Skip to content

Commit b31af92

Browse files
committed
docs
1 parent 31d67d8 commit b31af92

4 files changed

Lines changed: 686 additions & 0 deletions

File tree

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
---
2+
title: Environment Package
3+
description: Environment Package protocol schemas
4+
---
5+
6+
{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs go in content/docs/guides/. */}
7+
8+
# Environment Package Installation Protocol
9+
10+
Models `sys_package_installation` — the pairing between an Environment and
11+
12+
a specific, immutable `sys_package_version` snapshot.
13+
14+
Key invariants (per ADR-0003):
15+
16+
- One active version per package per environment at any time
17+
18+
(UNIQUE `(environment_id, package_id)`).
19+
20+
- **Upgrade** = atomic `UPDATE package_version_id` to a newer version UUID.
21+
22+
- **Rollback** = atomic `UPDATE package_version_id` to an older version UUID.
23+
24+
- Only `status = 'published'` versions may be installed in production
25+
26+
environments (draft/pre-release allowed in dev/sandbox with `allowDraft`).
27+
28+
Stored in the **Control Plane DB** (not in environment data-plane DBs).
29+
30+
<Callout type="info">
31+
**Source:** `packages/spec/src/cloud/environment-package.zod.ts`
32+
</Callout>
33+
34+
## TypeScript Usage
35+
36+
```typescript
37+
import { EnvironmentPackageInstallation, EnvironmentPackageStatus, InstallPackageToEnvironmentRequest, ListEnvironmentPackagesResponse, RollbackEnvironmentPackageRequest, UpgradeEnvironmentPackageRequest } from '@objectstack/spec/cloud';
38+
import type { EnvironmentPackageInstallation, EnvironmentPackageStatus, InstallPackageToEnvironmentRequest, ListEnvironmentPackagesResponse, RollbackEnvironmentPackageRequest, UpgradeEnvironmentPackageRequest } from '@objectstack/spec/cloud';
39+
40+
// Validate data
41+
const result = EnvironmentPackageInstallation.parse(data);
42+
```
43+
44+
---
45+
46+
## EnvironmentPackageInstallation
47+
48+
Package installation record in an environment (sys_package_installation)
49+
50+
### Properties
51+
52+
| Property | Type | Required | Description |
53+
| :--- | :--- | :--- | :--- |
54+
| **id** | `string` || Unique installation record ID |
55+
| **environmentId** | `string` || Environment this installation belongs to |
56+
| **packageVersionId** | `string` || UUID of the installed sys_package_version row |
57+
| **packageId** | `string` || UUID of the parent sys_package row (denormalized for constraint enforcement) |
58+
| **status** | `Enum<'installed' \| 'installing' \| 'upgrading' \| 'disabled' \| 'error'>` || Package installation status within an environment |
59+
| **enabled** | `boolean` || Whether the package metadata is loaded |
60+
| **settings** | `Record<string, any>` | optional | Per-installation configuration settings |
61+
| **withSampleData** | `boolean` || Replay the package seed datasets on next kernel cold-start |
62+
| **installedAt** | `string` || Installation timestamp (ISO-8601) |
63+
| **installedBy** | `string` | optional | User ID of the installer |
64+
| **updatedAt** | `string` | optional | Last update timestamp (ISO-8601) |
65+
| **errorMessage** | `string` | optional | Error message when status is error |
66+
67+
68+
---
69+
70+
## EnvironmentPackageStatus
71+
72+
Package installation status within an environment
73+
74+
### Allowed Values
75+
76+
* `installed`
77+
* `installing`
78+
* `upgrading`
79+
* `disabled`
80+
* `error`
81+
82+
83+
---
84+
85+
## InstallPackageToEnvironmentRequest
86+
87+
Install a package version into a specific environment
88+
89+
### Properties
90+
91+
| Property | Type | Required | Description |
92+
| :--- | :--- | :--- | :--- |
93+
| **packageVersionId** | `string` | optional | Exact package version UUID to install (preferred) |
94+
| **packageManifestId** | `string` | optional | Package manifest ID (reverse-domain, e.g. com.acme.crm) — resolved to version UUID |
95+
| **version** | `string` | optional | Version string (defaults to latest published) |
96+
| **allowDraft** | `boolean` || Allow installing a draft version (dev/sandbox environments only) |
97+
| **settings** | `Record<string, any>` | optional | Installation-time configuration settings |
98+
| **withSampleData** | `boolean` || Replay the package seed datasets on next kernel cold-start |
99+
| **enableOnInstall** | `boolean` || Activate the package immediately after install |
100+
| **installedBy** | `string` | optional | User ID of the installer |
101+
102+
103+
---
104+
105+
## ListEnvironmentPackagesResponse
106+
107+
List of packages installed in an environment
108+
109+
### Properties
110+
111+
| Property | Type | Required | Description |
112+
| :--- | :--- | :--- | :--- |
113+
| **packages** | `Object[]` || Packages installed in this environment |
114+
| **total** | `number` || Total count |
115+
116+
117+
---
118+
119+
## RollbackEnvironmentPackageRequest
120+
121+
Roll back a package installation to a specific older version
122+
123+
### Properties
124+
125+
| Property | Type | Required | Description |
126+
| :--- | :--- | :--- | :--- |
127+
| **targetPackageVersionId** | `string` || Package version UUID to roll back to |
128+
| **rolledBackBy** | `string` | optional | User ID performing the rollback |
129+
130+
131+
---
132+
133+
## UpgradeEnvironmentPackageRequest
134+
135+
Upgrade a package installation to a newer version
136+
137+
### Properties
138+
139+
| Property | Type | Required | Description |
140+
| :--- | :--- | :--- | :--- |
141+
| **targetPackageVersionId** | `string` | optional | Target package version UUID (preferred) |
142+
| **targetVersion** | `string` | optional | Target version string (defaults to latest published) |
143+
| **allowDraft** | `boolean` || Allow upgrading to a draft version |
144+
| **upgradedBy** | `string` | optional | User ID performing the upgrade |
145+
146+
147+
---
148+

0 commit comments

Comments
 (0)