@greatwait/contracts 0.2.1 → 0.2.2

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 (46) hide show
  1. package/dist/billing.d.ts +339 -0
  2. package/dist/billing.js +131 -1
  3. package/dist/host-correlation.d.ts +4 -0
  4. package/dist/host-correlation.js +18 -0
  5. package/dist/identifiers.d.ts +2 -0
  6. package/dist/identifiers.js +3 -0
  7. package/dist/index.d.ts +2 -1
  8. package/dist/index.js +2 -1
  9. package/dist/operations.d.ts +514 -0
  10. package/dist/operations.js +93 -1
  11. package/dist/protocol.d.ts +2 -0
  12. package/dist/protocol.js +3 -0
  13. package/dist/scheduling-records.d.ts +4 -0
  14. package/dist/scheduling.d.ts +12 -0
  15. package/dist/scheduling.js +13 -0
  16. package/generated/v1/examples/billing.promotions.response.json +26 -0
  17. package/generated/v1/examples/billing.redeem.request.json +4 -0
  18. package/generated/v1/examples/billing.redeem.response.json +43 -0
  19. package/generated/v1/manifest.json +56 -0
  20. package/generated/v1/openapi.json +2749 -89
  21. package/generated/v1/policy-matrix.json +14 -0
  22. package/generated/v1/schemas/billing.change.response.json +64 -0
  23. package/generated/v1/schemas/billing.projects.response.json +64 -0
  24. package/generated/v1/schemas/billing.promotions.response.json +188 -0
  25. package/generated/v1/schemas/billing.quote.response.json +51 -0
  26. package/generated/v1/schemas/billing.reconcile.response.json +324 -0
  27. package/generated/v1/schemas/billing.redeem.request-headers.json +13 -0
  28. package/generated/v1/schemas/billing.redeem.request.json +22 -0
  29. package/generated/v1/schemas/billing.redeem.response-headers.json +10 -0
  30. package/generated/v1/schemas/billing.redeem.response.json +326 -0
  31. package/generated/v1/schemas/billing.summary.response.json +324 -0
  32. package/generated/v1/schemas/executions.list.query.json +12 -0
  33. package/generated/v1/schemas/schedules.archive.response.json +17 -0
  34. package/generated/v1/schemas/schedules.cancel.response.json +17 -0
  35. package/generated/v1/schemas/schedules.create.request.json +17 -0
  36. package/generated/v1/schemas/schedules.create.response.json +17 -0
  37. package/generated/v1/schemas/schedules.list.query.json +12 -0
  38. package/generated/v1/schemas/schedules.list.response.json +17 -0
  39. package/generated/v1/schemas/schedules.pause.response.json +17 -0
  40. package/generated/v1/schemas/schedules.read.response.json +17 -0
  41. package/generated/v1/schemas/schedules.replace.request.json +17 -0
  42. package/generated/v1/schemas/schedules.replace.response.json +17 -0
  43. package/generated/v1/schemas/schedules.resume.response.json +17 -0
  44. package/generated/v1/snippets/billing.promotions.json +6 -0
  45. package/generated/v1/snippets/billing.redeem.json +6 -0
  46. package/package.json +1 -1
