@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.
- package/README.md +1 -1
- package/dist/billing.d.ts +231 -1
- package/dist/billing.js +150 -1
- package/dist/callback-safety.js +13 -3
- package/dist/configuration-bounds.d.ts +13 -0
- package/dist/configuration-bounds.js +13 -0
- package/dist/effective-limits.d.ts +40 -0
- package/dist/effective-limits.js +42 -0
- package/dist/endpoints.d.ts +5 -5
- package/dist/endpoints.js +5 -5
- package/dist/first-value-journey.d.ts +1 -1
- package/dist/first-value-journey.js +11 -7
- package/dist/forecast.d.ts +111 -21
- package/dist/forecast.js +87 -24
- package/dist/index.d.ts +5 -4
- package/dist/index.js +5 -4
- package/dist/mcp.js +1 -1
- package/dist/operational-config.d.ts +101 -0
- package/dist/operational-config.js +341 -0
- package/dist/operations.d.ts +597 -16
- package/dist/operations.js +384 -23
- package/dist/partition.d.ts +17 -9
- package/dist/partition.js +3 -3
- package/dist/problems.d.ts +25 -2
- package/dist/problems.js +49 -1
- package/dist/protocol.d.ts +5 -5
- package/dist/protocol.js +2 -1
- package/dist/scheduling-records.d.ts +6 -0
- package/dist/scheduling.d.ts +37 -1
- package/dist/scheduling.js +60 -4
- package/dist/usage.js +6 -21
- package/generated/v1/examples/attempts.list.response.json +2 -0
- package/generated/v1/examples/attempts.read.response.json +2 -0
- package/generated/v1/examples/billing.fundingconfirm.response.json +120 -0
- package/generated/v1/examples/billing.invoicehistory.response.json +6 -0
- package/generated/v1/examples/billing.invoices.response.json +15 -0
- package/generated/v1/examples/billing.paymenthistory.response.json +6 -0
- package/generated/v1/examples/billing.paymentmethod.response.json +16 -0
- package/generated/v1/examples/billing.paymentmethodconfirm.request.json +3 -0
- package/generated/v1/examples/billing.paymentmethodconfirm.response.json +16 -0
- package/generated/v1/examples/billing.paymentmethodremove.request.json +3 -0
- package/generated/v1/examples/billing.paymentmethodremove.response.json +4 -0
- package/generated/v1/examples/billing.paymentmethodsetup.request.json +1 -0
- package/generated/v1/examples/billing.paymentmethodsetup.response.json +3 -0
- package/generated/v1/examples/limits.read.response.json +16 -0
- package/generated/v1/examples/occurrences.redeliver.response.json +2 -0
- package/generated/v1/first-value-journey.json +24 -8
- package/generated/v1/manifest.json +342 -10
- package/generated/v1/openapi.json +12395 -6543
- package/generated/v1/policy-matrix.json +65 -2
- package/generated/v1/schemas/attempts.list.response.json +15 -0
- package/generated/v1/schemas/attempts.read.response.json +15 -0
- package/generated/v1/schemas/billing.fundingconfirm.response.json +552 -0
- package/generated/v1/schemas/billing.invoicehistory.query.json +16 -0
- package/generated/v1/schemas/billing.invoicehistory.response.json +88 -0
- package/generated/v1/schemas/billing.invoices.response.json +51 -0
- package/generated/v1/schemas/billing.ledger.response.json +5 -0
- package/generated/v1/schemas/billing.notificationsettingsupdate.request.json +24 -17
- package/generated/v1/schemas/billing.paymenthistory.query.json +16 -0
- package/generated/v1/schemas/billing.paymenthistory.response.json +182 -0
- package/generated/v1/schemas/billing.paymentmethod.response.json +137 -0
- package/generated/v1/schemas/billing.paymentmethodconfirm.request.json +14 -0
- package/generated/v1/schemas/billing.paymentmethodconfirm.response.json +137 -0
- package/generated/v1/schemas/billing.paymentmethodremove.request.json +12 -0
- package/generated/v1/schemas/billing.paymentmethodremove.response.json +137 -0
- package/generated/v1/schemas/billing.paymentmethodsetup.request.json +12 -0
- package/generated/v1/schemas/billing.paymentmethodsetup.response.json +11 -0
- package/generated/v1/schemas/billing.purchase.request.json +4 -0
- package/generated/v1/schemas/forecast.read.request-headers.json +10 -0
- package/generated/v1/schemas/forecast.read.response.json +148 -0
- package/generated/v1/schemas/limits.read.response.json +79 -0
- package/generated/v1/schemas/occurrences.redeliver.response.json +15 -0
- package/generated/v1/snippets/billing.fundingconfirm.json +6 -0
- package/generated/v1/snippets/billing.invoicehistory.json +6 -0
- package/generated/v1/snippets/billing.invoices.json +6 -0
- package/generated/v1/snippets/billing.notificationsettingsupdate.json +1 -1
- package/generated/v1/snippets/billing.paymenthistory.json +6 -0
- package/generated/v1/snippets/billing.paymentmethod.json +6 -0
- package/generated/v1/snippets/billing.paymentmethodconfirm.json +6 -0
- package/generated/v1/snippets/billing.paymentmethodremove.json +6 -0
- package/generated/v1/snippets/billing.paymentmethodsetup.json +6 -0
- package/generated/v1/snippets/forecast.windows.json +1 -1
- package/generated/v1/snippets/limits.read.json +6 -0
- package/package.json +7 -2
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
{
|
|
2
|
+
"automaticExecutionTopUp": {
|
|
3
|
+
"ceiling": {
|
|
4
|
+
"currency": "USD",
|
|
5
|
+
"microdollars": "50000000",
|
|
6
|
+
"scale": 6
|
|
7
|
+
},
|
|
8
|
+
"currentPeriod": {
|
|
9
|
+
"end": "2026-10-01T00:00:00.000Z",
|
|
10
|
+
"pending": {
|
|
11
|
+
"currency": "USD",
|
|
12
|
+
"microdollars": "10830000",
|
|
13
|
+
"scale": 6
|
|
14
|
+
},
|
|
15
|
+
"remaining": {
|
|
16
|
+
"currency": "USD",
|
|
17
|
+
"microdollars": "29170000",
|
|
18
|
+
"scale": 6
|
|
19
|
+
},
|
|
20
|
+
"settled": {
|
|
21
|
+
"currency": "USD",
|
|
22
|
+
"microdollars": "10000000",
|
|
23
|
+
"scale": 6
|
|
24
|
+
},
|
|
25
|
+
"start": "2026-09-01T00:00:00.000Z"
|
|
26
|
+
},
|
|
27
|
+
"rule": {
|
|
28
|
+
"cooldownUntil": null,
|
|
29
|
+
"desired": {
|
|
30
|
+
"ceiling": {
|
|
31
|
+
"currency": "USD",
|
|
32
|
+
"microdollars": "50000000",
|
|
33
|
+
"scale": 6
|
|
34
|
+
},
|
|
35
|
+
"credit": {
|
|
36
|
+
"currency": "USD",
|
|
37
|
+
"microdollars": "10000000",
|
|
38
|
+
"scale": 6
|
|
39
|
+
},
|
|
40
|
+
"triggerBelow": {
|
|
41
|
+
"currency": "USD",
|
|
42
|
+
"microdollars": "2000000",
|
|
43
|
+
"scale": 6
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"effective": {
|
|
47
|
+
"ceiling": {
|
|
48
|
+
"currency": "USD",
|
|
49
|
+
"microdollars": "50000000",
|
|
50
|
+
"scale": 6
|
|
51
|
+
},
|
|
52
|
+
"credit": {
|
|
53
|
+
"currency": "USD",
|
|
54
|
+
"microdollars": "10000000",
|
|
55
|
+
"scale": 6
|
|
56
|
+
},
|
|
57
|
+
"triggerBelow": {
|
|
58
|
+
"currency": "USD",
|
|
59
|
+
"microdollars": "2000000",
|
|
60
|
+
"scale": 6
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"state": "ready",
|
|
64
|
+
"suspension": null
|
|
65
|
+
},
|
|
66
|
+
"revision": 3
|
|
67
|
+
},
|
|
68
|
+
"credit": {
|
|
69
|
+
"amountOwed": {
|
|
70
|
+
"currency": "USD",
|
|
71
|
+
"microdollars": "0",
|
|
72
|
+
"scale": 6
|
|
73
|
+
},
|
|
74
|
+
"available": {
|
|
75
|
+
"currency": "USD",
|
|
76
|
+
"microdollars": "9000000",
|
|
77
|
+
"scale": 6
|
|
78
|
+
},
|
|
79
|
+
"reserved": {
|
|
80
|
+
"currency": "USD",
|
|
81
|
+
"microdollars": "10",
|
|
82
|
+
"scale": 6
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"freshness": {
|
|
86
|
+
"kind": "authoritative"
|
|
87
|
+
},
|
|
88
|
+
"paymentOperations": [
|
|
89
|
+
{
|
|
90
|
+
"createdAt": "2026-09-10T12:00:00.000Z",
|
|
91
|
+
"credit": {
|
|
92
|
+
"currency": "USD",
|
|
93
|
+
"microdollars": "10000000",
|
|
94
|
+
"scale": 6
|
|
95
|
+
},
|
|
96
|
+
"gross": {
|
|
97
|
+
"currency": "USD",
|
|
98
|
+
"microdollars": "10830000",
|
|
99
|
+
"scale": 6
|
|
100
|
+
},
|
|
101
|
+
"id": "funding-operation-example",
|
|
102
|
+
"kind": "automatic",
|
|
103
|
+
"paymentUrl": "https://pay.stripe.com/receipts/acct_example/example",
|
|
104
|
+
"reason": "payment-required",
|
|
105
|
+
"state": "pending",
|
|
106
|
+
"tax": {
|
|
107
|
+
"currency": "USD",
|
|
108
|
+
"microdollars": "830000",
|
|
109
|
+
"scale": 6
|
|
110
|
+
},
|
|
111
|
+
"taxStatus": "confirmed",
|
|
112
|
+
"updatedAt": "2026-09-10T12:00:01.000Z"
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
"subscribedProjectFees": {
|
|
116
|
+
"currency": "USD",
|
|
117
|
+
"microdollars": "5000000",
|
|
118
|
+
"scale": 6
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"id": "in_example_project_charge",
|
|
5
|
+
"createdAt": "2026-09-01T12:00:00.000Z",
|
|
6
|
+
"amount": {
|
|
7
|
+
"currency": "USD",
|
|
8
|
+
"microdollars": "5000000",
|
|
9
|
+
"scale": 6
|
|
10
|
+
},
|
|
11
|
+
"state": "paid",
|
|
12
|
+
"receiptUrl": "https://invoice.stripe.com/i/acct_example/example"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"limits": {
|
|
3
|
+
"inlinePayloadBytes": 65536,
|
|
4
|
+
"forecastHorizonSeconds": 90000,
|
|
5
|
+
"usageWindowDays": 366
|
|
6
|
+
},
|
|
7
|
+
"provenance": {
|
|
8
|
+
"inlinePayloadBytes": "default",
|
|
9
|
+
"forecastHorizonSeconds": "default",
|
|
10
|
+
"usageWindowDays": "default"
|
|
11
|
+
},
|
|
12
|
+
"revision": {
|
|
13
|
+
"global": 0,
|
|
14
|
+
"organization": 0
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
"attempt": {
|
|
3
3
|
"attemptNumber": 3,
|
|
4
4
|
"delivery": "dlv_21h8xyz9k2m4n6p8r0t2v4w6y8",
|
|
5
|
+
"dispatchRecoveries": 0,
|
|
5
6
|
"id": "att_21h8xyz9k2m4n6p8r0t2v4w6y8",
|
|
7
|
+
"localReceiptRecoveries": 0,
|
|
6
8
|
"occurrence": "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
|
|
7
9
|
"startedAt": "2026-07-28T15:05:00.000Z",
|
|
8
10
|
"trigger": {
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
"contractVersion": "2026-08-22",
|
|
3
3
|
"prerequisites": [
|
|
4
4
|
{
|
|
5
|
-
"action": "Accept your
|
|
5
|
+
"action": "Accept your GreatWait invitation, sign in, and create a project in the dashboard.",
|
|
6
6
|
"because": "projects.create accepts only a signed-in member, so a project is created by a person rather than by an API credential.",
|
|
7
7
|
"id": "project",
|
|
8
8
|
"title": "A project"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
|
-
"action": "In that project, create an API credential and copy the secret it shows once.",
|
|
11
|
+
"action": "In that project, create an API credential with endpoints:write, occurrences:read, schedules:read and schedules:write, and copy the secret it shows once. The key picker starts with nothing selected and refuses an empty one, so those four are the boxes to tick.",
|
|
12
12
|
"because": "credentials.create accepts only a signed-in member: a credential that could mint another credential would make revoking one meaningless.",
|
|
13
13
|
"id": "credential",
|
|
14
14
|
"title": "An API credential"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"action": "Have an HTTPS URL of your own that answers POST with a 2xx status, and can be reached from the public internet.",
|
|
18
|
-
"because": "
|
|
18
|
+
"because": "GreatWait delivers your callback to an address you control. It does not offer a shared receiver to try, and it will not send your payload to a third-party inspection service on your behalf.",
|
|
19
19
|
"id": "receiver",
|
|
20
20
|
"title": "An HTTPS receiver you control"
|
|
21
21
|
}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"observe": "The service name and the environment you meant to work in. If the environment is not the one you expect, stop and fix GREATWAIT_API_URL before creating anything.",
|
|
29
29
|
"operationId": "meta.version",
|
|
30
30
|
"path": "/__greatwait/version",
|
|
31
|
-
"purpose": "Confirms the origin you are pointed at is a
|
|
31
|
+
"purpose": "Confirms the origin you are pointed at is a GreatWait API and says which environment it serves. It needs no credential, so it separates 'wrong URL' from 'wrong key'.",
|
|
32
32
|
"recovery": [
|
|
33
33
|
{
|
|
34
34
|
"nextMove": "Something answered, but not this service. Check GREATWAIT_API_URL — a 404 here comes from a proxy in front of the API rather than from the API, so it carries no problem document to read.",
|
|
@@ -39,7 +39,11 @@
|
|
|
39
39
|
"when": "no-response"
|
|
40
40
|
}
|
|
41
41
|
],
|
|
42
|
-
"problems": [
|
|
42
|
+
"problems": [
|
|
43
|
+
"capability_not_configured",
|
|
44
|
+
"rate_limited",
|
|
45
|
+
"service_unavailable"
|
|
46
|
+
],
|
|
43
47
|
"scopes": [],
|
|
44
48
|
"successStatus": 200,
|
|
45
49
|
"title": "Check which service and environment you reached",
|
|
@@ -76,6 +80,7 @@
|
|
|
76
80
|
],
|
|
77
81
|
"problems": [
|
|
78
82
|
"authentication_required",
|
|
83
|
+
"capability_not_configured",
|
|
79
84
|
"credential_expired",
|
|
80
85
|
"credential_revoked",
|
|
81
86
|
"invalid_request",
|
|
@@ -106,7 +111,7 @@
|
|
|
106
111
|
],
|
|
107
112
|
"key": "create-destination",
|
|
108
113
|
"method": "POST",
|
|
109
|
-
"observe": "An endpoint identifier, and a signing secret
|
|
114
|
+
"observe": "An endpoint identifier, and a signing secret. Store it now: this is the only call that returns it, and reading the endpoint back shows a redacted prefix instead. It is not gone if you lose it — a signed-in member can read it again on the endpoint's own page in the dashboard, which is the one caller `endpoints.revealSigningSecret` accepts.",
|
|
110
115
|
"operationId": "endpoints.create",
|
|
111
116
|
"path": "/v1/endpoints",
|
|
112
117
|
"purpose": "Registers the address every occurrence of this schedule is delivered to, and mints the per-endpoint signing key your receiver verifies callbacks with.",
|
|
@@ -118,6 +123,10 @@
|
|
|
118
123
|
{
|
|
119
124
|
"nextMove": "This project is at its destination ceiling. Disable a destination you no longer deliver to; disabled ones still count, because they stay readable for audit.",
|
|
120
125
|
"when": "plan_limit_reached"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"nextMove": "An active destination already delivers to this address in this project — usually one a previous run of this journey created. Reuse that destination, disable it first, or give the new one a name of its own.",
|
|
129
|
+
"when": "state_conflict"
|
|
121
130
|
}
|
|
122
131
|
],
|
|
123
132
|
"request": {
|
|
@@ -125,6 +134,7 @@
|
|
|
125
134
|
},
|
|
126
135
|
"problems": [
|
|
127
136
|
"authentication_required",
|
|
137
|
+
"capability_not_configured",
|
|
128
138
|
"credential_expired",
|
|
129
139
|
"credential_revoked",
|
|
130
140
|
"invalid_request",
|
|
@@ -179,7 +189,7 @@
|
|
|
179
189
|
"when": "invalid_request"
|
|
180
190
|
},
|
|
181
191
|
{
|
|
182
|
-
"nextMove": "This organization is at a plan ceiling —
|
|
192
|
+
"nextMove": "This organization is at a plan ceiling — the payload is larger than its plan carries, or the schedule names a new partition key when the organization's keys are full. Nothing was created; send a smaller payload or reuse a partition key that is already live, and retry.",
|
|
183
193
|
"when": "plan_limit_reached"
|
|
184
194
|
},
|
|
185
195
|
{
|
|
@@ -199,6 +209,7 @@
|
|
|
199
209
|
},
|
|
200
210
|
"problems": [
|
|
201
211
|
"authentication_required",
|
|
212
|
+
"capability_not_configured",
|
|
202
213
|
"credential_expired",
|
|
203
214
|
"credential_revoked",
|
|
204
215
|
"idempotency_key_reused",
|
|
@@ -255,6 +266,7 @@
|
|
|
255
266
|
},
|
|
256
267
|
"problems": [
|
|
257
268
|
"authentication_required",
|
|
269
|
+
"capability_not_configured",
|
|
258
270
|
"credential_expired",
|
|
259
271
|
"credential_revoked",
|
|
260
272
|
"idempotency_key_reused",
|
|
@@ -288,6 +300,7 @@
|
|
|
288
300
|
],
|
|
289
301
|
"problems": [
|
|
290
302
|
"authentication_required",
|
|
303
|
+
"capability_not_configured",
|
|
291
304
|
"credential_expired",
|
|
292
305
|
"credential_revoked",
|
|
293
306
|
"invalid_request",
|
|
@@ -323,6 +336,7 @@
|
|
|
323
336
|
],
|
|
324
337
|
"problems": [
|
|
325
338
|
"authentication_required",
|
|
339
|
+
"capability_not_configured",
|
|
326
340
|
"credential_expired",
|
|
327
341
|
"credential_revoked",
|
|
328
342
|
"invalid_request",
|
|
@@ -351,12 +365,13 @@
|
|
|
351
365
|
"when": "attempt-failed"
|
|
352
366
|
},
|
|
353
367
|
{
|
|
354
|
-
"nextMove": "Nothing reached your receiver. Confirm the URL answers a POST from the public internet, and that it is not behind an allowlist
|
|
368
|
+
"nextMove": "Nothing reached your receiver. Confirm the URL answers a POST from the public internet, and that it is not behind an allowlist GreatWait is not on.",
|
|
355
369
|
"when": "receiver-unreachable"
|
|
356
370
|
}
|
|
357
371
|
],
|
|
358
372
|
"problems": [
|
|
359
373
|
"authentication_required",
|
|
374
|
+
"capability_not_configured",
|
|
360
375
|
"credential_expired",
|
|
361
376
|
"credential_revoked",
|
|
362
377
|
"invalid_request",
|
|
@@ -387,6 +402,7 @@
|
|
|
387
402
|
],
|
|
388
403
|
"problems": [
|
|
389
404
|
"authentication_required",
|
|
405
|
+
"capability_not_configured",
|
|
390
406
|
"credential_expired",
|
|
391
407
|
"credential_revoked",
|
|
392
408
|
"invalid_request",
|