@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
package/dist/endpoints.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import { z } from "./zod.js";
|
|
2
2
|
import { environmentKindSchema } from "./authority.js";
|
|
3
3
|
import { evaluateCallbackUrl } from "./callback-safety.js";
|
|
4
4
|
import { callbackSigningKeyIdSchema, endpointIdSchema, projectIdSchema, } from "./identifiers.js";
|
|
@@ -12,15 +12,22 @@ import { timestampSchema } from "./time.js";
|
|
|
12
12
|
* a caller can use to widen that tuple: `project` and `environmentKind` are
|
|
13
13
|
* display metadata, while every lookup is scoped by the verified principal.
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
/**
|
|
16
|
+
* An endpoint is usable the moment it exists (W4-12). `active` is every
|
|
17
|
+
* endpoint that is not disabled; `disabled` stops delivery until
|
|
18
|
+
* `endpoints.enable` turns it back on. There is no state in between and
|
|
19
|
+
* nothing to prove.
|
|
20
|
+
*/
|
|
21
|
+
export const CALLBACK_ENDPOINT_STATUSES = ["active", "disabled"];
|
|
20
22
|
export const callbackEndpointStatusSchema = z.enum(CALLBACK_ENDPOINT_STATUSES);
|
|
21
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Why an address could not be resolved or reached: the classification the
|
|
25
|
+
* DNS inspection at create and update, and the delivery egress, share. It
|
|
26
|
+
* was the verification-failure vocabulary until W4-12 removed verification;
|
|
27
|
+
* what remains is what those two paths can still observe.
|
|
28
|
+
*/
|
|
29
|
+
export const CALLBACK_EGRESS_FAILURES = [
|
|
22
30
|
"address_forbidden",
|
|
23
|
-
"challenge_failed",
|
|
24
31
|
"connection_failed",
|
|
25
32
|
"dns_unresolved",
|
|
26
33
|
"rate_limited",
|
|
@@ -29,51 +36,74 @@ export const CALLBACK_VERIFICATION_FAILURES = [
|
|
|
29
36
|
"timed_out",
|
|
30
37
|
"unexpected_status",
|
|
31
38
|
];
|
|
32
|
-
export const
|
|
39
|
+
export const callbackEgressFailureSchema = z.enum(CALLBACK_EGRESS_FAILURES);
|
|
33
40
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
41
|
+
* @deprecated The former retained endpoint count ceiling. W0-15 removes count
|
|
42
|
+
* enforcement after the operator's decision; DNS/mutation admission and paged
|
|
43
|
+
* reads protect bounded work. Retained for source compatibility with old clients.
|
|
37
44
|
*/
|
|
38
45
|
export const CALLBACK_ENDPOINT_LIMIT_PER_ENVIRONMENT = 50;
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
/**
|
|
47
|
+
* DNS inspection at create and update is admitted through both buckets
|
|
48
|
+
* before the first lookup, so an address a caller retypes cannot make this
|
|
49
|
+
* service resolve names without bound.
|
|
50
|
+
*/
|
|
51
|
+
export const CALLBACK_ADMISSION_RATE_LIMITS = {
|
|
52
|
+
destinationPerMinute: 15,
|
|
53
|
+
projectPerMinute: 60,
|
|
43
54
|
windowSeconds: 60,
|
|
44
55
|
};
|
|
45
|
-
/** Total bytes a verification response may return before it is refused. */
|
|
46
|
-
export const CALLBACK_VERIFICATION_RESPONSE_BYTES = 1_024;
|
|
47
|
-
/** Total DNS + connect + response bound for one verification attempt. */
|
|
48
|
-
export const CALLBACK_VERIFICATION_TIMEOUT_MILLISECONDS = 5_000;
|
|
49
56
|
/** Longest period during which a receiver may accept current and next keys. */
|
|
50
57
|
export const CALLBACK_SIGNING_KEY_ROTATION_OVERLAP_SECONDS = 86_400;
|
|
51
58
|
export const callbackSigningKeysSchema = z.object({
|
|
52
59
|
current: callbackSigningKeyIdSchema,
|
|
53
60
|
next: z
|
|
54
61
|
.object({
|
|
62
|
+
/** When a person confirmed their server accepts this next key. */
|
|
63
|
+
acknowledgedAt: timestampSchema.optional(),
|
|
55
64
|
id: callbackSigningKeyIdSchema,
|
|
56
65
|
overlapEndsAt: timestampSchema,
|
|
57
66
|
})
|
|
58
67
|
.optional(),
|
|
59
68
|
});
|
|
69
|
+
/**
|
|
70
|
+
* An endpoint's name: unique within its project and environment, compared
|
|
71
|
+
* exactly (W4-14, FXO-2255).
|
|
72
|
+
*
|
|
73
|
+
* Generated on save when nobody types one — the whole URL — because an
|
|
74
|
+
* endpoint appears in a dropdown, and two identical rows in a dropdown are
|
|
75
|
+
* two rows nobody can choose between. So a second endpoint at an address one
|
|
76
|
+
* already has is refused unless it is given a name of its own. **Case
|
|
77
|
+
* matters**: two webhook URLs differing only in the case of a token are two
|
|
78
|
+
* endpoints and both save unnamed; the cost, accepted knowingly, is that
|
|
79
|
+
* "Prod receiver" and "prod receiver" are both allowed. Deliberately unlike a
|
|
80
|
+
* project's name, which ignores case and spacing.
|
|
81
|
+
*/
|
|
82
|
+
export const callbackEndpointNameSchema = z
|
|
83
|
+
.string()
|
|
84
|
+
.trim()
|
|
85
|
+
.min(1, "must not be blank")
|
|
86
|
+
.max(2_048, "must be at most 2048 characters");
|
|
60
87
|
/**
|
|
61
88
|
* A metadata-only endpoint shape. The sealed signing secret has no public
|
|
62
|
-
* field, so list/get/update/
|
|
89
|
+
* field, so list/get/update/disable/enable cannot accidentally recover it.
|
|
63
90
|
*/
|
|
64
91
|
export const callbackEndpointSchema = z.object({
|
|
65
92
|
createdAt: timestampSchema,
|
|
66
93
|
disabledAt: timestampSchema.optional(),
|
|
67
94
|
environmentKind: environmentKindSchema,
|
|
68
95
|
id: endpointIdSchema,
|
|
69
|
-
|
|
70
|
-
|
|
96
|
+
/**
|
|
97
|
+
* The endpoint's name. Every endpoint written since W4-14 has one — its
|
|
98
|
+
* URL when none was given — and it is optional on the wire only so a row
|
|
99
|
+
* from before the column parses rather than fails.
|
|
100
|
+
*/
|
|
101
|
+
name: callbackEndpointNameSchema.optional(),
|
|
71
102
|
project: projectIdSchema,
|
|
72
103
|
signingKeys: callbackSigningKeysSchema,
|
|
73
104
|
status: callbackEndpointStatusSchema,
|
|
74
105
|
updatedAt: timestampSchema,
|
|
75
106
|
url: z.string().url(),
|
|
76
|
-
verifiedAt: timestampSchema.optional(),
|
|
77
107
|
version: z.number().int().positive(),
|
|
78
108
|
});
|
|
79
109
|
export const callbackEndpointPageSchema = pageSchema(callbackEndpointSchema);
|
|
@@ -97,6 +127,27 @@ export const callbackEndpointRotatedSchema = z.object({
|
|
|
97
127
|
secret: z.string().min(1),
|
|
98
128
|
shownOnce: z.literal(true),
|
|
99
129
|
});
|
|
130
|
+
/** One signing key and the secret behind it, as a signed-in person may see it. */
|
|
131
|
+
export const callbackEndpointSigningSecretSchema = z.object({
|
|
132
|
+
keyId: callbackSigningKeyIdSchema,
|
|
133
|
+
secret: z.string().min(1),
|
|
134
|
+
});
|
|
135
|
+
/**
|
|
136
|
+
* What `endpoints.revealSigningSecret` answers (FXO-2244).
|
|
137
|
+
*
|
|
138
|
+
* The same value `endpoints.create` and `endpoints.rotateSigningKey` hand out
|
|
139
|
+
* once, readable again by a signed-in member. Mirrors `signingKeys`: during a
|
|
140
|
+
* rotation both keys are here, with the instant the overlap ends, because a
|
|
141
|
+
* receiver being moved to the new key needs both until then.
|
|
142
|
+
*/
|
|
143
|
+
export const callbackEndpointSigningSecretsSchema = z.object({
|
|
144
|
+
current: callbackEndpointSigningSecretSchema,
|
|
145
|
+
/** The endpoint these belong to, so an answer names what it is about. */
|
|
146
|
+
id: endpointIdSchema,
|
|
147
|
+
next: callbackEndpointSigningSecretSchema
|
|
148
|
+
.extend({ overlapEndsAt: timestampSchema })
|
|
149
|
+
.optional(),
|
|
150
|
+
});
|
|
100
151
|
function callbackUrlSchema() {
|
|
101
152
|
return z
|
|
102
153
|
.string()
|
|
@@ -113,67 +164,12 @@ function callbackUrlSchema() {
|
|
|
113
164
|
});
|
|
114
165
|
}
|
|
115
166
|
export const callbackEndpointRequestSchema = z.object({
|
|
167
|
+
/**
|
|
168
|
+
* A name for people (W4-14, FXO-2255). Omitted on a create, the endpoint
|
|
169
|
+
* takes its whole URL as its name; omitted on an update, the stored name
|
|
170
|
+
* stays. Unique within the project and environment, compared exactly: a
|
|
171
|
+
* name another endpoint holds is refused as `state_conflict`.
|
|
172
|
+
*/
|
|
173
|
+
name: callbackEndpointNameSchema.optional(),
|
|
116
174
|
url: callbackUrlSchema(),
|
|
117
175
|
});
|
|
118
|
-
export const CALLBACK_VERIFICATION_PROTOCOL_VERSION = "2026-08-05";
|
|
119
|
-
export const CALLBACK_VERIFICATION_TYPE = "callback.endpoint.verification";
|
|
120
|
-
/**
|
|
121
|
-
* Exact verification bytes sent to the receiver. The receiver validates the
|
|
122
|
-
* request signature and proves possession of the one-time secret by returning
|
|
123
|
-
* an HMAC of `challenge` in `Callback-Verification-Response`.
|
|
124
|
-
*/
|
|
125
|
-
export const callbackVerificationChallengeSchema = z.object({
|
|
126
|
-
challenge: z.string().regex(/^cvc_[A-Za-z0-9_-]{43}$/u),
|
|
127
|
-
endpointId: endpointIdSchema,
|
|
128
|
-
type: z.literal(CALLBACK_VERIFICATION_TYPE),
|
|
129
|
-
version: z.literal(CALLBACK_VERIFICATION_PROTOCOL_VERSION),
|
|
130
|
-
});
|
|
131
|
-
export const CALLBACK_VERIFICATION_HEADERS = {
|
|
132
|
-
challenge: "Callback-Verification-Challenge",
|
|
133
|
-
requestSignature: "Callback-Verification-Signature",
|
|
134
|
-
responseSignature: "Callback-Verification-Response",
|
|
135
|
-
};
|
|
136
|
-
/**
|
|
137
|
-
* Machine-readable receiver contract for endpoint ownership verification.
|
|
138
|
-
*
|
|
139
|
-
* This is deliberately separate from W3-02's occurrence-delivery signature:
|
|
140
|
-
* the request proves control of a receiver before the endpoint may be used,
|
|
141
|
-
* while a delivery signature authenticates an occurrence body later. The
|
|
142
|
-
* generator publishes this object beside OpenAPI and the JSON Schema.
|
|
143
|
-
*/
|
|
144
|
-
export const CALLBACK_VERIFICATION_PROTOCOL = {
|
|
145
|
-
purpose: "Prove that the receiver possesses the one-time endpoint secret before Greatwait marks the endpoint verified.",
|
|
146
|
-
request: {
|
|
147
|
-
bodyEncoding: "UTF-8 bytes of the compact JSON object in schema property order: challenge, endpointId, type, version.",
|
|
148
|
-
contentType: "application/json",
|
|
149
|
-
method: "POST",
|
|
150
|
-
redirectPolicy: "manual; every 3xx response is refused",
|
|
151
|
-
signature: {
|
|
152
|
-
algorithm: "HMAC-SHA-256",
|
|
153
|
-
format: "v1=<64 lowercase hexadecimal characters>",
|
|
154
|
-
header: CALLBACK_VERIFICATION_HEADERS.requestSignature,
|
|
155
|
-
input: "the exact request body bytes",
|
|
156
|
-
key: "the one-time endpoint secret returned by REST endpoint creation",
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
response: {
|
|
160
|
-
body: "ignored after enforcing the 1024-byte response limit; return an empty body",
|
|
161
|
-
proof: {
|
|
162
|
-
algorithm: "HMAC-SHA-256",
|
|
163
|
-
format: "v1=<64 lowercase hexadecimal characters>",
|
|
164
|
-
header: CALLBACK_VERIFICATION_HEADERS.responseSignature,
|
|
165
|
-
input: "the UTF-8 bytes of the challenge string",
|
|
166
|
-
key: "the same endpoint secret",
|
|
167
|
-
},
|
|
168
|
-
status: "any 2xx status",
|
|
169
|
-
},
|
|
170
|
-
testVector: {
|
|
171
|
-
challenge: "cvc_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
|
172
|
-
endpointId: "ep_00000000000000000000000000",
|
|
173
|
-
exactBodyBase64: "eyJjaGFsbGVuZ2UiOiJjdmNfQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQSIsImVuZHBvaW50SWQiOiJlcF8wMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMCIsInR5cGUiOiJjYWxsYmFjay5lbmRwb2ludC52ZXJpZmljYXRpb24iLCJ2ZXJzaW9uIjoiMjAyNi0wOC0wNSJ9",
|
|
174
|
-
requestSignature: "v1=0d24c7fed4d752411b88025a9923627b329e0eb9d53978a6ebcf92c0678c731e",
|
|
175
|
-
responseSignature: "v1=efc690a23f1870930ff3388313162c0e06406902a7a4d3f9273ffe0abcef86bd",
|
|
176
|
-
secret: "verification-vector-secret",
|
|
177
|
-
},
|
|
178
|
-
version: CALLBACK_VERIFICATION_PROTOCOL_VERSION,
|
|
179
|
-
};
|
package/dist/events.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import { z } from "./zod.js";
|
|
2
2
|
/**
|
|
3
3
|
* Product events.
|
|
4
4
|
*
|
|
@@ -11,7 +11,7 @@ import { z } from "zod";
|
|
|
11
11
|
* collapsing them is how "why is this event from the future" bugs start.
|
|
12
12
|
*/
|
|
13
13
|
export declare const EVENT_TYPES: readonly ["endpoint.verified", "occurrence.attempt.recorded", "occurrence.due", "occurrence.succeeded", "occurrence.terminal_failed", "schedule.cancelled", "schedule.completed", "schedule.created", "schedule.replaced"];
|
|
14
|
-
export declare const eventTypeSchema:
|
|
14
|
+
export declare const eventTypeSchema: import("zod").ZodEnum<{
|
|
15
15
|
"endpoint.verified": "endpoint.verified";
|
|
16
16
|
"occurrence.attempt.recorded": "occurrence.attempt.recorded";
|
|
17
17
|
"occurrence.due": "occurrence.due";
|
|
@@ -23,13 +23,13 @@ export declare const eventTypeSchema: z.ZodEnum<{
|
|
|
23
23
|
"schedule.replaced": "schedule.replaced";
|
|
24
24
|
}>;
|
|
25
25
|
export type EventType = z.infer<typeof eventTypeSchema>;
|
|
26
|
-
export declare function eventEnvelopeSchema<TData extends z.ZodTypeAny>(data: TData):
|
|
26
|
+
export declare function eventEnvelopeSchema<TData extends z.ZodTypeAny>(data: TData): import("zod").ZodObject<{
|
|
27
27
|
data: TData;
|
|
28
|
-
id:
|
|
29
|
-
occurredAt:
|
|
30
|
-
recordedAt:
|
|
31
|
-
schemaVersion:
|
|
32
|
-
type:
|
|
28
|
+
id: import("zod").ZodString;
|
|
29
|
+
occurredAt: import("zod").ZodString;
|
|
30
|
+
recordedAt: import("zod").ZodString;
|
|
31
|
+
schemaVersion: import("zod").ZodNumber;
|
|
32
|
+
type: import("zod").ZodEnum<{
|
|
33
33
|
"endpoint.verified": "endpoint.verified";
|
|
34
34
|
"occurrence.attempt.recorded": "occurrence.attempt.recorded";
|
|
35
35
|
"occurrence.due": "occurrence.due";
|
|
@@ -40,14 +40,14 @@ export declare function eventEnvelopeSchema<TData extends z.ZodTypeAny>(data: TD
|
|
|
40
40
|
"schedule.created": "schedule.created";
|
|
41
41
|
"schedule.replaced": "schedule.replaced";
|
|
42
42
|
}>;
|
|
43
|
-
},
|
|
44
|
-
export declare const genericEventSchema:
|
|
45
|
-
data:
|
|
46
|
-
id:
|
|
47
|
-
occurredAt:
|
|
48
|
-
recordedAt:
|
|
49
|
-
schemaVersion:
|
|
50
|
-
type:
|
|
43
|
+
}, import("zod/v4/core").$strip>;
|
|
44
|
+
export declare const genericEventSchema: import("zod").ZodObject<{
|
|
45
|
+
data: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
46
|
+
id: import("zod").ZodString;
|
|
47
|
+
occurredAt: import("zod").ZodString;
|
|
48
|
+
recordedAt: import("zod").ZodString;
|
|
49
|
+
schemaVersion: import("zod").ZodNumber;
|
|
50
|
+
type: import("zod").ZodEnum<{
|
|
51
51
|
"endpoint.verified": "endpoint.verified";
|
|
52
52
|
"occurrence.attempt.recorded": "occurrence.attempt.recorded";
|
|
53
53
|
"occurrence.due": "occurrence.due";
|
|
@@ -58,5 +58,5 @@ export declare const genericEventSchema: z.ZodObject<{
|
|
|
58
58
|
"schedule.created": "schedule.created";
|
|
59
59
|
"schedule.replaced": "schedule.replaced";
|
|
60
60
|
}>;
|
|
61
|
-
},
|
|
61
|
+
}, import("zod/v4/core").$strip>;
|
|
62
62
|
export type GenericEvent = z.infer<typeof genericEventSchema>;
|
package/dist/events.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import { z } from "./zod.js";
|
|
2
2
|
import type { ProblemCode } from "./problems.js";
|
|
3
3
|
/**
|
|
4
4
|
* The one bounded sequence that takes a developer from a credential to an
|
|
@@ -6,7 +6,7 @@ import type { ProblemCode } from "./problems.js";
|
|
|
6
6
|
*
|
|
7
7
|
* **Declared once, here, because W9-03 is not the only story that has to tell
|
|
8
8
|
* it.** The curl quickstart, the JavaScript quickstart, the website journey
|
|
9
|
-
* W9-01 owns, the
|
|
9
|
+
* W9-01 owns, the documentation pages W9-04 publishes, and the command-line
|
|
10
10
|
* ergonomics W10 owns are all the *same* sequence rendered for a different
|
|
11
11
|
* reader. Written separately they diverge silently — the legacy scheduler's
|
|
12
12
|
* hand-maintained client and documentation are the worked example, and the
|
|
@@ -195,47 +195,47 @@ export interface JourneyStep {
|
|
|
195
195
|
* carrying a real one would be a leak that no reviewer reads carefully enough
|
|
196
196
|
* to catch, so the refusal is here rather than in a convention.
|
|
197
197
|
*/
|
|
198
|
-
export declare const journeyVariableSchema:
|
|
199
|
-
defaultExpression:
|
|
200
|
-
javascript:
|
|
201
|
-
shell:
|
|
202
|
-
},
|
|
203
|
-
detail:
|
|
204
|
-
name:
|
|
205
|
-
placeholder:
|
|
206
|
-
secret:
|
|
207
|
-
title:
|
|
208
|
-
},
|
|
209
|
-
export declare const journeyStepSchema:
|
|
210
|
-
capture:
|
|
211
|
-
from:
|
|
212
|
-
header:
|
|
213
|
-
secret:
|
|
214
|
-
variable:
|
|
215
|
-
},
|
|
216
|
-
expect:
|
|
217
|
-
equals:
|
|
218
|
-
message:
|
|
219
|
-
subject:
|
|
220
|
-
},
|
|
221
|
-
key:
|
|
222
|
-
observe:
|
|
223
|
-
operationId:
|
|
224
|
-
poll:
|
|
225
|
-
describe:
|
|
226
|
-
intervalSeconds:
|
|
227
|
-
timeoutSeconds:
|
|
228
|
-
},
|
|
229
|
-
purpose:
|
|
230
|
-
query:
|
|
231
|
-
recovery:
|
|
232
|
-
nextMove:
|
|
233
|
-
when:
|
|
234
|
-
},
|
|
235
|
-
request:
|
|
236
|
-
requestHeaders:
|
|
237
|
-
title:
|
|
238
|
-
},
|
|
198
|
+
export declare const journeyVariableSchema: import("zod").ZodObject<{
|
|
199
|
+
defaultExpression: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
200
|
+
javascript: import("zod").ZodString;
|
|
201
|
+
shell: import("zod").ZodString;
|
|
202
|
+
}, import("zod/v4/core").$strip>>;
|
|
203
|
+
detail: import("zod").ZodString;
|
|
204
|
+
name: import("zod").ZodString;
|
|
205
|
+
placeholder: import("zod").ZodString;
|
|
206
|
+
secret: import("zod").ZodBoolean;
|
|
207
|
+
title: import("zod").ZodString;
|
|
208
|
+
}, import("zod/v4/core").$strip>;
|
|
209
|
+
export declare const journeyStepSchema: import("zod").ZodObject<{
|
|
210
|
+
capture: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
211
|
+
from: import("zod").ZodString;
|
|
212
|
+
header: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
213
|
+
secret: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
214
|
+
variable: import("zod").ZodString;
|
|
215
|
+
}, import("zod/v4/core").$strip>>>;
|
|
216
|
+
expect: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
217
|
+
equals: import("zod").ZodString;
|
|
218
|
+
message: import("zod").ZodString;
|
|
219
|
+
subject: import("zod").ZodString;
|
|
220
|
+
}, import("zod/v4/core").$strip>>>;
|
|
221
|
+
key: import("zod").ZodString;
|
|
222
|
+
observe: import("zod").ZodString;
|
|
223
|
+
operationId: import("zod").ZodString;
|
|
224
|
+
poll: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
225
|
+
describe: import("zod").ZodString;
|
|
226
|
+
intervalSeconds: import("zod").ZodNumber;
|
|
227
|
+
timeoutSeconds: import("zod").ZodNumber;
|
|
228
|
+
}, import("zod/v4/core").$strip>>;
|
|
229
|
+
purpose: import("zod").ZodString;
|
|
230
|
+
query: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
231
|
+
recovery: import("zod").ZodArray<import("zod").ZodObject<{
|
|
232
|
+
nextMove: import("zod").ZodString;
|
|
233
|
+
when: import("zod").ZodString;
|
|
234
|
+
}, import("zod/v4/core").$strip>>;
|
|
235
|
+
request: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
236
|
+
requestHeaders: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
237
|
+
title: import("zod").ZodString;
|
|
238
|
+
}, import("zod/v4/core").$strip>;
|
|
239
239
|
/**
|
|
240
240
|
* The lowest curl that runs the generated commands.
|
|
241
241
|
*
|
|
@@ -320,11 +320,6 @@ export declare function journeyCapturedVariables(): readonly string[];
|
|
|
320
320
|
* sentence of its own. What the browser prints is what the curl page prints,
|
|
321
321
|
* because it is the same declaration rendered twice.
|
|
322
322
|
*
|
|
323
|
-
* **`verified` maps to nothing, deliberately.** The ownership challenge is
|
|
324
|
-
* optional and off by default since W4-09, so the journey does not perform it;
|
|
325
|
-
* a deployment that turns it on gets the step from
|
|
326
|
-
* `endpoints.verify`'s own snippet. Mapping it to a journey step that does not
|
|
327
|
-
* exist would be worse than mapping it to none.
|
|
328
323
|
*/
|
|
329
324
|
export declare const WEBSITE_JOURNEY_STEP_KEYS: Readonly<Record<string, readonly string[]>>;
|
|
330
325
|
/** The journey steps a website step renders, resolved against the sequence. */
|
|
@@ -370,7 +365,7 @@ export declare function journeyActivationDuration(elapsedMs: number): JourneyAct
|
|
|
370
365
|
export declare const JOURNEY_ACTIVATION_OUTCOMES: readonly ["reached", "refused", "timed_out", "failed"];
|
|
371
366
|
export type JourneyActivationOutcome = (typeof JOURNEY_ACTIVATION_OUTCOMES)[number];
|
|
372
367
|
/** The website steps an activation fact may name. */
|
|
373
|
-
export declare const WEBSITE_JOURNEY_STEPS: readonly ["destination", "
|
|
368
|
+
export declare const WEBSITE_JOURNEY_STEPS: readonly ["destination", "scheduled", "delivered"];
|
|
374
369
|
/**
|
|
375
370
|
* What is recorded when somebody moves through the website journey, and the
|
|
376
371
|
* only thing that is.
|
|
@@ -388,27 +383,26 @@ export declare const WEBSITE_JOURNEY_STEPS: readonly ["destination", "verified",
|
|
|
388
383
|
* The MCP schema learned that from a test and this one inherits the lesson
|
|
389
384
|
* rather than rediscovering it.
|
|
390
385
|
*/
|
|
391
|
-
export declare const websiteActivationEventSchema:
|
|
392
|
-
duration:
|
|
386
|
+
export declare const websiteActivationEventSchema: import("zod").ZodObject<{
|
|
387
|
+
duration: import("zod").ZodEnum<{
|
|
393
388
|
under_1m: "under_1m";
|
|
394
389
|
under_5m: "under_5m";
|
|
395
390
|
under_15m: "under_15m";
|
|
396
391
|
over_15m: "over_15m";
|
|
397
392
|
}>;
|
|
398
|
-
outcome:
|
|
393
|
+
outcome: import("zod").ZodEnum<{
|
|
399
394
|
failed: "failed";
|
|
400
395
|
timed_out: "timed_out";
|
|
401
396
|
refused: "refused";
|
|
402
397
|
reached: "reached";
|
|
403
398
|
}>;
|
|
404
|
-
step:
|
|
405
|
-
verified: "verified";
|
|
399
|
+
step: import("zod").ZodEnum<{
|
|
406
400
|
delivered: "delivered";
|
|
407
401
|
destination: "destination";
|
|
408
402
|
scheduled: "scheduled";
|
|
409
403
|
}>;
|
|
410
|
-
type:
|
|
411
|
-
},
|
|
404
|
+
type: import("zod").ZodLiteral<"website.journey_step">;
|
|
405
|
+
}, import("zod/v4/core").$strict>;
|
|
412
406
|
export type WebsiteActivationEvent = z.infer<typeof websiteActivationEventSchema>;
|
|
413
407
|
/**
|
|
414
408
|
* Parses an activation fact before it leaves the browser.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import { z } from "./zod.js";
|
|
2
2
|
import { findOperation } from "./operations.js";
|
|
3
3
|
/**
|
|
4
4
|
* One thing that can go wrong at a step, and the next move.
|
|
@@ -109,20 +109,20 @@ export const CURL_JOURNEY_TOOLS = [
|
|
|
109
109
|
];
|
|
110
110
|
export const FIRST_VALUE_PREREQUISITES = [
|
|
111
111
|
{
|
|
112
|
-
action: "Accept your
|
|
112
|
+
action: "Accept your GreatWait invitation, sign in, and create a project in the dashboard.",
|
|
113
113
|
because: "projects.create accepts only a signed-in member, so a project is created by a person rather than by an API credential.",
|
|
114
114
|
id: "project",
|
|
115
115
|
title: "A project",
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
|
-
action: "In that project, create an API credential and copy the secret it shows once.",
|
|
118
|
+
action: "In that project, create an API credential with endpoints:write, occurrences:read, schedules:read and schedules:write, and copy the secret it shows once. The key picker starts with nothing selected and refuses an empty one, so those four are the boxes to tick.",
|
|
119
119
|
because: "credentials.create accepts only a signed-in member: a credential that could mint another credential would make revoking one meaningless.",
|
|
120
120
|
id: "credential",
|
|
121
121
|
title: "An API credential",
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
124
|
action: "Have an HTTPS URL of your own that answers POST with a 2xx status, and can be reached from the public internet.",
|
|
125
|
-
because: "
|
|
125
|
+
because: "GreatWait delivers your callback to an address you control. It does not offer a shared receiver to try, and it will not send your payload to a third-party inspection service on your behalf.",
|
|
126
126
|
id: "receiver",
|
|
127
127
|
title: "An HTTPS receiver you control",
|
|
128
128
|
},
|
|
@@ -190,7 +190,7 @@ export const FIRST_VALUE_STEPS = [
|
|
|
190
190
|
key: "check-service",
|
|
191
191
|
observe: "The service name and the environment you meant to work in. If the environment is not the one you expect, stop and fix GREATWAIT_API_URL before creating anything.",
|
|
192
192
|
operationId: "meta.version",
|
|
193
|
-
purpose: "Confirms the origin you are pointed at is a
|
|
193
|
+
purpose: "Confirms the origin you are pointed at is a GreatWait API and says which environment it serves. It needs no credential, so it separates 'wrong URL' from 'wrong key'.",
|
|
194
194
|
recovery: [
|
|
195
195
|
{
|
|
196
196
|
nextMove: "Something answered, but not this service. Check GREATWAIT_API_URL — a 404 here comes from a proxy in front of the API rather than from the API, so it carries no problem document to read.",
|
|
@@ -235,7 +235,7 @@ export const FIRST_VALUE_STEPS = [
|
|
|
235
235
|
{ from: "id", variable: "GREATWAIT_ENDPOINTID" },
|
|
236
236
|
{ from: "secret", secret: true, variable: "GREATWAIT_ENDPOINT_SECRET" },
|
|
237
237
|
],
|
|
238
|
-
observe: "An endpoint identifier, and a signing secret
|
|
238
|
+
observe: "An endpoint identifier, and a signing secret. Store it now: this is the only call that returns it, and reading the endpoint back shows a redacted prefix instead. It is not gone if you lose it — a signed-in member can read it again on the endpoint's own page in the dashboard, which is the one caller `endpoints.revealSigningSecret` accepts.",
|
|
239
239
|
operationId: "endpoints.create",
|
|
240
240
|
purpose: "Registers the address every occurrence of this schedule is delivered to, and mints the per-endpoint signing key your receiver verifies callbacks with.",
|
|
241
241
|
recovery: [
|
|
@@ -247,6 +247,10 @@ export const FIRST_VALUE_STEPS = [
|
|
|
247
247
|
nextMove: "This project is at its destination ceiling. Disable a destination you no longer deliver to; disabled ones still count, because they stay readable for audit.",
|
|
248
248
|
when: "plan_limit_reached",
|
|
249
249
|
},
|
|
250
|
+
{
|
|
251
|
+
nextMove: "An active destination already delivers to this address in this project — usually one a previous run of this journey created. Reuse that destination, disable it first, or give the new one a name of its own.",
|
|
252
|
+
when: "state_conflict",
|
|
253
|
+
},
|
|
250
254
|
],
|
|
251
255
|
request: { url: "{{GREATWAIT_RECEIVER_URL}}" },
|
|
252
256
|
title: "Create the destination",
|
|
@@ -262,12 +266,12 @@ export const FIRST_VALUE_STEPS = [
|
|
|
262
266
|
purpose: "Creates the one-shot. The delay is converted to an absolute instant when the request is accepted, so the schedule reads back the same afterwards however it was expressed.",
|
|
263
267
|
recovery: [
|
|
264
268
|
{
|
|
265
|
-
nextMove: "
|
|
266
|
-
when: "
|
|
269
|
+
nextMove: "The endpoint identifier is not one this credential's project can deliver to — it belongs to another project, or there is no such endpoint. Create a destination in this project, or check the identifier.",
|
|
270
|
+
when: "not_found",
|
|
267
271
|
},
|
|
268
272
|
{
|
|
269
|
-
nextMove: "The endpoint
|
|
270
|
-
when: "
|
|
273
|
+
nextMove: "The endpoint is disabled. Enable it with `endpoints.enable` and the schedule is accepted as sent, or point the schedule at another destination.",
|
|
274
|
+
when: "state_conflict",
|
|
271
275
|
},
|
|
272
276
|
{
|
|
273
277
|
nextMove: "The same idempotency key was used for a different request. Use a new key, or send the byte-identical body the key was first used with.",
|
|
@@ -278,7 +282,7 @@ export const FIRST_VALUE_STEPS = [
|
|
|
278
282
|
when: "invalid_request",
|
|
279
283
|
},
|
|
280
284
|
{
|
|
281
|
-
nextMove: "This organization is at a plan ceiling —
|
|
285
|
+
nextMove: "This organization is at a plan ceiling — the payload is larger than its plan carries, or the schedule names a new partition key when the organization's keys are full. Nothing was created; send a smaller payload or reuse a partition key that is already live, and retry.",
|
|
282
286
|
when: "plan_limit_reached",
|
|
283
287
|
},
|
|
284
288
|
{
|
|
@@ -375,7 +379,7 @@ export const FIRST_VALUE_STEPS = [
|
|
|
375
379
|
when: "attempt-failed",
|
|
376
380
|
},
|
|
377
381
|
{
|
|
378
|
-
nextMove: "Nothing reached your receiver. Confirm the URL answers a POST from the public internet, and that it is not behind an allowlist
|
|
382
|
+
nextMove: "Nothing reached your receiver. Confirm the URL answers a POST from the public internet, and that it is not behind an allowlist GreatWait is not on.",
|
|
379
383
|
when: "receiver-unreachable",
|
|
380
384
|
},
|
|
381
385
|
],
|
|
@@ -385,7 +389,7 @@ export const FIRST_VALUE_STEPS = [
|
|
|
385
389
|
key: "clean-up",
|
|
386
390
|
observe: "The endpoint in status `disabled`. Nothing further is delivered to it, and it stays readable so the attempts above keep their context.",
|
|
387
391
|
operationId: "endpoints.disable",
|
|
388
|
-
purpose: "Stops delivery to the destination you registered for this walkthrough. Disabling is
|
|
392
|
+
purpose: "Stops delivery to the destination you registered for this walkthrough. Disabling is deliberate rather than final: it leaves the history intact rather than deleting evidence of what happened, and `endpoints.enable` turns the destination back on if you want it again.",
|
|
389
393
|
recovery: [
|
|
390
394
|
{
|
|
391
395
|
nextMove: "Already gone, or never in this project. Nothing to clean up.",
|
|
@@ -482,17 +486,11 @@ export function journeyCapturedVariables() {
|
|
|
482
486
|
* sentence of its own. What the browser prints is what the curl page prints,
|
|
483
487
|
* because it is the same declaration rendered twice.
|
|
484
488
|
*
|
|
485
|
-
* **`verified` maps to nothing, deliberately.** The ownership challenge is
|
|
486
|
-
* optional and off by default since W4-09, so the journey does not perform it;
|
|
487
|
-
* a deployment that turns it on gets the step from
|
|
488
|
-
* `endpoints.verify`'s own snippet. Mapping it to a journey step that does not
|
|
489
|
-
* exist would be worse than mapping it to none.
|
|
490
489
|
*/
|
|
491
490
|
export const WEBSITE_JOURNEY_STEP_KEYS = {
|
|
492
491
|
delivered: ["await-occurrence", "read-attempt"],
|
|
493
492
|
destination: ["create-destination"],
|
|
494
493
|
scheduled: ["create-one-shot"],
|
|
495
|
-
verified: [],
|
|
496
494
|
};
|
|
497
495
|
/** The journey steps a website step renders, resolved against the sequence. */
|
|
498
496
|
export function websiteJourneySteps(step) {
|
|
@@ -580,7 +578,6 @@ export const JOURNEY_ACTIVATION_OUTCOMES = [
|
|
|
580
578
|
/** The website steps an activation fact may name. */
|
|
581
579
|
export const WEBSITE_JOURNEY_STEPS = [
|
|
582
580
|
"destination",
|
|
583
|
-
"verified",
|
|
584
581
|
"scheduled",
|
|
585
582
|
"delivered",
|
|
586
583
|
];
|