@greatwait/contracts 0.2.3 → 0.3.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.
Files changed (79) hide show
  1. package/dist/attempt-search.d.ts +235 -0
  2. package/dist/attempt-search.js +98 -0
  3. package/dist/billing.d.ts +4 -4
  4. package/dist/bulk-operations.d.ts +1832 -0
  5. package/dist/bulk-operations.js +610 -0
  6. package/dist/configuration-bounds.d.ts +12 -0
  7. package/dist/configuration-bounds.js +12 -0
  8. package/dist/configuration.d.ts +71 -0
  9. package/dist/configuration.js +204 -0
  10. package/dist/data-export.d.ts +3 -3
  11. package/dist/effective-limits.d.ts +4 -4
  12. package/dist/execution-selection.d.ts +48 -0
  13. package/dist/execution-selection.js +21 -0
  14. package/dist/http-request.d.ts +1 -1
  15. package/dist/identifiers.d.ts +2 -0
  16. package/dist/identifiers.js +2 -0
  17. package/dist/identity.d.ts +3 -3
  18. package/dist/index.d.ts +5 -0
  19. package/dist/index.js +5 -0
  20. package/dist/occurrence-states.d.ts +14 -0
  21. package/dist/occurrence-states.js +13 -0
  22. package/dist/operations.d.ts +573 -89
  23. package/dist/operations.js +67 -0
  24. package/dist/protocol.d.ts +19 -5
  25. package/dist/protocol.js +14 -7
  26. package/dist/schedule-selection.d.ts +28 -0
  27. package/dist/schedule-selection.js +48 -0
  28. package/dist/scheduling-records.d.ts +20 -20
  29. package/dist/scheduling.d.ts +64 -63
  30. package/dist/scheduling.js +10 -37
  31. package/dist/test-sink.d.ts +6 -6
  32. package/dist/usage.d.ts +3 -3
  33. package/generated/v1/examples/attempts.search.response.json +42 -0
  34. package/generated/v1/examples/bulk.cancel.request.json +3 -0
  35. package/generated/v1/examples/bulk.cancel.response.json +59 -0
  36. package/generated/v1/examples/bulk.confirm.request.json +5 -0
  37. package/generated/v1/examples/bulk.confirm.response.json +59 -0
  38. package/generated/v1/examples/bulk.items.response.json +3 -0
  39. package/generated/v1/examples/bulk.list.response.json +63 -0
  40. package/generated/v1/examples/bulk.pause.request.json +3 -0
  41. package/generated/v1/examples/bulk.pause.response.json +59 -0
  42. package/generated/v1/examples/bulk.preview.request.json +12 -0
  43. package/generated/v1/examples/bulk.preview.response.json +59 -0
  44. package/generated/v1/examples/bulk.read.response.json +59 -0
  45. package/generated/v1/examples/bulk.resume.request.json +3 -0
  46. package/generated/v1/examples/bulk.resume.response.json +59 -0
  47. package/generated/v1/manifest.json +243 -1
  48. package/generated/v1/openapi.json +21569 -2418
  49. package/generated/v1/policy-matrix.json +63 -0
  50. package/generated/v1/schemas/attempts.search.query.json +96 -0
  51. package/generated/v1/schemas/attempts.search.response.json +271 -0
  52. package/generated/v1/schemas/bulk.cancel.request.json +13 -0
  53. package/generated/v1/schemas/bulk.cancel.response.json +1717 -0
  54. package/generated/v1/schemas/bulk.confirm.request-headers.json +13 -0
  55. package/generated/v1/schemas/bulk.confirm.request.json +19 -0
  56. package/generated/v1/schemas/bulk.confirm.response.json +1717 -0
  57. package/generated/v1/schemas/bulk.items.query.json +29 -0
  58. package/generated/v1/schemas/bulk.items.response.json +194 -0
  59. package/generated/v1/schemas/bulk.list.query.json +32 -0
  60. package/generated/v1/schemas/bulk.list.response.json +1789 -0
  61. package/generated/v1/schemas/bulk.pause.request.json +13 -0
  62. package/generated/v1/schemas/bulk.pause.response.json +1717 -0
  63. package/generated/v1/schemas/bulk.preview.request.json +1218 -0
  64. package/generated/v1/schemas/bulk.preview.response.json +1717 -0
  65. package/generated/v1/schemas/bulk.read.response.json +1717 -0
  66. package/generated/v1/schemas/bulk.resume.request.json +13 -0
  67. package/generated/v1/schemas/bulk.resume.response.json +1717 -0
  68. package/generated/v1/schemas/executions.list.query.json +33 -12
  69. package/generated/v1/schemas/schedules.list.query.json +32 -3
  70. package/generated/v1/snippets/attempts.search.json +6 -0
  71. package/generated/v1/snippets/bulk.cancel.json +6 -0
  72. package/generated/v1/snippets/bulk.confirm.json +6 -0
  73. package/generated/v1/snippets/bulk.items.json +6 -0
  74. package/generated/v1/snippets/bulk.list.json +6 -0
  75. package/generated/v1/snippets/bulk.pause.json +6 -0
  76. package/generated/v1/snippets/bulk.preview.json +6 -0
  77. package/generated/v1/snippets/bulk.read.json +6 -0
  78. package/generated/v1/snippets/bulk.resume.json +6 -0
  79. package/package.json +1 -1
