ObjectStackObjectStack

Environment Package

Environment Package protocol schemas

Environment Package Installation Protocol

Models sys_package_installation — the pairing between an Environment and a specific, immutable sys_package_version snapshot.

Key invariants (per ADR-0003):

  • One active version per package per environment at any time (UNIQUE (environment_id, package_id)).
  • Upgrade = atomic UPDATE package_version_id to a newer version UUID.
  • Rollback = atomic UPDATE package_version_id to an older version UUID.
  • 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 data-plane DBs).

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

TypeScript Usage

import { EnvironmentPackageInstallationSchema, EnvironmentPackageStatusSchema, InstallPackageToEnvironmentRequestSchema, ListEnvironmentPackagesResponseSchema, RollbackEnvironmentPackageRequestSchema, UpgradeEnvironmentPackageRequestSchema } from '@objectstack/spec/cloud';
import type { EnvironmentPackageInstallation, EnvironmentPackageStatus, InstallPackageToEnvironmentRequest, ListEnvironmentPackagesResponse, RollbackEnvironmentPackageRequest, UpgradeEnvironmentPackageRequest } from '@objectstack/spec/cloud';

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

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
withSampleDatabooleanReplay the package seed datasets on next kernel cold-start
installedAtstringInstallation timestamp (ISO-8601)
installedBystringoptionalUser ID of the installer
updatedAtstringoptionalLast update timestamp (ISO-8601)
errorMessagestringoptionalError message when status is error

EnvironmentPackageStatus

Package installation status within an environment

Allowed Values

  • installed
  • installing
  • upgrading
  • disabled
  • error

InstallPackageToEnvironmentRequest

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 environments only)
settingsRecord<string, any>optionalInstallation-time configuration settings
withSampleDatabooleanReplay the package seed datasets on next kernel cold-start
enableOnInstallbooleanActivate the package immediately after install
installedBystringoptionalUser ID of the installer

ListEnvironmentPackagesResponse

List of packages installed in an environment

Properties

PropertyTypeRequiredDescription
packages{ id: string; environmentId: string; packageVersionId: string; packageId: string; … }[]Packages installed in this environment
totalnumberTotal count

RollbackEnvironmentPackageRequest

Roll back a package installation to a specific older version

Properties

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

UpgradeEnvironmentPackageRequest

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