@greatwait/contracts 0.1.0-alpha.3 → 0.1.0-alpha.5
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 +12 -10
- package/dist/authority.d.ts +33 -27
- package/dist/authority.js +12 -2
- package/dist/billing.d.ts +1231 -0
- package/dist/billing.js +833 -0
- package/dist/callback-safety.d.ts +2 -2
- package/dist/callback-safety.js +15 -5
- package/dist/compatibility.d.ts +3 -3
- package/dist/compatibility.js +1 -1
- package/dist/configuration-bounds.d.ts +13 -0
- package/dist/configuration-bounds.js +13 -0
- package/dist/data-export.d.ts +67 -0
- package/dist/data-export.js +182 -0
- package/dist/effective-limits.d.ts +40 -0
- package/dist/effective-limits.js +42 -0
- package/dist/endpoints.d.ts +186 -245
- package/dist/endpoints.js +82 -86
- package/dist/events.d.ts +17 -17
- package/dist/events.js +1 -1
- package/dist/first-value-journey.d.ts +50 -56
- package/dist/first-value-journey.js +17 -20
- package/dist/forecast.d.ts +182 -92
- package/dist/forecast.js +88 -25
- package/dist/identifiers.d.ts +20 -20
- package/dist/identifiers.js +1 -1
- package/dist/identity.d.ts +41 -37
- package/dist/identity.js +5 -4
- package/dist/index.d.ts +12 -6
- package/dist/index.js +12 -6
- package/dist/mcp.d.ts +21 -19
- package/dist/mcp.js +2 -2
- package/dist/naming.d.ts +45 -0
- package/dist/naming.js +159 -0
- package/dist/oauth.d.ts +186 -172
- package/dist/oauth.js +1 -1
- package/dist/operation-definitions.d.ts +9 -0
- package/dist/operation-definitions.js +7 -0
- package/dist/operational-config.d.ts +101 -0
- package/dist/operational-config.js +341 -0
- package/dist/operations.d.ts +4742 -2170
- package/dist/operations.js +3064 -932
- package/dist/organization-lifecycle.d.ts +34 -0
- package/dist/organization-lifecycle.js +122 -0
- package/dist/partition.d.ts +43 -9
- package/dist/partition.js +3 -3
- package/dist/policy.d.ts +4 -4
- package/dist/policy.js +9 -5
- package/dist/problems.d.ts +57 -28
- package/dist/problems.js +55 -3
- package/dist/protocol.d.ts +209 -80
- package/dist/protocol.js +110 -37
- package/dist/scheduling-records.d.ts +349 -285
- package/dist/scheduling-records.js +1 -1
- package/dist/scheduling.d.ts +707 -361
- package/dist/scheduling.js +443 -61
- package/dist/secrets.d.ts +119 -105
- package/dist/secrets.js +1 -1
- package/dist/signatures.d.ts +74 -74
- package/dist/signatures.js +1 -1
- package/dist/tenancy.d.ts +142 -68
- package/dist/tenancy.js +70 -17
- package/dist/test-sink.d.ts +127 -127
- package/dist/test-sink.js +1 -1
- package/dist/time.d.ts +4 -4
- package/dist/time.js +1 -1
- package/dist/timing.d.ts +65 -0
- package/dist/timing.js +82 -0
- package/dist/usage.d.ts +103 -47
- package/dist/usage.js +183 -32
- package/dist/workspace.d.ts +34 -34
- package/dist/workspace.js +1 -1
- package/dist/zod-values.d.ts +3 -0
- package/dist/zod-values.js +2 -0
- package/dist/zod.d.ts +2 -0
- package/dist/zod.js +2 -0
- package/generated/v1/examples/attempts.list.response.json +6 -0
- package/generated/v1/examples/attempts.read.response.json +6 -0
- package/generated/v1/examples/billing.autotopup.request.json +5 -0
- package/generated/v1/examples/billing.autotopup.response.json +120 -0
- package/generated/v1/examples/billing.autotopuppreview.request.json +19 -0
- package/generated/v1/examples/billing.autotopuppreview.response.json +45 -0
- package/generated/v1/examples/billing.budgets.request.json +13 -0
- package/generated/v1/examples/billing.budgets.response.json +22 -0
- package/generated/v1/examples/billing.ceiling.request.json +8 -0
- package/generated/v1/examples/billing.ceiling.response.json +120 -0
- package/generated/v1/examples/billing.change.request.json +5 -0
- package/generated/v1/examples/billing.change.response.json +12 -0
- package/generated/v1/examples/billing.funding.response.json +120 -0
- package/generated/v1/examples/billing.fundingconfirm.response.json +120 -0
- package/generated/v1/examples/billing.fundingquote.request.json +7 -0
- package/generated/v1/examples/billing.fundingquote.response.json +13 -0
- package/generated/v1/examples/billing.invoicehistory.response.json +6 -0
- package/generated/v1/examples/billing.invoices.response.json +15 -0
- package/generated/v1/examples/billing.ledger.response.json +23 -0
- package/generated/v1/examples/billing.notices.response.json +41 -0
- package/generated/v1/examples/billing.notificationsettings.response.json +17 -0
- package/generated/v1/examples/billing.notificationsettingsupdate.request.json +9 -0
- package/generated/v1/examples/billing.notificationsettingsupdate.response.json +17 -0
- package/generated/v1/examples/billing.paymenthistory.response.json +6 -0
- package/generated/v1/examples/billing.paymentmethod.response.json +16 -0
- package/generated/v1/examples/billing.paymentmethodconfirm.request.json +3 -0
- package/generated/v1/examples/billing.paymentmethodconfirm.response.json +16 -0
- package/generated/v1/examples/billing.paymentmethodremove.request.json +3 -0
- package/generated/v1/examples/billing.paymentmethodremove.response.json +4 -0
- package/generated/v1/examples/billing.paymentmethodsetup.request.json +1 -0
- package/generated/v1/examples/billing.paymentmethodsetup.response.json +3 -0
- package/generated/v1/examples/billing.portal.response.json +3 -0
- package/generated/v1/examples/billing.projects.response.json +12 -0
- package/generated/v1/examples/billing.purchase.request.json +5 -0
- package/generated/v1/examples/billing.purchase.response.json +120 -0
- package/generated/v1/examples/billing.quote.request.json +4 -0
- package/generated/v1/examples/billing.quote.response.json +19 -0
- package/generated/v1/examples/billing.reconcile.response.json +73 -0
- package/generated/v1/examples/billing.refundrequest.request.json +10 -0
- package/generated/v1/examples/billing.refundrequest.response.json +11 -0
- package/generated/v1/examples/billing.refundresolution.request.json +4 -0
- package/generated/v1/examples/billing.refundresolution.response.json +120 -0
- package/generated/v1/examples/billing.summary.response.json +73 -0
- package/generated/v1/examples/endpoints.acknowledgeSigningKeyRotation.response.json +18 -0
- package/generated/v1/examples/endpoints.create.response.json +1 -1
- package/generated/v1/examples/endpoints.disable.response.json +0 -1
- package/generated/v1/examples/{endpoints.verify.response.json → endpoints.enable.response.json} +4 -5
- package/generated/v1/examples/endpoints.list.response.json +1 -2
- package/generated/v1/examples/endpoints.read.response.json +2 -2
- package/generated/v1/examples/endpoints.revealSigningSecret.response.json +7 -0
- package/generated/v1/examples/endpoints.rotateSigningKey.response.json +1 -2
- package/generated/v1/examples/endpoints.update.response.json +1 -1
- package/generated/v1/examples/executions.list.response.json +20 -0
- package/generated/v1/examples/exports.cancel.response.json +11 -0
- package/generated/v1/examples/exports.create.request.json +1 -0
- package/generated/v1/examples/exports.create.response.json +8 -0
- package/generated/v1/examples/exports.part.response.json +5 -0
- package/generated/v1/examples/exports.read.response.json +8 -0
- package/generated/v1/examples/limits.read.response.json +16 -0
- package/generated/v1/examples/occurrences.read.response.json +4 -0
- package/generated/v1/examples/occurrences.redeliver.response.json +2 -0
- package/generated/v1/examples/organizations.close.request.json +5 -0
- package/generated/v1/examples/organizations.close.response.json +10 -0
- package/generated/v1/examples/organizations.lifecycle.response.json +10 -0
- package/generated/v1/examples/organizations.restore.request.json +3 -0
- package/generated/v1/examples/organizations.restore.response.json +10 -0
- package/generated/v1/examples/projects.archive.request.json +3 -0
- package/generated/v1/examples/projects.archive.response.json +14 -0
- package/generated/v1/examples/projects.create.response.json +10 -1
- package/generated/v1/examples/projects.delete.response.json +9 -0
- package/generated/v1/examples/projects.list.response.json +12 -2
- package/generated/v1/examples/projects.rename.request.json +3 -0
- package/generated/v1/examples/projects.rename.response.json +14 -0
- package/generated/v1/examples/schedules.archive.response.json +3 -0
- package/generated/v1/examples/schedules.cancel.response.json +3 -0
- package/generated/v1/examples/schedules.create.request.json +4 -0
- package/generated/v1/examples/schedules.create.response.json +3 -0
- package/generated/v1/examples/schedules.list.response.json +3 -0
- package/generated/v1/examples/schedules.pause.response.json +3 -0
- package/generated/v1/examples/schedules.read.response.json +6 -0
- package/generated/v1/examples/schedules.replace.request.json +4 -0
- package/generated/v1/examples/schedules.replace.response.json +3 -0
- package/generated/v1/examples/schedules.resume.response.json +3 -0
- package/generated/v1/examples/timing.summary.response.json +35 -0
- package/generated/v1/examples/usage.read.response.json +1 -0
- package/generated/v1/first-value-journey.json +43 -18
- package/generated/v1/manifest.json +1287 -42
- package/generated/v1/openapi.json +36033 -5982
- package/generated/v1/policy-matrix.json +341 -47
- package/generated/v1/schemas/attempts.list.response.json +39 -1
- package/generated/v1/schemas/attempts.read.response.json +39 -1
- package/generated/v1/schemas/billing.autotopup.request-headers.json +13 -0
- package/generated/v1/schemas/billing.autotopup.request.json +22 -0
- package/generated/v1/schemas/billing.autotopup.response-headers.json +10 -0
- package/generated/v1/schemas/billing.autotopup.response.json +552 -0
- package/generated/v1/schemas/billing.autotopuppreview.request.json +77 -0
- package/generated/v1/schemas/billing.autotopuppreview.response.json +277 -0
- package/generated/v1/schemas/billing.budgets.request-headers.json +13 -0
- package/generated/v1/schemas/billing.budgets.request.json +66 -0
- package/generated/v1/schemas/billing.budgets.response-headers.json +10 -0
- package/generated/v1/schemas/billing.budgets.response.json +92 -0
- package/generated/v1/schemas/billing.ceiling.request-headers.json +13 -0
- package/generated/v1/schemas/billing.ceiling.request.json +40 -0
- package/generated/v1/schemas/billing.ceiling.response-headers.json +10 -0
- package/generated/v1/schemas/billing.ceiling.response.json +552 -0
- package/generated/v1/schemas/billing.change.request-headers.json +13 -0
- package/generated/v1/schemas/billing.change.request.json +22 -0
- package/generated/v1/schemas/billing.change.response.json +119 -0
- package/generated/v1/schemas/billing.funding.response.json +552 -0
- package/generated/v1/schemas/billing.fundingconfirm.response.json +552 -0
- package/generated/v1/schemas/billing.fundingquote.request.json +28 -0
- package/generated/v1/schemas/billing.fundingquote.response.json +61 -0
- package/generated/v1/schemas/billing.invoicehistory.query.json +16 -0
- package/generated/v1/schemas/billing.invoicehistory.response.json +88 -0
- package/generated/v1/schemas/billing.invoices.response.json +51 -0
- package/generated/v1/schemas/billing.ledger.query.json +16 -0
- package/generated/v1/schemas/billing.ledger.response.json +130 -0
- package/generated/v1/schemas/billing.notices.query.json +16 -0
- package/generated/v1/schemas/billing.notices.response.json +278 -0
- package/generated/v1/schemas/billing.notificationsettings.response.json +70 -0
- package/generated/v1/schemas/billing.notificationsettingsupdate.request-headers.json +13 -0
- package/generated/v1/schemas/billing.notificationsettingsupdate.request.json +43 -0
- package/generated/v1/schemas/billing.notificationsettingsupdate.response-headers.json +10 -0
- package/generated/v1/schemas/billing.notificationsettingsupdate.response.json +70 -0
- package/generated/v1/schemas/billing.paymenthistory.query.json +16 -0
- package/generated/v1/schemas/billing.paymenthistory.response.json +182 -0
- package/generated/v1/schemas/billing.paymentmethod.response.json +137 -0
- package/generated/v1/schemas/billing.paymentmethodconfirm.request.json +14 -0
- package/generated/v1/schemas/billing.paymentmethodconfirm.response.json +137 -0
- package/generated/v1/schemas/billing.paymentmethodremove.request.json +12 -0
- package/generated/v1/schemas/billing.paymentmethodremove.response.json +137 -0
- package/generated/v1/schemas/billing.paymentmethodsetup.request.json +12 -0
- package/generated/v1/schemas/billing.paymentmethodsetup.response.json +11 -0
- package/generated/v1/schemas/billing.portal.response.json +11 -0
- package/generated/v1/schemas/billing.projects.response.json +119 -0
- package/generated/v1/schemas/billing.purchase.request-headers.json +13 -0
- package/generated/v1/schemas/billing.purchase.request.json +26 -0
- package/generated/v1/schemas/billing.purchase.response-headers.json +10 -0
- package/generated/v1/schemas/billing.purchase.response.json +552 -0
- package/generated/v1/schemas/billing.quote.request.json +20 -0
- package/generated/v1/schemas/billing.quote.response.json +86 -0
- package/generated/v1/schemas/billing.reconcile.response.json +468 -0
- package/generated/v1/schemas/billing.refundrequest.request-headers.json +13 -0
- package/generated/v1/schemas/billing.refundrequest.request.json +42 -0
- package/generated/v1/schemas/billing.refundrequest.response-headers.json +10 -0
- package/generated/v1/schemas/billing.refundrequest.response.json +45 -0
- package/generated/v1/schemas/billing.refundresolution.request-headers.json +13 -0
- package/generated/v1/schemas/billing.refundresolution.request.json +61 -0
- package/generated/v1/schemas/billing.refundresolution.response-headers.json +10 -0
- package/generated/v1/schemas/billing.refundresolution.response.json +552 -0
- package/generated/v1/schemas/billing.summary.response.json +468 -0
- package/generated/v1/schemas/context.read.response.json +2 -0
- package/generated/v1/schemas/credentials.connection.response.json +2 -0
- package/generated/v1/schemas/credentials.create.request.json +2 -0
- package/generated/v1/schemas/credentials.create.response.json +2 -0
- package/generated/v1/schemas/credentials.list.response.json +2 -0
- package/generated/v1/schemas/credentials.revoke.response.json +2 -0
- package/generated/v1/schemas/credentials.rotate.response.json +4 -0
- package/generated/v1/schemas/{endpoints.verify.request-headers.json → endpoints.acknowledgeSigningKeyRotation.request-headers.json} +2 -1
- package/generated/v1/schemas/{endpoints.verify.response.json → endpoints.acknowledgeSigningKeyRotation.response.json} +8 -21
- package/generated/v1/schemas/endpoints.create.request.json +5 -0
- package/generated/v1/schemas/endpoints.create.response.json +8 -21
- package/generated/v1/schemas/endpoints.disable.response.json +8 -21
- package/generated/v1/schemas/endpoints.enable.response-headers.json +11 -0
- package/generated/v1/schemas/endpoints.enable.response.json +87 -0
- package/generated/v1/schemas/endpoints.list.response.json +8 -21
- package/generated/v1/schemas/endpoints.read.response.json +8 -21
- package/generated/v1/schemas/endpoints.revealSigningSecret.response.json +43 -0
- package/generated/v1/schemas/endpoints.rotateSigningKey.response.json +8 -21
- package/generated/v1/schemas/endpoints.update.request.json +5 -0
- package/generated/v1/schemas/endpoints.update.response.json +8 -21
- package/generated/v1/schemas/executions.list.query.json +46 -0
- package/generated/v1/schemas/executions.list.response.json +116 -0
- package/generated/v1/schemas/exports.cancel.response.json +48 -0
- package/generated/v1/schemas/exports.create.request.json +6 -0
- package/generated/v1/schemas/exports.create.response.json +38 -0
- package/generated/v1/schemas/exports.part.query.json +11 -0
- package/generated/v1/schemas/exports.part.response.json +22 -0
- package/generated/v1/schemas/exports.read.response.json +38 -0
- package/generated/v1/schemas/forecast.read.request-headers.json +10 -0
- package/generated/v1/schemas/forecast.read.response.json +148 -0
- package/generated/v1/schemas/grants.list.response.json +2 -0
- package/generated/v1/schemas/grants.revoke.response.json +2 -0
- package/generated/v1/schemas/limits.read.response.json +79 -0
- package/generated/v1/schemas/occurrences.list.query.json +5 -0
- package/generated/v1/schemas/occurrences.list.response.json +23 -0
- package/generated/v1/schemas/occurrences.read.response.json +23 -0
- package/generated/v1/schemas/occurrences.redeliver.response.json +39 -1
- package/generated/v1/schemas/organizations.close.request.json +20 -0
- package/generated/v1/schemas/organizations.close.response.json +68 -0
- package/generated/v1/schemas/organizations.lifecycle.response.json +68 -0
- package/generated/v1/schemas/organizations.restore.request.json +13 -0
- package/generated/v1/schemas/organizations.restore.response.json +68 -0
- package/generated/v1/schemas/projects.archive.request-headers.json +11 -0
- package/generated/v1/schemas/projects.archive.request.json +10 -0
- package/generated/v1/schemas/projects.archive.response-headers.json +11 -0
- package/generated/v1/schemas/projects.archive.response.json +79 -0
- package/generated/v1/schemas/projects.create.response.json +55 -1
- package/generated/v1/schemas/projects.delete.request-headers.json +11 -0
- package/generated/v1/schemas/projects.delete.response.json +37 -0
- package/generated/v1/schemas/projects.list.response.json +61 -2
- package/generated/v1/schemas/projects.rename.request-headers.json +11 -0
- package/generated/v1/schemas/projects.rename.request.json +12 -0
- package/generated/v1/schemas/projects.rename.response-headers.json +11 -0
- package/generated/v1/schemas/projects.rename.response.json +79 -0
- package/generated/v1/schemas/schedules.archive.response.json +90 -2
- package/generated/v1/schemas/schedules.cancel.response.json +90 -2
- package/generated/v1/schemas/schedules.create.request.json +24 -3
- package/generated/v1/schemas/schedules.create.response.json +90 -2
- package/generated/v1/schemas/schedules.list.query.json +13 -0
- package/generated/v1/schemas/schedules.list.response.json +67 -2
- package/generated/v1/schemas/schedules.pause.response.json +90 -2
- package/generated/v1/schemas/schedules.read.response.json +90 -2
- package/generated/v1/schemas/schedules.replace.request.json +24 -3
- package/generated/v1/schemas/schedules.replace.response.json +90 -2
- package/generated/v1/schemas/schedules.resume.response.json +90 -2
- package/generated/v1/schemas/timing.summary.response.json +191 -0
- package/generated/v1/schemas/usage.read.query.json +7 -0
- package/generated/v1/schemas/usage.read.response.json +36 -1
- package/generated/v1/snippets/billing.autotopup.json +6 -0
- package/generated/v1/snippets/billing.autotopuppreview.json +6 -0
- package/generated/v1/snippets/billing.budgets.json +6 -0
- package/generated/v1/snippets/billing.ceiling.json +6 -0
- package/generated/v1/snippets/billing.change.json +6 -0
- package/generated/v1/snippets/billing.funding.json +6 -0
- package/generated/v1/snippets/billing.fundingconfirm.json +6 -0
- package/generated/v1/snippets/billing.fundingquote.json +6 -0
- package/generated/v1/snippets/billing.invoicehistory.json +6 -0
- package/generated/v1/snippets/billing.invoices.json +6 -0
- package/generated/v1/snippets/billing.ledger.json +6 -0
- package/generated/v1/snippets/billing.notices.json +6 -0
- package/generated/v1/snippets/billing.notificationsettings.json +6 -0
- package/generated/v1/snippets/billing.notificationsettingsupdate.json +6 -0
- package/generated/v1/snippets/billing.paymenthistory.json +6 -0
- package/generated/v1/snippets/billing.paymentmethod.json +6 -0
- package/generated/v1/snippets/billing.paymentmethodconfirm.json +6 -0
- package/generated/v1/snippets/billing.paymentmethodremove.json +6 -0
- package/generated/v1/snippets/billing.paymentmethodsetup.json +6 -0
- package/generated/v1/snippets/billing.portal.json +6 -0
- package/generated/v1/snippets/billing.projects.json +6 -0
- package/generated/v1/snippets/billing.purchase.json +6 -0
- package/generated/v1/snippets/billing.quote.json +6 -0
- package/generated/v1/snippets/billing.reconcile.json +6 -0
- package/generated/v1/snippets/billing.refundrequest.json +6 -0
- package/generated/v1/snippets/billing.refundresolution.json +6 -0
- package/generated/v1/snippets/billing.summary.json +6 -0
- package/generated/v1/snippets/endpoints.acknowledgeSigningKeyRotation.json +6 -0
- package/generated/v1/snippets/{endpoints.verify.json → endpoints.enable.json} +3 -3
- package/generated/v1/snippets/endpoints.revealSigningSecret.json +6 -0
- package/generated/v1/snippets/executions.list.json +6 -0
- package/generated/v1/snippets/exports.cancel.json +6 -0
- package/generated/v1/snippets/exports.create.json +6 -0
- package/generated/v1/snippets/exports.part.json +6 -0
- package/generated/v1/snippets/exports.read.json +6 -0
- package/generated/v1/snippets/forecast.windows.json +1 -1
- package/generated/v1/snippets/limits.read.json +6 -0
- package/generated/v1/snippets/organizations.close.json +6 -0
- package/generated/v1/snippets/organizations.lifecycle.json +6 -0
- package/generated/v1/snippets/organizations.restore.json +6 -0
- package/generated/v1/snippets/projects.archive.json +6 -0
- package/generated/v1/snippets/projects.delete.json +6 -0
- package/generated/v1/snippets/projects.rename.json +6 -0
- package/generated/v1/snippets/schedules.create.json +3 -3
- package/generated/v1/snippets/schedules.replace.json +3 -3
- package/generated/v1/snippets/timing.summary.json +6 -0
- package/package.json +7 -7
- package/dist/callback-ownership.d.ts +0 -58
- package/dist/callback-ownership.js +0 -71
- package/generated/v1/callback-endpoint-verification.json +0 -59
- /package/generated/v1/schemas/{endpoints.verify.response-headers.json → endpoints.acknowledgeSigningKeyRotation.response-headers.json} +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from "./zod.js";
|
|
2
|
+
export declare const organizationLifecycleSchema: import("zod").ZodObject<{
|
|
3
|
+
organizationId: import("zod").ZodString;
|
|
4
|
+
generation: import("zod").ZodNumber;
|
|
5
|
+
phase: import("zod").ZodEnum<{
|
|
6
|
+
active: "active";
|
|
7
|
+
closing: "closing";
|
|
8
|
+
closed: "closed";
|
|
9
|
+
restoring: "restoring";
|
|
10
|
+
purging: "purging";
|
|
11
|
+
erased: "erased";
|
|
12
|
+
}>;
|
|
13
|
+
requestedAt: import("zod").ZodNullable<import("zod").ZodString>;
|
|
14
|
+
reversibleUntil: import("zod").ZodNullable<import("zod").ZodString>;
|
|
15
|
+
purgeDeadline: import("zod").ZodNullable<import("zod").ZodString>;
|
|
16
|
+
immediate: import("zod").ZodBoolean;
|
|
17
|
+
converged: import("zod").ZodBoolean;
|
|
18
|
+
}, import("zod/v4/core").$strict>;
|
|
19
|
+
export declare const organizationClosureRequestSchema: import("zod").ZodObject<{
|
|
20
|
+
expectedGeneration: import("zod").ZodNumber;
|
|
21
|
+
immediate: import("zod").ZodBoolean;
|
|
22
|
+
confirmation: import("zod").ZodLiteral<"delete organization">;
|
|
23
|
+
}, import("zod/v4/core").$strict>;
|
|
24
|
+
export declare const organizationRestoreRequestSchema: import("zod").ZodObject<{
|
|
25
|
+
expectedGeneration: import("zod").ZodNumber;
|
|
26
|
+
}, import("zod/v4/core").$strict>;
|
|
27
|
+
export type OrganizationLifecycle = z.infer<typeof organizationLifecycleSchema>;
|
|
28
|
+
export declare const ORGANIZATION_LIFECYCLE_OPERATIONS: readonly [import("./operations.js").OperationDefinition & {
|
|
29
|
+
readonly id: "organizations.lifecycle";
|
|
30
|
+
}, import("./operations.js").OperationDefinition & {
|
|
31
|
+
readonly id: "organizations.close";
|
|
32
|
+
}, import("./operations.js").OperationDefinition & {
|
|
33
|
+
readonly id: "organizations.restore";
|
|
34
|
+
}];
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { organizationIdSchema } from "./identifiers.js";
|
|
2
|
+
import { API_UNUSED_RESPONSE_SCHEMA, defineOperations, } from "./operation-definitions.js";
|
|
3
|
+
import { timestampSchema } from "./time.js";
|
|
4
|
+
import { z } from "./zod.js";
|
|
5
|
+
export const organizationLifecycleSchema = z.strictObject({
|
|
6
|
+
organizationId: organizationIdSchema,
|
|
7
|
+
generation: z.number().int().nonnegative(),
|
|
8
|
+
phase: z.enum([
|
|
9
|
+
"active",
|
|
10
|
+
"closing",
|
|
11
|
+
"closed",
|
|
12
|
+
"restoring",
|
|
13
|
+
"purging",
|
|
14
|
+
"erased",
|
|
15
|
+
]),
|
|
16
|
+
requestedAt: timestampSchema.nullable(),
|
|
17
|
+
reversibleUntil: timestampSchema.nullable(),
|
|
18
|
+
purgeDeadline: timestampSchema.nullable(),
|
|
19
|
+
immediate: z.boolean(),
|
|
20
|
+
converged: z.boolean(),
|
|
21
|
+
});
|
|
22
|
+
export const organizationClosureRequestSchema = z.strictObject({
|
|
23
|
+
expectedGeneration: z.number().int().nonnegative(),
|
|
24
|
+
immediate: z.boolean(),
|
|
25
|
+
confirmation: z.literal("delete organization"),
|
|
26
|
+
});
|
|
27
|
+
export const organizationRestoreRequestSchema = z.strictObject({
|
|
28
|
+
expectedGeneration: z.number().int().positive(),
|
|
29
|
+
});
|
|
30
|
+
const example = {
|
|
31
|
+
organizationId: "org_01h8xyz9k2m4n6p8r0t2v4w6y8",
|
|
32
|
+
generation: 1,
|
|
33
|
+
phase: "closed",
|
|
34
|
+
requestedAt: "2026-09-12T12:00:00.000Z",
|
|
35
|
+
reversibleUntil: "2026-09-19T12:00:00.000Z",
|
|
36
|
+
purgeDeadline: "2026-10-12T12:00:00.000Z",
|
|
37
|
+
immediate: false,
|
|
38
|
+
converged: true,
|
|
39
|
+
};
|
|
40
|
+
const common = {
|
|
41
|
+
creates: false,
|
|
42
|
+
idempotent: true,
|
|
43
|
+
mcp: {
|
|
44
|
+
kind: "unavailable",
|
|
45
|
+
reason: "Organization closure and recovery require a signed-in administrator; delegated credentials cannot acquire organization-wide authority.",
|
|
46
|
+
},
|
|
47
|
+
principals: ["session"],
|
|
48
|
+
problems: [
|
|
49
|
+
"invalid_request",
|
|
50
|
+
"not_found",
|
|
51
|
+
"state_conflict",
|
|
52
|
+
"version_conflict",
|
|
53
|
+
],
|
|
54
|
+
response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
|
|
55
|
+
? API_UNUSED_RESPONSE_SCHEMA
|
|
56
|
+
: organizationLifecycleSchema,
|
|
57
|
+
scopes: ["projects:administer"],
|
|
58
|
+
sessionAuthority: "organization",
|
|
59
|
+
surfaces: ["api", "mock"],
|
|
60
|
+
example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
|
|
61
|
+
? {}
|
|
62
|
+
: example,
|
|
63
|
+
};
|
|
64
|
+
export const ORGANIZATION_LIFECYCLE_OPERATIONS = defineOperations([
|
|
65
|
+
{
|
|
66
|
+
...common,
|
|
67
|
+
id: "organizations.lifecycle",
|
|
68
|
+
problems: ["not_found", "service_unavailable"],
|
|
69
|
+
method: "GET",
|
|
70
|
+
mutates: false,
|
|
71
|
+
path: "/v1/organization/lifecycle",
|
|
72
|
+
summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
|
|
73
|
+
? ""
|
|
74
|
+
: "Read organization closure progress",
|
|
75
|
+
description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
|
|
76
|
+
? ""
|
|
77
|
+
: "Reads the signed-in administrator's organization closure generation and progress, including the reversible window. It remains available during closure so the administrator can request recovery.",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
...common,
|
|
81
|
+
id: "organizations.close",
|
|
82
|
+
method: "POST",
|
|
83
|
+
mutates: true,
|
|
84
|
+
path: "/v1/organization/close",
|
|
85
|
+
summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
|
|
86
|
+
? ""
|
|
87
|
+
: "Close the organization and request erasure",
|
|
88
|
+
description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
|
|
89
|
+
? ""
|
|
90
|
+
: "Stops customer access, execution and new purchases across the organization. Ordinary closure can be reversed for seven days; immediate erasure skips that window. Non-financial erasure completes within thirty days unless suspended by an operator legal hold. Financial records remain under the configured retention policy. An interrupted request resumes under the same generation; closure is acknowledged only after every configured scheduling shard is fenced.",
|
|
91
|
+
request: organizationClosureRequestSchema,
|
|
92
|
+
requestExample: globalThis
|
|
93
|
+
.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
|
|
94
|
+
? {}
|
|
95
|
+
: {
|
|
96
|
+
expectedGeneration: 0,
|
|
97
|
+
immediate: false,
|
|
98
|
+
confirmation: "delete organization",
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
...common,
|
|
103
|
+
id: "organizations.restore",
|
|
104
|
+
method: "POST",
|
|
105
|
+
mutates: true,
|
|
106
|
+
path: "/v1/organization/restore",
|
|
107
|
+
summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
|
|
108
|
+
? ""
|
|
109
|
+
: "Cancel organization erasure during its reversible window",
|
|
110
|
+
description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
|
|
111
|
+
? ""
|
|
112
|
+
: "Restores access after every configured scheduling shard acknowledges the new generation. Immediate erasure and expired reversible windows cannot be restored. Recovery preserves each schedule's pause and lateness policy and does not reauthorize automatic top-up.",
|
|
113
|
+
request: organizationRestoreRequestSchema,
|
|
114
|
+
requestExample: globalThis
|
|
115
|
+
.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
|
|
116
|
+
? {}
|
|
117
|
+
: { expectedGeneration: 1 },
|
|
118
|
+
example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
|
|
119
|
+
? {}
|
|
120
|
+
: { ...example, generation: 2, phase: "active" },
|
|
121
|
+
},
|
|
122
|
+
]);
|
package/dist/partition.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export declare const SINGLE_SHARD = "0";
|
|
|
53
53
|
* produced by two constants drifting apart. The test-gap audit named exactly
|
|
54
54
|
* that, and the fix is one declaration rather than a test comparing two.
|
|
55
55
|
*
|
|
56
|
-
* Thirty-two is one
|
|
56
|
+
* Thirty-two is one control-plane batch's worth of work and a few kilobytes of response.
|
|
57
57
|
* The caller comes back for the rest, and `RetainedProjections.pending` is how
|
|
58
58
|
* it knows to.
|
|
59
59
|
*/
|
|
@@ -93,8 +93,8 @@ export declare const MAX_PARTITION_SHARDS = 8;
|
|
|
93
93
|
* only under a precondition, and that is the most important thing to know about
|
|
94
94
|
* it.** A schedule's shard is derived from its identifier. Before W2-06 that was
|
|
95
95
|
* the only answer, so raising the count stranded every schedule already stored.
|
|
96
|
-
* Now the shard a schedule was actually stored in is *recorded* in the
|
|
97
|
-
* directory, and `resolveSchedule` falls back to it whenever the derived
|
|
96
|
+
* Now the shard a schedule was actually stored in is *recorded* in the
|
|
97
|
+
* control-plane directory, and `resolveSchedule` falls back to it whenever the derived
|
|
98
98
|
* partition has nothing — so a schedule created under an older count keeps
|
|
99
99
|
* working, because its route was written down rather than recomputed.
|
|
100
100
|
*
|
|
@@ -295,7 +295,7 @@ export interface DrainProjectionsQuery {
|
|
|
295
295
|
*
|
|
296
296
|
* **Nothing is deleted here.** The intents stay until `settleProjections` says
|
|
297
297
|
* the control plane has them, which is acceptance criterion 1: an intent
|
|
298
|
-
* survives a drain whose
|
|
298
|
+
* survives a drain whose control-plane write never landed, and a partition that has never
|
|
299
299
|
* been initialized answers an empty drain rather than a refusal — a shard nobody
|
|
300
300
|
* has written to owes the directory nothing.
|
|
301
301
|
*/
|
|
@@ -304,9 +304,10 @@ export type DrainProjectionsOutcome = PartitionRefused | RetainedProjections;
|
|
|
304
304
|
* Retire the intents the control plane accepted, and postpone the rest.
|
|
305
305
|
*
|
|
306
306
|
* Both halves in one call rather than two, because a drain has exactly one of
|
|
307
|
-
* these outcomes and the failing half must not need a healthy
|
|
308
|
-
* the deferral is what stops a control-plane outage from
|
|
309
|
-
* request pay a
|
|
307
|
+
* these outcomes and the failing half must not need a healthy control plane
|
|
308
|
+
* to be recorded: the deferral is what stops a control-plane outage from
|
|
309
|
+
* making every subsequent request pay a control-plane timeout for the same
|
|
310
|
+
* intent.
|
|
310
311
|
*/
|
|
311
312
|
export interface SettleProjectionsCommand {
|
|
312
313
|
/** Intents the control plane has durably applied, or cannot route. */
|
|
@@ -470,7 +471,7 @@ export interface CreateScheduleCommand {
|
|
|
470
471
|
readonly partitionKey?: string;
|
|
471
472
|
/**
|
|
472
473
|
* Authenticated encrypted customer JSON. The plaintext never crosses this
|
|
473
|
-
* seam and is never stored in a
|
|
474
|
+
* seam and is never stored in a control-plane projection.
|
|
474
475
|
*/
|
|
475
476
|
readonly payloadEnvelope?: string;
|
|
476
477
|
/** UTF-8 byte length of the plaintext JSON, before encryption. */
|
|
@@ -479,7 +480,7 @@ export interface CreateScheduleCommand {
|
|
|
479
480
|
* The verified endpoint URL captured for durable host routing.
|
|
480
481
|
*
|
|
481
482
|
* This is internal metadata, not a public response field. The Host Executor
|
|
482
|
-
* re-reads the
|
|
483
|
+
* re-reads the control-plane endpoint row before signing and reroutes if the URL has
|
|
483
484
|
* changed. It does not resolve or revalidate the address: that boundary was
|
|
484
485
|
* removed by FXO-1566 and FXO-1581, and this comment claimed it afterwards.
|
|
485
486
|
*/
|
|
@@ -540,6 +541,12 @@ export interface ListOccurrencesQuery {
|
|
|
540
541
|
readonly after?: OccurrencePagePosition;
|
|
541
542
|
readonly authority: Authority;
|
|
542
543
|
readonly limit: number;
|
|
544
|
+
/**
|
|
545
|
+
* Which end to walk from; oldest when absent. A cursor belongs to the order
|
|
546
|
+
* it was issued under. Spelled out rather than imported so this module keeps
|
|
547
|
+
* carrying no runtime import of the contract barrel.
|
|
548
|
+
*/
|
|
549
|
+
readonly order?: "newest" | "oldest";
|
|
543
550
|
readonly scheduleId: string;
|
|
544
551
|
}
|
|
545
552
|
export type ListOccurrencesOutcome = PartitionRefused | {
|
|
@@ -621,6 +628,8 @@ export interface ScheduleWriteCommand {
|
|
|
621
628
|
}
|
|
622
629
|
/** Replace a schedule's definition, starting a new generation. */
|
|
623
630
|
export interface ReplaceScheduleCommand extends ScheduleWriteCommand {
|
|
631
|
+
/** A new name; absent keeps the stored one (W4-14). */
|
|
632
|
+
readonly name?: string;
|
|
624
633
|
/**
|
|
625
634
|
* The replacement's delivery settings.
|
|
626
635
|
*
|
|
@@ -692,6 +701,8 @@ export interface ForecastQuery {
|
|
|
692
701
|
readonly authority: Authority;
|
|
693
702
|
readonly bucketMs: number;
|
|
694
703
|
readonly fromMs: number;
|
|
704
|
+
/** Omit named-key cells when the public caller only needs totals/classes. */
|
|
705
|
+
readonly includePartitionKeys?: boolean;
|
|
695
706
|
readonly toMs: number;
|
|
696
707
|
}
|
|
697
708
|
/** One bucket, as one partition sees it. */
|
|
@@ -701,6 +712,8 @@ export interface ForecastPartitionBucket {
|
|
|
701
712
|
readonly count: number;
|
|
702
713
|
/** Occurrences here that are the next firing of their schedule. */
|
|
703
714
|
readonly nextFireCount: number;
|
|
715
|
+
/** Named-key counts folded into the public remainder after exact ranking. */
|
|
716
|
+
readonly omittedPartitionKeyCount?: number;
|
|
704
717
|
/**
|
|
705
718
|
* Named customer keys and their counts, ascending by key.
|
|
706
719
|
*
|
|
@@ -740,6 +753,27 @@ export type ForecastOutcome = PartitionRefused | {
|
|
|
740
753
|
*/
|
|
741
754
|
readonly asOfMs?: number;
|
|
742
755
|
readonly buckets: readonly ForecastPartitionBucket[];
|
|
756
|
+
/** Operator work budget that prevented a complete answer, never a count. */
|
|
757
|
+
readonly exhaustedBudget?: string;
|
|
758
|
+
readonly coverage?: import("./forecast.js").ForecastCoverage;
|
|
759
|
+
/**
|
|
760
|
+
* The instant this answer actually reached, when it is not the one asked
|
|
761
|
+
* for.
|
|
762
|
+
*
|
|
763
|
+
* **A plan horizon shortens a forecast rather than refusing it**, which
|
|
764
|
+
* is the right trade — a plan that buys six hours is telling a customer
|
|
765
|
+
* how far it can see, and answering "no forecast at all" because they
|
|
766
|
+
* asked for a day would be a worse reading of the same purchase. What
|
|
767
|
+
* was missing is the other half: the published window said twenty-four
|
|
768
|
+
* hours and the last eighteen of them were empty, so a caller sizing
|
|
769
|
+
* capacity read "nothing planned" where the truth was "not projected",
|
|
770
|
+
* and under-read by three quarters. The dashboard drew it as eighteen
|
|
771
|
+
* hours of zero bars.
|
|
772
|
+
*
|
|
773
|
+
* Absent when the answer covered the whole window, which is every source
|
|
774
|
+
* with no horizon over it.
|
|
775
|
+
*/
|
|
776
|
+
readonly coveredToMs?: number;
|
|
743
777
|
readonly truncated: boolean;
|
|
744
778
|
};
|
|
745
779
|
/**
|
package/dist/partition.js
CHANGED
|
@@ -51,7 +51,7 @@ export const SINGLE_SHARD = "0";
|
|
|
51
51
|
* produced by two constants drifting apart. The test-gap audit named exactly
|
|
52
52
|
* that, and the fix is one declaration rather than a test comparing two.
|
|
53
53
|
*
|
|
54
|
-
* Thirty-two is one
|
|
54
|
+
* Thirty-two is one control-plane batch's worth of work and a few kilobytes of response.
|
|
55
55
|
* The caller comes back for the rest, and `RetainedProjections.pending` is how
|
|
56
56
|
* it knows to.
|
|
57
57
|
*/
|
|
@@ -110,8 +110,8 @@ function fnv1a32(input) {
|
|
|
110
110
|
* only under a precondition, and that is the most important thing to know about
|
|
111
111
|
* it.** A schedule's shard is derived from its identifier. Before W2-06 that was
|
|
112
112
|
* the only answer, so raising the count stranded every schedule already stored.
|
|
113
|
-
* Now the shard a schedule was actually stored in is *recorded* in the
|
|
114
|
-
* directory, and `resolveSchedule` falls back to it whenever the derived
|
|
113
|
+
* Now the shard a schedule was actually stored in is *recorded* in the
|
|
114
|
+
* control-plane directory, and `resolveSchedule` falls back to it whenever the derived
|
|
115
115
|
* partition has nothing — so a schedule created under an older count keeps
|
|
116
116
|
* working, because its route was written down rather than recomputed.
|
|
117
117
|
*
|
package/dist/policy.d.ts
CHANGED
|
@@ -47,10 +47,10 @@ export declare function grantableScopes(): readonly Scope[];
|
|
|
47
47
|
* that will be refused `authentication_required` on the only route it names,
|
|
48
48
|
* for ever, and nothing about the key says so.
|
|
49
49
|
*
|
|
50
|
-
* `projects:read`
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
50
|
+
* `projects:read` remains excluded because enumerating an organization is a
|
|
51
|
+
* signed-in member's question. Project writes are different: a key's authority
|
|
52
|
+
* already names exactly the project that rename/archive/delete may affect, so
|
|
53
|
+
* those scopes become usable when their operations do.
|
|
54
54
|
*/
|
|
55
55
|
export declare function credentialScopes(): readonly Scope[];
|
|
56
56
|
/** One row of the generated policy matrix. */
|
package/dist/policy.js
CHANGED
|
@@ -50,9 +50,13 @@ function allOperations() {
|
|
|
50
50
|
* Clerk's and this product does not do it, so this is the whole of what `admin`
|
|
51
51
|
* means here.
|
|
52
52
|
*/
|
|
53
|
-
const MEMBER_SCOPES = SCOPES.filter((scope) => scope !== "
|
|
53
|
+
const MEMBER_SCOPES = SCOPES.filter((scope) => scope !== "billing:write" &&
|
|
54
|
+
scope !== "credentials:administer" &&
|
|
55
|
+
scope !== "projects:administer");
|
|
56
|
+
const BILLING_SCOPES = SCOPES.filter((scope) => scope !== "credentials:administer" && scope !== "projects:administer");
|
|
54
57
|
export const ROLE_SCOPE_CEILINGS = {
|
|
55
58
|
admin: SCOPES,
|
|
59
|
+
billing: BILLING_SCOPES,
|
|
56
60
|
member: MEMBER_SCOPES,
|
|
57
61
|
};
|
|
58
62
|
/** Everything a role may hold, expanded so a write implies its read. */
|
|
@@ -129,10 +133,10 @@ export function grantableScopes() {
|
|
|
129
133
|
* that will be refused `authentication_required` on the only route it names,
|
|
130
134
|
* for ever, and nothing about the key says so.
|
|
131
135
|
*
|
|
132
|
-
* `projects:read`
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
+
* `projects:read` remains excluded because enumerating an organization is a
|
|
137
|
+
* signed-in member's question. Project writes are different: a key's authority
|
|
138
|
+
* already names exactly the project that rename/archive/delete may affect, so
|
|
139
|
+
* those scopes become usable when their operations do.
|
|
136
140
|
*/
|
|
137
141
|
export function credentialScopes() {
|
|
138
142
|
const usable = new Set(allOperations()
|
package/dist/problems.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import { z } from "./zod.js";
|
|
2
2
|
/**
|
|
3
3
|
* Refusals.
|
|
4
4
|
*
|
|
@@ -12,12 +12,13 @@ import { z } from "zod";
|
|
|
12
12
|
* `code` is the contract. `title` and `detail` are prose and may change without
|
|
13
13
|
* being a breaking change; clients must never branch on them.
|
|
14
14
|
*/
|
|
15
|
-
export declare const PROBLEM_CATEGORIES: readonly ["authentication", "authorization", "conflict", "invalid-request", "not-found", "rate-limited", "unavailable"];
|
|
16
|
-
export declare const problemCategorySchema:
|
|
15
|
+
export declare const PROBLEM_CATEGORIES: readonly ["authentication", "authorization", "conflict", "invalid-request", "not-configured", "not-found", "rate-limited", "unavailable"];
|
|
16
|
+
export declare const problemCategorySchema: import("zod").ZodEnum<{
|
|
17
17
|
authentication: "authentication";
|
|
18
18
|
authorization: "authorization";
|
|
19
19
|
conflict: "conflict";
|
|
20
20
|
"invalid-request": "invalid-request";
|
|
21
|
+
"not-configured": "not-configured";
|
|
21
22
|
"not-found": "not-found";
|
|
22
23
|
"rate-limited": "rate-limited";
|
|
23
24
|
unavailable: "unavailable";
|
|
@@ -32,6 +33,14 @@ export declare const PROBLEM_CODES: {
|
|
|
32
33
|
readonly category: "authentication";
|
|
33
34
|
readonly status: 401;
|
|
34
35
|
};
|
|
36
|
+
readonly billing_not_ready: {
|
|
37
|
+
readonly category: "unavailable";
|
|
38
|
+
readonly status: 503;
|
|
39
|
+
};
|
|
40
|
+
readonly capability_not_configured: {
|
|
41
|
+
readonly category: "not-configured";
|
|
42
|
+
readonly status: 503;
|
|
43
|
+
};
|
|
35
44
|
readonly credential_expired: {
|
|
36
45
|
readonly category: "authentication";
|
|
37
46
|
readonly status: 401;
|
|
@@ -40,10 +49,6 @@ export declare const PROBLEM_CODES: {
|
|
|
40
49
|
readonly category: "authentication";
|
|
41
50
|
readonly status: 401;
|
|
42
51
|
};
|
|
43
|
-
readonly endpoint_unverified: {
|
|
44
|
-
readonly category: "invalid-request";
|
|
45
|
-
readonly status: 422;
|
|
46
|
-
};
|
|
47
52
|
readonly idempotency_key_reused: {
|
|
48
53
|
readonly category: "conflict";
|
|
49
54
|
readonly status: 409;
|
|
@@ -64,10 +69,18 @@ export declare const PROBLEM_CODES: {
|
|
|
64
69
|
readonly category: "conflict";
|
|
65
70
|
readonly status: 409;
|
|
66
71
|
};
|
|
72
|
+
readonly project_archived: {
|
|
73
|
+
readonly category: "conflict";
|
|
74
|
+
readonly status: 409;
|
|
75
|
+
};
|
|
67
76
|
readonly rate_limited: {
|
|
68
77
|
readonly category: "rate-limited";
|
|
69
78
|
readonly status: 429;
|
|
70
79
|
};
|
|
80
|
+
readonly revision_conflict: {
|
|
81
|
+
readonly category: "conflict";
|
|
82
|
+
readonly status: 409;
|
|
83
|
+
};
|
|
71
84
|
readonly scope_missing: {
|
|
72
85
|
readonly category: "authorization";
|
|
73
86
|
readonly status: 403;
|
|
@@ -90,59 +103,75 @@ export declare const PROBLEM_CODES: {
|
|
|
90
103
|
};
|
|
91
104
|
};
|
|
92
105
|
export type ProblemCode = keyof typeof PROBLEM_CODES;
|
|
93
|
-
export declare const problemCodeSchema:
|
|
106
|
+
export declare const problemCodeSchema: import("zod").ZodEnum<{
|
|
94
107
|
authentication_required: "authentication_required";
|
|
108
|
+
billing_not_ready: "billing_not_ready";
|
|
109
|
+
capability_not_configured: "capability_not_configured";
|
|
95
110
|
credential_expired: "credential_expired";
|
|
96
111
|
credential_revoked: "credential_revoked";
|
|
97
|
-
endpoint_unverified: "endpoint_unverified";
|
|
98
112
|
idempotency_key_reused: "idempotency_key_reused";
|
|
99
113
|
invalid_request: "invalid_request";
|
|
100
114
|
not_found: "not_found";
|
|
101
115
|
payload_too_large: "payload_too_large";
|
|
102
116
|
plan_limit_reached: "plan_limit_reached";
|
|
117
|
+
project_archived: "project_archived";
|
|
103
118
|
rate_limited: "rate_limited";
|
|
119
|
+
revision_conflict: "revision_conflict";
|
|
104
120
|
scope_missing: "scope_missing";
|
|
105
121
|
service_unavailable: "service_unavailable";
|
|
106
122
|
state_conflict: "state_conflict";
|
|
107
123
|
test_to_live_escalation: "test_to_live_escalation";
|
|
108
124
|
version_conflict: "version_conflict";
|
|
109
125
|
}>;
|
|
110
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* Whether repeating the identical request could succeed later.
|
|
128
|
+
*
|
|
129
|
+
* **Two 5xx categories, opposite answers, and that is the point.**
|
|
130
|
+
* `unavailable` is something that has gone wrong and will come back;
|
|
131
|
+
* `not-configured` is something that was never turned on and will not turn
|
|
132
|
+
* itself on. Reading the status alone cannot tell them apart, which is how a
|
|
133
|
+
* permanent refusal came to be published to customers as retryable — in the
|
|
134
|
+
* SDK's `retryable`, in the CLI's exit class, and as a "Try again" control the
|
|
135
|
+
* dashboard offered for a condition no amount of trying clears.
|
|
136
|
+
*/
|
|
111
137
|
export declare function isRetryable(code: ProblemCode): boolean;
|
|
112
|
-
export declare const fieldErrorSchema:
|
|
113
|
-
pointer:
|
|
114
|
-
reason:
|
|
115
|
-
},
|
|
138
|
+
export declare const fieldErrorSchema: import("zod").ZodObject<{
|
|
139
|
+
pointer: import("zod").ZodString;
|
|
140
|
+
reason: import("zod").ZodString;
|
|
141
|
+
}, import("zod/v4/core").$strip>;
|
|
116
142
|
export type FieldError = z.infer<typeof fieldErrorSchema>;
|
|
117
|
-
export declare const problemSchema:
|
|
118
|
-
code:
|
|
143
|
+
export declare const problemSchema: import("zod").ZodObject<{
|
|
144
|
+
code: import("zod").ZodEnum<{
|
|
119
145
|
authentication_required: "authentication_required";
|
|
146
|
+
billing_not_ready: "billing_not_ready";
|
|
147
|
+
capability_not_configured: "capability_not_configured";
|
|
120
148
|
credential_expired: "credential_expired";
|
|
121
149
|
credential_revoked: "credential_revoked";
|
|
122
|
-
endpoint_unverified: "endpoint_unverified";
|
|
123
150
|
idempotency_key_reused: "idempotency_key_reused";
|
|
124
151
|
invalid_request: "invalid_request";
|
|
125
152
|
not_found: "not_found";
|
|
126
153
|
payload_too_large: "payload_too_large";
|
|
127
154
|
plan_limit_reached: "plan_limit_reached";
|
|
155
|
+
project_archived: "project_archived";
|
|
128
156
|
rate_limited: "rate_limited";
|
|
157
|
+
revision_conflict: "revision_conflict";
|
|
129
158
|
scope_missing: "scope_missing";
|
|
130
159
|
service_unavailable: "service_unavailable";
|
|
131
160
|
state_conflict: "state_conflict";
|
|
132
161
|
test_to_live_escalation: "test_to_live_escalation";
|
|
133
162
|
version_conflict: "version_conflict";
|
|
134
163
|
}>;
|
|
135
|
-
detail:
|
|
136
|
-
errors:
|
|
137
|
-
pointer:
|
|
138
|
-
reason:
|
|
139
|
-
},
|
|
140
|
-
retryAfterSeconds:
|
|
141
|
-
status:
|
|
142
|
-
title:
|
|
143
|
-
traceId:
|
|
144
|
-
type:
|
|
145
|
-
},
|
|
164
|
+
detail: import("zod").ZodOptional<import("zod").ZodString>;
|
|
165
|
+
errors: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
166
|
+
pointer: import("zod").ZodString;
|
|
167
|
+
reason: import("zod").ZodString;
|
|
168
|
+
}, import("zod/v4/core").$strip>>>;
|
|
169
|
+
retryAfterSeconds: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
170
|
+
status: import("zod").ZodNumber;
|
|
171
|
+
title: import("zod").ZodString;
|
|
172
|
+
traceId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
173
|
+
type: import("zod").ZodLiteral<"about:blank">;
|
|
174
|
+
}, import("zod/v4/core").$strip>;
|
|
146
175
|
export type Problem = z.infer<typeof problemSchema>;
|
|
147
176
|
export interface ProblemOptions {
|
|
148
177
|
readonly detail?: string;
|
package/dist/problems.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import { z } from "./zod.js";
|
|
2
2
|
/**
|
|
3
3
|
* Refusals.
|
|
4
4
|
*
|
|
@@ -17,6 +17,14 @@ export const PROBLEM_CATEGORIES = [
|
|
|
17
17
|
"authorization",
|
|
18
18
|
"conflict",
|
|
19
19
|
"invalid-request",
|
|
20
|
+
// **A capability this deployment was never given, which is not an outage.**
|
|
21
|
+
// Separate from `unavailable` for one reason: `isRetryable` is a function of
|
|
22
|
+
// the category, and these two answer the retry question oppositely. An
|
|
23
|
+
// outage clears by itself and repeating is the right move; an unconfigured
|
|
24
|
+
// capability clears when somebody changes configuration and never otherwise,
|
|
25
|
+
// so telling a client "the identical request is safe to repeat" is false and
|
|
26
|
+
// it is false forever. Both are 5xx because the caller's request was fine.
|
|
27
|
+
"not-configured",
|
|
20
28
|
"not-found",
|
|
21
29
|
"rate-limited",
|
|
22
30
|
"unavailable",
|
|
@@ -34,15 +42,49 @@ export const PROBLEM_CODES = {
|
|
|
34
42
|
// now. One code for both would make a missed rotation window indistinguishable
|
|
35
43
|
// from a security event, and the client's remedy differs — rotate again
|
|
36
44
|
// versus find out who revoked it.
|
|
45
|
+
// **"Still being set up" is not "broken", and a first screen should not say
|
|
46
|
+
// the second when it means the first.** An organization's billing account row
|
|
47
|
+
// is written by a projection that runs every minute rather than synchronously
|
|
48
|
+
// at sign-up, so a member who creates their project immediately can read
|
|
49
|
+
// billing before the row exists. That used to answer `service_unavailable`,
|
|
50
|
+
// which the dashboard renders as "The service is not answering right now" —
|
|
51
|
+
// the sentence W9-06 blocked the invited cohort over, and the one a new member
|
|
52
|
+
// met on first contact.
|
|
53
|
+
//
|
|
54
|
+
// Deliberately still `unavailable`, and therefore still retryable: repeating
|
|
55
|
+
// the request is exactly the right move, and it succeeds within about a
|
|
56
|
+
// minute. What changes is what the reader is told, not what a client does.
|
|
57
|
+
billing_not_ready: { category: "unavailable", status: 503 },
|
|
58
|
+
// **The environment was never given this capability.** A configuration fact,
|
|
59
|
+
// not a fault and not a fluctuation: the Worker holds no provider, no secret
|
|
60
|
+
// or no binding for the thing being asked about, and it will hold none until
|
|
61
|
+
// somebody deploys different configuration.
|
|
62
|
+
//
|
|
63
|
+
// It exists because `service_unavailable` was carrying both meanings, and
|
|
64
|
+
// the retry answer differs between them. W9-06 blocked the invited cohort
|
|
65
|
+
// over billing panels that said "The service is not answering right now" for
|
|
66
|
+
// capabilities production had deliberately not turned on; W9-08 found the
|
|
67
|
+
// other half still live — the same refusal reaching a customer as
|
|
68
|
+
// `retryable`, and the CLI printing "The identical request is safe to
|
|
69
|
+
// repeat" about a condition no repetition can clear.
|
|
70
|
+
//
|
|
71
|
+
// Deliberately **not** `billing_not_ready`, which is the opposite case: that
|
|
72
|
+
// one is provisioning already in flight, finishes on its own within a
|
|
73
|
+
// minute, and is correctly retryable.
|
|
74
|
+
capability_not_configured: { category: "not-configured", status: 503 },
|
|
37
75
|
credential_expired: { category: "authentication", status: 401 },
|
|
38
76
|
credential_revoked: { category: "authentication", status: 401 },
|
|
39
|
-
endpoint_unverified: { category: "invalid-request", status: 422 },
|
|
40
77
|
idempotency_key_reused: { category: "conflict", status: 409 },
|
|
41
78
|
invalid_request: { category: "invalid-request", status: 400 },
|
|
42
79
|
not_found: { category: "not-found", status: 404 },
|
|
43
80
|
payload_too_large: { category: "invalid-request", status: 413 },
|
|
44
81
|
plan_limit_reached: { category: "conflict", status: 409 },
|
|
82
|
+
// The target belongs to the caller, but its whole project is parked. This is
|
|
83
|
+
// deliberately distinct from `not_found`: foreign projects still receive
|
|
84
|
+
// that opaque answer, while an owner needs the move that restores their own.
|
|
85
|
+
project_archived: { category: "conflict", status: 409 },
|
|
45
86
|
rate_limited: { category: "rate-limited", status: 429 },
|
|
87
|
+
revision_conflict: { category: "conflict", status: 409 },
|
|
46
88
|
scope_missing: { category: "authorization", status: 403 },
|
|
47
89
|
service_unavailable: { category: "unavailable", status: 503 },
|
|
48
90
|
// The resource is in a state that does not permit what was asked — resuming a
|
|
@@ -57,7 +99,17 @@ export const PROBLEM_CODES = {
|
|
|
57
99
|
version_conflict: { category: "conflict", status: 409 },
|
|
58
100
|
};
|
|
59
101
|
export const problemCodeSchema = z.enum(Object.keys(PROBLEM_CODES));
|
|
60
|
-
/**
|
|
102
|
+
/**
|
|
103
|
+
* Whether repeating the identical request could succeed later.
|
|
104
|
+
*
|
|
105
|
+
* **Two 5xx categories, opposite answers, and that is the point.**
|
|
106
|
+
* `unavailable` is something that has gone wrong and will come back;
|
|
107
|
+
* `not-configured` is something that was never turned on and will not turn
|
|
108
|
+
* itself on. Reading the status alone cannot tell them apart, which is how a
|
|
109
|
+
* permanent refusal came to be published to customers as retryable — in the
|
|
110
|
+
* SDK's `retryable`, in the CLI's exit class, and as a "Try again" control the
|
|
111
|
+
* dashboard offered for a condition no amount of trying clears.
|
|
112
|
+
*/
|
|
61
113
|
export function isRetryable(code) {
|
|
62
114
|
const category = PROBLEM_CODES[code].category;
|
|
63
115
|
return category === "rate-limited" || category === "unavailable";
|