@@ -0,0 +1,326 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "grant": {
6
+ "type": "object",
7
+ "properties": {
8
+ "id": {
9
+ "type": "string",
10
+ "pattern": "^grn_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
11
+ },
12
+ "source": {
13
+ "type": "string",
14
+ "enum": ["operator", "code"]
15
+ },
16
+ "benefit": {
17
+ "oneOf": [
18
+ {
19
+ "type": "object",
20
+ "properties": {
21
+ "kind": {
22
+ "type": "string",
23
+ "const": "credit"
24
+ },
25
+ "amount": {
26
+ "type": "object",
27
+ "properties": {
28
+ "currency": {
29
+ "type": "string",
30
+ "const": "USD"
31
+ },
32
+ "microdollars": {
33
+ "type": "string",
34
+ "pattern": "^(?:0|[1-9]\\d*)$"
35
+ },
36
+ "scale": {
37
+ "type": "number",
38
+ "const": 6
39
+ }
40
+ },
41
+ "required": ["currency", "microdollars", "scale"]
42
+ }
43
+ },
44
+ "required": ["kind", "amount"]
45
+ },
46
+ {
47
+ "type": "object",
48
+ "properties": {
49
+ "kind": {
50
+ "type": "string",
51
+ "const": "project-slot"
52
+ },
53
+ "project": {
54
+ "type": "string",
55
+ "pattern": "^proj_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
56
+ }
57
+ },
58
+ "required": ["kind", "project"]
59
+ },
60
+ {
61
+ "type": "object",
62
+ "properties": {
63
+ "kind": {
64
+ "type": "string",
65
+ "const": "perk"
66
+ },
67
+ "perk": {
68
+ "type": "string",
69
+ "pattern": "^[a-z][a-z0-9-]{0,63}$"
70
+ }
71
+ },
72
+ "required": ["kind", "perk"]
73
+ },
74
+ {
75
+ "type": "object",
76
+ "properties": {
77
+ "kind": {
78
+ "type": "string",
79
+ "const": "discount"
80
+ },
81
+ "percentOff": {
82
+ "type": "integer",
83
+ "minimum": 1,
84
+ "maximum": 100
85
+ },
86
+ "amountOff": {
87
+ "type": "object",
88
+ "properties": {
89
+ "currency": {
90
+ "type": "string",
91
+ "const": "USD"
92
+ },
93
+ "microdollars": {
94
+ "type": "string",
95
+ "pattern": "^(?:0|[1-9]\\d*)$"
96
+ },
97
+ "scale": {
98
+ "type": "number",
99
+ "const": 6
100
+ }
101
+ },
102
+ "required": ["currency", "microdollars", "scale"]
103
+ },
104
+ "duration": {
105
+ "type": "string",
106
+ "enum": ["once", "repeating"]
107
+ },
108
+ "durationInMonths": {
109
+ "type": "integer",
110
+ "minimum": 1,
111
+ "maximum": 12
112
+ }
113
+ },
114
+ "required": ["kind", "duration"]
115
+ }
116
+ ]
117
+ },
118
+ "state": {
119
+ "type": "string",
120
+ "enum": ["active", "expired", "revoked"]
121
+ },
122
+ "startsAt": {
123
+ "type": "string",
124
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
125
+ },
126
+ "endsAt": {
127
+ "type": "string",
128
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
129
+ },
130
+ "revokedAt": {
131
+ "type": "string",
132
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
133
+ }
134
+ },
135
+ "required": ["id", "source", "benefit", "state", "startsAt"]
136
+ },
137
+ "promotions": {
138
+ "type": "object",
139
+ "properties": {
140
+ "grants": {
141
+ "type": "array",
142
+ "items": {
143
+ "type": "object",
144
+ "properties": {
145
+ "id": {
146
+ "type": "string",
147
+ "pattern": "^grn_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
148
+ },
149
+ "source": {
150
+ "type": "string",
151
+ "enum": ["operator", "code"]
152
+ },
153
+ "benefit": {
154
+ "oneOf": [
155
+ {
156
+ "type": "object",
157
+ "properties": {
158
+ "kind": {
159
+ "type": "string",
160
+ "const": "credit"
161
+ },
162
+ "amount": {
163
+ "type": "object",
164
+ "properties": {
165
+ "currency": {
166
+ "type": "string",
167
+ "const": "USD"
168
+ },
169
+ "microdollars": {
170
+ "type": "string",
171
+ "pattern": "^(?:0|[1-9]\\d*)$"
172
+ },
173
+ "scale": {
174
+ "type": "number",
175
+ "const": 6
176
+ }
177
+ },
178
+ "required": ["currency", "microdollars", "scale"]
179
+ }
180
+ },
181
+ "required": ["kind", "amount"]
182
+ },
183
+ {
184
+ "type": "object",
185
+ "properties": {
186
+ "kind": {
187
+ "type": "string",
188
+ "const": "project-slot"
189
+ },
190
+ "project": {
191
+ "type": "string",
192
+ "pattern": "^proj_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
193
+ }
194
+ },
195
+ "required": ["kind", "project"]
196
+ },
197
+ {
198
+ "type": "object",
199
+ "properties": {
200
+ "kind": {
201
+ "type": "string",
202
+ "const": "perk"
203
+ },
204
+ "perk": {
205
+ "type": "string",
206
+ "pattern": "^[a-z][a-z0-9-]{0,63}$"
207
+ }
208
+ },
209
+ "required": ["kind", "perk"]
210
+ },
211
+ {
212
+ "type": "object",
213
+ "properties": {
214
+ "kind": {
215
+ "type": "string",
216
+ "const": "discount"
217
+ },
218
+ "percentOff": {
219
+ "type": "integer",
220
+ "minimum": 1,
221
+ "maximum": 100
222
+ },
223
+ "amountOff": {
224
+ "type": "object",
225
+ "properties": {
226
+ "currency": {
227
+ "type": "string",
228
+ "const": "USD"
229
+ },
230
+ "microdollars": {
231
+ "type": "string",
232
+ "pattern": "^(?:0|[1-9]\\d*)$"
233
+ },
234
+ "scale": {
235
+ "type": "number",
236
+ "const": 6
237
+ }
238
+ },
239
+ "required": ["currency", "microdollars", "scale"]
240
+ },
241
+ "duration": {
242
+ "type": "string",
243
+ "enum": ["once", "repeating"]
244
+ },
245
+ "durationInMonths": {
246
+ "type": "integer",
247
+ "minimum": 1,
248
+ "maximum": 12
249
+ }
250
+ },
251
+ "required": ["kind", "duration"]
252
+ }
253
+ ]
254
+ },
255
+ "state": {
256
+ "type": "string",
257
+ "enum": ["active", "expired", "revoked"]
258
+ },
259
+ "startsAt": {
260
+ "type": "string",
261
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
262
+ },
263
+ "endsAt": {
264
+ "type": "string",
265
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
266
+ },
267
+ "revokedAt": {
268
+ "type": "string",
269
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
270
+ }
271
+ },
272
+ "required": ["id", "source", "benefit", "state", "startsAt"]
273
+ }
274
+ },
275
+ "projectCapacity": {
276
+ "type": "object",
277
+ "properties": {
278
+ "included": {
279
+ "type": "integer",
280
+ "minimum": 0,
281
+ "maximum": 9007199254740991
282
+ },
283
+ "paid": {
284
+ "type": "integer",
285
+ "minimum": 0,
286
+ "maximum": 9007199254740991
287
+ },
288
+ "complimentary": {
289
+ "type": "integer",
290
+ "minimum": 0,
291
+ "maximum": 9007199254740991
292
+ }
293
+ },
294
+ "required": ["included", "paid", "complimentary"]
295
+ },
296
+ "perks": {
297
+ "type": "array",
298
+ "items": {
299
+ "type": "object",
300
+ "properties": {
301
+ "perk": {
302
+ "type": "string",
303
+ "pattern": "^[a-z][a-z0-9-]{0,63}$"
304
+ },
305
+ "endsAt": {
306
+ "type": "string",
307
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
308
+ }
309
+ },
310
+ "required": ["perk", "endsAt"]
311
+ }
312
+ },
313
+ "restrictions": {
314
+ "type": "array",
315
+ "items": {
316
+ "type": "string",
317
+ "minLength": 1,
318
+ "maxLength": 300
319
+ }
320
+ }
321
+ },
322
+ "required": ["grants", "projectCapacity", "perks", "restrictions"]
323
+ }
324
+ },
325
+ "required": ["grant", "promotions"]
326
+ }
@@ -164,6 +164,330 @@
164
164
  }
