refactor: migrate v02 cloud api to TypeScript

This commit is contained in:
Codex
2026-05-29 00:33:01 +08:00
parent 44851d8eb3
commit a0869c5afa
79 changed files with 10696 additions and 10065 deletions
+8 -8
View File
@@ -193,7 +193,7 @@ When health reports:
- `runtime.status: "degraded"`
the Cloud API is using the process-local runtime store in
`internal/db/runtime-store.mjs`. Gateway sessions, box resources, operations,
`internal/db/runtime-store.ts`. Gateway sessions, box resources, operations,
audit events, and evidence records accepted through the runtime can be lost on
pod restart, redeploy, or scale-out, and cannot be treated as durable M3/M4/M5
evidence. Users may see accepted operations or evidence disappear after a
@@ -238,9 +238,9 @@ below are true.
The cloud-api image owns a stable DEV DB provisioning entrypoint:
```sh
node cmd/hwlab-cloud-api/provision.mjs --check
node cmd/hwlab-cloud-api/provision.mjs --dry-run --allow-live-db-read --confirm-dev --report /tmp/hwlab-dev-gate/dev-runtime-provisioning-report.json
node cmd/hwlab-cloud-api/provision.mjs --apply --confirm-dev --confirmed-non-production --report /tmp/hwlab-dev-gate/dev-runtime-provisioning-report.json
bun cmd/hwlab-cloud-api/provision.ts --check
bun cmd/hwlab-cloud-api/provision.ts --dry-run --allow-live-db-read --confirm-dev --report /tmp/hwlab-dev-gate/dev-runtime-provisioning-report.json
bun cmd/hwlab-cloud-api/provision.ts --apply --confirm-dev --confirmed-non-production --report /tmp/hwlab-dev-gate/dev-runtime-provisioning-report.json
```
This is the preferred image-internal operator command for `hwlab-cloud-api`.
@@ -288,9 +288,9 @@ untracked manual DB write.
The cloud-api image owns a stable runtime migration entrypoint:
```sh
node cmd/hwlab-cloud-api/migrate.mjs --check
node cmd/hwlab-cloud-api/migrate.mjs --dry-run --report /tmp/hwlab-dev-gate/dev-runtime-migration-report.json
node cmd/hwlab-cloud-api/migrate.mjs --apply --confirm-dev --confirmed-non-production --report /tmp/hwlab-dev-gate/dev-runtime-migration-report.json
bun cmd/hwlab-cloud-api/migrate.ts --check
bun cmd/hwlab-cloud-api/migrate.ts --dry-run --report /tmp/hwlab-dev-gate/dev-runtime-migration-report.json
bun cmd/hwlab-cloud-api/migrate.ts --apply --confirm-dev --confirmed-non-production --report /tmp/hwlab-dev-gate/dev-runtime-migration-report.json
```
This is the preferred image-internal operator command for `hwlab-cloud-api`.
@@ -298,7 +298,7 @@ It delegates to the same repo-owned migration implementation as the root
script, so there is only one migration contract and one output format. The
cloud-api artifact build copies `cmd/`, `scripts/`, `internal/`, `package.json`,
and runtime dependencies into the image; the DEV CD runtime migration Job uses
`node cmd/hwlab-cloud-api/migrate.mjs` from the current cloud-api image and
`bun cmd/hwlab-cloud-api/migrate.ts` from the current cloud-api image and
injects DB inputs only through SecretRef-backed env.
The repo-level compatibility entrypoint remains: