@greatwait/contracts 0.1.0-alpha.4 → 0.1.0-alpha.5

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 (84) hide show
  1. package/README.md +1 -1
  2. package/dist/billing.d.ts +231 -1
  3. package/dist/billing.js +150 -1
  4. package/dist/callback-safety.js +13 -3
  5. package/dist/configuration-bounds.d.ts +13 -0
  6. package/dist/configuration-bounds.js +13 -0
  7. package/dist/effective-limits.d.ts +40 -0
  8. package/dist/effective-limits.js +42 -0
  9. package/dist/endpoints.d.ts +5 -5
  10. package/dist/endpoints.js +5 -5
  11. package/dist/first-value-journey.d.ts +1 -1
  12. package/dist/first-value-journey.js +11 -7
  13. package/dist/forecast.d.ts +111 -21
  14. package/dist/forecast.js +87 -24
  15. package/dist/index.d.ts +5 -4
  16. package/dist/index.js +5 -4
  17. package/dist/mcp.js +1 -1
  18. package/dist/operational-config.d.ts +101 -0
  19. package/dist/operational-config.js +341 -0
  20. package/dist/operations.d.ts +597 -16
  21. package/dist/operations.js +384 -23
  22. package/dist/partition.d.ts +17 -9
  23. package/dist/partition.js +3 -3
  24. package/dist/problems.d.ts +25 -2
  25. package/dist/problems.js +49 -1
  26. package/dist/protocol.d.ts +5 -5
  27. package/dist/protocol.js +2 -1
  28. package/dist/scheduling-records.d.ts +6 -0
  29. package/dist/scheduling.d.ts +37 -1
  30. package/dist/scheduling.js +60 -4
  31. package/dist/usage.js +6 -21
  32. package/generated/v1/examples/attempts.list.response.json +2 -0
  33. package/generated/v1/examples/attempts.read.response.json +2 -0
  34. package/generated/v1/examples/billing.fundingconfirm.response.json +120 -0
  35. package/generated/v1/examples/billing.invoicehistory.response.json +6 -0
  36. package/generated/v1/examples/billing.invoices.response.json +15 -0
  37. package/generated/v1/examples/billing.paymenthistory.response.json +6 -0
  38. package/generated/v1/examples/billing.paymentmethod.response.json +16 -0
  39. package/generated/v1/examples/billing.paymentmethodconfirm.request.json +3 -0
  40. package/generated/v1/examples/billing.paymentmethodconfirm.response.json +16 -0
  41. package/generated/v1/examples/billing.paymentmethodremove.request.json +3 -0
  42. package/generated/v1/examples/billing.paymentmethodremove.response.json +4 -0
  43. package/generated/v1/examples/billing.paymentmethodsetup.request.json +1 -0
  44. package/generated/v1/examples/billing.paymentmethodsetup.response.json +3 -0
  45. package/generated/v1/examples/limits.read.response.json +16 -0
  46. package/generated/v1/examples/occurrences.redeliver.response.json +2 -0
  47. package/generated/v1/first-value-journey.json +24 -8
  48. package/generated/v1/manifest.json +342 -10
  49. package/generated/v1/openapi.json +12395 -6543
  50. package/generated/v1/policy-matrix.json +65 -2
  51. package/generated/v1/schemas/attempts.list.response.json +15 -0
  52. package/generated/v1/schemas/attempts.read.response.json +15 -0
  53. package/generated/v1/schemas/billing.fundingconfirm.response.json +552 -0
  54. package/generated/v1/schemas/billing.invoicehistory.query.json +16 -0
  55. package/generated/v1/schemas/billing.invoicehistory.response.json +88 -0
  56. package/generated/v1/schemas/billing.invoices.response.json +51 -0
  57. package/generated/v1/schemas/billing.ledger.response.json +5 -0
  58. package/generated/v1/schemas/billing.notificationsettingsupdate.request.json +24 -17
  59. package/generated/v1/schemas/billing.paymenthistory.query.json +16 -0
  60. package/generated/v1/schemas/billing.paymenthistory.response.json +182 -0
  61. package/generated/v1/schemas/billing.paymentmethod.response.json +137 -0
  62. package/generated/v1/schemas/billing.paymentmethodconfirm.request.json +14 -0
  63. package/generated/v1/schemas/billing.paymentmethodconfirm.response.json +137 -0
  64. package/generated/v1/schemas/billing.paymentmethodremove.request.json +12 -0
  65. package/generated/v1/schemas/billing.paymentmethodremove.response.json +137 -0
  66. package/generated/v1/schemas/billing.paymentmethodsetup.request.json +12 -0
  67. package/generated/v1/schemas/billing.paymentmethodsetup.response.json +11 -0
  68. package/generated/v1/schemas/billing.purchase.request.json +4 -0
  69. package/generated/v1/schemas/forecast.read.request-headers.json +10 -0
  70. package/generated/v1/schemas/forecast.read.response.json +148 -0
  71. package/generated/v1/schemas/limits.read.response.json +79 -0
  72. package/generated/v1/schemas/occurrences.redeliver.response.json +15 -0
  73. package/generated/v1/snippets/billing.fundingconfirm.json +6 -0
  74. package/generated/v1/snippets/billing.invoicehistory.json +6 -0
  75. package/generated/v1/snippets/billing.invoices.json +6 -0
  76. package/generated/v1/snippets/billing.notificationsettingsupdate.json +1 -1
  77. package/generated/v1/snippets/billing.paymenthistory.json +6 -0
  78. package/generated/v1/snippets/billing.paymentmethod.json +6 -0
  79. package/generated/v1/snippets/billing.paymentmethodconfirm.json +6 -0
  80. package/generated/v1/snippets/billing.paymentmethodremove.json +6 -0
  81. package/generated/v1/snippets/billing.paymentmethodsetup.json +6 -0
  82. package/generated/v1/snippets/forecast.windows.json +1 -1
  83. package/generated/v1/snippets/limits.read.json +6 -0
  84. package/package.json +7 -2