@@ -13,6 +13,13 @@
13
13
  "roles": ["admin", "billing", "member"],
14
14
  "scopes": ["occurrences:read"]
15
15
  },
16
+ {
17
+ "mutates": false,
18
+ "operation": "attempts.search",
19
+ "principals": ["api-credential", "oauth", "session"],
20
+ "roles": ["admin", "billing", "member"],
21
+ "scopes": ["occurrences:read"]
22
+ },
16
23
  {
17
24
  "mutates": true,
18
25
  "operation": "billing.autotopup",
@@ -216,6 +223,62 @@
216
223
  "roles": ["admin", "billing", "member"],
217
224
  "scopes": ["usage:read"]
218
225
  },
226
+ {
227
+ "mutates": true,
228
+ "operation": "bulk.cancel",
229
+ "principals": ["api-credential", "oauth", "session"],
230
+ "roles": ["admin", "billing", "member"],
231
+ "scopes": []
232
+ },
233
+ {
234
+ "mutates": true,
235
+ "operation": "bulk.confirm",
236
+ "principals": ["api-credential", "oauth", "session"],
237
+ "roles": ["admin", "billing", "member"],
238
+ "scopes": []
239
+ },
240
+ {
241
+ "mutates": false,
242
+ "operation": "bulk.items",
243
+ "principals": ["api-credential", "oauth", "session"],
244
+ "roles": ["admin", "billing", "member"],
245
+ "scopes": []
246
+ },
247
+ {
248
+ "mutates": false,
249
+ "operation": "bulk.list",
250
+ "principals": ["api-credential", "oauth", "session"],
251
+ "roles": ["admin", "billing", "member"],
252
+ "scopes": []
253
+ },
254
+ {
255
+ "mutates": true,
256
+ "operation": "bulk.pause",
257
+ "principals": ["api-credential", "oauth", "session"],
258
+ "roles": ["admin", "billing", "member"],
259
+ "scopes": []
260
+ },
261
+ {
262
+ "mutates": true,
263
+ "operation": "bulk.preview",
264
+ "principals": ["api-credential", "oauth", "session"],
265
+ "roles": ["admin", "billing", "member"],
266
+ "scopes": []
267
+ },
268
+ {
269
+ "mutates": false,
270
+ "operation": "bulk.read",
271
+ "principals": ["api-credential", "oauth", "session"],
272
+ "roles": ["admin", "billing", "member"],
273
+ "scopes": []
274
+ },
275
+ {
276
+ "mutates": true,
277
+ "operation": "bulk.resume",
278
+ "principals": ["api-credential", "oauth", "session"],
279
+ "roles": ["admin", "billing", "member"],
280
+ "scopes": []
281
+ },
219
282
  {
220
283
  "mutates": false,
221
284
  "operation": "context.read",
@@ -0,0 +1,96 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "cursor": {
6
+ "type": "string",
7
+ "minLength": 1
8
+ },
9
+ "limit": {
10
+ "default": 25,
11
+ "type": "integer",
12
+ "minimum": 1,
13
+ "maximum": 100
14
+ },
15
+ "startedFrom": {
16
+ "type": "string",
17
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
18
+ },
19
+ "startedBefore": {
20
+ "type": "string",
21
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
22
+ },
23
+ "responseStatus": {
24
+ "type": "integer",
25
+ "minimum": 100,
26
+ "maximum": 599
27
+ },
28
+ "statusClass": {
29
+ "type": "string",
30
+ "enum": ["1xx", "2xx", "3xx", "4xx", "5xx"]
31
+ },
32
+ "outcome": {
33
+ "anyOf": [
34
+ {
35
+ "type": "string",
36
+ "enum": [
37
+ "succeeded",
38
+ "retryable_failure",
39
+ "terminal_failure",
40
+ "ambiguous"
41
+ ]
42
+ },
43
+ {
44
+ "type": "string",
45
+ "const": "in_flight"
46
+ }
47
+ ]
48
+ },
49
+ "diagnostic": {
50
+ "type": "string",
51
+ "enum": [
52
+ "completion_timed_out",
53
+ "delivered",
54
+ "duplicate_inflight",
55
+ "endpoint_unavailable",
56
+ "endpoint_unsafe",
57
+ "http_refused",
58
+ "http_retryable",
59
+ "http_terminal",
60
+ "identity_conflict",
61
+ "network_ambiguous",
62
+ "payload_unavailable",
63
+ "rate_limited"
64
+ ]
65
+ },
66
+ "endpoint": {
67
+ "anyOf": [
68
+ {
69
+ "type": "string",
70
+ "pattern": "^ep_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
71
+ },
72
+ {
73
+ "type": "string",
74
+ "const": "none"
75
+ }
76
+ ]
77
+ },
78
+ "schedule": {
79
+ "type": "string",
80
+ "pattern": "^sch_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
81
+ },
82
+ "external_identifier": {
83
+ "type": "string",
84
+ "minLength": 1,
85
+ "maxLength": 256,
86
+ "description": "Host application identifier, matched exactly and case-sensitively; at most 256 UTF-8 bytes. Readable by schedule readers; do not include secrets."
87
+ },
88
+ "tag": {
89
+ "type": "string",
90
+ "minLength": 1,
91
+ "maxLength": 64,
92
+ "description": "An exact, case-sensitive tag of at most 64 UTF-8 bytes."
93
+ }
94
+ },
95
+ "required": ["startedFrom", "startedBefore"]
96
+ }
@@ -0,0 +1,271 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "data": {
6
+ "type": "array",
7
+ "items": {
8
+ "type": "object",
9
+ "properties": {
10
+ "attempt": {
11
+ "type": "object",
12
+ "properties": {
13
+ "id": {
14
+ "type": "string",
15
+ "pattern": "^att_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
16
+ },
17
+ "attemptNumber": {
18
+ "type": "integer",
19
+ "exclusiveMinimum": 0,
20
+ "maximum": 9007199254740991
21
+ },
22
+ "occurrence": {
23
+ "type": "string",
24
+ "pattern": "^occ_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
25
+ },
26
+ "startedAt": {
27
+ "type": "string",
28
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
29
+ },
30
+ "state": {
31
+ "type": "string",
32
+ "enum": [
33
+ "succeeded",
34
+ "retryable_failure",
35
+ "terminal_failure",
36
+ "ambiguous"
37
+ ]
38
+ },
39
+ "classifiedAt": {
40
+ "type": "string",
41
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
42
+ },
43
+ "durationMs": {
44
+ "type": "integer",
45
+ "minimum": 0,
46
+ "maximum": 9007199254740991
47
+ },
48
+ "responseStatus": {
49
+ "type": "integer",
50
+ "minimum": 100,
51
+ "maximum": 599
52
+ },
53
+ "diagnostic": {
54
+ "type": "string",
55
+ "x-callback-attempt-diagnostics": [
56
+ "completion_timed_out",
57
+ "delivered",
58
+ "duplicate_inflight",
59
+ "endpoint_unavailable",
60
+ "endpoint_unsafe",
61
+ "http_refused",
62
+ "http_retryable",
63
+ "http_terminal",
64
+ "identity_conflict",
65
+ "network_ambiguous",
66
+ "payload_unavailable",
67
+ "rate_limited"
68
+ ]
69
+ },
70
+ "remediation": {
71
+ "type": "string",
72
+ "enum": [
73
+ "none",
74
+ "review_retry_policy",
75
+ "inspect_receiver",
76
+ "review_endpoint",
77
+ "replace_payload",
78
+ "contact_support",
79
+ "review_before_redelivery"
80
+ ]
81
+ },
82
+ "trigger": {
83
+ "oneOf": [
84
+ {
85
+ "type": "object",
86
+ "properties": {
87
+ "kind": {
88
+ "type": "string",
89
+ "const": "automatic"
90
+ }
91
+ },
92
+ "required": ["kind"]
93
+ },
94
+ {
95
+ "type": "object",
96
+ "properties": {
97
+ "kind": {
98
+ "type": "string",
99
+ "const": "redelivery"
100
+ },
101
+ "sourceAttemptId": {
102
+ "type": "string",
103
+ "pattern": "^att_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
104
+ }
105
+ },
106
+ "required": ["kind", "sourceAttemptId"]
107
+ }
108
+ ]
109
+ }
110
+ },
111
+ "required": [
112
+ "id",
113
+ "attemptNumber",
114
+ "occurrence",
115
+ "startedAt",
116
+ "trigger"
117
+ ]
118
+ },
119
+ "occurrence": {
120
+ "type": "object",
121
+ "properties": {
122
+ "attemptCount": {
123
+ "type": "integer",
124
+ "minimum": 0,
125
+ "maximum": 9007199254740991
126
+ },
127
+ "firstAttemptLatenessMs": {
128
+ "type": "integer",
129
+ "minimum": -9007199254740991,
130
+ "maximum": 9007199254740991
131
+ },
132
+ "firstAttemptStartedAt": {
133
+ "type": "string",
134
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
135
+ },
136
+ "timingEligibility": {
137
+ "type": "string",
138
+ "enum": ["eligible", "customer_blocked", "platform_blocked"]
139
+ },
140
+ "timingEligibilityReason": {
141
+ "type": "string",
142
+ "minLength": 1,
143
+ "maxLength": 128
144
+ },
145
+ "timingPolicyVersion": {
146
+ "type": "string",
147
+ "minLength": 1,
148
+ "maxLength": 64
149
+ },
150
+ "generation": {
151
+ "type": "integer",
152
+ "exclusiveMinimum": 0,
153
+ "maximum": 9007199254740991
154
+ },
155
+ "id": {
156
+ "type": "string",
157
+ "pattern": "^occ_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
158
+ },
159
+ "plannedFor": {
160
+ "type": "string",
161
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
162
+ },
163
+ "schedule": {
164
+ "type": "string",
165
+ "pattern": "^sch_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
166
+ },
167
+ "sequence": {
168
+ "type": "integer",
169
+ "exclusiveMinimum": 0,
170
+ "maximum": 9007199254740991
171
+ },
172
+ "settledAt": {
173
+ "type": "string",
174
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
175
+ },
176
+ "state": {
177
+ "type": "string",
178
+ "enum": [
179
+ "planned",
180
+ "due",
181
+ "dispatching",
182
+ "retry_wait",
183
+ "ambiguous",
184
+ "succeeded",
185
+ "terminal_failed",
186
+ "cancelled",
187
+ "skipped_stale"
188
+ ]
189
+ }
190
+ },
191
+ "required": [
192
+ "attemptCount",
193
+ "generation",
194
+ "id",
195
+ "plannedFor",
196
+ "schedule",
197
+ "sequence",
198
+ "state"
199
+ ]
200
+ },
201
+ "schedule": {
202
+ "type": "object",
203
+ "properties": {
204
+ "id": {
205
+ "type": "string",
206
+ "pattern": "^sch_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
207
+ },
208
+ "name": {
209
+ "type": "string",
210
+ "minLength": 1,
211
+ "maxLength": 120
212
+ },
213
+ "endpoint": {
214
+ "type": "string",
215
+ "pattern": "^ep_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
216
+ },
217
+ "external_identifier": {
218
+ "type": "string",
219
+ "minLength": 1,
220
+ "maxLength": 256,
221
+ "description": "Host application identifier, matched exactly and case-sensitively; at most 256 UTF-8 bytes. Readable by schedule readers; do not include secrets."
222
+ },
223
+ "tags": {
224
+ "maxItems": 16,
225
+ "type": "array",
226
+ "items": {
227
+ "type": "string",
228
+ "minLength": 1,
229
+ "maxLength": 64,
230
+ "description": "An exact, case-sensitive tag of at most 64 UTF-8 bytes."
231
+ },
232
+ "description": "Up to 16 distinct searchable tags. Omission preserves tags on replacement; [] clears them."
233
+ }
234
+ },
235
+ "required": ["id"]
236
+ }
237
+ },
238
+ "required": ["attempt", "occurrence", "schedule"]
239
+ }
240
+ },
241
+ "freshness": {
242
+ "type": "object",
243
+ "properties": {
244
+ "kind": {
245
+ "type": "string",
246
+ "const": "authoritative"
247
+ }
248
+ },
249
+ "required": ["kind"]
250
+ },
251
+ "nextCursor": {
252
+ "type": "string",
253
+ "minLength": 1
254
+ },
255
+ "retention": {
256
+ "type": "object",
257
+ "properties": {
258
+ "from": {
259
+ "type": "string",
260
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
261
+ },
262
+ "detailsFrom": {
263
+ "type": "string",
264
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
265
+ }
266
+ },
267
+ "required": ["from", "detailsFrom"]
268
+ }
269
+ },
270
+ "required": ["data", "freshness", "retention"]
271
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "expectedVersion": {
6
+ "type": "integer",
7
+ "exclusiveMinimum": 0,
8
+ "maximum": 9007199254740991
9
+ }
10
+ },
11
+ "required": ["expectedVersion"],
12
+ "additionalProperties": false
13
+ }