@whooshbang/contracts 1.0.0-rc.13

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.
Files changed (229) hide show
  1. package/CHANGELOG.md +198 -0
  2. package/LICENSE +21 -0
  3. package/README.md +120 -0
  4. package/contract-manifest.json +390 -0
  5. package/dist/base64url.d.ts +2 -0
  6. package/dist/base64url.js +51 -0
  7. package/dist/base64url.js.map +1 -0
  8. package/dist/generated/artifact-index.d.ts +205 -0
  9. package/dist/generated/artifact-index.js +396 -0
  10. package/dist/generated/artifact-index.js.map +1 -0
  11. package/dist/generated/contract-manifest.d.ts +66 -0
  12. package/dist/generated/contract-manifest.js +6 -0
  13. package/dist/generated/contract-manifest.js.map +1 -0
  14. package/dist/generated/core-scenario.d.ts +18 -0
  15. package/dist/generated/core-scenario.js +6 -0
  16. package/dist/generated/core-scenario.js.map +1 -0
  17. package/dist/generated/fixture-index.d.ts +33 -0
  18. package/dist/generated/fixture-index.js +6 -0
  19. package/dist/generated/fixture-index.js.map +1 -0
  20. package/dist/generated/interaction-machine-scenario.d.ts +263 -0
  21. package/dist/generated/interaction-machine-scenario.js +6 -0
  22. package/dist/generated/interaction-machine-scenario.js.map +1 -0
  23. package/dist/generated/interaction-v1.d.ts +152 -0
  24. package/dist/generated/interaction-v1.js +6 -0
  25. package/dist/generated/interaction-v1.js.map +1 -0
  26. package/dist/generated/machine-v1.d.ts +169 -0
  27. package/dist/generated/machine-v1.js +6 -0
  28. package/dist/generated/machine-v1.js.map +1 -0
  29. package/dist/generated/provider-capabilities-v1.d.ts +78 -0
  30. package/dist/generated/provider-capabilities-v1.js +6 -0
  31. package/dist/generated/provider-capabilities-v1.js.map +1 -0
  32. package/dist/generated/validators-standalone.d.ts +659 -0
  33. package/dist/generated/validators-standalone.js +47800 -0
  34. package/dist/generated/validators-standalone.js.map +1 -0
  35. package/dist/generated/validators.d.ts +74 -0
  36. package/dist/generated/validators.js +493 -0
  37. package/dist/generated/validators.js.map +1 -0
  38. package/dist/generated/webhook-delivery-case-v1.d.ts +91 -0
  39. package/dist/generated/webhook-delivery-case-v1.js +6 -0
  40. package/dist/generated/webhook-delivery-case-v1.js.map +1 -0
  41. package/dist/generated/webhook-signing-vector-v1.d.ts +88 -0
  42. package/dist/generated/webhook-signing-vector-v1.js +6 -0
  43. package/dist/generated/webhook-signing-vector-v1.js.map +1 -0
  44. package/dist/generated/whooshbang-event-v1.d.ts +191 -0
  45. package/dist/generated/whooshbang-event-v1.js +6 -0
  46. package/dist/generated/whooshbang-event-v1.js.map +1 -0
  47. package/dist/generated/whooshbang-v1.d.ts +1162 -0
  48. package/dist/generated/whooshbang-v1.js +6 -0
  49. package/dist/generated/whooshbang-v1.js.map +1 -0
  50. package/dist/index.d.ts +20 -0
  51. package/dist/index.js +7 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/machine-credential.d.ts +31 -0
  54. package/dist/machine-credential.js +78 -0
  55. package/dist/machine-credential.js.map +1 -0
  56. package/dist/webhook-consumer.d.ts +50 -0
  57. package/dist/webhook-consumer.js +71 -0
  58. package/dist/webhook-consumer.js.map +1 -0
  59. package/dist/webhook-delivery.d.ts +46 -0
  60. package/dist/webhook-delivery.js +126 -0
  61. package/dist/webhook-delivery.js.map +1 -0
  62. package/dist/webhook-signature.d.ts +36 -0
  63. package/dist/webhook-signature.js +255 -0
  64. package/dist/webhook-signature.js.map +1 -0
  65. package/examples/python/verify_webhook.py +283 -0
  66. package/fixtures/.gitkeep +1 -0
  67. package/fixtures/core-v1/fixture-index.json +963 -0
  68. package/fixtures/core-v1/problems/auth-invalid.json +9 -0
  69. package/fixtures/core-v1/problems/authentication-required.json +9 -0
  70. package/fixtures/core-v1/problems/cancellation-too-late.json +9 -0
  71. package/fixtures/core-v1/problems/endpoint-rotation-conflict.json +10 -0
  72. package/fixtures/core-v1/problems/environment-mismatch.json +9 -0
  73. package/fixtures/core-v1/problems/idempotency-conflict.json +9 -0
  74. package/fixtures/core-v1/problems/idempotency-key-required.json +9 -0
  75. package/fixtures/core-v1/problems/project-slug-conflict.json +16 -0
  76. package/fixtures/core-v1/problems/provider-outcome-unknown.json +9 -0
  77. package/fixtures/core-v1/problems/provider-retryable.json +10 -0
  78. package/fixtures/core-v1/problems/provider-terminal.json +9 -0
  79. package/fixtures/core-v1/problems/rate-limited.json +10 -0
  80. package/fixtures/core-v1/problems/replay-unavailable-not-terminal.json +16 -0
  81. package/fixtures/core-v1/problems/replay-unavailable-payload.json +16 -0
  82. package/fixtures/core-v1/problems/replay-unavailable-rollout.json +16 -0
  83. package/fixtures/core-v1/problems/request-invalid.json +16 -0
  84. package/fixtures/core-v1/problems/resource-expired.json +9 -0
  85. package/fixtures/core-v1/problems/resource-not-found.json +9 -0
  86. package/fixtures/core-v1/problems/scope-forbidden.json +9 -0
  87. package/fixtures/core-v1/problems/subscriber-unbound.json +9 -0
  88. package/fixtures/core-v1/requests/create-api-credential.json +9 -0
  89. package/fixtures/core-v1/requests/create-customer-endpoint.json +5 -0
  90. package/fixtures/core-v1/requests/create-message.json +15 -0
  91. package/fixtures/core-v1/requests/create-project.json +4 -0
  92. package/fixtures/core-v1/requests/create-subscription-link.json +5 -0
  93. package/fixtures/core-v1/requests/rotate-api-credential.json +3 -0
  94. package/fixtures/core-v1/requests/rotate-customer-endpoint.json +3 -0
  95. package/fixtures/core-v1/scenarios/api-credential-invalid-indistinguishable.json +14 -0
  96. package/fixtures/core-v1/scenarios/api-credential-one-time-reveal.json +21 -0
  97. package/fixtures/core-v1/scenarios/api-credential-revocation-replay.json +17 -0
  98. package/fixtures/core-v1/scenarios/api-credential-rotation-overlap.json +18 -0
  99. package/fixtures/core-v1/scenarios/cancellation-too-late.json +15 -0
  100. package/fixtures/core-v1/scenarios/cross-account-project.json +14 -0
  101. package/fixtures/core-v1/scenarios/cross-project-resource.json +17 -0
  102. package/fixtures/core-v1/scenarios/environment-mismatch.json +17 -0
  103. package/fixtures/core-v1/scenarios/idempotency-conflict.json +35 -0
  104. package/fixtures/core-v1/scenarios/idempotency-equivalent-replay.json +27 -0
  105. package/fixtures/core-v1/scenarios/malformed-bearer.json +14 -0
  106. package/fixtures/core-v1/scenarios/metadata-overrun.json +14 -0
  107. package/fixtures/core-v1/scenarios/missing-scope.json +15 -0
  108. package/fixtures/core-v1/scenarios/project-create-equivalent-replay.json +26 -0
  109. package/fixtures/core-v1/scenarios/project-slug-conflict.json +21 -0
  110. package/fixtures/core-v1/scenarios/provider-outcome-unknown.json +15 -0
  111. package/fixtures/core-v1/scenarios/subscription-activation-replay.json +18 -0
  112. package/fixtures/core-v1/scenarios/subscription-expired-replay.json +16 -0
  113. package/fixtures/core-v1/success/account-projection.json +11 -0
  114. package/fixtures/core-v1/success/api-credential-collection.json +22 -0
  115. package/fixtures/core-v1/success/api-credential-created.json +20 -0
  116. package/fixtures/core-v1/success/api-credential-revoked.json +19 -0
  117. package/fixtures/core-v1/success/api-credential-rotated.json +41 -0
  118. package/fixtures/core-v1/success/customer-endpoint-attempts.json +15 -0
  119. package/fixtures/core-v1/success/customer-endpoint-collection.json +26 -0
  120. package/fixtures/core-v1/success/customer-endpoint-create-replayed.json +16 -0
  121. package/fixtures/core-v1/success/customer-endpoint-created.json +17 -0
  122. package/fixtures/core-v1/success/customer-endpoint-rotated.json +21 -0
  123. package/fixtures/core-v1/success/message-accepted.json +30 -0
  124. package/fixtures/core-v1/success/message-cancellation-too-late.json +27 -0
  125. package/fixtures/core-v1/success/message-cancelled.json +27 -0
  126. package/fixtures/core-v1/success/message-outcome-unknown.json +33 -0
  127. package/fixtures/core-v1/success/message-provider-accepted.json +30 -0
  128. package/fixtures/core-v1/success/project-collection.json +42 -0
  129. package/fixtures/core-v1/success/project-created.json +38 -0
  130. package/fixtures/core-v1/success/subscription-link-activated.json +22 -0
  131. package/fixtures/core-v1/success/subscription-link-cancelled.json +14 -0
  132. package/fixtures/core-v1/success/subscription-link-paused.json +22 -0
  133. package/fixtures/core-v1/success/subscription-link-pending.json +14 -0
  134. package/fixtures/core-v1/success/subscription-link-revoked.json +22 -0
  135. package/fixtures/interaction-machine-v1/capabilities/providers.json +57 -0
  136. package/fixtures/interaction-machine-v1/capabilities/telegram.json +52 -0
  137. package/fixtures/interaction-machine-v1/events/confirm-answered.json +22 -0
  138. package/fixtures/interaction-machine-v1/events/input-answered.json +22 -0
  139. package/fixtures/interaction-machine-v1/events/input-redacted.json +18 -0
  140. package/fixtures/interaction-machine-v1/events/select-answered.json +22 -0
  141. package/fixtures/interaction-machine-v1/requests/ack-processed.json +5 -0
  142. package/fixtures/interaction-machine-v1/requests/ack-quarantined.json +5 -0
  143. package/fixtures/interaction-machine-v1/requests/create-machine-client.json +6 -0
  144. package/fixtures/interaction-machine-v1/requests/create-message-confirm.json +18 -0
  145. package/fixtures/interaction-machine-v1/requests/create-message-input.json +16 -0
  146. package/fixtures/interaction-machine-v1/requests/create-message-select.json +26 -0
  147. package/fixtures/interaction-machine-v1/requests/register-machine-credential.json +4 -0
  148. package/fixtures/interaction-machine-v1/scenarios/ack-conflict.json +14 -0
  149. package/fixtures/interaction-machine-v1/scenarios/ack-cross-machine.json +15 -0
  150. package/fixtures/interaction-machine-v1/scenarios/ack-out-of-order.json +15 -0
  151. package/fixtures/interaction-machine-v1/scenarios/ack-replay.json +17 -0
  152. package/fixtures/interaction-machine-v1/scenarios/ambiguous-free-text.json +15 -0
  153. package/fixtures/interaction-machine-v1/scenarios/callback-token-opacity.json +16 -0
  154. package/fixtures/interaction-machine-v1/scenarios/credential-registration-conflict.json +16 -0
  155. package/fixtures/interaction-machine-v1/scenarios/credential-registration-replay.json +15 -0
  156. package/fixtures/interaction-machine-v1/scenarios/credential-revocation-replay.json +14 -0
  157. package/fixtures/interaction-machine-v1/scenarios/credential-rotation.json +16 -0
  158. package/fixtures/interaction-machine-v1/scenarios/first-credential-activates.json +15 -0
  159. package/fixtures/interaction-machine-v1/scenarios/interaction-duplicate.json +16 -0
  160. package/fixtures/interaction-machine-v1/scenarios/interaction-expired.json +17 -0
  161. package/fixtures/interaction-machine-v1/scenarios/interaction-mismatch.json +16 -0
  162. package/fixtures/interaction-machine-v1/scenarios/interaction-retired.json +16 -0
  163. package/fixtures/interaction-machine-v1/scenarios/interaction-stale.json +16 -0
  164. package/fixtures/interaction-machine-v1/scenarios/machine-admin-denied.json +14 -0
  165. package/fixtures/interaction-machine-v1/scenarios/machine-bound-message-create.json +22 -0
  166. package/fixtures/interaction-machine-v1/scenarios/machine-cancel-denied.json +14 -0
  167. package/fixtures/interaction-machine-v1/scenarios/machine-crash-before-ack.json +16 -0
  168. package/fixtures/interaction-machine-v1/scenarios/machine-notifier-mismatch.json +14 -0
  169. package/fixtures/interaction-machine-v1/scenarios/machine-other-message-read.json +14 -0
  170. package/fixtures/interaction-machine-v1/scenarios/machine-owned-message-read.json +22 -0
  171. package/fixtures/interaction-machine-v1/scenarios/machine-subscriber-mismatch.json +14 -0
  172. package/fixtures/interaction-machine-v1/scenarios/poll-uncommitted-cursor-rejected.json +17 -0
  173. package/fixtures/interaction-machine-v1/scenarios/project-credential-machine-endpoint-denied.json +14 -0
  174. package/fixtures/interaction-machine-v1/scenarios/quarantine-integrity-rejected.json +15 -0
  175. package/fixtures/interaction-machine-v1/scenarios/quarantine-signature-rejected.json +16 -0
  176. package/fixtures/interaction-machine-v1/scenarios/quarantine-valid.json +15 -0
  177. package/fixtures/interaction-machine-v1/scenarios/revoked-machine-credential.json +15 -0
  178. package/fixtures/interaction-machine-v1/success/ack-out-of-order.json +8 -0
  179. package/fixtures/interaction-machine-v1/success/ack-processed.json +8 -0
  180. package/fixtures/interaction-machine-v1/success/ack-quarantined.json +9 -0
  181. package/fixtures/interaction-machine-v1/success/interaction-answered-confirm.json +10 -0
  182. package/fixtures/interaction-machine-v1/success/interaction-answered-input.json +10 -0
  183. package/fixtures/interaction-machine-v1/success/interaction-answered-redacted.json +8 -0
  184. package/fixtures/interaction-machine-v1/success/interaction-answered-select.json +10 -0
  185. package/fixtures/interaction-machine-v1/success/interaction-open.json +7 -0
  186. package/fixtures/interaction-machine-v1/success/machine-client-active.json +20 -0
  187. package/fixtures/interaction-machine-v1/success/machine-client-provisioning.json +19 -0
  188. package/fixtures/interaction-machine-v1/success/machine-client-revoked.json +21 -0
  189. package/fixtures/interaction-machine-v1/success/machine-credential-active.json +13 -0
  190. package/fixtures/interaction-machine-v1/success/machine-credential-revoked.json +14 -0
  191. package/fixtures/interaction-machine-v1/success/message-interaction-open.json +33 -0
  192. package/fixtures/interaction-machine-v1/success/poll-empty.json +6 -0
  193. package/fixtures/interaction-machine-v1/success/poll-events.json +51 -0
  194. package/fixtures/interaction-machine-v1/tokens/callback-token.json +1 -0
  195. package/fixtures/whooshbang-events-v1/delivery/cases.json +418 -0
  196. package/fixtures/whooshbang-events-v1/events/agent-binding-degraded.json +17 -0
  197. package/fixtures/whooshbang-events-v1/events/interaction-expired.json +16 -0
  198. package/fixtures/whooshbang-events-v1/events/interaction-received.json +23 -0
  199. package/fixtures/whooshbang-events-v1/events/message-delivered.json +16 -0
  200. package/fixtures/whooshbang-events-v1/events/message-expired.json +15 -0
  201. package/fixtures/whooshbang-events-v1/events/message-failed.json +17 -0
  202. package/fixtures/whooshbang-events-v1/events/message-provider-accepted.json +15 -0
  203. package/fixtures/whooshbang-events-v1/events/subscription-activated.json +18 -0
  204. package/fixtures/whooshbang-events-v1/events/subscription-revoked.json +18 -0
  205. package/fixtures/whooshbang-events-v1/signing/vectors.json +852 -0
  206. package/openapi/.gitkeep +1 -0
  207. package/openapi/generated/whooshbang-v1.bundle.json +5913 -0
  208. package/openapi/whooshbang-v1.yaml +2334 -0
  209. package/package.json +63 -0
  210. package/schemas/contract-manifest.schema.json +140 -0
  211. package/schemas/core-scenario.schema.json +38 -0
  212. package/schemas/events/agent-binding-degraded-v1.schema.json +8 -0
  213. package/schemas/events/interaction-expired-v1.schema.json +8 -0
  214. package/schemas/events/interaction-received-v1.schema.json +8 -0
  215. package/schemas/events/message-delivered-v1.schema.json +8 -0
  216. package/schemas/events/message-expired-v1.schema.json +8 -0
  217. package/schemas/events/message-failed-v1.schema.json +8 -0
  218. package/schemas/events/message-provider-accepted-v1.schema.json +8 -0
  219. package/schemas/events/subscription-activated-v1.schema.json +8 -0
  220. package/schemas/events/subscription-revoked-v1.schema.json +8 -0
  221. package/schemas/events/whooshbang-event-v1.schema.json +689 -0
  222. package/schemas/fixture-index.schema.json +67 -0
  223. package/schemas/interaction-machine-scenario.schema.json +700 -0
  224. package/schemas/interaction-v1.schema.json +483 -0
  225. package/schemas/machine-v1.schema.json +430 -0
  226. package/schemas/provider-capabilities-v1.schema.json +263 -0
  227. package/schemas/webhooks/webhook-delivery-case-v1.schema.json +167 -0
  228. package/schemas/webhooks/webhook-signing-vector-v1.schema.json +197 -0
  229. package/schemas/whooshbang-v1.schema.json +2173 -0