@@ -0,0 +1,51 @@
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
+ "id": {
11
+ "type": "string",
12
+ "minLength": 1,
13
+ "maxLength": 255
14
+ },
15
+ "createdAt": {
16
+ "type": "string",
17
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
18
+ },
19
+ "amount": {
20
+ "type": "object",
21
+ "properties": {
22
+ "currency": {
23
+ "type": "string",
24
+ "const": "USD"
25
+ },
26
+ "microdollars": {
27
+ "type": "string",
28
+ "pattern": "^(?:0|[1-9]\\d*)$"
29
+ },
30
+ "scale": {
31
+ "type": "number",
32
+ "const": 6
33
+ }
34
+ },
35
+ "required": ["currency", "microdollars", "scale"]
36
+ },
37
+ "state": {
38
+ "type": "string",
39
+ "enum": ["paid", "open", "void", "uncollectible"]
40
+ },
41
+ "receiptUrl": {
42
+ "type": "string",
43
+ "format": "uri"
44
+ }
45
+ },
46
+ "required": ["id", "createdAt", "amount", "state"]
47
+ }
48
+ }
49
+ },
50
+ "required": ["data"]
51
+ }
@@ -65,6 +65,11 @@
65
65
  "service_restored"
66
66
  ]
67
67
  },
68
+ "note": {
69
+ "type": "string",
70
+ "enum": ["provider-details-attached"],
71
+ "description": "Present when an entry moved no money despite its kind. provider-details-attached: the provider reported details of a payment already recorded; the amount is zero."
72
+ },
68
73
  "period": {
69
74
  "type": "string",
70
75
  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
@@ -8,29 +8,36 @@
8
8
  "maximum": 9007199254740991
9
9
  },
10
10
  "lowCreditThreshold": {
11
- "type": "object",
12
- "properties": {
13
- "currency": {
14
- "type": "string",
15
- "const": "USD"
11
+ "anyOf": [
12
+ {
13
+ "type": "object",
14
+ "properties": {
15
+ "currency": {
16
+ "type": "string",
17
+ "const": "USD"
18
+ },
19
+ "microdollars": {
20
+ "type": "string",
21
+ "pattern": "^(?:0|(?:[1-9]\\d{0,13}|[1-8]\\d{14}|9[01]\\d{13}|92[01]\\d{12}|922[0-2]\\d{11}|9223[0-2]\\d{10}|92233[0-6]\\d{9}|922337[01]\\d{8}|92233720[0-2]\\d{6}|922337203[0-5]\\d{5}|9223372036[0-7]\\d{4}|92233720368[0-4]\\d{3}|922337203685[0-3]\\d{2}|9223372036854[0-6]\\d|92233720368547[0-7])0000)$",
22
+ "description": "A canonical nonnegative integer multiple of 10,000 microdollars, no greater than 9,223,372,036,854,770,000.",
23
+ "maxLength": 19
24
+ },
25
+ "scale": {
26
+ "type": "number",
27
+ "const": 6
28
+ }
29
+ },
30
+ "required": ["currency", "microdollars", "scale"]
16
31
  },
17
- "microdollars": {
18
- "type": "string",
19
- "pattern": "^(?:0|(?:[1-9]\\d{0,13}|[1-8]\\d{14}|9[01]\\d{13}|92[01]\\d{12}|922[0-2]\\d{11}|9223[0-2]\\d{10}|92233[0-6]\\d{9}|922337[01]\\d{8}|92233720[0-2]\\d{6}|922337203[0-5]\\d{5}|9223372036[0-7]\\d{4}|92233720368[0-4]\\d{3}|922337203685[0-3]\\d{2}|9223372036854[0-6]\\d|92233720368547[0-7])0000)$",
20
- "description": "A canonical nonnegative integer multiple of 10,000 microdollars, no greater than 9,223,372,036,854,770,000.",
21
- "maxLength": 19
22
- },
23
- "scale": {
24
- "type": "number",
25
- "const": 6
32
+ {
33
+ "type": "null"
26
34
  }
27
- },
28
- "required": ["currency", "microdollars", "scale"]
35
+ ]
29
36
  },
30
37
  "noncriticalEmail": {
31
38
  "type": "boolean"
32
39
  }
33
40
  },
34
- "required": ["expectedRevision", "lowCreditThreshold", "noncriticalEmail"],
41
+ "required": ["expectedRevision", "noncriticalEmail"],
35
42
  "additionalProperties": false
36
43
  }
