@fleetless/contracts 10.1.0 → 11.1.0-next.1
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/CHANGELOG.md +26 -0
- package/artifacts/openapi.json +288 -24
- package/artifacts/routes.json +7 -6
- package/artifacts/schema/asset-list-response.schema.json +83 -3
- package/artifacts/schema/asset-sync-status.schema.json +83 -3
- package/artifacts/schema/billing-change-response.schema.json +42 -3
- package/artifacts/schema/billing-invoice-pdf-query.schema.json +15 -0
- package/artifacts/schema/billing-invoice.schema.json +14 -1
- package/artifacts/schema/billing-view.schema.json +14 -1
- package/artifacts/schema/bridge-asset-progress.schema.json +81 -2
- package/artifacts/schema/busy-details.schema.json +1 -1
- package/artifacts/schema/command-result.schema.json +1 -1
- package/artifacts/schema/invoke-or-service-response.schema.json +1 -1
- package/artifacts/schema/invoke-response.schema.json +1 -1
- package/artifacts/schema/job-event.schema.json +1 -1
- package/artifacts/schema/job-response.schema.json +1 -1
- package/artifacts/schema/job-run-list-response.schema.json +1 -1
- package/artifacts/schema/job-run.schema.json +1 -1
- package/artifacts/schema/job.schema.json +1 -1
- package/artifacts/schema/purchase-intent-response.schema.json +42 -3
- package/artifacts/schema/recover-held-job-response.schema.json +1 -1
- package/artifacts/schema/robot-jobs-response.schema.json +1 -1
- package/artifacts/schema-outgoing/bridge-asset-progress.schema.json +83 -3
- package/dist/assets.d.ts +20 -10
- package/dist/assets.js +38 -18
- package/dist/billing.d.ts +32 -7
- package/dist/billing.js +9 -2
- package/dist/errors.d.ts +7 -19
- package/dist/errors.js +6 -22
- package/dist/file-too-large-details.d.ts +18 -0
- package/dist/file-too-large-details.js +21 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/jobs.js +2 -2
- package/dist/protocol.d.ts +6 -2
- package/dist/protocol.js +2 -2
- package/dist/routes.js +10 -9
- package/package.json +1 -1
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"cancelled",
|
|
45
45
|
"lost"
|
|
46
46
|
],
|
|
47
|
-
"description": "How the run ended, or `running` while it is still going. `unknown` while the robot has not accounted for it — offline or silent — and updated once the bridge says how it stands. `lost` is final
|
|
47
|
+
"description": "How the run ended, or `running` while it is still going. `unknown` while the robot has not accounted for it — offline or silent — and updated once the bridge says how it stands. `lost` is final after an action server disappears before terminal status (`action_server_lost`), a later query confirms the bridge does not know the job and no active goal accounts for it (`job_unknown_to_bridge`), or a terminal goal status is observed but its result cannot be recovered within the bounded wait (`job_lost`). An unqualified bridge loss report also uses `job_lost`, with a message distinguishing it from terminal-result loss. Cloud cleanup may settle a superseded run or a deleted robot's run as `lost` without an error code. A reconnect or omission from `hello.active_jobs` alone is not final."
|
|
48
48
|
},
|
|
49
49
|
"started_at": {
|
|
50
50
|
"type": "string",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"cancelled",
|
|
40
40
|
"lost"
|
|
41
41
|
],
|
|
42
|
-
"description": "How the run ended, or `running` while it is still going. `unknown` while the robot has not accounted for it — offline or silent — and updated once the bridge says how it stands. `lost` is final
|
|
42
|
+
"description": "How the run ended, or `running` while it is still going. `unknown` while the robot has not accounted for it — offline or silent — and updated once the bridge says how it stands. `lost` is final after an action server disappears before terminal status (`action_server_lost`), a later query confirms the bridge does not know the job and no active goal accounts for it (`job_unknown_to_bridge`), or a terminal goal status is observed but its result cannot be recovered within the bounded wait (`job_lost`). An unqualified bridge loss report also uses `job_lost`, with a message distinguishing it from terminal-result loss. Cloud cleanup may settle a superseded run or a deleted robot's run as `lost` without an error code. A reconnect or omission from `hello.active_jobs` alone is not final."
|
|
43
43
|
},
|
|
44
44
|
"started_at": {
|
|
45
45
|
"type": "string",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"cancelled",
|
|
32
32
|
"lost"
|
|
33
33
|
],
|
|
34
|
-
"description": "Where the job stands: `running`, `unknown`, `succeeded`, `failed`, `cancelled` or `lost`. `unknown` is not an outcome — the robot went offline or silent and the cloud does not know yet; the slug stays occupied and the bridge's next statement resolves it, `error` naming why the cloud lost sight of it. `lost` is final
|
|
34
|
+
"description": "Where the job stands: `running`, `unknown`, `succeeded`, `failed`, `cancelled` or `lost`. `unknown` is not an outcome — the robot went offline or silent and the cloud does not know yet; the slug stays occupied and the bridge's next statement resolves it, `error` naming why the cloud lost sight of it. `lost` is final after an action server disappears before terminal status (`action_server_lost`), a later query confirms the bridge does not know the job and no active goal accounts for it (`job_unknown_to_bridge`), or a terminal goal status is observed but its result cannot be recovered within the bounded wait (`job_lost`). An unqualified bridge loss report also uses `job_lost`, with a message distinguishing it from terminal-result loss. Cloud cleanup may settle a superseded job or a deleted robot's job as `lost` without an error code. A reconnect or omission from `hello.active_jobs` alone is not final."
|
|
35
35
|
},
|
|
36
36
|
"origin": {
|
|
37
37
|
"type": "string",
|
|
@@ -1316,10 +1316,22 @@
|
|
|
1316
1316
|
"enum": [
|
|
1317
1317
|
"open",
|
|
1318
1318
|
"paid",
|
|
1319
|
-
"uncollectible"
|
|
1319
|
+
"uncollectible",
|
|
1320
|
+
"cancelled"
|
|
1320
1321
|
],
|
|
1321
1322
|
"description": "This invoice's own status."
|
|
1322
1323
|
},
|
|
1324
|
+
"cancellation_document_url": {
|
|
1325
|
+
"anyOf": [
|
|
1326
|
+
{
|
|
1327
|
+
"type": "string"
|
|
1328
|
+
},
|
|
1329
|
+
{
|
|
1330
|
+
"type": "null"
|
|
1331
|
+
}
|
|
1332
|
+
],
|
|
1333
|
+
"description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
|
|
1334
|
+
},
|
|
1323
1335
|
"currency": {
|
|
1324
1336
|
"type": "string",
|
|
1325
1337
|
"enum": [
|
|
@@ -1358,6 +1370,7 @@
|
|
|
1358
1370
|
"number",
|
|
1359
1371
|
"issued_at",
|
|
1360
1372
|
"status",
|
|
1373
|
+
"cancellation_document_url",
|
|
1361
1374
|
"currency",
|
|
1362
1375
|
"net_cents",
|
|
1363
1376
|
"vat_rate_percent",
|
|
@@ -1627,10 +1640,22 @@
|
|
|
1627
1640
|
"enum": [
|
|
1628
1641
|
"open",
|
|
1629
1642
|
"paid",
|
|
1630
|
-
"uncollectible"
|
|
1643
|
+
"uncollectible",
|
|
1644
|
+
"cancelled"
|
|
1631
1645
|
],
|
|
1632
1646
|
"description": "This invoice's own status."
|
|
1633
1647
|
},
|
|
1648
|
+
"cancellation_document_url": {
|
|
1649
|
+
"anyOf": [
|
|
1650
|
+
{
|
|
1651
|
+
"type": "string"
|
|
1652
|
+
},
|
|
1653
|
+
{
|
|
1654
|
+
"type": "null"
|
|
1655
|
+
}
|
|
1656
|
+
],
|
|
1657
|
+
"description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
|
|
1658
|
+
},
|
|
1634
1659
|
"currency": {
|
|
1635
1660
|
"type": "string",
|
|
1636
1661
|
"enum": [
|
|
@@ -1669,6 +1694,7 @@
|
|
|
1669
1694
|
"number",
|
|
1670
1695
|
"issued_at",
|
|
1671
1696
|
"status",
|
|
1697
|
+
"cancellation_document_url",
|
|
1672
1698
|
"currency",
|
|
1673
1699
|
"net_cents",
|
|
1674
1700
|
"vat_rate_percent",
|
|
@@ -2462,10 +2488,22 @@
|
|
|
2462
2488
|
"enum": [
|
|
2463
2489
|
"open",
|
|
2464
2490
|
"paid",
|
|
2465
|
-
"uncollectible"
|
|
2491
|
+
"uncollectible",
|
|
2492
|
+
"cancelled"
|
|
2466
2493
|
],
|
|
2467
2494
|
"description": "This invoice's own status."
|
|
2468
2495
|
},
|
|
2496
|
+
"cancellation_document_url": {
|
|
2497
|
+
"anyOf": [
|
|
2498
|
+
{
|
|
2499
|
+
"type": "string"
|
|
2500
|
+
},
|
|
2501
|
+
{
|
|
2502
|
+
"type": "null"
|
|
2503
|
+
}
|
|
2504
|
+
],
|
|
2505
|
+
"description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
|
|
2506
|
+
},
|
|
2469
2507
|
"currency": {
|
|
2470
2508
|
"type": "string",
|
|
2471
2509
|
"enum": [
|
|
@@ -2504,6 +2542,7 @@
|
|
|
2504
2542
|
"number",
|
|
2505
2543
|
"issued_at",
|
|
2506
2544
|
"status",
|
|
2545
|
+
"cancellation_document_url",
|
|
2507
2546
|
"currency",
|
|
2508
2547
|
"net_cents",
|
|
2509
2548
|
"vat_rate_percent",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"cancelled",
|
|
35
35
|
"lost"
|
|
36
36
|
],
|
|
37
|
-
"description": "Where the job stands: `running`, `unknown`, `succeeded`, `failed`, `cancelled` or `lost`. `unknown` is not an outcome — the robot went offline or silent and the cloud does not know yet; the slug stays occupied and the bridge's next statement resolves it, `error` naming why the cloud lost sight of it. `lost` is final
|
|
37
|
+
"description": "Where the job stands: `running`, `unknown`, `succeeded`, `failed`, `cancelled` or `lost`. `unknown` is not an outcome — the robot went offline or silent and the cloud does not know yet; the slug stays occupied and the bridge's next statement resolves it, `error` naming why the cloud lost sight of it. `lost` is final after an action server disappears before terminal status (`action_server_lost`), a later query confirms the bridge does not know the job and no active goal accounts for it (`job_unknown_to_bridge`), or a terminal goal status is observed but its result cannot be recovered within the bounded wait (`job_lost`). An unqualified bridge loss report also uses `job_lost`, with a message distinguishing it from terminal-result loss. Cloud cleanup may settle a superseded job or a deleted robot's job as `lost` without an error code. A reconnect or omission from `hello.active_jobs` alone is not final."
|
|
38
38
|
},
|
|
39
39
|
"origin": {
|
|
40
40
|
"type": "string",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"cancelled",
|
|
37
37
|
"lost"
|
|
38
38
|
],
|
|
39
|
-
"description": "Where the job stands: `running`, `unknown`, `succeeded`, `failed`, `cancelled` or `lost`. `unknown` is not an outcome — the robot went offline or silent and the cloud does not know yet; the slug stays occupied and the bridge's next statement resolves it, `error` naming why the cloud lost sight of it. `lost` is final
|
|
39
|
+
"description": "Where the job stands: `running`, `unknown`, `succeeded`, `failed`, `cancelled` or `lost`. `unknown` is not an outcome — the robot went offline or silent and the cloud does not know yet; the slug stays occupied and the bridge's next statement resolves it, `error` naming why the cloud lost sight of it. `lost` is final after an action server disappears before terminal status (`action_server_lost`), a later query confirms the bridge does not know the job and no active goal accounts for it (`job_unknown_to_bridge`), or a terminal goal status is observed but its result cannot be recovered within the bounded wait (`job_lost`). An unqualified bridge loss report also uses `job_lost`, with a message distinguishing it from terminal-result loss. Cloud cleanup may settle a superseded job or a deleted robot's job as `lost` without an error code. A reconnect or omission from `hello.active_jobs` alone is not final."
|
|
40
40
|
},
|
|
41
41
|
"origin": {
|
|
42
42
|
"type": "string",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"upload_failed",
|
|
41
41
|
"refused"
|
|
42
42
|
],
|
|
43
|
-
"description": "Why it failed. `unresolvable` means the reference names nothing the producer can find or may read, and is **permanent** — the only kind reconciliation may treat as gone. `upload_failed` means the bytes exist and the transfer did not succeed
|
|
43
|
+
"description": "Why it failed. `unresolvable` means the reference names nothing the producer can find or may read, and is **permanent** — the only kind reconciliation may treat as gone. `upload_failed` means the bytes exist and the transfer did not succeed. `refused` means the store or per-file limit refused the upload, or the producer did not examine the reference; it remains transient for reconciliation."
|
|
44
44
|
},
|
|
45
45
|
"details": {
|
|
46
|
-
"description": "The three numbers behind a `refused` entry the robot's store had no room for
|
|
46
|
+
"description": "The three numbers behind a `refused` entry the robot's store had no room for. Absent for every other kind and exclusive with `file_limit`; a forced `null` on every other entry buys nothing.",
|
|
47
47
|
"anyOf": [
|
|
48
48
|
{
|
|
49
49
|
"type": "object",
|
|
@@ -78,13 +78,93 @@
|
|
|
78
78
|
"type": "null"
|
|
79
79
|
}
|
|
80
80
|
]
|
|
81
|
+
},
|
|
82
|
+
"file_limit": {
|
|
83
|
+
"description": "The enforced per-file limit and refused file size, if known, for a `refused` upload that received `413 file_too_large`. Exclusive with store-full `details`; absent on bare refusals and every other kind.",
|
|
84
|
+
"anyOf": [
|
|
85
|
+
{
|
|
86
|
+
"type": "object",
|
|
87
|
+
"properties": {
|
|
88
|
+
"max_bytes": {
|
|
89
|
+
"type": "integer",
|
|
90
|
+
"exclusiveMinimum": 0,
|
|
91
|
+
"maximum": 9007199254740991,
|
|
92
|
+
"description": "The most one asset file can be, in bytes: `ASSET_FILE_MAX_BYTES`, the same on every plan."
|
|
93
|
+
},
|
|
94
|
+
"size_bytes": {
|
|
95
|
+
"anyOf": [
|
|
96
|
+
{
|
|
97
|
+
"type": "integer",
|
|
98
|
+
"exclusiveMinimum": 0,
|
|
99
|
+
"maximum": 9007199254740991
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"type": "null"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"description": "The refused file's size, in bytes: the announced size, or the bytes that arrived when none (or a false one) was announced; `null` only when the body limit stopped the upload and nobody counted the bytes."
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"required": [
|
|
109
|
+
"max_bytes",
|
|
110
|
+
"size_bytes"
|
|
111
|
+
],
|
|
112
|
+
"additionalProperties": false
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"type": "null"
|
|
116
|
+
}
|
|
117
|
+
]
|
|
81
118
|
}
|
|
82
119
|
},
|
|
83
120
|
"required": [
|
|
84
121
|
"reference",
|
|
85
122
|
"kind"
|
|
86
123
|
],
|
|
87
|
-
"additionalProperties": false
|
|
124
|
+
"additionalProperties": false,
|
|
125
|
+
"allOf": [
|
|
126
|
+
{
|
|
127
|
+
"if": {
|
|
128
|
+
"properties": {
|
|
129
|
+
"details": {
|
|
130
|
+
"type": "object"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"required": [
|
|
134
|
+
"details"
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
"then": {
|
|
138
|
+
"properties": {
|
|
139
|
+
"kind": {
|
|
140
|
+
"const": "refused"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"if": {
|
|
147
|
+
"properties": {
|
|
148
|
+
"file_limit": {
|
|
149
|
+
"type": "object"
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"required": [
|
|
153
|
+
"file_limit"
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
"then": {
|
|
157
|
+
"properties": {
|
|
158
|
+
"kind": {
|
|
159
|
+
"const": "refused"
|
|
160
|
+
},
|
|
161
|
+
"details": {
|
|
162
|
+
"type": "null"
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
]
|
|
88
168
|
}
|
|
89
169
|
},
|
|
90
170
|
"state": {
|
package/dist/assets.d.ts
CHANGED
|
@@ -239,19 +239,17 @@ export type AssetStoreRefusedDetails = z.infer<typeof assetStoreRefusedDetails>;
|
|
|
239
239
|
* reconciliation may treat as gone.
|
|
240
240
|
* - **`upload_failed`** — the bytes exist and the transfer did not succeed.
|
|
241
241
|
* **Transient.** The asset is still wanted; a later sync will carry it.
|
|
242
|
-
* - **`refused`** —
|
|
243
|
-
*
|
|
244
|
-
* producer
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
* unexamined.
|
|
242
|
+
* - **`refused`** — the receiver refused this file because the robot's store
|
|
243
|
+
* was full (`details`) or its per-file limit was exceeded (`file_limit`),
|
|
244
|
+
* or the producer never examined it. A `.dae` with too many internal
|
|
245
|
+
* references is one example of the latter. **Transient in the same
|
|
246
|
+
* sense**: reconciliation must not delete an asset still wanted.
|
|
248
247
|
*
|
|
249
248
|
* There was a fourth, `too_large`, for a file over a per-file ceiling. That
|
|
250
249
|
* ceiling is gone from this enum, not from the cloud: a file over
|
|
251
|
-
* `ASSET_FILE_MAX_BYTES` is refused by the cloud as `413 file_too_large`;
|
|
252
|
-
* producer that relays it reports `refused` with
|
|
253
|
-
*
|
|
254
|
-
* the gain.
|
|
250
|
+
* `ASSET_FILE_MAX_BYTES` is refused by the cloud as `413 file_too_large`;
|
|
251
|
+
* a producer that relays it reports `refused` with `file_limit`, without a
|
|
252
|
+
* fourth kind.
|
|
255
253
|
*
|
|
256
254
|
* A consumer that cannot act on the distinction may still print `reference`
|
|
257
255
|
* alone and lose nothing it had before.
|
|
@@ -274,6 +272,10 @@ export declare const assetFailure: z.ZodObject<{
|
|
|
274
272
|
used_bytes: z.ZodNumber;
|
|
275
273
|
size_bytes: z.ZodNumber;
|
|
276
274
|
}, z.core.$strip>>>;
|
|
275
|
+
file_limit: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
276
|
+
max_bytes: z.ZodNumber;
|
|
277
|
+
size_bytes: z.ZodNullable<z.ZodNumber>;
|
|
278
|
+
}, z.core.$strip>>>;
|
|
277
279
|
}, z.core.$strip>;
|
|
278
280
|
export type AssetFailure = z.infer<typeof assetFailure>;
|
|
279
281
|
export declare const assetSyncState: z.ZodEnum<{
|
|
@@ -304,6 +306,10 @@ export declare const assetSyncStatus: z.ZodObject<{
|
|
|
304
306
|
used_bytes: z.ZodNumber;
|
|
305
307
|
size_bytes: z.ZodNumber;
|
|
306
308
|
}, z.core.$strip>>>;
|
|
309
|
+
file_limit: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
310
|
+
max_bytes: z.ZodNumber;
|
|
311
|
+
size_bytes: z.ZodNullable<z.ZodNumber>;
|
|
312
|
+
}, z.core.$strip>>>;
|
|
307
313
|
}, z.core.$strip>>;
|
|
308
314
|
reason: z.ZodNullable<z.ZodString>;
|
|
309
315
|
stored: z.ZodNullable<z.ZodNumber>;
|
|
@@ -349,6 +355,10 @@ export declare const assetListResponse: z.ZodObject<{
|
|
|
349
355
|
used_bytes: z.ZodNumber;
|
|
350
356
|
size_bytes: z.ZodNumber;
|
|
351
357
|
}, z.core.$strip>>>;
|
|
358
|
+
file_limit: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
359
|
+
max_bytes: z.ZodNumber;
|
|
360
|
+
size_bytes: z.ZodNullable<z.ZodNumber>;
|
|
361
|
+
}, z.core.$strip>>>;
|
|
352
362
|
}, z.core.$strip>>;
|
|
353
363
|
reason: z.ZodNullable<z.ZodString>;
|
|
354
364
|
stored: z.ZodNullable<z.ZodNumber>;
|
package/dist/assets.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { slug } from './common.js';
|
|
4
|
+
import { fileTooLargeDetails } from './file-too-large-details.js';
|
|
4
5
|
/**
|
|
5
6
|
* The asset store.
|
|
6
7
|
*
|
|
@@ -299,19 +300,17 @@ export const assetStoreRefusedDetails = z.object({
|
|
|
299
300
|
* reconciliation may treat as gone.
|
|
300
301
|
* - **`upload_failed`** — the bytes exist and the transfer did not succeed.
|
|
301
302
|
* **Transient.** The asset is still wanted; a later sync will carry it.
|
|
302
|
-
* - **`refused`** —
|
|
303
|
-
*
|
|
304
|
-
* producer
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
* unexamined.
|
|
303
|
+
* - **`refused`** — the receiver refused this file because the robot's store
|
|
304
|
+
* was full (`details`) or its per-file limit was exceeded (`file_limit`),
|
|
305
|
+
* or the producer never examined it. A `.dae` with too many internal
|
|
306
|
+
* references is one example of the latter. **Transient in the same
|
|
307
|
+
* sense**: reconciliation must not delete an asset still wanted.
|
|
308
308
|
*
|
|
309
309
|
* There was a fourth, `too_large`, for a file over a per-file ceiling. That
|
|
310
310
|
* ceiling is gone from this enum, not from the cloud: a file over
|
|
311
|
-
* `ASSET_FILE_MAX_BYTES` is refused by the cloud as `413 file_too_large`;
|
|
312
|
-
* producer that relays it reports `refused` with
|
|
313
|
-
*
|
|
314
|
-
* the gain.
|
|
311
|
+
* `ASSET_FILE_MAX_BYTES` is refused by the cloud as `413 file_too_large`;
|
|
312
|
+
* a producer that relays it reports `refused` with `file_limit`, without a
|
|
313
|
+
* fourth kind.
|
|
315
314
|
*
|
|
316
315
|
* A consumer that cannot act on the distinction may still print `reference`
|
|
317
316
|
* alone and lose nothing it had before.
|
|
@@ -329,7 +328,7 @@ export const assetFailure = z.object({
|
|
|
329
328
|
description: 'What could not be provided, verbatim — the same string the asset would have been stored under, so a developer can match it against their own workspace by eye. For a failed URDF upload it is `robot_description`, which is **not** a mesh URI: a consumer must not assume every entry is one.',
|
|
330
329
|
}),
|
|
331
330
|
kind: assetFailureKind.meta({
|
|
332
|
-
description: 'Why it failed. `unresolvable` means the reference names nothing the producer can find or may read, and is **permanent** — the only kind reconciliation may treat as gone. `upload_failed` means the bytes exist and the transfer did not succeed
|
|
331
|
+
description: 'Why it failed. `unresolvable` means the reference names nothing the producer can find or may read, and is **permanent** — the only kind reconciliation may treat as gone. `upload_failed` means the bytes exist and the transfer did not succeed. `refused` means the store or per-file limit refused the upload, or the producer did not examine the reference; it remains transient for reconciliation.',
|
|
333
332
|
}),
|
|
334
333
|
/**
|
|
335
334
|
* **The three numbers behind a full store.**
|
|
@@ -338,15 +337,17 @@ export const assetFailure = z.object({
|
|
|
338
337
|
* not answer whether to delete an old sync or shrink the mesh;
|
|
339
338
|
* `store_bytes`, `used_bytes` and `size_bytes` do.
|
|
340
339
|
*
|
|
341
|
-
* **Present only on `refused
|
|
342
|
-
*
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
*
|
|
346
|
-
* else. A forced `details: null` on every `unresolvable` buys nothing.
|
|
340
|
+
* **Present only on store-full `refused` entries.** A per-file refusal
|
|
341
|
+
* uses `file_limit`, while a producer that stops naming individual
|
|
342
|
+
* failures carries neither set of numbers. Requiring store details for
|
|
343
|
+
* either would mean inventing them. A forced `details: null` on every
|
|
344
|
+
* `unresolvable` buys nothing.
|
|
347
345
|
*/
|
|
348
346
|
details: assetStoreRefusedDetails.nullish().meta({
|
|
349
|
-
description: 'The three numbers behind a `refused` entry the robot\'s store had no room for
|
|
347
|
+
description: 'The three numbers behind a `refused` entry the robot\'s store had no room for. Absent for every other kind and exclusive with `file_limit`; a forced `null` on every other entry buys nothing.',
|
|
348
|
+
}),
|
|
349
|
+
file_limit: fileTooLargeDetails.nullish().meta({
|
|
350
|
+
description: 'The enforced per-file limit and refused file size, if known, for a `refused` upload that received `413 file_too_large`. Exclusive with store-full `details`; absent on bare refusals and every other kind.',
|
|
350
351
|
}),
|
|
351
352
|
}).superRefine((f, ctx) => {
|
|
352
353
|
// Enforced here, not merely described above — a rule that lives only in a
|
|
@@ -354,6 +355,25 @@ export const assetFailure = z.object({
|
|
|
354
355
|
if (f.kind !== 'refused' && f.details != null) {
|
|
355
356
|
ctx.addIssue({ code: 'custom', path: ['details'], message: 'store details belong to `refused` only' });
|
|
356
357
|
}
|
|
358
|
+
if (f.file_limit != null && f.kind !== 'refused') {
|
|
359
|
+
ctx.addIssue({ code: 'custom', path: ['file_limit'], message: 'file limit belongs to `refused` only' });
|
|
360
|
+
}
|
|
361
|
+
if (f.file_limit != null && f.details != null) {
|
|
362
|
+
ctx.addIssue({ code: 'custom', path: ['file_limit'], message: 'file limit and store details are exclusive' });
|
|
363
|
+
}
|
|
364
|
+
}).meta({
|
|
365
|
+
// Zod refinements do not survive JSON Schema export. Keep the same
|
|
366
|
+
// cross-field rules on the entry so every enclosing wire artifact gets them.
|
|
367
|
+
allOf: [
|
|
368
|
+
{
|
|
369
|
+
if: { properties: { details: { type: 'object' } }, required: ['details'] },
|
|
370
|
+
then: { properties: { kind: { const: 'refused' } } },
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
if: { properties: { file_limit: { type: 'object' } }, required: ['file_limit'] },
|
|
374
|
+
then: { properties: { kind: { const: 'refused' }, details: { type: 'null' } } },
|
|
375
|
+
},
|
|
376
|
+
],
|
|
357
377
|
});
|
|
358
378
|
export const assetSyncState = z.enum(['running', 'succeeded', 'failed']);
|
|
359
379
|
export const assetSyncStatus = z.object({
|
package/dist/billing.d.ts
CHANGED
|
@@ -6238,11 +6238,12 @@ export declare const paymentMethod: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
6238
6238
|
account: z.ZodString;
|
|
6239
6239
|
}, z.core.$strip>], "kind">;
|
|
6240
6240
|
export type PaymentMethod = z.infer<typeof paymentMethod>;
|
|
6241
|
-
/** An invoice's status: `open` until paid,
|
|
6241
|
+
/** An invoice's status: `open` until paid, `cancelled` after a cancellation, or `uncollectible` after an unpaid fallback. */
|
|
6242
6242
|
export declare const invoiceStatus: z.ZodEnum<{
|
|
6243
6243
|
paid: "paid";
|
|
6244
6244
|
open: "open";
|
|
6245
6245
|
uncollectible: "uncollectible";
|
|
6246
|
+
cancelled: "cancelled";
|
|
6246
6247
|
}>;
|
|
6247
6248
|
export type InvoiceStatus = z.infer<typeof invoiceStatus>;
|
|
6248
6249
|
/** One invoice, rendered by the cloud: the number is gapless, `FL-<year>-<seq>`. */
|
|
@@ -6254,7 +6255,9 @@ export declare const billingInvoice: z.ZodObject<{
|
|
|
6254
6255
|
paid: "paid";
|
|
6255
6256
|
open: "open";
|
|
6256
6257
|
uncollectible: "uncollectible";
|
|
6258
|
+
cancelled: "cancelled";
|
|
6257
6259
|
}>;
|
|
6260
|
+
cancellation_document_url: z.ZodNullable<z.ZodString>;
|
|
6258
6261
|
currency: z.ZodEnum<{
|
|
6259
6262
|
eur: "eur";
|
|
6260
6263
|
usd: "usd";
|
|
@@ -6265,6 +6268,14 @@ export declare const billingInvoice: z.ZodObject<{
|
|
|
6265
6268
|
gross_cents: z.ZodNumber;
|
|
6266
6269
|
}, z.core.$strip>;
|
|
6267
6270
|
export type BillingInvoice = z.infer<typeof billingInvoice>;
|
|
6271
|
+
/** Optional document kind for `GET /api/billing/invoices/:id/pdf`; omitted means the original invoice. */
|
|
6272
|
+
export declare const billingInvoicePdfQuery: z.ZodObject<{
|
|
6273
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
6274
|
+
invoice: "invoice";
|
|
6275
|
+
cancellation: "cancellation";
|
|
6276
|
+
}>>;
|
|
6277
|
+
}, z.core.$strict>;
|
|
6278
|
+
export type BillingInvoicePdfQuery = z.infer<typeof billingInvoicePdfQuery>;
|
|
6268
6279
|
/**
|
|
6269
6280
|
* The org's billing account: the payer, the VAT treatment, the cycle and
|
|
6270
6281
|
* period, what is scheduled for the period's end and dunning
|
|
@@ -6397,8 +6408,8 @@ export declare const billingCharge: z.ZodObject<{
|
|
|
6397
6408
|
status: z.ZodEnum<{
|
|
6398
6409
|
paid: "paid";
|
|
6399
6410
|
uncollectible: "uncollectible";
|
|
6400
|
-
due: "due";
|
|
6401
6411
|
cancelled: "cancelled";
|
|
6412
|
+
due: "due";
|
|
6402
6413
|
}>;
|
|
6403
6414
|
currency: z.ZodLiteral<"eur">;
|
|
6404
6415
|
net_cents: z.ZodNumber;
|
|
@@ -6547,7 +6558,9 @@ export declare const billingView: z.ZodObject<{
|
|
|
6547
6558
|
paid: "paid";
|
|
6548
6559
|
open: "open";
|
|
6549
6560
|
uncollectible: "uncollectible";
|
|
6561
|
+
cancelled: "cancelled";
|
|
6550
6562
|
}>;
|
|
6563
|
+
cancellation_document_url: z.ZodNullable<z.ZodString>;
|
|
6551
6564
|
currency: z.ZodEnum<{
|
|
6552
6565
|
eur: "eur";
|
|
6553
6566
|
usd: "usd";
|
|
@@ -6567,8 +6580,8 @@ export declare const billingView: z.ZodObject<{
|
|
|
6567
6580
|
status: z.ZodEnum<{
|
|
6568
6581
|
paid: "paid";
|
|
6569
6582
|
uncollectible: "uncollectible";
|
|
6570
|
-
due: "due";
|
|
6571
6583
|
cancelled: "cancelled";
|
|
6584
|
+
due: "due";
|
|
6572
6585
|
}>;
|
|
6573
6586
|
currency: z.ZodLiteral<"eur">;
|
|
6574
6587
|
net_cents: z.ZodNumber;
|
|
@@ -6970,7 +6983,9 @@ export declare const billingChangeResponse: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
6970
6983
|
paid: "paid";
|
|
6971
6984
|
open: "open";
|
|
6972
6985
|
uncollectible: "uncollectible";
|
|
6986
|
+
cancelled: "cancelled";
|
|
6973
6987
|
}>;
|
|
6988
|
+
cancellation_document_url: z.ZodNullable<z.ZodString>;
|
|
6974
6989
|
currency: z.ZodEnum<{
|
|
6975
6990
|
eur: "eur";
|
|
6976
6991
|
usd: "usd";
|
|
@@ -6990,8 +7005,8 @@ export declare const billingChangeResponse: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
6990
7005
|
status: z.ZodEnum<{
|
|
6991
7006
|
paid: "paid";
|
|
6992
7007
|
uncollectible: "uncollectible";
|
|
6993
|
-
due: "due";
|
|
6994
7008
|
cancelled: "cancelled";
|
|
7009
|
+
due: "due";
|
|
6995
7010
|
}>;
|
|
6996
7011
|
currency: z.ZodLiteral<"eur">;
|
|
6997
7012
|
net_cents: z.ZodNumber;
|
|
@@ -7020,7 +7035,9 @@ export declare const billingChangeResponse: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
7020
7035
|
paid: "paid";
|
|
7021
7036
|
open: "open";
|
|
7022
7037
|
uncollectible: "uncollectible";
|
|
7038
|
+
cancelled: "cancelled";
|
|
7023
7039
|
}>;
|
|
7040
|
+
cancellation_document_url: z.ZodNullable<z.ZodString>;
|
|
7024
7041
|
currency: z.ZodEnum<{
|
|
7025
7042
|
eur: "eur";
|
|
7026
7043
|
usd: "usd";
|
|
@@ -7153,7 +7170,9 @@ export declare const billingChangeResponse: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
7153
7170
|
paid: "paid";
|
|
7154
7171
|
open: "open";
|
|
7155
7172
|
uncollectible: "uncollectible";
|
|
7173
|
+
cancelled: "cancelled";
|
|
7156
7174
|
}>;
|
|
7175
|
+
cancellation_document_url: z.ZodNullable<z.ZodString>;
|
|
7157
7176
|
currency: z.ZodEnum<{
|
|
7158
7177
|
eur: "eur";
|
|
7159
7178
|
usd: "usd";
|
|
@@ -7173,8 +7192,8 @@ export declare const billingChangeResponse: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
7173
7192
|
status: z.ZodEnum<{
|
|
7174
7193
|
paid: "paid";
|
|
7175
7194
|
uncollectible: "uncollectible";
|
|
7176
|
-
due: "due";
|
|
7177
7195
|
cancelled: "cancelled";
|
|
7196
|
+
due: "due";
|
|
7178
7197
|
}>;
|
|
7179
7198
|
currency: z.ZodLiteral<"eur">;
|
|
7180
7199
|
net_cents: z.ZodNumber;
|
|
@@ -7470,7 +7489,9 @@ export declare const purchaseIntentResponse: z.ZodUnion<readonly [z.ZodDiscrimin
|
|
|
7470
7489
|
paid: "paid";
|
|
7471
7490
|
open: "open";
|
|
7472
7491
|
uncollectible: "uncollectible";
|
|
7492
|
+
cancelled: "cancelled";
|
|
7473
7493
|
}>;
|
|
7494
|
+
cancellation_document_url: z.ZodNullable<z.ZodString>;
|
|
7474
7495
|
currency: z.ZodEnum<{
|
|
7475
7496
|
eur: "eur";
|
|
7476
7497
|
usd: "usd";
|
|
@@ -7490,8 +7511,8 @@ export declare const purchaseIntentResponse: z.ZodUnion<readonly [z.ZodDiscrimin
|
|
|
7490
7511
|
status: z.ZodEnum<{
|
|
7491
7512
|
paid: "paid";
|
|
7492
7513
|
uncollectible: "uncollectible";
|
|
7493
|
-
due: "due";
|
|
7494
7514
|
cancelled: "cancelled";
|
|
7515
|
+
due: "due";
|
|
7495
7516
|
}>;
|
|
7496
7517
|
currency: z.ZodLiteral<"eur">;
|
|
7497
7518
|
net_cents: z.ZodNumber;
|
|
@@ -7520,7 +7541,9 @@ export declare const purchaseIntentResponse: z.ZodUnion<readonly [z.ZodDiscrimin
|
|
|
7520
7541
|
paid: "paid";
|
|
7521
7542
|
open: "open";
|
|
7522
7543
|
uncollectible: "uncollectible";
|
|
7544
|
+
cancelled: "cancelled";
|
|
7523
7545
|
}>;
|
|
7546
|
+
cancellation_document_url: z.ZodNullable<z.ZodString>;
|
|
7524
7547
|
currency: z.ZodEnum<{
|
|
7525
7548
|
eur: "eur";
|
|
7526
7549
|
usd: "usd";
|
|
@@ -7653,7 +7676,9 @@ export declare const purchaseIntentResponse: z.ZodUnion<readonly [z.ZodDiscrimin
|
|
|
7653
7676
|
paid: "paid";
|
|
7654
7677
|
open: "open";
|
|
7655
7678
|
uncollectible: "uncollectible";
|
|
7679
|
+
cancelled: "cancelled";
|
|
7656
7680
|
}>;
|
|
7681
|
+
cancellation_document_url: z.ZodNullable<z.ZodString>;
|
|
7657
7682
|
currency: z.ZodEnum<{
|
|
7658
7683
|
eur: "eur";
|
|
7659
7684
|
usd: "usd";
|
|
@@ -7673,8 +7698,8 @@ export declare const purchaseIntentResponse: z.ZodUnion<readonly [z.ZodDiscrimin
|
|
|
7673
7698
|
status: z.ZodEnum<{
|
|
7674
7699
|
paid: "paid";
|
|
7675
7700
|
uncollectible: "uncollectible";
|
|
7676
|
-
due: "due";
|
|
7677
7701
|
cancelled: "cancelled";
|
|
7702
|
+
due: "due";
|
|
7678
7703
|
}>;
|
|
7679
7704
|
currency: z.ZodLiteral<"eur">;
|
|
7680
7705
|
net_cents: z.ZodNumber;
|
package/dist/billing.js
CHANGED
|
@@ -673,8 +673,8 @@ export const paymentMethod = z.discriminatedUnion('kind', [
|
|
|
673
673
|
account: z.string().meta({ description: "The PayPal account Mollie's mandate names." }),
|
|
674
674
|
}),
|
|
675
675
|
]);
|
|
676
|
-
/** An invoice's status: `open` until paid,
|
|
677
|
-
export const invoiceStatus = z.enum(['open', 'paid', 'uncollectible']);
|
|
676
|
+
/** An invoice's status: `open` until paid, `cancelled` after a cancellation, or `uncollectible` after an unpaid fallback. */
|
|
677
|
+
export const invoiceStatus = z.enum(['open', 'paid', 'uncollectible', 'cancelled']);
|
|
678
678
|
/** One invoice, rendered by the cloud: the number is gapless, `FL-<year>-<seq>`. */
|
|
679
679
|
export const billingInvoice = z.object({
|
|
680
680
|
id: z.uuid().meta({ description: "The invoice's id." }),
|
|
@@ -683,12 +683,19 @@ export const billingInvoice = z.object({
|
|
|
683
683
|
}),
|
|
684
684
|
issued_at: z.iso.datetime().meta({ description: 'When the invoice was issued.' }),
|
|
685
685
|
status: invoiceStatus.meta({ description: 'This invoice\'s own status.' }),
|
|
686
|
+
cancellation_document_url: z.string().nullable().meta({
|
|
687
|
+
description: 'Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice\'s id, not the cancellation number.',
|
|
688
|
+
}),
|
|
686
689
|
currency: planCurrency.meta({ description: "The org's billing currency." }),
|
|
687
690
|
net_cents: z.number().int().nonnegative().meta({ description: 'The charge, excluding VAT, in integer cents.' }),
|
|
688
691
|
vat_rate_percent: z.number().int().min(0).max(100).meta({ description: 'The VAT rate applied, in whole percent.' }),
|
|
689
692
|
vat_cents: z.number().int().nonnegative().meta({ description: 'VAT, in integer cents (`vatCents`).' }),
|
|
690
693
|
gross_cents: z.number().int().nonnegative().meta({ description: 'Net plus VAT, in integer cents.' }),
|
|
691
694
|
});
|
|
695
|
+
/** Optional document kind for `GET /api/billing/invoices/:id/pdf`; omitted means the original invoice. */
|
|
696
|
+
export const billingInvoicePdfQuery = z.object({
|
|
697
|
+
kind: z.enum(['invoice', 'cancellation']).optional().meta({ description: 'The original invoice or its stored cancellation PDF; omitted means `invoice`.' }),
|
|
698
|
+
}).strict();
|
|
692
699
|
/**
|
|
693
700
|
* The org's billing account: the payer, the VAT treatment, the cycle and
|
|
694
701
|
* period, what is scheduled for the period's end and dunning
|