@run402/sdk 4.93.2 → 4.95.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/README.md +40 -38
- package/core-dist/config.d.ts +16 -2
- package/core-dist/config.js +52 -18
- package/core-dist/control-plane-session.d.ts +29 -14
- package/core-dist/control-plane-session.js +31 -6
- package/core-dist/keystore.js +7 -7
- package/core-dist/profiles.d.ts +3 -3
- package/core-dist/profiles.js +9 -7
- package/core-dist/{allowance-auth.d.ts → wallet-auth.d.ts} +6 -6
- package/core-dist/{allowance-auth.js → wallet-auth.js} +15 -15
- package/core-dist/wallet.d.ts +22 -0
- package/core-dist/{allowance.js → wallet.js} +20 -20
- package/core-dist/{write-auth-session.d.ts → write-approvals.d.ts} +28 -26
- package/core-dist/{write-auth-session.js → write-approvals.js} +19 -19
- package/dist/actions.d.ts +4 -4
- package/dist/actions.d.ts.map +1 -1
- package/dist/app-up.d.ts +2 -2
- package/dist/app-up.d.ts.map +1 -1
- package/dist/config.d.ts +1 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/control-plane-credentials.d.ts +8 -8
- package/dist/control-plane-credentials.js +7 -7
- package/dist/credentials.d.ts +20 -20
- package/dist/credentials.d.ts.map +1 -1
- package/dist/credentials.js +1 -1
- package/dist/errors.d.ts +26 -28
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +35 -38
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +29 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -17
- package/dist/index.js.map +1 -1
- package/dist/kernel.d.ts +1 -1
- package/dist/kernel.d.ts.map +1 -1
- package/dist/kernel.js +10 -9
- package/dist/kernel.js.map +1 -1
- package/dist/namespaces/admin.d.ts +52 -121
- package/dist/namespaces/admin.d.ts.map +1 -1
- package/dist/namespaces/admin.js +41 -45
- package/dist/namespaces/admin.js.map +1 -1
- package/dist/namespaces/agent.d.ts +2 -2
- package/dist/namespaces/agent.d.ts.map +1 -1
- package/dist/namespaces/agent.js +2 -2
- package/dist/namespaces/agent.js.map +1 -1
- package/dist/namespaces/ai.d.ts +2 -2
- package/dist/namespaces/ai.js +3 -3
- package/dist/namespaces/ai.js.map +1 -1
- package/dist/namespaces/assets.js +1 -1
- package/dist/namespaces/assets.js.map +1 -1
- package/dist/namespaces/billing.d.ts +6 -3
- package/dist/namespaces/billing.d.ts.map +1 -1
- package/dist/namespaces/billing.js.map +1 -1
- package/dist/namespaces/buzz-notifications.types.d.ts +1 -1
- package/dist/namespaces/buzz.d.ts +2 -2
- package/dist/namespaces/buzz.d.ts.map +1 -1
- package/dist/namespaces/buzz.js +2 -2
- package/dist/namespaces/buzz.js.map +1 -1
- package/dist/namespaces/buzz.types.d.ts +2 -2
- package/dist/namespaces/buzz.types.d.ts.map +1 -1
- package/dist/namespaces/ci.js +3 -3
- package/dist/namespaces/ci.js.map +1 -1
- package/dist/namespaces/credentials.types.d.ts +1 -1
- package/dist/namespaces/deploy.d.ts +1 -1
- package/dist/namespaces/deploy.d.ts.map +1 -1
- package/dist/namespaces/deploy.js +31 -32
- package/dist/namespaces/deploy.js.map +1 -1
- package/dist/namespaces/deploy.types.d.ts +6 -6
- package/dist/namespaces/deploy.types.d.ts.map +1 -1
- package/dist/namespaces/domains.d.ts +10 -2
- package/dist/namespaces/domains.d.ts.map +1 -1
- package/dist/namespaces/domains.js +10 -5
- package/dist/namespaces/domains.js.map +1 -1
- package/dist/namespaces/errors.js +1 -1
- package/dist/namespaces/escalations.d.ts +1 -1
- package/dist/namespaces/escalations.js +1 -1
- package/dist/namespaces/escalations.types.d.ts +2 -2
- package/dist/namespaces/escalations.types.d.ts.map +1 -1
- package/dist/namespaces/events.types.d.ts +1 -1
- package/dist/namespaces/functions.d.ts +1 -1
- package/dist/namespaces/functions.js +2 -2
- package/dist/namespaces/functions.js.map +1 -1
- package/dist/namespaces/gitvault.crypto.d.ts +1 -1
- package/dist/namespaces/gitvault.d.ts +26 -26
- package/dist/namespaces/gitvault.d.ts.map +1 -1
- package/dist/namespaces/gitvault.js +113 -113
- package/dist/namespaces/gitvault.js.map +1 -1
- package/dist/namespaces/me.d.ts +120 -0
- package/dist/namespaces/me.d.ts.map +1 -0
- package/dist/namespaces/me.js +34 -0
- package/dist/namespaces/me.js.map +1 -0
- package/dist/namespaces/org.d.ts +108 -6
- package/dist/namespaces/org.d.ts.map +1 -1
- package/dist/namespaces/org.js +63 -7
- package/dist/namespaces/org.js.map +1 -1
- package/dist/namespaces/org.types.d.ts +29 -9
- package/dist/namespaces/org.types.d.ts.map +1 -1
- package/dist/namespaces/pay.js +3 -3
- package/dist/namespaces/pay.js.map +1 -1
- package/dist/namespaces/projects.d.ts +9 -9
- package/dist/namespaces/projects.js +15 -15
- package/dist/namespaces/projects.js.map +1 -1
- package/dist/namespaces/projects.types.d.ts +28 -12
- package/dist/namespaces/projects.types.d.ts.map +1 -1
- package/dist/namespaces/rooms.d.ts +7 -7
- package/dist/namespaces/rooms.js +17 -17
- package/dist/namespaces/rooms.js.map +1 -1
- package/dist/namespaces/rooms.types.d.ts +9 -9
- package/dist/namespaces/rooms.types.d.ts.map +1 -1
- package/dist/namespaces/service.d.ts +1 -1
- package/dist/namespaces/service.js +1 -1
- package/dist/namespaces/{operator-session.d.ts → session.d.ts} +135 -51
- package/dist/namespaces/session.d.ts.map +1 -0
- package/dist/namespaces/{operator-session.js → session.js} +118 -30
- package/dist/namespaces/session.js.map +1 -0
- package/dist/namespaces/subdomains.d.ts +5 -5
- package/dist/namespaces/subdomains.d.ts.map +1 -1
- package/dist/namespaces/subdomains.js +6 -6
- package/dist/namespaces/subdomains.js.map +1 -1
- package/dist/namespaces/tier.d.ts +44 -21
- package/dist/namespaces/tier.d.ts.map +1 -1
- package/dist/namespaces/tier.js +7 -7
- package/dist/namespaces/tier.js.map +1 -1
- package/dist/namespaces/transfers.d.ts +119 -85
- package/dist/namespaces/transfers.d.ts.map +1 -1
- package/dist/namespaces/transfers.js +31 -38
- package/dist/namespaces/transfers.js.map +1 -1
- package/dist/namespaces/vouchers.d.ts +9 -10
- package/dist/namespaces/vouchers.d.ts.map +1 -1
- package/dist/namespaces/vouchers.js +4 -5
- package/dist/namespaces/vouchers.js.map +1 -1
- package/dist/namespaces/wallets.d.ts +72 -3
- package/dist/namespaces/wallets.d.ts.map +1 -1
- package/dist/namespaces/wallets.js +141 -3
- package/dist/namespaces/wallets.js.map +1 -1
- package/dist/namespaces/write-approval.d.ts +101 -0
- package/dist/namespaces/write-approval.d.ts.map +1 -0
- package/dist/namespaces/write-approval.js +62 -0
- package/dist/namespaces/write-approval.js.map +1 -0
- package/dist/node/actions-node.d.ts +3 -3
- package/dist/node/actions-node.d.ts.map +1 -1
- package/dist/node/actions-node.js +44 -44
- package/dist/node/actions-node.js.map +1 -1
- package/dist/node/assets-node.js +6 -6
- package/dist/node/assets-node.js.map +1 -1
- package/dist/node/{bearer-claim-key.d.ts → bearer-redeem-key.d.ts} +12 -12
- package/dist/node/bearer-redeem-key.d.ts.map +1 -0
- package/dist/node/{bearer-claim-key.js → bearer-redeem-key.js} +21 -21
- package/dist/node/bearer-redeem-key.js.map +1 -0
- package/dist/node/ci.d.ts +1 -1
- package/dist/node/ci.d.ts.map +1 -1
- package/dist/node/ci.js +6 -6
- package/dist/node/ci.js.map +1 -1
- package/dist/node/credentials.d.ts +18 -17
- package/dist/node/credentials.d.ts.map +1 -1
- package/dist/node/credentials.js +29 -28
- package/dist/node/credentials.js.map +1 -1
- package/dist/node/deploy-manifest.d.ts +3 -5
- package/dist/node/deploy-manifest.d.ts.map +1 -1
- package/dist/node/deploy-manifest.js +3 -12
- package/dist/node/deploy-manifest.js.map +1 -1
- package/dist/node/funding-recovery.d.ts +1 -1
- package/dist/node/funding-recovery.d.ts.map +1 -1
- package/dist/node/funding-recovery.js +1 -1
- package/dist/node/funding-recovery.js.map +1 -1
- package/dist/node/gitvault-apply.d.ts +1 -1
- package/dist/node/gitvault-apply.d.ts.map +1 -1
- package/dist/node/gitvault-apply.js +1 -1
- package/dist/node/gitvault-apply.js.map +1 -1
- package/dist/node/gitvault-handoff.d.ts +22 -22
- package/dist/node/gitvault-handoff.d.ts.map +1 -1
- package/dist/node/gitvault-handoff.js +45 -45
- package/dist/node/gitvault-handoff.js.map +1 -1
- package/dist/node/gitvault-prewarm.js +7 -7
- package/dist/node/gitvault-prewarm.js.map +1 -1
- package/dist/node/gitvault-restore.d.ts +1 -1
- package/dist/node/gitvault-restore.js +1 -1
- package/dist/node/index.d.ts +16 -16
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +15 -15
- package/dist/node/index.js.map +1 -1
- package/dist/node/manifest-export.js +2 -2
- package/dist/node/manifest-export.js.map +1 -1
- package/dist/node/org-adopt.d.ts +49 -0
- package/dist/node/org-adopt.d.ts.map +1 -0
- package/dist/node/org-adopt.js +77 -0
- package/dist/node/org-adopt.js.map +1 -0
- package/dist/node/paid-fetch.d.ts +7 -7
- package/dist/node/paid-fetch.d.ts.map +1 -1
- package/dist/node/paid-fetch.js +54 -54
- package/dist/node/paid-fetch.js.map +1 -1
- package/dist/node/preflight.d.ts +1 -1
- package/dist/node/preflight.d.ts.map +1 -1
- package/dist/node/preflight.js +1 -1
- package/dist/node/preflight.js.map +1 -1
- package/dist/node/sites-node.js +1 -1
- package/dist/node/sites-node.js.map +1 -1
- package/dist/node/source-scan.d.ts +1 -1
- package/dist/node/source-scan.js +2 -2
- package/dist/node/source-scan.js.map +1 -1
- package/dist/scoped.d.ts +11 -11
- package/dist/scoped.d.ts.map +1 -1
- package/dist/scoped.js +5 -5
- package/dist/scoped.js.map +1 -1
- package/package.json +1 -1
- package/core-dist/allowance.d.ts +0 -22
- package/core-dist/operator-session.d.ts +0 -80
- package/core-dist/operator-session.js +0 -154
- package/dist/namespaces/allowance.d.ts +0 -79
- package/dist/namespaces/allowance.d.ts.map +0 -1
- package/dist/namespaces/allowance.js +0 -149
- package/dist/namespaces/allowance.js.map +0 -1
- package/dist/namespaces/operator-session.d.ts.map +0 -1
- package/dist/namespaces/operator-session.js.map +0 -1
- package/dist/namespaces/operator.d.ts +0 -359
- package/dist/namespaces/operator.d.ts.map +0 -1
- package/dist/namespaces/operator.js +0 -272
- package/dist/namespaces/operator.js.map +0 -1
- package/dist/node/bearer-claim-key.d.ts.map +0 -1
- package/dist/node/bearer-claim-key.js.map +0 -1
- package/dist/node/operator-claim.d.ts +0 -49
- package/dist/node/operator-claim.d.ts.map +0 -1
- package/dist/node/operator-claim.js +0 -77
- package/dist/node/operator-claim.js.map +0 -1
|
@@ -246,7 +246,7 @@ export class Deploy {
|
|
|
246
246
|
/**
|
|
247
247
|
* Promote an existing release to be the project's current live release —
|
|
248
248
|
* a pointer swap on `internal.projects.live_release_id` without re-running
|
|
249
|
-
* the apply pipeline. Designed for
|
|
249
|
+
* the apply pipeline. Designed for recovery from a destructive
|
|
250
250
|
* apply ("oops on a real project ID"). The prior release's bytes,
|
|
251
251
|
* functions, and migrations remain persisted; this just routes traffic
|
|
252
252
|
* back to them.
|
|
@@ -301,7 +301,7 @@ export class Deploy {
|
|
|
301
301
|
context: "promoting release",
|
|
302
302
|
headers: { "content-type": "application/json" },
|
|
303
303
|
body: {
|
|
304
|
-
project,
|
|
304
|
+
project_id: project,
|
|
305
305
|
allow_warning_codes: allowCodes,
|
|
306
306
|
},
|
|
307
307
|
});
|
|
@@ -688,7 +688,7 @@ async function applyOnce(client, spec, opts, emit) {
|
|
|
688
688
|
// event and resolve before we hit upload.
|
|
689
689
|
}
|
|
690
690
|
if (target === "core") {
|
|
691
|
-
await uploadCoreContent(client, spec.
|
|
691
|
+
await uploadCoreContent(client, spec.project_id, byteReaders, emit);
|
|
692
692
|
emit({
|
|
693
693
|
type: "commit.phase",
|
|
694
694
|
phase: "validate",
|
|
@@ -696,13 +696,13 @@ async function applyOnce(client, spec, opts, emit) {
|
|
|
696
696
|
...(sliceKinds.length > 0 ? { slice_kinds: sliceKinds } : {}),
|
|
697
697
|
});
|
|
698
698
|
const planId = requirePlanId(plan, "applying deploy to Core");
|
|
699
|
-
const commit = await commitInternal(client, planId, opts.idempotencyKey, spec.
|
|
699
|
+
const commit = await commitInternal(client, planId, opts.idempotencyKey, spec.project_id, opts.requiredPlan);
|
|
700
700
|
if (!isCoreCommitResponse(commit)) {
|
|
701
|
-
return await pollUntilReady(client, commit, plan.diff, plan.warnings, emit, spec.
|
|
701
|
+
return await pollUntilReady(client, commit, plan.diff, plan.warnings, emit, spec.project_id, sliceKinds);
|
|
702
702
|
}
|
|
703
|
-
return await coreDeployResult(client, commit, plan.diff, plan.warnings, emit, spec.
|
|
703
|
+
return await coreDeployResult(client, commit, plan.diff, plan.warnings, emit, spec.project_id, sliceKinds);
|
|
704
704
|
}
|
|
705
|
-
await uploadMissing(client, spec.
|
|
705
|
+
await uploadMissing(client, spec.project_id, plan.missing_content, byteReaders, emit);
|
|
706
706
|
emit({
|
|
707
707
|
type: "commit.phase",
|
|
708
708
|
phase: "validate",
|
|
@@ -717,7 +717,7 @@ async function applyOnce(client, spec, opts, emit) {
|
|
|
717
717
|
// protect and commits directly. A passed rehearsal binds the commit to the
|
|
718
718
|
// report's `required_plan` — unbound commits of rehearsed plans are
|
|
719
719
|
// refused by the gateway.
|
|
720
|
-
const rehearsal = await rehearseBeforeCommit(client, plan, planId, spec.
|
|
720
|
+
const rehearsal = await rehearseBeforeCommit(client, plan, planId, spec.project_id, opts, emit);
|
|
721
721
|
const requiredPlan = rehearsal.requiredPlan ?? opts.requiredPlan;
|
|
722
722
|
// gitvault §6.5 — the handshake. Content is uploaded, so the artifacts this
|
|
723
723
|
// release ships are fixed; `authorize` verifies snapshot correspondence,
|
|
@@ -731,8 +731,8 @@ async function applyOnce(client, spec, opts, emit) {
|
|
|
731
731
|
apply_plan_sha256: plan.gitvault?.apply_plan_sha256 ?? null,
|
|
732
732
|
})
|
|
733
733
|
: undefined;
|
|
734
|
-
const commit = requireCloudCommitResponse(await commitInternal(client, planId, opts.idempotencyKey, spec.
|
|
735
|
-
const result = await pollUntilReady(client, commit, plan.diff, plan.warnings, emit, spec.
|
|
734
|
+
const commit = requireCloudCommitResponse(await commitInternal(client, planId, opts.idempotencyKey, spec.project_id, requiredPlan, gitvaultCommit), "applying deploy");
|
|
735
|
+
const result = await pollUntilReady(client, commit, plan.diff, plan.warnings, emit, spec.project_id, sliceKinds);
|
|
736
736
|
result.rehearsal = rehearsal.block;
|
|
737
737
|
// v1.48 unified-apply: thread the plan response's `asset_entries[]` back
|
|
738
738
|
// into DeployResult.assets so callers reading `result.assets.byKey[key]`
|
|
@@ -1110,7 +1110,7 @@ function i18nToWire(i18n) {
|
|
|
1110
1110
|
}
|
|
1111
1111
|
function releaseSpecToCoreSpec(spec) {
|
|
1112
1112
|
return {
|
|
1113
|
-
project: spec.
|
|
1113
|
+
project: spec.project_id,
|
|
1114
1114
|
...(spec.base !== undefined ? { base: spec.base } : {}),
|
|
1115
1115
|
...(spec.database !== undefined ? { database: databaseToCoreSpec(spec.database) } : {}),
|
|
1116
1116
|
...(spec.secrets !== undefined ? { secrets: spec.secrets } : {}),
|
|
@@ -1125,7 +1125,7 @@ function releaseSpecToCoreSpec(spec) {
|
|
|
1125
1125
|
}
|
|
1126
1126
|
function releaseSpecToWire(spec) {
|
|
1127
1127
|
return {
|
|
1128
|
-
project_id: spec.
|
|
1128
|
+
project_id: spec.project_id,
|
|
1129
1129
|
...(spec.base !== undefined ? { base: spec.base } : {}),
|
|
1130
1130
|
...(spec.database !== undefined ? { database: databaseToWire(spec.database) } : {}),
|
|
1131
1131
|
...(spec.secrets !== undefined ? { secrets: spec.secrets } : {}),
|
|
@@ -1208,8 +1208,8 @@ async function planInternal(client, spec, idempotencyKey, opts = {}) {
|
|
|
1208
1208
|
// can pick it up via `manifest_ref`. The body still carries a minimal
|
|
1209
1209
|
// `spec` so the gateway has the project for auth + plan persistence.
|
|
1210
1210
|
const manifestBytes = new TextEncoder().encode(JSON.stringify(wireSpec));
|
|
1211
|
-
const ref = await uploadInlineCas(client, spec.
|
|
1212
|
-
body = { spec: { project_id: spec.
|
|
1211
|
+
const ref = await uploadInlineCas(client, spec.project_id, manifestBytes, MANIFEST_CONTENT_TYPE);
|
|
1212
|
+
body = { spec: { project_id: spec.project_id }, manifest_ref: contentRefToWire(ref) };
|
|
1213
1213
|
if (idempotencyKey)
|
|
1214
1214
|
body.idempotency_key = idempotencyKey;
|
|
1215
1215
|
if (opts.gitvault)
|
|
@@ -1220,8 +1220,8 @@ async function planInternal(client, spec, idempotencyKey, opts = {}) {
|
|
|
1220
1220
|
plan = withClientPlanWarnings(normalized, normalizePlanResponse(await client.request(dryRun ? "/apply/v1/plans?dry_run=true" : "/apply/v1/plans", {
|
|
1221
1221
|
method: "POST",
|
|
1222
1222
|
body,
|
|
1223
|
-
//
|
|
1224
|
-
authMeta: { method: "deploy.plan", capability: "project.deploy", target: { project_id: spec.
|
|
1223
|
+
// Write-approval scope: deploying a release is `project.deploy` on this project.
|
|
1224
|
+
authMeta: { method: "deploy.plan", capability: "project.deploy", target: { project_id: spec.project_id } },
|
|
1225
1225
|
context: "planning deploy",
|
|
1226
1226
|
})));
|
|
1227
1227
|
}
|
|
@@ -1402,7 +1402,7 @@ async function computeDesiredScheduledFunctionCount(client, spec) {
|
|
|
1402
1402
|
}
|
|
1403
1403
|
if (!functions.patch)
|
|
1404
1404
|
return null;
|
|
1405
|
-
const activeScheduled = await readActiveScheduledFunctionNames(client, spec.
|
|
1405
|
+
const activeScheduled = await readActiveScheduledFunctionNames(client, spec.project_id);
|
|
1406
1406
|
if (!activeScheduled)
|
|
1407
1407
|
return null;
|
|
1408
1408
|
applyScheduledFunctionPatch(activeScheduled, functions.patch);
|
|
@@ -1603,7 +1603,7 @@ async function commitInternal(client, planId, idempotencyKey, project, requiredP
|
|
|
1603
1603
|
return await client.request(`/apply/v1/plans/${encodeURIComponent(planId)}/commit`, {
|
|
1604
1604
|
method: "POST",
|
|
1605
1605
|
body,
|
|
1606
|
-
//
|
|
1606
|
+
// Write-approval scope: committing a deploy is `project.deploy` on this project.
|
|
1607
1607
|
...(project
|
|
1608
1608
|
? {
|
|
1609
1609
|
authMeta: {
|
|
@@ -1862,7 +1862,7 @@ async function pollUntilReady(client, commit, diff, warnings, emit, projectId, s
|
|
|
1862
1862
|
...(commit.subdomain_bindings ? { subdomain_bindings: commit.subdomain_bindings } : {}),
|
|
1863
1863
|
...(commit.static_continuity ? { static_continuity: commit.static_continuity } : {}),
|
|
1864
1864
|
...(commit.edge ? { edge: commit.edge } : {}),
|
|
1865
|
-
// The gateway's riders (poll / watch_errors /
|
|
1865
|
+
// The gateway's riders (poll / watch_errors / hand_to_member) ride the
|
|
1866
1866
|
// synchronous ready response and nowhere else — dropping them here is
|
|
1867
1867
|
// how an agent never learns the offer existed (builder-promotion).
|
|
1868
1868
|
...(Array.isArray(commit.next_actions) && commit.next_actions.length > 0
|
|
@@ -1971,7 +1971,7 @@ async function pollSnapshotUntilReady(client, initial, diff, warnings, emit, pro
|
|
|
1971
1971
|
...(snapshot.edge ? { edge: snapshot.edge } : {}),
|
|
1972
1972
|
// The gateway now attaches the same riders to a ready operation
|
|
1973
1973
|
// snapshot as to a synchronous ready commit (poll / watch_errors /
|
|
1974
|
-
//
|
|
1974
|
+
// hand_to_member) — pass them through exactly as the fast path does.
|
|
1975
1975
|
...(Array.isArray(snapshot.next_actions) && snapshot.next_actions.length > 0
|
|
1976
1976
|
? { next_actions: snapshot.next_actions }
|
|
1977
1977
|
: {}),
|
|
@@ -2093,7 +2093,7 @@ async function startInternal(client, spec, opts) {
|
|
|
2093
2093
|
}
|
|
2094
2094
|
const sliceKinds = deriveSliceKinds(spec);
|
|
2095
2095
|
const resultPromise = (async () => {
|
|
2096
|
-
await uploadMissing(client, spec.
|
|
2096
|
+
await uploadMissing(client, spec.project_id, plan.missing_content, byteReaders, emit);
|
|
2097
2097
|
emit({
|
|
2098
2098
|
type: "commit.phase",
|
|
2099
2099
|
phase: "validate",
|
|
@@ -2101,15 +2101,15 @@ async function startInternal(client, spec, opts) {
|
|
|
2101
2101
|
...(sliceKinds.length > 0 ? { slice_kinds: sliceKinds } : {}),
|
|
2102
2102
|
});
|
|
2103
2103
|
const { planId } = requirePersistedPlan(plan, "starting deploy");
|
|
2104
|
-
const commit = requireCloudCommitResponse(await commitInternal(client, planId, opts.idempotencyKey, spec.
|
|
2105
|
-
return await pollUntilReady(client, commit, plan.diff, plan.warnings, emit, spec.
|
|
2104
|
+
const commit = requireCloudCommitResponse(await commitInternal(client, planId, opts.idempotencyKey, spec.project_id, opts.requiredPlan), "starting deploy");
|
|
2105
|
+
return await pollUntilReady(client, commit, plan.diff, plan.warnings, emit, spec.project_id, sliceKinds);
|
|
2106
2106
|
})();
|
|
2107
2107
|
// Avoid an unhandled-rejection at construction time. Consumers must call
|
|
2108
2108
|
// .result() to actually observe the error.
|
|
2109
2109
|
resultPromise.catch(() => { });
|
|
2110
2110
|
let snapshot = null;
|
|
2111
2111
|
const { operationId } = requirePersistedPlan(plan, "starting deploy");
|
|
2112
|
-
const startHeaders = await apikeyHeaders(client, spec.
|
|
2112
|
+
const startHeaders = await apikeyHeaders(client, spec.project_id);
|
|
2113
2113
|
const fetchSnapshot = async () => {
|
|
2114
2114
|
if (snapshot && TERMINAL_STATUSES.includes(snapshot.status))
|
|
2115
2115
|
return snapshot;
|
|
@@ -2200,7 +2200,7 @@ async function startInternal(client, spec, opts) {
|
|
|
2200
2200
|
}
|
|
2201
2201
|
const RELEASE_SPEC_FIELDS = new Set([
|
|
2202
2202
|
"$schema",
|
|
2203
|
-
"
|
|
2203
|
+
"project_id",
|
|
2204
2204
|
"base",
|
|
2205
2205
|
"database",
|
|
2206
2206
|
"secrets",
|
|
@@ -2282,16 +2282,15 @@ function validateSpec(spec) {
|
|
|
2282
2282
|
}
|
|
2283
2283
|
const raw = spec;
|
|
2284
2284
|
validateKnownFields(raw, "spec", RELEASE_SPEC_FIELDS, {
|
|
2285
|
-
project_id: "Use `project` in ReleaseSpec, or call `loadDeployManifest()` / `normalizeDeployManifest()` for MCP/CLI-style manifests.",
|
|
2286
2285
|
subdomain: "Use `subdomains: { set: [name] }`.",
|
|
2287
2286
|
});
|
|
2288
|
-
if (!spec.
|
|
2289
|
-
throw new Run402DeployError("ReleaseSpec.
|
|
2287
|
+
if (!spec.project_id || typeof spec.project_id !== "string") {
|
|
2288
|
+
throw new Run402DeployError("ReleaseSpec.project_id is required", {
|
|
2290
2289
|
code: "INVALID_SPEC",
|
|
2291
2290
|
phase: "validate",
|
|
2292
|
-
resource: "spec.
|
|
2291
|
+
resource: "spec.project_id",
|
|
2293
2292
|
retryable: false,
|
|
2294
|
-
fix: { action: "set_field", path: "
|
|
2293
|
+
fix: { action: "set_field", path: "project_id" },
|
|
2295
2294
|
context: "validating spec",
|
|
2296
2295
|
});
|
|
2297
2296
|
}
|
|
@@ -3357,7 +3356,7 @@ async function normalizeReleaseSpec(client, spec, opts = {}) {
|
|
|
3357
3356
|
};
|
|
3358
3357
|
const rememberRelease = makeRemember("release");
|
|
3359
3358
|
const rememberAsset = makeRemember("asset");
|
|
3360
|
-
const normalized = {
|
|
3359
|
+
const normalized = { project_id: spec.project_id };
|
|
3361
3360
|
if (spec.base)
|
|
3362
3361
|
normalized.base = spec.base;
|
|
3363
3362
|
if (spec.subdomains)
|
|
@@ -3380,7 +3379,7 @@ async function normalizeReleaseSpec(client, spec, opts = {}) {
|
|
|
3380
3379
|
db.zero_downtime = spec.database.zero_downtime;
|
|
3381
3380
|
}
|
|
3382
3381
|
if (spec.database.migrations && spec.database.migrations.length > 0) {
|
|
3383
|
-
db.migrations = await Promise.all(spec.database.migrations.map(async (m) => normalizeMigration(client, spec.
|
|
3382
|
+
db.migrations = await Promise.all(spec.database.migrations.map(async (m) => normalizeMigration(client, spec.project_id, m, rememberRelease, opts)));
|
|
3384
3383
|
assertUniqueMigrationIds(db.migrations);
|
|
3385
3384
|
}
|
|
3386
3385
|
normalized.database = db;
|