@@ -0,0 +1,16 @@
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
+ }
16
+ }
@@ -0,0 +1,182 @@
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
+ "createdAt": {
11
+ "type": "string",
12
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
13
+ },
14
+ "credit": {
15
+ "type": "object",
16
+ "properties": {
17
+ "currency": {
18
+ "type": "string",
19
+ "const": "USD"
20
+ },
21
+ "microdollars": {
22
+ "type": "string",
23
+ "pattern": "^(?:0|(?:[1-9]\\d{0,13}|[1-8]\\d{14}|9[01]\\d{13}|92[01]\\d{12}|922[0-2]\\d{11}|9223[0-2]\\d{10}|92233[0-6]\\d{9}|922337[01]\\d{8}|92233720[0-2]\\d{6}|922337203[0-5]\\d{5}|9223372036[0-7]\\d{4}|92233720368[0-4]\\d{3}|922337203685[0-3]\\d{2}|9223372036854[0-6]\\d|92233720368547[0-7])0000)$",
24
+ "description": "A canonical nonnegative integer multiple of 10,000 microdollars, no greater than 9,223,372,036,854,770,000.",
25
+ "maxLength": 19
26
+ },
27
+ "scale": {
28
+ "type": "number",
29
+ "const": 6
30
+ }
31
+ },
32
+ "required": ["currency", "microdollars", "scale"]
33
+ },
34
+ "gross": {
35
+ "anyOf": [
36
+ {
37
+ "type": "object",
38
+ "properties": {
39
+ "currency": {
40
+ "type": "string",
41
+ "const": "USD"
42
+ },
43
+ "microdollars": {
44
+ "type": "string",
45
+ "pattern": "^(?:0|[1-9]\\d*)$"
46
+ },
47
+ "scale": {
48
+ "type": "number",
49
+ "const": 6
50
+ }
51
+ },
52
+ "required": ["currency", "microdollars", "scale"]
53
+ },
54
+ {
55
+ "type": "null"
56
+ }
57
+ ]
58
+ },
59
+ "id": {
60
+ "type": "string",
61
+ "minLength": 1,
62
+ "maxLength": 255
63
+ },
64
+ "kind": {
65
+ "type": "string",
66
+ "enum": ["manual", "automatic"]
67
+ },
68
+ "paymentUrl": {
69
+ "type": "string",
70
+ "maxLength": 4096,
71
+ "format": "uri"
72
+ },
73
+ "reason": {
74
+ "type": "string",
75
+ "pattern": "^[a-z][a-z0-9-]{0,127}$"
76
+ },
77
+ "receiptUrl": {
78
+ "type": "string",
79
+ "maxLength": 4096,
80
+ "format": "uri"
81
+ },
82
+ "state": {
83
+ "type": "string",
84
+ "enum": [
85
+ "pending",
86
+ "paid",
87
+ "failed",
88
+ "authentication-required",
89
+ "action-required",
90
+ "canceled",
91
+ "refunded",
92
+ "reversed",
93
+ "disputed"
94
+ ]
95
+ },
96
+ "tax": {
97
+ "anyOf": [
98
+ {
99
+ "type": "object",
100
+ "properties": {
101
+ "currency": {
102
+ "type": "string",
103
+ "const": "USD"
104
+ },
105
+ "microdollars": {
106
+ "type": "string",
107
+ "pattern": "^(?:0|[1-9]\\d*)$"
108
+ },
109
+ "scale": {
110
+ "type": "number",
111
+ "const": 6
112
+ }
113
+ },
114
+ "required": ["currency", "microdollars", "scale"]
115
+ },
116
+ {
117
+ "type": "null"
118
+ }
119
+ ]
120
+ },
121
+ "taxStatus": {
122
+ "type": "string",
123
+ "enum": ["calculated-at-checkout", "confirmed"]
124
+ },
125
+ "updatedAt": {
126
+ "type": "string",
127
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
128
+ }
129
+ },
130
+ "required": [
131
+ "createdAt",
132
+ "credit",
133
+ "gross",
134
+ "id",
135
+ "kind",
136
+ "state",
137
+ "tax",
138
+ "taxStatus",
139
+ "updatedAt"
140
+ ]
141
+ }
142
+ },
143
+ "freshness": {
144
+ "oneOf": [
145
+ {
146
+ "type": "object",
147
+ "properties": {
148
+ "kind": {
149
+ "type": "string",
150
+ "const": "authoritative"
151
+ }
152
+ },
153
+ "required": ["kind"]
154
+ },
155
+ {
156
+ "type": "object",
157
+ "properties": {
158
+ "asOf": {
159
+ "type": "string",
160
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
161
+ },
162
+ "kind": {
163
+ "type": "string",
164
+ "const": "projected"
165
+ },
166
+ "lagSeconds": {
167
+ "type": "integer",
168
+ "minimum": 0,
169
+ "maximum": 9007199254740991
170
+ }
171
+ },
172
+ "required": ["asOf", "kind", "lagSeconds"]
173
+ }
174
+ ]
175
+ },
176
+ "nextCursor": {
177
+ "type": "string",
178
+ "minLength": 1
179
+ }
180
+ },
181
+ "required": ["data", "freshness"]
182
+ }
@@ -0,0 +1,137 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "card": {
6
+ "anyOf": [
7
+ {
8
+ "type": "object",
9
+ "properties": {
10
+ "brand": {
11
+ "type": "string",
12
+ "minLength": 1,
13
+ "maxLength": 32
14
+ },
15
+ "last4": {
16
+ "type": "string",
17
+ "pattern": "^\\d{4}$"
18
+ },
19
+ "expMonth": {
20
+ "type": "integer",
21
+ "minimum": 1,
22
+ "maximum": 12
23
+ },
24
+ "expYear": {
25
+ "type": "integer",
26
+ "minimum": 2000,
27
+ "maximum": 2200
28
+ }
29
+ },
30
+ "required": ["brand", "last4", "expMonth", "expYear"]
31
+ },
32
+ {
33
+ "type": "null"
34
+ }
35
+ ]
36
+ },
37
+ "method": {
38
+ "anyOf": [
39
+ {
40
+ "oneOf": [
41
+ {
42
+ "type": "object",
43
+ "properties": {
44
+ "brand": {
45
+ "type": "string",
46
+ "minLength": 1,
47
+ "maxLength": 32
48
+ },
49
+ "last4": {
50
+ "type": "string",
51
+ "pattern": "^\\d{4}$"
52
+ },
53
+ "expMonth": {
54
+ "type": "integer",
55
+ "minimum": 1,
56
+ "maximum": 12
57
+ },
58
+ "expYear": {
59
+ "type": "integer",
60
+ "minimum": 2000,
61
+ "maximum": 2200
62
+ },
63
+ "type": {
64
+ "type": "string",
65
+ "const": "card"
66
+ },
67
+ "label": {
68
+ "type": "string",
69
+ "minLength": 1,
70
+ "maxLength": 200
71
+ }
72
+ },
73
+ "required": [
74
+ "brand",
75
+ "last4",
76
+ "expMonth",
77
+ "expYear",
78
+ "type",
79
+ "label"
80
+ ]
81
+ },
82
+ {
83
+ "type": "object",
84
+ "properties": {
85
+ "type": {
86
+ "type": "string",
87
+ "const": "link"
88
+ },
89
+ "label": {
90
+ "type": "string",
91
+ "minLength": 1,
92
+ "maxLength": 200
93
+ },
94
+ "email": {
95
+ "anyOf": [
96
+ {
97
+ "type": "string",
98
+ "minLength": 3,
99
+ "maxLength": 320
100
+ },
101
+ {
102
+ "type": "null"
103
+ }
104
+ ]
105
+ }
106
+ },
107
+ "required": ["type", "label", "email"]
108
+ },
109
+ {
110
+ "type": "object",
111
+ "properties": {
112
+ "type": {
113
+ "type": "string",
114
+ "const": "other"
115
+ },
116
+ "label": {
117
+ "type": "string",
118
+ "minLength": 1,
119
+ "maxLength": 200
120
+ },
121
+ "providerType": {
122
+ "type": "string",
123
+ "pattern": "^[a-z][a-z0-9_]{0,63}$"
124
+ }
125
+ },
126
+ "required": ["type", "label", "providerType"]
127
+ }
128
+ ]
129
+ },
130
+ {
131
+ "type": "null"
132
+ }
133
+ ]
134
+ }
135
+ },
136
+ "required": ["card", "method"]
137
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "checkoutSession": {
6
+ "type": "string",
7
+ "minLength": 4,
8
+ "maxLength": 255,
9
+ "pattern": "^cs_[A-Za-z0-9_]+$"
10
+ }
11
+ },
12
+ "required": ["checkoutSession"],
13
+ "additionalProperties": false
14
+ }
@@ -0,0 +1,137 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "card": {
6
+ "anyOf": [
7
+ {
8
+ "type": "object",
9
+ "properties": {
10
+ "brand": {
11
+ "type": "string",
12
+ "minLength": 1,
13
+ "maxLength": 32
14
+ },
15
+ "last4": {
16
+ "type": "string",
17
+ "pattern": "^\\d{4}$"
18
+ },
19
+ "expMonth": {
20
+ "type": "integer",
21
+ "minimum": 1,
22
+ "maximum": 12
23
+ },
24
+ "expYear": {
25
+ "type": "integer",
26
+ "minimum": 2000,
27
+ "maximum": 2200
28
+ }
29
+ },
30
+ "required": ["brand", "last4", "expMonth", "expYear"]
31
+ },
32
+ {
33
+ "type": "null"
34
+ }
35
+ ]
36
+ },
37
+ "method": {
38
+ "anyOf": [
39
+ {
40
+ "oneOf": [
41
+ {
42
+ "type": "object",
43
+ "properties": {
44
+ "brand": {
45
+ "type": "string",
46
+ "minLength": 1,
47
+ "maxLength": 32
48
+ },
49
+ "last4": {
50
+ "type": "string",
51
+ "pattern": "^\\d{4}$"
52
+ },
53
+ "expMonth": {
54
+ "type": "integer",
55
+ "minimum": 1,
56
+ "maximum": 12
57
+ },
58
+ "expYear": {
59
+ "type": "integer",
60
+ "minimum": 2000,
61
+ "maximum": 2200
62
+ },
63
+ "type": {
64
+ "type": "string",
65
+ "const": "card"
66
+ },
67
+ "label": {
68
+ "type": "string",
69
+ "minLength": 1,
70
+ "maxLength": 200
71
+ }
72
+ },
73
+ "required": [
74
+ "brand",
75
+ "last4",
76
+ "expMonth",
77
+ "expYear",
78
+ "type",
79
+ "label"
80
+ ]
81
+ },
82
+ {
83
+ "type": "object",
84
+ "properties": {
85
+ "type": {
86
+ "type": "string",
87
+ "const": "link"
88
+ },
89
+ "label": {
90
+ "type": "string",
91
+ "minLength": 1,
92
+ "maxLength": 200
93
+ },
94
+ "email": {
95
+ "anyOf": [
96
+ {
97
+ "type": "string",
98
+ "minLength": 3,
99
+ "maxLength": 320
100
+ },
101
+ {
102
+ "type": "null"
103
+ }
104
+ ]
105
+ }
106
+ },
107
+ "required": ["type", "label", "email"]
108
+ },
109
+ {
110
+ "type": "object",
111
+ "properties": {
112
+ "type": {
113
+ "type": "string",
114
+ "const": "other"
115
+ },
116
+ "label": {
117
+ "type": "string",
118
+ "minLength": 1,
119
+ "maxLength": 200
120
+ },
121
+ "providerType": {
122
+ "type": "string",
123
+ "pattern": "^[a-z][a-z0-9_]{0,63}$"
124
+ }
125
+ },
126
+ "required": ["type", "label", "providerType"]
127
+ }
128
+ ]
129
+ },
130
+ {
131
+ "type": "null"
132
+ }
133
+ ]
134
+ }
135
+ },
136
+ "required": ["card", "method"]
137
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "confirmed": {
6
+ "type": "boolean",
7
+ "const": true
8
+ }
9
+ },
10
+ "required": ["confirmed"],
11
+ "additionalProperties": false
12
+ }