ObjectStackObjectStack

Environment Package

Environment Package protocol schemas

Environment Package Installation Protocol

Models sys_package_installation — the pairing between an environment and a

specific, immutable package version snapshot (sys_package_version).

Key invariants (per ADR-0003):

  • One active version per package per environment at any time.

  • Upgrade = atomic UPDATE package_version_id to a newer version UUID.

  • Rollback = atomic UPDATE package_version_id to an older version UUID.

  • The upgradeHistory field is removed; history is tracked via the

sequence of package_version_id changes on this row (and an optional

sys_package_installation_history audit table).

  • Only status = 'published' versions may be installed in production

environments (draft/pre-release allowed in dev/sandbox with allowDraft).

Stored in the Control Plane DB (not in environment DBs).

See docs/adr/0003-package-as-first-class-citizen.md for the full rationale.

Source: packages/spec/src/cloud/environment-package.zod.ts

TypeScript Usage

import { EnvPackageStatus, EnvPackageStatusEnum, EnvironmentPackageInstallation, InstallPackageToEnvRequest, ListEnvPackagesResponse, RollbackEnvPackageRequest, UpgradeEnvPackageRequest } from '@objectstack/spec/cloud';
import type { EnvPackageStatus, EnvPackageStatusEnum, EnvironmentPackageInstallation, InstallPackageToEnvRequest, ListEnvPackagesResponse, RollbackEnvPackageRequest, UpgradeEnvPackageRequest } from '@objectstack/spec/cloud';

// Validate data
const result = EnvPackageStatus.parse(data);

EnvPackageStatus

Package installation status within an environment

Allowed Values

  • installed
  • installing
  • upgrading
  • disabled
  • error

EnvPackageStatusEnum

Package installation status within an environment

Allowed Values

  • installed
  • installing
  • upgrading
  • disabled
  • error

EnvironmentPackageInstallation

Package installation record in an environment (sys_package_installation)

Properties

PropertyTypeRequiredDescription
idstringUnique installation record ID
environmentIdstringEnvironment this installation belongs to
packageVersionIdstringUUID of the installed sys_package_version row
packageIdstringUUID of the parent sys_package row (denormalized for constraint enforcement)
statusEnum<'installed' | 'installing' | 'upgrading' | 'disabled' | 'error'>Package installation status within an environment
enabledbooleanWhether the package metadata is loaded
settingsRecord<string, any>optionalPer-installation configuration settings
installedAtstringInstallation timestamp (ISO-8601)
installedBystringoptionalUser ID of the installer
updatedAtstringoptionalLast update timestamp (ISO-8601)
errorMessagestringoptionalError message when status is error

InstallPackageToEnvRequest

Install a package version into a specific environment

Properties

PropertyTypeRequiredDescription
packageVersionIdstringoptionalExact package version UUID to install (preferred)
packageManifestIdstringoptionalPackage manifest ID (reverse-domain, e.g. com.acme.crm) — resolved to version UUID
versionstringoptionalVersion string (defaults to latest published)
allowDraftbooleanAllow installing a draft version (dev/sandbox envs only)
settingsRecord<string, any>optionalInstallation-time configuration settings
enableOnInstallbooleanActivate the package immediately after install
installedBystringoptionalUser ID of the installer

ListEnvPackagesResponse

List of packages installed in an environment

Properties

PropertyTypeRequiredDescription
packagesObject[]Packages installed in this environment
totalnumberTotal count

RollbackEnvPackageRequest

Roll back a package installation to a specific older version

Properties

PropertyTypeRequiredDescription
targetPackageVersionIdstringPackage version UUID to roll back to
rolledBackBystringoptionalUser ID performing the rollback

UpgradeEnvPackageRequest

Upgrade a package installation to a newer version

Properties

PropertyTypeRequiredDescription
targetPackageVersionIdstringoptionalTarget package version UUID (preferred)
targetVersionstringoptionalTarget version string (defaults to latest published)
allowDraftbooleanAllow upgrading to a draft version
upgradedBystringoptionalUser ID performing the upgrade

On this page