@alneas/eaos-server 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/LICENSE +21 -0
- package/README.ja.md +49 -0
- package/README.md +46 -2
- package/dist/agentic/agent-jobs.d.ts +333 -0
- package/dist/agentic/agent-jobs.js +15 -0
- package/dist/agentic/agent-jobs.js.map +1 -0
- package/dist/agentic/agent-node.d.ts +40 -0
- package/dist/agentic/agent-node.js +7 -0
- package/dist/agentic/agent-node.js.map +1 -0
- package/dist/agentic/agent-runner.d.ts +33 -0
- package/dist/agentic/agent-runner.js +7 -0
- package/dist/agentic/agent-runner.js.map +1 -0
- package/dist/agentic/ai-broker.d.ts +169 -0
- package/dist/agentic/ai-broker.js +8 -0
- package/dist/agentic/ai-broker.js.map +1 -0
- package/dist/agentic/atomic-checkpointer.d.ts +137 -0
- package/dist/agentic/atomic-checkpointer.js +9 -0
- package/dist/agentic/atomic-checkpointer.js.map +1 -0
- package/dist/agentic/autonomous-worker.d.ts +122 -0
- package/dist/agentic/autonomous-worker.js +10 -0
- package/dist/agentic/autonomous-worker.js.map +1 -0
- package/dist/agentic/event-bridge.d.ts +350 -0
- package/dist/agentic/event-bridge.js +9 -0
- package/dist/agentic/event-bridge.js.map +1 -0
- package/dist/agentic/executor.d.ts +91 -0
- package/dist/agentic/executor.js +12 -0
- package/dist/agentic/executor.js.map +1 -0
- package/dist/agentic/graph-projection.d.ts +119 -0
- package/dist/agentic/graph-projection.js +7 -0
- package/dist/agentic/graph-projection.js.map +1 -0
- package/dist/agentic/graph.d.ts +524 -0
- package/dist/agentic/graph.js +7 -0
- package/dist/agentic/graph.js.map +1 -0
- package/dist/agentic/index.d.ts +28 -0
- package/dist/agentic/index.js +87 -0
- package/dist/agentic/index.js.map +1 -0
- package/dist/agentic/local-runner.d.ts +106 -0
- package/dist/agentic/local-runner.js +7 -0
- package/dist/agentic/local-runner.js.map +1 -0
- package/dist/agentic/remote-executor.d.ts +67 -0
- package/dist/agentic/remote-executor.js +8 -0
- package/dist/agentic/remote-executor.js.map +1 -0
- package/dist/agentic/types.d.ts +157 -0
- package/dist/agentic/types.js +7 -0
- package/dist/agentic/types.js.map +1 -0
- package/dist/agentic/workflow-catalog.d.ts +152 -0
- package/dist/agentic/workflow-catalog.js +7 -0
- package/dist/agentic/workflow-catalog.js.map +1 -0
- package/dist/agentic/workflow-compiler.d.ts +44 -0
- package/dist/agentic/workflow-compiler.js +8 -0
- package/dist/agentic/workflow-compiler.js.map +1 -0
- package/dist/agentic/workflow-coordinator.d.ts +170 -0
- package/dist/agentic/workflow-coordinator.js +8 -0
- package/dist/agentic/workflow-coordinator.js.map +1 -0
- package/dist/agentic/workflow-manager.d.ts +91 -0
- package/dist/agentic/workflow-manager.js +7 -0
- package/dist/agentic/workflow-manager.js.map +1 -0
- package/dist/agentic/workflow-registry.d.ts +334 -0
- package/dist/agentic/workflow-registry.js +7 -0
- package/dist/agentic/workflow-registry.js.map +1 -0
- package/dist/artifacts-CteHmCMI.d.ts +614 -0
- package/dist/auth-hooks/api-key.d.ts +75 -0
- package/dist/auth-hooks/api-key.js +7 -0
- package/dist/auth-hooks/api-key.js.map +1 -0
- package/dist/auth-hooks/index.d.ts +80 -0
- package/dist/auth-hooks/index.js +28 -0
- package/dist/auth-hooks/index.js.map +1 -0
- package/dist/browser-auth/account-memberships.d.ts +213 -0
- package/dist/browser-auth/account-memberships.js +13 -0
- package/dist/browser-auth/account-memberships.js.map +1 -0
- package/dist/browser-auth/index.d.ts +8 -0
- package/dist/browser-auth/index.js +59 -0
- package/dist/browser-auth/index.js.map +1 -0
- package/dist/browser-auth/kratos-session.d.ts +37 -0
- package/dist/browser-auth/kratos-session.js +7 -0
- package/dist/browser-auth/kratos-session.js.map +1 -0
- package/dist/browser-auth/platform-session.d.ts +120 -0
- package/dist/browser-auth/platform-session.js +7 -0
- package/dist/browser-auth/platform-session.js.map +1 -0
- package/dist/browser-auth/public-memberships.d.ts +22 -0
- package/dist/browser-auth/public-memberships.js +7 -0
- package/dist/browser-auth/public-memberships.js.map +1 -0
- package/dist/cache/index.d.ts +181 -0
- package/dist/cache/index.js +197 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/chunk-32746UQZ.js +131 -0
- package/dist/chunk-32746UQZ.js.map +1 -0
- package/dist/chunk-3NLSWP2Y.js +223 -0
- package/dist/chunk-3NLSWP2Y.js.map +1 -0
- package/dist/chunk-3P4XTTQH.js +346 -0
- package/dist/chunk-3P4XTTQH.js.map +1 -0
- package/dist/chunk-3VITSHN3.js +15 -0
- package/dist/chunk-3VITSHN3.js.map +1 -0
- package/dist/chunk-46UWPEW2.js +226 -0
- package/dist/chunk-46UWPEW2.js.map +1 -0
- package/dist/chunk-4BARRLJR.js +180 -0
- package/dist/chunk-4BARRLJR.js.map +1 -0
- package/dist/chunk-4VORUFKR.js +45 -0
- package/dist/chunk-4VORUFKR.js.map +1 -0
- package/dist/chunk-55D4ERWO.js +1 -0
- package/dist/chunk-55D4ERWO.js.map +1 -0
- package/dist/chunk-5TBBZIND.js +18 -0
- package/dist/chunk-5TBBZIND.js.map +1 -0
- package/dist/chunk-5WOZWPZA.js +211 -0
- package/dist/chunk-5WOZWPZA.js.map +1 -0
- package/dist/chunk-6CBVZ6CT.js +168 -0
- package/dist/chunk-6CBVZ6CT.js.map +1 -0
- package/dist/chunk-6XZXYNJR.js +74 -0
- package/dist/chunk-6XZXYNJR.js.map +1 -0
- package/dist/chunk-753HWDSC.js +222 -0
- package/dist/chunk-753HWDSC.js.map +1 -0
- package/dist/chunk-7AHSS7SO.js +81 -0
- package/dist/chunk-7AHSS7SO.js.map +1 -0
- package/dist/chunk-7FTJN4SA.js +1 -0
- package/dist/chunk-7FTJN4SA.js.map +1 -0
- package/dist/chunk-AVDMLTPF.js +24 -0
- package/dist/chunk-AVDMLTPF.js.map +1 -0
- package/dist/chunk-BKAHUEIT.js +95 -0
- package/dist/chunk-BKAHUEIT.js.map +1 -0
- package/dist/chunk-CJ7OFEF7.js +134 -0
- package/dist/chunk-CJ7OFEF7.js.map +1 -0
- package/dist/chunk-EJKWDZIU.js +111 -0
- package/dist/chunk-EJKWDZIU.js.map +1 -0
- package/dist/chunk-F2J6IQ6I.js +247 -0
- package/dist/chunk-F2J6IQ6I.js.map +1 -0
- package/dist/chunk-F3O7CELI.js +23 -0
- package/dist/chunk-F3O7CELI.js.map +1 -0
- package/dist/chunk-F4IITPGX.js +221 -0
- package/dist/chunk-F4IITPGX.js.map +1 -0
- package/dist/chunk-FD6VC2NA.js +66 -0
- package/dist/chunk-FD6VC2NA.js.map +1 -0
- package/dist/chunk-FRRRWAHO.js +14 -0
- package/dist/chunk-FRRRWAHO.js.map +1 -0
- package/dist/chunk-HCKAGLLB.js +17 -0
- package/dist/chunk-HCKAGLLB.js.map +1 -0
- package/dist/chunk-HVC7FG6B.js +191 -0
- package/dist/chunk-HVC7FG6B.js.map +1 -0
- package/dist/chunk-HXFVOR7Z.js +496 -0
- package/dist/chunk-HXFVOR7Z.js.map +1 -0
- package/dist/chunk-IJWYS2PF.js +122 -0
- package/dist/chunk-IJWYS2PF.js.map +1 -0
- package/dist/chunk-INCHXAFK.js +1395 -0
- package/dist/chunk-INCHXAFK.js.map +1 -0
- package/dist/chunk-JT6BRGQM.js +1 -0
- package/dist/chunk-JT6BRGQM.js.map +1 -0
- package/dist/chunk-L6PMAEMB.js +115 -0
- package/dist/chunk-L6PMAEMB.js.map +1 -0
- package/dist/chunk-LOUGW6MU.js +126 -0
- package/dist/chunk-LOUGW6MU.js.map +1 -0
- package/dist/chunk-LYPZPE53.js +129 -0
- package/dist/chunk-LYPZPE53.js.map +1 -0
- package/dist/chunk-NNCCN7JP.js +186 -0
- package/dist/chunk-NNCCN7JP.js.map +1 -0
- package/dist/chunk-PBC3MZUL.js +212 -0
- package/dist/chunk-PBC3MZUL.js.map +1 -0
- package/dist/chunk-R4ADP2DC.js +20 -0
- package/dist/chunk-R4ADP2DC.js.map +1 -0
- package/dist/chunk-RHN4Y6VS.js +44 -0
- package/dist/chunk-RHN4Y6VS.js.map +1 -0
- package/dist/chunk-SDJNYPYK.js +770 -0
- package/dist/chunk-SDJNYPYK.js.map +1 -0
- package/dist/chunk-UGNTCOVR.js +28 -0
- package/dist/chunk-UGNTCOVR.js.map +1 -0
- package/dist/chunk-VC2PCK2S.js +31 -0
- package/dist/chunk-VC2PCK2S.js.map +1 -0
- package/dist/chunk-VF5YDZJC.js +305 -0
- package/dist/chunk-VF5YDZJC.js.map +1 -0
- package/dist/chunk-VISRDVTK.js +675 -0
- package/dist/chunk-VISRDVTK.js.map +1 -0
- package/dist/chunk-W6O3LVBY.js +102 -0
- package/dist/chunk-W6O3LVBY.js.map +1 -0
- package/dist/chunk-WFEAKJLR.js +47 -0
- package/dist/chunk-WFEAKJLR.js.map +1 -0
- package/dist/chunk-XIEY2OF4.js +67 -0
- package/dist/chunk-XIEY2OF4.js.map +1 -0
- package/dist/chunk-XITLHDG3.js +37 -0
- package/dist/chunk-XITLHDG3.js.map +1 -0
- package/dist/chunk-XMWPYZWZ.js +61 -0
- package/dist/chunk-XMWPYZWZ.js.map +1 -0
- package/dist/chunk-XUP6CNOM.js +34 -0
- package/dist/chunk-XUP6CNOM.js.map +1 -0
- package/dist/chunk-YABTQZDJ.js +25 -0
- package/dist/chunk-YABTQZDJ.js.map +1 -0
- package/dist/chunk-YMHVRBUU.js +199 -0
- package/dist/chunk-YMHVRBUU.js.map +1 -0
- package/dist/chunk-YMJ7BRKU.js +510 -0
- package/dist/chunk-YMJ7BRKU.js.map +1 -0
- package/dist/chunk-ZC3XWU7B.js +28 -0
- package/dist/chunk-ZC3XWU7B.js.map +1 -0
- package/dist/chunk-ZHMTD5KV.js +90 -0
- package/dist/chunk-ZHMTD5KV.js.map +1 -0
- package/dist/chunk-ZWZDLOE7.js +160 -0
- package/dist/chunk-ZWZDLOE7.js.map +1 -0
- package/dist/db-package/db/local-first-sqlite-adapter.d.ts +432 -0
- package/dist/db-package/db/local-first-sqlite-adapter.js +7 -0
- package/dist/db-package/db/local-first-sqlite-adapter.js.map +1 -0
- package/dist/db-package/index.d.ts +7 -0
- package/dist/db-package/index.js +16 -0
- package/dist/db-package/index.js.map +1 -0
- package/dist/db-package/migration/aggregator.d.ts +86 -0
- package/dist/db-package/migration/aggregator.js +7 -0
- package/dist/db-package/migration/aggregator.js.map +1 -0
- package/dist/db-package/migration/index.d.ts +3 -0
- package/dist/db-package/migration/index.js +8 -0
- package/dist/db-package/migration/index.js.map +1 -0
- package/dist/engine.d.ts +205 -0
- package/dist/engine.js +20 -0
- package/dist/engine.js.map +1 -0
- package/dist/entitlements/index.d.ts +313 -0
- package/dist/entitlements/index.js +23 -0
- package/dist/entitlements/index.js.map +1 -0
- package/dist/execution/chat.d.ts +7 -0
- package/dist/execution/chat.js +7 -0
- package/dist/execution/chat.js.map +1 -0
- package/dist/execution/index.d.ts +342 -0
- package/dist/execution/index.js +66 -0
- package/dist/execution/index.js.map +1 -0
- package/dist/execution/tool-agent.d.ts +7 -0
- package/dist/execution/tool-agent.js +8 -0
- package/dist/execution/tool-agent.js.map +1 -0
- package/dist/extensions/index.d.ts +172 -0
- package/dist/extensions/index.js +95 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/health/index.d.ts +35 -0
- package/dist/health/index.js +7 -0
- package/dist/health/index.js.map +1 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.js +161 -0
- package/dist/index.js.map +1 -0
- package/dist/lifecycle/index.d.ts +133 -0
- package/dist/lifecycle/index.js +13 -0
- package/dist/lifecycle/index.js.map +1 -0
- package/dist/lifecycle-engine/backend-migration.d.ts +2 -0
- package/dist/lifecycle-engine/backend-migration.js +11 -0
- package/dist/lifecycle-engine/backend-migration.js.map +1 -0
- package/dist/lifecycle-engine/baseline.d.ts +2 -0
- package/dist/lifecycle-engine/baseline.js +9 -0
- package/dist/lifecycle-engine/baseline.js.map +1 -0
- package/dist/lifecycle-engine/index.d.ts +1497 -0
- package/dist/lifecycle-engine/index.js +41 -0
- package/dist/lifecycle-engine/index.js.map +1 -0
- package/dist/lifecycle-engine/platform/artifacts.d.ts +4 -0
- package/dist/lifecycle-engine/platform/artifacts.js +7 -0
- package/dist/lifecycle-engine/platform/artifacts.js.map +1 -0
- package/dist/lifecycle-engine/platform/control-plane.d.ts +12 -0
- package/dist/lifecycle-engine/platform/control-plane.js +2 -0
- package/dist/lifecycle-engine/platform/control-plane.js.map +1 -0
- package/dist/lifecycle-engine/platform/database-router.d.ts +118 -0
- package/dist/lifecycle-engine/platform/database-router.js +7 -0
- package/dist/lifecycle-engine/platform/database-router.js.map +1 -0
- package/dist/lifecycle-engine/platform/deployment-placements.d.ts +464 -0
- package/dist/lifecycle-engine/platform/deployment-placements.js +16 -0
- package/dist/lifecycle-engine/platform/deployment-placements.js.map +1 -0
- package/dist/lifecycle-engine/platform/deployment.d.ts +4 -0
- package/dist/lifecycle-engine/platform/deployment.js +17 -0
- package/dist/lifecycle-engine/platform/deployment.js.map +1 -0
- package/dist/lifecycle-engine/platform/index.d.ts +737 -0
- package/dist/lifecycle-engine/platform/index.js +60 -0
- package/dist/lifecycle-engine/platform/index.js.map +1 -0
- package/dist/lifecycle-engine/platform/runtime.d.ts +80 -0
- package/dist/lifecycle-engine/platform/runtime.js +11 -0
- package/dist/lifecycle-engine/platform/runtime.js.map +1 -0
- package/dist/lifecycle-engine/platform/site-publication.d.ts +102 -0
- package/dist/lifecycle-engine/platform/site-publication.js +7 -0
- package/dist/lifecycle-engine/platform/site-publication.js.map +1 -0
- package/dist/lifecycle-engine/platform/user-directory.d.ts +139 -0
- package/dist/lifecycle-engine/platform/user-directory.js +13 -0
- package/dist/lifecycle-engine/platform/user-directory.js.map +1 -0
- package/dist/mcp.d.ts +92 -0
- package/dist/mcp.js +10 -0
- package/dist/mcp.js.map +1 -0
- package/dist/middleware/auth.d.ts +118 -0
- package/dist/middleware/auth.js +7 -0
- package/dist/middleware/auth.js.map +1 -0
- package/dist/middleware/error-handler.d.ts +35 -0
- package/dist/middleware/error-handler.js +7 -0
- package/dist/middleware/error-handler.js.map +1 -0
- package/dist/middleware/module-guard.d.ts +33 -0
- package/dist/middleware/module-guard.js +7 -0
- package/dist/middleware/module-guard.js.map +1 -0
- package/dist/platform-admin/index.d.ts +37 -0
- package/dist/platform-admin/index.js +11 -0
- package/dist/platform-admin/index.js.map +1 -0
- package/dist/platform-admin/store.d.ts +346 -0
- package/dist/platform-admin/store.js +7 -0
- package/dist/platform-admin/store.js.map +1 -0
- package/dist/plugin-data/annotations.d.ts +6 -0
- package/dist/plugin-data/annotations.js +12 -0
- package/dist/plugin-data/annotations.js.map +1 -0
- package/dist/plugin-data/atomic-context.d.ts +41 -0
- package/dist/plugin-data/atomic-context.js +9 -0
- package/dist/plugin-data/atomic-context.js.map +1 -0
- package/dist/plugin-data/atomic.d.ts +6 -0
- package/dist/plugin-data/atomic.js +26 -0
- package/dist/plugin-data/atomic.js.map +1 -0
- package/dist/plugin-data/audit.d.ts +6 -0
- package/dist/plugin-data/audit.js +12 -0
- package/dist/plugin-data/audit.js.map +1 -0
- package/dist/plugin-data/commands.d.ts +6 -0
- package/dist/plugin-data/commands.js +8 -0
- package/dist/plugin-data/commands.js.map +1 -0
- package/dist/plugin-data/composite.d.ts +6 -0
- package/dist/plugin-data/composite.js +8 -0
- package/dist/plugin-data/composite.js.map +1 -0
- package/dist/plugin-data/delivery.d.ts +6 -0
- package/dist/plugin-data/delivery.js +16 -0
- package/dist/plugin-data/delivery.js.map +1 -0
- package/dist/plugin-data/index.d.ts +2798 -0
- package/dist/plugin-data/index.js +102 -0
- package/dist/plugin-data/index.js.map +1 -0
- package/dist/plugin-data/json-documents.d.ts +6 -0
- package/dist/plugin-data/json-documents.js +16 -0
- package/dist/plugin-data/json-documents.js.map +1 -0
- package/dist/plugin-data/outbox.d.ts +6 -0
- package/dist/plugin-data/outbox.js +16 -0
- package/dist/plugin-data/outbox.js.map +1 -0
- package/dist/plugin-data/scoped-records.d.ts +6 -0
- package/dist/plugin-data/scoped-records.js +10 -0
- package/dist/plugin-data/scoped-records.js.map +1 -0
- package/dist/plugin-sdk.d.ts +41 -0
- package/dist/plugin-sdk.js +10 -0
- package/dist/plugin-sdk.js.map +1 -0
- package/dist/sql-lifecycle/index.d.ts +138 -0
- package/dist/sql-lifecycle/index.js +167 -0
- package/dist/sql-lifecycle/index.js.map +1 -0
- package/dist/storage/index.d.ts +2 -0
- package/dist/storage/index.js +13 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/s3-compatible.d.ts +139 -0
- package/dist/storage/s3-compatible.js +11 -0
- package/dist/storage/s3-compatible.js.map +1 -0
- package/dist/tenant.d.ts +108 -0
- package/dist/tenant.js +9 -0
- package/dist/tenant.js.map +1 -0
- package/dist/workspace-context.d.ts +119 -0
- package/dist/workspace-context.js +9 -0
- package/dist/workspace-context.js.map +1 -0
- package/docs/api.md +30560 -0
- package/docs/db/README.md +49 -0
- package/docs/db/docs/api.md +1613 -0
- package/docs/db/docs/guide.md +47 -0
- package/docs/entitlements.md +60 -0
- package/docs/guide.md +92 -0
- package/docs/index.md +57 -0
- package/docs/ja/db/README.md +46 -0
- package/docs/ja/db/docs/guide.md +53 -0
- package/docs/ja/guide.md +46 -0
- package/docs/ja/lifecycle/README.md +46 -0
- package/docs/ja/lifecycle/docs/guide.md +45 -0
- package/docs/ja/storage/README.md +46 -0
- package/docs/ja/storage/docs/guide.md +43 -0
- package/docs/lifecycle/README.md +49 -0
- package/docs/lifecycle/docs/api.md +3770 -0
- package/docs/lifecycle/docs/baseline.md +50 -0
- package/docs/lifecycle/docs/guide.md +47 -0
- package/docs/storage/README.md +49 -0
- package/docs/storage/docs/api.md +470 -0
- package/docs/storage/docs/guide.md +47 -0
- package/package.json +354 -4
|
@@ -0,0 +1,3770 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@alneas/eaos-server API"
|
|
3
|
+
description: "@alneas/eaos-server API: source-derived declarations, parameter tables, return types and public import examples."
|
|
4
|
+
sidebar:
|
|
5
|
+
order: 30
|
|
6
|
+
archetype: "reference"
|
|
7
|
+
project: "eaos-workspace"
|
|
8
|
+
tags: ["api", "generated"]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<!-- Generated by scripts/generate-public-api.ts from built source declarations. Edit source JSDoc/types and regenerate; do not edit these cards. -->
|
|
12
|
+
|
|
13
|
+
# @alneas/eaos-server API
|
|
14
|
+
|
|
15
|
+
## Public entrypoints
|
|
16
|
+
|
|
17
|
+
| Import | Contract |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| `@alneas/eaos-server/lifecycle-engine/backend-migration` | Typed public export |
|
|
20
|
+
| `@alneas/eaos-server/lifecycle-engine` | Typed public export |
|
|
21
|
+
| `@alneas/eaos-server/lifecycle-engine/baseline` | Typed public export |
|
|
22
|
+
|
|
23
|
+
<a id="api-assertBackendMigrationCutover"></a>
|
|
24
|
+
|
|
25
|
+
## [FUNCTION] `assertBackendMigrationCutover`
|
|
26
|
+
|
|
27
|
+
Validates matching verification and a source-retaining cutover receipt for the target backend.
|
|
28
|
+
|
|
29
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`, `@alneas/eaos-server/lifecycle-engine/backend-migration`.
|
|
30
|
+
|
|
31
|
+
### Signature
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
declare function assertBackendMigrationCutover(plan: BackendMigrationPlan, report: BackendMigrationVerificationReport, cutover: BackendMigrationCutover): BackendMigrationCutover;
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Parameters
|
|
38
|
+
|
|
39
|
+
| Name | Type | Required | Description |
|
|
40
|
+
| --- | --- | --- | --- |
|
|
41
|
+
| `plan` | `BackendMigrationPlan` | Yes | Reviewed backend migration plan. |
|
|
42
|
+
| `report` | `BackendMigrationVerificationReport` | Yes | Passed host verification matching the plan. |
|
|
43
|
+
| `cutover` | `BackendMigrationCutover` | Yes | Host routing receipt with nonnegative routing revision and parseable cutover timestamp. |
|
|
44
|
+
|
|
45
|
+
### Returns
|
|
46
|
+
|
|
47
|
+
`BackendMigrationCutover`
|
|
48
|
+
|
|
49
|
+
The original cutover object; no routing mutation occurs.
|
|
50
|
+
|
|
51
|
+
### Remarks
|
|
52
|
+
|
|
53
|
+
This is evidence shape validation, not independent copy verification or authority to switch a tenant.
|
|
54
|
+
|
|
55
|
+
### Errors and rejections
|
|
56
|
+
|
|
57
|
+
Error for invalid verification, mismatched target/migration, missing source-retention claim or invalid revision/time.
|
|
58
|
+
|
|
59
|
+
### Example
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
import { assertBackendMigrationCutover, type BackendMigrationPlan, type BackendMigrationVerificationReport, type BackendMigrationCutover } from '@alneas/eaos-server/lifecycle-engine/backend-migration';
|
|
63
|
+
export function inspectCutover(plan: BackendMigrationPlan, report: BackendMigrationVerificationReport, receipt: BackendMigrationCutover) { return assertBackendMigrationCutover(plan, report, receipt); }
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
<a id="api-assertBackendMigrationVerification"></a>
|
|
68
|
+
|
|
69
|
+
## [FUNCTION] `assertBackendMigrationVerification`
|
|
70
|
+
|
|
71
|
+
Checks that a reported migration verification matches its plan and contains only matched in-scope records.
|
|
72
|
+
|
|
73
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`, `@alneas/eaos-server/lifecycle-engine/backend-migration`.
|
|
74
|
+
|
|
75
|
+
### Signature
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
declare function assertBackendMigrationVerification(plan: BackendMigrationPlan, report: BackendMigrationVerificationReport): BackendMigrationVerificationReport;
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Parameters
|
|
82
|
+
|
|
83
|
+
| Name | Type | Required | Description |
|
|
84
|
+
| --- | --- | --- | --- |
|
|
85
|
+
| `plan` | `BackendMigrationPlan` | Yes | Reviewed backend migration plan. |
|
|
86
|
+
| `report` | `BackendMigrationVerificationReport` | Yes | Host report claiming passed verification for the plan's source and target. |
|
|
87
|
+
|
|
88
|
+
### Returns
|
|
89
|
+
|
|
90
|
+
`BackendMigrationVerificationReport`
|
|
91
|
+
|
|
92
|
+
The original report when accepted; it is neither cloned nor independently measured.
|
|
93
|
+
|
|
94
|
+
### Remarks
|
|
95
|
+
|
|
96
|
+
Validates nonempty records and nonnegative revisions, but does not prove exhaustive tenant/plugin coverage or equal source/target revision numbers. The host owns verification completeness and truth.
|
|
97
|
+
|
|
98
|
+
### Errors and rejections
|
|
99
|
+
|
|
100
|
+
Error for mismatched identities, invalid timestamp/revisions, out-of-scope records or unpassed/unmatched evidence.
|
|
101
|
+
|
|
102
|
+
### Example
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
import { assertBackendMigrationVerification, type BackendMigrationPlan, type BackendMigrationVerificationReport } from '@alneas/eaos-server/lifecycle-engine/backend-migration';
|
|
106
|
+
export function inspectVerification(plan: BackendMigrationPlan, report: BackendMigrationVerificationReport) { return assertBackendMigrationVerification(plan, report); }
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
<a id="api-assertDataContractBinding"></a>
|
|
111
|
+
|
|
112
|
+
## [FUNCTION] `assertDataContractBinding`
|
|
113
|
+
|
|
114
|
+
Compatibility re-export; its implementation and documentation are owned by the owning package ``.
|
|
115
|
+
|
|
116
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
117
|
+
|
|
118
|
+
### Signature
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
declare function assertDataContractBinding(catalog: DataContractCatalog, binding: DataContractBinding): void;
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Parameters
|
|
125
|
+
|
|
126
|
+
| Name | Type | Required | Description |
|
|
127
|
+
| --- | --- | --- | --- |
|
|
128
|
+
| `catalog` | `DataContractCatalog` | Yes | See the upstream owning declaration. |
|
|
129
|
+
| `binding` | `DataContractBinding` | Yes | See the upstream owning declaration. |
|
|
130
|
+
|
|
131
|
+
### Returns
|
|
132
|
+
|
|
133
|
+
`void`
|
|
134
|
+
|
|
135
|
+
### Example
|
|
136
|
+
|
|
137
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
138
|
+
|
|
139
|
+
<a id="api-assertJsonDocumentContracts"></a>
|
|
140
|
+
|
|
141
|
+
## [FUNCTION] `assertJsonDocumentContracts`
|
|
142
|
+
|
|
143
|
+
Compatibility re-export; its implementation and documentation are owned by the owning package ``.
|
|
144
|
+
|
|
145
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
146
|
+
|
|
147
|
+
### Signature
|
|
148
|
+
|
|
149
|
+
```typescript
|
|
150
|
+
declare function assertJsonDocumentContracts(documents: readonly JsonDocumentContract[], tables: ReadonlyMap<string, Record<string, unknown>>): void;
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Parameters
|
|
154
|
+
|
|
155
|
+
| Name | Type | Required | Description |
|
|
156
|
+
| --- | --- | --- | --- |
|
|
157
|
+
| `documents` | `readonly JsonDocumentContract[]` | Yes | See the upstream owning declaration. |
|
|
158
|
+
| `tables` | `ReadonlyMap<string, Record<string, unknown>>` | Yes | See the upstream owning declaration. |
|
|
159
|
+
|
|
160
|
+
### Returns
|
|
161
|
+
|
|
162
|
+
`void`
|
|
163
|
+
|
|
164
|
+
### Example
|
|
165
|
+
|
|
166
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
167
|
+
|
|
168
|
+
<a id="api-BackendMigrationCutover"></a>
|
|
169
|
+
|
|
170
|
+
## [INTERFACE] `BackendMigrationCutover`
|
|
171
|
+
|
|
172
|
+
Host-reported routing switch retaining the original database for recovery.
|
|
173
|
+
|
|
174
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`, `@alneas/eaos-server/lifecycle-engine/backend-migration`.
|
|
175
|
+
|
|
176
|
+
### Signature
|
|
177
|
+
|
|
178
|
+
```typescript
|
|
179
|
+
interface BackendMigrationCutover {
|
|
180
|
+
migrationId: string;
|
|
181
|
+
targetBackendId: string;
|
|
182
|
+
routingRevision: number;
|
|
183
|
+
cutoverAt: string;
|
|
184
|
+
sourceRetained: true;
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Parameters
|
|
189
|
+
|
|
190
|
+
| Name | Type | Required | Description |
|
|
191
|
+
| --- | --- | --- | --- |
|
|
192
|
+
| `migrationId` | `string` | Yes | Plan migration identity. |
|
|
193
|
+
| `targetBackendId` | `string` | Yes | Exact reviewed target backend. |
|
|
194
|
+
| `routingRevision` | `number` | Yes | Nonnegative safe routing revision after cutover. |
|
|
195
|
+
| `cutoverAt` | `string` | Yes | Parseable routing-switch timestamp. |
|
|
196
|
+
| `sourceRetained` | `true` | Yes | Must be true; destructive source cleanup is outside this contract. |
|
|
197
|
+
|
|
198
|
+
### Returns
|
|
199
|
+
|
|
200
|
+
Type declaration; no runtime value.
|
|
201
|
+
|
|
202
|
+
### See also
|
|
203
|
+
|
|
204
|
+
planBackendMigration for canonical integration usage.
|
|
205
|
+
|
|
206
|
+
### Public members
|
|
207
|
+
|
|
208
|
+
#### `migrationId`
|
|
209
|
+
|
|
210
|
+
Plan migration identity.
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
#### `targetBackendId`
|
|
214
|
+
|
|
215
|
+
Exact reviewed target backend.
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
#### `routingRevision`
|
|
219
|
+
|
|
220
|
+
Nonnegative safe routing revision after cutover.
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
#### `cutoverAt`
|
|
224
|
+
|
|
225
|
+
Parseable routing-switch timestamp.
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
#### `sourceRetained`
|
|
229
|
+
|
|
230
|
+
Must be true; destructive source cleanup is outside this contract.
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
### Example
|
|
235
|
+
|
|
236
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
237
|
+
|
|
238
|
+
<a id="api-BackendMigrationExecutor"></a>
|
|
239
|
+
|
|
240
|
+
## [INTERFACE] `BackendMigrationExecutor`
|
|
241
|
+
|
|
242
|
+
Host-owned migration phases operating on real adapters and retained source storage.
|
|
243
|
+
|
|
244
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`, `@alneas/eaos-server/lifecycle-engine/backend-migration`.
|
|
245
|
+
|
|
246
|
+
### Signature
|
|
247
|
+
|
|
248
|
+
```typescript
|
|
249
|
+
interface BackendMigrationExecutor {
|
|
250
|
+
prepare(plan: BackendMigrationPlan): Promise<void>;
|
|
251
|
+
copy(plan: BackendMigrationPlan): Promise<void>;
|
|
252
|
+
verify(plan: BackendMigrationPlan): Promise<BackendMigrationVerificationReport>;
|
|
253
|
+
cutover(plan: BackendMigrationPlan, verification: BackendMigrationVerificationReport): Promise<BackendMigrationCutover>;
|
|
254
|
+
}
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Parameters
|
|
258
|
+
|
|
259
|
+
| Name | Type | Required | Description |
|
|
260
|
+
| --- | --- | --- | --- |
|
|
261
|
+
| `prepare` | `Promise<void>` | Yes | Provision/adopt the reviewed target and establish quiescence without deleting source data. |
|
|
262
|
+
| `copy` | `Promise<void>` | Yes | Copy the scoped tenant/plugin data into the target and retain source state. |
|
|
263
|
+
| `verify` | `Promise<BackendMigrationVerificationReport>` | Yes | Produce nonempty exhaustive host match evidence for the plan's scope. |
|
|
264
|
+
| `cutover` | `Promise<BackendMigrationCutover>` | Yes | Switch routing only after valid verification, retaining source and returning a cutover receipt. |
|
|
265
|
+
|
|
266
|
+
### Returns
|
|
267
|
+
|
|
268
|
+
Type declaration; no runtime value.
|
|
269
|
+
|
|
270
|
+
### See also
|
|
271
|
+
|
|
272
|
+
planBackendMigration for canonical integration usage.
|
|
273
|
+
|
|
274
|
+
### Public members
|
|
275
|
+
|
|
276
|
+
#### `prepare`
|
|
277
|
+
|
|
278
|
+
Provision/adopt the reviewed target and establish quiescence without deleting source data.
|
|
279
|
+
|
|
280
|
+
Parameters:
|
|
281
|
+
|
|
282
|
+
- `plan`: Reviewed unmodified backend migration plan; host must preserve quiescence and source data.
|
|
283
|
+
|
|
284
|
+
Returns: Resolves without a value after target preparation and required quiescence.
|
|
285
|
+
|
|
286
|
+
### Errors and rejections
|
|
287
|
+
|
|
288
|
+
Host adapter or callback failures reject the returned Promise; side effects may already be partially complete.
|
|
289
|
+
|
|
290
|
+
Example:
|
|
291
|
+
|
|
292
|
+
```typescript
|
|
293
|
+
import type { BackendMigrationExecutor, BackendMigrationPlan } from '@alneas/eaos-server/lifecycle-engine';
|
|
294
|
+
export async function prepareReviewed(executor: BackendMigrationExecutor, plan: BackendMigrationPlan) {
|
|
295
|
+
// The host approves exact targets and serializes migration writers.
|
|
296
|
+
await executor.prepare(plan);
|
|
297
|
+
}
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
#### `copy`
|
|
302
|
+
|
|
303
|
+
Copy the scoped tenant/plugin data into the target and retain source state.
|
|
304
|
+
|
|
305
|
+
Parameters:
|
|
306
|
+
|
|
307
|
+
- `plan`: Reviewed unmodified backend migration plan; host must preserve quiescence and source data.
|
|
308
|
+
|
|
309
|
+
Returns: Resolves without a value after the scoped copy completes, with source retained.
|
|
310
|
+
|
|
311
|
+
### Errors and rejections
|
|
312
|
+
|
|
313
|
+
Host adapter or callback failures reject the returned Promise; side effects may already be partially complete.
|
|
314
|
+
|
|
315
|
+
Example:
|
|
316
|
+
|
|
317
|
+
```typescript
|
|
318
|
+
import type { BackendMigrationExecutor, BackendMigrationPlan } from '@alneas/eaos-server/lifecycle-engine';
|
|
319
|
+
export async function copyReviewed(executor: BackendMigrationExecutor, plan: BackendMigrationPlan) {
|
|
320
|
+
// The host approves exact targets and serializes migration writers.
|
|
321
|
+
await executor.copy(plan);
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
#### `verify`
|
|
327
|
+
|
|
328
|
+
Produce nonempty exhaustive host match evidence for the plan's scope.
|
|
329
|
+
|
|
330
|
+
Parameters:
|
|
331
|
+
|
|
332
|
+
- `plan`: Reviewed unmodified backend migration plan; host must preserve quiescence and source data.
|
|
333
|
+
|
|
334
|
+
Returns: The host verification report; caller must check it against the reviewed plan.
|
|
335
|
+
|
|
336
|
+
### Errors and rejections
|
|
337
|
+
|
|
338
|
+
Host adapter or callback failures reject the returned Promise; side effects may already be partially complete.
|
|
339
|
+
|
|
340
|
+
Example:
|
|
341
|
+
|
|
342
|
+
```typescript
|
|
343
|
+
import type { BackendMigrationExecutor, BackendMigrationPlan } from '@alneas/eaos-server/lifecycle-engine';
|
|
344
|
+
export async function verifyReviewed(executor: BackendMigrationExecutor, plan: BackendMigrationPlan) {
|
|
345
|
+
// The host approves exact targets and serializes migration writers.
|
|
346
|
+
return executor.verify(plan);
|
|
347
|
+
}
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
#### `cutover`
|
|
352
|
+
|
|
353
|
+
Switch routing only after valid verification, retaining source and returning a cutover receipt.
|
|
354
|
+
|
|
355
|
+
Parameters:
|
|
356
|
+
|
|
357
|
+
- `plan`: Reviewed unmodified backend migration plan; host must preserve quiescence and source data.
|
|
358
|
+
- `verification`: Matching passed host verification report; establish complete copy coverage before cutover.
|
|
359
|
+
|
|
360
|
+
Returns: A source-retaining routing cutover receipt after accepted verification.
|
|
361
|
+
|
|
362
|
+
### Errors and rejections
|
|
363
|
+
|
|
364
|
+
Host adapter or callback failures reject the returned Promise; side effects may already be partially complete.
|
|
365
|
+
|
|
366
|
+
Example:
|
|
367
|
+
|
|
368
|
+
```typescript
|
|
369
|
+
import type { BackendMigrationExecutor, BackendMigrationPlan, BackendMigrationVerificationReport } from '@alneas/eaos-server/lifecycle-engine';
|
|
370
|
+
export async function cutoverReviewed(executor: BackendMigrationExecutor, plan: BackendMigrationPlan, verification: BackendMigrationVerificationReport) {
|
|
371
|
+
// Supply current, successful evidence for this exact reviewed plan.
|
|
372
|
+
return executor.cutover(plan, verification);
|
|
373
|
+
}
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
### Example
|
|
379
|
+
|
|
380
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
381
|
+
|
|
382
|
+
<a id="api-BackendMigrationPlan"></a>
|
|
383
|
+
|
|
384
|
+
## [INTERFACE] `BackendMigrationPlan`
|
|
385
|
+
|
|
386
|
+
Deterministic five-phase non-destructive data migration plan.
|
|
387
|
+
|
|
388
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`, `@alneas/eaos-server/lifecycle-engine/backend-migration`.
|
|
389
|
+
|
|
390
|
+
### Signature
|
|
391
|
+
|
|
392
|
+
```typescript
|
|
393
|
+
interface BackendMigrationPlan {
|
|
394
|
+
format: 1;
|
|
395
|
+
id: string;
|
|
396
|
+
request: BackendMigrationRequest;
|
|
397
|
+
phases: readonly [
|
|
398
|
+
'prepare',
|
|
399
|
+
'copy',
|
|
400
|
+
'verify',
|
|
401
|
+
'cutover',
|
|
402
|
+
'retain-source'
|
|
403
|
+
];
|
|
404
|
+
requiresQuiesce: true;
|
|
405
|
+
retainSourceData: true;
|
|
406
|
+
destructiveOperations: false;
|
|
407
|
+
}
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
### Parameters
|
|
411
|
+
|
|
412
|
+
| Name | Type | Required | Description |
|
|
413
|
+
| --- | --- | --- | --- |
|
|
414
|
+
| `format` | `1` | Yes | Plan discriminator; currently 1. |
|
|
415
|
+
| `id` | `string` | Yes | Canonical digest of the normalized request and phase/safety flags. |
|
|
416
|
+
| `request` | `BackendMigrationRequest` | Yes | Cloned request with sorted plugin and explicit tenant IDs. |
|
|
417
|
+
| `phases` | `readonly [ 'prepare', 'copy', 'verify', 'cutover', 'retain-source' ]` | Yes | Ordered prepare/copy/verify/cutover/retain-source execution phases. |
|
|
418
|
+
| `requiresQuiesce` | `true` | Yes | Always true; the host must drain affected execution before switching. |
|
|
419
|
+
| `retainSourceData` | `true` | Yes | Always true; source data must remain available. |
|
|
420
|
+
| `destructiveOperations` | `false` | Yes | Always false; dropping source data is outside this plan. |
|
|
421
|
+
|
|
422
|
+
### Returns
|
|
423
|
+
|
|
424
|
+
Type declaration; no runtime value.
|
|
425
|
+
|
|
426
|
+
### See also
|
|
427
|
+
|
|
428
|
+
planBackendMigration for canonical integration usage.
|
|
429
|
+
|
|
430
|
+
### Public members
|
|
431
|
+
|
|
432
|
+
#### `format`
|
|
433
|
+
|
|
434
|
+
Plan discriminator; currently 1.
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
#### `id`
|
|
438
|
+
|
|
439
|
+
Canonical digest of the normalized request and phase/safety flags.
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
#### `request`
|
|
443
|
+
|
|
444
|
+
Cloned request with sorted plugin and explicit tenant IDs.
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
#### `phases`
|
|
448
|
+
|
|
449
|
+
Ordered prepare/copy/verify/cutover/retain-source execution phases.
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
#### `requiresQuiesce`
|
|
453
|
+
|
|
454
|
+
Always true; the host must drain affected execution before switching.
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
#### `retainSourceData`
|
|
458
|
+
|
|
459
|
+
Always true; source data must remain available.
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
#### `destructiveOperations`
|
|
463
|
+
|
|
464
|
+
Always false; dropping source data is outside this plan.
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
### Example
|
|
469
|
+
|
|
470
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
471
|
+
|
|
472
|
+
<a id="api-BackendMigrationRequest"></a>
|
|
473
|
+
|
|
474
|
+
## [INTERFACE] `BackendMigrationRequest`
|
|
475
|
+
|
|
476
|
+
Operator-reviewed source/target database move with bounded scope and reason.
|
|
477
|
+
|
|
478
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`, `@alneas/eaos-server/lifecycle-engine/backend-migration`.
|
|
479
|
+
|
|
480
|
+
### Signature
|
|
481
|
+
|
|
482
|
+
```typescript
|
|
483
|
+
interface BackendMigrationRequest {
|
|
484
|
+
migrationId: string;
|
|
485
|
+
source: BackendTarget;
|
|
486
|
+
target: BackendTarget;
|
|
487
|
+
scope: BackendMigrationScope;
|
|
488
|
+
pluginIds: readonly string[];
|
|
489
|
+
requestedAt: string;
|
|
490
|
+
reason: string;
|
|
491
|
+
}
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
### Parameters
|
|
495
|
+
|
|
496
|
+
| Name | Type | Required | Description |
|
|
497
|
+
| --- | --- | --- | --- |
|
|
498
|
+
| `migrationId` | `string` | Yes | Nonblank stable migration identity, up to 256 characters. |
|
|
499
|
+
| `source` | `BackendTarget` | Yes | Existing backend whose data remains retained. |
|
|
500
|
+
| `target` | `BackendTarget` | Yes | Different backend and physical database identity. |
|
|
501
|
+
| `scope` | `BackendMigrationScope` | Yes | All tenants or nonempty unique explicit tenant IDs; dedicated endpoints require their tenant in explicit scope. |
|
|
502
|
+
| `pluginIds` | `readonly string[]` | Yes | Nonempty unique registered-style feature IDs covered by the move. |
|
|
503
|
+
| `requestedAt` | `string` | Yes | Parseable request timestamp. |
|
|
504
|
+
| `reason` | `string` | Yes | Nonblank reviewed operator reason, at most 1024 characters. |
|
|
505
|
+
|
|
506
|
+
### Returns
|
|
507
|
+
|
|
508
|
+
Type declaration; no runtime value.
|
|
509
|
+
|
|
510
|
+
### See also
|
|
511
|
+
|
|
512
|
+
planBackendMigration for canonical integration usage.
|
|
513
|
+
|
|
514
|
+
### Public members
|
|
515
|
+
|
|
516
|
+
#### `migrationId`
|
|
517
|
+
|
|
518
|
+
Nonblank stable migration identity, up to 256 characters.
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
#### `source`
|
|
522
|
+
|
|
523
|
+
Existing backend whose data remains retained.
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
#### `target`
|
|
527
|
+
|
|
528
|
+
Different backend and physical database identity.
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
#### `scope`
|
|
532
|
+
|
|
533
|
+
All tenants or nonempty unique explicit tenant IDs; dedicated endpoints require their tenant in explicit scope.
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
#### `pluginIds`
|
|
537
|
+
|
|
538
|
+
Nonempty unique registered-style feature IDs covered by the move.
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
#### `requestedAt`
|
|
542
|
+
|
|
543
|
+
Parseable request timestamp.
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
#### `reason`
|
|
547
|
+
|
|
548
|
+
Nonblank reviewed operator reason, at most 1024 characters.
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
### Example
|
|
553
|
+
|
|
554
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
555
|
+
|
|
556
|
+
<a id="api-BackendMigrationScope"></a>
|
|
557
|
+
|
|
558
|
+
## [TYPE] `BackendMigrationScope`
|
|
559
|
+
|
|
560
|
+
Explicit complete fleet or nonempty concrete tenant selection for a reviewed data move.
|
|
561
|
+
|
|
562
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`, `@alneas/eaos-server/lifecycle-engine/backend-migration`.
|
|
563
|
+
|
|
564
|
+
### Signature
|
|
565
|
+
|
|
566
|
+
```typescript
|
|
567
|
+
type BackendMigrationScope = {
|
|
568
|
+
kind: 'all-tenants';
|
|
569
|
+
} | {
|
|
570
|
+
kind: 'tenants';
|
|
571
|
+
tenantIds: readonly string[];
|
|
572
|
+
};
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
### Parameters
|
|
576
|
+
|
|
577
|
+
| Name | Type | Required | Description |
|
|
578
|
+
| --- | --- | --- | --- |
|
|
579
|
+
| — | — | — | No call parameters. |
|
|
580
|
+
|
|
581
|
+
### Returns
|
|
582
|
+
|
|
583
|
+
Type declaration; no runtime value.
|
|
584
|
+
|
|
585
|
+
### See also
|
|
586
|
+
|
|
587
|
+
planBackendMigration for canonical integration usage.
|
|
588
|
+
|
|
589
|
+
### Public members
|
|
590
|
+
|
|
591
|
+
#### `kind`
|
|
592
|
+
|
|
593
|
+
Scope discriminator: all-tenants includes the fleet; tenants names a concrete bounded selection.
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
#### `kind`
|
|
597
|
+
|
|
598
|
+
Scope discriminator: all-tenants includes the fleet; tenants names a concrete bounded selection.
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
#### `tenantIds`
|
|
602
|
+
|
|
603
|
+
Nonempty distinct concrete tenant IDs; dedicated endpoint tenants must be included.
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
### Example
|
|
608
|
+
|
|
609
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
610
|
+
|
|
611
|
+
<a id="api-BackendMigrationVerification"></a>
|
|
612
|
+
|
|
613
|
+
## [INTERFACE] `BackendMigrationVerification`
|
|
614
|
+
|
|
615
|
+
Host-reported match for one tenant/plugin copy at observed revisions.
|
|
616
|
+
|
|
617
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`, `@alneas/eaos-server/lifecycle-engine/backend-migration`.
|
|
618
|
+
|
|
619
|
+
### Signature
|
|
620
|
+
|
|
621
|
+
```typescript
|
|
622
|
+
interface BackendMigrationVerification {
|
|
623
|
+
tenantId: string;
|
|
624
|
+
pluginId: string;
|
|
625
|
+
sourceRevision: number;
|
|
626
|
+
targetRevision: number;
|
|
627
|
+
matched: boolean;
|
|
628
|
+
}
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
### Parameters
|
|
632
|
+
|
|
633
|
+
| Name | Type | Required | Description |
|
|
634
|
+
| --- | --- | --- | --- |
|
|
635
|
+
| `tenantId` | `string` | Yes | Concrete verified tenant covered by the plan. |
|
|
636
|
+
| `pluginId` | `string` | Yes | Planned feature whose records were compared. |
|
|
637
|
+
| `sourceRevision` | `number` | Yes | Nonnegative safe revision observed at source. |
|
|
638
|
+
| `targetRevision` | `number` | Yes | Nonnegative safe revision observed at target; not required to numerically equal source. |
|
|
639
|
+
| `matched` | `boolean` | Yes | True only when the host comparison passed; validator does not perform the comparison. |
|
|
640
|
+
|
|
641
|
+
### Returns
|
|
642
|
+
|
|
643
|
+
Type declaration; no runtime value.
|
|
644
|
+
|
|
645
|
+
### See also
|
|
646
|
+
|
|
647
|
+
planBackendMigration for canonical integration usage.
|
|
648
|
+
|
|
649
|
+
### Public members
|
|
650
|
+
|
|
651
|
+
#### `tenantId`
|
|
652
|
+
|
|
653
|
+
Concrete verified tenant covered by the plan.
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
#### `pluginId`
|
|
657
|
+
|
|
658
|
+
Planned feature whose records were compared.
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
#### `sourceRevision`
|
|
662
|
+
|
|
663
|
+
Nonnegative safe revision observed at source.
|
|
664
|
+
|
|
665
|
+
|
|
666
|
+
#### `targetRevision`
|
|
667
|
+
|
|
668
|
+
Nonnegative safe revision observed at target; not required to numerically equal source.
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
#### `matched`
|
|
672
|
+
|
|
673
|
+
True only when the host comparison passed; validator does not perform the comparison.
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
### Example
|
|
678
|
+
|
|
679
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
680
|
+
|
|
681
|
+
<a id="api-BackendMigrationVerificationReport"></a>
|
|
682
|
+
|
|
683
|
+
## [INTERFACE] `BackendMigrationVerificationReport`
|
|
684
|
+
|
|
685
|
+
Host verification evidence bound to a reviewed source/target migration.
|
|
686
|
+
|
|
687
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`, `@alneas/eaos-server/lifecycle-engine/backend-migration`.
|
|
688
|
+
|
|
689
|
+
### Signature
|
|
690
|
+
|
|
691
|
+
```typescript
|
|
692
|
+
interface BackendMigrationVerificationReport {
|
|
693
|
+
migrationId: string;
|
|
694
|
+
sourceBackendId: string;
|
|
695
|
+
targetBackendId: string;
|
|
696
|
+
checkedAt: string;
|
|
697
|
+
records: readonly BackendMigrationVerification[];
|
|
698
|
+
passed: boolean;
|
|
699
|
+
}
|
|
700
|
+
```
|
|
701
|
+
|
|
702
|
+
### Parameters
|
|
703
|
+
|
|
704
|
+
| Name | Type | Required | Description |
|
|
705
|
+
| --- | --- | --- | --- |
|
|
706
|
+
| `migrationId` | `string` | Yes | Plan request migration identity. |
|
|
707
|
+
| `sourceBackendId` | `string` | Yes | Exact source backend identity. |
|
|
708
|
+
| `targetBackendId` | `string` | Yes | Exact target backend identity. |
|
|
709
|
+
| `checkedAt` | `string` | Yes | Parseable verification timestamp. |
|
|
710
|
+
| `records` | `readonly BackendMigrationVerification[]` | Yes | Nonempty matched in-scope record reports; host must establish exhaustive coverage. |
|
|
711
|
+
| `passed` | `boolean` | Yes | Host declaration that verification passed; must be true for acceptance. |
|
|
712
|
+
|
|
713
|
+
### Returns
|
|
714
|
+
|
|
715
|
+
Type declaration; no runtime value.
|
|
716
|
+
|
|
717
|
+
### See also
|
|
718
|
+
|
|
719
|
+
planBackendMigration for canonical integration usage.
|
|
720
|
+
|
|
721
|
+
### Public members
|
|
722
|
+
|
|
723
|
+
#### `migrationId`
|
|
724
|
+
|
|
725
|
+
Plan request migration identity.
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
#### `sourceBackendId`
|
|
729
|
+
|
|
730
|
+
Exact source backend identity.
|
|
731
|
+
|
|
732
|
+
|
|
733
|
+
#### `targetBackendId`
|
|
734
|
+
|
|
735
|
+
Exact target backend identity.
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
#### `checkedAt`
|
|
739
|
+
|
|
740
|
+
Parseable verification timestamp.
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
#### `records`
|
|
744
|
+
|
|
745
|
+
Nonempty matched in-scope record reports; host must establish exhaustive coverage.
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
#### `passed`
|
|
749
|
+
|
|
750
|
+
Host declaration that verification passed; must be true for acceptance.
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
### Example
|
|
755
|
+
|
|
756
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
757
|
+
|
|
758
|
+
<a id="api-BackendTarget"></a>
|
|
759
|
+
|
|
760
|
+
## [INTERFACE] `BackendTarget`
|
|
761
|
+
|
|
762
|
+
Opaque physical database placement and shared/dedicated tenant scope.
|
|
763
|
+
|
|
764
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
765
|
+
|
|
766
|
+
### Signature
|
|
767
|
+
|
|
768
|
+
```typescript
|
|
769
|
+
interface BackendTarget {
|
|
770
|
+
id: string;
|
|
771
|
+
databaseId: string;
|
|
772
|
+
dialect: Dialect;
|
|
773
|
+
mode: 'shared' | 'dedicated';
|
|
774
|
+
tenantId?: string;
|
|
775
|
+
}
|
|
776
|
+
```
|
|
777
|
+
|
|
778
|
+
### Parameters
|
|
779
|
+
|
|
780
|
+
| Name | Type | Required | Description |
|
|
781
|
+
| --- | --- | --- | --- |
|
|
782
|
+
| `id` | `string` | Yes | Stable execution backend ID; lifecycle plans reject identity changes under an existing ID. |
|
|
783
|
+
| `databaseId` | `string` | Yes | Opaque physical database identity shared by aliases of the same database; never a DSN. |
|
|
784
|
+
| `dialect` | `Dialect` | Yes | SQL dialect required by this database and migration history. |
|
|
785
|
+
| `mode` | `'shared' \| 'dedicated'` | Yes | Shared permits tenant isolation within one database; dedicated binds one tenant. |
|
|
786
|
+
| `tenantId` | `string` | No | Required concrete tenant for dedicated mode and forbidden for shared mode. |
|
|
787
|
+
|
|
788
|
+
### Returns
|
|
789
|
+
|
|
790
|
+
Type declaration; no runtime value.
|
|
791
|
+
|
|
792
|
+
### See also
|
|
793
|
+
|
|
794
|
+
PluginLifecycle for canonical integration usage.
|
|
795
|
+
|
|
796
|
+
### Public members
|
|
797
|
+
|
|
798
|
+
#### `id`
|
|
799
|
+
|
|
800
|
+
Stable execution backend ID; lifecycle plans reject identity changes under an existing ID.
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
#### `databaseId`
|
|
804
|
+
|
|
805
|
+
Opaque physical database identity shared by aliases of the same database; never a DSN.
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
#### `dialect`
|
|
809
|
+
|
|
810
|
+
SQL dialect required by this database and migration history.
|
|
811
|
+
|
|
812
|
+
|
|
813
|
+
#### `mode`
|
|
814
|
+
|
|
815
|
+
Shared permits tenant isolation within one database; dedicated binds one tenant.
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
#### `tenantId`
|
|
819
|
+
|
|
820
|
+
Required concrete tenant for dedicated mode and forbidden for shared mode.
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
|
|
824
|
+
### Example
|
|
825
|
+
|
|
826
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
827
|
+
|
|
828
|
+
<a id="api-canonical"></a>
|
|
829
|
+
|
|
830
|
+
## [FUNCTION] `canonical`
|
|
831
|
+
|
|
832
|
+
Serializes JSON-compatible lifecycle values with recursively sorted object keys.
|
|
833
|
+
|
|
834
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
835
|
+
|
|
836
|
+
### Signature
|
|
837
|
+
|
|
838
|
+
```typescript
|
|
839
|
+
declare function canonical(value: unknown): string;
|
|
840
|
+
```
|
|
841
|
+
|
|
842
|
+
### Parameters
|
|
843
|
+
|
|
844
|
+
| Name | Type | Required | Description |
|
|
845
|
+
| --- | --- | --- | --- |
|
|
846
|
+
| `value` | `unknown` | Yes | JSON-serializable primitives, arrays or plain/null-prototype objects; avoid cycles and nonfinite numbers. |
|
|
847
|
+
|
|
848
|
+
### Returns
|
|
849
|
+
|
|
850
|
+
`string`
|
|
851
|
+
|
|
852
|
+
Deterministic JSON text; array order is preserved.
|
|
853
|
+
|
|
854
|
+
### Remarks
|
|
855
|
+
|
|
856
|
+
Uses JSON.stringify primitive semantics, including null for nonfinite numbers. It does not accept undefined/function/symbol values or class instances. Cyclic graphs are unsupported.
|
|
857
|
+
|
|
858
|
+
### Errors and rejections
|
|
859
|
+
|
|
860
|
+
Error for unsupported values/prototypes, JSON serialization failure or recursive cycles.
|
|
861
|
+
|
|
862
|
+
### Example
|
|
863
|
+
|
|
864
|
+
```typescript
|
|
865
|
+
import { canonical } from '@alneas/eaos-server/lifecycle-engine';
|
|
866
|
+
const serialized = canonical({ b: [2, 1], a: true });
|
|
867
|
+
```
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
<a id="api-collectSchemaMigrations"></a>
|
|
871
|
+
|
|
872
|
+
## [FUNCTION] `collectSchemaMigrations`
|
|
873
|
+
|
|
874
|
+
Compatibility re-export; its implementation and documentation are owned by the owning package ``.
|
|
875
|
+
|
|
876
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
877
|
+
|
|
878
|
+
### Signature
|
|
879
|
+
|
|
880
|
+
```typescript
|
|
881
|
+
declare function collectSchemaMigrations(releases: readonly SchemaMigrationSource[], available?: readonly DataContract[]): PluginMigration[];
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
### Parameters
|
|
885
|
+
|
|
886
|
+
| Name | Type | Required | Description |
|
|
887
|
+
| --- | --- | --- | --- |
|
|
888
|
+
| `releases` | `readonly SchemaMigrationSource[]` | Yes | See the upstream owning declaration. |
|
|
889
|
+
| `available` | `readonly DataContract[]` | No | See the upstream owning declaration. |
|
|
890
|
+
|
|
891
|
+
### Returns
|
|
892
|
+
|
|
893
|
+
`PluginMigration[]`
|
|
894
|
+
|
|
895
|
+
### Example
|
|
896
|
+
|
|
897
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
898
|
+
|
|
899
|
+
<a id="api-createDataContractBaseline"></a>
|
|
900
|
+
|
|
901
|
+
## [FUNCTION] `createDataContractBaseline`
|
|
902
|
+
|
|
903
|
+
Builds a newer single-migration contract release and hashes the exact historical migrations it replaces.
|
|
904
|
+
|
|
905
|
+
Final DDL comes from a schema compiler or an isolated database introspector, never concatenation.
|
|
906
|
+
|
|
907
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`, `@alneas/eaos-server/lifecycle-engine/baseline`.
|
|
908
|
+
|
|
909
|
+
### Signature
|
|
910
|
+
|
|
911
|
+
```typescript
|
|
912
|
+
declare function createDataContractBaseline(source: DataContract, version: string, sql: DataContract['migrations'][number]['sql']): DataContractBaseline;
|
|
913
|
+
```
|
|
914
|
+
|
|
915
|
+
### Parameters
|
|
916
|
+
|
|
917
|
+
| Name | Type | Required | Description |
|
|
918
|
+
| --- | --- | --- | --- |
|
|
919
|
+
| `source` | `DataContract` | Yes | Valid source contract with nonempty database-scoped migration history. |
|
|
920
|
+
| `version` | `string` | Yes | Valid semver strictly newer than source.version. |
|
|
921
|
+
| `sql` | `DataContract['migrations'][number]['sql']` | Yes | Compiler/introspector-generated complete baseline DDL covering exactly the original dialect set. |
|
|
922
|
+
|
|
923
|
+
### Returns
|
|
924
|
+
|
|
925
|
+
`DataContractBaseline`
|
|
926
|
+
|
|
927
|
+
Source/target contract snapshots, replacement migration checksums and integrity hash.
|
|
928
|
+
|
|
929
|
+
### Remarks
|
|
930
|
+
|
|
931
|
+
Read-only; the host must establish final DDL equivalence using a schema compiler or isolated introspector. SQL is not concatenated or executed here.
|
|
932
|
+
|
|
933
|
+
### Errors and rejections
|
|
934
|
+
|
|
935
|
+
Error for nonnewer version, tenant-scoped/empty history, changed dialect set or invalid source/target contracts.
|
|
936
|
+
|
|
937
|
+
### Example
|
|
938
|
+
|
|
939
|
+
```typescript
|
|
940
|
+
import { createDataContractBaseline, type DataContract } from '@alneas/eaos-server/lifecycle-engine';
|
|
941
|
+
export function reviewBaseline(source: DataContract, version: string, sql: DataContract['migrations'][number]['sql']) { return createDataContractBaseline(source, version, sql); }
|
|
942
|
+
```
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
<a id="api-createJsonDocumentAssertion"></a>
|
|
946
|
+
|
|
947
|
+
## [FUNCTION] `createJsonDocumentAssertion`
|
|
948
|
+
|
|
949
|
+
Compatibility re-export; its implementation and documentation are owned by the owning package ``.
|
|
950
|
+
|
|
951
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
952
|
+
|
|
953
|
+
### Signature
|
|
954
|
+
|
|
955
|
+
```typescript
|
|
956
|
+
declare function createJsonDocumentAssertion(document: JsonDocumentContract): (value: unknown) => void;
|
|
957
|
+
```
|
|
958
|
+
|
|
959
|
+
### Parameters
|
|
960
|
+
|
|
961
|
+
| Name | Type | Required | Description |
|
|
962
|
+
| --- | --- | --- | --- |
|
|
963
|
+
| `document` | `JsonDocumentContract` | Yes | See the upstream owning declaration. |
|
|
964
|
+
|
|
965
|
+
### Returns
|
|
966
|
+
|
|
967
|
+
`(value: unknown) => void`
|
|
968
|
+
|
|
969
|
+
### Example
|
|
970
|
+
|
|
971
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
972
|
+
|
|
973
|
+
<a id="api-DataContract"></a>
|
|
974
|
+
|
|
975
|
+
## [INTERFACE] `DataContract`
|
|
976
|
+
|
|
977
|
+
Compatibility re-export; its implementation and documentation are owned by the owning package ``.
|
|
978
|
+
|
|
979
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
980
|
+
|
|
981
|
+
### Signature
|
|
982
|
+
|
|
983
|
+
```typescript
|
|
984
|
+
interface DataContract {
|
|
985
|
+
id: string;
|
|
986
|
+
version: string;
|
|
987
|
+
description: string;
|
|
988
|
+
schema: Record<string, unknown>;
|
|
989
|
+
migrations: PluginMigration[];
|
|
990
|
+
dependencies?: Record<string, string>;
|
|
991
|
+
migrationIdentity?: string;
|
|
992
|
+
jsonDocuments?: JsonDocumentContract[];
|
|
993
|
+
}
|
|
994
|
+
```
|
|
995
|
+
|
|
996
|
+
### Parameters
|
|
997
|
+
|
|
998
|
+
| Name | Type | Required | Description |
|
|
999
|
+
| --- | --- | --- | --- |
|
|
1000
|
+
| `id` | `string` | Yes | See the upstream owning declaration. |
|
|
1001
|
+
| `version` | `string` | Yes | See the upstream owning declaration. |
|
|
1002
|
+
| `description` | `string` | Yes | See the upstream owning declaration. |
|
|
1003
|
+
| `schema` | `Record<string, unknown>` | Yes | See the upstream owning declaration. |
|
|
1004
|
+
| `migrations` | `PluginMigration[]` | Yes | See the upstream owning declaration. |
|
|
1005
|
+
| `dependencies` | `Record<string, string>` | No | See the upstream owning declaration. |
|
|
1006
|
+
| `migrationIdentity` | `string` | No | See the upstream owning declaration. |
|
|
1007
|
+
| `jsonDocuments` | `JsonDocumentContract[]` | No | See the upstream owning declaration. |
|
|
1008
|
+
|
|
1009
|
+
### Returns
|
|
1010
|
+
|
|
1011
|
+
Type declaration; no runtime value.
|
|
1012
|
+
|
|
1013
|
+
### Example
|
|
1014
|
+
|
|
1015
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
1016
|
+
|
|
1017
|
+
<a id="api-DataContractBaseline"></a>
|
|
1018
|
+
|
|
1019
|
+
## [INTERFACE] `DataContractBaseline`
|
|
1020
|
+
|
|
1021
|
+
Hash-bound replacement of exact historical database migrations by equivalent baseline DDL.
|
|
1022
|
+
|
|
1023
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`, `@alneas/eaos-server/lifecycle-engine/baseline`.
|
|
1024
|
+
|
|
1025
|
+
### Signature
|
|
1026
|
+
|
|
1027
|
+
```typescript
|
|
1028
|
+
interface DataContractBaseline {
|
|
1029
|
+
format: 1;
|
|
1030
|
+
source: DataContract;
|
|
1031
|
+
target: DataContract;
|
|
1032
|
+
replaces: {
|
|
1033
|
+
id: string;
|
|
1034
|
+
position: number;
|
|
1035
|
+
checksum: string;
|
|
1036
|
+
}[];
|
|
1037
|
+
hash: string;
|
|
1038
|
+
}
|
|
1039
|
+
```
|
|
1040
|
+
|
|
1041
|
+
### Parameters
|
|
1042
|
+
|
|
1043
|
+
| Name | Type | Required | Description |
|
|
1044
|
+
| --- | --- | --- | --- |
|
|
1045
|
+
| `format` | `1` | Yes | Baseline discriminator; currently 1. |
|
|
1046
|
+
| `source` | `DataContract` | Yes | Canonical contract release whose fully applied history is replaced. |
|
|
1047
|
+
| `target` | `DataContract` | Yes | Newer release retaining schema but using one database-scoped baseline migration. |
|
|
1048
|
+
| `replaces` | `{ id: string; position: number; checksum: string; }[]` | Yes | Ordered historical migration IDs, positions and checksums requiring exact ledger matches. |
|
|
1049
|
+
| `hash` | `string` | Yes | Canonical digest of format/source/target/replaces. |
|
|
1050
|
+
|
|
1051
|
+
### Returns
|
|
1052
|
+
|
|
1053
|
+
Type declaration; no runtime value.
|
|
1054
|
+
|
|
1055
|
+
### See also
|
|
1056
|
+
|
|
1057
|
+
createDataContractBaseline for canonical integration usage.
|
|
1058
|
+
|
|
1059
|
+
### Public members
|
|
1060
|
+
|
|
1061
|
+
#### `format`
|
|
1062
|
+
|
|
1063
|
+
Baseline discriminator; currently 1.
|
|
1064
|
+
|
|
1065
|
+
|
|
1066
|
+
#### `source`
|
|
1067
|
+
|
|
1068
|
+
Canonical contract release whose fully applied history is replaced.
|
|
1069
|
+
|
|
1070
|
+
|
|
1071
|
+
#### `target`
|
|
1072
|
+
|
|
1073
|
+
Newer release retaining schema but using one database-scoped baseline migration.
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
#### `replaces`
|
|
1077
|
+
|
|
1078
|
+
Ordered historical migration IDs, positions and checksums requiring exact ledger matches.
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
#### `replaces[].id`
|
|
1082
|
+
|
|
1083
|
+
Original immutable migration ID replaced by the baseline.
|
|
1084
|
+
|
|
1085
|
+
|
|
1086
|
+
#### `replaces[].position`
|
|
1087
|
+
|
|
1088
|
+
Original zero-based migration position.
|
|
1089
|
+
|
|
1090
|
+
|
|
1091
|
+
#### `replaces[].checksum`
|
|
1092
|
+
|
|
1093
|
+
Canonical original migration definition digest.
|
|
1094
|
+
|
|
1095
|
+
|
|
1096
|
+
#### `hash`
|
|
1097
|
+
|
|
1098
|
+
Canonical digest of format/source/target/replaces.
|
|
1099
|
+
|
|
1100
|
+
|
|
1101
|
+
|
|
1102
|
+
### Example
|
|
1103
|
+
|
|
1104
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
1105
|
+
|
|
1106
|
+
<a id="api-DataContractBinding"></a>
|
|
1107
|
+
|
|
1108
|
+
## [INTERFACE] `DataContractBinding`
|
|
1109
|
+
|
|
1110
|
+
Compatibility re-export; its implementation and documentation are owned by the owning package ``.
|
|
1111
|
+
|
|
1112
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
1113
|
+
|
|
1114
|
+
### Signature
|
|
1115
|
+
|
|
1116
|
+
```typescript
|
|
1117
|
+
interface DataContractBinding {
|
|
1118
|
+
contractId: string;
|
|
1119
|
+
version: string;
|
|
1120
|
+
table: string;
|
|
1121
|
+
namespace?: string;
|
|
1122
|
+
}
|
|
1123
|
+
```
|
|
1124
|
+
|
|
1125
|
+
### Parameters
|
|
1126
|
+
|
|
1127
|
+
| Name | Type | Required | Description |
|
|
1128
|
+
| --- | --- | --- | --- |
|
|
1129
|
+
| `contractId` | `string` | Yes | See the upstream owning declaration. |
|
|
1130
|
+
| `version` | `string` | Yes | See the upstream owning declaration. |
|
|
1131
|
+
| `table` | `string` | Yes | See the upstream owning declaration. |
|
|
1132
|
+
| `namespace` | `string` | No | See the upstream owning declaration. |
|
|
1133
|
+
|
|
1134
|
+
### Returns
|
|
1135
|
+
|
|
1136
|
+
Type declaration; no runtime value.
|
|
1137
|
+
|
|
1138
|
+
### Example
|
|
1139
|
+
|
|
1140
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
1141
|
+
|
|
1142
|
+
<a id="api-DataContractCatalog"></a>
|
|
1143
|
+
|
|
1144
|
+
## [INTERFACE] `DataContractCatalog`
|
|
1145
|
+
|
|
1146
|
+
Compatibility re-export; its implementation and documentation are owned by the owning package ``.
|
|
1147
|
+
|
|
1148
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
1149
|
+
|
|
1150
|
+
### Signature
|
|
1151
|
+
|
|
1152
|
+
```typescript
|
|
1153
|
+
interface DataContractCatalog {
|
|
1154
|
+
contracts: DataContract[];
|
|
1155
|
+
tables: {
|
|
1156
|
+
name: string;
|
|
1157
|
+
contractId: string;
|
|
1158
|
+
version: string;
|
|
1159
|
+
schema: Record<string, unknown>;
|
|
1160
|
+
}[];
|
|
1161
|
+
}
|
|
1162
|
+
```
|
|
1163
|
+
|
|
1164
|
+
### Parameters
|
|
1165
|
+
|
|
1166
|
+
| Name | Type | Required | Description |
|
|
1167
|
+
| --- | --- | --- | --- |
|
|
1168
|
+
| `contracts` | `DataContract[]` | Yes | See the upstream owning declaration. |
|
|
1169
|
+
| `tables` | `{ name: string; contractId: string; version: string; schema: Record<string, unknown>; }[]` | Yes | See the upstream owning declaration. |
|
|
1170
|
+
|
|
1171
|
+
### Returns
|
|
1172
|
+
|
|
1173
|
+
Type declaration; no runtime value.
|
|
1174
|
+
|
|
1175
|
+
### Example
|
|
1176
|
+
|
|
1177
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
1178
|
+
|
|
1179
|
+
<a id="api-dataContractTables"></a>
|
|
1180
|
+
|
|
1181
|
+
## [FUNCTION] `dataContractTables`
|
|
1182
|
+
|
|
1183
|
+
Compatibility re-export; its implementation and documentation are owned by the owning package ``.
|
|
1184
|
+
|
|
1185
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
1186
|
+
|
|
1187
|
+
### Signature
|
|
1188
|
+
|
|
1189
|
+
```typescript
|
|
1190
|
+
declare function dataContractTables(schema: Record<string, unknown>): Map<string, Record<string, unknown>>;
|
|
1191
|
+
```
|
|
1192
|
+
|
|
1193
|
+
### Parameters
|
|
1194
|
+
|
|
1195
|
+
| Name | Type | Required | Description |
|
|
1196
|
+
| --- | --- | --- | --- |
|
|
1197
|
+
| `schema` | `Record<string, unknown>` | Yes | See the upstream owning declaration. |
|
|
1198
|
+
|
|
1199
|
+
### Returns
|
|
1200
|
+
|
|
1201
|
+
`Map<string, Record<string, unknown>>`
|
|
1202
|
+
|
|
1203
|
+
### Example
|
|
1204
|
+
|
|
1205
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
1206
|
+
|
|
1207
|
+
<a id="api-Dialect"></a>
|
|
1208
|
+
|
|
1209
|
+
## [TYPE] `Dialect`
|
|
1210
|
+
|
|
1211
|
+
Supported SQL dialects used to select reviewed migration statements.
|
|
1212
|
+
|
|
1213
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
1214
|
+
|
|
1215
|
+
### Signature
|
|
1216
|
+
|
|
1217
|
+
```typescript
|
|
1218
|
+
type Dialect = 'sqlite' | 'oracle' | 'postgres';
|
|
1219
|
+
```
|
|
1220
|
+
|
|
1221
|
+
### Parameters
|
|
1222
|
+
|
|
1223
|
+
| Name | Type | Required | Description |
|
|
1224
|
+
| --- | --- | --- | --- |
|
|
1225
|
+
| — | — | — | No call parameters. |
|
|
1226
|
+
|
|
1227
|
+
### Returns
|
|
1228
|
+
|
|
1229
|
+
Type declaration; no runtime value.
|
|
1230
|
+
|
|
1231
|
+
### See also
|
|
1232
|
+
|
|
1233
|
+
PluginLifecycle for canonical integration usage.
|
|
1234
|
+
|
|
1235
|
+
### Example
|
|
1236
|
+
|
|
1237
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
1238
|
+
|
|
1239
|
+
<a id="api-emptyLifecyclePlatformState"></a>
|
|
1240
|
+
|
|
1241
|
+
## [FUNCTION] `emptyLifecyclePlatformState`
|
|
1242
|
+
|
|
1243
|
+
Creates independent empty platform tenant, placement and migration maps.
|
|
1244
|
+
|
|
1245
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
1246
|
+
|
|
1247
|
+
### Signature
|
|
1248
|
+
|
|
1249
|
+
```typescript
|
|
1250
|
+
declare const emptyLifecyclePlatformState: () => LifecyclePlatformState;
|
|
1251
|
+
```
|
|
1252
|
+
|
|
1253
|
+
### Parameters
|
|
1254
|
+
|
|
1255
|
+
| Name | Type | Required | Description |
|
|
1256
|
+
| --- | --- | --- | --- |
|
|
1257
|
+
| — | — | — | No call parameters. |
|
|
1258
|
+
|
|
1259
|
+
### Returns
|
|
1260
|
+
|
|
1261
|
+
`LifecyclePlatformState`
|
|
1262
|
+
|
|
1263
|
+
A new mutable platform-state object.
|
|
1264
|
+
|
|
1265
|
+
### Example
|
|
1266
|
+
|
|
1267
|
+
```typescript
|
|
1268
|
+
import { emptyLifecyclePlatformState } from '@alneas/eaos-server/lifecycle-engine';
|
|
1269
|
+
const platform = emptyLifecyclePlatformState();
|
|
1270
|
+
```
|
|
1271
|
+
|
|
1272
|
+
|
|
1273
|
+
<a id="api-emptyLifecycleState"></a>
|
|
1274
|
+
|
|
1275
|
+
## [FUNCTION] `emptyLifecycleState`
|
|
1276
|
+
|
|
1277
|
+
Creates an independent empty version-1 ledger with revision zero and platform state.
|
|
1278
|
+
|
|
1279
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
1280
|
+
|
|
1281
|
+
### Signature
|
|
1282
|
+
|
|
1283
|
+
```typescript
|
|
1284
|
+
declare const emptyLifecycleState: () => LifecycleState;
|
|
1285
|
+
```
|
|
1286
|
+
|
|
1287
|
+
### Parameters
|
|
1288
|
+
|
|
1289
|
+
| Name | Type | Required | Description |
|
|
1290
|
+
| --- | --- | --- | --- |
|
|
1291
|
+
| — | — | — | No call parameters. |
|
|
1292
|
+
|
|
1293
|
+
### Returns
|
|
1294
|
+
|
|
1295
|
+
`LifecycleState`
|
|
1296
|
+
|
|
1297
|
+
A new mutable LifecycleState with empty maps; no persistence is performed.
|
|
1298
|
+
|
|
1299
|
+
### Example
|
|
1300
|
+
|
|
1301
|
+
```typescript
|
|
1302
|
+
import { emptyLifecycleState } from '@alneas/eaos-server/lifecycle-engine';
|
|
1303
|
+
const state = emptyLifecycleState();
|
|
1304
|
+
```
|
|
1305
|
+
|
|
1306
|
+
|
|
1307
|
+
<a id="api-FRAMEWORK_VERSION"></a>
|
|
1308
|
+
|
|
1309
|
+
## [CONSTANT] `FRAMEWORK_VERSION`
|
|
1310
|
+
|
|
1311
|
+
Installed server package version used as the default lifecycle compatibility version.
|
|
1312
|
+
|
|
1313
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
1314
|
+
|
|
1315
|
+
### Signature
|
|
1316
|
+
|
|
1317
|
+
```typescript
|
|
1318
|
+
declare const FRAMEWORK_VERSION: string;
|
|
1319
|
+
```
|
|
1320
|
+
|
|
1321
|
+
### Parameters
|
|
1322
|
+
|
|
1323
|
+
| Name | Type | Required | Description |
|
|
1324
|
+
| --- | --- | --- | --- |
|
|
1325
|
+
| — | — | — | No call parameters. |
|
|
1326
|
+
|
|
1327
|
+
### Returns
|
|
1328
|
+
|
|
1329
|
+
`Declared constant value.`
|
|
1330
|
+
|
|
1331
|
+
### See also
|
|
1332
|
+
|
|
1333
|
+
PluginLifecycle for canonical integration usage.
|
|
1334
|
+
|
|
1335
|
+
### Example
|
|
1336
|
+
|
|
1337
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
1338
|
+
|
|
1339
|
+
<a id="api-InfrastructureStep"></a>
|
|
1340
|
+
|
|
1341
|
+
## [INTERFACE] `InfrastructureStep`
|
|
1342
|
+
|
|
1343
|
+
Planned host infrastructure change bound to the release and backend digest.
|
|
1344
|
+
|
|
1345
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
1346
|
+
|
|
1347
|
+
### Signature
|
|
1348
|
+
|
|
1349
|
+
```typescript
|
|
1350
|
+
interface InfrastructureStep {
|
|
1351
|
+
key: string;
|
|
1352
|
+
digest: string;
|
|
1353
|
+
plugin: LifecyclePlugin;
|
|
1354
|
+
backend: BackendTarget;
|
|
1355
|
+
}
|
|
1356
|
+
```
|
|
1357
|
+
|
|
1358
|
+
### Parameters
|
|
1359
|
+
|
|
1360
|
+
| Name | Type | Required | Description |
|
|
1361
|
+
| --- | --- | --- | --- |
|
|
1362
|
+
| `key` | `string` | Yes | Infrastructure ledger key for backend/plugin. |
|
|
1363
|
+
| `digest` | `string` | Yes | Canonical digest binding backend and plugin infrastructure configuration. |
|
|
1364
|
+
| `plugin` | `LifecyclePlugin` | Yes | Trusted plugin release declaring infrastructure requirements. |
|
|
1365
|
+
| `backend` | `BackendTarget` | Yes | Exact target whose resources are previewed/applied. |
|
|
1366
|
+
|
|
1367
|
+
### Returns
|
|
1368
|
+
|
|
1369
|
+
Type declaration; no runtime value.
|
|
1370
|
+
|
|
1371
|
+
### See also
|
|
1372
|
+
|
|
1373
|
+
PluginLifecycle for canonical integration usage.
|
|
1374
|
+
|
|
1375
|
+
### Public members
|
|
1376
|
+
|
|
1377
|
+
#### `key`
|
|
1378
|
+
|
|
1379
|
+
Infrastructure ledger key for backend/plugin.
|
|
1380
|
+
|
|
1381
|
+
|
|
1382
|
+
#### `digest`
|
|
1383
|
+
|
|
1384
|
+
Canonical digest binding backend and plugin infrastructure configuration.
|
|
1385
|
+
|
|
1386
|
+
|
|
1387
|
+
#### `plugin`
|
|
1388
|
+
|
|
1389
|
+
Trusted plugin release declaring infrastructure requirements.
|
|
1390
|
+
|
|
1391
|
+
|
|
1392
|
+
#### `backend`
|
|
1393
|
+
|
|
1394
|
+
Exact target whose resources are previewed/applied.
|
|
1395
|
+
|
|
1396
|
+
|
|
1397
|
+
|
|
1398
|
+
### Example
|
|
1399
|
+
|
|
1400
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
1401
|
+
|
|
1402
|
+
<a id="api-Installation"></a>
|
|
1403
|
+
|
|
1404
|
+
## [INTERFACE] `Installation`
|
|
1405
|
+
|
|
1406
|
+
Registered release snapshot and progress stored for one backend/plugin.
|
|
1407
|
+
|
|
1408
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
1409
|
+
|
|
1410
|
+
### Signature
|
|
1411
|
+
|
|
1412
|
+
```typescript
|
|
1413
|
+
interface Installation {
|
|
1414
|
+
release: LifecyclePlugin;
|
|
1415
|
+
digest: string;
|
|
1416
|
+
status: 'installing' | 'installed' | 'failed';
|
|
1417
|
+
}
|
|
1418
|
+
```
|
|
1419
|
+
|
|
1420
|
+
### Parameters
|
|
1421
|
+
|
|
1422
|
+
| Name | Type | Required | Description |
|
|
1423
|
+
| --- | --- | --- | --- |
|
|
1424
|
+
| `release` | `LifecyclePlugin` | Yes | Copied trusted plugin release installed on this backend. |
|
|
1425
|
+
| `digest` | `string` | Yes | Canonical digest of the release snapshot. |
|
|
1426
|
+
| `status` | `'installing' \| 'installed' \| 'failed'` | Yes | Installing/installed/failed progress; noninstalled records require reconciliation. |
|
|
1427
|
+
|
|
1428
|
+
### Returns
|
|
1429
|
+
|
|
1430
|
+
Type declaration; no runtime value.
|
|
1431
|
+
|
|
1432
|
+
### See also
|
|
1433
|
+
|
|
1434
|
+
PluginLifecycle for canonical integration usage.
|
|
1435
|
+
|
|
1436
|
+
### Public members
|
|
1437
|
+
|
|
1438
|
+
#### `release`
|
|
1439
|
+
|
|
1440
|
+
Copied trusted plugin release installed on this backend.
|
|
1441
|
+
|
|
1442
|
+
|
|
1443
|
+
#### `digest`
|
|
1444
|
+
|
|
1445
|
+
Canonical digest of the release snapshot.
|
|
1446
|
+
|
|
1447
|
+
|
|
1448
|
+
#### `status`
|
|
1449
|
+
|
|
1450
|
+
Installing/installed/failed progress; noninstalled records require reconciliation.
|
|
1451
|
+
|
|
1452
|
+
|
|
1453
|
+
|
|
1454
|
+
### Example
|
|
1455
|
+
|
|
1456
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
1457
|
+
|
|
1458
|
+
<a id="api-JsonDocumentContract"></a>
|
|
1459
|
+
|
|
1460
|
+
## [INTERFACE] `JsonDocumentContract`
|
|
1461
|
+
|
|
1462
|
+
Compatibility re-export; its implementation and documentation are owned by the owning package ``.
|
|
1463
|
+
|
|
1464
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
1465
|
+
|
|
1466
|
+
### Signature
|
|
1467
|
+
|
|
1468
|
+
```typescript
|
|
1469
|
+
interface JsonDocumentContract {
|
|
1470
|
+
id: string;
|
|
1471
|
+
version: string;
|
|
1472
|
+
table: string;
|
|
1473
|
+
column: string;
|
|
1474
|
+
namespace?: string;
|
|
1475
|
+
jsonPath?: string;
|
|
1476
|
+
recordPrefix?: string;
|
|
1477
|
+
schema: Record<string, unknown>;
|
|
1478
|
+
immutable?: boolean;
|
|
1479
|
+
maxBytes?: number;
|
|
1480
|
+
}
|
|
1481
|
+
```
|
|
1482
|
+
|
|
1483
|
+
### Parameters
|
|
1484
|
+
|
|
1485
|
+
| Name | Type | Required | Description |
|
|
1486
|
+
| --- | --- | --- | --- |
|
|
1487
|
+
| `id` | `string` | Yes | See the upstream owning declaration. |
|
|
1488
|
+
| `version` | `string` | Yes | See the upstream owning declaration. |
|
|
1489
|
+
| `table` | `string` | Yes | See the upstream owning declaration. |
|
|
1490
|
+
| `column` | `string` | Yes | See the upstream owning declaration. |
|
|
1491
|
+
| `namespace` | `string` | No | See the upstream owning declaration. |
|
|
1492
|
+
| `jsonPath` | `string` | No | See the upstream owning declaration. |
|
|
1493
|
+
| `recordPrefix` | `string` | No | See the upstream owning declaration. |
|
|
1494
|
+
| `schema` | `Record<string, unknown>` | Yes | See the upstream owning declaration. |
|
|
1495
|
+
| `immutable` | `boolean` | No | See the upstream owning declaration. |
|
|
1496
|
+
| `maxBytes` | `number` | No | See the upstream owning declaration. |
|
|
1497
|
+
|
|
1498
|
+
### Returns
|
|
1499
|
+
|
|
1500
|
+
Type declaration; no runtime value.
|
|
1501
|
+
|
|
1502
|
+
### Example
|
|
1503
|
+
|
|
1504
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
1505
|
+
|
|
1506
|
+
<a id="api-LifecycleBundlePlan"></a>
|
|
1507
|
+
|
|
1508
|
+
## [INTERFACE] `LifecycleBundlePlan`
|
|
1509
|
+
|
|
1510
|
+
Reviewable ordered collection of member plans with projected sequential ledger revisions.
|
|
1511
|
+
|
|
1512
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
1513
|
+
|
|
1514
|
+
### Signature
|
|
1515
|
+
|
|
1516
|
+
```typescript
|
|
1517
|
+
interface LifecycleBundlePlan {
|
|
1518
|
+
format: 1;
|
|
1519
|
+
id: string;
|
|
1520
|
+
bundleId: string;
|
|
1521
|
+
operation: Operation;
|
|
1522
|
+
plans: LifecyclePlan[];
|
|
1523
|
+
}
|
|
1524
|
+
```
|
|
1525
|
+
|
|
1526
|
+
### Parameters
|
|
1527
|
+
|
|
1528
|
+
| Name | Type | Required | Description |
|
|
1529
|
+
| --- | --- | --- | --- |
|
|
1530
|
+
| `format` | `1` | Yes | Bundle discriminator; currently 1. |
|
|
1531
|
+
| `id` | `string` | Yes | Canonical digest of bundle identity, operation and member plans. |
|
|
1532
|
+
| `bundleId` | `string` | Yes | Registered host bundle alias. |
|
|
1533
|
+
| `operation` | `Operation` | Yes | Transition applied to every bundle member. |
|
|
1534
|
+
| `plans` | `LifecyclePlan[]` | Yes | Dependency-compatible member order; reversed for disable/uninstall. |
|
|
1535
|
+
|
|
1536
|
+
### Returns
|
|
1537
|
+
|
|
1538
|
+
Type declaration; no runtime value.
|
|
1539
|
+
|
|
1540
|
+
### See also
|
|
1541
|
+
|
|
1542
|
+
PluginLifecycle for canonical integration usage.
|
|
1543
|
+
|
|
1544
|
+
### Public members
|
|
1545
|
+
|
|
1546
|
+
#### `format`
|
|
1547
|
+
|
|
1548
|
+
Bundle discriminator; currently 1.
|
|
1549
|
+
|
|
1550
|
+
|
|
1551
|
+
#### `id`
|
|
1552
|
+
|
|
1553
|
+
Canonical digest of bundle identity, operation and member plans.
|
|
1554
|
+
|
|
1555
|
+
|
|
1556
|
+
#### `bundleId`
|
|
1557
|
+
|
|
1558
|
+
Registered host bundle alias.
|
|
1559
|
+
|
|
1560
|
+
|
|
1561
|
+
#### `operation`
|
|
1562
|
+
|
|
1563
|
+
Transition applied to every bundle member.
|
|
1564
|
+
|
|
1565
|
+
|
|
1566
|
+
#### `plans`
|
|
1567
|
+
|
|
1568
|
+
Dependency-compatible member order; reversed for disable/uninstall.
|
|
1569
|
+
|
|
1570
|
+
|
|
1571
|
+
|
|
1572
|
+
### Example
|
|
1573
|
+
|
|
1574
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
1575
|
+
|
|
1576
|
+
<a id="api-lifecycleDigest"></a>
|
|
1577
|
+
|
|
1578
|
+
## [FUNCTION] `lifecycleDigest`
|
|
1579
|
+
|
|
1580
|
+
Computes a lowercase SHA-256 digest of the canonical lifecycle JSON representation.
|
|
1581
|
+
|
|
1582
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
1583
|
+
|
|
1584
|
+
### Signature
|
|
1585
|
+
|
|
1586
|
+
```typescript
|
|
1587
|
+
declare const lifecycleDigest: (value: unknown) => string;
|
|
1588
|
+
```
|
|
1589
|
+
|
|
1590
|
+
### Parameters
|
|
1591
|
+
|
|
1592
|
+
| Name | Type | Required | Description |
|
|
1593
|
+
| --- | --- | --- | --- |
|
|
1594
|
+
| `value` | `unknown` | Yes | Supported canonical JSON lifecycle configuration. |
|
|
1595
|
+
|
|
1596
|
+
### Returns
|
|
1597
|
+
|
|
1598
|
+
`string`
|
|
1599
|
+
|
|
1600
|
+
A 64-character lowercase hexadecimal digest.
|
|
1601
|
+
|
|
1602
|
+
### Remarks
|
|
1603
|
+
|
|
1604
|
+
Requires Node crypto; the digest proves content identity, not authorization or authenticity.
|
|
1605
|
+
|
|
1606
|
+
### Errors and rejections
|
|
1607
|
+
|
|
1608
|
+
Propagates canonical serialization errors for unsupported values.
|
|
1609
|
+
|
|
1610
|
+
### Example
|
|
1611
|
+
|
|
1612
|
+
```typescript
|
|
1613
|
+
import { lifecycleDigest } from '@alneas/eaos-server/lifecycle-engine';
|
|
1614
|
+
const digest = lifecycleDigest({ pluginId: 'reports', version: '1.0.0' });
|
|
1615
|
+
```
|
|
1616
|
+
|
|
1617
|
+
|
|
1618
|
+
<a id="api-LifecycleInventory"></a>
|
|
1619
|
+
|
|
1620
|
+
## [INTERFACE] `LifecycleInventory`
|
|
1621
|
+
|
|
1622
|
+
Read-only revision-bound plugin inventory including code-only and orphaned entries.
|
|
1623
|
+
|
|
1624
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
1625
|
+
|
|
1626
|
+
### Signature
|
|
1627
|
+
|
|
1628
|
+
```typescript
|
|
1629
|
+
interface LifecycleInventory {
|
|
1630
|
+
format: 1;
|
|
1631
|
+
revision: number;
|
|
1632
|
+
frameworkVersion: string;
|
|
1633
|
+
plugins: LifecycleInventoryEntry[];
|
|
1634
|
+
}
|
|
1635
|
+
```
|
|
1636
|
+
|
|
1637
|
+
### Parameters
|
|
1638
|
+
|
|
1639
|
+
| Name | Type | Required | Description |
|
|
1640
|
+
| --- | --- | --- | --- |
|
|
1641
|
+
| `format` | `1` | Yes | Inventory discriminator; currently 1. |
|
|
1642
|
+
| `revision` | `number` | Yes | Ledger snapshot revision inspected. |
|
|
1643
|
+
| `frameworkVersion` | `string` | Yes | Framework compatibility version used for readiness. |
|
|
1644
|
+
| `plugins` | `LifecycleInventoryEntry[]` | Yes | Deterministically ordered plugin/backend inventory entries, possibly empty. |
|
|
1645
|
+
|
|
1646
|
+
### Returns
|
|
1647
|
+
|
|
1648
|
+
Type declaration; no runtime value.
|
|
1649
|
+
|
|
1650
|
+
### See also
|
|
1651
|
+
|
|
1652
|
+
PluginLifecycle for canonical integration usage.
|
|
1653
|
+
|
|
1654
|
+
### Public members
|
|
1655
|
+
|
|
1656
|
+
#### `format`
|
|
1657
|
+
|
|
1658
|
+
Inventory discriminator; currently 1.
|
|
1659
|
+
|
|
1660
|
+
|
|
1661
|
+
#### `revision`
|
|
1662
|
+
|
|
1663
|
+
Ledger snapshot revision inspected.
|
|
1664
|
+
|
|
1665
|
+
|
|
1666
|
+
#### `frameworkVersion`
|
|
1667
|
+
|
|
1668
|
+
Framework compatibility version used for readiness.
|
|
1669
|
+
|
|
1670
|
+
|
|
1671
|
+
#### `plugins`
|
|
1672
|
+
|
|
1673
|
+
Deterministically ordered plugin/backend inventory entries, possibly empty.
|
|
1674
|
+
|
|
1675
|
+
|
|
1676
|
+
|
|
1677
|
+
### Example
|
|
1678
|
+
|
|
1679
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
1680
|
+
|
|
1681
|
+
<a id="api-LifecycleInventoryEntry"></a>
|
|
1682
|
+
|
|
1683
|
+
## [INTERFACE] `LifecycleInventoryEntry`
|
|
1684
|
+
|
|
1685
|
+
One registered or historical plugin/backend pair with requested and effective tenant readiness.
|
|
1686
|
+
|
|
1687
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
1688
|
+
|
|
1689
|
+
### Signature
|
|
1690
|
+
|
|
1691
|
+
```typescript
|
|
1692
|
+
interface LifecycleInventoryEntry {
|
|
1693
|
+
pluginId: string;
|
|
1694
|
+
backendId: string | null;
|
|
1695
|
+
backendConfigured: boolean;
|
|
1696
|
+
registeredVersion: string | null;
|
|
1697
|
+
installedVersion: string | null;
|
|
1698
|
+
installationStatus: Installation['status'] | 'not-installed';
|
|
1699
|
+
releaseMatches: boolean | null;
|
|
1700
|
+
tenants: {
|
|
1701
|
+
tenantId: string;
|
|
1702
|
+
requestedEnabled: boolean;
|
|
1703
|
+
enabled: boolean;
|
|
1704
|
+
}[];
|
|
1705
|
+
}
|
|
1706
|
+
```
|
|
1707
|
+
|
|
1708
|
+
### Parameters
|
|
1709
|
+
|
|
1710
|
+
| Name | Type | Required | Description |
|
|
1711
|
+
| --- | --- | --- | --- |
|
|
1712
|
+
| `pluginId` | `string` | Yes | Registered or historically recorded plugin ID. |
|
|
1713
|
+
| `backendId` | `string \| null` | Yes | Backend associated with the entry, or null when no backend is known. |
|
|
1714
|
+
| `backendConfigured` | `boolean` | Yes | Whether this backend remains in the trusted runtime catalog. |
|
|
1715
|
+
| `registeredVersion` | `string \| null` | Yes | Current registered code version, or null for orphaned history. |
|
|
1716
|
+
| `installedVersion` | `string \| null` | Yes | Stored installation version, or null before installation. |
|
|
1717
|
+
| `installationStatus` | `Installation['status'] \| 'not-installed'` | Yes | Stored progress or not-installed. |
|
|
1718
|
+
| `releaseMatches` | `boolean \| null` | Yes | Whether stored digest matches registered code, or null without installation. |
|
|
1719
|
+
| `tenants` | `{ tenantId: string; requestedEnabled: boolean; enabled: boolean; }[]` | Yes | Tenant requestedEnabled flags and effective enabled readiness results. |
|
|
1720
|
+
|
|
1721
|
+
### Returns
|
|
1722
|
+
|
|
1723
|
+
Type declaration; no runtime value.
|
|
1724
|
+
|
|
1725
|
+
### See also
|
|
1726
|
+
|
|
1727
|
+
PluginLifecycle for canonical integration usage.
|
|
1728
|
+
|
|
1729
|
+
### Public members
|
|
1730
|
+
|
|
1731
|
+
#### `pluginId`
|
|
1732
|
+
|
|
1733
|
+
Registered or historically recorded plugin ID.
|
|
1734
|
+
|
|
1735
|
+
|
|
1736
|
+
#### `backendId`
|
|
1737
|
+
|
|
1738
|
+
Backend associated with the entry, or null when no backend is known.
|
|
1739
|
+
|
|
1740
|
+
|
|
1741
|
+
#### `backendConfigured`
|
|
1742
|
+
|
|
1743
|
+
Whether this backend remains in the trusted runtime catalog.
|
|
1744
|
+
|
|
1745
|
+
|
|
1746
|
+
#### `registeredVersion`
|
|
1747
|
+
|
|
1748
|
+
Current registered code version, or null for orphaned history.
|
|
1749
|
+
|
|
1750
|
+
|
|
1751
|
+
#### `installedVersion`
|
|
1752
|
+
|
|
1753
|
+
Stored installation version, or null before installation.
|
|
1754
|
+
|
|
1755
|
+
|
|
1756
|
+
#### `installationStatus`
|
|
1757
|
+
|
|
1758
|
+
Stored progress or not-installed.
|
|
1759
|
+
|
|
1760
|
+
|
|
1761
|
+
#### `releaseMatches`
|
|
1762
|
+
|
|
1763
|
+
Whether stored digest matches registered code, or null without installation.
|
|
1764
|
+
|
|
1765
|
+
|
|
1766
|
+
#### `tenants`
|
|
1767
|
+
|
|
1768
|
+
Tenant requestedEnabled flags and effective enabled readiness results.
|
|
1769
|
+
|
|
1770
|
+
|
|
1771
|
+
#### `tenants[].tenantId`
|
|
1772
|
+
|
|
1773
|
+
Concrete tenant whose activation is inspected.
|
|
1774
|
+
|
|
1775
|
+
|
|
1776
|
+
#### `tenants[].requestedEnabled`
|
|
1777
|
+
|
|
1778
|
+
Stored requested activation flag without readiness guarantees.
|
|
1779
|
+
|
|
1780
|
+
|
|
1781
|
+
#### `tenants[].enabled`
|
|
1782
|
+
|
|
1783
|
+
Effective lifecycle readiness for the registered release and dependency closure.
|
|
1784
|
+
|
|
1785
|
+
|
|
1786
|
+
|
|
1787
|
+
### Example
|
|
1788
|
+
|
|
1789
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
1790
|
+
|
|
1791
|
+
<a id="api-LifecyclePlan"></a>
|
|
1792
|
+
|
|
1793
|
+
## [INTERFACE] `LifecyclePlan`
|
|
1794
|
+
|
|
1795
|
+
Reviewable hash-bound lifecycle transition generated against one ledger revision.
|
|
1796
|
+
|
|
1797
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
1798
|
+
|
|
1799
|
+
### Signature
|
|
1800
|
+
|
|
1801
|
+
```typescript
|
|
1802
|
+
interface LifecyclePlan {
|
|
1803
|
+
format: 1;
|
|
1804
|
+
id: string;
|
|
1805
|
+
revision: number;
|
|
1806
|
+
frameworkVersion: string;
|
|
1807
|
+
request: LifecycleRequest;
|
|
1808
|
+
backend: BackendTarget;
|
|
1809
|
+
dataCatalog?: DataContractCatalog;
|
|
1810
|
+
plugins: LifecyclePlugin[];
|
|
1811
|
+
migrations: MigrationStep[];
|
|
1812
|
+
infrastructure: InfrastructureStep[];
|
|
1813
|
+
deactivate: string[];
|
|
1814
|
+
infrastructureProvider: string | null;
|
|
1815
|
+
retainData: true;
|
|
1816
|
+
}
|
|
1817
|
+
```
|
|
1818
|
+
|
|
1819
|
+
### Parameters
|
|
1820
|
+
|
|
1821
|
+
| Name | Type | Required | Description |
|
|
1822
|
+
| --- | --- | --- | --- |
|
|
1823
|
+
| `format` | `1` | Yes | Plan discriminator; currently 1. |
|
|
1824
|
+
| `id` | `string` | Yes | Canonical SHA-256 hash of all plan body fields. |
|
|
1825
|
+
| `revision` | `number` | Yes | Ledger revision observed during planning; apply rejects stale plans. |
|
|
1826
|
+
| `frameworkVersion` | `string` | Yes | Framework compatibility version used to resolve the plan. |
|
|
1827
|
+
| `request` | `LifecycleRequest` | Yes | Original scoped operation request. |
|
|
1828
|
+
| `backend` | `BackendTarget` | Yes | Snapshot of the exact immutable backend identity. |
|
|
1829
|
+
| `dataCatalog` | `DataContractCatalog` | No | Optional dependency-resolved canonical data contracts and table ownership. |
|
|
1830
|
+
| `plugins` | `LifecyclePlugin[]` | Yes | Dependency-ordered trusted feature releases involved in the transition. |
|
|
1831
|
+
| `migrations` | `MigrationStep[]` | Yes | Ordered migration steps not already applied with matching checksums. |
|
|
1832
|
+
| `infrastructure` | `InfrastructureStep[]` | Yes | Planned host infrastructure changes requiring the configured executor. |
|
|
1833
|
+
| `deactivate` | `string[]` | Yes | Activation map keys disabled before disruptive changes. |
|
|
1834
|
+
| `infrastructureProvider` | `string \| null` | Yes | Configured executor identity, or null when none exists. |
|
|
1835
|
+
| `retainData` | `true` | Yes | Always true; lifecycle uninstall never drops business data. |
|
|
1836
|
+
|
|
1837
|
+
### Returns
|
|
1838
|
+
|
|
1839
|
+
Type declaration; no runtime value.
|
|
1840
|
+
|
|
1841
|
+
### See also
|
|
1842
|
+
|
|
1843
|
+
PluginLifecycle for canonical integration usage.
|
|
1844
|
+
|
|
1845
|
+
### Public members
|
|
1846
|
+
|
|
1847
|
+
#### `format`
|
|
1848
|
+
|
|
1849
|
+
Plan discriminator; currently 1.
|
|
1850
|
+
|
|
1851
|
+
|
|
1852
|
+
#### `id`
|
|
1853
|
+
|
|
1854
|
+
Canonical SHA-256 hash of all plan body fields.
|
|
1855
|
+
|
|
1856
|
+
|
|
1857
|
+
#### `revision`
|
|
1858
|
+
|
|
1859
|
+
Ledger revision observed during planning; apply rejects stale plans.
|
|
1860
|
+
|
|
1861
|
+
|
|
1862
|
+
#### `frameworkVersion`
|
|
1863
|
+
|
|
1864
|
+
Framework compatibility version used to resolve the plan.
|
|
1865
|
+
|
|
1866
|
+
|
|
1867
|
+
#### `request`
|
|
1868
|
+
|
|
1869
|
+
Original scoped operation request.
|
|
1870
|
+
|
|
1871
|
+
|
|
1872
|
+
#### `backend`
|
|
1873
|
+
|
|
1874
|
+
Snapshot of the exact immutable backend identity.
|
|
1875
|
+
|
|
1876
|
+
|
|
1877
|
+
#### `dataCatalog`
|
|
1878
|
+
|
|
1879
|
+
Optional dependency-resolved canonical data contracts and table ownership.
|
|
1880
|
+
|
|
1881
|
+
|
|
1882
|
+
#### `plugins`
|
|
1883
|
+
|
|
1884
|
+
Dependency-ordered trusted feature releases involved in the transition.
|
|
1885
|
+
|
|
1886
|
+
|
|
1887
|
+
#### `migrations`
|
|
1888
|
+
|
|
1889
|
+
Ordered migration steps not already applied with matching checksums.
|
|
1890
|
+
|
|
1891
|
+
|
|
1892
|
+
#### `infrastructure`
|
|
1893
|
+
|
|
1894
|
+
Planned host infrastructure changes requiring the configured executor.
|
|
1895
|
+
|
|
1896
|
+
|
|
1897
|
+
#### `deactivate`
|
|
1898
|
+
|
|
1899
|
+
Activation map keys disabled before disruptive changes.
|
|
1900
|
+
|
|
1901
|
+
|
|
1902
|
+
#### `infrastructureProvider`
|
|
1903
|
+
|
|
1904
|
+
Configured executor identity, or null when none exists.
|
|
1905
|
+
|
|
1906
|
+
|
|
1907
|
+
#### `retainData`
|
|
1908
|
+
|
|
1909
|
+
Always true; lifecycle uninstall never drops business data.
|
|
1910
|
+
|
|
1911
|
+
|
|
1912
|
+
|
|
1913
|
+
### Example
|
|
1914
|
+
|
|
1915
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
1916
|
+
|
|
1917
|
+
<a id="api-LifecyclePlatformBackendMetadata"></a>
|
|
1918
|
+
|
|
1919
|
+
## [INTERFACE] `LifecyclePlatformBackendMetadata`
|
|
1920
|
+
|
|
1921
|
+
Nonsecret descriptive metadata for an existing backend.
|
|
1922
|
+
|
|
1923
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
1924
|
+
|
|
1925
|
+
### Signature
|
|
1926
|
+
|
|
1927
|
+
```typescript
|
|
1928
|
+
interface LifecyclePlatformBackendMetadata {
|
|
1929
|
+
label?: string;
|
|
1930
|
+
provider?: string;
|
|
1931
|
+
capabilities?: readonly string[];
|
|
1932
|
+
}
|
|
1933
|
+
```
|
|
1934
|
+
|
|
1935
|
+
### Parameters
|
|
1936
|
+
|
|
1937
|
+
| Name | Type | Required | Description |
|
|
1938
|
+
| --- | --- | --- | --- |
|
|
1939
|
+
| `label` | `string` | No | Optional public display label. |
|
|
1940
|
+
| `provider` | `string` | No | Optional provider descriptor; never credentials or DSNs. |
|
|
1941
|
+
| `capabilities` | `readonly string[]` | No | Optional declared host capability names, not permission grants. |
|
|
1942
|
+
|
|
1943
|
+
### Returns
|
|
1944
|
+
|
|
1945
|
+
Type declaration; no runtime value.
|
|
1946
|
+
|
|
1947
|
+
### See also
|
|
1948
|
+
|
|
1949
|
+
PluginLifecycle for canonical integration usage.
|
|
1950
|
+
|
|
1951
|
+
### Public members
|
|
1952
|
+
|
|
1953
|
+
#### `label`
|
|
1954
|
+
|
|
1955
|
+
Optional public display label.
|
|
1956
|
+
|
|
1957
|
+
|
|
1958
|
+
#### `provider`
|
|
1959
|
+
|
|
1960
|
+
Optional provider descriptor; never credentials or DSNs.
|
|
1961
|
+
|
|
1962
|
+
|
|
1963
|
+
#### `capabilities`
|
|
1964
|
+
|
|
1965
|
+
Optional declared host capability names, not permission grants.
|
|
1966
|
+
|
|
1967
|
+
|
|
1968
|
+
|
|
1969
|
+
### Example
|
|
1970
|
+
|
|
1971
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
1972
|
+
|
|
1973
|
+
<a id="api-LifecyclePlatformMigrationRecord"></a>
|
|
1974
|
+
|
|
1975
|
+
## [INTERFACE] `LifecyclePlatformMigrationRecord`
|
|
1976
|
+
|
|
1977
|
+
Durable migration execution, verification and reconciliation evidence.
|
|
1978
|
+
|
|
1979
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
1980
|
+
|
|
1981
|
+
### Signature
|
|
1982
|
+
|
|
1983
|
+
```typescript
|
|
1984
|
+
interface LifecyclePlatformMigrationRecord {
|
|
1985
|
+
status: LifecyclePlatformMigrationStatus;
|
|
1986
|
+
executionId?: string;
|
|
1987
|
+
verification?: BackendMigrationVerificationReport;
|
|
1988
|
+
cutover?: BackendMigrationCutover;
|
|
1989
|
+
error?: {
|
|
1990
|
+
message: string;
|
|
1991
|
+
occurredAt: string;
|
|
1992
|
+
};
|
|
1993
|
+
updatedAt: string;
|
|
1994
|
+
rollbackOf?: string;
|
|
1995
|
+
rollbackPlanId?: string;
|
|
1996
|
+
}
|
|
1997
|
+
```
|
|
1998
|
+
|
|
1999
|
+
### Parameters
|
|
2000
|
+
|
|
2001
|
+
| Name | Type | Required | Description |
|
|
2002
|
+
| --- | --- | --- | --- |
|
|
2003
|
+
| `status` | `LifecyclePlatformMigrationStatus` | Yes | Current progress; reconciling represents uncertain execution outcomes. |
|
|
2004
|
+
| `executionId` | `string` | No | Optional identity claiming the host migration execution. |
|
|
2005
|
+
| `verification` | `BackendMigrationVerificationReport` | No | Optional host-reported verification matching the migration plan. |
|
|
2006
|
+
| `cutover` | `BackendMigrationCutover` | No | Optional source-retaining cutover receipt. |
|
|
2007
|
+
| `error` | `{ message: string; occurredAt: string; }` | No | Optional failure message and occurrence timestamp; exclude secrets. |
|
|
2008
|
+
| `updatedAt` | `string` | Yes | Timestamp of the latest migration-state change. |
|
|
2009
|
+
| `rollbackOf` | `string` | No | Optional original migration ID when this is a rollback execution. |
|
|
2010
|
+
| `rollbackPlanId` | `string` | No | Optional reviewed reverse plan associated with this migration. |
|
|
2011
|
+
|
|
2012
|
+
### Returns
|
|
2013
|
+
|
|
2014
|
+
Type declaration; no runtime value.
|
|
2015
|
+
|
|
2016
|
+
### See also
|
|
2017
|
+
|
|
2018
|
+
PluginLifecycle for canonical integration usage.
|
|
2019
|
+
|
|
2020
|
+
### Public members
|
|
2021
|
+
|
|
2022
|
+
#### `status`
|
|
2023
|
+
|
|
2024
|
+
Current progress; reconciling represents uncertain execution outcomes.
|
|
2025
|
+
|
|
2026
|
+
|
|
2027
|
+
#### `executionId`
|
|
2028
|
+
|
|
2029
|
+
Optional identity claiming the host migration execution.
|
|
2030
|
+
|
|
2031
|
+
|
|
2032
|
+
#### `verification`
|
|
2033
|
+
|
|
2034
|
+
Optional host-reported verification matching the migration plan.
|
|
2035
|
+
|
|
2036
|
+
|
|
2037
|
+
#### `cutover`
|
|
2038
|
+
|
|
2039
|
+
Optional source-retaining cutover receipt.
|
|
2040
|
+
|
|
2041
|
+
|
|
2042
|
+
#### `error`
|
|
2043
|
+
|
|
2044
|
+
Optional failure message and occurrence timestamp; exclude secrets.
|
|
2045
|
+
|
|
2046
|
+
|
|
2047
|
+
#### `error.message`
|
|
2048
|
+
|
|
2049
|
+
Nonsecret failure description retained for operator reconciliation.
|
|
2050
|
+
|
|
2051
|
+
|
|
2052
|
+
#### `error.occurredAt`
|
|
2053
|
+
|
|
2054
|
+
Timestamp at which the error was recorded.
|
|
2055
|
+
|
|
2056
|
+
|
|
2057
|
+
#### `updatedAt`
|
|
2058
|
+
|
|
2059
|
+
Timestamp of the latest migration-state change.
|
|
2060
|
+
|
|
2061
|
+
|
|
2062
|
+
#### `rollbackOf`
|
|
2063
|
+
|
|
2064
|
+
Optional original migration ID when this is a rollback execution.
|
|
2065
|
+
|
|
2066
|
+
|
|
2067
|
+
#### `rollbackPlanId`
|
|
2068
|
+
|
|
2069
|
+
Optional reviewed reverse plan associated with this migration.
|
|
2070
|
+
|
|
2071
|
+
|
|
2072
|
+
|
|
2073
|
+
### Example
|
|
2074
|
+
|
|
2075
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
2076
|
+
|
|
2077
|
+
<a id="api-LifecyclePlatformMigrationStatus"></a>
|
|
2078
|
+
|
|
2079
|
+
## [TYPE] `LifecyclePlatformMigrationStatus`
|
|
2080
|
+
|
|
2081
|
+
Persisted migration progress including uncertainty, failure, reconciliation and rollback states.
|
|
2082
|
+
|
|
2083
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
2084
|
+
|
|
2085
|
+
### Signature
|
|
2086
|
+
|
|
2087
|
+
```typescript
|
|
2088
|
+
type LifecyclePlatformMigrationStatus = 'planned' | 'running' | 'verified' | 'cutover' | 'failed' | 'reconciling' | 'rolled-back';
|
|
2089
|
+
```
|
|
2090
|
+
|
|
2091
|
+
### Parameters
|
|
2092
|
+
|
|
2093
|
+
| Name | Type | Required | Description |
|
|
2094
|
+
| --- | --- | --- | --- |
|
|
2095
|
+
| — | — | — | No call parameters. |
|
|
2096
|
+
|
|
2097
|
+
### Returns
|
|
2098
|
+
|
|
2099
|
+
Type declaration; no runtime value.
|
|
2100
|
+
|
|
2101
|
+
### See also
|
|
2102
|
+
|
|
2103
|
+
PluginLifecycle for canonical integration usage.
|
|
2104
|
+
|
|
2105
|
+
### Example
|
|
2106
|
+
|
|
2107
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
2108
|
+
|
|
2109
|
+
<a id="api-LifecyclePlatformPlacement"></a>
|
|
2110
|
+
|
|
2111
|
+
## [INTERFACE] `LifecyclePlatformPlacement`
|
|
2112
|
+
|
|
2113
|
+
Durable tenant-to-backend routing assignment with optimistic routing revision.
|
|
2114
|
+
|
|
2115
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
2116
|
+
|
|
2117
|
+
### Signature
|
|
2118
|
+
|
|
2119
|
+
```typescript
|
|
2120
|
+
interface LifecyclePlatformPlacement {
|
|
2121
|
+
tenantId: string;
|
|
2122
|
+
backendId: string;
|
|
2123
|
+
routingRevision: number;
|
|
2124
|
+
changedAt: string;
|
|
2125
|
+
}
|
|
2126
|
+
```
|
|
2127
|
+
|
|
2128
|
+
### Parameters
|
|
2129
|
+
|
|
2130
|
+
| Name | Type | Required | Description |
|
|
2131
|
+
| --- | --- | --- | --- |
|
|
2132
|
+
| `tenantId` | `string` | Yes | Verified tenant whose traffic is routed. |
|
|
2133
|
+
| `backendId` | `string` | Yes | Opaque configured backend receiving traffic. |
|
|
2134
|
+
| `routingRevision` | `number` | Yes | Nonnegative revision used to track routing changes. |
|
|
2135
|
+
| `changedAt` | `string` | Yes | Timestamp of the recorded routing switch. |
|
|
2136
|
+
|
|
2137
|
+
### Returns
|
|
2138
|
+
|
|
2139
|
+
Type declaration; no runtime value.
|
|
2140
|
+
|
|
2141
|
+
### See also
|
|
2142
|
+
|
|
2143
|
+
PluginLifecycle for canonical integration usage.
|
|
2144
|
+
|
|
2145
|
+
### Public members
|
|
2146
|
+
|
|
2147
|
+
#### `tenantId`
|
|
2148
|
+
|
|
2149
|
+
Verified tenant whose traffic is routed.
|
|
2150
|
+
|
|
2151
|
+
|
|
2152
|
+
#### `backendId`
|
|
2153
|
+
|
|
2154
|
+
Opaque configured backend receiving traffic.
|
|
2155
|
+
|
|
2156
|
+
|
|
2157
|
+
#### `routingRevision`
|
|
2158
|
+
|
|
2159
|
+
Nonnegative revision used to track routing changes.
|
|
2160
|
+
|
|
2161
|
+
|
|
2162
|
+
#### `changedAt`
|
|
2163
|
+
|
|
2164
|
+
Timestamp of the recorded routing switch.
|
|
2165
|
+
|
|
2166
|
+
|
|
2167
|
+
|
|
2168
|
+
### Example
|
|
2169
|
+
|
|
2170
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
2171
|
+
|
|
2172
|
+
<a id="api-LifecyclePlatformState"></a>
|
|
2173
|
+
|
|
2174
|
+
## [INTERFACE] `LifecyclePlatformState`
|
|
2175
|
+
|
|
2176
|
+
Platform-owned tenant, backend and migration control maps stored with the lifecycle ledger.
|
|
2177
|
+
|
|
2178
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
2179
|
+
|
|
2180
|
+
### Signature
|
|
2181
|
+
|
|
2182
|
+
```typescript
|
|
2183
|
+
interface LifecyclePlatformState {
|
|
2184
|
+
tenants: Record<string, LifecyclePlatformTenant>;
|
|
2185
|
+
placements: Record<string, LifecyclePlatformPlacement>;
|
|
2186
|
+
backendMetadata: Record<string, LifecyclePlatformBackendMetadata>;
|
|
2187
|
+
migrationPlans: Record<string, BackendMigrationPlan>;
|
|
2188
|
+
migrationRecords: Record<string, LifecyclePlatformMigrationRecord>;
|
|
2189
|
+
}
|
|
2190
|
+
```
|
|
2191
|
+
|
|
2192
|
+
### Parameters
|
|
2193
|
+
|
|
2194
|
+
| Name | Type | Required | Description |
|
|
2195
|
+
| --- | --- | --- | --- |
|
|
2196
|
+
| `tenants` | `Record<string, LifecyclePlatformTenant>` | Yes | Tenant records indexed by tenant ID. |
|
|
2197
|
+
| `placements` | `Record<string, LifecyclePlatformPlacement>` | Yes | Current routing assignments indexed by tenant ID. |
|
|
2198
|
+
| `backendMetadata` | `Record<string, LifecyclePlatformBackendMetadata>` | Yes | Nonsecret backend labels/provider capabilities indexed by backend ID. |
|
|
2199
|
+
| `migrationPlans` | `Record<string, BackendMigrationPlan>` | Yes | Reviewed backend migration plans indexed by migration ID. |
|
|
2200
|
+
| `migrationRecords` | `Record<string, LifecyclePlatformMigrationRecord>` | Yes | Execution/reconciliation records indexed by migration ID. |
|
|
2201
|
+
|
|
2202
|
+
### Returns
|
|
2203
|
+
|
|
2204
|
+
Type declaration; no runtime value.
|
|
2205
|
+
|
|
2206
|
+
### See also
|
|
2207
|
+
|
|
2208
|
+
PluginLifecycle for canonical integration usage.
|
|
2209
|
+
|
|
2210
|
+
### Public members
|
|
2211
|
+
|
|
2212
|
+
#### `tenants`
|
|
2213
|
+
|
|
2214
|
+
Tenant records indexed by tenant ID.
|
|
2215
|
+
|
|
2216
|
+
|
|
2217
|
+
#### `placements`
|
|
2218
|
+
|
|
2219
|
+
Current routing assignments indexed by tenant ID.
|
|
2220
|
+
|
|
2221
|
+
|
|
2222
|
+
#### `backendMetadata`
|
|
2223
|
+
|
|
2224
|
+
Nonsecret backend labels/provider capabilities indexed by backend ID.
|
|
2225
|
+
|
|
2226
|
+
|
|
2227
|
+
#### `migrationPlans`
|
|
2228
|
+
|
|
2229
|
+
Reviewed backend migration plans indexed by migration ID.
|
|
2230
|
+
|
|
2231
|
+
|
|
2232
|
+
#### `migrationRecords`
|
|
2233
|
+
|
|
2234
|
+
Execution/reconciliation records indexed by migration ID.
|
|
2235
|
+
|
|
2236
|
+
|
|
2237
|
+
|
|
2238
|
+
### Example
|
|
2239
|
+
|
|
2240
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
2241
|
+
|
|
2242
|
+
<a id="api-LifecyclePlatformTenant"></a>
|
|
2243
|
+
|
|
2244
|
+
## [INTERFACE] `LifecyclePlatformTenant`
|
|
2245
|
+
|
|
2246
|
+
Durable platform tenant metadata independent of business schemas.
|
|
2247
|
+
|
|
2248
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
2249
|
+
|
|
2250
|
+
### Signature
|
|
2251
|
+
|
|
2252
|
+
```typescript
|
|
2253
|
+
interface LifecyclePlatformTenant {
|
|
2254
|
+
id: string;
|
|
2255
|
+
name: string;
|
|
2256
|
+
active: boolean;
|
|
2257
|
+
domains: readonly string[];
|
|
2258
|
+
createdAt: string;
|
|
2259
|
+
updatedAt: string;
|
|
2260
|
+
}
|
|
2261
|
+
```
|
|
2262
|
+
|
|
2263
|
+
### Parameters
|
|
2264
|
+
|
|
2265
|
+
| Name | Type | Required | Description |
|
|
2266
|
+
| --- | --- | --- | --- |
|
|
2267
|
+
| `id` | `string` | Yes | Stable concrete tenant ID. |
|
|
2268
|
+
| `name` | `string` | Yes | Public tenant display name. |
|
|
2269
|
+
| `active` | `boolean` | Yes | Whether platform tenant admission is enabled; membership remains host-owned. |
|
|
2270
|
+
| `domains` | `readonly string[]` | Yes | Configured tenant lookup domains; domain mapping alone never proves membership. |
|
|
2271
|
+
| `createdAt` | `string` | Yes | Tenant creation timestamp. |
|
|
2272
|
+
| `updatedAt` | `string` | Yes | Latest metadata update timestamp. |
|
|
2273
|
+
|
|
2274
|
+
### Returns
|
|
2275
|
+
|
|
2276
|
+
Type declaration; no runtime value.
|
|
2277
|
+
|
|
2278
|
+
### See also
|
|
2279
|
+
|
|
2280
|
+
PluginLifecycle for canonical integration usage.
|
|
2281
|
+
|
|
2282
|
+
### Public members
|
|
2283
|
+
|
|
2284
|
+
#### `id`
|
|
2285
|
+
|
|
2286
|
+
Stable concrete tenant ID.
|
|
2287
|
+
|
|
2288
|
+
|
|
2289
|
+
#### `name`
|
|
2290
|
+
|
|
2291
|
+
Public tenant display name.
|
|
2292
|
+
|
|
2293
|
+
|
|
2294
|
+
#### `active`
|
|
2295
|
+
|
|
2296
|
+
Whether platform tenant admission is enabled; membership remains host-owned.
|
|
2297
|
+
|
|
2298
|
+
|
|
2299
|
+
#### `domains`
|
|
2300
|
+
|
|
2301
|
+
Configured tenant lookup domains; domain mapping alone never proves membership.
|
|
2302
|
+
|
|
2303
|
+
|
|
2304
|
+
#### `createdAt`
|
|
2305
|
+
|
|
2306
|
+
Tenant creation timestamp.
|
|
2307
|
+
|
|
2308
|
+
|
|
2309
|
+
#### `updatedAt`
|
|
2310
|
+
|
|
2311
|
+
Latest metadata update timestamp.
|
|
2312
|
+
|
|
2313
|
+
|
|
2314
|
+
|
|
2315
|
+
### Example
|
|
2316
|
+
|
|
2317
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
2318
|
+
|
|
2319
|
+
<a id="api-LifecyclePlugin"></a>
|
|
2320
|
+
|
|
2321
|
+
## [INTERFACE] `LifecyclePlugin`
|
|
2322
|
+
|
|
2323
|
+
Trusted release definition with feature dependencies, schema requirements and immutable migrations.
|
|
2324
|
+
|
|
2325
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
2326
|
+
|
|
2327
|
+
### Signature
|
|
2328
|
+
|
|
2329
|
+
```typescript
|
|
2330
|
+
interface LifecyclePlugin {
|
|
2331
|
+
id: string;
|
|
2332
|
+
version: string;
|
|
2333
|
+
framework: string;
|
|
2334
|
+
dependencies?: Record<string, string>;
|
|
2335
|
+
schemaDependencies?: Record<string, string>;
|
|
2336
|
+
schemaContracts?: DataContract[];
|
|
2337
|
+
migrations: PluginMigration[];
|
|
2338
|
+
infrastructure?: Record<string, unknown>;
|
|
2339
|
+
}
|
|
2340
|
+
```
|
|
2341
|
+
|
|
2342
|
+
### Parameters
|
|
2343
|
+
|
|
2344
|
+
| Name | Type | Required | Description |
|
|
2345
|
+
| --- | --- | --- | --- |
|
|
2346
|
+
| `id` | `string` | Yes | Registered feature identifier, up to 128 letters/digits/underscore/hyphen characters starting alphanumeric. |
|
|
2347
|
+
| `version` | `string` | Yes | Valid semantic release version; changed contents require a version bump. |
|
|
2348
|
+
| `framework` | `string` | Yes | Valid semver range for compatible framework versions. |
|
|
2349
|
+
| `dependencies` | `Record<string, string>` | No | Optional feature ID to semver range dependencies installed/enabled as a closure. |
|
|
2350
|
+
| `schemaDependencies` | `Record<string, string>` | No | Optional canonical data contract ranges; never installs or enables feature plugins. Storage dependencies do not install or enable a feature plugin. |
|
|
2351
|
+
| `schemaContracts` | `DataContract[]` | No | Optional canonical releases supplied by a data package; duplicate IDs must agree exactly. Canonical contract releases supplied by the data package, not inline table copies. |
|
|
2352
|
+
| `migrations` | `PluginMigration[]` | Yes | Append-only reviewed plugin migrations; contract-backed plugins must put DDL in data contracts instead. Immutable, reviewed migrations generated from the plugin's schema; never rewrite applied IDs. |
|
|
2353
|
+
| `infrastructure` | `Record<string, unknown>` | No | Optional nonsecret declarative host requirements; absence causes no infrastructure work. Declarative, host-defined resource requirements. No secrets. Absence means no infrastructure changes. |
|
|
2354
|
+
|
|
2355
|
+
### Returns
|
|
2356
|
+
|
|
2357
|
+
Type declaration; no runtime value.
|
|
2358
|
+
|
|
2359
|
+
### See also
|
|
2360
|
+
|
|
2361
|
+
PluginLifecycle for canonical integration usage.
|
|
2362
|
+
|
|
2363
|
+
### Public members
|
|
2364
|
+
|
|
2365
|
+
#### `id`
|
|
2366
|
+
|
|
2367
|
+
Registered feature identifier, up to 128 letters/digits/underscore/hyphen characters starting alphanumeric.
|
|
2368
|
+
|
|
2369
|
+
|
|
2370
|
+
#### `version`
|
|
2371
|
+
|
|
2372
|
+
Valid semantic release version; changed contents require a version bump.
|
|
2373
|
+
|
|
2374
|
+
|
|
2375
|
+
#### `framework`
|
|
2376
|
+
|
|
2377
|
+
Valid semver range for compatible framework versions.
|
|
2378
|
+
|
|
2379
|
+
|
|
2380
|
+
#### `dependencies`
|
|
2381
|
+
|
|
2382
|
+
Optional feature ID to semver range dependencies installed/enabled as a closure.
|
|
2383
|
+
|
|
2384
|
+
|
|
2385
|
+
#### `schemaDependencies`
|
|
2386
|
+
|
|
2387
|
+
Optional canonical data contract ranges; never installs or enables feature plugins.
|
|
2388
|
+
|
|
2389
|
+
Storage dependencies do not install or enable a feature plugin.
|
|
2390
|
+
|
|
2391
|
+
|
|
2392
|
+
#### `schemaContracts`
|
|
2393
|
+
|
|
2394
|
+
Optional canonical releases supplied by a data package; duplicate IDs must agree exactly.
|
|
2395
|
+
|
|
2396
|
+
Canonical contract releases supplied by the data package, not inline table copies.
|
|
2397
|
+
|
|
2398
|
+
|
|
2399
|
+
#### `migrations`
|
|
2400
|
+
|
|
2401
|
+
Append-only reviewed plugin migrations; contract-backed plugins must put DDL in data contracts instead.
|
|
2402
|
+
|
|
2403
|
+
Immutable, reviewed migrations generated from the plugin's schema; never rewrite applied IDs.
|
|
2404
|
+
|
|
2405
|
+
|
|
2406
|
+
#### `infrastructure`
|
|
2407
|
+
|
|
2408
|
+
Optional nonsecret declarative host requirements; absence causes no infrastructure work.
|
|
2409
|
+
|
|
2410
|
+
Declarative, host-defined resource requirements. No secrets. Absence means no infrastructure changes.
|
|
2411
|
+
|
|
2412
|
+
|
|
2413
|
+
|
|
2414
|
+
### Example
|
|
2415
|
+
|
|
2416
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
2417
|
+
|
|
2418
|
+
<a id="api-LifecycleProject"></a>
|
|
2419
|
+
|
|
2420
|
+
## [INTERFACE] `LifecycleProject`
|
|
2421
|
+
|
|
2422
|
+
Host-provided trusted release catalogs, durable lifecycle storage and side-effect adapters.
|
|
2423
|
+
|
|
2424
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
2425
|
+
|
|
2426
|
+
### Signature
|
|
2427
|
+
|
|
2428
|
+
```typescript
|
|
2429
|
+
interface LifecycleProject {
|
|
2430
|
+
store: LifecycleStore;
|
|
2431
|
+
backends: BackendTarget[];
|
|
2432
|
+
plugins: LifecyclePlugin[];
|
|
2433
|
+
dataContracts?: readonly DataContract[];
|
|
2434
|
+
bundles?: Record<string, readonly string[]>;
|
|
2435
|
+
migrate: (step: MigrationStep, backend: BackendTarget) => Promise<void>;
|
|
2436
|
+
quiesce?: (activations: LifecycleState['activations'][string][]) => Promise<void>;
|
|
2437
|
+
infrastructure?: {
|
|
2438
|
+
identity: string;
|
|
2439
|
+
preview(step: InfrastructureStep): Promise<unknown>;
|
|
2440
|
+
apply(step: InfrastructureStep): Promise<void>;
|
|
2441
|
+
};
|
|
2442
|
+
}
|
|
2443
|
+
```
|
|
2444
|
+
|
|
2445
|
+
### Parameters
|
|
2446
|
+
|
|
2447
|
+
| Name | Type | Required | Description |
|
|
2448
|
+
| --- | --- | --- | --- |
|
|
2449
|
+
| `store` | `LifecycleStore` | Yes | Cross-process locked atomic durable lifecycle store. |
|
|
2450
|
+
| `backends` | `BackendTarget[]` | Yes | Trusted configured backend catalog; existing physical identities are immutable. |
|
|
2451
|
+
| `plugins` | `LifecyclePlugin[]` | Yes | Trusted registered plugin releases; registration alone grants no tenant activation. |
|
|
2452
|
+
| `dataContracts` | `readonly DataContract[]` | No | Optional canonical schema contract releases, also collected from plugin schemaContracts. |
|
|
2453
|
+
| `bundles` | `Record<string, readonly string[]>` | No | Optional host aliases mapping bundle IDs to ordered registered feature IDs. |
|
|
2454
|
+
| `migrate` | `(step: MigrationStep, backend: BackendTarget) => Promise<void>` | Yes | Execute one reviewed migration step on the exact backend; reject failures so reconciliation state is recorded. |
|
|
2455
|
+
| `quiesce` | `(activations: LifecycleState['activations'][string][]) => Promise<void>` | No | Optional all-instance admission stop and active-work drain; required before upgrades affecting enabled activations. Stop admission and drain existing work on ALL affected backend instances before upgrades. |
|
|
2456
|
+
| `infrastructure` | `{ identity: string; preview(step: InfrastructureStep): Promise<unknown>; apply(step: InfrastructureStep): Promise<void>; }` | No | Optional named host preview/apply capability; no credentials belong in declarative plugin settings. |
|
|
2457
|
+
|
|
2458
|
+
### Returns
|
|
2459
|
+
|
|
2460
|
+
Type declaration; no runtime value.
|
|
2461
|
+
|
|
2462
|
+
### See also
|
|
2463
|
+
|
|
2464
|
+
PluginLifecycle for canonical integration usage.
|
|
2465
|
+
|
|
2466
|
+
### Public members
|
|
2467
|
+
|
|
2468
|
+
#### `store`
|
|
2469
|
+
|
|
2470
|
+
Cross-process locked atomic durable lifecycle store.
|
|
2471
|
+
|
|
2472
|
+
|
|
2473
|
+
#### `backends`
|
|
2474
|
+
|
|
2475
|
+
Trusted configured backend catalog; existing physical identities are immutable.
|
|
2476
|
+
|
|
2477
|
+
|
|
2478
|
+
#### `plugins`
|
|
2479
|
+
|
|
2480
|
+
Trusted registered plugin releases; registration alone grants no tenant activation.
|
|
2481
|
+
|
|
2482
|
+
|
|
2483
|
+
#### `dataContracts`
|
|
2484
|
+
|
|
2485
|
+
Optional canonical schema contract releases, also collected from plugin schemaContracts.
|
|
2486
|
+
|
|
2487
|
+
|
|
2488
|
+
#### `bundles`
|
|
2489
|
+
|
|
2490
|
+
Optional host aliases mapping bundle IDs to ordered registered feature IDs.
|
|
2491
|
+
|
|
2492
|
+
|
|
2493
|
+
#### `migrate`
|
|
2494
|
+
|
|
2495
|
+
Execute one reviewed migration step on the exact backend; reject failures so reconciliation state is recorded.
|
|
2496
|
+
|
|
2497
|
+
Parameters:
|
|
2498
|
+
|
|
2499
|
+
- `step`: Exact planned infrastructure step and target digest; do not reinterpret unreviewed settings.
|
|
2500
|
+
- `backend`: Already-provisioned opaque backend declaration; never a connection string or credentials.
|
|
2501
|
+
|
|
2502
|
+
Returns: Resolves without a value after the reviewed host side effect completes.
|
|
2503
|
+
|
|
2504
|
+
### Errors and rejections
|
|
2505
|
+
|
|
2506
|
+
Host adapter or callback failures reject the returned Promise; side effects may already be partially complete.
|
|
2507
|
+
|
|
2508
|
+
|
|
2509
|
+
#### `quiesce`
|
|
2510
|
+
|
|
2511
|
+
Optional all-instance admission stop and active-work drain; required before upgrades affecting enabled activations.
|
|
2512
|
+
|
|
2513
|
+
Stop admission and drain existing work on ALL affected backend instances before upgrades.
|
|
2514
|
+
|
|
2515
|
+
Parameters:
|
|
2516
|
+
|
|
2517
|
+
- `activations`: Host operation input bound to the scope described by this member.
|
|
2518
|
+
|
|
2519
|
+
Returns: Resolves without a value after the reviewed host side effect completes.
|
|
2520
|
+
|
|
2521
|
+
### Errors and rejections
|
|
2522
|
+
|
|
2523
|
+
Host adapter or callback failures reject the returned Promise; side effects may already be partially complete.
|
|
2524
|
+
|
|
2525
|
+
|
|
2526
|
+
#### `infrastructure`
|
|
2527
|
+
|
|
2528
|
+
Optional named host preview/apply capability; no credentials belong in declarative plugin settings.
|
|
2529
|
+
|
|
2530
|
+
|
|
2531
|
+
#### `infrastructure.identity`
|
|
2532
|
+
|
|
2533
|
+
Stable nonsecret infrastructure-provider identity bound into reviewed plans.
|
|
2534
|
+
|
|
2535
|
+
|
|
2536
|
+
#### `infrastructure.preview`
|
|
2537
|
+
|
|
2538
|
+
Preview one exact infrastructure step; host must not claim application completion from preview.
|
|
2539
|
+
|
|
2540
|
+
Parameters:
|
|
2541
|
+
|
|
2542
|
+
- `step`: Exact reviewed infrastructure step for the configured backend.
|
|
2543
|
+
|
|
2544
|
+
Returns: Host preview information; no apply result is implied.
|
|
2545
|
+
|
|
2546
|
+
### Errors and rejections
|
|
2547
|
+
|
|
2548
|
+
Rejects host adapter failures; effects may already have partially completed.
|
|
2549
|
+
|
|
2550
|
+
Example:
|
|
2551
|
+
|
|
2552
|
+
```typescript
|
|
2553
|
+
import type { LifecycleProject, InfrastructureStep } from '@alneas/eaos-server/lifecycle-engine';
|
|
2554
|
+
export async function previewInfrastructure(project: LifecycleProject, step: InfrastructureStep) {
|
|
2555
|
+
if (!project.infrastructure) throw new Error("Host infrastructure port required");
|
|
2556
|
+
return project.infrastructure.preview(step);
|
|
2557
|
+
}
|
|
2558
|
+
```
|
|
2559
|
+
|
|
2560
|
+
|
|
2561
|
+
#### `infrastructure.apply`
|
|
2562
|
+
|
|
2563
|
+
Apply one reviewed infrastructure step; errors leave reconciliation state and may follow partial external success.
|
|
2564
|
+
|
|
2565
|
+
Parameters:
|
|
2566
|
+
|
|
2567
|
+
- `step`: Exact reviewed infrastructure step for the configured backend.
|
|
2568
|
+
|
|
2569
|
+
Returns: Resolves without a value after host application completes.
|
|
2570
|
+
|
|
2571
|
+
### Errors and rejections
|
|
2572
|
+
|
|
2573
|
+
Rejects host adapter failures; effects may already have partially completed.
|
|
2574
|
+
|
|
2575
|
+
Example:
|
|
2576
|
+
|
|
2577
|
+
```typescript
|
|
2578
|
+
import type { LifecycleProject, InfrastructureStep } from '@alneas/eaos-server/lifecycle-engine';
|
|
2579
|
+
export async function applyInfrastructure(project: LifecycleProject, step: InfrastructureStep) {
|
|
2580
|
+
if (!project.infrastructure) throw new Error("Host infrastructure port required");
|
|
2581
|
+
await project.infrastructure.apply(step);
|
|
2582
|
+
}
|
|
2583
|
+
```
|
|
2584
|
+
|
|
2585
|
+
|
|
2586
|
+
|
|
2587
|
+
### Example
|
|
2588
|
+
|
|
2589
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
2590
|
+
|
|
2591
|
+
<a id="api-LifecycleRequest"></a>
|
|
2592
|
+
|
|
2593
|
+
## [INTERFACE] `LifecycleRequest`
|
|
2594
|
+
|
|
2595
|
+
Concrete lifecycle operation scoped to one registered backend and verified tenant.
|
|
2596
|
+
|
|
2597
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
2598
|
+
|
|
2599
|
+
### Signature
|
|
2600
|
+
|
|
2601
|
+
```typescript
|
|
2602
|
+
interface LifecycleRequest {
|
|
2603
|
+
operation: Operation;
|
|
2604
|
+
pluginId: string;
|
|
2605
|
+
backendId: string;
|
|
2606
|
+
tenantId: string;
|
|
2607
|
+
}
|
|
2608
|
+
```
|
|
2609
|
+
|
|
2610
|
+
### Parameters
|
|
2611
|
+
|
|
2612
|
+
| Name | Type | Required | Description |
|
|
2613
|
+
| --- | --- | --- | --- |
|
|
2614
|
+
| `operation` | `Operation` | Yes | Requested install/update/enable/disable/uninstall transition. |
|
|
2615
|
+
| `pluginId` | `string` | Yes | Registered plugin ID, or bundle ID for bundle planning. |
|
|
2616
|
+
| `backendId` | `string` | Yes | Registered execution backend ID. |
|
|
2617
|
+
| `tenantId` | `string` | Yes | Verified concrete tenant; must match dedicated backend scope. |
|
|
2618
|
+
|
|
2619
|
+
### Returns
|
|
2620
|
+
|
|
2621
|
+
Type declaration; no runtime value.
|
|
2622
|
+
|
|
2623
|
+
### See also
|
|
2624
|
+
|
|
2625
|
+
PluginLifecycle for canonical integration usage.
|
|
2626
|
+
|
|
2627
|
+
### Public members
|
|
2628
|
+
|
|
2629
|
+
#### `operation`
|
|
2630
|
+
|
|
2631
|
+
Requested install/update/enable/disable/uninstall transition.
|
|
2632
|
+
|
|
2633
|
+
|
|
2634
|
+
#### `pluginId`
|
|
2635
|
+
|
|
2636
|
+
Registered plugin ID, or bundle ID for bundle planning.
|
|
2637
|
+
|
|
2638
|
+
|
|
2639
|
+
#### `backendId`
|
|
2640
|
+
|
|
2641
|
+
Registered execution backend ID.
|
|
2642
|
+
|
|
2643
|
+
|
|
2644
|
+
#### `tenantId`
|
|
2645
|
+
|
|
2646
|
+
Verified concrete tenant; must match dedicated backend scope.
|
|
2647
|
+
|
|
2648
|
+
|
|
2649
|
+
|
|
2650
|
+
### Example
|
|
2651
|
+
|
|
2652
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
2653
|
+
|
|
2654
|
+
<a id="api-LifecycleState"></a>
|
|
2655
|
+
|
|
2656
|
+
## [INTERFACE] `LifecycleState`
|
|
2657
|
+
|
|
2658
|
+
Versioned durable control ledger for plugin readiness, schema history and platform placement.
|
|
2659
|
+
|
|
2660
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
2661
|
+
|
|
2662
|
+
### Signature
|
|
2663
|
+
|
|
2664
|
+
```typescript
|
|
2665
|
+
interface LifecycleState {
|
|
2666
|
+
baselineHistory?: Record<string, {
|
|
2667
|
+
hash: string;
|
|
2668
|
+
source: DataContract;
|
|
2669
|
+
migrations: Record<string, MigrationRecord>;
|
|
2670
|
+
}>;
|
|
2671
|
+
format: 1;
|
|
2672
|
+
revision: number;
|
|
2673
|
+
backends: Record<string, BackendTarget>;
|
|
2674
|
+
installations: Record<string, Installation>;
|
|
2675
|
+
activations: Record<string, {
|
|
2676
|
+
backendId: string;
|
|
2677
|
+
tenantId: string;
|
|
2678
|
+
pluginId: string;
|
|
2679
|
+
digest: string;
|
|
2680
|
+
enabled: boolean;
|
|
2681
|
+
}>;
|
|
2682
|
+
migrations: Record<string, MigrationRecord>;
|
|
2683
|
+
infrastructure: Record<string, {
|
|
2684
|
+
digest: string;
|
|
2685
|
+
status: 'running' | 'applied' | 'failed';
|
|
2686
|
+
}>;
|
|
2687
|
+
platform: LifecyclePlatformState;
|
|
2688
|
+
dataContracts?: Record<string, {
|
|
2689
|
+
contract: DataContract;
|
|
2690
|
+
digest: string;
|
|
2691
|
+
status: 'installing' | 'installed' | 'failed';
|
|
2692
|
+
}>;
|
|
2693
|
+
}
|
|
2694
|
+
```
|
|
2695
|
+
|
|
2696
|
+
### Parameters
|
|
2697
|
+
|
|
2698
|
+
| Name | Type | Required | Description |
|
|
2699
|
+
| --- | --- | --- | --- |
|
|
2700
|
+
| `baselineHistory` | `Record<string, { hash: string; source: DataContract; migrations: Record<string, MigrationRecord>; }>` | No | Optional archived exact histories replaced by reviewed baselines. |
|
|
2701
|
+
| `format` | `1` | Yes | Persistent ledger discriminator; currently 1. |
|
|
2702
|
+
| `revision` | `number` | Yes | Nonnegative safe integer incremented on persisted lifecycle changes. |
|
|
2703
|
+
| `backends` | `Record<string, BackendTarget>` | Yes | Opaque backend target definitions indexed by backend ID. |
|
|
2704
|
+
| `installations` | `Record<string, Installation>` | Yes | Release snapshots indexed by JSON [backendId, pluginId]. |
|
|
2705
|
+
| `activations` | `Record<string, { backendId: string; tenantId: string; pluginId: string; digest: string; enabled: boolean; }>` | Yes | Requested tenant activation records indexed by JSON [backendId, tenantId, pluginId]; effective readiness is checked separately. |
|
|
2706
|
+
| `migrations` | `Record<string, MigrationRecord>` | Yes | Progress indexed by JSON [databaseId, migrationIdentity, migrationId, tenantId-or-*]. |
|
|
2707
|
+
| `infrastructure` | `Record<string, { digest: string; status: 'running' \| 'applied' \| 'failed'; }>` | Yes | Infrastructure digests/progress indexed by JSON [backendId, pluginId]. |
|
|
2708
|
+
| `platform` | `LifecyclePlatformState` | Yes | Tenant/control-plane metadata and backend migration evidence. |
|
|
2709
|
+
| `dataContracts` | `Record<string, { contract: DataContract; digest: string; status: 'installing' \| 'installed' \| 'failed'; }>` | No | Optional canonical contract installation records indexed by JSON [databaseId, contractId]. |
|
|
2710
|
+
|
|
2711
|
+
### Returns
|
|
2712
|
+
|
|
2713
|
+
Type declaration; no runtime value.
|
|
2714
|
+
|
|
2715
|
+
### See also
|
|
2716
|
+
|
|
2717
|
+
PluginLifecycle for canonical integration usage.
|
|
2718
|
+
|
|
2719
|
+
### Public members
|
|
2720
|
+
|
|
2721
|
+
#### `baselineHistory`
|
|
2722
|
+
|
|
2723
|
+
Optional archived exact histories replaced by reviewed baselines.
|
|
2724
|
+
|
|
2725
|
+
|
|
2726
|
+
#### `baselineHistory.hash`
|
|
2727
|
+
|
|
2728
|
+
Exact archived baseline integrity hash.
|
|
2729
|
+
|
|
2730
|
+
|
|
2731
|
+
#### `baselineHistory.source`
|
|
2732
|
+
|
|
2733
|
+
Original canonical contract release retained for historical evidence.
|
|
2734
|
+
|
|
2735
|
+
|
|
2736
|
+
#### `baselineHistory.migrations`
|
|
2737
|
+
|
|
2738
|
+
Archived exact applied migration receipts.
|
|
2739
|
+
|
|
2740
|
+
|
|
2741
|
+
#### `format`
|
|
2742
|
+
|
|
2743
|
+
Persistent ledger discriminator; currently 1.
|
|
2744
|
+
|
|
2745
|
+
|
|
2746
|
+
#### `revision`
|
|
2747
|
+
|
|
2748
|
+
Nonnegative safe integer incremented on persisted lifecycle changes.
|
|
2749
|
+
|
|
2750
|
+
|
|
2751
|
+
#### `backends`
|
|
2752
|
+
|
|
2753
|
+
Opaque backend target definitions indexed by backend ID.
|
|
2754
|
+
|
|
2755
|
+
|
|
2756
|
+
#### `installations`
|
|
2757
|
+
|
|
2758
|
+
Release snapshots indexed by JSON [backendId, pluginId].
|
|
2759
|
+
|
|
2760
|
+
|
|
2761
|
+
#### `activations`
|
|
2762
|
+
|
|
2763
|
+
Requested tenant activation records indexed by JSON [backendId, tenantId, pluginId]; effective readiness is checked separately.
|
|
2764
|
+
|
|
2765
|
+
|
|
2766
|
+
#### `activations.backendId`
|
|
2767
|
+
|
|
2768
|
+
Registered execution backend owning this activation.
|
|
2769
|
+
|
|
2770
|
+
|
|
2771
|
+
#### `activations.tenantId`
|
|
2772
|
+
|
|
2773
|
+
Concrete verified tenant owning this activation.
|
|
2774
|
+
|
|
2775
|
+
|
|
2776
|
+
#### `activations.pluginId`
|
|
2777
|
+
|
|
2778
|
+
Registered feature ID requested for activation.
|
|
2779
|
+
|
|
2780
|
+
|
|
2781
|
+
#### `activations.digest`
|
|
2782
|
+
|
|
2783
|
+
Canonical release or infrastructure definition digest.
|
|
2784
|
+
|
|
2785
|
+
|
|
2786
|
+
#### `activations.enabled`
|
|
2787
|
+
|
|
2788
|
+
Requested activation flag; effective readiness also requires matching installed digests and dependencies.
|
|
2789
|
+
|
|
2790
|
+
|
|
2791
|
+
#### `migrations`
|
|
2792
|
+
|
|
2793
|
+
Progress indexed by JSON [databaseId, migrationIdentity, migrationId, tenantId-or-*].
|
|
2794
|
+
|
|
2795
|
+
|
|
2796
|
+
#### `infrastructure`
|
|
2797
|
+
|
|
2798
|
+
Infrastructure digests/progress indexed by JSON [backendId, pluginId].
|
|
2799
|
+
|
|
2800
|
+
|
|
2801
|
+
#### `infrastructure.digest`
|
|
2802
|
+
|
|
2803
|
+
Canonical release or infrastructure definition digest.
|
|
2804
|
+
|
|
2805
|
+
|
|
2806
|
+
#### `infrastructure.status`
|
|
2807
|
+
|
|
2808
|
+
Persisted installing/installed/failed or running/applied/failed progress, according to this ledger map.
|
|
2809
|
+
|
|
2810
|
+
|
|
2811
|
+
#### `platform`
|
|
2812
|
+
|
|
2813
|
+
Tenant/control-plane metadata and backend migration evidence.
|
|
2814
|
+
|
|
2815
|
+
|
|
2816
|
+
#### `dataContracts`
|
|
2817
|
+
|
|
2818
|
+
Optional canonical contract installation records indexed by JSON [databaseId, contractId].
|
|
2819
|
+
|
|
2820
|
+
|
|
2821
|
+
#### `dataContracts.contract`
|
|
2822
|
+
|
|
2823
|
+
Canonical schema contract release bound by its stored digest.
|
|
2824
|
+
|
|
2825
|
+
|
|
2826
|
+
#### `dataContracts.digest`
|
|
2827
|
+
|
|
2828
|
+
Canonical release or infrastructure definition digest.
|
|
2829
|
+
|
|
2830
|
+
|
|
2831
|
+
#### `dataContracts.status`
|
|
2832
|
+
|
|
2833
|
+
Persisted installing/installed/failed or running/applied/failed progress, according to this ledger map.
|
|
2834
|
+
|
|
2835
|
+
|
|
2836
|
+
|
|
2837
|
+
### Example
|
|
2838
|
+
|
|
2839
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
2840
|
+
|
|
2841
|
+
<a id="api-LifecycleStore"></a>
|
|
2842
|
+
|
|
2843
|
+
## [INTERFACE] `LifecycleStore`
|
|
2844
|
+
|
|
2845
|
+
Durable lifecycle reads and cross-process exclusive writer coordination.
|
|
2846
|
+
|
|
2847
|
+
|
|
2848
|
+
withLock must exclude every other writer, across processes. Reads must observe atomic committed snapshots.
|
|
2849
|
+
|
|
2850
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
2851
|
+
|
|
2852
|
+
### Signature
|
|
2853
|
+
|
|
2854
|
+
```typescript
|
|
2855
|
+
interface LifecycleStore extends Pick<LifecycleWriter, 'read'> {
|
|
2856
|
+
withLock<T>(fn: (writer: LifecycleWriter) => Promise<T>): Promise<T>;
|
|
2857
|
+
}
|
|
2858
|
+
```
|
|
2859
|
+
|
|
2860
|
+
### Parameters
|
|
2861
|
+
|
|
2862
|
+
| Name | Type | Required | Description |
|
|
2863
|
+
| --- | --- | --- | --- |
|
|
2864
|
+
| `withLock` | `Promise<T>` | Yes | Exclude every competing writer across processes and hold the lock until the async callback settles; release on success or failure. |
|
|
2865
|
+
|
|
2866
|
+
### Returns
|
|
2867
|
+
|
|
2868
|
+
Type declaration; no runtime value.
|
|
2869
|
+
|
|
2870
|
+
### See also
|
|
2871
|
+
|
|
2872
|
+
PluginLifecycle for canonical integration usage.
|
|
2873
|
+
|
|
2874
|
+
### Public members
|
|
2875
|
+
|
|
2876
|
+
#### `withLock`
|
|
2877
|
+
|
|
2878
|
+
Exclude every competing writer across processes and hold the lock until the async callback settles; release on success or failure.
|
|
2879
|
+
|
|
2880
|
+
Parameters:
|
|
2881
|
+
|
|
2882
|
+
- `fn`: Async work invoked only while holding exclusive writer ownership; receives atomic read/write capabilities.
|
|
2883
|
+
|
|
2884
|
+
Returns: The callback result after its lock is released; the lock is also released on failure.
|
|
2885
|
+
|
|
2886
|
+
### Type parameters
|
|
2887
|
+
|
|
2888
|
+
- `T`: Result resolved by the exclusive-lock callback.
|
|
2889
|
+
|
|
2890
|
+
### Errors and rejections
|
|
2891
|
+
|
|
2892
|
+
Host adapter or callback failures reject the returned Promise; side effects may already be partially complete.
|
|
2893
|
+
|
|
2894
|
+
Example:
|
|
2895
|
+
|
|
2896
|
+
```typescript
|
|
2897
|
+
import type { LifecycleStore } from '@alneas/eaos-server/lifecycle-engine';
|
|
2898
|
+
export async function snapshot(store: LifecycleStore) {
|
|
2899
|
+
return store.withLock(async writer => writer.read());
|
|
2900
|
+
}
|
|
2901
|
+
```
|
|
2902
|
+
|
|
2903
|
+
|
|
2904
|
+
|
|
2905
|
+
### Example
|
|
2906
|
+
|
|
2907
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
2908
|
+
|
|
2909
|
+
<a id="api-LifecycleWriter"></a>
|
|
2910
|
+
|
|
2911
|
+
## [INTERFACE] `LifecycleWriter`
|
|
2912
|
+
|
|
2913
|
+
Atomic lifecycle snapshot access made available inside the host's exclusive lock.
|
|
2914
|
+
|
|
2915
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
2916
|
+
|
|
2917
|
+
### Signature
|
|
2918
|
+
|
|
2919
|
+
```typescript
|
|
2920
|
+
interface LifecycleWriter {
|
|
2921
|
+
read(): Promise<LifecycleState>;
|
|
2922
|
+
write(state: LifecycleState): Promise<void>;
|
|
2923
|
+
}
|
|
2924
|
+
```
|
|
2925
|
+
|
|
2926
|
+
### Parameters
|
|
2927
|
+
|
|
2928
|
+
| Name | Type | Required | Description |
|
|
2929
|
+
| --- | --- | --- | --- |
|
|
2930
|
+
| `read` | `Promise<LifecycleState>` | Yes | Read the currently committed ledger snapshot; must not expose uncommitted writes. |
|
|
2931
|
+
| `write` | `Promise<void>` | Yes | Atomically persist the complete next snapshot; resolve only after durable completion. |
|
|
2932
|
+
|
|
2933
|
+
### Returns
|
|
2934
|
+
|
|
2935
|
+
Type declaration; no runtime value.
|
|
2936
|
+
|
|
2937
|
+
### See also
|
|
2938
|
+
|
|
2939
|
+
PluginLifecycle for canonical integration usage.
|
|
2940
|
+
|
|
2941
|
+
### Public members
|
|
2942
|
+
|
|
2943
|
+
#### `read`
|
|
2944
|
+
|
|
2945
|
+
Read the currently committed ledger snapshot; must not expose uncommitted writes.
|
|
2946
|
+
|
|
2947
|
+
Returns: The currently committed atomic ledger snapshot.
|
|
2948
|
+
|
|
2949
|
+
### Errors and rejections
|
|
2950
|
+
|
|
2951
|
+
Host adapter or callback failures reject the returned Promise; side effects may already be partially complete.
|
|
2952
|
+
|
|
2953
|
+
Example:
|
|
2954
|
+
|
|
2955
|
+
```typescript
|
|
2956
|
+
import type { LifecycleStore } from '@alneas/eaos-server/lifecycle-engine';
|
|
2957
|
+
export async function readLocked(store: LifecycleStore) {
|
|
2958
|
+
return store.withLock(async writer => writer.read());
|
|
2959
|
+
}
|
|
2960
|
+
```
|
|
2961
|
+
|
|
2962
|
+
|
|
2963
|
+
#### `write`
|
|
2964
|
+
|
|
2965
|
+
Atomically persist the complete next snapshot; resolve only after durable completion.
|
|
2966
|
+
|
|
2967
|
+
Parameters:
|
|
2968
|
+
|
|
2969
|
+
- `state`: Complete next ledger snapshot with updated revision and control metadata.
|
|
2970
|
+
|
|
2971
|
+
Returns: Resolves without a value after the complete snapshot is durably committed.
|
|
2972
|
+
|
|
2973
|
+
### Errors and rejections
|
|
2974
|
+
|
|
2975
|
+
Host adapter or callback failures reject the returned Promise; side effects may already be partially complete.
|
|
2976
|
+
|
|
2977
|
+
Example:
|
|
2978
|
+
|
|
2979
|
+
```typescript
|
|
2980
|
+
import type { LifecycleStore } from '@alneas/eaos-server/lifecycle-engine';
|
|
2981
|
+
export async function persistReviewedRevision(store: LifecycleStore) {
|
|
2982
|
+
await store.withLock(async writer => {
|
|
2983
|
+
const state = await writer.read();
|
|
2984
|
+
// Domain changes belong in the same reviewed writer callback.
|
|
2985
|
+
state.revision += 1;
|
|
2986
|
+
await writer.write(state);
|
|
2987
|
+
});
|
|
2988
|
+
}
|
|
2989
|
+
```
|
|
2990
|
+
|
|
2991
|
+
|
|
2992
|
+
|
|
2993
|
+
### Example
|
|
2994
|
+
|
|
2995
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
2996
|
+
|
|
2997
|
+
<a id="api-MigrationRecord"></a>
|
|
2998
|
+
|
|
2999
|
+
## [INTERFACE] `MigrationRecord`
|
|
3000
|
+
|
|
3001
|
+
Durable per-database/tenant migration progress and immutable definition checksum.
|
|
3002
|
+
|
|
3003
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
3004
|
+
|
|
3005
|
+
### Signature
|
|
3006
|
+
|
|
3007
|
+
```typescript
|
|
3008
|
+
interface MigrationRecord {
|
|
3009
|
+
databaseId: string;
|
|
3010
|
+
pluginId: string;
|
|
3011
|
+
migrationId: string;
|
|
3012
|
+
position: number;
|
|
3013
|
+
tenantId: string | null;
|
|
3014
|
+
checksum: string;
|
|
3015
|
+
status: 'running' | 'applied' | 'failed';
|
|
3016
|
+
}
|
|
3017
|
+
```
|
|
3018
|
+
|
|
3019
|
+
### Parameters
|
|
3020
|
+
|
|
3021
|
+
| Name | Type | Required | Description |
|
|
3022
|
+
| --- | --- | --- | --- |
|
|
3023
|
+
| `databaseId` | `string` | Yes | Physical database on which the migration executes. |
|
|
3024
|
+
| `pluginId` | `string` | Yes | Plugin or canonical data-contract migration identity. |
|
|
3025
|
+
| `migrationId` | `string` | Yes | Immutable migration definition ID. |
|
|
3026
|
+
| `position` | `number` | Yes | Zero-based position in the append-only migration history. |
|
|
3027
|
+
| `tenantId` | `string \| null` | Yes | Concrete tenant for tenant-scoped work, or null for database scope. |
|
|
3028
|
+
| `checksum` | `string` | Yes | Canonical definition digest used to detect rewritten applied SQL. |
|
|
3029
|
+
| `status` | `'running' \| 'applied' \| 'failed'` | Yes | Running/applied/failed progress; running and failed require reconciliation before planning further changes. |
|
|
3030
|
+
|
|
3031
|
+
### Returns
|
|
3032
|
+
|
|
3033
|
+
Type declaration; no runtime value.
|
|
3034
|
+
|
|
3035
|
+
### See also
|
|
3036
|
+
|
|
3037
|
+
PluginLifecycle for canonical integration usage.
|
|
3038
|
+
|
|
3039
|
+
### Public members
|
|
3040
|
+
|
|
3041
|
+
#### `databaseId`
|
|
3042
|
+
|
|
3043
|
+
Physical database on which the migration executes.
|
|
3044
|
+
|
|
3045
|
+
|
|
3046
|
+
#### `pluginId`
|
|
3047
|
+
|
|
3048
|
+
Plugin or canonical data-contract migration identity.
|
|
3049
|
+
|
|
3050
|
+
|
|
3051
|
+
#### `migrationId`
|
|
3052
|
+
|
|
3053
|
+
Immutable migration definition ID.
|
|
3054
|
+
|
|
3055
|
+
|
|
3056
|
+
#### `position`
|
|
3057
|
+
|
|
3058
|
+
Zero-based position in the append-only migration history.
|
|
3059
|
+
|
|
3060
|
+
|
|
3061
|
+
#### `tenantId`
|
|
3062
|
+
|
|
3063
|
+
Concrete tenant for tenant-scoped work, or null for database scope.
|
|
3064
|
+
|
|
3065
|
+
|
|
3066
|
+
#### `checksum`
|
|
3067
|
+
|
|
3068
|
+
Canonical definition digest used to detect rewritten applied SQL.
|
|
3069
|
+
|
|
3070
|
+
|
|
3071
|
+
#### `status`
|
|
3072
|
+
|
|
3073
|
+
Running/applied/failed progress; running and failed require reconciliation before planning further changes.
|
|
3074
|
+
|
|
3075
|
+
|
|
3076
|
+
|
|
3077
|
+
### Example
|
|
3078
|
+
|
|
3079
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
3080
|
+
|
|
3081
|
+
<a id="api-MigrationStep"></a>
|
|
3082
|
+
|
|
3083
|
+
## [INTERFACE] `MigrationStep`
|
|
3084
|
+
|
|
3085
|
+
Planned migration ledger identity and ordered SQL to execute on one physical target.
|
|
3086
|
+
|
|
3087
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
3088
|
+
|
|
3089
|
+
### Signature
|
|
3090
|
+
|
|
3091
|
+
```typescript
|
|
3092
|
+
interface MigrationStep {
|
|
3093
|
+
key: string;
|
|
3094
|
+
record: MigrationRecord;
|
|
3095
|
+
statements: string[];
|
|
3096
|
+
}
|
|
3097
|
+
```
|
|
3098
|
+
|
|
3099
|
+
### Parameters
|
|
3100
|
+
|
|
3101
|
+
| Name | Type | Required | Description |
|
|
3102
|
+
| --- | --- | --- | --- |
|
|
3103
|
+
| `key` | `string` | Yes | Exact ledger map key for this migration and scope. |
|
|
3104
|
+
| `record` | `MigrationRecord` | Yes | Initial running migration receipt with immutable checksum. |
|
|
3105
|
+
| `statements` | `string[]` | Yes | Reviewed target-dialect SQL executed in order by the host migrate adapter. |
|
|
3106
|
+
|
|
3107
|
+
### Returns
|
|
3108
|
+
|
|
3109
|
+
Type declaration; no runtime value.
|
|
3110
|
+
|
|
3111
|
+
### See also
|
|
3112
|
+
|
|
3113
|
+
PluginLifecycle for canonical integration usage.
|
|
3114
|
+
|
|
3115
|
+
### Public members
|
|
3116
|
+
|
|
3117
|
+
#### `key`
|
|
3118
|
+
|
|
3119
|
+
Exact ledger map key for this migration and scope.
|
|
3120
|
+
|
|
3121
|
+
|
|
3122
|
+
#### `record`
|
|
3123
|
+
|
|
3124
|
+
Initial running migration receipt with immutable checksum.
|
|
3125
|
+
|
|
3126
|
+
|
|
3127
|
+
#### `statements`
|
|
3128
|
+
|
|
3129
|
+
Reviewed target-dialect SQL executed in order by the host migrate adapter.
|
|
3130
|
+
|
|
3131
|
+
|
|
3132
|
+
|
|
3133
|
+
### Example
|
|
3134
|
+
|
|
3135
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
3136
|
+
|
|
3137
|
+
<a id="api-normalizeLifecycleState"></a>
|
|
3138
|
+
|
|
3139
|
+
## [FUNCTION] `normalizeLifecycleState`
|
|
3140
|
+
|
|
3141
|
+
Clones a historical ledger snapshot and fills missing platform maps without rewriting storage.
|
|
3142
|
+
|
|
3143
|
+
Add fields introduced after the original snapshot format without rewriting old control rows on read.
|
|
3144
|
+
|
|
3145
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
3146
|
+
|
|
3147
|
+
### Signature
|
|
3148
|
+
|
|
3149
|
+
```typescript
|
|
3150
|
+
declare function normalizeLifecycleState(input: LifecycleState): LifecycleState;
|
|
3151
|
+
```
|
|
3152
|
+
|
|
3153
|
+
### Parameters
|
|
3154
|
+
|
|
3155
|
+
| Name | Type | Required | Description |
|
|
3156
|
+
| --- | --- | --- | --- |
|
|
3157
|
+
| `input` | `LifecycleState` | Yes | Historical state snapshot to normalize. |
|
|
3158
|
+
|
|
3159
|
+
### Returns
|
|
3160
|
+
|
|
3161
|
+
`LifecycleState`
|
|
3162
|
+
|
|
3163
|
+
A structured clone with a complete platform object; unrelated state validation remains the caller's responsibility.
|
|
3164
|
+
|
|
3165
|
+
### Errors and rejections
|
|
3166
|
+
|
|
3167
|
+
Error for nonobject input or malformed platform/maps; structuredClone errors propagate.
|
|
3168
|
+
|
|
3169
|
+
### Example
|
|
3170
|
+
|
|
3171
|
+
```typescript
|
|
3172
|
+
import { emptyLifecycleState, normalizeLifecycleState } from '@alneas/eaos-server/lifecycle-engine';
|
|
3173
|
+
const state = normalizeLifecycleState(emptyLifecycleState());
|
|
3174
|
+
```
|
|
3175
|
+
|
|
3176
|
+
|
|
3177
|
+
<a id="api-Operation"></a>
|
|
3178
|
+
|
|
3179
|
+
## [TYPE] `Operation`
|
|
3180
|
+
|
|
3181
|
+
Lifecycle change to installation or tenant activation; disable/uninstall retain business data.
|
|
3182
|
+
|
|
3183
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
3184
|
+
|
|
3185
|
+
### Signature
|
|
3186
|
+
|
|
3187
|
+
```typescript
|
|
3188
|
+
type Operation = 'install' | 'update' | 'enable' | 'disable' | 'uninstall';
|
|
3189
|
+
```
|
|
3190
|
+
|
|
3191
|
+
### Parameters
|
|
3192
|
+
|
|
3193
|
+
| Name | Type | Required | Description |
|
|
3194
|
+
| --- | --- | --- | --- |
|
|
3195
|
+
| — | — | — | No call parameters. |
|
|
3196
|
+
|
|
3197
|
+
### Returns
|
|
3198
|
+
|
|
3199
|
+
Type declaration; no runtime value.
|
|
3200
|
+
|
|
3201
|
+
### See also
|
|
3202
|
+
|
|
3203
|
+
PluginLifecycle for canonical integration usage.
|
|
3204
|
+
|
|
3205
|
+
### Example
|
|
3206
|
+
|
|
3207
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
3208
|
+
|
|
3209
|
+
<a id="api-planBackendMigration"></a>
|
|
3210
|
+
|
|
3211
|
+
## [FUNCTION] `planBackendMigration`
|
|
3212
|
+
|
|
3213
|
+
Creates a deterministic source-retaining migration plan without touching either database.
|
|
3214
|
+
|
|
3215
|
+
Create a reviewable fleet/tenant data-migration plan without touching either backend.
|
|
3216
|
+
|
|
3217
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`, `@alneas/eaos-server/lifecycle-engine/backend-migration`.
|
|
3218
|
+
|
|
3219
|
+
### Signature
|
|
3220
|
+
|
|
3221
|
+
```typescript
|
|
3222
|
+
declare function planBackendMigration(request: BackendMigrationRequest): BackendMigrationPlan;
|
|
3223
|
+
```
|
|
3224
|
+
|
|
3225
|
+
### Parameters
|
|
3226
|
+
|
|
3227
|
+
| Name | Type | Required | Description |
|
|
3228
|
+
| --- | --- | --- | --- |
|
|
3229
|
+
| `request` | `BackendMigrationRequest` | Yes | Reviewed distinct physical source/target backends, concrete tenant scope, nonempty unique plugin IDs, timestamp and reason. |
|
|
3230
|
+
|
|
3231
|
+
### Returns
|
|
3232
|
+
|
|
3233
|
+
`BackendMigrationPlan`
|
|
3234
|
+
|
|
3235
|
+
A shallow-frozen plan with sorted cloned scopes/plugin IDs and five ordered phases.
|
|
3236
|
+
|
|
3237
|
+
### Remarks
|
|
3238
|
+
|
|
3239
|
+
Dedicated backend tenants must appear in explicit tenant scope. No executor, lock, provisioning, copy or cutover runs during planning; host must implement quiescence.
|
|
3240
|
+
|
|
3241
|
+
### Errors and rejections
|
|
3242
|
+
|
|
3243
|
+
Error for malformed request, same source/target identity, invalid scope or dedicated-tenant mismatch.
|
|
3244
|
+
|
|
3245
|
+
### Example
|
|
3246
|
+
|
|
3247
|
+
```typescript
|
|
3248
|
+
import { planBackendMigration } from '@alneas/eaos-server/lifecycle-engine/backend-migration';
|
|
3249
|
+
const plan = planBackendMigration({ migrationId: 'move-1', source: { id: 'old', databaseId: 'db-old', dialect: 'sqlite', mode: 'shared' }, target: { id: 'new', databaseId: 'db-new', dialect: 'postgres', mode: 'shared' }, scope: { kind: 'tenants', tenantIds: ['sample'] }, pluginIds: ['reports'], requestedAt: '2026-01-01T00:00:00Z', reason: 'Reviewed backend move' });
|
|
3250
|
+
```
|
|
3251
|
+
|
|
3252
|
+
|
|
3253
|
+
<a id="api-PluginLifecycle"></a>
|
|
3254
|
+
|
|
3255
|
+
## [CLASS] `PluginLifecycle`
|
|
3256
|
+
|
|
3257
|
+
Plans and applies checksum-bound plugin/schema changes against an exclusively locked host ledger.
|
|
3258
|
+
|
|
3259
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
3260
|
+
|
|
3261
|
+
### Signature
|
|
3262
|
+
|
|
3263
|
+
```typescript
|
|
3264
|
+
declare class PluginLifecycle {
|
|
3265
|
+
readonly frameworkVersion: string;
|
|
3266
|
+
constructor(project: LifecycleProject, frameworkVersion?: string);
|
|
3267
|
+
planBundle(request: LifecycleRequest): Promise<LifecycleBundlePlan>;
|
|
3268
|
+
applyBundle(bundlePlan: LifecycleBundlePlan): Promise<void>;
|
|
3269
|
+
schemaCatalog(pluginIds?: readonly string[]): DataContractCatalog;
|
|
3270
|
+
plan(request: LifecycleRequest): Promise<LifecyclePlan>;
|
|
3271
|
+
isEnabled(backendId: string, tenantId: string, pluginId: string): Promise<boolean>;
|
|
3272
|
+
list(options?: {
|
|
3273
|
+
backendId?: string;
|
|
3274
|
+
tenantId?: string;
|
|
3275
|
+
}): Promise<LifecycleInventory>;
|
|
3276
|
+
run<T>(backendId: string, tenantId: string, pluginId: string, callback: () => Promise<T>): Promise<T>;
|
|
3277
|
+
preview(plan: LifecyclePlan): Promise<unknown[]>;
|
|
3278
|
+
apply(plan: LifecyclePlan): Promise<void>;
|
|
3279
|
+
}
|
|
3280
|
+
```
|
|
3281
|
+
|
|
3282
|
+
### Parameters
|
|
3283
|
+
|
|
3284
|
+
| Name | Type | Required | Description |
|
|
3285
|
+
| --- | --- | --- | --- |
|
|
3286
|
+
| `project` | `LifecycleProject` | Yes | Host lifecycle storage, trusted catalogs and execution adapters. |
|
|
3287
|
+
| `frameworkVersion` | `string` | No | Valid semver framework version; defaults to the installed package version. |
|
|
3288
|
+
|
|
3289
|
+
### Returns
|
|
3290
|
+
|
|
3291
|
+
`PluginLifecycle`
|
|
3292
|
+
|
|
3293
|
+
### Remarks
|
|
3294
|
+
|
|
3295
|
+
Server runtime uses Node crypto and semver. The host provides durable cross-process locking, tenant authorization, SQL migration execution and any infrastructure/quiesce adapters. Installation never implies tenant enablement; disable/uninstall retain data. Migration/infrastructure failures persist reconciliation state, and DDL is not rolled back automatically.
|
|
3296
|
+
|
|
3297
|
+
### Constructor contract
|
|
3298
|
+
|
|
3299
|
+
### Errors and rejections
|
|
3300
|
+
|
|
3301
|
+
Error for invalid/duplicate IDs, versions, migrations, conflicting schemas, unsupported backend configuration or unsatisfied contract dependencies.
|
|
3302
|
+
|
|
3303
|
+
### Public members
|
|
3304
|
+
|
|
3305
|
+
#### `planBundle`
|
|
3306
|
+
|
|
3307
|
+
Plans registered bundle members sequentially against a projected ledger state.
|
|
3308
|
+
|
|
3309
|
+
Parameters:
|
|
3310
|
+
|
|
3311
|
+
- `request`: Lifecycle request whose pluginId names a registered bundle.
|
|
3312
|
+
|
|
3313
|
+
Returns: A checksum-bound ordered bundle plan with each member's projected revision.
|
|
3314
|
+
|
|
3315
|
+
### Remarks
|
|
3316
|
+
|
|
3317
|
+
Disable/uninstall reverse bundle order. Planning executes no migrations or writes; projected revisions mirror member apply ordering.
|
|
3318
|
+
|
|
3319
|
+
### Errors and rejections
|
|
3320
|
+
|
|
3321
|
+
Rejects unknown bundle, invalid member request/state or propagated store failures.
|
|
3322
|
+
|
|
3323
|
+
Example:
|
|
3324
|
+
|
|
3325
|
+
```typescript
|
|
3326
|
+
import { PluginLifecycle, type LifecycleRequest } from '@alneas/eaos-server/lifecycle-engine';
|
|
3327
|
+
export function reviewBundle(lifecycle: PluginLifecycle, request: LifecycleRequest) { return lifecycle.planBundle(request); }
|
|
3328
|
+
```
|
|
3329
|
+
|
|
3330
|
+
|
|
3331
|
+
#### `applyBundle`
|
|
3332
|
+
|
|
3333
|
+
Validates a reviewed bundle plan and applies its member plans in sequence.
|
|
3334
|
+
|
|
3335
|
+
Parameters:
|
|
3336
|
+
|
|
3337
|
+
- `bundlePlan`: Unmodified checksum-bound bundle plan from planBundle.
|
|
3338
|
+
|
|
3339
|
+
Returns: Resolves without a value after every member apply completes.
|
|
3340
|
+
|
|
3341
|
+
### Remarks
|
|
3342
|
+
|
|
3343
|
+
Members acquire their own ledger locks. There is no all-or-nothing bundle transaction; earlier members remain applied if a later member fails. Replan/reconcile before retrying uncertain outcomes.
|
|
3344
|
+
|
|
3345
|
+
### Errors and rejections
|
|
3346
|
+
|
|
3347
|
+
Rejects modified/stale/misordered bundle plans, member apply failures and propagated host errors.
|
|
3348
|
+
|
|
3349
|
+
Example:
|
|
3350
|
+
|
|
3351
|
+
```typescript
|
|
3352
|
+
import { PluginLifecycle, type LifecycleBundlePlan } from '@alneas/eaos-server/lifecycle-engine';
|
|
3353
|
+
export function applyReviewedBundle(lifecycle: PluginLifecycle, plan: LifecycleBundlePlan) { return lifecycle.applyBundle(plan); }
|
|
3354
|
+
```
|
|
3355
|
+
|
|
3356
|
+
|
|
3357
|
+
#### `schemaCatalog`
|
|
3358
|
+
|
|
3359
|
+
Resolves the canonical schema dependency catalog for registered feature plugins.
|
|
3360
|
+
|
|
3361
|
+
Read-only complete schema inventory for the selected trusted feature catalog.
|
|
3362
|
+
|
|
3363
|
+
Parameters:
|
|
3364
|
+
|
|
3365
|
+
- `pluginIds`: Optional feature IDs; omitted includes all registered plugins, while an empty array selects none.
|
|
3366
|
+
|
|
3367
|
+
Returns: A JSON-cloned dependency-resolved DataContractCatalog.
|
|
3368
|
+
|
|
3369
|
+
### Remarks
|
|
3370
|
+
|
|
3371
|
+
Read-only; schema dependencies never install or enable feature plugins.
|
|
3372
|
+
|
|
3373
|
+
### Errors and rejections
|
|
3374
|
+
|
|
3375
|
+
Error for unknown/incompatible feature dependencies or invalid/conflicting contract requirements.
|
|
3376
|
+
|
|
3377
|
+
Example:
|
|
3378
|
+
|
|
3379
|
+
```typescript
|
|
3380
|
+
import { PluginLifecycle } from '@alneas/eaos-server/lifecycle-engine';
|
|
3381
|
+
export function schemas(lifecycle: PluginLifecycle) { return lifecycle.schemaCatalog(); }
|
|
3382
|
+
```
|
|
3383
|
+
|
|
3384
|
+
|
|
3385
|
+
#### `plan`
|
|
3386
|
+
|
|
3387
|
+
Creates a reviewable lifecycle plan from one current ledger snapshot without executing side effects.
|
|
3388
|
+
|
|
3389
|
+
Parameters:
|
|
3390
|
+
|
|
3391
|
+
- `request`: Concrete operation, registered plugin/backend and verified tenant; see LifecycleRequest.
|
|
3392
|
+
|
|
3393
|
+
Returns: A deterministic checksum-bound plan carrying the snapshot revision, dependency closure, migrations and retained-data policy.
|
|
3394
|
+
|
|
3395
|
+
### Remarks
|
|
3396
|
+
|
|
3397
|
+
Planning is read-only but may become stale immediately. Backend physical identity is immutable. Updates require appended immutable migrations and compatible schema versions; installation and enablement are separate operations.
|
|
3398
|
+
|
|
3399
|
+
### Errors and rejections
|
|
3400
|
+
|
|
3401
|
+
Rejects invalid request/state, incompatible or missing dependencies, changed applied migrations, dirty ledger, unsupported dialect, tenant mismatch or propagated store failures.
|
|
3402
|
+
|
|
3403
|
+
Example:
|
|
3404
|
+
|
|
3405
|
+
```typescript
|
|
3406
|
+
import { PluginLifecycle, type LifecycleRequest } from '@alneas/eaos-server/lifecycle-engine';
|
|
3407
|
+
export function review(lifecycle: PluginLifecycle, request: LifecycleRequest) { return lifecycle.plan(request); }
|
|
3408
|
+
```
|
|
3409
|
+
|
|
3410
|
+
|
|
3411
|
+
#### `isEnabled`
|
|
3412
|
+
|
|
3413
|
+
Checks that a tenant activation and its entire registered dependency closure match ready ledger releases.
|
|
3414
|
+
|
|
3415
|
+
Parameters:
|
|
3416
|
+
|
|
3417
|
+
- `backendId`: Registered execution backend ID.
|
|
3418
|
+
- `tenantId`: Verified concrete tenant ID.
|
|
3419
|
+
- `pluginId`: Registered feature ID to check.
|
|
3420
|
+
|
|
3421
|
+
Returns: True only when matching installation, migrations, infrastructure and activation digests are all ready; false for missing/incompatible readiness.
|
|
3422
|
+
|
|
3423
|
+
### Remarks
|
|
3424
|
+
|
|
3425
|
+
Read-only admission check; a later state change can revoke access. Host must still enforce current tenant/resource authorization.
|
|
3426
|
+
|
|
3427
|
+
### Errors and rejections
|
|
3428
|
+
|
|
3429
|
+
Rejects malformed IDs/state, unknown or mismatched backend/tenant and store failures.
|
|
3430
|
+
|
|
3431
|
+
Example:
|
|
3432
|
+
|
|
3433
|
+
```typescript
|
|
3434
|
+
import { PluginLifecycle } from '@alneas/eaos-server/lifecycle-engine';
|
|
3435
|
+
export function admitted(lifecycle: PluginLifecycle, backendId: string, tenantId: string, pluginId: string) { return lifecycle.isEnabled(backendId, tenantId, pluginId); }
|
|
3436
|
+
```
|
|
3437
|
+
|
|
3438
|
+
|
|
3439
|
+
#### `list`
|
|
3440
|
+
|
|
3441
|
+
Reads inventory including registered uninstalled code and orphaned historical installations.
|
|
3442
|
+
|
|
3443
|
+
One read-only control-state snapshot; includes orphaned installation records and registered, uninstalled code.
|
|
3444
|
+
|
|
3445
|
+
Parameters:
|
|
3446
|
+
|
|
3447
|
+
- `options`: Optional backendId and tenantId filters; omitted returns all known inventory.
|
|
3448
|
+
|
|
3449
|
+
Returns: A revision-bound inventory with effective enabled state distinct from requested activation.
|
|
3450
|
+
|
|
3451
|
+
### Remarks
|
|
3452
|
+
|
|
3453
|
+
Performs one ledger read without writes. Dedicated backends for another tenant are omitted unless explicitly requested, in which case the request rejects.
|
|
3454
|
+
|
|
3455
|
+
### Errors and rejections
|
|
3456
|
+
|
|
3457
|
+
Rejects invalid filter IDs, unknown backend, corrupt installation/activation records, dedicated tenant mismatch or store failure.
|
|
3458
|
+
|
|
3459
|
+
Example:
|
|
3460
|
+
|
|
3461
|
+
```typescript
|
|
3462
|
+
import { PluginLifecycle } from '@alneas/eaos-server/lifecycle-engine';
|
|
3463
|
+
export function inventory(lifecycle: PluginLifecycle) { return lifecycle.list(); }
|
|
3464
|
+
```
|
|
3465
|
+
|
|
3466
|
+
|
|
3467
|
+
#### `list.options.backendId`
|
|
3468
|
+
|
|
3469
|
+
Optional exact backend filter; unknown backends reject.
|
|
3470
|
+
|
|
3471
|
+
|
|
3472
|
+
#### `list.options.tenantId`
|
|
3473
|
+
|
|
3474
|
+
Optional concrete tenant filter; dedicated backend scope must match.
|
|
3475
|
+
|
|
3476
|
+
|
|
3477
|
+
#### `run`
|
|
3478
|
+
|
|
3479
|
+
Runs a host callback only after the current plugin dependency closure passes lifecycle admission.
|
|
3480
|
+
|
|
3481
|
+
Parameters:
|
|
3482
|
+
|
|
3483
|
+
- `backendId`: Registered backend ID.
|
|
3484
|
+
- `tenantId`: Verified concrete tenant ID.
|
|
3485
|
+
- `pluginId`: Feature plugin ID.
|
|
3486
|
+
- `callback`: Async work invoked once after admission; must enforce tenant/resource authorization itself.
|
|
3487
|
+
|
|
3488
|
+
Returns: The callback result without cloning.
|
|
3489
|
+
|
|
3490
|
+
### Type parameters
|
|
3491
|
+
|
|
3492
|
+
- `T`: Value resolved by the admitted callback.
|
|
3493
|
+
|
|
3494
|
+
### Remarks
|
|
3495
|
+
|
|
3496
|
+
The admission check does not hold a lock or pin activation throughout callback execution. Host quiesce/drain and live authorization remain required.
|
|
3497
|
+
|
|
3498
|
+
### Errors and rejections
|
|
3499
|
+
|
|
3500
|
+
Rejects inactive plugin, lifecycle/store validation failure or callback rejection.
|
|
3501
|
+
|
|
3502
|
+
Example:
|
|
3503
|
+
|
|
3504
|
+
```typescript
|
|
3505
|
+
import { PluginLifecycle } from '@alneas/eaos-server/lifecycle-engine';
|
|
3506
|
+
export function runAdmitted<T>(lifecycle: PluginLifecycle, backendId: string, tenantId: string, pluginId: string, work: () => Promise<T>) { return lifecycle.run(backendId, tenantId, pluginId, work); }
|
|
3507
|
+
```
|
|
3508
|
+
|
|
3509
|
+
|
|
3510
|
+
#### `preview`
|
|
3511
|
+
|
|
3512
|
+
Checks plan freshness and invokes host infrastructure previews without applying ledger changes.
|
|
3513
|
+
|
|
3514
|
+
Parameters:
|
|
3515
|
+
|
|
3516
|
+
- `plan`: Unmodified lifecycle plan to preview.
|
|
3517
|
+
|
|
3518
|
+
Returns: Preview results in infrastructure-step order, or an empty array when no infrastructure is needed.
|
|
3519
|
+
|
|
3520
|
+
### Remarks
|
|
3521
|
+
|
|
3522
|
+
Infrastructure previews run concurrently through Promise.all. Host preview adapters own any external read/preview effects; this method executes no migrations.
|
|
3523
|
+
|
|
3524
|
+
### Errors and rejections
|
|
3525
|
+
|
|
3526
|
+
Rejects stale/modified plan, missing infrastructure adapter or propagated plan/preview errors.
|
|
3527
|
+
|
|
3528
|
+
Example:
|
|
3529
|
+
|
|
3530
|
+
```typescript
|
|
3531
|
+
import { PluginLifecycle, type LifecyclePlan } from '@alneas/eaos-server/lifecycle-engine';
|
|
3532
|
+
export function preview(lifecycle: PluginLifecycle, plan: LifecyclePlan) { return lifecycle.preview(plan); }
|
|
3533
|
+
```
|
|
3534
|
+
|
|
3535
|
+
|
|
3536
|
+
#### `apply`
|
|
3537
|
+
|
|
3538
|
+
Revalidates and executes a reviewed lifecycle plan while holding the host's exclusive ledger lock.
|
|
3539
|
+
|
|
3540
|
+
Parameters:
|
|
3541
|
+
|
|
3542
|
+
- `plan`: Unmodified plan bound to the current ledger revision and registered configuration.
|
|
3543
|
+
|
|
3544
|
+
Returns: Resolves without a value after ledger updates and requested side effects complete.
|
|
3545
|
+
|
|
3546
|
+
### Remarks
|
|
3547
|
+
|
|
3548
|
+
Before upgrade side effects, affected activations are disabled durably and all-instance quiesce is required. Infrastructure/migration running/applied/failed receipts are persisted separately. Errors can follow partial external success; no automatic rollback/retry occurs. Uninstall retains business data and migration history.
|
|
3549
|
+
|
|
3550
|
+
### Errors and rejections
|
|
3551
|
+
|
|
3552
|
+
Rejects stale/modified plan, missing executors/quiesce, reconciliation conflicts or host store, migration, infrastructure or drain failures.
|
|
3553
|
+
|
|
3554
|
+
Example:
|
|
3555
|
+
|
|
3556
|
+
```typescript
|
|
3557
|
+
import { PluginLifecycle, type LifecyclePlan } from '@alneas/eaos-server/lifecycle-engine';
|
|
3558
|
+
export function applyReviewed(lifecycle: PluginLifecycle, plan: LifecyclePlan) { return lifecycle.apply(plan); }
|
|
3559
|
+
```
|
|
3560
|
+
|
|
3561
|
+
|
|
3562
|
+
|
|
3563
|
+
### Example
|
|
3564
|
+
|
|
3565
|
+
```typescript
|
|
3566
|
+
import { PluginLifecycle, type LifecycleProject } from '@alneas/eaos-server/lifecycle-engine';
|
|
3567
|
+
export function connectLifecycle(project: LifecycleProject) { return new PluginLifecycle(project); }
|
|
3568
|
+
```
|
|
3569
|
+
|
|
3570
|
+
|
|
3571
|
+
<a id="api-PluginMigration"></a>
|
|
3572
|
+
|
|
3573
|
+
## [INTERFACE] `PluginMigration`
|
|
3574
|
+
|
|
3575
|
+
Immutable reviewed migration statements scoped to a physical database or one tenant.
|
|
3576
|
+
|
|
3577
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
3578
|
+
|
|
3579
|
+
### Signature
|
|
3580
|
+
|
|
3581
|
+
```typescript
|
|
3582
|
+
interface PluginMigration {
|
|
3583
|
+
id: string;
|
|
3584
|
+
scope: 'database' | 'tenant';
|
|
3585
|
+
sql: Partial<Record<Dialect, string[]>>;
|
|
3586
|
+
}
|
|
3587
|
+
```
|
|
3588
|
+
|
|
3589
|
+
### Parameters
|
|
3590
|
+
|
|
3591
|
+
| Name | Type | Required | Description |
|
|
3592
|
+
| --- | --- | --- | --- |
|
|
3593
|
+
| `id` | `string` | Yes | Stable unique migration ID whose applied definition must never be rewritten. |
|
|
3594
|
+
| `scope` | `'database' \| 'tenant'` | Yes | Database runs once per physical database; tenant runs once per tenant. |
|
|
3595
|
+
| `sql` | `Partial<Record<Dialect, string[]>>` | Yes | Dialect-to-ordered-statements map; the target dialect must have nonempty statements. |
|
|
3596
|
+
|
|
3597
|
+
### Returns
|
|
3598
|
+
|
|
3599
|
+
Type declaration; no runtime value.
|
|
3600
|
+
|
|
3601
|
+
### See also
|
|
3602
|
+
|
|
3603
|
+
PluginLifecycle for canonical integration usage.
|
|
3604
|
+
|
|
3605
|
+
### Public members
|
|
3606
|
+
|
|
3607
|
+
#### `id`
|
|
3608
|
+
|
|
3609
|
+
Stable unique migration ID whose applied definition must never be rewritten.
|
|
3610
|
+
|
|
3611
|
+
|
|
3612
|
+
#### `scope`
|
|
3613
|
+
|
|
3614
|
+
Database runs once per physical database; tenant runs once per tenant.
|
|
3615
|
+
|
|
3616
|
+
|
|
3617
|
+
#### `sql`
|
|
3618
|
+
|
|
3619
|
+
Dialect-to-ordered-statements map; the target dialect must have nonempty statements.
|
|
3620
|
+
|
|
3621
|
+
|
|
3622
|
+
|
|
3623
|
+
### Example
|
|
3624
|
+
|
|
3625
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
3626
|
+
|
|
3627
|
+
<a id="api-rebaseDataContractBaseline"></a>
|
|
3628
|
+
|
|
3629
|
+
## [FUNCTION] `rebaseDataContractBaseline`
|
|
3630
|
+
|
|
3631
|
+
Replaces a completely applied exact contract history with its reviewed baseline ledger record without running DDL.
|
|
3632
|
+
|
|
3633
|
+
Rebase only a completely applied exact history. This function never executes DDL.
|
|
3634
|
+
|
|
3635
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`, `@alneas/eaos-server/lifecycle-engine/baseline`.
|
|
3636
|
+
|
|
3637
|
+
### Signature
|
|
3638
|
+
|
|
3639
|
+
```typescript
|
|
3640
|
+
declare function rebaseDataContractBaseline(store: LifecycleStore, databaseId: string, baseline: DataContractBaseline, options: {
|
|
3641
|
+
expectedRevision: number;
|
|
3642
|
+
quiesce?: (input: {
|
|
3643
|
+
databaseId: string;
|
|
3644
|
+
pluginIds: string[];
|
|
3645
|
+
}) => Promise<void>;
|
|
3646
|
+
}): Promise<{
|
|
3647
|
+
baselineHash: string;
|
|
3648
|
+
revision: number;
|
|
3649
|
+
rebased: number;
|
|
3650
|
+
ddlExecuted: false;
|
|
3651
|
+
}>;
|
|
3652
|
+
```
|
|
3653
|
+
|
|
3654
|
+
### Parameters
|
|
3655
|
+
|
|
3656
|
+
| Name | Type | Required | Description |
|
|
3657
|
+
| --- | --- | --- | --- |
|
|
3658
|
+
| `store` | `LifecycleStore` | Yes | Durable cross-process exclusive lifecycle store. |
|
|
3659
|
+
| `databaseId` | `string` | Yes | Physical database ledger identity whose contract history is rebased. |
|
|
3660
|
+
| `baseline` | `DataContractBaseline` | Yes | Unmodified baseline created by createDataContractBaseline. |
|
|
3661
|
+
| `options` | `{ expectedRevision: number; quiesce?: (input: { databaseId: string; pluginIds: string[]; }) => Promise<void>; }` | Yes | Expected ledger revision and optional all-instance quiesce callback, required when affected consumers are active. |
|
|
3662
|
+
|
|
3663
|
+
### Returns
|
|
3664
|
+
|
|
3665
|
+
`Promise<{ baselineHash: string; revision: number; rebased: number; ddlExecuted: false; }>`
|
|
3666
|
+
|
|
3667
|
+
Baseline hash, next revision, count of replaced records and ddlExecuted=false.
|
|
3668
|
+
|
|
3669
|
+
### Remarks
|
|
3670
|
+
|
|
3671
|
+
Runs under the store lock, archives old migration history and disables affected live consumers. Host drain happens before the final atomic state write; external drain may have occurred even if that write fails. No schema or data migration is executed.
|
|
3672
|
+
|
|
3673
|
+
### Errors and rejections
|
|
3674
|
+
|
|
3675
|
+
Rejects integrity mismatch, stale revision, partial/dirty history, incompatible installed consumer range, absent drain or propagated store/quiesce failures.
|
|
3676
|
+
|
|
3677
|
+
### Public members
|
|
3678
|
+
|
|
3679
|
+
#### `options.expectedRevision`
|
|
3680
|
+
|
|
3681
|
+
Exact current ledger revision reviewed by the caller; mismatch rejects before mutation.
|
|
3682
|
+
|
|
3683
|
+
|
|
3684
|
+
#### `options.quiesce`
|
|
3685
|
+
|
|
3686
|
+
Host drains all instances before disabling the affected live consumers.
|
|
3687
|
+
|
|
3688
|
+
|
|
3689
|
+
#### `options.quiesce.input.databaseId`
|
|
3690
|
+
|
|
3691
|
+
Exact physical database identity whose live consumers must drain.
|
|
3692
|
+
|
|
3693
|
+
|
|
3694
|
+
#### `options.quiesce.input.pluginIds`
|
|
3695
|
+
|
|
3696
|
+
Distinct affected feature IDs consuming the rebased contract.
|
|
3697
|
+
|
|
3698
|
+
|
|
3699
|
+
|
|
3700
|
+
### Example
|
|
3701
|
+
|
|
3702
|
+
```typescript
|
|
3703
|
+
import { rebaseDataContractBaseline, type DataContractBaseline, type LifecycleStore } from '@alneas/eaos-server/lifecycle-engine';
|
|
3704
|
+
export function rebaseReviewed(store: LifecycleStore, databaseId: string, baseline: DataContractBaseline, options: Parameters<typeof rebaseDataContractBaseline>[3]) { return rebaseDataContractBaseline(store, databaseId, baseline, options); }
|
|
3705
|
+
```
|
|
3706
|
+
|
|
3707
|
+
|
|
3708
|
+
<a id="api-resolveDataContracts"></a>
|
|
3709
|
+
|
|
3710
|
+
## [FUNCTION] `resolveDataContracts`
|
|
3711
|
+
|
|
3712
|
+
Compatibility re-export; its implementation and documentation are owned by the owning package ``.
|
|
3713
|
+
|
|
3714
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
3715
|
+
|
|
3716
|
+
### Signature
|
|
3717
|
+
|
|
3718
|
+
```typescript
|
|
3719
|
+
declare function resolveDataContracts(available: readonly DataContract[], requirements: Record<string, string>): DataContractCatalog;
|
|
3720
|
+
```
|
|
3721
|
+
|
|
3722
|
+
### Parameters
|
|
3723
|
+
|
|
3724
|
+
| Name | Type | Required | Description |
|
|
3725
|
+
| --- | --- | --- | --- |
|
|
3726
|
+
| `available` | `readonly DataContract[]` | Yes | See the upstream owning declaration. |
|
|
3727
|
+
| `requirements` | `Record<string, string>` | Yes | See the upstream owning declaration. |
|
|
3728
|
+
|
|
3729
|
+
### Returns
|
|
3730
|
+
|
|
3731
|
+
`DataContractCatalog`
|
|
3732
|
+
|
|
3733
|
+
### Example
|
|
3734
|
+
|
|
3735
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
3736
|
+
|
|
3737
|
+
<a id="api-SchemaMigrationSource"></a>
|
|
3738
|
+
|
|
3739
|
+
## [INTERFACE] `SchemaMigrationSource`
|
|
3740
|
+
|
|
3741
|
+
Compatibility re-export; its implementation and documentation are owned by the owning package ``.
|
|
3742
|
+
|
|
3743
|
+
Imports: `@alneas/eaos-server/lifecycle-engine`.
|
|
3744
|
+
|
|
3745
|
+
### Signature
|
|
3746
|
+
|
|
3747
|
+
```typescript
|
|
3748
|
+
interface SchemaMigrationSource {
|
|
3749
|
+
migrations: PluginMigration[];
|
|
3750
|
+
schemaDependencies?: Record<string, string>;
|
|
3751
|
+
schemaContracts?: DataContract[];
|
|
3752
|
+
}
|
|
3753
|
+
```
|
|
3754
|
+
|
|
3755
|
+
### Parameters
|
|
3756
|
+
|
|
3757
|
+
| Name | Type | Required | Description |
|
|
3758
|
+
| --- | --- | --- | --- |
|
|
3759
|
+
| `migrations` | `PluginMigration[]` | Yes | See the upstream owning declaration. |
|
|
3760
|
+
| `schemaDependencies` | `Record<string, string>` | No | See the upstream owning declaration. |
|
|
3761
|
+
| `schemaContracts` | `DataContract[]` | No | See the upstream owning declaration. |
|
|
3762
|
+
|
|
3763
|
+
### Returns
|
|
3764
|
+
|
|
3765
|
+
Type declaration; no runtime value.
|
|
3766
|
+
|
|
3767
|
+
### Example
|
|
3768
|
+
|
|
3769
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
3770
|
+
|