@@ -0,0 +1,1162 @@
1
+ /**
2
+ * Generated by `npm run contracts:generate`.
3
+ * Do not edit this file directly.
4
+ */
5
+ /**
6
+ * Public request, resource, summary, and Problem Details models for the WhooshBang V1 REST API.
7
+ */
8
+ export type WhooshBangV1ContractDocument = AccountProjection | CreateProjectRequest | Project | ProjectCollection | CreateApiCredentialRequest | RotateApiCredentialRequest | ApiCredential | ApiCredentialCollection | ApiCredentialSecretReveal | ApiCredentialRotation | CreateCustomerEndpointRequest | CustomerEndpoint | CustomerEndpointCollection | CustomerEndpointMutationResult | CustomerEndpointAttemptCollection | CustomerEndpointVerificationChallenge | CreateSubscriptionLinkRequest | SubscriptionLink | CreateMessageRequest | Message | Problem | IdempotencyKey | ProviderCapabilitiesCollection;
9
+ /**
10
+ * An opaque identifier. Its shape, ordering, and embedded content are not public promises.
11
+ */
12
+ export type OpaqueIdentifier = string;
13
+ /**
14
+ * The stable WhooshBang authorization role projected from the current Clerk organization membership.
15
+ */
16
+ export type AccountRole = "admin" | "member";
17
+ /**
18
+ * An RFC 3339 timestamp with a UTC offset. The server is authoritative.
19
+ */
20
+ export type Timestamp = string;
21
+ /**
22
+ * A safe public identifier used to correlate protected service diagnostics.
23
+ */
24
+ export type DiagnosticId = string;
25
+ /**
26
+ * The single environment selected by the authenticated credential.
27
+ */
28
+ export type Environment = "test" | "live";
29
+ /**
30
+ * @minItems 1
31
+ * @maxItems 7
32
+ */
33
+ export type ApiCredentialScopeSet = [ApiCredentialScope] | [ApiCredentialScope, ApiCredentialScope] | [ApiCredentialScope, ApiCredentialScope, ApiCredentialScope] | [
34
+ ApiCredentialScope,
35
+ ApiCredentialScope,
36
+ ApiCredentialScope,
37
+ ApiCredentialScope
38
+ ] | [
39
+ ApiCredentialScope,
40
+ ApiCredentialScope,
41
+ ApiCredentialScope,
42
+ ApiCredentialScope,
43
+ ApiCredentialScope
44
+ ] | [
45
+ ApiCredentialScope,
46
+ ApiCredentialScope,
47
+ ApiCredentialScope,
48
+ ApiCredentialScope,
49
+ ApiCredentialScope,
50
+ ApiCredentialScope
51
+ ] | [
52
+ ApiCredentialScope,
53
+ ApiCredentialScope,
54
+ ApiCredentialScope,
55
+ ApiCredentialScope,
56
+ ApiCredentialScope,
57
+ ApiCredentialScope,
58
+ ApiCredentialScope
59
+ ];
60
+ /**
61
+ * One project-credential capability. Environment authority always comes from the credential record, never a scope or request field.
62
+ */
63
+ export type ApiCredentialScope = "messages:write" | "messages:read" | "subscriptions:write" | "subscriptions:read" | "machine-clients:write" | "machine-clients:read" | "capabilities:read";
64
+ /**
65
+ * Safe environment-scoped API credential metadata. It never contains a bearer secret, digest, Clerk identifier, or digest-key reference.
66
+ */
67
+ export type ApiCredential = {
68
+ [k: string]: unknown;
69
+ } & {
70
+ id: ApiCredentialId;
71
+ project_id: OpaqueIdentifier;
72
+ environment_id: OpaqueIdentifier;
73
+ environment: Environment;
74
+ prefix: ApiCredentialPrefix;
75
+ label: string;
76
+ scopes: ApiCredentialScopeSet;
77
+ /**
78
+ * An opaque identifier. Its shape, ordering, and embedded content are not public promises.
79
+ */
80
+ created_by: string;
81
+ created_at: Timestamp;
82
+ last_used_at?: Timestamp;
83
+ /**
84
+ * An RFC 3339 timestamp with a UTC offset. The server is authoritative.
85
+ */
86
+ scheduled_revocation_at?: string;
87
+ status: "active" | "revoked";
88
+ revoked_at?: Timestamp;
89
+ };
90
+ /**
91
+ * pcred_ followed by the canonical unpadded base64url encoding of exactly 16 random bytes.
92
+ */
93
+ export type ApiCredentialId = string;
94
+ /**
95
+ * A safe display prefix containing the credential format marker and first eight base64url identity characters, never secret bytes.
96
+ */
97
+ export type ApiCredentialPrefix = string;
98
+ /**
99
+ * The exact one-time runtime bearer syntax. The final segment is canonical unpadded base64url for exactly 32 random secret bytes.
100
+ */
101
+ export type ApiCredentialSecret = string;
102
+ export type CustomerEventType = "subscription.activated" | "subscription.revoked" | "message.provider_accepted" | "message.delivered" | "message.failed" | "message.expired" | "interaction.received" | "interaction.expired" | "agent_binding.degraded";
103
+ export type CustomerEndpointStatus = "unverified" | "active" | "paused" | "disabled";
104
+ /**
105
+ * Exactly 32 random bytes in the Standard Webhooks secret format. Returned only by the first successful create or rotate response.
106
+ */
107
+ export type CustomerEndpointSecret = string;
108
+ /**
109
+ * The only channel accepted during C0. The vocabulary can grow additively.
110
+ */
111
+ export type Channel = "telegram";
112
+ /**
113
+ * A public subscription-link resource scoped to the authenticated project and environment.
114
+ */
115
+ export type SubscriptionLink = {
116
+ [k: string]: unknown;
117
+ } & {
118
+ id: OpaqueIdentifier;
119
+ project_id: OpaqueIdentifier;
120
+ environment: Environment;
121
+ subscriber_id: OpaqueIdentifier;
122
+ notifier_id: OpaqueIdentifier;
123
+ /**
124
+ * @minItems 1
125
+ * @maxItems 1
126
+ */
127
+ channels: [Channel];
128
+ status: "pending" | "activated" | "expired" | "cancelled" | "failed" | "revoked";
129
+ /**
130
+ * An opaque authorization URL. It contains no project or provider secret.
131
+ */
132
+ authorization_url?: string;
133
+ binding?: BindingSummary;
134
+ created_at: Timestamp;
135
+ updated_at: Timestamp;
136
+ expires_at: Timestamp;
137
+ diagnostic_id: DiagnosticId;
138
+ classified_error?: ClassifiedError;
139
+ /**
140
+ * Present on cancellation responses; false never claims provider-side deletion.
141
+ */
142
+ cancellation_effective?: boolean;
143
+ };
144
+ export type ProblemCode = "authentication_required" | "credential_invalid" | "scope_forbidden" | "environment_mismatch" | "idempotency_key_required" | "idempotency_conflict" | "project_slug_conflict" | "request_invalid" | "replay_unavailable" | "subscriber_unbound" | "resource_not_found" | "resource_expired" | "cancellation_too_late" | "endpoint_rotation_conflict" | "rate_limited" | "provider_retryable" | "provider_terminal" | "provider_outcome_unknown";
145
+ export type MetadataValue = string | number | boolean | null;
146
+ /**
147
+ * A project- and environment-scoped logical message and its highest proven delivery outcome.
148
+ */
149
+ export type Message = {
150
+ [k: string]: unknown;
151
+ } & {
152
+ id: OpaqueIdentifier;
153
+ project_id: OpaqueIdentifier;
154
+ environment: Environment;
155
+ subscriber_id: OpaqueIdentifier;
156
+ notifier_id: OpaqueIdentifier;
157
+ binding: BindingSummary;
158
+ state: MessageState;
159
+ accepted_at: Timestamp;
160
+ updated_at: Timestamp;
161
+ expires_at: Timestamp;
162
+ delivery: DeliveryAttemptSummary;
163
+ diagnostic_id: DiagnosticId;
164
+ correlation_id?: string;
165
+ metadata?: Metadata;
166
+ interaction?: InteractionSummary;
167
+ /**
168
+ * Present on cancellation responses. False means the provider call was already owned and no deletion is claimed.
169
+ */
170
+ cancellation_effective?: boolean;
171
+ outcome_guidance?: "Delivery may have been accepted by the provider. No automatic retry is scheduled; create a new message explicitly if another attempt is appropriate.";
172
+ };
173
+ export type MessageState = "accepted" | "dispatch_pending" | "queued" | "sending" | "provider_accepted" | "retry_wait" | "terminal_failed" | "outcome_unknown" | "cancelled" | "expired";
174
+ /**
175
+ * A safe aggregate of delivery attempts. Protected provider responses are excluded.
176
+ */
177
+ export type DeliveryAttemptSummary = {
178
+ [k: string]: unknown;
179
+ } & {
180
+ attempt_count: number;
181
+ highest_proven_provider_state: HighestProvenProviderState;
182
+ retry_scheduled: boolean;
183
+ retry_at?: Timestamp;
184
+ classified_error?: ClassifiedError;
185
+ };
186
+ /**
187
+ * The strongest provider assertion the service can prove; it is not an end-device delivery receipt.
188
+ */
189
+ export type HighestProvenProviderState = "none" | "provider_accepted";
190
+ /**
191
+ * The hosted interaction identity and first-terminal-writer state.
192
+ */
193
+ export type InteractionSummary = {
194
+ [k: string]: unknown;
195
+ } & {
196
+ /**
197
+ * An opaque identifier whose internal encoding is not a public promise.
198
+ */
199
+ id: string;
200
+ type: "confirm" | "select" | "input";
201
+ state: "open" | "answered" | "expired" | "cancelled" | "retired";
202
+ expires_at: string;
203
+ /**
204
+ * Caller-owned opaque correlation returned as data, never treated as execution authority.
205
+ */
206
+ correlation_id?: string;
207
+ answered_at?: string;
208
+ /**
209
+ * Whether the typed answer remains available inside its content-retention window. False preserves the answered terminal fact after answer deletion.
210
+ */
211
+ answer_retained?: boolean;
212
+ answer?: boolean | string;
213
+ };
214
+ /**
215
+ * Safe RFC 9457-style Problem Details for the WhooshBang API.
216
+ */
217
+ export type Problem = {
218
+ [k: string]: unknown;
219
+ } & {
220
+ type: string;
221
+ title: string;
222
+ status: number;
223
+ detail: string;
224
+ code: ProblemCode;
225
+ diagnostic_id: DiagnosticId;
226
+ retryable: boolean;
227
+ retry_at?: Timestamp;
228
+ /**
229
+ * @maxItems 20
230
+ */
231
+ field_errors?: [] | [ProblemFieldError] | [ProblemFieldError, ProblemFieldError] | [ProblemFieldError, ProblemFieldError, ProblemFieldError] | [
232
+ ProblemFieldError,
233
+ ProblemFieldError,
234
+ ProblemFieldError,
235
+ ProblemFieldError
236
+ ] | [
237
+ ProblemFieldError,
238
+ ProblemFieldError,
239
+ ProblemFieldError,
240
+ ProblemFieldError,
241
+ ProblemFieldError
242
+ ] | [
243
+ ProblemFieldError,
244
+ ProblemFieldError,
245
+ ProblemFieldError,
246
+ ProblemFieldError,
247
+ ProblemFieldError,
248
+ ProblemFieldError
249
+ ] | [
250
+ ProblemFieldError,
251
+ ProblemFieldError,
252
+ ProblemFieldError,
253
+ ProblemFieldError,
254
+ ProblemFieldError,
255
+ ProblemFieldError,
256
+ ProblemFieldError
257
+ ] | [
258
+ ProblemFieldError,
259
+ ProblemFieldError,
260
+ ProblemFieldError,
261
+ ProblemFieldError,
262
+ ProblemFieldError,
263
+ ProblemFieldError,
264
+ ProblemFieldError,
265
+ ProblemFieldError
266
+ ] | [
267
+ ProblemFieldError,
268
+ ProblemFieldError,
269
+ ProblemFieldError,
270
+ ProblemFieldError,
271
+ ProblemFieldError,
272
+ ProblemFieldError,
273
+ ProblemFieldError,
274
+ ProblemFieldError,
275
+ ProblemFieldError
276
+ ] | [
277
+ ProblemFieldError,
278
+ ProblemFieldError,
279
+ ProblemFieldError,
280
+ ProblemFieldError,
281
+ ProblemFieldError,
282
+ ProblemFieldError,
283
+ ProblemFieldError,
284
+ ProblemFieldError,
285
+ ProblemFieldError,
286
+ ProblemFieldError
287
+ ] | [
288
+ ProblemFieldError,
289
+ ProblemFieldError,
290
+ ProblemFieldError,
291
+ ProblemFieldError,
292
+ ProblemFieldError,
293
+ ProblemFieldError,
294
+ ProblemFieldError,
295
+ ProblemFieldError,
296
+ ProblemFieldError,
297
+ ProblemFieldError,
298
+ ProblemFieldError
299
+ ] | [
300
+ ProblemFieldError,
301
+ ProblemFieldError,
302
+ ProblemFieldError,
303
+ ProblemFieldError,
304
+ ProblemFieldError,
305
+ ProblemFieldError,
306
+ ProblemFieldError,
307
+ ProblemFieldError,
308
+ ProblemFieldError,
309
+ ProblemFieldError,
310
+ ProblemFieldError,
311
+ ProblemFieldError
312
+ ] | [
313
+ ProblemFieldError,
314
+ ProblemFieldError,
315
+ ProblemFieldError,
316
+ ProblemFieldError,
317
+ ProblemFieldError,
318
+ ProblemFieldError,
319
+ ProblemFieldError,
320
+ ProblemFieldError,
321
+ ProblemFieldError,
322
+ ProblemFieldError,
323
+ ProblemFieldError,
324
+ ProblemFieldError,
325
+ ProblemFieldError
326
+ ] | [
327
+ ProblemFieldError,
328
+ ProblemFieldError,
329
+ ProblemFieldError,
330
+ ProblemFieldError,
331
+ ProblemFieldError,
332
+ ProblemFieldError,
333
+ ProblemFieldError,
334
+ ProblemFieldError,
335
+ ProblemFieldError,
336
+ ProblemFieldError,
337
+ ProblemFieldError,
338
+ ProblemFieldError,
339
+ ProblemFieldError,
340
+ ProblemFieldError
341
+ ] | [
342
+ ProblemFieldError,
343
+ ProblemFieldError,
344
+ ProblemFieldError,
345
+ ProblemFieldError,
346
+ ProblemFieldError,
347
+ ProblemFieldError,
348
+ ProblemFieldError,
349
+ ProblemFieldError,
350
+ ProblemFieldError,
351
+ ProblemFieldError,
352
+ ProblemFieldError,
353
+ ProblemFieldError,
354
+ ProblemFieldError,
355
+ ProblemFieldError,
356
+ ProblemFieldError
357
+ ] | [
358
+ ProblemFieldError,
359
+ ProblemFieldError,
360
+ ProblemFieldError,
361
+ ProblemFieldError,
362
+ ProblemFieldError,
363
+ ProblemFieldError,
364
+ ProblemFieldError,
365
+ ProblemFieldError,
366
+ ProblemFieldError,
367
+ ProblemFieldError,
368
+ ProblemFieldError,
369
+ ProblemFieldError,
370
+ ProblemFieldError,
371
+ ProblemFieldError,
372
+ ProblemFieldError,
373
+ ProblemFieldError
374
+ ] | [
375
+ ProblemFieldError,
376
+ ProblemFieldError,
377
+ ProblemFieldError,
378
+ ProblemFieldError,
379
+ ProblemFieldError,
380
+ ProblemFieldError,
381
+ ProblemFieldError,
382
+ ProblemFieldError,
383
+ ProblemFieldError,
384
+ ProblemFieldError,
385
+ ProblemFieldError,
386
+ ProblemFieldError,
387
+ ProblemFieldError,
388
+ ProblemFieldError,
389
+ ProblemFieldError,
390
+ ProblemFieldError,
391
+ ProblemFieldError
392
+ ] | [
393
+ ProblemFieldError,
394
+ ProblemFieldError,
395
+ ProblemFieldError,
396
+ ProblemFieldError,
397
+ ProblemFieldError,
398
+ ProblemFieldError,
399
+ ProblemFieldError,
400
+ ProblemFieldError,
401
+ ProblemFieldError,
402
+ ProblemFieldError,
403
+ ProblemFieldError,
404
+ ProblemFieldError,
405
+ ProblemFieldError,
406
+ ProblemFieldError,
407
+ ProblemFieldError,
408
+ ProblemFieldError,
409
+ ProblemFieldError,
410
+ ProblemFieldError
411
+ ] | [
412
+ ProblemFieldError,
413
+ ProblemFieldError,
414
+ ProblemFieldError,
415
+ ProblemFieldError,
416
+ ProblemFieldError,
417
+ ProblemFieldError,
418
+ ProblemFieldError,
419
+ ProblemFieldError,
420
+ ProblemFieldError,
421
+ ProblemFieldError,
422
+ ProblemFieldError,
423
+ ProblemFieldError,
424
+ ProblemFieldError,
425
+ ProblemFieldError,
426
+ ProblemFieldError,
427
+ ProblemFieldError,
428
+ ProblemFieldError,
429
+ ProblemFieldError,
430
+ ProblemFieldError
431
+ ] | [
432
+ ProblemFieldError,
433
+ ProblemFieldError,
434
+ ProblemFieldError,
435
+ ProblemFieldError,
436
+ ProblemFieldError,
437
+ ProblemFieldError,
438
+ ProblemFieldError,
439
+ ProblemFieldError,
440
+ ProblemFieldError,
441
+ ProblemFieldError,
442
+ ProblemFieldError,
443
+ ProblemFieldError,
444
+ ProblemFieldError,
445
+ ProblemFieldError,
446
+ ProblemFieldError,
447
+ ProblemFieldError,
448
+ ProblemFieldError,
449
+ ProblemFieldError,
450
+ ProblemFieldError,
451
+ ProblemFieldError
452
+ ];
453
+ } & Problem1;
454
+ export type Problem1 = {
455
+ type?: "https://whooshbang.flowxo.com/problems/authentication_required";
456
+ title?: "Authentication required";
457
+ status?: 401;
458
+ code?: "authentication_required";
459
+ retryable?: false;
460
+ [k: string]: unknown;
461
+ } | {
462
+ type?: "https://whooshbang.flowxo.com/problems/replay_unavailable";
463
+ title?: "Replay unavailable";
464
+ status?: 409;
465
+ code?: "replay_unavailable";
466
+ retryable?: false;
467
+ [k: string]: unknown;
468
+ } | {
469
+ type?: "https://whooshbang.flowxo.com/problems/endpoint_rotation_conflict";
470
+ title?: "Endpoint rotation conflict";
471
+ status?: 409;
472
+ code?: "endpoint_rotation_conflict";
473
+ retryable?: true;
474
+ [k: string]: unknown;
475
+ } | {
476
+ type?: "https://whooshbang.flowxo.com/problems/project_slug_conflict";
477
+ title?: "Project slug conflict";
478
+ status?: 409;
479
+ code?: "project_slug_conflict";
480
+ retryable?: false;
481
+ [k: string]: unknown;
482
+ } | {
483
+ type?: "https://whooshbang.flowxo.com/problems/credential_invalid";
484
+ title?: "Credential invalid";
485
+ status?: 401;
486
+ code?: "credential_invalid";
487
+ retryable?: false;
488
+ [k: string]: unknown;
489
+ } | {
490
+ type?: "https://whooshbang.flowxo.com/problems/scope_forbidden";
491
+ title?: "Scope forbidden";
492
+ status?: 403;
493
+ code?: "scope_forbidden";
494
+ retryable?: false;
495
+ [k: string]: unknown;
496
+ } | {
497
+ type?: "https://whooshbang.flowxo.com/problems/environment_mismatch";
498
+ title?: "Environment mismatch";
499
+ status?: 403;
500
+ code?: "environment_mismatch";
501
+ retryable?: false;
502
+ [k: string]: unknown;
503
+ } | {
504
+ type?: "https://whooshbang.flowxo.com/problems/idempotency_key_required";
505
+ title?: "Idempotency key required";
506
+ status?: 400;
507
+ code?: "idempotency_key_required";
508
+ retryable?: false;
509
+ [k: string]: unknown;
510
+ } | {
511
+ type?: "https://whooshbang.flowxo.com/problems/idempotency_conflict";
512
+ title?: "Idempotency conflict";
513
+ status?: 409;
514
+ code?: "idempotency_conflict";
515
+ retryable?: false;
516
+ [k: string]: unknown;
517
+ } | {
518
+ type?: "https://whooshbang.flowxo.com/problems/request_invalid";
519
+ title?: "Request invalid";
520
+ status?: 400;
521
+ code?: "request_invalid";
522
+ retryable?: false;
523
+ [k: string]: unknown;
524
+ } | {
525
+ type?: "https://whooshbang.flowxo.com/problems/subscriber_unbound";
526
+ title?: "Subscriber unbound";
527
+ status?: 422;
528
+ code?: "subscriber_unbound";
529
+ retryable?: false;
530
+ [k: string]: unknown;
531
+ } | {
532
+ type?: "https://whooshbang.flowxo.com/problems/resource_not_found";
533
+ title?: "Resource not found";
534
+ status?: 404;
535
+ code?: "resource_not_found";
536
+ retryable?: false;
537
+ [k: string]: unknown;
538
+ } | {
539
+ type?: "https://whooshbang.flowxo.com/problems/resource_expired";
540
+ title?: "Resource expired";
541
+ status?: 404;
542
+ code?: "resource_expired";
543
+ retryable?: false;
544
+ [k: string]: unknown;
545
+ } | {
546
+ type?: "https://whooshbang.flowxo.com/problems/cancellation_too_late";
547
+ title?: "Cancellation too late";
548
+ status?: 409;
549
+ code?: "cancellation_too_late";
550
+ retryable?: false;
551
+ [k: string]: unknown;
552
+ } | {
553
+ type?: "https://whooshbang.flowxo.com/problems/rate_limited";
554
+ title?: "Rate limited";
555
+ status?: 429;
556
+ code?: "rate_limited";
557
+ retryable?: true;
558
+ [k: string]: unknown;
559
+ } | {
560
+ type?: "https://whooshbang.flowxo.com/problems/provider_retryable";
561
+ title?: "Provider retryable failure";
562
+ status?: 503;
563
+ code?: "provider_retryable";
564
+ retryable?: true;
565
+ [k: string]: unknown;
566
+ } | {
567
+ type?: "https://whooshbang.flowxo.com/problems/provider_terminal";
568
+ title?: "Provider terminal failure";
569
+ status?: 502;
570
+ code?: "provider_terminal";
571
+ retryable?: false;
572
+ [k: string]: unknown;
573
+ } | {
574
+ type?: "https://whooshbang.flowxo.com/problems/provider_outcome_unknown";
575
+ title?: "Provider outcome unknown";
576
+ status?: 502;
577
+ code?: "provider_outcome_unknown";
578
+ retryable?: false;
579
+ [k: string]: unknown;
580
+ };
581
+ /**
582
+ * Visible ASCII, scoped by authenticated environment, operation ID, and key, and retained for seven days from first acceptance.
583
+ */
584
+ export type IdempotencyKey = string;
585
+ /**
586
+ * This interface was referenced by `ProviderCapabilitiesV1`'s JSON-Schema
587
+ * via the `definition` "InteractionCapability".
588
+ */
589
+ export type InteractionCapability = {
590
+ [k: string]: unknown;
591
+ } & {
592
+ mode: "native" | "fallback" | "unsupported" | "conditional";
593
+ /**
594
+ * This interface was referenced by `ProviderCapabilitiesV1`'s JSON-Schema
595
+ * via the `definition` "SafeExplanation".
596
+ */
597
+ explanation?: string;
598
+ } & {
599
+ mode: "native" | "fallback" | "unsupported" | "conditional";
600
+ /**
601
+ * This interface was referenced by `ProviderCapabilitiesV1`'s JSON-Schema
602
+ * via the `definition` "SafeExplanation".
603
+ */
604
+ explanation?: string;
605
+ } & {
606
+ mode: "native" | "fallback" | "unsupported" | "conditional";
607
+ /**
608
+ * This interface was referenced by `ProviderCapabilitiesV1`'s JSON-Schema
609
+ * via the `definition` "SafeExplanation".
610
+ */
611
+ explanation?: string;
612
+ } & {
613
+ mode: "native" | "fallback" | "unsupported" | "conditional";
614
+ /**
615
+ * This interface was referenced by `ProviderCapabilitiesV1`'s JSON-Schema
616
+ * via the `definition` "SafeExplanation".
617
+ */
618
+ explanation?: string;
619
+ };
620
+ /**
621
+ * This interface was referenced by `ProviderCapabilitiesV1`'s JSON-Schema
622
+ * via the `definition` "ContextSupport".
623
+ */
624
+ export type ContextSupport = {
625
+ [k: string]: unknown;
626
+ } & {
627
+ mode: "supported" | "unsupported" | "conditional";
628
+ /**
629
+ * This interface was referenced by `ProviderCapabilitiesV1`'s JSON-Schema
630
+ * via the `definition` "SafeExplanation".
631
+ */
632
+ explanation?: string;
633
+ } & {
634
+ mode: "supported" | "unsupported" | "conditional";
635
+ /**
636
+ * This interface was referenced by `ProviderCapabilitiesV1`'s JSON-Schema
637
+ * via the `definition` "SafeExplanation".
638
+ */
639
+ explanation?: string;
640
+ } & {
641
+ mode: "supported" | "unsupported" | "conditional";
642
+ /**
643
+ * This interface was referenced by `ProviderCapabilitiesV1`'s JSON-Schema
644
+ * via the `definition` "SafeExplanation".
645
+ */
646
+ explanation?: string;
647
+ } & {
648
+ mode: "supported" | "unsupported" | "conditional";
649
+ /**
650
+ * This interface was referenced by `ProviderCapabilitiesV1`'s JSON-Schema
651
+ * via the `definition` "SafeExplanation".
652
+ */
653
+ explanation?: string;
654
+ };
655
+ /**
656
+ * This interface was referenced by `ProviderCapabilitiesV1`'s JSON-Schema
657
+ * via the `definition` "Degradation".
658
+ */
659
+ export type Degradation = {
660
+ [k: string]: unknown;
661
+ } & {
662
+ active: boolean;
663
+ code?: string;
664
+ /**
665
+ * This interface was referenced by `ProviderCapabilitiesV1`'s JSON-Schema
666
+ * via the `definition` "SafeExplanation".
667
+ */
668
+ explanation?: string;
669
+ } & {
670
+ active: boolean;
671
+ code?: string;
672
+ /**
673
+ * This interface was referenced by `ProviderCapabilitiesV1`'s JSON-Schema
674
+ * via the `definition` "SafeExplanation".
675
+ */
676
+ explanation?: string;
677
+ };
678
+ /**
679
+ * The current Clerk organization projected as a WhooshBang tenant. Clerk organization and user identifiers are not public fields.
680
+ */
681
+ export interface AccountProjection {
682
+ id: OpaqueIdentifier;
683
+ name: string;
684
+ status: "active" | "suspended";
685
+ membership: AccountMembershipSummary;
686
+ created_at: Timestamp;
687
+ updated_at: Timestamp;
688
+ diagnostic_id: DiagnosticId;
689
+ }
690
+ export interface AccountMembershipSummary {
691
+ role: AccountRole;
692
+ }
693
+ /**
694
+ * Creates one project inside the account selected by the authenticated human session.
695
+ */
696
+ export interface CreateProjectRequest {
697
+ name: string;
698
+ slug: string;
699
+ }
700
+ /**
701
+ * An account-scoped application project with its complete test/live bootstrap.
702
+ */
703
+ export interface Project {
704
+ id: OpaqueIdentifier;
705
+ account_id: OpaqueIdentifier;
706
+ name: string;
707
+ slug: string;
708
+ status: "active" | "disabled";
709
+ /**
710
+ * @minItems 2
711
+ * @maxItems 2
712
+ */
713
+ environments: [ProjectEnvironment, ProjectEnvironment];
714
+ created_at: Timestamp;
715
+ updated_at: Timestamp;
716
+ diagnostic_id: DiagnosticId;
717
+ }
718
+ /**
719
+ * A test or live project environment with its transactionally created default notifier.
720
+ */
721
+ export interface ProjectEnvironment {
722
+ id: OpaqueIdentifier;
723
+ project_id: OpaqueIdentifier;
724
+ kind: Environment;
725
+ status: "active" | "disabled";
726
+ default_notifier: DefaultNotifierSummary;
727
+ }
728
+ /**
729
+ * The default notifier created transactionally with one project environment.
730
+ */
731
+ export interface DefaultNotifierSummary {
732
+ id: OpaqueIdentifier;
733
+ environment_id: OpaqueIdentifier;
734
+ display_name: "Default";
735
+ status: "active" | "disabled";
736
+ is_default: true;
737
+ }
738
+ /**
739
+ * A stable page of projects inside the authenticated account.
740
+ */
741
+ export interface ProjectCollection {
742
+ /**
743
+ * @maxItems 100
744
+ */
745
+ items: Project[];
746
+ next_cursor?: string;
747
+ }
748
+ /**
749
+ * Creates one credential inside the project environment selected by the authenticated administration path.
750
+ */
751
+ export interface CreateApiCredentialRequest {
752
+ label: string;
753
+ scopes: ApiCredentialScopeSet;
754
+ }
755
+ /**
756
+ * Creates a replacement with the same label and scopes and schedules terminal revocation of the replaced credential after the declared overlap.
757
+ */
758
+ export interface RotateApiCredentialRequest {
759
+ overlap_seconds: number;
760
+ }
761
+ /**
762
+ * A stable page of safe credential metadata in one project environment.
763
+ */
764
+ export interface ApiCredentialCollection {
765
+ /**
766
+ * @maxItems 100
767
+ */
768
+ items: ApiCredential[];
769
+ next_cursor?: string;
770
+ }
771
+ /**
772
+ * The creation-only response. The secret is emitted in this response exactly once and is never available from list, rotate-target, revoke, or later read responses.
773
+ */
774
+ export interface ApiCredentialSecretReveal {
775
+ credential: ApiCredential;
776
+ secret: ApiCredentialSecret;
777
+ }
778
+ /**
779
+ * A creation-only replacement secret plus safe metadata for the credential it replaces.
780
+ */
781
+ export interface ApiCredentialRotation {
782
+ credential: ApiCredentialSecretReveal;
783
+ replaced_credential: ApiCredential;
784
+ }
785
+ /**
786
+ * Creates one project/environment endpoint. The service validates the final normalized destination and never returns it from health or diagnostic reads.
787
+ */
788
+ export interface CreateCustomerEndpointRequest {
789
+ url: string;
790
+ /**
791
+ * @minItems 1
792
+ * @maxItems 9
793
+ */
794
+ event_types: [CustomerEventType] | [CustomerEventType, CustomerEventType] | [CustomerEventType, CustomerEventType, CustomerEventType] | [
795
+ CustomerEventType,
796
+ CustomerEventType,
797
+ CustomerEventType,
798
+ CustomerEventType
799
+ ] | [
800
+ CustomerEventType,
801
+ CustomerEventType,
802
+ CustomerEventType,
803
+ CustomerEventType,
804
+ CustomerEventType
805
+ ] | [
806
+ CustomerEventType,
807
+ CustomerEventType,
808
+ CustomerEventType,
809
+ CustomerEventType,
810
+ CustomerEventType,
811
+ CustomerEventType
812
+ ] | [
813
+ CustomerEventType,
814
+ CustomerEventType,
815
+ CustomerEventType,
816
+ CustomerEventType,
817
+ CustomerEventType,
818
+ CustomerEventType,
819
+ CustomerEventType
820
+ ] | [
821
+ CustomerEventType,
822
+ CustomerEventType,
823
+ CustomerEventType,
824
+ CustomerEventType,
825
+ CustomerEventType,
826
+ CustomerEventType,
827
+ CustomerEventType,
828
+ CustomerEventType
829
+ ] | [
830
+ CustomerEventType,
831
+ CustomerEventType,
832
+ CustomerEventType,
833
+ CustomerEventType,
834
+ CustomerEventType,
835
+ CustomerEventType,
836
+ CustomerEventType,
837
+ CustomerEventType,
838
+ CustomerEventType
839
+ ];
840
+ /**
841
+ * Explicit local-tooling marker. Production deployments reject true even though local test tooling accepts loopback HTTP before persistence.
842
+ */
843
+ local_test?: boolean;
844
+ }
845
+ /**
846
+ * Safe endpoint lifecycle and health metadata. URL, signing material, event bodies, answers, and response bodies are structurally absent.
847
+ */
848
+ export interface CustomerEndpoint {
849
+ id: OpaqueIdentifier;
850
+ project_id: OpaqueIdentifier;
851
+ environment_id: OpaqueIdentifier;
852
+ environment: Environment;
853
+ status: CustomerEndpointStatus;
854
+ verification_status: "pending" | "failed" | "verified";
855
+ /**
856
+ * @minItems 1
857
+ * @maxItems 9
858
+ */
859
+ event_types: [CustomerEventType] | [CustomerEventType, CustomerEventType] | [CustomerEventType, CustomerEventType, CustomerEventType] | [
860
+ CustomerEventType,
861
+ CustomerEventType,
862
+ CustomerEventType,
863
+ CustomerEventType
864
+ ] | [
865
+ CustomerEventType,
866
+ CustomerEventType,
867
+ CustomerEventType,
868
+ CustomerEventType,
869
+ CustomerEventType
870
+ ] | [
871
+ CustomerEventType,
872
+ CustomerEventType,
873
+ CustomerEventType,
874
+ CustomerEventType,
875
+ CustomerEventType,
876
+ CustomerEventType
877
+ ] | [
878
+ CustomerEventType,
879
+ CustomerEventType,
880
+ CustomerEventType,
881
+ CustomerEventType,
882
+ CustomerEventType,
883
+ CustomerEventType,
884
+ CustomerEventType
885
+ ] | [
886
+ CustomerEventType,
887
+ CustomerEventType,
888
+ CustomerEventType,
889
+ CustomerEventType,
890
+ CustomerEventType,
891
+ CustomerEventType,
892
+ CustomerEventType,
893
+ CustomerEventType
894
+ ] | [
895
+ CustomerEventType,
896
+ CustomerEventType,
897
+ CustomerEventType,
898
+ CustomerEventType,
899
+ CustomerEventType,
900
+ CustomerEventType,
901
+ CustomerEventType,
902
+ CustomerEventType,
903
+ CustomerEventType
904
+ ];
905
+ secret_version: number;
906
+ health: "never_delivered" | "healthy" | "failing";
907
+ created_at: Timestamp;
908
+ updated_at: Timestamp;
909
+ verification_attempted_at?: Timestamp;
910
+ verified_at?: Timestamp;
911
+ rotated_at?: Timestamp;
912
+ paused_at?: Timestamp;
913
+ disabled_at?: Timestamp;
914
+ last_success_at?: Timestamp;
915
+ last_failure?: CustomerEndpointFailure;
916
+ diagnostic_id: DiagnosticId;
917
+ }
918
+ export interface CustomerEndpointFailure {
919
+ at: Timestamp;
920
+ category: string;
921
+ }
922
+ export interface CustomerEndpointCollection {
923
+ /**
924
+ * @maxItems 100
925
+ */
926
+ items: CustomerEndpoint[];
927
+ }
928
+ /**
929
+ * The initial create/rotate result includes secret. An equivalent idempotent replay returns the same logical endpoint without revealing the secret again.
930
+ */
931
+ export interface CustomerEndpointMutationResult {
932
+ endpoint: CustomerEndpoint;
933
+ secret?: CustomerEndpointSecret;
934
+ }
935
+ export interface CustomerEndpointAttemptCollection {
936
+ endpoint_id: OpaqueIdentifier;
937
+ /**
938
+ * @maxItems 100
939
+ */
940
+ attempts: CustomerEndpointAttemptDiagnostic[];
941
+ }
942
+ /**
943
+ * Content-free per-attempt timing and failure classification.
944
+ */
945
+ export interface CustomerEndpointAttemptDiagnostic {
946
+ id: OpaqueIdentifier;
947
+ event_id: OpaqueIdentifier;
948
+ attempt: number;
949
+ status: "pending" | "attempting" | "delivered" | "retry_wait" | "terminal_failed" | "paused";
950
+ diagnostic_code?: string;
951
+ http_status?: number;
952
+ started_at?: Timestamp;
953
+ completed_at?: Timestamp;
954
+ created_at: Timestamp;
955
+ }
956
+ /**
957
+ * Exact signed request bytes. A verifier echoes these exact bytes with valid webhook headers to prove it possesses the endpoint secret.
958
+ */
959
+ export interface CustomerEndpointVerificationChallenge {
960
+ schema: "whooshbang.endpoint-verification.v1";
961
+ endpoint_id: OpaqueIdentifier;
962
+ challenge: string;
963
+ }
964
+ /**
965
+ * Creates one project- and environment-scoped, single-use authorization link.
966
+ */
967
+ export interface CreateSubscriptionLinkRequest {
968
+ subscriber_id: OpaqueIdentifier;
969
+ notifier_id?: OpaqueIdentifier;
970
+ /**
971
+ * @minItems 1
972
+ * @maxItems 1
973
+ */
974
+ channels: [Channel];
975
+ /**
976
+ * Untrusted redirect input. HTTPS is required outside synthetic .test fixtures; the service never fetches this URL.
977
+ */
978
+ return_url?: string;
979
+ expires_in_seconds?: number;
980
+ }
981
+ /**
982
+ * A safe channel binding identity. Raw Telegram chat and user identifiers are never exposed.
983
+ */
984
+ export interface BindingSummary {
985
+ id: OpaqueIdentifier;
986
+ project_id: OpaqueIdentifier;
987
+ environment: Environment;
988
+ subscriber_id: OpaqueIdentifier;
989
+ notifier_id: OpaqueIdentifier;
990
+ channel: Channel;
991
+ status: "active" | "paused" | "revoked";
992
+ }
993
+ /**
994
+ * A stable, safe error classification with no provider response or credential material.
995
+ */
996
+ export interface ClassifiedError {
997
+ code: ProblemCode;
998
+ retryable: boolean;
999
+ detail?: string;
1000
+ diagnostic_id?: DiagnosticId;
1001
+ }
1002
+ /**
1003
+ * Creates one logical message for one subscriber and one resolved channel binding.
1004
+ */
1005
+ export interface CreateMessageRequest {
1006
+ to: MessageTarget;
1007
+ notifier_id?: OpaqueIdentifier;
1008
+ content: TextContent;
1009
+ /**
1010
+ * An RFC 3339 timestamp with a UTC offset. The server is authoritative.
1011
+ */
1012
+ expires_at?: string;
1013
+ correlation_id?: string;
1014
+ metadata?: Metadata;
1015
+ /**
1016
+ * A required-type tagged union. C0 supports confirm, single-select, and input only.
1017
+ */
1018
+ interaction?: ConfirmInteractionRequest | SelectInteractionRequest | InputInteractionRequest;
1019
+ }
1020
+ export interface MessageTarget {
1021
+ subscriber_id: OpaqueIdentifier;
1022
+ }
1023
+ export interface TextContent {
1024
+ type: "text";
1025
+ text: string;
1026
+ }
1027
+ /**
1028
+ * Bounded customer correlation data. Do not include secrets or personal data.
1029
+ */
1030
+ export interface Metadata {
1031
+ [k: string]: MetadataValue;
1032
+ }
1033
+ export interface ConfirmInteractionRequest {
1034
+ type: "confirm";
1035
+ prompt: string;
1036
+ confirm_label?: string;
1037
+ deny_label?: string;
1038
+ /**
1039
+ * Must be 30 seconds through 24 hours after server acceptance.
1040
+ */
1041
+ expires_at: string;
1042
+ /**
1043
+ * Caller-owned opaque correlation returned as data, never treated as execution authority.
1044
+ */
1045
+ correlation_id?: string;
1046
+ }
1047
+ export interface SelectInteractionRequest {
1048
+ type: "select";
1049
+ prompt: string;
1050
+ /**
1051
+ * @minItems 2
1052
+ * @maxItems 6
1053
+ */
1054
+ options: [InteractionOption, InteractionOption] | [InteractionOption, InteractionOption, InteractionOption] | [
1055
+ InteractionOption,
1056
+ InteractionOption,
1057
+ InteractionOption,
1058
+ InteractionOption
1059
+ ] | [
1060
+ InteractionOption,
1061
+ InteractionOption,
1062
+ InteractionOption,
1063
+ InteractionOption,
1064
+ InteractionOption
1065
+ ] | [
1066
+ InteractionOption,
1067
+ InteractionOption,
1068
+ InteractionOption,
1069
+ InteractionOption,
1070
+ InteractionOption,
1071
+ InteractionOption
1072
+ ];
1073
+ /**
1074
+ * Must be 30 seconds through 24 hours after server acceptance.
1075
+ */
1076
+ expires_at: string;
1077
+ /**
1078
+ * Caller-owned opaque correlation returned as data, never treated as execution authority.
1079
+ */
1080
+ correlation_id?: string;
1081
+ }
1082
+ export interface InteractionOption {
1083
+ /**
1084
+ * Opaque customer data. It is never interpreted as a command.
1085
+ */
1086
+ value: string;
1087
+ label: string;
1088
+ }
1089
+ export interface InputInteractionRequest {
1090
+ type: "input";
1091
+ prompt: string;
1092
+ /**
1093
+ * Must be 30 seconds through 24 hours after server acceptance.
1094
+ */
1095
+ expires_at: string;
1096
+ /**
1097
+ * Caller-owned opaque correlation returned as data, never treated as execution authority.
1098
+ */
1099
+ correlation_id?: string;
1100
+ }
1101
+ export interface ProblemFieldError {
1102
+ /**
1103
+ * A bounded JSON Pointer or request field identifier.
1104
+ */
1105
+ field: string;
1106
+ code: string;
1107
+ detail: string;
1108
+ }
1109
+ export interface ProviderCapabilitiesCollection {
1110
+ schema: "whooshbang.provider-capabilities-collection.v1";
1111
+ /**
1112
+ * @minItems 1
1113
+ */
1114
+ providers: [ProviderCapabilitiesV1, ...ProviderCapabilitiesV1[]];
1115
+ }
1116
+ /**
1117
+ * Provider-neutral, renderer-facing delivery and interaction capabilities with explicit degradation.
1118
+ */
1119
+ export interface ProviderCapabilitiesV1 {
1120
+ schema: "whooshbang.provider-capabilities.v1";
1121
+ provider: string;
1122
+ text: {
1123
+ supported: boolean;
1124
+ maximum_bytes: number;
1125
+ };
1126
+ interaction: {
1127
+ confirm: InteractionCapability;
1128
+ select: InteractionCapability;
1129
+ input: InteractionCapability;
1130
+ };
1131
+ streaming: {
1132
+ mode: "native" | "edit" | "typing_then_final" | "final_only" | "unsupported";
1133
+ /**
1134
+ * This interface was referenced by `ProviderCapabilitiesV1`'s JSON-Schema
1135
+ * via the `definition` "SafeExplanation".
1136
+ */
1137
+ explanation?: string;
1138
+ };
1139
+ edit: {
1140
+ supported: boolean;
1141
+ };
1142
+ receipts: {
1143
+ provider_accepted: boolean;
1144
+ delivered: boolean;
1145
+ read: boolean;
1146
+ };
1147
+ contexts: {
1148
+ private_chat: ContextSupport;
1149
+ thread: ContextSupport;
1150
+ group: ContextSupport;
1151
+ };
1152
+ rate_limit: {
1153
+ strategy: "provider_retry_after" | "token_bucket" | "fixed_window" | "adaptive" | "unknown";
1154
+ /**
1155
+ * This interface was referenced by `ProviderCapabilitiesV1`'s JSON-Schema
1156
+ * via the `definition` "SafeExplanation".
1157
+ */
1158
+ explanation?: string;
1159
+ };
1160
+ degradation: Degradation;
1161
+ }
1162
+ export type RotateCustomerEndpointRequest = RotateApiCredentialRequest;