@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,689 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://whooshbang.flowxo.com/schemas/events/whooshbang-event-v1.schema.json",
4
+ "x-contract-version": "1.0.0-rc.13",
5
+ "title": "WhooshBangEventV1ContractDocument",
6
+ "description": "Strict public customer-event envelope and initial WhooshBang event union.",
7
+ "oneOf": [
8
+ {
9
+ "$ref": "#/$defs/SubscriptionActivatedEvent"
10
+ },
11
+ {
12
+ "$ref": "#/$defs/SubscriptionRevokedEvent"
13
+ },
14
+ {
15
+ "$ref": "#/$defs/MessageProviderAcceptedEvent"
16
+ },
17
+ {
18
+ "$ref": "#/$defs/MessageDeliveredEvent"
19
+ },
20
+ {
21
+ "$ref": "#/$defs/MessageFailedEvent"
22
+ },
23
+ {
24
+ "$ref": "#/$defs/MessageExpiredEvent"
25
+ },
26
+ {
27
+ "$ref": "#/$defs/InteractionReceivedEvent"
28
+ },
29
+ {
30
+ "$ref": "#/$defs/InteractionExpiredEvent"
31
+ },
32
+ {
33
+ "$ref": "#/$defs/AgentBindingDegradedEvent"
34
+ }
35
+ ],
36
+ "$defs": {
37
+ "Environment": {
38
+ "type": "string",
39
+ "enum": ["test", "live"],
40
+ "description": "The environment in which the immutable event occurred."
41
+ },
42
+ "Channel": {
43
+ "type": "string",
44
+ "enum": ["telegram"],
45
+ "description": "The initial provider-neutral channel vocabulary."
46
+ },
47
+ "OpaqueIdentifier": {
48
+ "type": "string",
49
+ "minLength": 1,
50
+ "maxLength": 128,
51
+ "pattern": "^[^\\u0000-\\u001F\\u007F]+$",
52
+ "description": "A stable public resource identifier whose internal encoding is not a public promise."
53
+ },
54
+ "EventIdentifier": {
55
+ "type": "string",
56
+ "minLength": 8,
57
+ "maxLength": 128,
58
+ "pattern": "^evt_[A-Za-z0-9_-]+$",
59
+ "description": "The stable logical event identifier. Dots and control characters are excluded so it is safe in the Standard Webhooks signing input."
60
+ },
61
+ "Timestamp": {
62
+ "type": "string",
63
+ "format": "date-time",
64
+ "pattern": "^[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12][0-9]|3[01])T(?:[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](?:\\.[0-9]+)?(?:Z|[+-](?:[01][0-9]|2[0-3]):[0-5][0-9])$",
65
+ "description": "An RFC 3339 timestamp with an explicit UTC offset."
66
+ },
67
+ "CorrelationId": {
68
+ "type": "string",
69
+ "minLength": 1,
70
+ "maxLength": 128,
71
+ "pattern": "^[^\\u0000-\\u001F\\u007F]+$",
72
+ "description": "Opaque customer correlation returned as data and never interpreted as authority or an executable command."
73
+ },
74
+ "InteractionCorrelationId": {
75
+ "type": "string",
76
+ "minLength": 8,
77
+ "maxLength": 128,
78
+ "pattern": "^[^\\u0000-\\u001F\\u007F]+$",
79
+ "description": "The C0-03 bounded opaque interaction correlation returned as data and never interpreted as authority."
80
+ },
81
+ "BaseEvent": {
82
+ "type": "object",
83
+ "required": [
84
+ "schema",
85
+ "id",
86
+ "type",
87
+ "created_at",
88
+ "account_id",
89
+ "project_id",
90
+ "environment",
91
+ "data"
92
+ ],
93
+ "properties": {
94
+ "schema": {
95
+ "const": "whooshbang.event.v1"
96
+ },
97
+ "id": {
98
+ "$ref": "#/$defs/EventIdentifier"
99
+ },
100
+ "type": {
101
+ "type": "string",
102
+ "enum": [
103
+ "subscription.activated",
104
+ "subscription.revoked",
105
+ "message.provider_accepted",
106
+ "message.delivered",
107
+ "message.failed",
108
+ "message.expired",
109
+ "interaction.received",
110
+ "interaction.expired",
111
+ "agent_binding.degraded"
112
+ ]
113
+ },
114
+ "created_at": {
115
+ "$ref": "#/$defs/Timestamp"
116
+ },
117
+ "account_id": {
118
+ "$ref": "#/$defs/OpaqueIdentifier"
119
+ },
120
+ "project_id": {
121
+ "$ref": "#/$defs/OpaqueIdentifier"
122
+ },
123
+ "environment": {
124
+ "$ref": "#/$defs/Environment"
125
+ },
126
+ "data": {
127
+ "type": "object"
128
+ }
129
+ },
130
+ "additionalProperties": false
131
+ },
132
+ "SubscriptionActivatedData": {
133
+ "type": "object",
134
+ "required": [
135
+ "subscription_link_id",
136
+ "binding_id",
137
+ "subscriber_id",
138
+ "notifier_id",
139
+ "channel",
140
+ "state",
141
+ "activated_at"
142
+ ],
143
+ "properties": {
144
+ "subscription_link_id": {
145
+ "$ref": "#/$defs/OpaqueIdentifier"
146
+ },
147
+ "binding_id": {
148
+ "$ref": "#/$defs/OpaqueIdentifier"
149
+ },
150
+ "subscriber_id": {
151
+ "$ref": "#/$defs/OpaqueIdentifier"
152
+ },
153
+ "notifier_id": {
154
+ "$ref": "#/$defs/OpaqueIdentifier"
155
+ },
156
+ "channel": {
157
+ "$ref": "#/$defs/Channel"
158
+ },
159
+ "state": {
160
+ "const": "activated"
161
+ },
162
+ "activated_at": {
163
+ "$ref": "#/$defs/Timestamp"
164
+ }
165
+ },
166
+ "additionalProperties": false
167
+ },
168
+ "SubscriptionRevokedData": {
169
+ "type": "object",
170
+ "required": [
171
+ "subscription_link_id",
172
+ "binding_id",
173
+ "subscriber_id",
174
+ "notifier_id",
175
+ "channel",
176
+ "state",
177
+ "revoked_at"
178
+ ],
179
+ "properties": {
180
+ "subscription_link_id": {
181
+ "$ref": "#/$defs/OpaqueIdentifier"
182
+ },
183
+ "binding_id": {
184
+ "$ref": "#/$defs/OpaqueIdentifier"
185
+ },
186
+ "subscriber_id": {
187
+ "$ref": "#/$defs/OpaqueIdentifier"
188
+ },
189
+ "notifier_id": {
190
+ "$ref": "#/$defs/OpaqueIdentifier"
191
+ },
192
+ "channel": {
193
+ "$ref": "#/$defs/Channel"
194
+ },
195
+ "state": {
196
+ "const": "revoked"
197
+ },
198
+ "revoked_at": {
199
+ "$ref": "#/$defs/Timestamp"
200
+ }
201
+ },
202
+ "additionalProperties": false
203
+ },
204
+ "MessageProviderAcceptedData": {
205
+ "type": "object",
206
+ "required": ["message_id", "state", "accepted_at"],
207
+ "properties": {
208
+ "message_id": {
209
+ "$ref": "#/$defs/OpaqueIdentifier"
210
+ },
211
+ "correlation_id": {
212
+ "$ref": "#/$defs/CorrelationId"
213
+ },
214
+ "state": {
215
+ "const": "provider_accepted"
216
+ },
217
+ "accepted_at": {
218
+ "$ref": "#/$defs/Timestamp"
219
+ }
220
+ },
221
+ "additionalProperties": false
222
+ },
223
+ "MessageDeliveredData": {
224
+ "type": "object",
225
+ "required": ["message_id", "state", "evidence", "delivered_at"],
226
+ "properties": {
227
+ "message_id": {
228
+ "$ref": "#/$defs/OpaqueIdentifier"
229
+ },
230
+ "correlation_id": {
231
+ "$ref": "#/$defs/CorrelationId"
232
+ },
233
+ "state": {
234
+ "const": "delivered"
235
+ },
236
+ "evidence": {
237
+ "const": "provider_delivery_receipt",
238
+ "description": "Delivery is claimed only when the provider supplied trustworthy delivery evidence."
239
+ },
240
+ "delivered_at": {
241
+ "$ref": "#/$defs/Timestamp"
242
+ }
243
+ },
244
+ "additionalProperties": false
245
+ },
246
+ "MessageFailedData": {
247
+ "type": "object",
248
+ "required": [
249
+ "message_id",
250
+ "state",
251
+ "failure_code",
252
+ "retryable",
253
+ "failed_at"
254
+ ],
255
+ "properties": {
256
+ "message_id": {
257
+ "$ref": "#/$defs/OpaqueIdentifier"
258
+ },
259
+ "correlation_id": {
260
+ "$ref": "#/$defs/CorrelationId"
261
+ },
262
+ "state": {
263
+ "const": "terminal_failed"
264
+ },
265
+ "failure_code": {
266
+ "type": "string",
267
+ "minLength": 1,
268
+ "maxLength": 64,
269
+ "pattern": "^[a-z0-9][a-z0-9._-]*$",
270
+ "description": "A provider-neutral, safe public failure classification."
271
+ },
272
+ "retryable": {
273
+ "const": false
274
+ },
275
+ "failed_at": {
276
+ "$ref": "#/$defs/Timestamp"
277
+ }
278
+ },
279
+ "additionalProperties": false
280
+ },
281
+ "MessageExpiredData": {
282
+ "type": "object",
283
+ "required": ["message_id", "state", "expired_at"],
284
+ "properties": {
285
+ "message_id": {
286
+ "$ref": "#/$defs/OpaqueIdentifier"
287
+ },
288
+ "correlation_id": {
289
+ "$ref": "#/$defs/CorrelationId"
290
+ },
291
+ "state": {
292
+ "const": "expired"
293
+ },
294
+ "expired_at": {
295
+ "$ref": "#/$defs/Timestamp"
296
+ }
297
+ },
298
+ "additionalProperties": false
299
+ },
300
+ "ConfirmInteractionResponse": {
301
+ "type": "object",
302
+ "required": ["type", "value"],
303
+ "properties": {
304
+ "type": {
305
+ "const": "confirm"
306
+ },
307
+ "value": {
308
+ "type": "boolean"
309
+ }
310
+ },
311
+ "additionalProperties": false
312
+ },
313
+ "SelectInteractionResponse": {
314
+ "type": "object",
315
+ "required": ["type", "value"],
316
+ "properties": {
317
+ "type": {
318
+ "const": "select"
319
+ },
320
+ "value": {
321
+ "type": "string",
322
+ "minLength": 1,
323
+ "maxLength": 128,
324
+ "pattern": "^[^\\u0000-\\u001F\\u007F]+$",
325
+ "description": "Opaque customer data and never an executable command."
326
+ }
327
+ },
328
+ "additionalProperties": false
329
+ },
330
+ "InputInteractionResponse": {
331
+ "type": "object",
332
+ "required": ["type", "value"],
333
+ "properties": {
334
+ "type": {
335
+ "const": "input"
336
+ },
337
+ "value": {
338
+ "type": "string",
339
+ "minLength": 1,
340
+ "maxLength": 4000,
341
+ "pattern": "^(?:\\S|\\S[\\s\\S]*\\S)$"
342
+ }
343
+ },
344
+ "additionalProperties": false
345
+ },
346
+ "InteractionResponse": {
347
+ "oneOf": [
348
+ {
349
+ "$ref": "#/$defs/ConfirmInteractionResponse"
350
+ },
351
+ {
352
+ "$ref": "#/$defs/SelectInteractionResponse"
353
+ },
354
+ {
355
+ "$ref": "#/$defs/InputInteractionResponse"
356
+ }
357
+ ]
358
+ },
359
+ "InteractionReceivedData": {
360
+ "type": "object",
361
+ "required": [
362
+ "interaction_id",
363
+ "message_id",
364
+ "binding_id",
365
+ "channel",
366
+ "interaction_type",
367
+ "response",
368
+ "occurred_at",
369
+ "expires_at"
370
+ ],
371
+ "properties": {
372
+ "interaction_id": {
373
+ "$ref": "#/$defs/OpaqueIdentifier"
374
+ },
375
+ "message_id": {
376
+ "$ref": "#/$defs/OpaqueIdentifier"
377
+ },
378
+ "binding_id": {
379
+ "$ref": "#/$defs/OpaqueIdentifier"
380
+ },
381
+ "channel": {
382
+ "$ref": "#/$defs/Channel"
383
+ },
384
+ "correlation_id": {
385
+ "$ref": "#/$defs/InteractionCorrelationId"
386
+ },
387
+ "interaction_type": {
388
+ "type": "string",
389
+ "enum": ["confirm", "select", "input"]
390
+ },
391
+ "response": {
392
+ "$ref": "#/$defs/InteractionResponse"
393
+ },
394
+ "occurred_at": {
395
+ "$ref": "#/$defs/Timestamp"
396
+ },
397
+ "expires_at": {
398
+ "$ref": "#/$defs/Timestamp"
399
+ }
400
+ },
401
+ "allOf": [
402
+ {
403
+ "if": {
404
+ "type": "object",
405
+ "properties": {
406
+ "interaction_type": {
407
+ "const": "confirm"
408
+ }
409
+ },
410
+ "required": ["interaction_type"]
411
+ },
412
+ "then": {
413
+ "type": "object",
414
+ "properties": {
415
+ "response": {
416
+ "$ref": "#/$defs/ConfirmInteractionResponse"
417
+ }
418
+ }
419
+ }
420
+ },
421
+ {
422
+ "if": {
423
+ "type": "object",
424
+ "properties": {
425
+ "interaction_type": {
426
+ "const": "select"
427
+ }
428
+ },
429
+ "required": ["interaction_type"]
430
+ },
431
+ "then": {
432
+ "type": "object",
433
+ "properties": {
434
+ "response": {
435
+ "$ref": "#/$defs/SelectInteractionResponse"
436
+ }
437
+ }
438
+ }
439
+ },
440
+ {
441
+ "if": {
442
+ "type": "object",
443
+ "properties": {
444
+ "interaction_type": {
445
+ "const": "input"
446
+ }
447
+ },
448
+ "required": ["interaction_type"]
449
+ },
450
+ "then": {
451
+ "type": "object",
452
+ "properties": {
453
+ "response": {
454
+ "$ref": "#/$defs/InputInteractionResponse"
455
+ }
456
+ }
457
+ }
458
+ }
459
+ ],
460
+ "additionalProperties": false
461
+ },
462
+ "InteractionExpiredData": {
463
+ "type": "object",
464
+ "required": [
465
+ "interaction_id",
466
+ "message_id",
467
+ "interaction_type",
468
+ "expired_at"
469
+ ],
470
+ "properties": {
471
+ "interaction_id": {
472
+ "$ref": "#/$defs/OpaqueIdentifier"
473
+ },
474
+ "message_id": {
475
+ "$ref": "#/$defs/OpaqueIdentifier"
476
+ },
477
+ "correlation_id": {
478
+ "$ref": "#/$defs/InteractionCorrelationId"
479
+ },
480
+ "interaction_type": {
481
+ "type": "string",
482
+ "enum": ["confirm", "select", "input"]
483
+ },
484
+ "expired_at": {
485
+ "$ref": "#/$defs/Timestamp"
486
+ }
487
+ },
488
+ "additionalProperties": false
489
+ },
490
+ "AgentBindingDegradedData": {
491
+ "type": "object",
492
+ "required": [
493
+ "agent_binding_id",
494
+ "binding_id",
495
+ "notifier_id",
496
+ "state",
497
+ "degradation_code",
498
+ "degraded_at"
499
+ ],
500
+ "properties": {
501
+ "agent_binding_id": {
502
+ "$ref": "#/$defs/OpaqueIdentifier"
503
+ },
504
+ "binding_id": {
505
+ "$ref": "#/$defs/OpaqueIdentifier"
506
+ },
507
+ "notifier_id": {
508
+ "$ref": "#/$defs/OpaqueIdentifier"
509
+ },
510
+ "state": {
511
+ "const": "degraded"
512
+ },
513
+ "degradation_code": {
514
+ "type": "string",
515
+ "minLength": 1,
516
+ "maxLength": 64,
517
+ "pattern": "^[a-z0-9][a-z0-9._-]*$",
518
+ "description": "A safe public classification without provider identity or credentials."
519
+ },
520
+ "degraded_at": {
521
+ "$ref": "#/$defs/Timestamp"
522
+ }
523
+ },
524
+ "additionalProperties": false
525
+ },
526
+ "SubscriptionActivatedEvent": {
527
+ "allOf": [
528
+ {
529
+ "$ref": "#/$defs/BaseEvent"
530
+ },
531
+ {
532
+ "type": "object",
533
+ "properties": {
534
+ "type": {
535
+ "const": "subscription.activated"
536
+ },
537
+ "data": {
538
+ "$ref": "#/$defs/SubscriptionActivatedData"
539
+ }
540
+ }
541
+ }
542
+ ]
543
+ },
544
+ "SubscriptionRevokedEvent": {
545
+ "allOf": [
546
+ {
547
+ "$ref": "#/$defs/BaseEvent"
548
+ },
549
+ {
550
+ "type": "object",
551
+ "properties": {
552
+ "type": {
553
+ "const": "subscription.revoked"
554
+ },
555
+ "data": {
556
+ "$ref": "#/$defs/SubscriptionRevokedData"
557
+ }
558
+ }
559
+ }
560
+ ]
561
+ },
562
+ "MessageProviderAcceptedEvent": {
563
+ "allOf": [
564
+ {
565
+ "$ref": "#/$defs/BaseEvent"
566
+ },
567
+ {
568
+ "type": "object",
569
+ "properties": {
570
+ "type": {
571
+ "const": "message.provider_accepted"
572
+ },
573
+ "data": {
574
+ "$ref": "#/$defs/MessageProviderAcceptedData"
575
+ }
576
+ }
577
+ }
578
+ ]
579
+ },
580
+ "MessageDeliveredEvent": {
581
+ "allOf": [
582
+ {
583
+ "$ref": "#/$defs/BaseEvent"
584
+ },
585
+ {
586
+ "type": "object",
587
+ "properties": {
588
+ "type": {
589
+ "const": "message.delivered"
590
+ },
591
+ "data": {
592
+ "$ref": "#/$defs/MessageDeliveredData"
593
+ }
594
+ }
595
+ }
596
+ ]
597
+ },
598
+ "MessageFailedEvent": {
599
+ "allOf": [
600
+ {
601
+ "$ref": "#/$defs/BaseEvent"
602
+ },
603
+ {
604
+ "type": "object",
605
+ "properties": {
606
+ "type": {
607
+ "const": "message.failed"
608
+ },
609
+ "data": {
610
+ "$ref": "#/$defs/MessageFailedData"
611
+ }
612
+ }
613
+ }
614
+ ]
615
+ },
616
+ "MessageExpiredEvent": {
617
+ "allOf": [
618
+ {
619
+ "$ref": "#/$defs/BaseEvent"
620
+ },
621
+ {
622
+ "type": "object",
623
+ "properties": {
624
+ "type": {
625
+ "const": "message.expired"
626
+ },
627
+ "data": {
628
+ "$ref": "#/$defs/MessageExpiredData"
629
+ }
630
+ }
631
+ }
632
+ ]
633
+ },
634
+ "InteractionReceivedEvent": {
635
+ "allOf": [
636
+ {
637
+ "$ref": "#/$defs/BaseEvent"
638
+ },
639
+ {
640
+ "type": "object",
641
+ "properties": {
642
+ "type": {
643
+ "const": "interaction.received"
644
+ },
645
+ "data": {
646
+ "$ref": "#/$defs/InteractionReceivedData"
647
+ }
648
+ }
649
+ }
650
+ ]
651
+ },
652
+ "InteractionExpiredEvent": {
653
+ "allOf": [
654
+ {
655
+ "$ref": "#/$defs/BaseEvent"
656
+ },
657
+ {
658
+ "type": "object",
659
+ "properties": {
660
+ "type": {
661
+ "const": "interaction.expired"
662
+ },
663
+ "data": {
664
+ "$ref": "#/$defs/InteractionExpiredData"
665
+ }
666
+ }
667
+ }
668
+ ]
669
+ },
670
+ "AgentBindingDegradedEvent": {
671
+ "allOf": [
672
+ {
673
+ "$ref": "#/$defs/BaseEvent"
674
+ },
675
+ {
676
+ "type": "object",
677
+ "properties": {
678
+ "type": {
679
+ "const": "agent_binding.degraded"
680
+ },
681
+ "data": {
682
+ "$ref": "#/$defs/AgentBindingDegradedData"
683
+ }
684
+ }
685
+ }
686
+ ]
687
+ }
688
+ }
689
+ }