@greatwait/contracts 0.1.0-alpha.2 → 0.1.0-alpha.4
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 +11 -9
- package/dist/authority.d.ts +84 -21
- package/dist/authority.js +47 -2
- package/dist/billing.d.ts +1001 -0
- package/dist/billing.js +684 -0
- package/dist/callback-safety.d.ts +2 -2
- package/dist/callback-safety.js +2 -2
- package/dist/compatibility.d.ts +3 -3
- package/dist/compatibility.js +1 -1
- package/dist/data-export.d.ts +67 -0
- package/dist/data-export.js +182 -0
- package/dist/endpoints.d.ts +181 -240
- package/dist/endpoints.js +77 -81
- package/dist/events.d.ts +17 -17
- package/dist/events.js +1 -1
- package/dist/first-value-journey.d.ts +192 -42
- package/dist/first-value-journey.js +212 -6
- package/dist/forecast.d.ts +71 -71
- package/dist/forecast.js +1 -1
- package/dist/identifiers.d.ts +20 -20
- package/dist/identifiers.js +1 -1
- package/dist/identity.d.ts +45 -41
- package/dist/identity.js +5 -4
- package/dist/index.d.ts +13 -8
- package/dist/index.js +13 -8
- package/dist/mcp.d.ts +201 -0
- package/dist/mcp.js +214 -0
- package/dist/naming.d.ts +45 -0
- package/dist/naming.js +159 -0
- package/dist/oauth.d.ts +186 -172
- package/dist/oauth.js +84 -8
- package/dist/operation-definitions.d.ts +9 -0
- package/dist/operation-definitions.js +7 -0
- package/dist/operations.d.ts +4359 -2214
- package/dist/operations.js +2754 -881
- package/dist/organization-lifecycle.d.ts +34 -0
- package/dist/organization-lifecycle.js +122 -0
- package/dist/partition.d.ts +26 -0
- package/dist/policy.d.ts +4 -4
- package/dist/policy.js +9 -5
- package/dist/problems.d.ts +32 -26
- package/dist/problems.js +6 -2
- package/dist/protocol.d.ts +204 -75
- package/dist/protocol.js +108 -36
- package/dist/scheduling-records.d.ts +343 -285
- package/dist/scheduling-records.js +1 -1
- package/dist/scheduling.d.ts +670 -360
- package/dist/scheduling.js +382 -56
- 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 +197 -31
- 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 +4 -0
- package/generated/v1/examples/attempts.read.response.json +4 -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.fundingquote.request.json +7 -0
- package/generated/v1/examples/billing.fundingquote.response.json +13 -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.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/context.read.response.json +6 -0
- package/generated/v1/examples/credentials.connection.response.json +16 -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/occurrences.read.response.json +4 -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 +19 -10
- package/generated/v1/manifest.json +1019 -53
- package/generated/v1/openapi.json +30597 -5709
- package/generated/v1/policy-matrix.json +290 -45
- package/generated/v1/schemas/attempts.list.response.json +24 -1
- package/generated/v1/schemas/attempts.read.response.json +24 -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.fundingquote.request.json +28 -0
- package/generated/v1/schemas/billing.fundingquote.response.json +61 -0
- package/generated/v1/schemas/billing.ledger.query.json +16 -0
- package/generated/v1/schemas/billing.ledger.response.json +125 -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 +36 -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.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 +22 -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 +45 -0
- package/generated/v1/schemas/credentials.connection.response.json +66 -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/grants.list.response.json +2 -0
- package/generated/v1/schemas/grants.revoke.response.json +2 -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 +24 -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/attempts.list.json +1 -0
- package/generated/v1/snippets/attempts.read.json +1 -0
- 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.fundingquote.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.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/context.read.json +6 -0
- package/generated/v1/snippets/credentials.connection.json +6 -0
- package/generated/v1/snippets/credentials.create.json +1 -0
- package/generated/v1/snippets/credentials.list.json +1 -0
- package/generated/v1/snippets/credentials.revoke.json +1 -0
- package/generated/v1/snippets/credentials.rotate.json +1 -0
- package/generated/v1/snippets/endpoints.acknowledgeSigningKeyRotation.json +6 -0
- package/generated/v1/snippets/endpoints.create.json +1 -0
- package/generated/v1/snippets/endpoints.disable.json +1 -0
- package/generated/v1/snippets/{endpoints.verify.json → endpoints.enable.json} +4 -3
- package/generated/v1/snippets/endpoints.list.json +1 -0
- package/generated/v1/snippets/endpoints.read.json +1 -0
- package/generated/v1/snippets/endpoints.revealSigningSecret.json +6 -0
- package/generated/v1/snippets/endpoints.rotateSigningKey.json +1 -0
- package/generated/v1/snippets/endpoints.update.json +1 -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.read.json +1 -0
- package/generated/v1/snippets/forecast.windows.json +1 -0
- package/generated/v1/snippets/grants.list.json +1 -0
- package/generated/v1/snippets/grants.revoke.json +1 -0
- package/generated/v1/snippets/journey/await-occurrence.json +6 -0
- package/generated/v1/snippets/journey/check-credential.json +6 -0
- package/generated/v1/snippets/journey/check-service.json +6 -0
- package/generated/v1/snippets/journey/clean-up.json +6 -0
- package/generated/v1/snippets/journey/create-destination.json +6 -0
- package/generated/v1/snippets/journey/create-one-shot.json +6 -0
- package/generated/v1/snippets/journey/read-attempt.json +6 -0
- package/generated/v1/snippets/journey/read-schedule.json +6 -0
- package/generated/v1/snippets/journey/replay-one-shot.json +6 -0
- package/generated/v1/snippets/meta.scaffold.json +1 -0
- package/generated/v1/snippets/meta.version.json +1 -0
- package/generated/v1/snippets/occurrences.list.json +1 -0
- package/generated/v1/snippets/occurrences.read.json +1 -0
- package/generated/v1/snippets/occurrences.redeliver.json +1 -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.create.json +1 -0
- package/generated/v1/snippets/projects.delete.json +6 -0
- package/generated/v1/snippets/projects.list.json +1 -0
- package/generated/v1/snippets/projects.rename.json +6 -0
- package/generated/v1/snippets/schedules.archive.json +1 -0
- package/generated/v1/snippets/schedules.cancel.json +1 -0
- package/generated/v1/snippets/schedules.create.json +4 -3
- package/generated/v1/snippets/schedules.list.json +1 -0
- package/generated/v1/snippets/schedules.pause.json +1 -0
- package/generated/v1/snippets/schedules.read.json +1 -0
- package/generated/v1/snippets/schedules.replace.json +4 -3
- package/generated/v1/snippets/schedules.resume.json +1 -0
- package/generated/v1/snippets/sinkdeliveries.list.json +1 -0
- package/generated/v1/snippets/sinkdeliveries.read.json +1 -0
- package/generated/v1/snippets/testsinks.configure.json +1 -0
- package/generated/v1/snippets/testsinks.create.json +1 -0
- package/generated/v1/snippets/testsinks.delete.json +1 -0
- package/generated/v1/snippets/testsinks.list.json +1 -0
- package/generated/v1/snippets/testsinks.read.json +1 -0
- package/generated/v1/snippets/timing.summary.json +6 -0
- package/generated/v1/snippets/usage.read.json +1 -0
- package/package.json +2 -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
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import { z } from "./zod.js";
|
|
2
|
+
import { findOperation } from "./operations.js";
|
|
2
3
|
/**
|
|
3
4
|
* One thing that can go wrong at a step, and the next move.
|
|
4
5
|
*
|
|
@@ -261,12 +262,12 @@ export const FIRST_VALUE_STEPS = [
|
|
|
261
262
|
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.",
|
|
262
263
|
recovery: [
|
|
263
264
|
{
|
|
264
|
-
nextMove: "
|
|
265
|
-
when: "
|
|
265
|
+
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.",
|
|
266
|
+
when: "not_found",
|
|
266
267
|
},
|
|
267
268
|
{
|
|
268
|
-
nextMove: "The endpoint
|
|
269
|
-
when: "
|
|
269
|
+
nextMove: "The endpoint is disabled. Enable it with `endpoints.enable` and the schedule is accepted as sent, or point the schedule at another destination.",
|
|
270
|
+
when: "state_conflict",
|
|
270
271
|
},
|
|
271
272
|
{
|
|
272
273
|
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.",
|
|
@@ -384,7 +385,7 @@ export const FIRST_VALUE_STEPS = [
|
|
|
384
385
|
key: "clean-up",
|
|
385
386
|
observe: "The endpoint in status `disabled`. Nothing further is delivered to it, and it stays readable so the attempts above keep their context.",
|
|
386
387
|
operationId: "endpoints.disable",
|
|
387
|
-
purpose: "Stops delivery to the destination you registered for this walkthrough. Disabling is
|
|
388
|
+
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.",
|
|
388
389
|
recovery: [
|
|
389
390
|
{
|
|
390
391
|
nextMove: "Already gone, or never in this project. Nothing to clean up.",
|
|
@@ -464,3 +465,208 @@ export function resolveJourneyReferences(value, resolve) {
|
|
|
464
465
|
export function journeyCapturedVariables() {
|
|
465
466
|
return FIRST_VALUE_STEPS.flatMap((step) => (step.capture ?? []).map((capture) => capture.variable));
|
|
466
467
|
}
|
|
468
|
+
/**
|
|
469
|
+
* The website's rendering of the same journey.
|
|
470
|
+
*
|
|
471
|
+
* **Declared here rather than in the dashboard, because it is the *binding*
|
|
472
|
+
* between two things that already exist and neither of them may own it.** The
|
|
473
|
+
* dashboard has a four-step onboarding flow derived from what a member's
|
|
474
|
+
* project contains; this file has a nine-step sequence derived from the
|
|
475
|
+
* operation registry. Left unrelated they answered the same question with
|
|
476
|
+
* different words and different examples, and the website's answer was the one
|
|
477
|
+
* that went stale: its "Schedule a one-shot" step rendered the registry's
|
|
478
|
+
* `schedules.create` example, which is a **recurring cron** — a live dashboard
|
|
479
|
+
* action showing a reader the one thing the step promises it is not.
|
|
480
|
+
*
|
|
481
|
+
* So a website step names journey steps, and never a body, a title or a
|
|
482
|
+
* sentence of its own. What the browser prints is what the curl page prints,
|
|
483
|
+
* because it is the same declaration rendered twice.
|
|
484
|
+
*
|
|
485
|
+
*/
|
|
486
|
+
export const WEBSITE_JOURNEY_STEP_KEYS = {
|
|
487
|
+
delivered: ["await-occurrence", "read-attempt"],
|
|
488
|
+
destination: ["create-destination"],
|
|
489
|
+
scheduled: ["create-one-shot"],
|
|
490
|
+
};
|
|
491
|
+
/** The journey steps a website step renders, resolved against the sequence. */
|
|
492
|
+
export function websiteJourneySteps(step) {
|
|
493
|
+
const keys = WEBSITE_JOURNEY_STEP_KEYS[step] ?? [];
|
|
494
|
+
return keys.map((key) => {
|
|
495
|
+
const found = FIRST_VALUE_STEPS.find((entry) => entry.key === key);
|
|
496
|
+
if (found === undefined) {
|
|
497
|
+
// Not reachable from the constant above, and that is exactly why it
|
|
498
|
+
// throws: the map is hand-written and the sequence is not, so a step
|
|
499
|
+
// renamed in `FIRST_VALUE_STEPS` must fail loudly here rather than
|
|
500
|
+
// silently render one fewer call than the page promises.
|
|
501
|
+
throw new Error(`website journey names unknown step ${key}`);
|
|
502
|
+
}
|
|
503
|
+
return found;
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* The bounded wait the website inherits, rather than one it chose.
|
|
508
|
+
*
|
|
509
|
+
* W9-01's fourth criterion asks the browser to bound outcome polling and to
|
|
510
|
+
* leave a recovery action on timeout. The journey already declares both numbers
|
|
511
|
+
* on `await-occurrence`, and the curl and JavaScript quickstarts already wait
|
|
512
|
+
* exactly that long — so a browser that picked its own interval would be a
|
|
513
|
+
* third answer to a question with one published answer, and the reader who
|
|
514
|
+
* followed both would be told two different things about how long to wait.
|
|
515
|
+
*/
|
|
516
|
+
export function journeyPoll(key) {
|
|
517
|
+
const step = FIRST_VALUE_STEPS.find((entry) => entry.key === key);
|
|
518
|
+
if (step?.poll === undefined) {
|
|
519
|
+
throw new Error(`journey step ${key} declares no bounded wait`);
|
|
520
|
+
}
|
|
521
|
+
return step.poll;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* What the reader has to bring, in the words the quickstarts already use.
|
|
525
|
+
*
|
|
526
|
+
* The website used to write its own: "anything that can take an HTTP POST. A
|
|
527
|
+
* webhook playground is fine for a first look." That sentence steered a new
|
|
528
|
+
* customer to paste their first callback into a third-party inspection service,
|
|
529
|
+
* which is the thing this project's receiver decision exists to refuse, and it
|
|
530
|
+
* disagreed with the curl page on the same screenful of product.
|
|
531
|
+
*
|
|
532
|
+
* The operator's decision on W9-01 was that the *invitation* says none of this
|
|
533
|
+
* — a prerequisite stated before somebody has any context is noise they cannot
|
|
534
|
+
* act on. It is said here instead, at the step that needs it.
|
|
535
|
+
*/
|
|
536
|
+
export function journeyPrerequisite(id) {
|
|
537
|
+
const found = FIRST_VALUE_PREREQUISITES.find((entry) => entry.id === id);
|
|
538
|
+
if (found === undefined) {
|
|
539
|
+
throw new Error(`journey declares no prerequisite ${id}`);
|
|
540
|
+
}
|
|
541
|
+
return found;
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* How long a website step took, as a bucket and never as a number.
|
|
545
|
+
*
|
|
546
|
+
* Coarser than `MCP_ACTIVATION_DURATIONS`, because these measure different
|
|
547
|
+
* things: a connection test is a handshake and finishes in seconds, and a
|
|
548
|
+
* person adding a destination and scheduling a callback is doing minutes of
|
|
549
|
+
* work. Reusing the millisecond buckets would put every website step in
|
|
550
|
+
* `over_30s` and record nothing.
|
|
551
|
+
*/
|
|
552
|
+
export const JOURNEY_ACTIVATION_DURATIONS = [
|
|
553
|
+
"under_1m",
|
|
554
|
+
"under_5m",
|
|
555
|
+
"under_15m",
|
|
556
|
+
"over_15m",
|
|
557
|
+
];
|
|
558
|
+
export function journeyActivationDuration(elapsedMs) {
|
|
559
|
+
if (elapsedMs < 60_000)
|
|
560
|
+
return "under_1m";
|
|
561
|
+
if (elapsedMs < 300_000)
|
|
562
|
+
return "under_5m";
|
|
563
|
+
if (elapsedMs < 900_000)
|
|
564
|
+
return "under_15m";
|
|
565
|
+
return "over_15m";
|
|
566
|
+
}
|
|
567
|
+
/** Every way a website step can end, drawn from a closed list. */
|
|
568
|
+
export const JOURNEY_ACTIVATION_OUTCOMES = [
|
|
569
|
+
"reached",
|
|
570
|
+
"refused",
|
|
571
|
+
"timed_out",
|
|
572
|
+
"failed",
|
|
573
|
+
];
|
|
574
|
+
/** The website steps an activation fact may name. */
|
|
575
|
+
export const WEBSITE_JOURNEY_STEPS = [
|
|
576
|
+
"destination",
|
|
577
|
+
"scheduled",
|
|
578
|
+
"delivered",
|
|
579
|
+
];
|
|
580
|
+
/**
|
|
581
|
+
* What is recorded when somebody moves through the website journey, and the
|
|
582
|
+
* only thing that is.
|
|
583
|
+
*
|
|
584
|
+
* **Modelled on `mcpActivationEventSchema` down to the `strictObject`, and for
|
|
585
|
+
* the same reason.** Every field is drawn from a closed set: there is no
|
|
586
|
+
* free-text field, no identifier, no address, no URL and no measurement finer
|
|
587
|
+
* than a bucket, so an event of this shape cannot carry an account, an
|
|
588
|
+
* organization, a project, an invitation link, a token, a destination or a
|
|
589
|
+
* payload however carelessly it is constructed.
|
|
590
|
+
*
|
|
591
|
+
* Strict rather than merely typed. An ordinary object schema *strips* what it
|
|
592
|
+
* does not know, so an emitter that added `project` would look like it was
|
|
593
|
+
* recording one while the field silently vanished — safe and dishonest at once.
|
|
594
|
+
* The MCP schema learned that from a test and this one inherits the lesson
|
|
595
|
+
* rather than rediscovering it.
|
|
596
|
+
*/
|
|
597
|
+
export const websiteActivationEventSchema = z.strictObject({
|
|
598
|
+
duration: z.enum(JOURNEY_ACTIVATION_DURATIONS),
|
|
599
|
+
outcome: z.enum(JOURNEY_ACTIVATION_OUTCOMES),
|
|
600
|
+
step: z.enum(WEBSITE_JOURNEY_STEPS),
|
|
601
|
+
type: z.literal("website.journey_step"),
|
|
602
|
+
});
|
|
603
|
+
/**
|
|
604
|
+
* Parses an activation fact before it leaves the browser.
|
|
605
|
+
*
|
|
606
|
+
* The parse is the control, exactly as it is on the MCP side: a caller hands
|
|
607
|
+
* this an object and the schema refuses anything the closed sets do not admit,
|
|
608
|
+
* so the mistake surfaces where it was made rather than as a field that quietly
|
|
609
|
+
* disappeared.
|
|
610
|
+
*/
|
|
611
|
+
export function parseWebsiteActivationEvent(value) {
|
|
612
|
+
return websiteActivationEventSchema.parse(value);
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* A path parameter's name, as the journey's variables spell it.
|
|
616
|
+
*
|
|
617
|
+
* **Published because a machine consumer cannot run the journey without it.**
|
|
618
|
+
* A step names its operation and the variables it needs — `read-schedule` says
|
|
619
|
+
* `/v1/schedules/{scheduleId}` and, separately, `GREATWAIT_SCHEDULEID` — and
|
|
620
|
+
* the rule joining the two lived in `scripts/first-value-projection.ts`, which
|
|
621
|
+
* is not published. A documentation page never notices: it renders both halves
|
|
622
|
+
* as text and a human joins them by eye. A command-line client has to *fill*
|
|
623
|
+
* the parameter, and had to re-derive the convention by guessing at it.
|
|
624
|
+
*
|
|
625
|
+
* The transformation is deliberately total and lossy in the safe direction:
|
|
626
|
+
* every non-alphanumeric character becomes `_`, so a parameter that differs
|
|
627
|
+
* from another only in punctuation would collide. `journeyPathVariables` is
|
|
628
|
+
* where that would surface, and `first-value-journey.test.ts` holds the
|
|
629
|
+
* journey's own parameters to distinct names.
|
|
630
|
+
*/
|
|
631
|
+
export function journeyVariableName(parameter) {
|
|
632
|
+
return `GREATWAIT_${parameter.toUpperCase().replace(/[^A-Z0-9]/gu, "_")}`;
|
|
633
|
+
}
|
|
634
|
+
/** Every `{parameter}` in a path, in the order the path names them. */
|
|
635
|
+
export function pathParameterNames(path) {
|
|
636
|
+
return [...path.matchAll(/\{([^}]+)\}/gu)].map((match) => match[1]);
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* The variables a step's path parameters are filled from, in path order.
|
|
640
|
+
*
|
|
641
|
+
* Order is the contract: a client filling positional arguments — which is what
|
|
642
|
+
* the generated client takes — needs them in the order the path names them,
|
|
643
|
+
* and `attempts.list` has two.
|
|
644
|
+
*/
|
|
645
|
+
export function journeyPathVariables(step) {
|
|
646
|
+
const operation = findOperation(step.operationId);
|
|
647
|
+
if (operation === undefined) {
|
|
648
|
+
throw new Error(`the first-value journey names ${step.operationId}, which is not an operation`);
|
|
649
|
+
}
|
|
650
|
+
return pathParameterNames(operation.path).map(journeyVariableName);
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* Everything a step must be given before it can be performed.
|
|
654
|
+
*
|
|
655
|
+
* **Published because it is a join, and a join is where a second consumer
|
|
656
|
+
* invents its own copy.** A step's inputs come from three places — the
|
|
657
|
+
* operation's path parameters, the `{{…}}` references in its body, query and
|
|
658
|
+
* headers — and stitching them is the kind of two-line rule every consumer gets
|
|
659
|
+
* *nearly* right. The machine-readable artifact's own `variables` field is this
|
|
660
|
+
* function, so a client reading the artifact and a client reading this module
|
|
661
|
+
* cannot disagree about what a step needs.
|
|
662
|
+
*/
|
|
663
|
+
export function journeyStepVariables(step) {
|
|
664
|
+
return [
|
|
665
|
+
...new Set([
|
|
666
|
+
...journeyPathVariables(step),
|
|
667
|
+
...journeyReferences(step.request),
|
|
668
|
+
...journeyReferences(step.query),
|
|
669
|
+
...journeyReferences(step.requestHeaders),
|
|
670
|
+
]),
|
|
671
|
+
];
|
|
672
|
+
}
|
package/dist/forecast.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import { z } from "./zod.js";
|
|
2
2
|
import type { FieldError } from "./problems.js";
|
|
3
3
|
import { type Freshness } from "./protocol.js";
|
|
4
4
|
import type { ForecastPartitionBucket } from "./partition.js";
|
|
@@ -120,20 +120,20 @@ export declare const FORECAST_BOUNDS: {
|
|
|
120
120
|
* the total and the latency split, which every answer carries.
|
|
121
121
|
*/
|
|
122
122
|
export declare const FORECAST_BREAKDOWNS: readonly ["none", "partitionKey"];
|
|
123
|
-
export declare const forecastBreakdownSchema:
|
|
123
|
+
export declare const forecastBreakdownSchema: import("zod").ZodEnum<{
|
|
124
124
|
none: "none";
|
|
125
125
|
partitionKey: "partitionKey";
|
|
126
126
|
}>;
|
|
127
127
|
export type ForecastBreakdown = z.infer<typeof forecastBreakdownSchema>;
|
|
128
|
-
export declare const forecastRequestSchema:
|
|
129
|
-
breakdown:
|
|
128
|
+
export declare const forecastRequestSchema: import("zod").ZodObject<{
|
|
129
|
+
breakdown: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
130
130
|
none: "none";
|
|
131
131
|
partitionKey: "partitionKey";
|
|
132
132
|
}>>;
|
|
133
|
-
bucketSeconds:
|
|
134
|
-
from:
|
|
135
|
-
to:
|
|
136
|
-
},
|
|
133
|
+
bucketSeconds: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
134
|
+
from: import("zod").ZodOptional<import("zod").ZodString>;
|
|
135
|
+
to: import("zod").ZodOptional<import("zod").ZodString>;
|
|
136
|
+
}, import("zod/v4/core").$strip>;
|
|
137
137
|
export type ForecastRequest = z.infer<typeof forecastRequestSchema>;
|
|
138
138
|
export type ForecastRequestParse = {
|
|
139
139
|
readonly errors: readonly FieldError[];
|
|
@@ -197,46 +197,46 @@ export declare function forecastBucketStartMs(instantMs: number, bucketSeconds:
|
|
|
197
197
|
* third latency class fails a test here rather than silently vanishing from
|
|
198
198
|
* every forecast.
|
|
199
199
|
*/
|
|
200
|
-
export declare const forecastLatencyCountsSchema:
|
|
201
|
-
bulk:
|
|
202
|
-
realtime:
|
|
203
|
-
},
|
|
200
|
+
export declare const forecastLatencyCountsSchema: import("zod").ZodObject<{
|
|
201
|
+
bulk: import("zod").ZodNumber;
|
|
202
|
+
realtime: import("zod").ZodNumber;
|
|
203
|
+
}, import("zod/v4/core").$strip>;
|
|
204
204
|
export type ForecastLatencyCounts = z.infer<typeof forecastLatencyCountsSchema>;
|
|
205
|
-
export declare const forecastBucketSchema:
|
|
206
|
-
byLatencyClass:
|
|
207
|
-
bulk:
|
|
208
|
-
realtime:
|
|
209
|
-
},
|
|
210
|
-
byPartitionKey:
|
|
211
|
-
count:
|
|
212
|
-
nextFireCount:
|
|
213
|
-
otherPartitionKeyCount:
|
|
214
|
-
start:
|
|
215
|
-
},
|
|
205
|
+
export declare const forecastBucketSchema: import("zod").ZodObject<{
|
|
206
|
+
byLatencyClass: import("zod").ZodObject<{
|
|
207
|
+
bulk: import("zod").ZodNumber;
|
|
208
|
+
realtime: import("zod").ZodNumber;
|
|
209
|
+
}, import("zod/v4/core").$strip>;
|
|
210
|
+
byPartitionKey: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodNumber>>;
|
|
211
|
+
count: import("zod").ZodNumber;
|
|
212
|
+
nextFireCount: import("zod").ZodNumber;
|
|
213
|
+
otherPartitionKeyCount: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
214
|
+
start: import("zod").ZodString;
|
|
215
|
+
}, import("zod/v4/core").$strip>;
|
|
216
216
|
export type ForecastBucket = z.infer<typeof forecastBucketSchema>;
|
|
217
|
-
export declare const forecastSchema:
|
|
218
|
-
buckets:
|
|
219
|
-
byLatencyClass:
|
|
220
|
-
bulk:
|
|
221
|
-
realtime:
|
|
222
|
-
},
|
|
223
|
-
byPartitionKey:
|
|
224
|
-
count:
|
|
225
|
-
nextFireCount:
|
|
226
|
-
otherPartitionKeyCount:
|
|
227
|
-
start:
|
|
228
|
-
},
|
|
229
|
-
freshness:
|
|
230
|
-
asOf:
|
|
231
|
-
kind:
|
|
232
|
-
lagSeconds:
|
|
233
|
-
},
|
|
234
|
-
window:
|
|
235
|
-
bucketSeconds:
|
|
236
|
-
from:
|
|
237
|
-
to:
|
|
238
|
-
},
|
|
239
|
-
},
|
|
217
|
+
export declare const forecastSchema: import("zod").ZodObject<{
|
|
218
|
+
buckets: import("zod").ZodArray<import("zod").ZodObject<{
|
|
219
|
+
byLatencyClass: import("zod").ZodObject<{
|
|
220
|
+
bulk: import("zod").ZodNumber;
|
|
221
|
+
realtime: import("zod").ZodNumber;
|
|
222
|
+
}, import("zod/v4/core").$strip>;
|
|
223
|
+
byPartitionKey: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodNumber>>;
|
|
224
|
+
count: import("zod").ZodNumber;
|
|
225
|
+
nextFireCount: import("zod").ZodNumber;
|
|
226
|
+
otherPartitionKeyCount: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
227
|
+
start: import("zod").ZodString;
|
|
228
|
+
}, import("zod/v4/core").$strip>>;
|
|
229
|
+
freshness: import("zod").ZodObject<{
|
|
230
|
+
asOf: import("zod").ZodString;
|
|
231
|
+
kind: import("zod").ZodLiteral<"projected">;
|
|
232
|
+
lagSeconds: import("zod").ZodNumber;
|
|
233
|
+
}, import("zod/v4/core").$strip>;
|
|
234
|
+
window: import("zod").ZodObject<{
|
|
235
|
+
bucketSeconds: import("zod").ZodNumber;
|
|
236
|
+
from: import("zod").ZodString;
|
|
237
|
+
to: import("zod").ZodString;
|
|
238
|
+
}, import("zod/v4/core").$strip>;
|
|
239
|
+
}, import("zod/v4/core").$strip>;
|
|
240
240
|
export type Forecast = z.infer<typeof forecastSchema>;
|
|
241
241
|
/** One bucket, summed across every shard, before it is rendered. */
|
|
242
242
|
export interface ForecastMergedBucket {
|
|
@@ -329,32 +329,32 @@ export declare function decideForecastAnswer(answers: readonly ForecastShardAnsw
|
|
|
329
329
|
* rather than one it discovers.
|
|
330
330
|
*/
|
|
331
331
|
export declare const FORECAST_WINDOW_VERSION = "2026-08-09";
|
|
332
|
-
export declare const forecastWindowBucketSchema:
|
|
333
|
-
byTenant:
|
|
334
|
-
count:
|
|
335
|
-
nextFireCount:
|
|
336
|
-
otherCount:
|
|
337
|
-
start:
|
|
338
|
-
},
|
|
332
|
+
export declare const forecastWindowBucketSchema: import("zod").ZodObject<{
|
|
333
|
+
byTenant: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodNumber>;
|
|
334
|
+
count: import("zod").ZodNumber;
|
|
335
|
+
nextFireCount: import("zod").ZodNumber;
|
|
336
|
+
otherCount: import("zod").ZodNumber;
|
|
337
|
+
start: import("zod").ZodString;
|
|
338
|
+
}, import("zod/v4/core").$strip>;
|
|
339
339
|
export type ForecastWindowBucket = z.infer<typeof forecastWindowBucketSchema>;
|
|
340
|
-
export declare const forecastWindowsSchema:
|
|
341
|
-
bucketSeconds:
|
|
342
|
-
buckets:
|
|
343
|
-
byTenant:
|
|
344
|
-
count:
|
|
345
|
-
nextFireCount:
|
|
346
|
-
otherCount:
|
|
347
|
-
start:
|
|
348
|
-
},
|
|
349
|
-
freshness:
|
|
350
|
-
kind:
|
|
351
|
-
},
|
|
352
|
-
asOf:
|
|
353
|
-
kind:
|
|
354
|
-
lagSeconds:
|
|
355
|
-
},
|
|
356
|
-
version:
|
|
357
|
-
},
|
|
340
|
+
export declare const forecastWindowsSchema: import("zod").ZodObject<{
|
|
341
|
+
bucketSeconds: import("zod").ZodNumber;
|
|
342
|
+
buckets: import("zod").ZodArray<import("zod").ZodObject<{
|
|
343
|
+
byTenant: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodNumber>;
|
|
344
|
+
count: import("zod").ZodNumber;
|
|
345
|
+
nextFireCount: import("zod").ZodNumber;
|
|
346
|
+
otherCount: import("zod").ZodNumber;
|
|
347
|
+
start: import("zod").ZodString;
|
|
348
|
+
}, import("zod/v4/core").$strip>>;
|
|
349
|
+
freshness: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
350
|
+
kind: import("zod").ZodLiteral<"authoritative">;
|
|
351
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
352
|
+
asOf: import("zod").ZodString;
|
|
353
|
+
kind: import("zod").ZodLiteral<"projected">;
|
|
354
|
+
lagSeconds: import("zod").ZodNumber;
|
|
355
|
+
}, import("zod/v4/core").$strip>], "kind">;
|
|
356
|
+
version: import("zod").ZodLiteral<"2026-08-09">;
|
|
357
|
+
}, import("zod/v4/core").$strip>;
|
|
358
358
|
export type ForecastWindows = z.infer<typeof forecastWindowsSchema>;
|
|
359
359
|
/**
|
|
360
360
|
* What the migrating consumer may rely on, published as data.
|
package/dist/forecast.js
CHANGED
package/dist/identifiers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import { z } from "./zod.js";
|
|
2
2
|
/**
|
|
3
3
|
* Public identifiers.
|
|
4
4
|
*
|
|
@@ -37,25 +37,25 @@ export type IdResource = keyof typeof ID_PREFIXES;
|
|
|
37
37
|
export declare function idPattern(resource: IdResource): RegExp;
|
|
38
38
|
/** Any well-formed public identifier, whatever it names. */
|
|
39
39
|
export declare const ANY_ID_PATTERN: RegExp;
|
|
40
|
-
export declare function idSchema(resource: IdResource):
|
|
41
|
-
export declare const apiCredentialIdSchema:
|
|
42
|
-
export declare const apiCredentialEventIdSchema:
|
|
43
|
-
export declare const authorizationRequestIdSchema:
|
|
44
|
-
export declare const callbackSigningKeyIdSchema:
|
|
45
|
-
export declare const oauthClientIdSchema:
|
|
46
|
-
export declare const oauthGrantIdSchema:
|
|
47
|
-
export declare const oauthGrantEventIdSchema:
|
|
48
|
-
export declare const scheduleIdSchema:
|
|
49
|
-
export declare const occurrenceIdSchema:
|
|
50
|
-
export declare const attemptIdSchema:
|
|
51
|
-
export declare const deliveryIdSchema:
|
|
52
|
-
export declare const endpointIdSchema:
|
|
53
|
-
export declare const organizationIdSchema:
|
|
54
|
-
export declare const projectIdSchema:
|
|
55
|
-
export declare const environmentIdSchema:
|
|
56
|
-
export declare const eventIdSchema:
|
|
57
|
-
export declare const testSinkIdSchema:
|
|
58
|
-
export declare const testSinkDeliveryIdSchema:
|
|
40
|
+
export declare function idSchema(resource: IdResource): import("zod").ZodString;
|
|
41
|
+
export declare const apiCredentialIdSchema: import("zod").ZodString;
|
|
42
|
+
export declare const apiCredentialEventIdSchema: import("zod").ZodString;
|
|
43
|
+
export declare const authorizationRequestIdSchema: import("zod").ZodString;
|
|
44
|
+
export declare const callbackSigningKeyIdSchema: import("zod").ZodString;
|
|
45
|
+
export declare const oauthClientIdSchema: import("zod").ZodString;
|
|
46
|
+
export declare const oauthGrantIdSchema: import("zod").ZodString;
|
|
47
|
+
export declare const oauthGrantEventIdSchema: import("zod").ZodString;
|
|
48
|
+
export declare const scheduleIdSchema: import("zod").ZodString;
|
|
49
|
+
export declare const occurrenceIdSchema: import("zod").ZodString;
|
|
50
|
+
export declare const attemptIdSchema: import("zod").ZodString;
|
|
51
|
+
export declare const deliveryIdSchema: import("zod").ZodString;
|
|
52
|
+
export declare const endpointIdSchema: import("zod").ZodString;
|
|
53
|
+
export declare const organizationIdSchema: import("zod").ZodString;
|
|
54
|
+
export declare const projectIdSchema: import("zod").ZodString;
|
|
55
|
+
export declare const environmentIdSchema: import("zod").ZodString;
|
|
56
|
+
export declare const eventIdSchema: import("zod").ZodString;
|
|
57
|
+
export declare const testSinkIdSchema: import("zod").ZodString;
|
|
58
|
+
export declare const testSinkDeliveryIdSchema: import("zod").ZodString;
|
|
59
59
|
export type ApiCredentialId = z.infer<typeof apiCredentialIdSchema>;
|
|
60
60
|
export type ApiCredentialEventId = z.infer<typeof apiCredentialEventIdSchema>;
|
|
61
61
|
export type AuthorizationRequestId = z.infer<typeof authorizationRequestIdSchema>;
|
package/dist/identifiers.js
CHANGED
package/dist/identity.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import { z } from "./zod.js";
|
|
2
2
|
/**
|
|
3
3
|
* External identity, and what it projects into.
|
|
4
4
|
*
|
|
@@ -32,8 +32,8 @@ import { z } from "zod";
|
|
|
32
32
|
* surface depend on our identity vendor and hand callers a second spelling of
|
|
33
33
|
* the same tenant.
|
|
34
34
|
*/
|
|
35
|
-
export declare const externalOrganizationIdSchema:
|
|
36
|
-
export declare const externalUserIdSchema:
|
|
35
|
+
export declare const externalOrganizationIdSchema: import("zod").ZodString;
|
|
36
|
+
export declare const externalUserIdSchema: import("zod").ZodString;
|
|
37
37
|
/**
|
|
38
38
|
* A Clerk organization-membership identifier, and the projection's primary key.
|
|
39
39
|
*
|
|
@@ -44,21 +44,22 @@ export declare const externalUserIdSchema: z.ZodString;
|
|
|
44
44
|
* the new one is a separate row, which is also what makes the two orderable
|
|
45
45
|
* independently.
|
|
46
46
|
*/
|
|
47
|
-
export declare const externalMembershipIdSchema:
|
|
47
|
+
export declare const externalMembershipIdSchema: import("zod").ZodString;
|
|
48
48
|
export type ExternalOrganizationId = z.infer<typeof externalOrganizationIdSchema>;
|
|
49
49
|
export type ExternalUserId = z.infer<typeof externalUserIdSchema>;
|
|
50
50
|
export type ExternalMembershipId = z.infer<typeof externalMembershipIdSchema>;
|
|
51
51
|
/**
|
|
52
|
-
* Product roles, projected from Clerk's
|
|
52
|
+
* Product roles, projected from Clerk's organization roles.
|
|
53
53
|
*
|
|
54
54
|
* Named without the `org:` prefix because these are ours: W1-03 builds the
|
|
55
55
|
* role-to-scope matrix on them, and binding that matrix to a vendor's string
|
|
56
56
|
* format would make changing identity providers a contract change.
|
|
57
57
|
*/
|
|
58
|
-
export declare const MEMBERSHIP_ROLES: readonly ["admin", "member"];
|
|
59
|
-
export declare const membershipRoleSchema:
|
|
60
|
-
admin: "admin";
|
|
58
|
+
export declare const MEMBERSHIP_ROLES: readonly ["admin", "billing", "member"];
|
|
59
|
+
export declare const membershipRoleSchema: import("zod").ZodEnum<{
|
|
61
60
|
member: "member";
|
|
61
|
+
admin: "admin";
|
|
62
|
+
billing: "billing";
|
|
62
63
|
}>;
|
|
63
64
|
export type MembershipRole = z.infer<typeof membershipRoleSchema>;
|
|
64
65
|
/**
|
|
@@ -69,9 +70,9 @@ export type MembershipRole = z.infer<typeof membershipRoleSchema>;
|
|
|
69
70
|
* it and rejoining creates a new one. Both refuse access.
|
|
70
71
|
*/
|
|
71
72
|
export declare const MEMBERSHIP_STATUSES: readonly ["active", "suspended", "removed"];
|
|
72
|
-
export declare const membershipStatusSchema:
|
|
73
|
-
removed: "removed";
|
|
73
|
+
export declare const membershipStatusSchema: import("zod").ZodEnum<{
|
|
74
74
|
active: "active";
|
|
75
|
+
removed: "removed";
|
|
75
76
|
suspended: "suspended";
|
|
76
77
|
}>;
|
|
77
78
|
export type MembershipStatus = z.infer<typeof membershipStatusSchema>;
|
|
@@ -95,21 +96,22 @@ export declare function leastStatus(left: MembershipStatus, right: MembershipSta
|
|
|
95
96
|
* convergent: there is no event that updates the status while leaving the role
|
|
96
97
|
* behind at an older version, so one version orders the whole record.
|
|
97
98
|
*/
|
|
98
|
-
export declare const membershipSchema:
|
|
99
|
-
id:
|
|
100
|
-
organization:
|
|
101
|
-
role:
|
|
102
|
-
admin: "admin";
|
|
99
|
+
export declare const membershipSchema: import("zod").ZodObject<{
|
|
100
|
+
id: import("zod").ZodString;
|
|
101
|
+
organization: import("zod").ZodString;
|
|
102
|
+
role: import("zod").ZodEnum<{
|
|
103
103
|
member: "member";
|
|
104
|
+
admin: "admin";
|
|
105
|
+
billing: "billing";
|
|
104
106
|
}>;
|
|
105
|
-
status:
|
|
106
|
-
removed: "removed";
|
|
107
|
+
status: import("zod").ZodEnum<{
|
|
107
108
|
active: "active";
|
|
109
|
+
removed: "removed";
|
|
108
110
|
suspended: "suspended";
|
|
109
111
|
}>;
|
|
110
|
-
user:
|
|
111
|
-
version:
|
|
112
|
-
},
|
|
112
|
+
user: import("zod").ZodString;
|
|
113
|
+
version: import("zod").ZodNumber;
|
|
114
|
+
}, import("zod/v4/core").$strip>;
|
|
113
115
|
export type Membership = z.infer<typeof membershipSchema>;
|
|
114
116
|
/**
|
|
115
117
|
* One change, normalized by the adapter from a Clerk webhook payload.
|
|
@@ -136,21 +138,22 @@ export type Membership = z.infer<typeof membershipSchema>;
|
|
|
136
138
|
* change. Deleting an organization does not. The asymmetry is real and is why
|
|
137
139
|
* only one of the two has a tombstone.
|
|
138
140
|
*/
|
|
139
|
-
export declare const membershipChangeSchema:
|
|
140
|
-
id:
|
|
141
|
-
organization:
|
|
142
|
-
role:
|
|
143
|
-
admin: "admin";
|
|
141
|
+
export declare const membershipChangeSchema: import("zod").ZodObject<{
|
|
142
|
+
id: import("zod").ZodString;
|
|
143
|
+
organization: import("zod").ZodString;
|
|
144
|
+
role: import("zod").ZodEnum<{
|
|
144
145
|
member: "member";
|
|
146
|
+
admin: "admin";
|
|
147
|
+
billing: "billing";
|
|
145
148
|
}>;
|
|
146
|
-
status:
|
|
147
|
-
removed: "removed";
|
|
149
|
+
status: import("zod").ZodEnum<{
|
|
148
150
|
active: "active";
|
|
151
|
+
removed: "removed";
|
|
149
152
|
suspended: "suspended";
|
|
150
153
|
}>;
|
|
151
|
-
user:
|
|
152
|
-
version:
|
|
153
|
-
},
|
|
154
|
+
user: import("zod").ZodString;
|
|
155
|
+
version: import("zod").ZodNumber;
|
|
156
|
+
}, import("zod/v4/core").$strip>;
|
|
154
157
|
export type MembershipChange = Membership;
|
|
155
158
|
/**
|
|
156
159
|
* The membership a verified session asserts.
|
|
@@ -160,15 +163,16 @@ export type MembershipChange = Membership;
|
|
|
160
163
|
* milliseconds — when Clerk vouched for this membership — which is what makes it
|
|
161
164
|
* comparable against a projected `version` from the same clock.
|
|
162
165
|
*/
|
|
163
|
-
export declare const sessionMembershipSchema:
|
|
164
|
-
assertedAt:
|
|
165
|
-
organization:
|
|
166
|
-
role:
|
|
167
|
-
admin: "admin";
|
|
166
|
+
export declare const sessionMembershipSchema: import("zod").ZodObject<{
|
|
167
|
+
assertedAt: import("zod").ZodNumber;
|
|
168
|
+
organization: import("zod").ZodString;
|
|
169
|
+
role: import("zod").ZodEnum<{
|
|
168
170
|
member: "member";
|
|
171
|
+
admin: "admin";
|
|
172
|
+
billing: "billing";
|
|
169
173
|
}>;
|
|
170
|
-
user:
|
|
171
|
-
},
|
|
174
|
+
user: import("zod").ZodString;
|
|
175
|
+
}, import("zod/v4/core").$strip>;
|
|
172
176
|
export type SessionMembership = z.infer<typeof sessionMembershipSchema>;
|
|
173
177
|
/**
|
|
174
178
|
* A record that an organization was deleted.
|
|
@@ -189,8 +193,8 @@ export type SessionMembership = z.infer<typeof sessionMembershipSchema>;
|
|
|
189
193
|
* for an organization that no longer exists. Deleting a *user* does emit a
|
|
190
194
|
* membership deletion. That asymmetry is why this exists — see FXO-1377.
|
|
191
195
|
*/
|
|
192
|
-
export declare const organizationTombstoneSchema:
|
|
193
|
-
organization:
|
|
194
|
-
version:
|
|
195
|
-
},
|
|
196
|
+
export declare const organizationTombstoneSchema: import("zod").ZodObject<{
|
|
197
|
+
organization: import("zod").ZodString;
|
|
198
|
+
version: import("zod").ZodNumber;
|
|
199
|
+
}, import("zod/v4/core").$strip>;
|
|
196
200
|
export type OrganizationTombstone = z.infer<typeof organizationTombstoneSchema>;
|