@pithy-sh/core 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access/access.d.ts +172 -0
- package/dist/access/access.d.ts.map +1 -0
- package/dist/access/access.js +147 -0
- package/dist/access/acting.d.ts +49 -0
- package/dist/access/acting.d.ts.map +1 -0
- package/dist/access/acting.js +21 -0
- package/dist/access/policyCheck.d.ts +33 -0
- package/dist/access/policyCheck.d.ts.map +1 -0
- package/dist/access/policyCheck.js +48 -0
- package/dist/access/usage.d.ts +83 -0
- package/dist/access/usage.d.ts.map +1 -0
- package/dist/access/usage.js +104 -0
- package/dist/access/visibility.d.ts +66 -0
- package/dist/access/visibility.d.ts.map +1 -0
- package/dist/access/visibility.js +86 -0
- package/dist/asyncapi/document.d.ts +46 -0
- package/dist/asyncapi/document.d.ts.map +1 -0
- package/dist/asyncapi/document.js +115 -0
- package/dist/audit/auditEvent.d.ts +5 -0
- package/dist/audit/auditEvent.d.ts.map +1 -1
- package/dist/audit/auditEvent.js +2 -0
- package/dist/capability/bindings.d.ts +47 -2
- package/dist/capability/bindings.d.ts.map +1 -1
- package/dist/capability/bindings.js +117 -7
- package/dist/capability/capability.d.ts +105 -28
- package/dist/capability/capability.d.ts.map +1 -1
- package/dist/capability/composition.d.ts.map +1 -1
- package/dist/capability/composition.js +5 -1
- package/dist/capability/manifest.d.ts +2 -1
- package/dist/capability/manifest.d.ts.map +1 -1
- package/dist/capability/manifest.js +1 -1
- package/dist/capability/settings.d.ts +96 -4
- package/dist/capability/settings.d.ts.map +1 -1
- package/dist/capability/settings.js +85 -4
- package/dist/cli/command.d.ts +364 -0
- package/dist/cli/command.d.ts.map +1 -0
- package/dist/cli/command.js +418 -0
- package/dist/cli/commandCatalog.generated.d.ts +2437 -0
- package/dist/cli/commandCatalog.generated.d.ts.map +1 -0
- package/dist/cli/commandCatalog.generated.js +2564 -0
- package/dist/cli/commandFacts.d.ts +164 -0
- package/dist/cli/commandFacts.d.ts.map +1 -0
- package/dist/cli/commandFacts.js +216 -0
- package/dist/controlPlane/capability.d.ts.map +1 -1
- package/dist/controlPlane/capability.js +12 -2
- package/dist/controlPlane/context.d.ts +5 -0
- package/dist/controlPlane/context.d.ts.map +1 -1
- package/dist/controlPlane/context.js +3 -1
- package/dist/controlPlane/data/connection.d.ts +47 -0
- package/dist/controlPlane/data/connection.d.ts.map +1 -1
- package/dist/controlPlane/data/connection.js +55 -1
- package/dist/controlPlane/error/errors.d.ts.map +1 -1
- package/dist/controlPlane/error/errors.js +4 -3
- package/dist/controlPlane/http/cors.d.ts +4 -4
- package/dist/controlPlane/http/cors.js +4 -4
- package/dist/controlPlane/http/guard.d.ts +11 -0
- package/dist/controlPlane/http/guard.d.ts.map +1 -1
- package/dist/controlPlane/http/guard.js +28 -2
- package/dist/controlPlane/http/handlers.d.ts +60 -0
- package/dist/controlPlane/http/handlers.d.ts.map +1 -1
- package/dist/controlPlane/http/handlers.js +31 -2
- package/dist/controlPlane/http/readiness.d.ts +33 -0
- package/dist/controlPlane/http/readiness.d.ts.map +1 -0
- package/dist/controlPlane/http/readiness.js +39 -0
- package/dist/controlPlane/http/responses.d.ts +147 -0
- package/dist/controlPlane/http/responses.d.ts.map +1 -1
- package/dist/controlPlane/http/responses.js +61 -4
- package/dist/controlPlane/http/routes.d.ts +2 -1
- package/dist/controlPlane/http/routes.d.ts.map +1 -1
- package/dist/controlPlane/http/routes.js +50 -9
- package/dist/controlPlane/http/verify.d.ts.map +1 -1
- package/dist/controlPlane/http/verify.js +2 -1
- package/dist/controlPlane/migrationState/migrationState.d.ts +102 -0
- package/dist/controlPlane/migrationState/migrationState.d.ts.map +1 -0
- package/dist/controlPlane/migrationState/migrationState.js +142 -0
- package/dist/controlPlane/migrations/0003_connection_principal.d.ts +21 -0
- package/dist/controlPlane/migrations/0003_connection_principal.d.ts.map +1 -0
- package/dist/controlPlane/migrations/0003_connection_principal.js +33 -0
- package/dist/controlPlane/scope/scope.d.ts +13 -2
- package/dist/controlPlane/scope/scope.d.ts.map +1 -1
- package/dist/controlPlane/scope/scope.js +14 -3
- package/dist/createBackend.d.ts +7 -0
- package/dist/createBackend.d.ts.map +1 -1
- package/dist/createBackend.js +41 -6
- package/dist/createEntrypoint.d.ts.map +1 -1
- package/dist/createEntrypoint.js +5 -3
- package/dist/entitlement/allowance.d.ts +25 -0
- package/dist/entitlement/allowance.d.ts.map +1 -0
- package/dist/entitlement/allowance.js +80 -0
- package/dist/entitlement/entitlement.d.ts +41 -0
- package/dist/entitlement/entitlement.d.ts.map +1 -1
- package/dist/entitlement/meter.d.ts +57 -0
- package/dist/entitlement/meter.d.ts.map +1 -0
- package/dist/entitlement/meter.js +13 -0
- package/dist/entitlement/require.js +1 -1
- package/dist/error/cause.d.ts +16 -116
- package/dist/error/cause.d.ts.map +1 -1
- package/dist/error/cause.js +19 -153
- package/dist/error/http.d.ts +184 -0
- package/dist/error/http.d.ts.map +1 -1
- package/dist/error/payload.d.ts +368 -0
- package/dist/error/payload.d.ts.map +1 -1
- package/dist/error/payload.js +126 -4
- package/dist/error/pithyError.d.ts +44 -0
- package/dist/error/pithyError.d.ts.map +1 -1
- package/dist/error/pithyError.js +56 -1
- package/dist/error/unresolved.d.ts +265 -0
- package/dist/error/unresolved.d.ts.map +1 -0
- package/dist/error/unresolved.js +599 -0
- package/dist/error/wire.d.ts +20 -0
- package/dist/error/wire.d.ts.map +1 -0
- package/dist/error/wire.js +19 -0
- package/dist/http/authContext.d.ts +7 -0
- package/dist/http/authContext.d.ts.map +1 -1
- package/dist/http/authContext.js +8 -1
- package/dist/http/oidcWebhook.d.ts +3 -3
- package/dist/http/oidcWebhook.js +3 -3
- package/dist/http/routeContract.js +1 -1
- package/dist/http/routeSpec.d.ts +66 -0
- package/dist/http/routeSpec.d.ts.map +1 -0
- package/dist/http/routeSpec.js +40 -0
- package/dist/http/sameOrigin.d.ts +1 -1
- package/dist/http/sameOrigin.js +1 -1
- package/dist/http/scopeGates.d.ts +20 -0
- package/dist/http/scopeGates.d.ts.map +1 -0
- package/dist/http/scopeGates.js +36 -0
- package/dist/http/signedWebhook.d.ts +3 -3
- package/dist/http/signedWebhook.js +3 -3
- package/dist/http/socket.d.ts +52 -0
- package/dist/http/socket.d.ts.map +1 -0
- package/dist/http/socket.js +2 -0
- package/dist/http/subprotocol.d.ts +29 -0
- package/dist/http/subprotocol.d.ts.map +1 -0
- package/dist/http/subprotocol.js +37 -0
- package/dist/http/validation.d.ts +40 -8
- package/dist/http/validation.d.ts.map +1 -1
- package/dist/http/validation.js +25 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/logger/record.d.ts +107 -0
- package/dist/logger/record.d.ts.map +1 -1
- package/dist/migrations/bookkeeping.d.ts +21 -0
- package/dist/migrations/bookkeeping.d.ts.map +1 -1
- package/dist/migrations/bookkeeping.js +32 -3
- package/dist/migrations/capabilitySets.d.ts +23 -0
- package/dist/migrations/capabilitySets.d.ts.map +1 -0
- package/dist/migrations/capabilitySets.js +74 -0
- package/dist/migrations/groups.d.ts +140 -0
- package/dist/migrations/groups.d.ts.map +1 -0
- package/dist/migrations/groups.js +191 -0
- package/dist/migrations/migrateStep.d.ts +13 -0
- package/dist/migrations/migrateStep.d.ts.map +1 -0
- package/dist/migrations/migrateStep.js +20 -0
- package/dist/migrations/owner.d.ts +7 -0
- package/dist/migrations/owner.d.ts.map +1 -1
- package/dist/migrations/owner.js +11 -7
- package/dist/migrations/registry.d.ts +26 -0
- package/dist/migrations/registry.d.ts.map +1 -1
- package/dist/migrations/registry.js +38 -7
- package/dist/migrations/retained.js +2 -2
- package/dist/migrations/runner.d.ts +76 -5
- package/dist/migrations/runner.d.ts.map +1 -1
- package/dist/migrations/runner.js +130 -19
- package/dist/migrations/state.d.ts +60 -0
- package/dist/migrations/state.d.ts.map +1 -0
- package/dist/migrations/state.js +46 -0
- package/dist/naming/domains.d.ts +17 -0
- package/dist/naming/domains.d.ts.map +1 -1
- package/dist/naming/domains.js +62 -4
- package/dist/naming/environment.d.ts.map +1 -1
- package/dist/naming/environment.js +2 -1
- package/dist/naming/feature.d.ts +27 -5
- package/dist/naming/feature.d.ts.map +1 -1
- package/dist/naming/feature.js +36 -6
- package/dist/naming/limits.d.ts +47 -3
- package/dist/naming/limits.d.ts.map +1 -1
- package/dist/naming/limits.js +47 -3
- package/dist/naming/packageName.d.ts +17 -0
- package/dist/naming/packageName.d.ts.map +1 -0
- package/dist/naming/packageName.js +22 -0
- package/dist/naming/provisionScope.d.ts +6 -0
- package/dist/naming/provisionScope.d.ts.map +1 -1
- package/dist/naming/provisionScope.js +10 -4
- package/dist/naming/resourceNames.d.ts +21 -2
- package/dist/naming/resourceNames.d.ts.map +1 -1
- package/dist/naming/resourceNames.js +21 -3
- package/dist/openapi/document.d.ts +106 -0
- package/dist/openapi/document.d.ts.map +1 -0
- package/dist/openapi/document.js +314 -0
- package/dist/openapi/routeGroups.d.ts +8 -0
- package/dist/openapi/routeGroups.d.ts.map +1 -0
- package/dist/openapi/routeGroups.js +23 -0
- package/dist/seed/writeD1.d.ts +7 -1
- package/dist/seed/writeD1.d.ts.map +1 -1
- package/dist/seed/writeD1.js +9 -3
- package/dist/seed/writeKv.d.ts +2 -0
- package/dist/seed/writeKv.d.ts.map +1 -1
- package/dist/seed/writeKv.js +6 -2
- package/dist/text/comments.js +66 -4
- package/dist/text/literals.d.ts +43 -0
- package/dist/text/literals.d.ts.map +1 -0
- package/dist/text/literals.js +293 -0
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.d.ts.map +1 -1
- package/dist/version.generated.js +1 -1
- package/dist/worker/serviceLoopback.d.ts +36 -0
- package/dist/worker/serviceLoopback.d.ts.map +1 -0
- package/dist/worker/serviceLoopback.js +74 -0
- package/dist/workflow/dispatchRoute.d.ts.map +1 -1
- package/dist/workflow/dispatchRoute.js +12 -6
- package/dist/workflow/faults.d.ts +12 -1
- package/dist/workflow/faults.d.ts.map +1 -1
- package/dist/workflow/faults.js +24 -18
- package/dist/workflow/hostEnv.d.ts +1 -0
- package/dist/workflow/hostEnv.d.ts.map +1 -1
- package/dist/workflow/hostEnv.js +4 -2
- package/dist/workflow/loopback.d.ts.map +1 -1
- package/dist/workflow/loopback.js +2 -1
- package/package.json +4 -4
- package/src/access/access.ts +298 -0
- package/src/access/acting.ts +59 -0
- package/src/access/policyCheck.ts +77 -0
- package/src/access/usage.ts +141 -0
- package/src/access/visibility.ts +109 -0
- package/src/asyncapi/document.ts +164 -0
- package/src/audit/auditEvent.ts +4 -0
- package/src/capability/bindings.ts +159 -13
- package/src/capability/capability.ts +106 -29
- package/src/capability/composition.ts +2 -1
- package/src/capability/settings.ts +165 -4
- package/src/cli/command.ts +865 -0
- package/src/cli/commandCatalog.generated.ts +2723 -0
- package/src/cli/commandFacts.ts +220 -0
- package/src/controlPlane/capability.ts +25 -1
- package/src/controlPlane/context.ts +4 -0
- package/src/controlPlane/data/connection.ts +90 -0
- package/src/controlPlane/error/errors.ts +10 -3
- package/src/controlPlane/http/cors.ts +4 -4
- package/src/controlPlane/http/guard.ts +35 -2
- package/src/controlPlane/http/handlers.ts +41 -0
- package/src/controlPlane/http/readiness.ts +50 -0
- package/src/controlPlane/http/responses.ts +140 -2
- package/src/controlPlane/http/routes.ts +82 -10
- package/src/controlPlane/http/verify.ts +2 -0
- package/src/controlPlane/migrationState/migrationState.ts +200 -0
- package/src/controlPlane/migrations/0003_connection_principal.ts +37 -0
- package/src/controlPlane/scope/scope.ts +14 -2
- package/src/createBackend.ts +59 -8
- package/src/createEntrypoint.ts +9 -3
- package/src/entitlement/allowance.ts +85 -0
- package/src/entitlement/entitlement.ts +38 -0
- package/src/entitlement/meter.ts +69 -0
- package/src/entitlement/require.ts +1 -1
- package/src/error/cause.ts +18 -181
- package/src/error/payload.ts +270 -4
- package/src/error/pithyError.ts +76 -0
- package/src/error/unresolved.ts +853 -0
- package/src/error/wire.ts +40 -0
- package/src/http/authContext.ts +13 -1
- package/src/http/oidcWebhook.ts +3 -3
- package/src/http/routeContract.ts +1 -1
- package/src/http/routeSpec.ts +81 -0
- package/src/http/sameOrigin.ts +1 -1
- package/src/http/scopeGates.ts +34 -0
- package/src/http/signedWebhook.ts +3 -3
- package/src/http/socket.ts +55 -0
- package/src/http/subprotocol.ts +47 -0
- package/src/http/validation.ts +50 -8
- package/src/index.ts +1 -0
- package/src/migrations/bookkeeping.ts +39 -2
- package/src/migrations/capabilitySets.ts +87 -0
- package/src/migrations/groups.ts +295 -0
- package/src/migrations/migrateStep.ts +19 -0
- package/src/migrations/owner.ts +10 -6
- package/src/migrations/registry.ts +46 -2
- package/src/migrations/retained.ts +2 -2
- package/src/migrations/runner.ts +214 -22
- package/src/migrations/state.ts +94 -0
- package/src/naming/domains.ts +75 -16
- package/src/naming/environment.ts +2 -1
- package/src/naming/feature.ts +46 -7
- package/src/naming/limits.ts +35 -3
- package/src/naming/packageName.ts +20 -0
- package/src/naming/provisionScope.ts +21 -2
- package/src/naming/resourceNames.ts +52 -5
- package/src/openapi/document.ts +412 -0
- package/src/openapi/routeGroups.ts +25 -0
- package/src/seed/writeD1.ts +13 -4
- package/src/seed/writeKv.ts +6 -2
- package/src/text/comments.ts +56 -4
- package/src/text/literals.ts +294 -0
- package/src/version.generated.ts +1 -1
- package/src/worker/serviceLoopback.ts +105 -0
- package/src/workflow/dispatchRoute.ts +13 -6
- package/src/workflow/faults.ts +56 -27
- package/src/workflow/hostEnv.ts +9 -1
- package/src/workflow/loopback.ts +2 -1
package/dist/error/payload.js
CHANGED
|
@@ -60,6 +60,23 @@ const InvalidInputPublic = z.object({
|
|
|
60
60
|
issues: z.array(ValidationIssue).describe("Field-level validation failures."),
|
|
61
61
|
...publicFields
|
|
62
62
|
}).describe("Input failed validation at a boundary (400).");
|
|
63
|
+
const InputRequiredPublic = z.object({
|
|
64
|
+
code: z.literal("input/required").describe("A run that may not prompt reached a question with no answer. `PITHY_NONINTERACTIVE=1`, `--no-input` and `--json` each forbid a prompt; this is what one turns into, so an agent is told what to pass rather than left waiting on a question nobody will answer."),
|
|
65
|
+
status: z.literal(400).describe("Bad Request — the call left out something it has to say."),
|
|
66
|
+
flag: z.string().nullable().describe("The flag that answers the question, as it is typed (`--worker`). `null` when no flag can: only a person, or a document piped to stdin, answers it."),
|
|
67
|
+
choices: z.array(z.string().describe("One value the flag takes.")).optional().describe("Every value the flag takes, when the set is known. Absent when it is open, such as a name."),
|
|
68
|
+
...publicFields
|
|
69
|
+
}).describe("A run that may not prompt needed an answer it was not given (400).");
|
|
70
|
+
const PreconditionFailedPublic = z.object({
|
|
71
|
+
code: z.literal("core/precondition_failed").describe("The call is well formed, and the state it needs is not there yet: no credentials, an environment that is not provisioned, a resource nothing has created. Distinct from `validation/invalid_input` because the remedy is a different step run first, not a different call."),
|
|
72
|
+
status: z.literal(412).describe("Precondition Failed — the request is valid, and what it depends on is missing."),
|
|
73
|
+
...publicFields
|
|
74
|
+
}).describe("The state this request depends on is not there yet (412).");
|
|
75
|
+
const PersonRequiredPublic = z.object({
|
|
76
|
+
code: z.literal("core/person_required").describe("The step is one only a person may take: a typed confirmation phrase, or a command that is manual by design. Distinct from `input/required` because no flag value an automated caller could choose is the right answer — the right move is to stop and ask."),
|
|
77
|
+
status: z.literal(403).describe("Forbidden — the caller may not take this step for a person, however the call is phrased."),
|
|
78
|
+
...publicFields
|
|
79
|
+
}).describe("A step only a person may take (403).");
|
|
63
80
|
const InvalidTokenPublic = z.object({
|
|
64
81
|
code: z.literal("auth/invalid_token").describe("The bearer/session credential is missing, expired, or invalid."),
|
|
65
82
|
status: z.literal(401).describe("Unauthorized."),
|
|
@@ -225,6 +242,16 @@ const TurnstileConfigPublic = z.object({
|
|
|
225
242
|
status: z.literal(500).describe("Internal Server Error — a configuration fault, not a client request."),
|
|
226
243
|
...publicFields
|
|
227
244
|
}).describe("The Turnstile middleware is misconfigured (500).");
|
|
245
|
+
const TurnstileAnalyticsWindowPublic = z.object({
|
|
246
|
+
code: z.literal("turnstile/analytics_window").describe("The requested challenge window reaches past what Cloudflare keeps, or is wider than one read may ask for."),
|
|
247
|
+
status: z.literal(400).describe("Bad Request — narrow the window or move it later."),
|
|
248
|
+
...publicFields
|
|
249
|
+
}).describe("A Turnstile-analytics window outside Cloudflare's retention or range (400).");
|
|
250
|
+
const TurnstileAnalyticsUnavailablePublic = z.object({
|
|
251
|
+
code: z.literal("turnstile/analytics_unavailable").describe("Cloudflare does not serve Turnstile analytics to this account, so no outcome can be read."),
|
|
252
|
+
status: z.literal(409).describe("Conflict — the account's configuration rules the read out."),
|
|
253
|
+
...publicFields
|
|
254
|
+
}).describe("Turnstile analytics are not served to this account (409).");
|
|
228
255
|
const AuditInvalidEventPublic = z.object({
|
|
229
256
|
code: z.literal("audit/invalid_event").describe("An audit event failed validation against the AuditEvent schema (bad action, outcome, or actor)."),
|
|
230
257
|
status: z.literal(400).describe("Bad Request — the event did not match its schema."),
|
|
@@ -240,6 +267,11 @@ const MediaNotFoundPublic = z.object({
|
|
|
240
267
|
status: z.literal(404).describe("Not Found."),
|
|
241
268
|
...publicFields
|
|
242
269
|
}).describe("A requested media record does not exist (404).");
|
|
270
|
+
const MediaForbiddenPublic = z.object({
|
|
271
|
+
code: z.literal("media/forbidden").describe("The caller may read the media record but not change it: only its owner, acting for the record's organization, or a role holding `media:manage` there may edit, delete or re-scope it."),
|
|
272
|
+
status: z.literal(403).describe("Forbidden."),
|
|
273
|
+
...publicFields
|
|
274
|
+
}).describe("The caller may read the record but not change it (403).");
|
|
243
275
|
const MediaUnsupportedPublic = z.object({
|
|
244
276
|
code: z.literal("media/unsupported").describe("The media type, extension, or backend is not supported for the requested operation."),
|
|
245
277
|
status: z.literal(400).describe("Bad Request — the operation does not apply to this media."),
|
|
@@ -255,6 +287,16 @@ const MediaEnrichmentFailedPublic = z.object({
|
|
|
255
287
|
status: z.literal(500).describe("Internal Server Error — an enrichment step could not complete."),
|
|
256
288
|
...publicFields
|
|
257
289
|
}).describe("A media AI-enrichment step failed (500).");
|
|
290
|
+
const MediaAnalyticsWindowPublic = z.object({
|
|
291
|
+
code: z.literal("media/analytics_window").describe("The requested delivery window reaches past what Cloudflare keeps, or is wider than one read may ask for."),
|
|
292
|
+
status: z.literal(400).describe("Bad Request — narrow the window or move it later."),
|
|
293
|
+
...publicFields
|
|
294
|
+
}).describe("A delivery-analytics window outside Cloudflare's retention or range (400).");
|
|
295
|
+
const MediaAnalyticsUnavailablePublic = z.object({
|
|
296
|
+
code: z.literal("media/analytics_unavailable").describe("Cloudflare does not serve the delivery analytics this read needs to this account — a Customer Metadata Boundary outside the US carries none of them."),
|
|
297
|
+
status: z.literal(409).describe("Conflict — the account's configuration rules the read out."),
|
|
298
|
+
...publicFields
|
|
299
|
+
}).describe("Delivery analytics are not served to this account (409).");
|
|
258
300
|
const LeaderboardBoardNotFoundPublic = z.object({
|
|
259
301
|
code: z.literal("leaderboard/board_not_found").describe("No board with that key is configured. Board keys come from `pithy.config.ts`, not from the database."),
|
|
260
302
|
status: z.literal(404).describe("Not Found."),
|
|
@@ -421,17 +463,17 @@ const MatchmakingNotQueuedPublic = z.object({
|
|
|
421
463
|
...publicFields
|
|
422
464
|
}).describe("The player is not in the queue (404).");
|
|
423
465
|
const StorageNotFoundPublic = z.object({
|
|
424
|
-
code: z.literal("storage/not_found").describe("No object row matches, or the object exists but
|
|
466
|
+
code: z.literal("storage/not_found").describe("No object row matches, or the object exists but this caller may not read it."),
|
|
425
467
|
status: z.literal(404).describe("Not Found."),
|
|
426
468
|
...publicFields
|
|
427
469
|
}).describe("The object does not exist, or is not visible to the caller (404).");
|
|
428
470
|
const StorageForbiddenPublic = z.object({
|
|
429
|
-
code: z.literal("storage/forbidden").describe("The caller
|
|
471
|
+
code: z.literal("storage/forbidden").describe("The caller may read the object but not change it: only its owner, acting for the object's organization, or a role holding `storage:manage` there may."),
|
|
430
472
|
status: z.literal(403).describe("Forbidden."),
|
|
431
473
|
...publicFields
|
|
432
|
-
}).describe("The caller
|
|
474
|
+
}).describe("The caller may read the object but not change it (403).");
|
|
433
475
|
const StorageQuotaExceededPublic = z.object({
|
|
434
|
-
code: z.literal("storage/quota_exceeded").describe("The declared upload size would push the owner past
|
|
476
|
+
code: z.literal("storage/quota_exceeded").describe("The declared upload size would push the owner past the configured `bytesPerOwner` quota. Checked at init against pending and stored rows together, so concurrent inits cannot race past the limit. Where the `storageBytes` meter is enforced, the same refusal is `payments/quota_exceeded` (402)."),
|
|
435
477
|
status: z.literal(413).describe("Content Too Large."),
|
|
436
478
|
...publicFields
|
|
437
479
|
}).describe("The upload would exceed the owner's byte quota (413).");
|
|
@@ -565,6 +607,16 @@ const PaymentsSubscriptionChangeRefusedPublic = z.object({
|
|
|
565
607
|
status: z.literal(409).describe("Conflict — the subscription's present state forbids the change asked of it."),
|
|
566
608
|
...publicFields
|
|
567
609
|
}).describe("A subscription's state forbids the change asked of it (409).");
|
|
610
|
+
const PaymentsOverrideStalePublic = z.object({
|
|
611
|
+
code: z.literal("payments/override_stale").describe("A control-plane override write named a version behind the subject's override row. Two operators share one customer: both opened the same allowance, and the second would silently overwrite the first while the first believed they had succeeded. So the write is refused and nothing is written. 409, because the request is well-formed and the same request against the version it now holds would be accepted — the caller re-reads, and tries again."),
|
|
612
|
+
status: z.literal(409).describe("Conflict — the override changed since the caller read it."),
|
|
613
|
+
...publicFields
|
|
614
|
+
}).describe("An override write named a stale version (409).");
|
|
615
|
+
const PaymentsQuotaExceededPublic = z.object({
|
|
616
|
+
code: z.literal("payments/quota_exceeded").describe("An enforced kit meter — emails enqueued, bytes stored, media items held — would pass the subject's effective quota for the period. Nothing was written. 402 Payment Required, because it is the honest status: the plan does not allow more and the remedy is a purchase, a bigger tier, or a number pinned for this subject from the control plane. A meter refuses and never bills — the kit does not sell overage."),
|
|
617
|
+
status: z.literal(402).describe("Payment Required — the plan's allowance for this period is used up."),
|
|
618
|
+
...publicFields
|
|
619
|
+
}).describe("An enforced meter is at its quota for this period (402).");
|
|
568
620
|
const ControlPlaneNotConnectedPublic = z.object({
|
|
569
621
|
code: z.literal("controlplane/not_connected").describe("No management-client connection is registered for this environment. The shipped default: the seam is present and denies everything until the adopter provisions a credential. There is no backdoor."),
|
|
570
622
|
status: z.literal(403).describe("Forbidden."),
|
|
@@ -625,6 +677,31 @@ const OrganizationNominationInvalidPublic = z.object({
|
|
|
625
677
|
status: z.literal(400).describe("Bad Request — no offer this caller may accept."),
|
|
626
678
|
...publicFields
|
|
627
679
|
}).describe("No standing ownership offer this caller may accept (400).");
|
|
680
|
+
const ArtifactsNotFoundPublic = z.object({
|
|
681
|
+
code: z.literal("artifacts/not_found").describe("No such repository, **or** one the caller holds no grant on and does not own. One code for both, byte for byte: a repository's name is in its clone URL, and a refusal that told the two apart would hand it over. Also what the credential route answers for a repository with remote access off. Which it was survives in `detail`, which the HTTP codec strips."),
|
|
682
|
+
status: z.literal(404).describe("Not Found."),
|
|
683
|
+
...publicFields
|
|
684
|
+
}).describe("No such repository, or none this caller may see — the same answer for both (404).");
|
|
685
|
+
const ArtifactsForbiddenPublic = z.object({
|
|
686
|
+
code: z.literal("artifacts/forbidden").describe("The caller can see the repository and may not do this to it: a grant holder asking for what only an owner may do, or a member of an organization whose role lacks the configured `managePower`. A 403 rather than the 404 above, because by then the caller already knows the repository exists."),
|
|
687
|
+
status: z.literal(403).describe("Forbidden."),
|
|
688
|
+
...publicFields
|
|
689
|
+
}).describe("The caller may see this repository and may not do this (403).");
|
|
690
|
+
const ArtifactsInvalidNamePublic = z.object({
|
|
691
|
+
code: z.literal("artifacts/invalid_name").describe("A supplied repository name is outside Cloudflare's charset or the 2-to-63 cap. Refused and never shortened: a name somebody chose is in every clone URL, and a silently different one is a repository nobody can find."),
|
|
692
|
+
status: z.literal(400).describe("Bad Request."),
|
|
693
|
+
...publicFields
|
|
694
|
+
}).describe("A repository name breaks the naming rule (400).");
|
|
695
|
+
const ArtifactsNameTakenPublic = z.object({
|
|
696
|
+
code: z.literal("artifacts/name_taken").describe("The owner already holds a repository with that display name, or a supplied physical name is already in the namespace. The second happens only where the adopter supplies names, so uniqueness is theirs."),
|
|
697
|
+
status: z.literal(409).describe("Conflict."),
|
|
698
|
+
...publicFields
|
|
699
|
+
}).describe("That repository name is already in use (409).");
|
|
700
|
+
const ArtifactsInvalidConfigPublic = z.object({
|
|
701
|
+
code: z.literal("artifacts/invalid_config").describe("The capability's configuration cannot be honored: a `tokenTtlSeconds` above the ceiling, or `organization` composed with no `managePower` named. Raised at boot, so a mistake fails on deploy rather than at the first mint."),
|
|
702
|
+
status: z.literal(400).describe("Bad Request — the configuration is malformed."),
|
|
703
|
+
...publicFields
|
|
704
|
+
}).describe("The artifacts configuration is invalid (400).");
|
|
628
705
|
const SupportNotFoundPublic = z.object({
|
|
629
706
|
code: z.literal("support/not_found").describe("A requested support thread, message, or attachment does not exist."),
|
|
630
707
|
status: z.literal(404).describe("Not Found."),
|
|
@@ -713,6 +790,9 @@ const TestersNotConfiguredPublic = z.object({
|
|
|
713
790
|
*/
|
|
714
791
|
const KitPublicErrorPayload = z.discriminatedUnion("code", [
|
|
715
792
|
InvalidInputPublic,
|
|
793
|
+
InputRequiredPublic,
|
|
794
|
+
PreconditionFailedPublic,
|
|
795
|
+
PersonRequiredPublic,
|
|
716
796
|
InvalidTokenPublic,
|
|
717
797
|
ForbiddenPublic,
|
|
718
798
|
AuthProviderUnavailablePublic,
|
|
@@ -746,12 +826,17 @@ const KitPublicErrorPayload = z.discriminatedUnion("code", [
|
|
|
746
826
|
TurnstileMissingTokenPublic,
|
|
747
827
|
TurnstileFailedPublic,
|
|
748
828
|
TurnstileConfigPublic,
|
|
829
|
+
TurnstileAnalyticsWindowPublic,
|
|
830
|
+
TurnstileAnalyticsUnavailablePublic,
|
|
749
831
|
AuditInvalidEventPublic,
|
|
750
832
|
AuditWriteFailedPublic,
|
|
751
833
|
MediaNotFoundPublic,
|
|
834
|
+
MediaForbiddenPublic,
|
|
752
835
|
MediaUnsupportedPublic,
|
|
753
836
|
MediaStorageFailedPublic,
|
|
754
837
|
MediaEnrichmentFailedPublic,
|
|
838
|
+
MediaAnalyticsWindowPublic,
|
|
839
|
+
MediaAnalyticsUnavailablePublic,
|
|
755
840
|
LeaderboardBoardNotFoundPublic,
|
|
756
841
|
LeaderboardEntryNotFoundPublic,
|
|
757
842
|
LeaderboardScoreRejectedPublic,
|
|
@@ -814,6 +899,8 @@ const KitPublicErrorPayload = z.discriminatedUnion("code", [
|
|
|
814
899
|
PaymentsEntitlementNotInCatalogPublic,
|
|
815
900
|
PaymentsSubjectUnresolvedPublic,
|
|
816
901
|
PaymentsSubscriptionChangeRefusedPublic,
|
|
902
|
+
PaymentsOverrideStalePublic,
|
|
903
|
+
PaymentsQuotaExceededPublic,
|
|
817
904
|
ControlPlaneNotConnectedPublic,
|
|
818
905
|
ControlPlaneInvalidCredentialPublic,
|
|
819
906
|
ControlPlaneInsufficientScopePublic,
|
|
@@ -826,6 +913,11 @@ const KitPublicErrorPayload = z.discriminatedUnion("code", [
|
|
|
826
913
|
OrganizationLastAdministratorPublic,
|
|
827
914
|
OrganizationSlugTakenPublic,
|
|
828
915
|
OrganizationNominationInvalidPublic,
|
|
916
|
+
ArtifactsNotFoundPublic,
|
|
917
|
+
ArtifactsForbiddenPublic,
|
|
918
|
+
ArtifactsInvalidNamePublic,
|
|
919
|
+
ArtifactsNameTakenPublic,
|
|
920
|
+
ArtifactsInvalidConfigPublic,
|
|
829
921
|
SupportNotFoundPublic,
|
|
830
922
|
SupportInvalidCategoryPublic,
|
|
831
923
|
SupportUnparseableMessagePublic,
|
|
@@ -844,6 +936,9 @@ const KitPublicErrorPayload = z.discriminatedUnion("code", [
|
|
|
844
936
|
TestersNotConfiguredPublic
|
|
845
937
|
]).describe("The public shape of every error the kit defines — the closed set, safe for the wire.");
|
|
846
938
|
const InvalidInput = InvalidInputPublic.extend(internalFields).describe(InvalidInputPublic.description ?? "");
|
|
939
|
+
const InputRequired = InputRequiredPublic.extend(internalFields).describe(InputRequiredPublic.description ?? "");
|
|
940
|
+
const PreconditionFailed = PreconditionFailedPublic.extend(internalFields).describe(PreconditionFailedPublic.description ?? "");
|
|
941
|
+
const PersonRequired = PersonRequiredPublic.extend(internalFields).describe(PersonRequiredPublic.description ?? "");
|
|
847
942
|
const InvalidToken = InvalidTokenPublic.extend(internalFields).describe(InvalidTokenPublic.description ?? "");
|
|
848
943
|
const Forbidden = ForbiddenPublic.extend(internalFields).describe(ForbiddenPublic.description ?? "");
|
|
849
944
|
const AuthProviderUnavailable = AuthProviderUnavailablePublic.extend(internalFields).describe(AuthProviderUnavailablePublic.description ?? "");
|
|
@@ -877,12 +972,17 @@ const EmailSendFailed = EmailSendFailedPublic.extend(internalFields).describe(Em
|
|
|
877
972
|
const TurnstileMissingToken = TurnstileMissingTokenPublic.extend(internalFields).describe(TurnstileMissingTokenPublic.description ?? "");
|
|
878
973
|
const TurnstileFailed = TurnstileFailedPublic.extend(internalFields).describe(TurnstileFailedPublic.description ?? "");
|
|
879
974
|
const TurnstileConfig = TurnstileConfigPublic.extend(internalFields).describe(TurnstileConfigPublic.description ?? "");
|
|
975
|
+
const TurnstileAnalyticsWindow = TurnstileAnalyticsWindowPublic.extend(internalFields).describe(TurnstileAnalyticsWindowPublic.description ?? "");
|
|
976
|
+
const TurnstileAnalyticsUnavailable = TurnstileAnalyticsUnavailablePublic.extend(internalFields).describe(TurnstileAnalyticsUnavailablePublic.description ?? "");
|
|
880
977
|
const AuditInvalidEvent = AuditInvalidEventPublic.extend(internalFields).describe(AuditInvalidEventPublic.description ?? "");
|
|
881
978
|
const AuditWriteFailed = AuditWriteFailedPublic.extend(internalFields).describe(AuditWriteFailedPublic.description ?? "");
|
|
882
979
|
const MediaNotFound = MediaNotFoundPublic.extend(internalFields).describe(MediaNotFoundPublic.description ?? "");
|
|
980
|
+
const MediaForbidden = MediaForbiddenPublic.extend(internalFields).describe(MediaForbiddenPublic.description ?? "");
|
|
883
981
|
const MediaUnsupported = MediaUnsupportedPublic.extend(internalFields).describe(MediaUnsupportedPublic.description ?? "");
|
|
884
982
|
const MediaStorageFailed = MediaStorageFailedPublic.extend(internalFields).describe(MediaStorageFailedPublic.description ?? "");
|
|
885
983
|
const MediaEnrichmentFailed = MediaEnrichmentFailedPublic.extend(internalFields).describe(MediaEnrichmentFailedPublic.description ?? "");
|
|
984
|
+
const MediaAnalyticsWindow = MediaAnalyticsWindowPublic.extend(internalFields).describe(MediaAnalyticsWindowPublic.description ?? "");
|
|
985
|
+
const MediaAnalyticsUnavailable = MediaAnalyticsUnavailablePublic.extend(internalFields).describe(MediaAnalyticsUnavailablePublic.description ?? "");
|
|
886
986
|
const LeaderboardBoardNotFound = LeaderboardBoardNotFoundPublic.extend(internalFields).describe(LeaderboardBoardNotFoundPublic.description ?? "");
|
|
887
987
|
const LeaderboardEntryNotFound = LeaderboardEntryNotFoundPublic.extend(internalFields).describe(LeaderboardEntryNotFoundPublic.description ?? "");
|
|
888
988
|
const LeaderboardScoreRejected = LeaderboardScoreRejectedPublic.extend(internalFields).describe(LeaderboardScoreRejectedPublic.description ?? "");
|
|
@@ -945,6 +1045,8 @@ const PaymentsDiscountInvalid = PaymentsDiscountInvalidPublic.extend(internalFie
|
|
|
945
1045
|
const PaymentsEntitlementNotInCatalog = PaymentsEntitlementNotInCatalogPublic.extend(internalFields).describe(PaymentsEntitlementNotInCatalogPublic.description ?? "");
|
|
946
1046
|
const PaymentsSubjectUnresolved = PaymentsSubjectUnresolvedPublic.extend(internalFields).describe(PaymentsSubjectUnresolvedPublic.description ?? "");
|
|
947
1047
|
const PaymentsSubscriptionChangeRefused = PaymentsSubscriptionChangeRefusedPublic.extend(internalFields).describe(PaymentsSubscriptionChangeRefusedPublic.description ?? "");
|
|
1048
|
+
const PaymentsOverrideStale = PaymentsOverrideStalePublic.extend(internalFields).describe(PaymentsOverrideStalePublic.description ?? "");
|
|
1049
|
+
const PaymentsQuotaExceeded = PaymentsQuotaExceededPublic.extend(internalFields).describe(PaymentsQuotaExceededPublic.description ?? "");
|
|
948
1050
|
const ControlPlaneNotConnected = ControlPlaneNotConnectedPublic.extend(internalFields).describe(ControlPlaneNotConnectedPublic.description ?? "");
|
|
949
1051
|
const ControlPlaneInvalidCredential = ControlPlaneInvalidCredentialPublic.extend(internalFields).describe(ControlPlaneInvalidCredentialPublic.description ?? "");
|
|
950
1052
|
const ControlPlaneInsufficientScope = ControlPlaneInsufficientScopePublic.extend(internalFields).describe(ControlPlaneInsufficientScopePublic.description ?? "");
|
|
@@ -967,6 +1069,11 @@ const OrganizationInvitationInvalid = OrganizationInvitationInvalidPublic.extend
|
|
|
967
1069
|
const OrganizationLastAdministrator = OrganizationLastAdministratorPublic.extend(internalFields).describe(OrganizationLastAdministratorPublic.description ?? "");
|
|
968
1070
|
const OrganizationSlugTaken = OrganizationSlugTakenPublic.extend(internalFields).describe(OrganizationSlugTakenPublic.description ?? "");
|
|
969
1071
|
const OrganizationNominationInvalid = OrganizationNominationInvalidPublic.extend(internalFields).describe(OrganizationNominationInvalidPublic.description ?? "");
|
|
1072
|
+
const ArtifactsNotFound = ArtifactsNotFoundPublic.extend(internalFields).describe(ArtifactsNotFoundPublic.description ?? "");
|
|
1073
|
+
const ArtifactsForbidden = ArtifactsForbiddenPublic.extend(internalFields).describe(ArtifactsForbiddenPublic.description ?? "");
|
|
1074
|
+
const ArtifactsInvalidName = ArtifactsInvalidNamePublic.extend(internalFields).describe(ArtifactsInvalidNamePublic.description ?? "");
|
|
1075
|
+
const ArtifactsNameTaken = ArtifactsNameTakenPublic.extend(internalFields).describe(ArtifactsNameTakenPublic.description ?? "");
|
|
1076
|
+
const ArtifactsInvalidConfig = ArtifactsInvalidConfigPublic.extend(internalFields).describe(ArtifactsInvalidConfigPublic.description ?? "");
|
|
970
1077
|
const SupportNotFound = SupportNotFoundPublic.extend(internalFields).describe(SupportNotFoundPublic.description ?? "");
|
|
971
1078
|
const SupportInvalidCategory = SupportInvalidCategoryPublic.extend(internalFields).describe(SupportInvalidCategoryPublic.description ?? "");
|
|
972
1079
|
const SupportUnparseableMessage = SupportUnparseableMessagePublic.extend(internalFields).describe(SupportUnparseableMessagePublic.description ?? "");
|
|
@@ -980,6 +1087,9 @@ const SupportReplyFailed = SupportReplyFailedPublic.extend(internalFields).descr
|
|
|
980
1087
|
*/
|
|
981
1088
|
const KitErrorPayload = z.discriminatedUnion("code", [
|
|
982
1089
|
InvalidInput,
|
|
1090
|
+
InputRequired,
|
|
1091
|
+
PreconditionFailed,
|
|
1092
|
+
PersonRequired,
|
|
983
1093
|
InvalidToken,
|
|
984
1094
|
Forbidden,
|
|
985
1095
|
AuthProviderUnavailable,
|
|
@@ -1013,12 +1123,17 @@ const KitErrorPayload = z.discriminatedUnion("code", [
|
|
|
1013
1123
|
TurnstileMissingToken,
|
|
1014
1124
|
TurnstileFailed,
|
|
1015
1125
|
TurnstileConfig,
|
|
1126
|
+
TurnstileAnalyticsWindow,
|
|
1127
|
+
TurnstileAnalyticsUnavailable,
|
|
1016
1128
|
AuditInvalidEvent,
|
|
1017
1129
|
AuditWriteFailed,
|
|
1018
1130
|
MediaNotFound,
|
|
1131
|
+
MediaForbidden,
|
|
1019
1132
|
MediaUnsupported,
|
|
1020
1133
|
MediaStorageFailed,
|
|
1021
1134
|
MediaEnrichmentFailed,
|
|
1135
|
+
MediaAnalyticsWindow,
|
|
1136
|
+
MediaAnalyticsUnavailable,
|
|
1022
1137
|
LeaderboardBoardNotFound,
|
|
1023
1138
|
LeaderboardEntryNotFound,
|
|
1024
1139
|
LeaderboardScoreRejected,
|
|
@@ -1081,6 +1196,8 @@ const KitErrorPayload = z.discriminatedUnion("code", [
|
|
|
1081
1196
|
PaymentsEntitlementNotInCatalog,
|
|
1082
1197
|
PaymentsSubjectUnresolved,
|
|
1083
1198
|
PaymentsSubscriptionChangeRefused,
|
|
1199
|
+
PaymentsOverrideStale,
|
|
1200
|
+
PaymentsQuotaExceeded,
|
|
1084
1201
|
ControlPlaneNotConnected,
|
|
1085
1202
|
ControlPlaneInvalidCredential,
|
|
1086
1203
|
ControlPlaneInsufficientScope,
|
|
@@ -1093,6 +1210,11 @@ const KitErrorPayload = z.discriminatedUnion("code", [
|
|
|
1093
1210
|
OrganizationLastAdministrator,
|
|
1094
1211
|
OrganizationSlugTaken,
|
|
1095
1212
|
OrganizationNominationInvalid,
|
|
1213
|
+
ArtifactsNotFound,
|
|
1214
|
+
ArtifactsForbidden,
|
|
1215
|
+
ArtifactsInvalidName,
|
|
1216
|
+
ArtifactsNameTaken,
|
|
1217
|
+
ArtifactsInvalidConfig,
|
|
1096
1218
|
SupportNotFound,
|
|
1097
1219
|
SupportInvalidCategory,
|
|
1098
1220
|
SupportUnparseableMessage,
|
|
@@ -44,6 +44,50 @@ export declare class ValidationError extends PithyError {
|
|
|
44
44
|
cause?: unknown;
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* A run that may not prompt reached a question nobody gave it the answer to (#697).
|
|
49
|
+
*
|
|
50
|
+
* `flag` is the flag that answers it, or `null` when no flag can — a person, or a document on stdin, is
|
|
51
|
+
* the only answer. `choices` is every value the flag takes when that set is known, and is left off the
|
|
52
|
+
* payload rather than written empty when it is not: an empty list would claim the flag takes nothing.
|
|
53
|
+
*/
|
|
54
|
+
export declare class InputRequiredError extends PithyError {
|
|
55
|
+
readonly payload: Extract<ErrorPayload, {
|
|
56
|
+
code: "input/required";
|
|
57
|
+
}>;
|
|
58
|
+
constructor(args?: ErrorArgs & {
|
|
59
|
+
flag?: string | null;
|
|
60
|
+
choices?: readonly string[];
|
|
61
|
+
}, options?: {
|
|
62
|
+
cause?: unknown;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The call is well formed, and what it depends on is not there yet (#697): no credentials, an environment
|
|
67
|
+
* nothing has provisioned. A separate class from {@link ValidationError} because the remedy is a step to
|
|
68
|
+
* run first, not a different call — the CLI exits 3 for it and 2 for a validation failure.
|
|
69
|
+
*/
|
|
70
|
+
export declare class PreconditionFailedError extends PithyError {
|
|
71
|
+
readonly payload: Extract<ErrorPayload, {
|
|
72
|
+
code: "core/precondition_failed";
|
|
73
|
+
}>;
|
|
74
|
+
constructor(args?: ErrorArgs, options?: {
|
|
75
|
+
cause?: unknown;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* A step only a person may take (#697): a typed confirmation phrase, or a command that is manual by
|
|
80
|
+
* design. Not {@link InputRequiredError}, which names a flag an automated caller can pass — here no value
|
|
81
|
+
* a caller could choose is the right answer, and the CLI exits 5 so an agent stops and asks.
|
|
82
|
+
*/
|
|
83
|
+
export declare class PersonRequiredError extends PithyError {
|
|
84
|
+
readonly payload: Extract<ErrorPayload, {
|
|
85
|
+
code: "core/person_required";
|
|
86
|
+
}>;
|
|
87
|
+
constructor(args?: ErrorArgs, options?: {
|
|
88
|
+
cause?: unknown;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
47
91
|
export declare class UnauthorizedError extends PithyError {
|
|
48
92
|
readonly payload: Extract<ErrorPayload, {
|
|
49
93
|
code: "auth/invalid_token";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pithyError.d.ts","sourceRoot":"","sources":["../../src/error/pithyError.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC;;;;;;;;GAQG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAE/B,YAAY,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAK/D;CACF;AAED,4FAA4F;AAC5F,UAAU,SAAS;IACjB,mFAAmF;IACnF,O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GjD"}
|
package/dist/error/pithyError.js
CHANGED
|
@@ -33,6 +33,61 @@ var ValidationError = class extends PithyError {
|
|
|
33
33
|
}, options);
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* A run that may not prompt reached a question nobody gave it the answer to (#697).
|
|
38
|
+
*
|
|
39
|
+
* `flag` is the flag that answers it, or `null` when no flag can — a person, or a document on stdin, is
|
|
40
|
+
* the only answer. `choices` is every value the flag takes when that set is known, and is left off the
|
|
41
|
+
* payload rather than written empty when it is not: an empty list would claim the flag takes nothing.
|
|
42
|
+
*/
|
|
43
|
+
var InputRequiredError = class extends PithyError {
|
|
44
|
+
constructor(args = {}, options) {
|
|
45
|
+
super({
|
|
46
|
+
code: "input/required",
|
|
47
|
+
status: 400,
|
|
48
|
+
message: args.message ?? "An answer is required, and this run may not ask for it.",
|
|
49
|
+
action: args.action,
|
|
50
|
+
detail: args.detail,
|
|
51
|
+
params: args.params,
|
|
52
|
+
flag: args.flag ?? null,
|
|
53
|
+
...args.choices === void 0 ? {} : { choices: [...args.choices] }
|
|
54
|
+
}, options);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* The call is well formed, and what it depends on is not there yet (#697): no credentials, an environment
|
|
59
|
+
* nothing has provisioned. A separate class from {@link ValidationError} because the remedy is a step to
|
|
60
|
+
* run first, not a different call — the CLI exits 3 for it and 2 for a validation failure.
|
|
61
|
+
*/
|
|
62
|
+
var PreconditionFailedError = class extends PithyError {
|
|
63
|
+
constructor(args = {}, options) {
|
|
64
|
+
super({
|
|
65
|
+
code: "core/precondition_failed",
|
|
66
|
+
status: 412,
|
|
67
|
+
message: args.message ?? "Something this needs is not set up yet.",
|
|
68
|
+
action: args.action,
|
|
69
|
+
detail: args.detail,
|
|
70
|
+
params: args.params
|
|
71
|
+
}, options);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* A step only a person may take (#697): a typed confirmation phrase, or a command that is manual by
|
|
76
|
+
* design. Not {@link InputRequiredError}, which names a flag an automated caller can pass — here no value
|
|
77
|
+
* a caller could choose is the right answer, and the CLI exits 5 so an agent stops and asks.
|
|
78
|
+
*/
|
|
79
|
+
var PersonRequiredError = class extends PithyError {
|
|
80
|
+
constructor(args = {}, options) {
|
|
81
|
+
super({
|
|
82
|
+
code: "core/person_required",
|
|
83
|
+
status: 403,
|
|
84
|
+
message: args.message ?? "Only a person may take this step.",
|
|
85
|
+
action: args.action,
|
|
86
|
+
detail: args.detail,
|
|
87
|
+
params: args.params
|
|
88
|
+
}, options);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
36
91
|
var UnauthorizedError = class extends PithyError {
|
|
37
92
|
constructor(args = {}, options) {
|
|
38
93
|
super({
|
|
@@ -196,4 +251,4 @@ function sentenceOf(error) {
|
|
|
196
251
|
return action ? `${messageOf(error)} ${action}` : messageOf(error);
|
|
197
252
|
}
|
|
198
253
|
//#endregion
|
|
199
|
-
export { ConflictError, ForbiddenError, InternalError, NotFoundError, PithyError, RateLimitError, UnauthorizedError, UpstreamError, UpstreamTimeoutError, ValidationError, WebhookUnverifiedError, fromZodError, messageOf, sentenceOf };
|
|
254
|
+
export { ConflictError, ForbiddenError, InputRequiredError, InternalError, NotFoundError, PersonRequiredError, PithyError, PreconditionFailedError, RateLimitError, UnauthorizedError, UpstreamError, UpstreamTimeoutError, ValidationError, WebhookUnverifiedError, fromZodError, messageOf, sentenceOf };
|