165
165
  },
166
166
  "required": ["currency", "microdollars", "scale"]
167
+ },
168
+ "byKind": {
169
+ "type": "object",
170
+ "properties": {
171
+ "purchased": {
172
+ "type": "object",
173
+ "properties": {
174
+ "available": {
175
+ "type": "object",
176
+ "properties": {
177
+ "currency": {
178
+ "type": "string",
179
+ "const": "USD"
180
+ },
181
+ "microdollars": {
182
+ "type": "string",
183
+ "pattern": "^(?:0|[1-9]\\d*)$"
184
+ },
185
+ "scale": {
186
+ "type": "number",
187
+ "const": 6
188
+ }
189
+ },
190
+ "required": ["currency", "microdollars", "scale"]
191
+ },
192
+ "reserved": {
193
+ "type": "object",
194
+ "properties": {
195
+ "currency": {
196
+ "type": "string",
197
+ "const": "USD"
198
+ },
199
+ "microdollars": {
200
+ "type": "string",
201
+ "pattern": "^(?:0|[1-9]\\d*)$"
202
+ },
203
+ "scale": {
204
+ "type": "number",
205
+ "const": 6
206
+ }
207
+ },
208
+ "required": ["currency", "microdollars", "scale"]
209
+ },
210
+ "consumed": {
211
+ "type": "object",
212
+ "properties": {
213
+ "currency": {
214
+ "type": "string",
215
+ "const": "USD"
216
+ },
217
+ "microdollars": {
218
+ "type": "string",
219
+ "pattern": "^(?:0|[1-9]\\d*)$"
220
+ },
221
+ "scale": {
222
+ "type": "number",
223
+ "const": 6
224
+ }
225
+ },
226
+ "required": ["currency", "microdollars", "scale"]
227
+ },
228
+ "forfeited": {
229
+ "type": "object",
230
+ "properties": {
231
+ "currency": {
232
+ "type": "string",
233
+ "const": "USD"
234
+ },
235
+ "microdollars": {
236
+ "type": "string",
237
+ "pattern": "^(?:0|[1-9]\\d*)$"
238
+ },
239
+ "scale": {
240
+ "type": "number",
241
+ "const": 6
242
+ }
243
+ },
244
+ "required": ["currency", "microdollars", "scale"]
245
+ },
246
+ "granted": {
247
+ "type": "object",
248
+ "properties": {
249
+ "currency": {
250
+ "type": "string",
251
+ "const": "USD"
252
+ },
253
+ "microdollars": {
254
+ "type": "string",
255
+ "pattern": "^(?:0|[1-9]\\d*)$"
256
+ },
257
+ "scale": {
258
+ "type": "number",
259
+ "const": 6
260
+ }
261
+ },
262
+ "required": ["currency", "microdollars", "scale"]
263
+ },
264
+ "expiresAt": {
265
+ "type": "string",
266
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
267
+ }
268
+ },
269
+ "required": [
270
+ "available",
271
+ "reserved",
272
+ "consumed",
273
+ "forfeited",
274
+ "granted"
275
+ ]
276
+ },
277
+ "trial": {
278
+ "type": "object",
279
+ "properties": {
280
+ "available": {
281
+ "type": "object",
282
+ "properties": {
283
+ "currency": {
284
+ "type": "string",
285
+ "const": "USD"
286
+ },
287
+ "microdollars": {
288
+ "type": "string",
289
+ "pattern": "^(?:0|[1-9]\\d*)$"
290
+ },
291
+ "scale": {
292
+ "type": "number",
293
+ "const": 6
294
+ }
295
+ },
296
+ "required": ["currency", "microdollars", "scale"]
297
+ },
298
+ "reserved": {
299
+ "type": "object",
300
+ "properties": {
301
+ "currency": {
302
+ "type": "string",
303
+ "const": "USD"
304
+ },
305
+ "microdollars": {
306
+ "type": "string",
307
+ "pattern": "^(?:0|[1-9]\\d*)$"
308
+ },
309
+ "scale": {
310
+ "type": "number",
311
+ "const": 6
312
+ }
313
+ },
314
+ "required": ["currency", "microdollars", "scale"]
315
+ },
316
+ "consumed": {
317
+ "type": "object",
318
+ "properties": {
319
+ "currency": {
320
+ "type": "string",
321
+ "const": "USD"
322
+ },
323
+ "microdollars": {
324
+ "type": "string",
325
+ "pattern": "^(?:0|[1-9]\\d*)$"
326
+ },
327
+ "scale": {
328
+ "type": "number",
329
+ "const": 6
330
+ }
331
+ },
332
+ "required": ["currency", "microdollars", "scale"]
333
+ },
334
+ "forfeited": {
335
+ "type": "object",
336
+ "properties": {
337
+ "currency": {
338
+ "type": "string",
339
+ "const": "USD"
340
+ },
341
+ "microdollars": {
342
+ "type": "string",
343
+ "pattern": "^(?:0|[1-9]\\d*)$"
344
+ },
345
+ "scale": {
346
+ "type": "number",
347
+ "const": 6
348
+ }
349
+ },
350
+ "required": ["currency", "microdollars", "scale"]
351
+ },
352
+ "granted": {
353
+ "type": "object",
354
+ "properties": {
355
+ "currency": {
356
+ "type": "string",
357
+ "const": "USD"
358
+ },
359
+ "microdollars": {
360
+ "type": "string",
361
+ "pattern": "^(?:0|[1-9]\\d*)$"
362
+ },
363
+ "scale": {
364
+ "type": "number",
365
+ "const": 6
366
+ }
367
+ },
368
+ "required": ["currency", "microdollars", "scale"]
369
+ },
370
+ "expiresAt": {
371
+ "type": "string",
372
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
373
+ }
374
+ },
375
+ "required": [
376
+ "available",
377
+ "reserved",
378
+ "consumed",
379
+ "forfeited",
380
+ "granted"
381
+ ]
382
+ },
383
+ "promotional": {
384
+ "type": "object",
385
+ "properties": {
386
+ "available": {
387
+ "type": "object",
388
+ "properties": {
389
+ "currency": {
390
+ "type": "string",
391
+ "const": "USD"
392
+ },
393
+ "microdollars": {
394
+ "type": "string",
395
+ "pattern": "^(?:0|[1-9]\\d*)$"
396
+ },
397
+ "scale": {
398
+ "type": "number",
399
+ "const": 6
400
+ }
401
+ },
402
+ "required": ["currency", "microdollars", "scale"]
403
+ },
404
+ "reserved": {
405
+ "type": "object",
406
+ "properties": {
407
+ "currency": {
408
+ "type": "string",
409
+ "const": "USD"
410
+ },
411
+ "microdollars": {
412
+ "type": "string",
413
+ "pattern": "^(?:0|[1-9]\\d*)$"
414
+ },
415
+ "scale": {
416
+ "type": "number",
417
+ "const": 6
418
+ }
419
+ },
420
+ "required": ["currency", "microdollars", "scale"]
421
+ },
422
+ "consumed": {
423
+ "type": "object",
424
+ "properties": {
425
+ "currency": {
426
+ "type": "string",
427
+ "const": "USD"
428
+ },
429
+ "microdollars": {
430
+ "type": "string",
431
+ "pattern": "^(?:0|[1-9]\\d*)$"
432
+ },
433
+ "scale": {
434
+ "type": "number",
435
+ "const": 6
436
+ }
437
+ },
438
+ "required": ["currency", "microdollars", "scale"]
439
+ },
440
+ "forfeited": {
441
+ "type": "object",
442
+ "properties": {
443
+ "currency": {
444
+ "type": "string",
445
+ "const": "USD"
446
+ },
447
+ "microdollars": {
448
+ "type": "string",
449
+ "pattern": "^(?:0|[1-9]\\d*)$"
450
+ },
451
+ "scale": {
452
+ "type": "number",
453
+ "const": 6
454
+ }
455
+ },
456
+ "required": ["currency", "microdollars", "scale"]
457
+ },
458
+ "granted": {
459
+ "type": "object",
460
+ "properties": {
461
+ "currency": {
462
+ "type": "string",
463
+ "const": "USD"
464
+ },
465
+ "microdollars": {
466
+ "type": "string",
467
+ "pattern": "^(?:0|[1-9]\\d*)$"
468
+ },
469
+ "scale": {
470
+ "type": "number",
471
+ "const": 6
472
+ }
473
+ },
474
+ "required": ["currency", "microdollars", "scale"]
475
+ },
476
+ "expiresAt": {
477
+ "type": "string",
478
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
479
+ }
480
+ },
481
+ "required": [
482
+ "available",
483
+ "reserved",
484
+ "consumed",
485
+ "forfeited",
486
+ "granted"
487
+ ]
488
+ }
489
+ },
490
+ "required": ["purchased", "trial", "promotional"]
167
491
  }
168
492
  },
169
493
  "required": ["available", "consumed", "reserved"]
@@ -16,6 +16,18 @@
16
16
  "type": "string",
17
17
  "pattern": "^ep_[0-9abcdefghjkmnpqrstvwxyz]{26}$"
18
18
  },
19
+ "external_identifier": {
20
+ "type": "string",
21
+ "minLength": 1,
22
+ "maxLength": 256,
23
+ "description": "Host application identifier, matched exactly and case-sensitively; at most 256 UTF-8 bytes. Readable by schedule readers; do not include secrets."
24
+ },
25
+ "tag": {
26
+ "type": "string",
27
+ "minLength": 1,
28
+ "maxLength": 64,
29
+ "description": "An exact, case-sensitive tag of at most 64 UTF-8 bytes."
30
+ },
19
31
  "from": {
20
32
  "type": "string",
21
33
  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"