@fleetless/sdk 5.2.1 → 5.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.
- package/CHANGELOG.md +12 -0
- package/dist/index.cjs +1243 -1087
- package/dist/index.d.cts +148 -5
- package/dist/index.d.ts +148 -5
- package/dist/index.js +1241 -1087
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -24,7 +24,9 @@ __export(index_exports, {
|
|
|
24
24
|
CANCEL_RETURN_CODES: () => CANCEL_RETURN_CODES,
|
|
25
25
|
FleetlessError: () => FleetlessError,
|
|
26
26
|
InMemoryTokenStore: () => InMemoryTokenStore,
|
|
27
|
+
LIVE_START_REFUSALS: () => LIVE_START_REFUSALS,
|
|
27
28
|
SDK_ERROR_CODES: () => SDK_ERROR_CODES,
|
|
29
|
+
cameraOfflineDetails: () => cameraOfflineDetails,
|
|
28
30
|
cancelRejectedDetails: () => cancelRejectedDetails,
|
|
29
31
|
createClient: () => createClient,
|
|
30
32
|
parameterInvalidDetails: () => parameterInvalidDetails,
|
|
@@ -449,16 +451,16 @@ function createAssetsApi(http) {
|
|
|
449
451
|
};
|
|
450
452
|
}
|
|
451
453
|
|
|
452
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
454
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/journal-restore.js
|
|
453
455
|
var import_zod6 = require("zod");
|
|
454
456
|
|
|
455
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
457
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/journal-intents.js
|
|
456
458
|
var import_zod5 = require("zod");
|
|
457
459
|
|
|
458
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
460
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/app-users.js
|
|
459
461
|
var import_zod4 = require("zod");
|
|
460
462
|
|
|
461
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
463
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/identity.js
|
|
462
464
|
var import_zod = require("zod");
|
|
463
465
|
var password = import_zod.z.string().min(12).max(256);
|
|
464
466
|
var USER_DISPLAY_NAME_MAX = 120;
|
|
@@ -681,7 +683,7 @@ var recoveryCodesResponse = import_zod.z.object({
|
|
|
681
683
|
recovery_codes: recoveryCodesList.meta({ description: "The ten new recovery codes, lowercase, shown once. Every earlier code is void." })
|
|
682
684
|
});
|
|
683
685
|
|
|
684
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
686
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/app-mail-html.js
|
|
685
687
|
var DEFAULT_MAIL_HTML = {
|
|
686
688
|
"invite": `<!doctype html>
|
|
687
689
|
<html lang="en">
|
|
@@ -769,7 +771,7 @@ var DEFAULT_MAIL_HTML = {
|
|
|
769
771
|
`
|
|
770
772
|
};
|
|
771
773
|
|
|
772
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
774
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/legal.js
|
|
773
775
|
var import_zod2 = require("zod");
|
|
774
776
|
var httpsLegalUrl = import_zod2.z.url().max(2048).regex(/^https:\/\/(?=[A-Za-z0-9.-]{1,253}(?::[0-9]{1,5})?(?:[/?#]|$))[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*(?::(?:[0-5]?[0-9]{1,4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?(?:[/?#]|$)/).refine((value) => {
|
|
775
777
|
try {
|
|
@@ -789,7 +791,7 @@ var legalTextReferences = import_zod2.z.object({
|
|
|
789
791
|
dpa: legalDocumentReference.nullable()
|
|
790
792
|
}).strict();
|
|
791
793
|
|
|
792
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
794
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/rights.js
|
|
793
795
|
var import_zod3 = require("zod");
|
|
794
796
|
var ROLE_KEY_PATTERN = /^(?!defaults$)[a-z][a-z0-9_]{0,62}$/;
|
|
795
797
|
var ROLE_KEY_RULE = "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all \u2014 `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved.";
|
|
@@ -827,7 +829,7 @@ var ENTRY_KIND_OF = {
|
|
|
827
829
|
};
|
|
828
830
|
var SECTIONS = Object.keys(ENTRY_KIND_OF);
|
|
829
831
|
|
|
830
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
832
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/app-users.js
|
|
831
833
|
var APP_USER_DISPLAY_NAME_MAX = 120;
|
|
832
834
|
var providerSlug = import_zod4.z.string().max(40).regex(/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/, "must be lowercase and hyphen-separated, starting with a letter");
|
|
833
835
|
var appUserStatus = import_zod4.z.enum(["pending_verification", "active", "blocked"]);
|
|
@@ -1215,7 +1217,7 @@ var mailOutcome = import_zod4.z.object({
|
|
|
1215
1217
|
})
|
|
1216
1218
|
});
|
|
1217
1219
|
|
|
1218
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
1220
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/journal-intents.js
|
|
1219
1221
|
var hash = import_zod5.z.string().regex(/^[0-9a-f]{64}$/);
|
|
1220
1222
|
var uuid = import_zod5.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/);
|
|
1221
1223
|
var opaqueId = import_zod5.z.string().min(1);
|
|
@@ -1313,7 +1315,7 @@ var journalIntentV2 = import_zod5.z.discriminatedUnion("kind", [
|
|
|
1313
1315
|
...branches.slice(1).map((branch) => branch.extend(envelope))
|
|
1314
1316
|
]);
|
|
1315
1317
|
|
|
1316
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
1318
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/journal-restore.js
|
|
1317
1319
|
var hash2 = import_zod6.z.string().regex(/^[0-9a-f]{64}$/);
|
|
1318
1320
|
var uuid2 = import_zod6.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/);
|
|
1319
1321
|
var opaqueId2 = import_zod6.z.string().min(1);
|
|
@@ -1733,7 +1735,7 @@ var journalReplayReceiptBody = import_zod6.z.strictObject(receiptFields).superRe
|
|
|
1733
1735
|
}).describe("JSON Schema consumers must also verify counts, exact erase-proof set, reference bindings, kind/registry surface applicability and pass outcomes, signatures and protected-version readbacks.");
|
|
1734
1736
|
var journalReplayReceipt = journalReplayReceiptBody.safeExtend({ receipt_hash: hash2, signature: signature2 });
|
|
1735
1737
|
|
|
1736
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
1738
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/journal-manifests.js
|
|
1737
1739
|
var import_zod7 = require("zod");
|
|
1738
1740
|
var uuid3 = import_zod7.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/);
|
|
1739
1741
|
var hash3 = import_zod7.z.string().regex(/^[0-9a-f]{64}$/);
|
|
@@ -2089,7 +2091,7 @@ var journalManifestBinding = import_zod7.z.strictObject({
|
|
|
2089
2091
|
problem("Unexpected batch", ["manifest", "batches"]);
|
|
2090
2092
|
}).describe("JSON Schema consumers must also verify exact intent/scope/batch binding, sorted physical membership, original bytes and protected readbacks.");
|
|
2091
2093
|
|
|
2092
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2094
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/journal-seals.js
|
|
2093
2095
|
var import_zod8 = require("zod");
|
|
2094
2096
|
var hash4 = import_zod8.z.string().regex(/^[0-9a-f]{64}$/);
|
|
2095
2097
|
var uuid4 = import_zod8.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/);
|
|
@@ -2171,7 +2173,7 @@ var journalFinalSealBody = import_zod8.z.strictObject({
|
|
|
2171
2173
|
}, { path: ["cutoff_utc"], message: "Must equal max(ceil_to_second(T + E_max + W_max), previous C + 1 second)" }).describe("JSON Schema consumers must also verify C = max(ceil_to_second(T + E_max + W_max), previous C + 1 second), original signatures and complete drain/admission evidence.");
|
|
2172
2174
|
var journalFinalSeal = journalFinalSealBody.safeExtend({ seal_hash: hash4, signature: signature3 });
|
|
2173
2175
|
|
|
2174
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2176
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/journal-controls.js
|
|
2175
2177
|
var import_zod9 = require("zod");
|
|
2176
2178
|
var hash5 = import_zod9.z.string().regex(/^[0-9a-f]{64}$/);
|
|
2177
2179
|
var zeroHash = import_zod9.z.literal("0".repeat(64));
|
|
@@ -2274,23 +2276,23 @@ var journalRegistryActivationReceipt = import_zod9.z.union([
|
|
|
2274
2276
|
laterActivationBody.extend({ receipt_hash: hash5, signature: signature4 })
|
|
2275
2277
|
]);
|
|
2276
2278
|
|
|
2277
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2279
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/legal-offers.js
|
|
2278
2280
|
var import_zod13 = require("zod");
|
|
2279
2281
|
|
|
2280
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2282
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/plans.js
|
|
2281
2283
|
var import_zod12 = require("zod");
|
|
2282
2284
|
|
|
2283
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2285
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/purchase-operation-key.js
|
|
2284
2286
|
var import_zod10 = require("zod");
|
|
2285
2287
|
var purchaseOperationKey = import_zod10.z.uuid().meta({ description: "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input." });
|
|
2286
2288
|
|
|
2287
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2289
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/confirmation-proof.js
|
|
2288
2290
|
var import_zod11 = require("zod");
|
|
2289
2291
|
var confirmationProof = import_zod11.z.string().regex(/^[A-Za-z0-9_-]{43}$/).meta({
|
|
2290
2292
|
description: "Opaque 32-byte Cloud proof, unpadded base64url. Syntax alone is not evidence."
|
|
2291
2293
|
});
|
|
2292
2294
|
|
|
2293
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2295
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/plans.js
|
|
2294
2296
|
var planId = import_zod12.z.enum(["basic", "plus", "pro", "enterprise"]);
|
|
2295
2297
|
var PLAN_ORDER = ["basic", "plus", "pro", "enterprise"];
|
|
2296
2298
|
var planLimitKey = import_zod12.z.enum([
|
|
@@ -2599,7 +2601,7 @@ var adminPlanChangeRequest = import_zod12.z.object({
|
|
|
2599
2601
|
})
|
|
2600
2602
|
}).strict();
|
|
2601
2603
|
|
|
2602
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2604
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/legal-offers.js
|
|
2603
2605
|
var utc = import_zod13.z.iso.datetime().regex(/Z$/);
|
|
2604
2606
|
var text = import_zod13.z.string().min(1).regex(/\S/);
|
|
2605
2607
|
var cents2 = import_zod13.z.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
@@ -2735,7 +2737,7 @@ var legalOfferConflictDetails = import_zod13.z.strictObject({
|
|
|
2735
2737
|
rule: import_zod13.z.enum(["withdrawn", "stale", "expired", "reused", "boundary_changed", "deadline_unavailable"])
|
|
2736
2738
|
});
|
|
2737
2739
|
|
|
2738
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2740
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/common.js
|
|
2739
2741
|
var import_zod14 = require("zod");
|
|
2740
2742
|
var SLUG_RULE = "A name is lower-case: it starts with a letter, continues with letters and digits, and joins further words with a single underscore \u2014 `battery_voltage`. Capitals, dashes, dots, spaces, a leading digit and a doubled or trailing underscore are all refused.";
|
|
2741
2743
|
var slug = import_zod14.z.string().min(2).max(63).regex(/^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$/, SLUG_RULE);
|
|
@@ -2766,7 +2768,7 @@ var applyError = import_zod14.z.object({
|
|
|
2766
2768
|
details: import_zod14.z.record(import_zod14.z.string(), import_zod14.z.unknown()).optional()
|
|
2767
2769
|
});
|
|
2768
2770
|
|
|
2769
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2771
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/mcp.js
|
|
2770
2772
|
var import_zod15 = require("zod");
|
|
2771
2773
|
function mcpAppEndpointPath(appIdentifier2) {
|
|
2772
2774
|
return `/mcp/${appIdentifier2}`;
|
|
@@ -2811,13 +2813,13 @@ var mcpRobotDatasheet = import_zod15.z.object({
|
|
|
2811
2813
|
});
|
|
2812
2814
|
var MCP_ASSET_LINK_TTL_MS = 15 * 60 * 1e3;
|
|
2813
2815
|
|
|
2814
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2816
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/protocol.js
|
|
2815
2817
|
var import_zod22 = require("zod");
|
|
2816
2818
|
|
|
2817
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2819
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/assets.js
|
|
2818
2820
|
var import_zod17 = require("zod");
|
|
2819
2821
|
|
|
2820
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2822
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/file-too-large-details.js
|
|
2821
2823
|
var import_zod16 = require("zod");
|
|
2822
2824
|
var fileTooLargeDetails = import_zod16.z.object({
|
|
2823
2825
|
max_bytes: import_zod16.z.number().int().positive().meta({
|
|
@@ -2828,7 +2830,7 @@ var fileTooLargeDetails = import_zod16.z.object({
|
|
|
2828
2830
|
})
|
|
2829
2831
|
});
|
|
2830
2832
|
|
|
2831
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2833
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/assets.js
|
|
2832
2834
|
var assetKind = import_zod17.z.enum(["urdf", "mesh", "texture"]);
|
|
2833
2835
|
var asset = import_zod17.z.object({
|
|
2834
2836
|
id: import_zod17.z.uuid().meta({ description: "The asset's id in the store." }),
|
|
@@ -3168,10 +3170,10 @@ var assetSyncBusyDetails = import_zod17.z.object({
|
|
|
3168
3170
|
started_at_ms: import_zod17.z.number().int().nonnegative()
|
|
3169
3171
|
});
|
|
3170
3172
|
|
|
3171
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
3173
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/config.js
|
|
3172
3174
|
var import_zod19 = require("zod");
|
|
3173
3175
|
|
|
3174
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
3176
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/alerts.js
|
|
3175
3177
|
var import_zod18 = require("zod");
|
|
3176
3178
|
var alertRowCondition = import_zod18.z.discriminatedUnion("kind", [
|
|
3177
3179
|
import_zod18.z.strictObject({
|
|
@@ -3241,7 +3243,7 @@ var putDatapointDisplayRequest = import_zod18.z.object({
|
|
|
3241
3243
|
y_max: import_zod18.z.number().finite().nullable()
|
|
3242
3244
|
}).strict();
|
|
3243
3245
|
|
|
3244
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
3246
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/config.js
|
|
3245
3247
|
var RTSP_URL_RULE = "The URL has to begin with `rtsp://` or `rtsps://` \u2014 `rtsp://cam-1.plant.local/stream1`. No other scheme is accepted: the bridge opens this with a library that would equally honour `file:`.";
|
|
3246
3248
|
var MJPEG_URL_RULE = "The URL has to begin with `http://` or `https://` \u2014 `http://cam-1.plant.local/video.mjpg`. No other scheme is accepted: the bridge opens this with a library that would equally serve `file:`.";
|
|
3247
3249
|
var DEVICE_PATH_RULE = "A capture device is a path under `/dev/`, and the character straight after it is a letter or a digit \u2014 `/dev/video0`, or a stable `/dev/v4l/by-id/...` symlink. Nothing outside `/dev/` is accepted: the string reaches OpenCV, which would as happily open an ordinary file.";
|
|
@@ -3547,14 +3549,14 @@ var datapointNumeric = strictObject({
|
|
|
3547
3549
|
});
|
|
3548
3550
|
var datapointRetention = strictObject({
|
|
3549
3551
|
enabled: import_zod19.z.boolean().meta({
|
|
3550
|
-
description: "Whether values are written to the time series and become queryable. Off by default: without it the value is live only, and nobody who was not watching will ever see it."
|
|
3552
|
+
description: "Whether values are written to the time series and become queryable. Off by default: without it the value is live only, and nobody who was not watching will ever see it. It also switches the robot's buffer: with it off, the robot holds nothing for this datapoint, and switching it off drops what the robot held."
|
|
3551
3553
|
}).optional(),
|
|
3552
3554
|
interval_seconds: import_zod19.z.number().int().min(1).max(3600).meta({
|
|
3553
3555
|
description: "How often a value is written to history, in seconds; absent means `300`. **Not** how often it is sent \u2014 that is `rate_throttle_hz`. Stored points are billed, so this is the direct lever on what a robot costs, and a bumper that is true for 200 ms does not appear unless a write falls inside it.",
|
|
3554
3556
|
examples: [300, 60]
|
|
3555
3557
|
}).optional(),
|
|
3556
3558
|
max_buffer_values: import_zod19.z.number().int().min(1).max(1e5).meta({
|
|
3557
|
-
description: "How many values the robot holds while the bridge is disconnected, to be pushed once it reconnects. The catch-up runs behind live telemetry and job results at a limited rate, so closing a gap never delays the present; without it the series simply has a gap, which is an honest answer.",
|
|
3559
|
+
description: "How many values the robot holds while the bridge is disconnected, to be pushed once it reconnects. The catch-up runs behind live telemetry and job results at a limited rate, so closing a gap never delays the present; without it the series simply has a gap, which is an honest answer. It needs `enabled`, and it also holds the values low-bandwidth mode's rate cap holds back.",
|
|
3558
3560
|
examples: [5e3]
|
|
3559
3561
|
}).optional()
|
|
3560
3562
|
});
|
|
@@ -4464,7 +4466,7 @@ var configState = import_zod19.z.object({
|
|
|
4464
4466
|
applied_errors: import_zod19.z.array(applyError).nullable()
|
|
4465
4467
|
});
|
|
4466
4468
|
|
|
4467
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
4469
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/introspection.js
|
|
4468
4470
|
var import_zod20 = require("zod");
|
|
4469
4471
|
var rosGraphEntry = import_zod20.z.object({
|
|
4470
4472
|
name: rosName,
|
|
@@ -4518,7 +4520,7 @@ var typeDefinition = import_zod20.z.discriminatedUnion("kind", [
|
|
|
4518
4520
|
})
|
|
4519
4521
|
]);
|
|
4520
4522
|
|
|
4521
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
4523
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/jobs.js
|
|
4522
4524
|
var import_zod21 = require("zod");
|
|
4523
4525
|
var jobState = import_zod21.z.enum(["running", "unknown", "succeeded", "failed", "cancelled", "lost"]);
|
|
4524
4526
|
var reportedJobState = jobState.exclude(["unknown"]);
|
|
@@ -4577,7 +4579,7 @@ var job = import_zod21.z.object({
|
|
|
4577
4579
|
description: "A monotonic counter ascending in mint order, and the named tiebreaker for any listing that claims one \u2014 `started_at` alone is not a total order. Scoped per cloud process and per run: job state lives in memory, so this restarts with the registry it orders."
|
|
4578
4580
|
}),
|
|
4579
4581
|
result: import_zod21.z.unknown().nullable().meta({
|
|
4580
|
-
description: "What the call returned
|
|
4582
|
+
description: "What the call returned, shaped by the ROS action or service itself: on `succeeded`, and on `failed` or `cancelled` when the action sent a result. `null` while running, when nothing was returned, and when it was too large to send (`result_omitted`)."
|
|
4581
4583
|
}),
|
|
4582
4584
|
result_omitted: resultOmitted.optional().meta({ description: RESULT_OMITTED_DESCRIPTION }),
|
|
4583
4585
|
/**
|
|
@@ -4691,7 +4693,7 @@ var jobRun = import_zod21.z.object({
|
|
|
4691
4693
|
description: 'How long the run took, in milliseconds. `null` while it is still `running` or `unknown`, never `0` standing in for "nothing so far".'
|
|
4692
4694
|
}),
|
|
4693
4695
|
result: import_zod21.z.unknown().nullable().meta({
|
|
4694
|
-
description: "What the action or service
|
|
4696
|
+
description: "What the call returned, shaped by the ROS action or service itself: on `succeeded`, and on `failed` or `cancelled` when the action sent a result. `null` while running, when nothing was returned, and when it was too large to send (`result_omitted`)."
|
|
4695
4697
|
}),
|
|
4696
4698
|
result_omitted: resultOmitted.optional().meta({ description: RESULT_OMITTED_DESCRIPTION }),
|
|
4697
4699
|
error: import_zod21.z.object({
|
|
@@ -4773,7 +4775,7 @@ var jobRunSummary = import_zod21.z.object({
|
|
|
4773
4775
|
since_ms: import_zod21.z.number().int().nonnegative()
|
|
4774
4776
|
});
|
|
4775
4777
|
|
|
4776
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
4778
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/protocol.js
|
|
4777
4779
|
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
4778
4780
|
var MAX_PATIENCE_MS = 12e4;
|
|
4779
4781
|
var MIN_PATIENCE_MS = 1e3;
|
|
@@ -4862,6 +4864,14 @@ var bridgeLinkMode = import_zod22.z.object({
|
|
|
4862
4864
|
reason: import_zod22.z.enum(["lag", "dwell", "forced", "recovered"]).meta({ description: "`lag`: the cloud-measured lag crossed the threshold; `dwell`: the bridge-measured queue dwell did; `forced`: `mode: on` or `off`; `recovered`: both measures stayed at or below the exit threshold." }),
|
|
4863
4865
|
at_ms: import_zod22.z.number().int().nonnegative().meta({ description: "Bridge time of the transition, epoch milliseconds." })
|
|
4864
4866
|
});
|
|
4867
|
+
var failsafeWatchdogReason = import_zod22.z.enum(["self_test", "late_fire", "not_alive", "crashed"]);
|
|
4868
|
+
var bridgeFailsafeWatchdog = import_zod22.z.object({
|
|
4869
|
+
type: import_zod22.z.literal("failsafe_watchdog"),
|
|
4870
|
+
state: import_zod22.z.enum(["ok", "failed"]).meta({ description: "`ok`: the watchdog passed its self-test and holds its bound, and the bridge takes publishes; `failed`: it does not, and the bridge refuses every publish until it recovers." }),
|
|
4871
|
+
reason: failsafeWatchdogReason.nullable().meta({ description: "Why the state is `failed`; `null` with `ok`. `self_test`: the failsafe process did not start, did not answer its self-test, or its start-up self-test ran past the 10 ms bound (only then with `lateness_ms`); `late_fire`: a failsafe went out more than 10 ms after its deadline (with `lateness_ms`); `not_alive`: a second without a word from the failsafe process; `crashed`: the process ended, or it reported two errors within 60 s." }),
|
|
4872
|
+
lateness_ms: import_zod22.z.number().nonnegative().nullable().meta({ description: "The lateness that decided the state, in milliseconds after the deadline: with `ok` the self-test's it passed; with `failed` the self-test's that ran late, or the late failsafe's. `null` for `not_alive`, `crashed`, and a `self_test` whose process did not start or did not answer." }),
|
|
4873
|
+
at_ms: import_zod22.z.number().int().nonnegative().meta({ description: "Bridge time of the state change, epoch milliseconds." })
|
|
4874
|
+
});
|
|
4865
4875
|
var cloudConfig = import_zod22.z.object({
|
|
4866
4876
|
type: import_zod22.z.literal("config"),
|
|
4867
4877
|
version: import_zod22.z.number().int().nonnegative(),
|
|
@@ -5023,7 +5033,10 @@ var bridgeState = import_zod22.z.object({
|
|
|
5023
5033
|
online: import_zod22.z.boolean(),
|
|
5024
5034
|
latency_ms: import_zod22.z.number().nonnegative().nullable(),
|
|
5025
5035
|
low_bandwidth: import_zod22.z.boolean().meta({ description: "Whether the bridge is in its low-bandwidth mode: datapoints capped, cameras reduced or stopped. Bridge-reported." }),
|
|
5026
|
-
health_reason: import_zod22.z.enum(["job_query_unanswered"]).nullable().optional().meta({ description: "Cloud-observed connection health: `job_query_unanswered` after a bridge ignores held-job queries; `null` on an ordinary connect or disconnect. Optional for older observations." })
|
|
5036
|
+
health_reason: import_zod22.z.enum(["job_query_unanswered"]).nullable().optional().meta({ description: "Cloud-observed connection health: `job_query_unanswered` after a bridge ignores held-job queries; `null` on an ordinary connect or disconnect. Optional for older observations." }),
|
|
5037
|
+
failsafe: import_zod22.z.enum(["ok", "failed"]).nullable().optional().meta({ description: "The bridge's failsafe watchdog: `failed` while the bridge takes no publishes because it cannot promise a failsafe on time; `null` until the bridge states it. Bridge-reported. Optional for older observations." }),
|
|
5038
|
+
failsafe_reason: failsafeWatchdogReason.nullable().optional().meta({ description: "Why `failsafe` is `failed`, as the bridge stated it: `self_test`, `late_fire`, `not_alive` or `crashed`; `null` otherwise. Bridge-reported. Optional for older observations." }),
|
|
5039
|
+
failsafe_lateness_ms: import_zod22.z.number().nonnegative().nullable().optional().meta({ description: "The lateness that made `failsafe` `failed`, in milliseconds after the deadline, where the bridge knows it (`late_fire`, and a `self_test` that ran late); `null` otherwise. Bridge-reported. Optional for older observations." })
|
|
5027
5040
|
});
|
|
5028
5041
|
var snapshotHeader = import_zod22.z.object({
|
|
5029
5042
|
type: import_zod22.z.literal("snapshot"),
|
|
@@ -5187,11 +5200,11 @@ var bridgeCameraState = import_zod22.z.object({
|
|
|
5187
5200
|
request_id: import_zod22.z.string().min(1).max(64).nullable()
|
|
5188
5201
|
});
|
|
5189
5202
|
|
|
5190
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
5203
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/config-issues.js
|
|
5191
5204
|
var EXPOSURE_SECTIONS = ["datapoints", "actions", "services", "publishers", "cameras"];
|
|
5192
5205
|
var EXPOSURE_SECTION_NAMES = new Set(EXPOSURE_SECTIONS);
|
|
5193
5206
|
|
|
5194
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
5207
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/org-roles.js
|
|
5195
5208
|
var import_zod23 = require("zod");
|
|
5196
5209
|
var roleName = import_zod23.z.string().trim().min(1).max(ROLE_NAME_MAX);
|
|
5197
5210
|
var referencePlace = import_zod23.z.object({
|
|
@@ -5330,7 +5343,7 @@ var putRoleDefaultsRequest = import_zod23.z.object({
|
|
|
5330
5343
|
})
|
|
5331
5344
|
}).strict();
|
|
5332
5345
|
|
|
5333
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
5346
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/rest.js
|
|
5334
5347
|
var import_zod24 = require("zod");
|
|
5335
5348
|
var robot2 = import_zod24.z.object({
|
|
5336
5349
|
id: import_zod24.z.uuid().meta({
|
|
@@ -5468,7 +5481,16 @@ var configVersionResponse = import_zod24.z.object({
|
|
|
5468
5481
|
var introspectionResponse = import_zod24.z.object({
|
|
5469
5482
|
graph: rosGraph,
|
|
5470
5483
|
fetched_at: import_zod24.z.iso.datetime(),
|
|
5471
|
-
stale: import_zod24.z.boolean()
|
|
5484
|
+
stale: import_zod24.z.boolean(),
|
|
5485
|
+
bridge_version: import_zod24.z.string().nullable().optional().meta({
|
|
5486
|
+
description: "The bridge version the graph was read under. `null` for a snapshot older than this field. Absent when the server predates this field."
|
|
5487
|
+
}),
|
|
5488
|
+
types_fetched_at: import_zod24.z.iso.datetime().nullable().optional().meta({
|
|
5489
|
+
description: "When the types of this snapshot were read and replaced the stored definitions. `null` while they have not been, or when reading them failed: the stored definitions are then the older ones. Absent when the server predates this field."
|
|
5490
|
+
}),
|
|
5491
|
+
unresolved_types: import_zod24.z.array(import_zod24.z.string()).optional().meta({
|
|
5492
|
+
description: "The type names the robot could not resolve when the types of this snapshot were read, sorted; empty when every one resolved, or when they have not been read. Absent when the server predates this field."
|
|
5493
|
+
})
|
|
5472
5494
|
});
|
|
5473
5495
|
var typesResponse = import_zod24.z.object({
|
|
5474
5496
|
types: import_zod24.z.array(typeDefinition)
|
|
@@ -5975,6 +5997,13 @@ var RESOURCE_HEALTH_STATES = [
|
|
|
5975
5997
|
* `reason` names the size and the limit, built from numbers only.
|
|
5976
5998
|
*/
|
|
5977
5999
|
"too_large",
|
|
6000
|
+
/**
|
|
6001
|
+
* A camera's live video is paused because the bridge is in low-bandwidth
|
|
6002
|
+
* mode: a new stream is refused and a running one may have been ended
|
|
6003
|
+
* (fleetless/fleetless#1126). Not an error; snapshots go on. `reason` is
|
|
6004
|
+
* the cloud's fixed sentence.
|
|
6005
|
+
*/
|
|
6006
|
+
"low_bandwidth",
|
|
5978
6007
|
/**
|
|
5979
6008
|
* Something is wrong and this platform cannot say what.
|
|
5980
6009
|
*
|
|
@@ -6154,20 +6183,30 @@ var slugUsageResponse = import_zod24.z.object({
|
|
|
6154
6183
|
alert_count: import_zod24.z.number().int().nonnegative()
|
|
6155
6184
|
});
|
|
6156
6185
|
|
|
6157
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
6158
|
-
var
|
|
6186
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/realtime.js
|
|
6187
|
+
var import_zod31 = require("zod");
|
|
6188
|
+
|
|
6189
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/live-start-refusal.js
|
|
6190
|
+
var import_zod25 = require("zod");
|
|
6191
|
+
var LIVE_START_REFUSALS = ["low_bandwidth", "source_auth", "source_unreachable", "not_startable", "unknown"];
|
|
6192
|
+
var liveStartRefusal = import_zod25.z.enum(LIVE_START_REFUSALS).meta({
|
|
6193
|
+
description: "Why the robot refused to start live video: `low_bandwidth` (the link is weak; snapshots go on), `source_auth` (the source refused the credentials), `source_unreachable` (the source could not be reached), `not_startable` (the bridge could not start it; its log says why), `unknown` (a reason this cloud does not know yet)."
|
|
6194
|
+
});
|
|
6195
|
+
var cameraOfflineDetails = import_zod25.z.object({
|
|
6196
|
+
refusal: liveStartRefusal
|
|
6197
|
+
});
|
|
6198
|
+
|
|
6199
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/client-auth.js
|
|
6200
|
+
var import_zod29 = require("zod");
|
|
6159
6201
|
|
|
6160
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
6202
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/apps.js
|
|
6161
6203
|
var import_zod28 = require("zod");
|
|
6162
6204
|
|
|
6163
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
6205
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-rights.js
|
|
6164
6206
|
var import_zod27 = require("zod");
|
|
6165
6207
|
|
|
6166
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
6208
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections.js
|
|
6167
6209
|
var import_zod26 = require("zod");
|
|
6168
|
-
|
|
6169
|
-
// node_modules/.pnpm/@fleetless+contracts@18.2.0/node_modules/@fleetless/contracts/dist/collections.js
|
|
6170
|
-
var import_zod25 = require("zod");
|
|
6171
6210
|
var COLLECTIONS_FORMAT_VERSION = 1;
|
|
6172
6211
|
var COLLECTION_LIMITS = {
|
|
6173
6212
|
/** Collections in one document. */
|
|
@@ -6224,13 +6263,13 @@ var COLLECTION_LIMITS = {
|
|
|
6224
6263
|
importErrorText: 200
|
|
6225
6264
|
};
|
|
6226
6265
|
var KEY_RULE = /^[a-z][a-z0-9_]{0,62}$/;
|
|
6227
|
-
var collectionKey =
|
|
6266
|
+
var collectionKey = import_zod26.z.string().regex(KEY_RULE, {
|
|
6228
6267
|
message: "A key starts with a lowercase letter and continues with lowercase letters, digits or underscores, up to 63 characters in all."
|
|
6229
6268
|
}).meta({ description: "A collection key or a field key: `^[a-z][a-z0-9_]{0,62}$`. Keys appear in URLs, filters and record bodies; `label` is the text people read." });
|
|
6230
|
-
var collectionBinding =
|
|
6269
|
+
var collectionBinding = import_zod26.z.enum(["global", "per_robot", "one_per_robot"]).meta({
|
|
6231
6270
|
description: "`global`: records belong to the app and no robot. `per_robot`: every record belongs to one robot (system field `robot_id`, fixed when the record is created). `one_per_robot`: every robot of the app has exactly one record, which Fleetless creates itself."
|
|
6232
6271
|
});
|
|
6233
|
-
var collectionFieldType =
|
|
6272
|
+
var collectionFieldType = import_zod26.z.enum([
|
|
6234
6273
|
"text",
|
|
6235
6274
|
"long_text",
|
|
6236
6275
|
"number",
|
|
@@ -6241,70 +6280,70 @@ var collectionFieldType = import_zod25.z.enum([
|
|
|
6241
6280
|
"json",
|
|
6242
6281
|
"reference"
|
|
6243
6282
|
]);
|
|
6244
|
-
var label =
|
|
6245
|
-
var description =
|
|
6283
|
+
var label = import_zod26.z.string().max(120).meta({ description: "A short name for people to read. It may change at any time; the key is what code uses." });
|
|
6284
|
+
var description = import_zod26.z.string().max(1e3).meta({ description: "Free text that explains the field to the people who fill it in." });
|
|
6246
6285
|
var common2 = {
|
|
6247
6286
|
label: label.optional(),
|
|
6248
6287
|
description: description.optional(),
|
|
6249
|
-
required:
|
|
6250
|
-
unique:
|
|
6288
|
+
required: import_zod26.z.boolean().meta({ description: "A new record must set this field, and an update may not clear it." }).optional(),
|
|
6289
|
+
unique: import_zod26.z.union([import_zod26.z.boolean(), import_zod26.z.literal("collection")]).meta({
|
|
6251
6290
|
description: "`true`: no two records hold the same value, within the collection (`global`) or within one robot (`per_robot`, `one_per_robot`). `collection`: on a robot-bound collection, across all robots. Empty values never collide. Not allowed on `boolean` and `json` fields."
|
|
6252
6291
|
}).optional(),
|
|
6253
|
-
default:
|
|
6292
|
+
default: import_zod26.z.unknown().meta({ description: "The value a record gets when it does not set this field. It must itself be a valid value of the field." }).optional()
|
|
6254
6293
|
};
|
|
6255
|
-
var textField =
|
|
6256
|
-
type:
|
|
6294
|
+
var textField = import_zod26.z.object({
|
|
6295
|
+
type: import_zod26.z.literal("text"),
|
|
6257
6296
|
...common2,
|
|
6258
|
-
max_length:
|
|
6259
|
-
pattern:
|
|
6297
|
+
max_length: import_zod26.z.number().int().min(1).max(COLLECTION_LIMITS.textMax).meta({ description: `Longest value in characters. Default ${COLLECTION_LIMITS.textDefault}, at most ${COLLECTION_LIMITS.textMax}.` }).optional(),
|
|
6298
|
+
pattern: import_zod26.z.string().max(COLLECTION_LIMITS.patternMax).meta({
|
|
6260
6299
|
description: `A regular expression in the RE2 subset, checked in unicode mode: lookahead, lookbehind and backreferences are not supported. At most ${COLLECTION_LIMITS.patternMax.toLocaleString("en-US")} characters, and the cloud may also refuse a pattern as too complex (its compiled size is bounded; counted repeats such as \`{n}\` multiply it), which a document reports as an invalid pattern. The value must match somewhere in it; anchor it with \`^\` and \`$\` to match the whole value.`
|
|
6261
6300
|
}).optional(),
|
|
6262
|
-
searchable:
|
|
6301
|
+
searchable: import_zod26.z.boolean().meta({ description: "Include this field in the `search` of record lists." }).optional()
|
|
6263
6302
|
}).strict();
|
|
6264
|
-
var longTextField =
|
|
6265
|
-
type:
|
|
6303
|
+
var longTextField = import_zod26.z.object({
|
|
6304
|
+
type: import_zod26.z.literal("long_text"),
|
|
6266
6305
|
...common2,
|
|
6267
|
-
max_length:
|
|
6268
|
-
searchable:
|
|
6306
|
+
max_length: import_zod26.z.number().int().min(1).max(COLLECTION_LIMITS.longTextMax).meta({ description: `Longest value in characters. Default ${COLLECTION_LIMITS.longTextDefault}, at most ${COLLECTION_LIMITS.longTextMax}.` }).optional(),
|
|
6307
|
+
searchable: import_zod26.z.boolean().meta({ description: "Include this field in the `search` of record lists." }).optional()
|
|
6269
6308
|
}).strict();
|
|
6270
|
-
var numberField =
|
|
6271
|
-
type:
|
|
6309
|
+
var numberField = import_zod26.z.object({
|
|
6310
|
+
type: import_zod26.z.literal("number"),
|
|
6272
6311
|
...common2,
|
|
6273
|
-
integer:
|
|
6274
|
-
min:
|
|
6275
|
-
max:
|
|
6276
|
-
unit:
|
|
6312
|
+
integer: import_zod26.z.boolean().meta({ description: "Accept whole numbers only." }).optional(),
|
|
6313
|
+
min: import_zod26.z.number().meta({ description: "Smallest accepted value." }).optional(),
|
|
6314
|
+
max: import_zod26.z.number().meta({ description: "Largest accepted value." }).optional(),
|
|
6315
|
+
unit: import_zod26.z.string().meta({ description: "A unit to show next to the value, such as `m` or `rad/s`. Display only; nothing converts values." }).optional()
|
|
6277
6316
|
}).strict();
|
|
6278
|
-
var booleanField =
|
|
6279
|
-
var selectOption =
|
|
6280
|
-
value:
|
|
6281
|
-
label:
|
|
6317
|
+
var booleanField = import_zod26.z.object({ type: import_zod26.z.literal("boolean"), ...common2 }).strict();
|
|
6318
|
+
var selectOption = import_zod26.z.object({
|
|
6319
|
+
value: import_zod26.z.string().min(1).max(200).meta({ description: "What is stored in records and used in filters." }),
|
|
6320
|
+
label: import_zod26.z.string().meta({ description: "What people see instead of the value." }).optional()
|
|
6282
6321
|
}).strict();
|
|
6283
|
-
var selectField =
|
|
6284
|
-
type:
|
|
6322
|
+
var selectField = import_zod26.z.object({
|
|
6323
|
+
type: import_zod26.z.literal("select"),
|
|
6285
6324
|
...common2,
|
|
6286
|
-
options:
|
|
6287
|
-
multiple:
|
|
6288
|
-
searchable:
|
|
6325
|
+
options: import_zod26.z.array(selectOption).min(1).max(COLLECTION_LIMITS.selectOptions).meta({ description: `The accepted values, 1 to ${COLLECTION_LIMITS.selectOptions}. Two options may not share a value.` }),
|
|
6326
|
+
multiple: import_zod26.z.boolean().meta({ description: "Hold a list of distinct options instead of one." }).optional(),
|
|
6327
|
+
searchable: import_zod26.z.boolean().meta({ description: "Include the values and labels of the chosen options in the `search` of record lists." }).optional()
|
|
6289
6328
|
}).strict();
|
|
6290
|
-
var dateField =
|
|
6291
|
-
var datetimeField =
|
|
6292
|
-
var jsonField =
|
|
6293
|
-
type:
|
|
6329
|
+
var dateField = import_zod26.z.object({ type: import_zod26.z.literal("date"), ...common2 }).strict();
|
|
6330
|
+
var datetimeField = import_zod26.z.object({ type: import_zod26.z.literal("datetime"), ...common2 }).strict();
|
|
6331
|
+
var jsonField = import_zod26.z.object({
|
|
6332
|
+
type: import_zod26.z.literal("json"),
|
|
6294
6333
|
...common2,
|
|
6295
|
-
schema:
|
|
6334
|
+
schema: import_zod26.z.union([import_zod26.z.string(), import_zod26.z.record(import_zod26.z.string(), import_zod26.z.unknown())]).meta({
|
|
6296
6335
|
description: "What the value must look like: the name of a built-in template (`pose2d`, `point2d`, `polygon2d`, `range1d`) or an inline JSON Schema (draft 2020-12). Without it any JSON value is accepted."
|
|
6297
6336
|
}).optional()
|
|
6298
6337
|
}).strict();
|
|
6299
|
-
var referenceField =
|
|
6300
|
-
type:
|
|
6338
|
+
var referenceField = import_zod26.z.object({
|
|
6339
|
+
type: import_zod26.z.literal("reference"),
|
|
6301
6340
|
...common2,
|
|
6302
6341
|
to: collectionKey.meta({ description: "The key of the collection whose records this field points at. It must be a collection of the same document." }),
|
|
6303
|
-
on_delete:
|
|
6342
|
+
on_delete: import_zod26.z.enum(["prevent", "clear"]).meta({
|
|
6304
6343
|
description: "`prevent` (the default): a record that other records point at cannot be deleted. `clear`: deleting it clears the reference in the records that pointed at it."
|
|
6305
6344
|
}).optional()
|
|
6306
6345
|
}).strict();
|
|
6307
|
-
var collectionField =
|
|
6346
|
+
var collectionField = import_zod26.z.discriminatedUnion("type", [
|
|
6308
6347
|
textField,
|
|
6309
6348
|
longTextField,
|
|
6310
6349
|
numberField,
|
|
@@ -6315,71 +6354,71 @@ var collectionField = import_zod25.z.discriminatedUnion("type", [
|
|
|
6315
6354
|
jsonField,
|
|
6316
6355
|
referenceField
|
|
6317
6356
|
]);
|
|
6318
|
-
var collectionAccessValue =
|
|
6319
|
-
var allOwn =
|
|
6357
|
+
var collectionAccessValue = import_zod26.z.union([import_zod26.z.string().min(1).max(63), import_zod26.z.array(import_zod26.z.string().min(1).max(63))]).meta({ description: "The key of an organization role, or a list of keys. A key that names no role grants nothing." });
|
|
6358
|
+
var allOwn = import_zod26.z.object({
|
|
6320
6359
|
all: collectionAccessValue.meta({ description: "Roles that may do this to every record." }).optional(),
|
|
6321
6360
|
own: collectionAccessValue.meta({ description: "Roles that may do this only to records they created themselves." }).optional()
|
|
6322
6361
|
}).strict();
|
|
6323
|
-
var collectionAccess =
|
|
6362
|
+
var collectionAccess = import_zod26.z.object({
|
|
6324
6363
|
read: collectionAccessValue.meta({ description: "Roles that may read records." }).optional(),
|
|
6325
6364
|
create: collectionAccessValue.meta({ description: "Roles that may create records. Has no effect on `one_per_robot` collections, whose records Fleetless creates." }).optional(),
|
|
6326
|
-
update:
|
|
6327
|
-
delete:
|
|
6365
|
+
update: import_zod26.z.union([collectionAccessValue, allOwn]).meta({ description: "Roles that may change records: a role key, a list, or `{ all, own }` to tell every record from the ones a role created itself." }).optional(),
|
|
6366
|
+
delete: import_zod26.z.union([collectionAccessValue, allOwn]).meta({ description: "Roles that may delete records: a role key, a list, or `{ all, own }`. Has no effect on `one_per_robot` collections, whose records are never deleted through the API." }).optional()
|
|
6328
6367
|
}).strict().meta({ description: "Which roles may read, create, update and delete the records of this collection. A missing key grants that action to nobody; developers and server keys can always do everything." });
|
|
6329
|
-
var collectionDefinition =
|
|
6330
|
-
label:
|
|
6331
|
-
description:
|
|
6368
|
+
var collectionDefinition = import_zod26.z.object({
|
|
6369
|
+
label: import_zod26.z.string().meta({ description: "A name for people to read. It may change at any time; the key is what code uses." }).optional(),
|
|
6370
|
+
description: import_zod26.z.string().meta({ description: "Free text that explains the collection to people." }).optional(),
|
|
6332
6371
|
binding: collectionBinding,
|
|
6333
|
-
display:
|
|
6372
|
+
display: import_zod26.z.string().meta({
|
|
6334
6373
|
description: "A template that names a record in lists, references and titles, for example `{{name}} ({{location.name}})`. A placeholder is a field of this collection, a system field (`id`, `created_at`, `created_by`, `updated_at`, `updated_by`, `revision`, and `robot_id` on robot-bound collections), `robot.name` on robot-bound collections, or `<reference field>.<field of the target>`."
|
|
6335
6374
|
}).optional(),
|
|
6336
6375
|
access: collectionAccess.optional(),
|
|
6337
|
-
fields:
|
|
6376
|
+
fields: import_zod26.z.record(collectionKey, collectionField).meta({ description: `The fields of a record, at most ${COLLECTION_LIMITS.fields}. Their order is the order of the record form.` })
|
|
6338
6377
|
}).strict();
|
|
6339
|
-
var collectionsMap =
|
|
6340
|
-
var collectionsDocument =
|
|
6341
|
-
format:
|
|
6378
|
+
var collectionsMap = import_zod26.z.record(collectionKey, collectionDefinition);
|
|
6379
|
+
var collectionsDocument = import_zod26.z.object({
|
|
6380
|
+
format: import_zod26.z.literal(COLLECTIONS_FORMAT_VERSION).meta({ description: `The document format version. Always ${COLLECTIONS_FORMAT_VERSION}.` }),
|
|
6342
6381
|
// A codec on the property and not a preprocess on the document: the published JSON Schema then says `object | null` and still lists
|
|
6343
6382
|
// `collections` as required, and the parsed value (and the output schema) is the plain map.
|
|
6344
|
-
collections:
|
|
6383
|
+
collections: import_zod26.z.codec(collectionsMap.nullable(), collectionsMap, { decode: (value) => value ?? {}, encode: (value) => value }).meta({ description: `The collections of the app by key, at most ${COLLECTION_LIMITS.collections}. Nothing under \`collections:\` (null) means none.` })
|
|
6345
6384
|
}).strict().meta({ description: "The data model of an app: its collections, their fields, and who may use them." });
|
|
6346
6385
|
|
|
6347
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
6348
|
-
var records =
|
|
6349
|
-
var roleCollectionRights =
|
|
6386
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-rights.js
|
|
6387
|
+
var records = import_zod27.z.union([import_zod27.z.literal("all"), import_zod27.z.literal("own"), import_zod27.z.literal(false)]);
|
|
6388
|
+
var roleCollectionRights = import_zod27.z.object({
|
|
6350
6389
|
collection: collectionKey.meta({ description: "The collection's key." }),
|
|
6351
|
-
label:
|
|
6390
|
+
label: import_zod27.z.string().meta({ description: "The collection's label for people to read; its key when the schema gives none." }),
|
|
6352
6391
|
binding: collectionBinding,
|
|
6353
|
-
read:
|
|
6354
|
-
create:
|
|
6392
|
+
read: import_zod27.z.boolean().meta({ description: "Whether the role may read the records." }),
|
|
6393
|
+
create: import_zod27.z.boolean().meta({ description: "Whether the role may create records." }),
|
|
6355
6394
|
update: records.meta({
|
|
6356
6395
|
description: "`all`: the role may change every record. `own`: only records its user created. `false`: none."
|
|
6357
6396
|
}),
|
|
6358
6397
|
delete: records.meta({
|
|
6359
6398
|
description: "`all`: the role may delete every record. `own`: only records its user created. `false`: none."
|
|
6360
6399
|
}),
|
|
6361
|
-
robot_filter:
|
|
6400
|
+
robot_filter: import_zod27.z.boolean().meta({
|
|
6362
6401
|
description: "`true` on a collection that belongs to robots (`per_robot`, `one_per_robot`): the role sees and writes only the records of robots a session of the role reaches, whatever the rights above say. `false` on a `global` collection."
|
|
6363
6402
|
})
|
|
6364
6403
|
}).meta({ description: "What one role may do with the records of one collection." });
|
|
6365
6404
|
|
|
6366
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
6405
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/apps.js
|
|
6367
6406
|
var appIdentifier = slug;
|
|
6368
|
-
var app2 =
|
|
6369
|
-
id:
|
|
6407
|
+
var app2 = import_zod28.z.object({
|
|
6408
|
+
id: import_zod28.z.uuid().meta({
|
|
6370
6409
|
description: "The app in the API, assigned by the cloud and stable for the life of the app. Everything app-scoped takes this as its `:id`."
|
|
6371
6410
|
}),
|
|
6372
|
-
org_id:
|
|
6411
|
+
org_id: import_zod28.z.uuid().meta({
|
|
6373
6412
|
description: "The organisation that owns this app. Every developer route is already scoped to the caller's org, so this confirms what a client is looking at rather than being a filter it applies."
|
|
6374
6413
|
}),
|
|
6375
|
-
name:
|
|
6414
|
+
name: import_zod28.z.string().min(1).max(120).meta({
|
|
6376
6415
|
description: "The display name, shown in the console and available to the developer's own pages through the `app.name` mail-template variable. Free text, changed through `PATCH /api/apps/:id`."
|
|
6377
6416
|
}),
|
|
6378
6417
|
identifier: appIdentifier.meta({
|
|
6379
6418
|
description: "The stable handle a client sends at login, lowercase and underscore-separated. **Globally unique, not per organisation** \u2014 `clientLoginRequest` carries no org context, so a collision is refused with `identifier_taken`."
|
|
6380
6419
|
}),
|
|
6381
6420
|
/** Robots are referenced individually; tags never grant rights. */
|
|
6382
|
-
robot_ids:
|
|
6421
|
+
robot_ids: import_zod28.z.array(import_zod28.z.uuid()).meta({
|
|
6383
6422
|
description: "The robots this app may reach, each referenced individually. Tags never grant rights, and a robot absent from this list is invisible to the app. What a user of the app may use on an attached robot follows that robot's `fleetless.yaml` and the organization's defaults, less what the app locks."
|
|
6384
6423
|
}),
|
|
6385
6424
|
/**
|
|
@@ -6401,83 +6440,83 @@ var app2 = import_zod27.z.object({
|
|
|
6401
6440
|
default_role: roleKey.nullable().meta({
|
|
6402
6441
|
description: "The role, by key, that an app user gets when created, invited or self-registered without an explicit one. `null` means this app has not chosen a default, the normal state of an app until someone picks one, and then a create or invite that names no role is refused. An invitation resolves the role when issued, so changing this never re-aims an outstanding one. The key is shown as stored and may name no role, which grants nothing; `GET /api/apps/:id/access` warns about it. It is set by `PUT /api/apps/:id/access`, not by `PATCH /api/apps/:id`."
|
|
6403
6442
|
}),
|
|
6404
|
-
created_at:
|
|
6443
|
+
created_at: import_zod28.z.iso.datetime().meta({
|
|
6405
6444
|
description: "When the app was created, as an ISO 8601 timestamp. `GET /api/apps` orders by this field."
|
|
6406
6445
|
})
|
|
6407
6446
|
});
|
|
6408
|
-
var appListResponse =
|
|
6409
|
-
apps:
|
|
6447
|
+
var appListResponse = import_zod28.z.object({
|
|
6448
|
+
apps: import_zod28.z.array(app2).meta({
|
|
6410
6449
|
description: "Every app of the caller's organisation, oldest first by `created_at`. The org scope is the whole filter \u2014 there is no id to narrow by and nothing to refuse."
|
|
6411
6450
|
})
|
|
6412
6451
|
});
|
|
6413
|
-
var appDeletionSummary =
|
|
6414
|
-
user_count:
|
|
6452
|
+
var appDeletionSummary = import_zod28.z.object({
|
|
6453
|
+
user_count: import_zod28.z.number().int().nonnegative().meta({
|
|
6415
6454
|
description: "App users deleted with the app. They are the developer's own customers, not Fleetless users, and exist in no other app."
|
|
6416
6455
|
}),
|
|
6417
|
-
server_key_count:
|
|
6456
|
+
server_key_count: import_zod28.z.number().int().nonnegative().meta({
|
|
6418
6457
|
description: "Server keys deleted with the app. A client still holding one is refused at its next request."
|
|
6419
6458
|
}),
|
|
6420
|
-
invitation_count:
|
|
6459
|
+
invitation_count: import_zod28.z.number().int().nonnegative().meta({
|
|
6421
6460
|
description: "Outstanding invitations \u2014 unspent and unexpired \u2014 that will never be accepted."
|
|
6422
6461
|
}),
|
|
6423
|
-
oidc_provider_count:
|
|
6462
|
+
oidc_provider_count: import_zod28.z.number().int().nonnegative().meta({
|
|
6424
6463
|
description: "Identity providers configured for this app. The providers themselves are somebody else's; only this app's configuration of them goes."
|
|
6425
6464
|
}),
|
|
6426
|
-
mail_template_count:
|
|
6465
|
+
mail_template_count: import_zod28.z.number().int().nonnegative().meta({
|
|
6427
6466
|
description: "Custom mail templates, of at most three. A kind using the Fleetless default text is not counted \u2014 there is no row to lose."
|
|
6428
6467
|
}),
|
|
6429
|
-
collection_count:
|
|
6468
|
+
collection_count: import_zod28.z.number().int().nonnegative().meta({
|
|
6430
6469
|
description: "Collections of the app's latest published schema. They go with the app, together with their records and history."
|
|
6431
6470
|
}),
|
|
6432
|
-
record_count:
|
|
6471
|
+
record_count: import_zod28.z.number().int().nonnegative().meta({
|
|
6433
6472
|
description: "Records of the app's collections, deleted with the app."
|
|
6434
6473
|
})
|
|
6435
6474
|
});
|
|
6436
|
-
var createAppRequest =
|
|
6437
|
-
name:
|
|
6475
|
+
var createAppRequest = import_zod28.z.object({
|
|
6476
|
+
name: import_zod28.z.string().min(1).max(120),
|
|
6438
6477
|
identifier: appIdentifier,
|
|
6439
|
-
robot_ids:
|
|
6478
|
+
robot_ids: import_zod28.z.array(import_zod28.z.uuid()).optional()
|
|
6440
6479
|
}).strict();
|
|
6441
|
-
var updateAppRequest =
|
|
6442
|
-
name:
|
|
6443
|
-
robot_ids:
|
|
6480
|
+
var updateAppRequest = import_zod28.z.object({
|
|
6481
|
+
name: import_zod28.z.string().min(1).max(120).optional(),
|
|
6482
|
+
robot_ids: import_zod28.z.array(import_zod28.z.uuid()).optional()
|
|
6444
6483
|
}).strict();
|
|
6445
|
-
var serverKeyToken =
|
|
6446
|
-
var serverKey =
|
|
6447
|
-
id:
|
|
6484
|
+
var serverKeyToken = import_zod28.z.string().regex(/^flk_[0-9a-f]{32}$/);
|
|
6485
|
+
var serverKey = import_zod28.z.object({
|
|
6486
|
+
id: import_zod28.z.uuid().meta({
|
|
6448
6487
|
description: "The key row, and what the rotate and delete routes address. It is not the key: this shape never carries the secret."
|
|
6449
6488
|
}),
|
|
6450
|
-
app_id:
|
|
6489
|
+
app_id: import_zod28.z.uuid().meta({
|
|
6451
6490
|
description: "The app whose full rights this key carries. A key is never shared between apps."
|
|
6452
6491
|
}),
|
|
6453
|
-
name:
|
|
6492
|
+
name: import_zod28.z.string().min(1).max(120).meta({
|
|
6454
6493
|
description: "A label the developer chose, so a key can be recognised before it is rotated or deleted."
|
|
6455
6494
|
}),
|
|
6456
|
-
created_at:
|
|
6495
|
+
created_at: import_zod28.z.iso.datetime().meta({
|
|
6457
6496
|
description: "When the key was minted, as an ISO 8601 timestamp. `GET /api/apps/:id/server-keys` orders by this field."
|
|
6458
6497
|
}),
|
|
6459
6498
|
/** Null until first use — the cheapest way to spot a key nobody needs. */
|
|
6460
|
-
last_used_at:
|
|
6499
|
+
last_used_at: import_zod28.z.iso.datetime().nullable().meta({
|
|
6461
6500
|
description: "When this key last authenticated a request, or `null` if it never has \u2014 the cheapest way to spot a key nobody needs."
|
|
6462
6501
|
})
|
|
6463
6502
|
});
|
|
6464
|
-
var serverKeyListResponse =
|
|
6465
|
-
server_keys:
|
|
6503
|
+
var serverKeyListResponse = import_zod28.z.object({
|
|
6504
|
+
server_keys: import_zod28.z.array(serverKey).meta({
|
|
6466
6505
|
description: "The app's server keys as metadata, oldest first by `created_at`. The raw secret is not here and never will be: it exists once, in the response that created or rotated the key."
|
|
6467
6506
|
})
|
|
6468
6507
|
});
|
|
6469
|
-
var createServerKeyResponse =
|
|
6508
|
+
var createServerKeyResponse = import_zod28.z.object({
|
|
6470
6509
|
server_key: serverKey,
|
|
6471
6510
|
key: serverKeyToken
|
|
6472
6511
|
});
|
|
6473
6512
|
var MAX_LOCK_SLUGS = 2e3;
|
|
6474
6513
|
var MAX_APP_LOCKS = 1e3;
|
|
6475
6514
|
var namedOnce = (items) => new Set(items).size === items.length;
|
|
6476
|
-
var appLock =
|
|
6477
|
-
robot_id:
|
|
6515
|
+
var appLock = import_zod28.z.object({
|
|
6516
|
+
robot_id: import_zod28.z.uuid().meta({
|
|
6478
6517
|
description: "The robot whose capabilities are locked for this app."
|
|
6479
6518
|
}),
|
|
6480
|
-
slugs:
|
|
6519
|
+
slugs: import_zod28.z.array(slug).min(1).max(MAX_LOCK_SLUGS).refine(namedOnce, { message: "Name each slug once." }).meta({
|
|
6481
6520
|
uniqueItems: true,
|
|
6482
6521
|
description: `The slugs of that robot's exposures to lock, at least one and each named once, at most ${MAX_LOCK_SLUGS}. A slug the robot has no exposure for is accepted and warns, and locks nothing.`
|
|
6483
6522
|
})
|
|
@@ -6486,245 +6525,245 @@ var appAccessFields = {
|
|
|
6486
6525
|
default_role: roleKey.nullable().meta({
|
|
6487
6526
|
description: "The role, by key, that an app user gets when created, invited or self-registered without an explicit one. `null` means the app has none, and a create or invite that names no role is refused. A key that names no role is accepted and warns; it grants nothing."
|
|
6488
6527
|
}),
|
|
6489
|
-
locked_kinds:
|
|
6528
|
+
locked_kinds: import_zod28.z.array(accessKind).max(ACCESS_KINDS.length).refine(namedOnce, { message: "Name each kind once." }).meta({
|
|
6490
6529
|
uniqueItems: true,
|
|
6491
6530
|
description: "Kinds of access locked for every user and server key of the app, on every robot it reaches: `read`, `invoke`, `publish`, `assets` or `job_history`, each at most once. The only way to lock `assets` or `job_history`, which belong to the robot as a whole."
|
|
6492
6531
|
}),
|
|
6493
|
-
locked:
|
|
6532
|
+
locked: import_zod28.z.array(appLock).max(MAX_APP_LOCKS).refine((locks) => namedOnce(locks.map((lock) => lock.robot_id)), { message: "Give each robot one entry; list all of its slugs in it." }).meta({
|
|
6494
6533
|
description: `Single exposures locked on single robots, one entry per robot and at most ${MAX_APP_LOCKS}. A lock never grants anything: it only takes away what a role would give.`
|
|
6495
6534
|
})
|
|
6496
6535
|
};
|
|
6497
|
-
var appAccessRevision =
|
|
6536
|
+
var appAccessRevision = import_zod28.z.string().regex(/^[0-9a-f]{64}$/).meta({
|
|
6498
6537
|
description: "A fingerprint of the stored access, 64 lower-case hexadecimal characters. It changes whenever the stored access changes, by whichever route (a write here, a slug rename that adds the new name to a lock, a robot detached from the app). Treat it as opaque: send back the one you read."
|
|
6499
6538
|
});
|
|
6500
|
-
var appAccess =
|
|
6539
|
+
var appAccess = import_zod28.z.object({
|
|
6501
6540
|
...appAccessFields,
|
|
6502
6541
|
revision: appAccessRevision.optional().meta({
|
|
6503
6542
|
description: "The `revision` of the access this body was composed from, as `GET` or `PUT /api/apps/:id/access` answered it. When it is sent and the stored access has changed since, the write is refused with `409 target_state_conflict` naming `revision` (rule `stale`) and nothing is written; read the access again and compose the body anew. Left out, the body replaces whatever is stored: the last writer wins."
|
|
6504
6543
|
})
|
|
6505
6544
|
}).strict();
|
|
6506
|
-
var accessWarning =
|
|
6507
|
-
code:
|
|
6545
|
+
var accessWarning = import_zod28.z.object({
|
|
6546
|
+
code: import_zod28.z.enum(["unknown_default_role", "unknown_lock_slug", "lock_robot_not_attached"]).meta({
|
|
6508
6547
|
description: "`unknown_default_role`: the default role names no role of the organization. `unknown_lock_slug`: a lock names a slug the robot has no published exposure for. `lock_robot_not_attached`: a lock names a robot that is not attached to the app."
|
|
6509
6548
|
}),
|
|
6510
|
-
message:
|
|
6549
|
+
message: import_zod28.z.string().min(1).meta({
|
|
6511
6550
|
description: "A sentence a person can read, naming the key, robot or slug."
|
|
6512
6551
|
}),
|
|
6513
|
-
robot_id:
|
|
6552
|
+
robot_id: import_zod28.z.uuid().nullable().meta({
|
|
6514
6553
|
description: "The robot a lock warning is about; `null` for `unknown_default_role`."
|
|
6515
6554
|
}),
|
|
6516
|
-
slug:
|
|
6555
|
+
slug: import_zod28.z.string().nullable().meta({
|
|
6517
6556
|
description: "The slug an `unknown_lock_slug` warning is about; `null` for the other warnings."
|
|
6518
6557
|
})
|
|
6519
6558
|
});
|
|
6520
|
-
var appAccessResponse =
|
|
6559
|
+
var appAccessResponse = import_zod28.z.object({
|
|
6521
6560
|
...appAccessFields,
|
|
6522
6561
|
revision: appAccessRevision.meta({
|
|
6523
6562
|
description: "The revision of the access as it stands. Send it back as `revision` of the next `PUT` to have that write refused when the access has changed in between."
|
|
6524
6563
|
}),
|
|
6525
|
-
warnings:
|
|
6564
|
+
warnings: import_zod28.z.array(accessWarning).meta({
|
|
6526
6565
|
description: "What the access names that does not exist as written. Empty when nothing is out of step."
|
|
6527
6566
|
})
|
|
6528
6567
|
});
|
|
6529
|
-
var effectiveRightsQuery =
|
|
6568
|
+
var effectiveRightsQuery = import_zod28.z.object({
|
|
6530
6569
|
role: roleKey.optional().meta({
|
|
6531
6570
|
description: "A role key to look at the app as. A key that names no role is not an error: the answer says `role_known: false` and grants nothing."
|
|
6532
6571
|
}),
|
|
6533
|
-
user:
|
|
6572
|
+
user: import_zod28.z.uuid().optional().meta({
|
|
6534
6573
|
description: "An app user of this app, to look at the app as that user's role. A user of another app answers `404`."
|
|
6535
6574
|
})
|
|
6536
6575
|
}).strict().refine((query) => query.role === void 0 !== (query.user === void 0), {
|
|
6537
6576
|
message: "Name exactly one of role and user."
|
|
6538
6577
|
});
|
|
6539
|
-
var effectiveCapability =
|
|
6578
|
+
var effectiveCapability = import_zod28.z.object({
|
|
6540
6579
|
name: slug.meta({
|
|
6541
6580
|
description: "The exposure's slug, or `assets` or `job_history` for the capabilities that belong to the robot as a whole."
|
|
6542
6581
|
}),
|
|
6543
6582
|
kind: accessKind.meta({
|
|
6544
6583
|
description: "The kind of access the capability needs."
|
|
6545
6584
|
}),
|
|
6546
|
-
granted:
|
|
6585
|
+
granted: import_zod28.z.boolean().meta({
|
|
6547
6586
|
description: "Whether the role may use it: its requirement is met and the app has not locked it."
|
|
6548
6587
|
}),
|
|
6549
|
-
requirement:
|
|
6588
|
+
requirement: import_zod28.z.array(import_zod28.z.string()).meta({
|
|
6550
6589
|
description: "The role keys that qualify, from the entry, the rule or the default that decided. Holding one of them, or inheriting from one, is enough. Empty when nobody qualifies."
|
|
6551
6590
|
}),
|
|
6552
|
-
source:
|
|
6591
|
+
source: import_zod28.z.enum(["entry", "rule", "robot", "org_default"]).meta({
|
|
6553
6592
|
description: "Where the requirement came from: `entry` is the entry's own `role`, `rule` the first matching rule of `access.rules`, `robot` the robot's `access.assets` or `access.job_history`, and `org_default` the organization's default for the kind."
|
|
6554
6593
|
}),
|
|
6555
|
-
rule_index:
|
|
6594
|
+
rule_index: import_zod28.z.number().int().nonnegative().nullable().meta({
|
|
6556
6595
|
description: "For `rule`, the position of the deciding rule in `access.rules`, counted from zero; `null` otherwise."
|
|
6557
6596
|
}),
|
|
6558
|
-
rule_match:
|
|
6597
|
+
rule_match: import_zod28.z.string().nullable().meta({
|
|
6559
6598
|
description: "For `rule`, that rule's `match` glob; `null` otherwise."
|
|
6560
6599
|
}),
|
|
6561
|
-
satisfied_by:
|
|
6600
|
+
satisfied_by: import_zod28.z.string().nullable().meta({
|
|
6562
6601
|
description: "The key from `requirement` that the role holds through inheritance. `null` when the role is named in the requirement itself, and when it does not meet the requirement at all. Independent of locks."
|
|
6563
6602
|
}),
|
|
6564
|
-
locked:
|
|
6603
|
+
locked: import_zod28.z.boolean().meta({
|
|
6565
6604
|
description: "Whether the app locks this capability, as a kind or as a single lock. A lock wins over the requirement."
|
|
6566
6605
|
}),
|
|
6567
|
-
unknown_roles:
|
|
6606
|
+
unknown_roles: import_zod28.z.array(import_zod28.z.string()).meta({
|
|
6568
6607
|
description: "Keys in the requirement that name no role of the organization. They grant nothing."
|
|
6569
6608
|
})
|
|
6570
6609
|
});
|
|
6571
|
-
var effectiveRobotRights =
|
|
6572
|
-
robot_id:
|
|
6573
|
-
robot_name:
|
|
6574
|
-
published_version:
|
|
6610
|
+
var effectiveRobotRights = import_zod28.z.object({
|
|
6611
|
+
robot_id: import_zod28.z.uuid().meta({ description: "The robot, one that is attached to the app." }),
|
|
6612
|
+
robot_name: import_zod28.z.string().min(1).max(200).meta({ description: "The robot's name." }),
|
|
6613
|
+
published_version: import_zod28.z.number().int().positive().nullable().meta({
|
|
6575
6614
|
description: "The version of the robot's published `fleetless.yaml` that the answer was computed from; `null` when nothing is published."
|
|
6576
6615
|
}),
|
|
6577
|
-
reachable:
|
|
6616
|
+
reachable: import_zod28.z.boolean().meta({
|
|
6578
6617
|
description: "Whether a session of this role reaches the robot at all: at least one slug or one capability is granted once the locks are applied. When `false`, `robots.describe` answers `not_found` for the robot and `robots.list` leaves it out; `capabilities` says why, and `datasheet` is the empty one."
|
|
6579
6618
|
}),
|
|
6580
|
-
capabilities:
|
|
6619
|
+
capabilities: import_zod28.z.array(effectiveCapability).meta({
|
|
6581
6620
|
description: "Every capability of the published configuration, and `assets` and `job_history`, each granted or not."
|
|
6582
6621
|
}),
|
|
6583
6622
|
datasheet: mcpRobotDatasheet.meta({
|
|
6584
6623
|
description: "The datasheet an MCP session of this role would get for the robot."
|
|
6585
6624
|
})
|
|
6586
6625
|
});
|
|
6587
|
-
var effectiveRightsResponse =
|
|
6588
|
-
role:
|
|
6626
|
+
var effectiveRightsResponse = import_zod28.z.object({
|
|
6627
|
+
role: import_zod28.z.string().nullable().meta({
|
|
6589
6628
|
description: "The role key the answer is for: the one asked about, or the app user's own. `null` when the app user holds none."
|
|
6590
6629
|
}),
|
|
6591
|
-
role_known:
|
|
6630
|
+
role_known: import_zod28.z.boolean().meta({
|
|
6592
6631
|
description: "Whether the key names a role of the organization. `false` means every capability below is not granted."
|
|
6593
6632
|
}),
|
|
6594
|
-
user_id:
|
|
6633
|
+
user_id: import_zod28.z.uuid().nullable().meta({
|
|
6595
6634
|
description: "The app user asked about; `null` when a role was asked about. A user who is not `active` reaches nothing, whatever role they hold: every capability below is not granted."
|
|
6596
6635
|
}),
|
|
6597
|
-
robots:
|
|
6636
|
+
robots: import_zod28.z.array(effectiveRobotRights).meta({
|
|
6598
6637
|
description: "The robots attached to the app, each with what the role may use."
|
|
6599
6638
|
}),
|
|
6600
|
-
collections:
|
|
6639
|
+
collections: import_zod28.z.array(roleCollectionRights).meta({
|
|
6601
6640
|
description: "What the role may do with the records of each collection of the app's latest published schema, in the schema's order. Empty when the app has no published schema. A role that is no role, and a user who is not `active`, are granted nothing in any row."
|
|
6602
6641
|
})
|
|
6603
6642
|
});
|
|
6604
6643
|
|
|
6605
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
6606
|
-
var clientLoginRequest =
|
|
6644
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/client-auth.js
|
|
6645
|
+
var clientLoginRequest = import_zod29.z.object({
|
|
6607
6646
|
app_identifier: appIdentifier.meta({
|
|
6608
6647
|
description: "The app being logged in to: its globally unique, lowercase, underscore-separated identifier, chosen by the developer at creation. There is no organisation context at login, so this is what decides which app the credentials are checked for."
|
|
6609
6648
|
}),
|
|
6610
|
-
email:
|
|
6649
|
+
email: import_zod29.z.email().meta({
|
|
6611
6650
|
description: "The app user's address. Addresses are unique **per app**, not across Fleetless: the same address may be an unrelated account in another app of the same organisation, so this pair is what identifies a person here."
|
|
6612
6651
|
}),
|
|
6613
|
-
password:
|
|
6652
|
+
password: import_zod29.z.string().min(1).meta({
|
|
6614
6653
|
description: "The app user's password. A wrong pair is refused without saying which half was wrong \u2014 and a `blocked` or not-yet-verified account is refused identically, so a failed login is not an account-enumeration oracle in any of its three forms."
|
|
6615
6654
|
})
|
|
6616
6655
|
});
|
|
6617
|
-
var clientRefreshRequest =
|
|
6618
|
-
refresh_token:
|
|
6656
|
+
var clientRefreshRequest = import_zod29.z.object({
|
|
6657
|
+
refresh_token: import_zod29.z.string().min(1).meta({
|
|
6619
6658
|
description: "The refresh token from the last login or refresh. Refresh tokens rotate on every use, so the value sent here is spent \u2014 keep the one that comes back, and presenting a spent one is treated as theft and ends the whole family."
|
|
6620
6659
|
})
|
|
6621
6660
|
});
|
|
6622
|
-
var clientLogoutRequest =
|
|
6623
|
-
refresh_token:
|
|
6661
|
+
var clientLogoutRequest = import_zod29.z.object({
|
|
6662
|
+
refresh_token: import_zod29.z.string().min(1).meta({
|
|
6624
6663
|
description: "Any refresh token of the session to end. The whole token family is revoked server-side, so a token stolen before this call stops working too \u2014 clearing a client-side store is a gesture, not a revocation. The answer is `204`: a token the server does not recognise gets it too, since that is the end state being asked for."
|
|
6625
6664
|
})
|
|
6626
6665
|
});
|
|
6627
|
-
var clientLoginCodeRequest =
|
|
6666
|
+
var clientLoginCodeRequest = import_zod29.z.object({
|
|
6628
6667
|
app_identifier: appIdentifier.meta({ description: "The app to sign in to. An identifier no app carries is `404 not_found`; the address is never the subject of a refusal." }),
|
|
6629
|
-
email:
|
|
6668
|
+
email: import_zod29.z.email().meta({
|
|
6630
6669
|
description: "The address to mail the code to, trimmed and compared case-insensitively. `202` whether or not it names an account of this app."
|
|
6631
6670
|
})
|
|
6632
6671
|
}).strict();
|
|
6633
|
-
var clientLoginCodeVerifyRequest =
|
|
6672
|
+
var clientLoginCodeVerifyRequest = import_zod29.z.object({
|
|
6634
6673
|
app_identifier: appIdentifier.meta({ description: "The app the code was requested for." }),
|
|
6635
|
-
email:
|
|
6674
|
+
email: import_zod29.z.email().meta({ description: "The address the code was mailed to, as typed when it was requested; trimmed and compared case-insensitively." }),
|
|
6636
6675
|
code: loginCode.meta({ description: "The six digits from the mail, exactly \u2014 leading zeros included, no spaces." })
|
|
6637
6676
|
}).strict();
|
|
6638
|
-
var twoFactorChallenge =
|
|
6639
|
-
status:
|
|
6677
|
+
var twoFactorChallenge = import_zod29.z.object({
|
|
6678
|
+
status: import_zod29.z.enum(["two_factor_required", "two_factor_setup_required"]).meta({
|
|
6640
6679
|
description: "`two_factor_required`: ask for the authenticator code. `two_factor_setup_required`: the app requires two-factor and the person has none yet, so set one up before any session exists."
|
|
6641
6680
|
}),
|
|
6642
|
-
challenge:
|
|
6681
|
+
challenge: import_zod29.z.string().min(1).meta({
|
|
6643
6682
|
description: "The handle the next step spends. Valid five minutes; afterwards it answers `410 token_spent` and the sign-in starts over."
|
|
6644
6683
|
})
|
|
6645
6684
|
});
|
|
6646
|
-
var clientSignInResult =
|
|
6647
|
-
var clientTwoFactorVerifyRequest =
|
|
6648
|
-
challenge:
|
|
6685
|
+
var clientSignInResult = import_zod29.z.union([sessionTokens, twoFactorChallenge]);
|
|
6686
|
+
var clientTwoFactorVerifyRequest = import_zod29.z.object({
|
|
6687
|
+
challenge: import_zod29.z.string().min(1).meta({ description: "The challenge the sign-in step answered." }),
|
|
6649
6688
|
code: totpCode.optional().meta({ description: "The six-digit code the authenticator shows now. A code already accepted once is refused, so a replay of a seen code does not sign anybody in." }),
|
|
6650
6689
|
recovery_code: recoveryCode.optional().meta({ description: "One of the ten recovery codes, `xxxxx-xxxxx`, in either case. Spent by its use." })
|
|
6651
6690
|
}).strict().refine((b) => b.code === void 0 !== (b.recovery_code === void 0), { message: "Send exactly one of code and recovery_code." });
|
|
6652
|
-
var clientTwoFactorSetupRequest =
|
|
6653
|
-
challenge:
|
|
6691
|
+
var clientTwoFactorSetupRequest = import_zod29.z.object({
|
|
6692
|
+
challenge: import_zod29.z.string().min(1).optional().meta({
|
|
6654
6693
|
description: "The `two_factor_setup_required` challenge, during sign-in. Absent when the call carries the app user's bearer instead."
|
|
6655
6694
|
})
|
|
6656
6695
|
}).strict();
|
|
6657
|
-
var clientTwoFactorSetupConfirmRequest =
|
|
6658
|
-
challenge:
|
|
6696
|
+
var clientTwoFactorSetupConfirmRequest = import_zod29.z.object({
|
|
6697
|
+
challenge: import_zod29.z.string().min(1).optional().meta({ description: "The same challenge as at `setup`, during sign-in; absent with a bearer." }),
|
|
6659
6698
|
code: totpCode.meta({ description: "A code the new authenticator shows now. It proves the secret was copied correctly before anything depends on it." })
|
|
6660
6699
|
}).strict();
|
|
6661
|
-
var clientTwoFactorSetupConfirmResponse =
|
|
6700
|
+
var clientTwoFactorSetupConfirmResponse = import_zod29.z.object({
|
|
6662
6701
|
recovery_codes: recoveryCodesList.meta({
|
|
6663
6702
|
description: "The ten single-use recovery codes, lowercase, shown once. Any earlier set is void."
|
|
6664
6703
|
}),
|
|
6665
6704
|
session: sessionTokens.meta({ description: "The session the sign-in was waiting for, or a fresh one for the account settings." })
|
|
6666
6705
|
});
|
|
6667
|
-
var clientTwoFactorDisableRequest =
|
|
6706
|
+
var clientTwoFactorDisableRequest = import_zod29.z.object({
|
|
6668
6707
|
code: totpCode.meta({ description: "A code the authenticator shows now." })
|
|
6669
6708
|
}).strict();
|
|
6670
|
-
var clientRegisterRequest =
|
|
6709
|
+
var clientRegisterRequest = import_zod29.z.object({
|
|
6671
6710
|
app_identifier: appIdentifier.meta({
|
|
6672
6711
|
description: "The app to register with. An identifier no app carries is `404 not_found` \u2014 an identifier is public, so naming it is no disclosure, and collapsing it into `registration_closed` sent a developer who mistyped their own identifier hunting a configuration bug that was not there. The **address** is never the subject of a refusal."
|
|
6673
6712
|
}),
|
|
6674
|
-
email:
|
|
6713
|
+
email: import_zod29.z.email().meta({
|
|
6675
6714
|
description: "The address to register. Unique per app, case-insensitively. An address this app already knows still answers `202`, without a mail \u2014 the answer may not say whether an account exists."
|
|
6676
6715
|
}),
|
|
6677
6716
|
password: password.optional().meta({
|
|
6678
6717
|
description: "The password for the new account, at least 12 characters. **Required while the app's password method is on, refused while it is off** \u2014 both as `400 validation_error` naming `password`. An email-code-only app registers people without one."
|
|
6679
6718
|
}),
|
|
6680
|
-
display_name:
|
|
6719
|
+
display_name: import_zod29.z.string().min(1).max(APP_USER_DISPLAY_NAME_MAX).nullable().optional().meta({
|
|
6681
6720
|
description: "An optional human name for the account. The developer's own UI decides whether to ask for it."
|
|
6682
6721
|
})
|
|
6683
6722
|
}).strict();
|
|
6684
|
-
var clientVerifyEmailRequest =
|
|
6685
|
-
token:
|
|
6723
|
+
var clientVerifyEmailRequest = import_zod29.z.object({
|
|
6724
|
+
token: import_zod29.z.string().min(1).meta({
|
|
6686
6725
|
description: "The opaque token from the verification link, valid 24 hours. Unknown, expired and already-spent all answer `410 token_spent` \u2014 telling them apart would say whether a token ever existed."
|
|
6687
6726
|
})
|
|
6688
6727
|
}).strict();
|
|
6689
|
-
var clientResendVerificationRequest =
|
|
6728
|
+
var clientResendVerificationRequest = import_zod29.z.object({
|
|
6690
6729
|
app_identifier: appIdentifier.meta({ description: "The app the address belongs to." }),
|
|
6691
|
-
email:
|
|
6730
|
+
email: import_zod29.z.email().meta({
|
|
6692
6731
|
description: "The address to re-send to. The answer is `202` whether or not it names an account, and whether or not that account is already verified."
|
|
6693
6732
|
})
|
|
6694
6733
|
}).strict();
|
|
6695
|
-
var clientPasswordResetRequest =
|
|
6734
|
+
var clientPasswordResetRequest = import_zod29.z.object({
|
|
6696
6735
|
app_identifier: appIdentifier.meta({ description: "The app the address belongs to." }),
|
|
6697
|
-
email:
|
|
6736
|
+
email: import_zod29.z.email().meta({
|
|
6698
6737
|
description: "The address to mail a reset link to. The answer is `202` for a known address and an unknown one alike, in status, body and timing. An app identifier no app carries is `404 not_found`; the address is never the subject of a refusal."
|
|
6699
6738
|
})
|
|
6700
6739
|
}).strict();
|
|
6701
|
-
var clientPasswordResetConfirmRequest =
|
|
6702
|
-
token:
|
|
6740
|
+
var clientPasswordResetConfirmRequest = import_zod29.z.object({
|
|
6741
|
+
token: import_zod29.z.string().min(1).meta({
|
|
6703
6742
|
description: "The opaque token from the reset link, valid one hour. Single-use; unknown, expired and spent all answer `410 token_spent`."
|
|
6704
6743
|
}),
|
|
6705
6744
|
new_password: password.meta({
|
|
6706
6745
|
description: "The replacement password. Accepting it revokes every refresh family the account holds \u2014 the answer carries a fresh pair, so the person is signed in on the device that completed the reset and nowhere else."
|
|
6707
6746
|
})
|
|
6708
6747
|
}).strict();
|
|
6709
|
-
var clientAcceptInvitationRequest =
|
|
6710
|
-
token:
|
|
6748
|
+
var clientAcceptInvitationRequest = import_zod29.z.object({
|
|
6749
|
+
token: import_zod29.z.string().min(1).meta({
|
|
6711
6750
|
description: "The opaque token from the invitation link, valid seven days. Unknown, expired, revoked and already-accepted all answer `410 token_spent`."
|
|
6712
6751
|
}),
|
|
6713
6752
|
password: password.optional().meta({
|
|
6714
6753
|
description: "The password the new account will use, at least 12 characters. **Required while the app's password method is on, refused while it is off** \u2014 both as `400 validation_error` naming `password`. An email-code-only app accepts invitations without one."
|
|
6715
6754
|
}),
|
|
6716
|
-
display_name:
|
|
6755
|
+
display_name: import_zod29.z.string().min(1).max(APP_USER_DISPLAY_NAME_MAX).nullable().optional().meta({
|
|
6717
6756
|
description: "An optional name, overriding whatever the invitation pre-filled."
|
|
6718
6757
|
})
|
|
6719
6758
|
}).strict();
|
|
6720
6759
|
var CLIENT_OIDC_CALLBACK_PATH = "/api/client/oidc/callback";
|
|
6721
|
-
var clientProviderListQuery =
|
|
6760
|
+
var clientProviderListQuery = import_zod29.z.object({
|
|
6722
6761
|
app_identifier: appIdentifier.meta({ description: "The app whose enabled providers to list." })
|
|
6723
6762
|
}).meta({ description: "The one parameter of the public provider listing." });
|
|
6724
|
-
var clientProviderListResponse =
|
|
6725
|
-
providers:
|
|
6763
|
+
var clientProviderListResponse = import_zod29.z.object({
|
|
6764
|
+
providers: import_zod29.z.array(import_zod29.z.object({
|
|
6726
6765
|
slug: providerSlug.meta({ description: "The handle to put in the start URL: `GET /api/client/oidc/<slug>/start`." }),
|
|
6727
|
-
name:
|
|
6766
|
+
name: import_zod29.z.string().meta({ description: "What to write on the button, as the developer configured it." })
|
|
6728
6767
|
})).meta({
|
|
6729
6768
|
description: "The app's **enabled** providers, slug and display name only. An app with none answers an empty array, which is the state of an app that offers password or code sign-in alone."
|
|
6730
6769
|
}),
|
|
@@ -6735,41 +6774,41 @@ var clientProviderListResponse = import_zod28.z.object({
|
|
|
6735
6774
|
description: "The app's off, optional or required two-factor policy; not the caller's enrollment state."
|
|
6736
6775
|
})
|
|
6737
6776
|
});
|
|
6738
|
-
var clientOidcStartQuery =
|
|
6777
|
+
var clientOidcStartQuery = import_zod29.z.object({
|
|
6739
6778
|
app_identifier: appIdentifier.meta({ description: "The app being signed in to." }),
|
|
6740
|
-
redirect_uri:
|
|
6779
|
+
redirect_uri: import_zod29.z.url().max(2e3).meta({
|
|
6741
6780
|
description: "Where to send the browser when the flow finishes, with `code` and `state` or with `error` and `state`. **Its origin must be one of the app's `allowed_origins`**; a failure here is refused flat, with no redirect, because until the target is confirmed there is nowhere trusted to bounce a browser to."
|
|
6742
6781
|
}),
|
|
6743
|
-
state:
|
|
6782
|
+
state: import_zod29.z.string().min(8).max(512).meta({
|
|
6744
6783
|
description: "Returned unchanged on the callback, and on the error redirect too, so the app can bind either answer to the request it started. At least eight characters: this is what ties the callback to the browser that began the flow, and a guessable value defends nothing."
|
|
6745
6784
|
}),
|
|
6746
|
-
code_challenge:
|
|
6785
|
+
code_challenge: import_zod29.z.string().regex(/^[A-Za-z0-9_-]{43,128}$/).meta({
|
|
6747
6786
|
description: "The app's own PKCE challenge (RFC 7636, S256 base64url). The verifier is presented at `oidc/exchange`, so the one-time code is worth nothing to whoever intercepts the redirect. `plain` is not accepted: a challenge equal to its verifier defends against nothing."
|
|
6748
6787
|
})
|
|
6749
6788
|
});
|
|
6750
|
-
var clientOidcCallbackQuery =
|
|
6751
|
-
state:
|
|
6789
|
+
var clientOidcCallbackQuery = import_zod29.z.object({
|
|
6790
|
+
state: import_zod29.z.string().min(1).meta({
|
|
6752
6791
|
description: "The opaque state Fleetless sent to the provider, which resolves the pending interaction \u2014 and with it the app's `redirect_uri`. Not the app's own `state` from `start`: that one is stored on the interaction and put back on the redirect to the app. A callback whose state resolves to nothing has no confirmed target to answer, and is the one case Fleetless renders a page for."
|
|
6753
6792
|
}),
|
|
6754
|
-
code:
|
|
6793
|
+
code: import_zod29.z.string().min(1).optional().meta({
|
|
6755
6794
|
description: "The provider's authorization code, present when the sign-in succeeded. Exchanged server-side by the cloud, so it never reaches the app \u2014 the app gets its own one-time code, bound to the PKCE challenge it sent at `start`."
|
|
6756
6795
|
}),
|
|
6757
|
-
error:
|
|
6796
|
+
error: import_zod29.z.string().min(1).optional().meta({
|
|
6758
6797
|
description: "The provider's own refusal, present instead of `code` when the person declined or the provider would not issue one. It is carried back to the app as a `clientOidcErrorCode`, not passed through: the provider's vocabulary is its own, and an app branching on it would be branching on a string nobody here controls."
|
|
6759
6798
|
}),
|
|
6760
|
-
error_description:
|
|
6799
|
+
error_description: import_zod29.z.string().optional().meta({
|
|
6761
6800
|
description: "The provider's human-readable note about `error`, when it sends one. Logged, never rendered to an app user and never put on the redirect \u2014 it is text from a system Fleetless does not run."
|
|
6762
6801
|
})
|
|
6763
6802
|
});
|
|
6764
|
-
var clientOidcExchangeRequest =
|
|
6765
|
-
code:
|
|
6803
|
+
var clientOidcExchangeRequest = import_zod29.z.object({
|
|
6804
|
+
code: import_zod29.z.string().min(1).meta({
|
|
6766
6805
|
description: "The one-time code from the callback redirect. Valid 60 seconds, single-use, and bound to the PKCE challenge the start step carried."
|
|
6767
6806
|
}),
|
|
6768
|
-
code_verifier:
|
|
6807
|
+
code_verifier: import_zod29.z.string().regex(/^[A-Za-z0-9_.~-]{43,128}$/).meta({
|
|
6769
6808
|
description: "The verifier for the challenge sent at `start`. RFC 7636 \xA74.1's alphabet and length."
|
|
6770
6809
|
})
|
|
6771
6810
|
}).strict();
|
|
6772
|
-
var clientOidcErrorCode =
|
|
6811
|
+
var clientOidcErrorCode = import_zod29.z.enum([
|
|
6773
6812
|
"no_access",
|
|
6774
6813
|
"email_taken",
|
|
6775
6814
|
"email_unverified",
|
|
@@ -6784,255 +6823,255 @@ var clientOidcErrorCode = import_zod28.z.enum([
|
|
|
6784
6823
|
"quota_exceeded",
|
|
6785
6824
|
"plan_limit"
|
|
6786
6825
|
]);
|
|
6787
|
-
var clientMcpInteraction =
|
|
6788
|
-
id:
|
|
6789
|
-
app_id:
|
|
6790
|
-
client_name:
|
|
6791
|
-
client_name_verified:
|
|
6826
|
+
var clientMcpInteraction = import_zod29.z.object({
|
|
6827
|
+
id: import_zod29.z.string().meta({ description: "The interaction, as it arrived in the app's `mcp_login_url`. Not a credential: it names a pending request the server already holds, and approving it needs the app user's own access token." }),
|
|
6828
|
+
app_id: import_zod29.z.uuid().meta({ description: "The app this authorization is for. The approving token's `app_id` must match it \u2014 an interaction of one app cannot be approved with a session from another." }),
|
|
6829
|
+
client_name: import_zod29.z.string().nullable().meta({ description: "What the MCP client calls itself, or `null` if it named nothing. **Unverified** \u2014 see `client_name_verified`." }),
|
|
6830
|
+
client_name_verified: import_zod29.z.literal(false).meta({
|
|
6792
6831
|
description: "Always `false`. The client named itself \u2014 in an unauthenticated dynamic registration or in its own Client ID Metadata Document \u2014 so the name must be rendered as a claim and never as an identity. Only `client_id_host` was checked, by fetching the document from it. There is no verified case, which is why this is a literal and not a boolean: a `true` branch would be dead code that looked like a safeguard."
|
|
6793
6832
|
}),
|
|
6794
|
-
client_id_host:
|
|
6833
|
+
client_id_host: import_zod29.z.string().nullable().meta({
|
|
6795
6834
|
description: "The hostname of the client's `client_id` when that id is the HTTPS URL of a Client ID Metadata Document, which the authorization server fetched from this host; `null` for a client that registered itself by dynamic registration. Show it beside the name: it is the one part of the client's description somebody checked."
|
|
6796
6835
|
}),
|
|
6797
|
-
redirect_uri_host:
|
|
6836
|
+
redirect_uri_host: import_zod29.z.string().meta({
|
|
6798
6837
|
description: "The hostname of the redirect URI this authorization will answer to \u2014 where the authorization code is sent. Show it on the consent screen (MCP 2026-07-28 requires it). An IPv6 literal keeps its brackets."
|
|
6799
6838
|
}),
|
|
6800
|
-
redirect_uri_loopback:
|
|
6839
|
+
redirect_uri_loopback: import_zod29.z.boolean().meta({
|
|
6801
6840
|
description: '`true` when the redirect URI is `http` on a loopback address (`localhost`, `127.0.0.1`, `[::1]`): the answer goes to a program on the person\'s own computer, on any port it chose. Warn about it, for example: "This client receives the answer on this computer (127.0.0.1). Approve only if you started it here."'
|
|
6802
6841
|
}),
|
|
6803
|
-
scopes:
|
|
6804
|
-
already_granted:
|
|
6805
|
-
expires_at:
|
|
6842
|
+
scopes: import_zod29.z.array(import_zod29.z.string()).meta({ description: "The scopes the client asked for, to show the person before they approve." }),
|
|
6843
|
+
already_granted: import_zod29.z.boolean().meta({ description: "Whether this user has already approved this client. It is a record of what they answered last time, and **this route makes no second use of it**: an app that skips its own consent screen when this is `true` is the only thing deciding that, and approve succeeds identically for a user who holds no grant at all. The standing grant is read elsewhere, on every request to the app's MCP endpoint. Withdrawing it is `DELETE /api/client/mcp/grants/:clientId` for the person themselves and `DELETE /api/apps/:id/users/:userId/mcp-grants/:clientId` for the developer. A withdrawal makes this `false` again at the next authorization **and stops the client at its very next MCP call**, unexpired access token and all \u2014 up to fifteen minutes of it \u2014 because the endpoint keys that check on the `client_id` the token carries." }),
|
|
6844
|
+
expires_at: import_zod29.z.iso.datetime().meta({ description: "When the interaction stops being approvable. Ten minutes from the authorize step; afterwards both approve and deny answer `interaction_expired`." })
|
|
6806
6845
|
});
|
|
6807
|
-
var clientMcpInteractionDecisionResponse =
|
|
6808
|
-
redirect_to:
|
|
6846
|
+
var clientMcpInteractionDecisionResponse = import_zod29.z.object({
|
|
6847
|
+
redirect_to: import_zod29.z.url().meta({
|
|
6809
6848
|
description: "Send the browser here. It is the MCP client's own callback, carrying either the authorization code or `error=access_denied` \u2014 a denial redirects as well, so the client learns the outcome from the place it is waiting."
|
|
6810
6849
|
})
|
|
6811
6850
|
});
|
|
6812
|
-
var mcpConsentGrant =
|
|
6813
|
-
client_id:
|
|
6851
|
+
var mcpConsentGrant = import_zod29.z.object({
|
|
6852
|
+
client_id: import_zod29.z.string().meta({
|
|
6814
6853
|
description: "The MCP client this consent is for: the id its dynamic registration was issued, or the HTTPS URL of its Client ID Metadata Document. It is the value the withdrawal routes take in their path, percent-encoded, and it is the only stable handle on a client \u2014 the name beside it is not one."
|
|
6815
6854
|
}),
|
|
6816
|
-
client_id_host:
|
|
6855
|
+
client_id_host: import_zod29.z.string().nullable().meta({
|
|
6817
6856
|
description: "The hostname of `client_id` when it is a Client ID Metadata Document URL; `null` for a self-registered client. The grant is to whoever controls that domain."
|
|
6818
6857
|
}),
|
|
6819
|
-
client_name:
|
|
6858
|
+
client_name: import_zod29.z.string().nullable().meta({
|
|
6820
6859
|
description: "What the client calls itself, or `null` once its registration or cached metadata document is gone. **Unverified** \u2014 see `client_name_verified`."
|
|
6821
6860
|
}),
|
|
6822
|
-
client_name_verified:
|
|
6861
|
+
client_name_verified: import_zod29.z.literal(false).meta({
|
|
6823
6862
|
description: "Always `false`. The client named itself \u2014 in an unauthenticated dynamic registration or in its own Client ID Metadata Document \u2014 so the name must be rendered as a claim and never as an identity. Only `client_id_host` was checked, by fetching the document from it. There is no verified case, which is why this is a literal and not a boolean: a `true` branch would be dead code that looked like a safeguard."
|
|
6824
6863
|
}),
|
|
6825
|
-
granted_at:
|
|
6864
|
+
granted_at: import_zod29.z.iso.datetime().meta({
|
|
6826
6865
|
description: "When the consent was last given. A withdrawal followed by a fresh approval moves it, because the second approval is the agreement that stands \u2014 it is not a record of the first time anybody ever said yes."
|
|
6827
6866
|
})
|
|
6828
6867
|
});
|
|
6829
|
-
var mcpConsentGrantListResponse =
|
|
6830
|
-
grants:
|
|
6868
|
+
var mcpConsentGrantListResponse = import_zod29.z.object({
|
|
6869
|
+
grants: import_zod29.z.array(mcpConsentGrant).meta({
|
|
6831
6870
|
description: "Every standing consent this app user holds, newest first. Withdrawn ones are absent rather than listed as withdrawn; an app user who has connected no MCP client answers an empty array."
|
|
6832
6871
|
})
|
|
6833
6872
|
});
|
|
6834
|
-
var clientIdentity =
|
|
6835
|
-
kind:
|
|
6873
|
+
var clientIdentity = import_zod29.z.object({
|
|
6874
|
+
kind: import_zod29.z.enum(["developer", "app_user", "server_key"]).meta({
|
|
6836
6875
|
description: "Which of the three kinds of caller this is: a `developer` working through the console, an `app_user` holding a token from a client login, or a `server_key` used by server-side code. Stated outright, not inferred from which id is set."
|
|
6837
6876
|
}),
|
|
6838
|
-
developer_id:
|
|
6877
|
+
developer_id: import_zod29.z.uuid().nullable().meta({
|
|
6839
6878
|
description: "The Fleetless user behind this session, or `null` when `kind` is not `developer`."
|
|
6840
6879
|
}),
|
|
6841
|
-
app_user_id:
|
|
6880
|
+
app_user_id: import_zod29.z.uuid().nullable().meta({
|
|
6842
6881
|
description: "The app user behind this session, or `null` when `kind` is not `app_user`. An app user belongs to exactly one app and is unrelated to any Fleetless user with the same address."
|
|
6843
6882
|
}),
|
|
6844
|
-
server_key_id:
|
|
6883
|
+
server_key_id: import_zod29.z.uuid().nullable().meta({
|
|
6845
6884
|
description: "The server key this session was authenticated with, or `null` when `kind` is not `server_key`."
|
|
6846
6885
|
}),
|
|
6847
|
-
app_id:
|
|
6886
|
+
app_id: import_zod29.z.uuid().nullable().meta({
|
|
6848
6887
|
description: "The app this session belongs to, and `null` for a developer \u2014 a developer is organisation-scoped and owns the configuration of every robot in the organisation rather than reaching one through an app."
|
|
6849
6888
|
}),
|
|
6850
|
-
role:
|
|
6889
|
+
role: import_zod29.z.object({
|
|
6851
6890
|
key: roleKey.meta({
|
|
6852
6891
|
description: "The role's key, the same string `fleetless.yaml` and the organization's role list write."
|
|
6853
6892
|
}),
|
|
6854
|
-
name:
|
|
6893
|
+
name: import_zod29.z.string().meta({
|
|
6855
6894
|
description: "The role's display name, for showing the caller what they hold. Changing it changes nothing about rights."
|
|
6856
6895
|
})
|
|
6857
6896
|
}).nullable().meta({
|
|
6858
6897
|
description: "The organization role that decides what this caller may reach: its key and display name. `null` when there is no role to name: for a developer and for a server key, which are not filtered by a role, and for an app user whose key names no role (the role was deleted), who then reaches nothing."
|
|
6859
6898
|
}),
|
|
6860
|
-
email:
|
|
6899
|
+
email: import_zod29.z.email().nullable().meta({
|
|
6861
6900
|
description: "The address of the Fleetless user or app user behind this session, and `null` for a server key, which is not a person."
|
|
6862
6901
|
}),
|
|
6863
|
-
two_factor_enabled:
|
|
6902
|
+
two_factor_enabled: import_zod29.z.boolean().nullable().meta({
|
|
6864
6903
|
description: "Whether the app user has a confirmed authenticator, so the app's account settings can offer to turn it on or off. `null` unless `kind` is `app_user`."
|
|
6865
6904
|
})
|
|
6866
6905
|
});
|
|
6867
6906
|
|
|
6868
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
6869
|
-
var
|
|
6870
|
-
var timestamp =
|
|
6871
|
-
var count3 =
|
|
6872
|
-
var schemaVersion =
|
|
6873
|
-
var collectionActor =
|
|
6874
|
-
kind:
|
|
6907
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-records.js
|
|
6908
|
+
var import_zod30 = require("zod");
|
|
6909
|
+
var timestamp = import_zod30.z.iso.datetime();
|
|
6910
|
+
var count3 = import_zod30.z.number().int().min(0);
|
|
6911
|
+
var schemaVersion = import_zod30.z.number().int().min(1);
|
|
6912
|
+
var collectionActor = import_zod30.z.object({
|
|
6913
|
+
kind: import_zod30.z.enum(["developer", "app_user", "server_key", "fleetless"]).meta({
|
|
6875
6914
|
description: "What made the change: a developer, a user of the app, a server key of the app, or the platform itself."
|
|
6876
6915
|
}),
|
|
6877
|
-
id:
|
|
6878
|
-
label:
|
|
6916
|
+
id: import_zod30.z.uuid().meta({ description: "The id of the developer, app user or server key. The nil id for the platform." }),
|
|
6917
|
+
label: import_zod30.z.string().min(1).max(200).meta({
|
|
6879
6918
|
description: "A name to show: the person's display name, the name of a server key, `Fleetless`, `Deleted user` when the user no longer exists, or `Deleted key` when the key does. A person without a display name reads as their email address to a developer or a server key and to themselves, and to an app user reading someone else as `Team member` (a developer) or `User` (an app user): an app user never learns another person's address."
|
|
6880
6919
|
})
|
|
6881
6920
|
}).meta({ description: "Who or what made a change to a record." });
|
|
6882
|
-
var collectionRecord =
|
|
6883
|
-
id:
|
|
6884
|
-
robot_id:
|
|
6921
|
+
var collectionRecord = import_zod30.z.object({
|
|
6922
|
+
id: import_zod30.z.uuid(),
|
|
6923
|
+
robot_id: import_zod30.z.uuid().nullable().meta({
|
|
6885
6924
|
description: "The robot a record of a `per_robot` or `one_per_robot` collection belongs to; null in a `global` collection."
|
|
6886
6925
|
}),
|
|
6887
6926
|
created_at: timestamp,
|
|
6888
6927
|
created_by: collectionActor,
|
|
6889
6928
|
updated_at: timestamp,
|
|
6890
6929
|
updated_by: collectionActor,
|
|
6891
|
-
revision:
|
|
6892
|
-
display:
|
|
6893
|
-
missing_required:
|
|
6930
|
+
revision: import_zod30.z.number().int().min(1).meta({ description: "Starts at 1 and grows by one with every change. Send it as `expected_revision` to refuse a write that would overwrite a newer one." }),
|
|
6931
|
+
display: import_zod30.z.string().meta({ description: "The collection's display template filled in for this record." }),
|
|
6932
|
+
missing_required: import_zod30.z.array(import_zod30.z.string()).meta({
|
|
6894
6933
|
description: "Required fields that are empty because the schema changed after the record was written. The record can still be updated in its other fields. Absent when nothing is missing."
|
|
6895
6934
|
}).optional(),
|
|
6896
|
-
values:
|
|
6935
|
+
values: import_zod30.z.record(import_zod30.z.string(), import_zod30.z.unknown()).meta({
|
|
6897
6936
|
description: "The record's fields by key. A field without a value is absent. With `expand`, a reference field holds the referenced record in this same shape instead of its id, when the caller may read that collection."
|
|
6898
6937
|
}),
|
|
6899
6938
|
deleted_at: timestamp.meta({ description: "When the record was deleted. Present only in the list of deleted records (`deleted=true`); absent on a live record." }).optional(),
|
|
6900
6939
|
deleted_by: collectionActor.meta({ description: "Who deleted the record. Present only in the list of deleted records (`deleted=true`); absent on a live record." }).optional()
|
|
6901
6940
|
}).meta({ description: "A record of a collection: its system fields and its values." });
|
|
6902
|
-
var collectionFilter =
|
|
6941
|
+
var collectionFilter = import_zod30.z.record(import_zod30.z.string(), import_zod30.z.unknown()).meta({
|
|
6903
6942
|
description: 'A filter is a JSON object. A condition names a field and one operator: `{ "location.name": { "eq": "XTD1" } }`. The operators are `eq`, `ne`, `lt`, `lte`, `gt`, `gte`, `contains` (case-insensitive text search), `in` (a list of at most 100 values) and `empty` (`true` or `false`). Conditions are combined with `{ "and": [ ... ] }` and `{ "or": [ ... ] }`, nested at most 3 levels deep, 50 conditions in all. A field is a field key, `reference.field` to go one hop through a reference field, or one of the system fields `id`, `robot_id`, `created_at`, `updated_at` and `created_by`.'
|
|
6904
6943
|
});
|
|
6905
|
-
var pageLimit =
|
|
6906
|
-
var wireBoolean =
|
|
6907
|
-
var expandParam =
|
|
6944
|
+
var pageLimit = import_zod30.z.union([import_zod30.z.string().regex(/^\d{1,4}$/), import_zod30.z.number().int()]).transform((v) => Number(v)).pipe(import_zod30.z.number().int().positive().max(COLLECTION_LIMITS.pageMax));
|
|
6945
|
+
var wireBoolean = import_zod30.z.enum(["true", "false"]);
|
|
6946
|
+
var expandParam = import_zod30.z.string().min(1).meta({
|
|
6908
6947
|
description: "Reference fields to embed as records, separated by commas. Only one hop is followed. The embedded records are not counted in the size of a page."
|
|
6909
6948
|
});
|
|
6910
|
-
var collectionRecordListQuery =
|
|
6911
|
-
filter:
|
|
6949
|
+
var collectionRecordListQuery = import_zod30.z.object({
|
|
6950
|
+
filter: import_zod30.z.string().min(1).meta({
|
|
6912
6951
|
description: 'A filter as JSON text, for example `{"location.name":{"eq":"XTD1"}}`. A condition names a field of the collection, one of the system fields `id`, `robot_id`, `created_at`, `updated_at` and `created_by`, or a field of a referenced record written `reference.field`. `created_by` is compared with the id of the developer, user or key that created the record.'
|
|
6913
6952
|
}).optional(),
|
|
6914
|
-
search:
|
|
6953
|
+
search: import_zod30.z.string().meta({
|
|
6915
6954
|
description: "Words that must all occur, in any letter case, in at least one searchable field of the record. At most 10 words, separated by whitespace."
|
|
6916
6955
|
}).optional(),
|
|
6917
|
-
sort:
|
|
6956
|
+
sort: import_zod30.z.string().min(1).meta({
|
|
6918
6957
|
description: "Up to 3 fields separated by commas; a leading `-` sorts descending, for example `-position_m,name`. A field is named as in `filter`: a field of the collection, one of the system fields `id`, `robot_id`, `created_at`, `updated_at` and `created_by`, or `reference.field`. Ties are broken by `id`."
|
|
6919
6958
|
}).optional(),
|
|
6920
6959
|
expand: expandParam.optional(),
|
|
6921
6960
|
limit: pageLimit.meta({
|
|
6922
6961
|
description: `The most records to return, 1 to ${COLLECTION_LIMITS.pageMax}. Default ${COLLECTION_LIMITS.pageDefault}. A page can hold fewer: see \`next_cursor\`.`
|
|
6923
6962
|
}).optional(),
|
|
6924
|
-
cursor:
|
|
6963
|
+
cursor: import_zod30.z.string().min(1).meta({ description: "The `next_cursor` of the previous page." }).optional(),
|
|
6925
6964
|
count: wireBoolean.meta({ description: "`true` adds `total`, the number of records that match." }).optional(),
|
|
6926
6965
|
deleted: wireBoolean.meta({ description: "`true` lists deleted records instead, newest deletion first. Needs the right to create records." }).optional(),
|
|
6927
|
-
robot:
|
|
6966
|
+
robot: import_zod30.z.uuid().meta({ description: "Only the records of this robot, in a collection that belongs to robots." }).optional()
|
|
6928
6967
|
}).strict();
|
|
6929
|
-
var collectionRecordGetQuery =
|
|
6930
|
-
var collectionRecordListResponse =
|
|
6931
|
-
records:
|
|
6968
|
+
var collectionRecordGetQuery = import_zod30.z.object({ expand: expandParam.optional() }).strict();
|
|
6969
|
+
var collectionRecordListResponse = import_zod30.z.object({
|
|
6970
|
+
records: import_zod30.z.array(collectionRecord).meta({
|
|
6932
6971
|
description: "The records of the page. A page is cut short at 4 MiB of stored record values (for the list of deleted records, of the revisions that deleted them), so it can hold fewer than `limit` records while more follow. It always holds at least one record when there is one, and a list of ordinary size is never cut."
|
|
6933
6972
|
}),
|
|
6934
|
-
next_cursor:
|
|
6973
|
+
next_cursor: import_zod30.z.string().nullable().meta({
|
|
6935
6974
|
description: "Send it as `cursor` to read the next page; it continues after the last record this page holds. Null when this is the last page, which a short page does not say on its own: only `null` says the list is at its end."
|
|
6936
6975
|
}),
|
|
6937
6976
|
total: count3.meta({ description: "The number of records that match, sent only when `count=true` was asked for. A page cut short does not change it." }).optional()
|
|
6938
6977
|
}).meta({ description: "One page of records." });
|
|
6939
|
-
var collectionRecordWrite =
|
|
6940
|
-
values:
|
|
6978
|
+
var collectionRecordWrite = import_zod30.z.object({
|
|
6979
|
+
values: import_zod30.z.record(import_zod30.z.string(), import_zod30.z.unknown()).meta({
|
|
6941
6980
|
description: `The fields to set by key. A \`null\` clears a field. On an update, fields that are left out keep their value. A record may hold ${COLLECTION_LIMITS.recordBytes.toLocaleString("en-US")} bytes of values as JSON; more is \`400 validation_error\`, field \`values\`, rule \`record_too_large\`, and so is a request body of more than 2 MiB.`
|
|
6942
6981
|
}),
|
|
6943
|
-
robot_id:
|
|
6944
|
-
expected_revision:
|
|
6982
|
+
robot_id: import_zod30.z.uuid().meta({ description: "The robot of a new record in a collection that belongs to robots. Fixed once the record exists." }).optional(),
|
|
6983
|
+
expected_revision: import_zod30.z.number().int().min(1).meta({ description: "The revision you last read. The write is refused with `record_changed` if the record has moved on." }).optional()
|
|
6945
6984
|
}).strict().meta({ description: "The body of a record create or update." });
|
|
6946
|
-
var collectionRevision =
|
|
6947
|
-
seq:
|
|
6948
|
-
op:
|
|
6985
|
+
var collectionRevision = import_zod30.z.object({
|
|
6986
|
+
seq: import_zod30.z.number().int().positive().meta({ description: "The position of this revision in the history. Use it to page (`before_seq`) and to restore (`seq`)." }),
|
|
6987
|
+
op: import_zod30.z.enum(["create", "update", "delete", "restore"]),
|
|
6949
6988
|
at: timestamp,
|
|
6950
6989
|
actor: collectionActor,
|
|
6951
|
-
reason:
|
|
6952
|
-
revision:
|
|
6953
|
-
changes:
|
|
6990
|
+
reason: import_zod30.z.string().nullable().meta({ description: "Why a change was made when it was not an ordinary write: `schema v5`, `import`, `restore v4`. Null otherwise." }),
|
|
6991
|
+
revision: import_zod30.z.number().int().min(1).meta({ description: "The record's revision number after this change." }),
|
|
6992
|
+
changes: import_zod30.z.record(import_zod30.z.string(), import_zod30.z.object({ old: import_zod30.z.unknown(), new: import_zod30.z.unknown() })).meta({
|
|
6954
6993
|
description: "The fields this change touched by key, each with its value before and after. `null` means no value."
|
|
6955
6994
|
}),
|
|
6956
6995
|
record: collectionRecord.nullable().meta({ description: "The whole record, on a `delete` revision. Null on every other operation." })
|
|
6957
6996
|
}).meta({ description: "One change in the history of a record." });
|
|
6958
|
-
var collectionRecordHistoryQuery =
|
|
6997
|
+
var collectionRecordHistoryQuery = import_zod30.z.object({
|
|
6959
6998
|
limit: pageLimit.meta({ description: `The most revisions to return, 1 to ${COLLECTION_LIMITS.pageMax}. A page can hold fewer: see \`next_before_seq\`.` }).optional(),
|
|
6960
6999
|
before_seq: wireSeqCursor.meta({ description: "Only revisions older than this `seq`: the next page, since the history is read newest first." }).optional()
|
|
6961
7000
|
}).strict();
|
|
6962
|
-
var collectionRecordHistoryResponse =
|
|
6963
|
-
revisions:
|
|
7001
|
+
var collectionRecordHistoryResponse = import_zod30.z.object({
|
|
7002
|
+
revisions: import_zod30.z.array(collectionRevision).meta({
|
|
6964
7003
|
description: "The revisions of the page, newest first. A page is cut short at 4 MiB of stored revisions, since the changes of a revision keep the old and the new value and a `delete` the whole record. It always holds at least one revision, and a history of ordinary size is never cut."
|
|
6965
7004
|
}),
|
|
6966
|
-
next_before_seq:
|
|
7005
|
+
next_before_seq: import_zod30.z.number().int().positive().nullable().meta({
|
|
6967
7006
|
description: "Send it as `before_seq` to read older revisions; it names the last revision this page holds, also when the page was cut short. Null when there are none."
|
|
6968
7007
|
}),
|
|
6969
|
-
purged:
|
|
7008
|
+
purged: import_zod30.z.object({
|
|
6970
7009
|
before: timestamp.meta({ description: "Revisions older than this were removed." }),
|
|
6971
7010
|
by: collectionActor,
|
|
6972
7011
|
at: timestamp.meta({ description: "When they were removed." })
|
|
6973
7012
|
}).nullable().meta({ description: "Set when an organization owner removed the older part of this history: the history then starts with that note." })
|
|
6974
7013
|
}).meta({ description: "A page of a record's history, newest first." });
|
|
6975
|
-
var collectionRecordRestoreRequest =
|
|
6976
|
-
seq:
|
|
7014
|
+
var collectionRecordRestoreRequest = import_zod30.z.object({
|
|
7015
|
+
seq: import_zod30.z.number().int().positive().meta({ description: "Put the record back to its state after this revision. Leave it out to restore a deleted record." }).optional()
|
|
6977
7016
|
}).strict().meta({ description: "The body of a record restore." });
|
|
6978
|
-
var collectionSummary =
|
|
7017
|
+
var collectionSummary = import_zod30.z.object({
|
|
6979
7018
|
key: collectionKey,
|
|
6980
|
-
label:
|
|
7019
|
+
label: import_zod30.z.string(),
|
|
6981
7020
|
binding: collectionBinding,
|
|
6982
7021
|
records: count3.meta({ description: "Records the collection holds now." }),
|
|
6983
7022
|
fields: count3,
|
|
6984
|
-
read_roles:
|
|
6985
|
-
warnings:
|
|
7023
|
+
read_roles: import_zod30.z.array(import_zod30.z.string()).meta({ description: "The roles that may read the records." }),
|
|
7024
|
+
warnings: import_zod30.z.array(import_zod30.z.enum(["no_role_access", "history_growing", "unknown_role"])).meta({
|
|
6986
7025
|
description: "`no_role_access`: no role may read these records. `unknown_role`: `access` names a role the organization does not have. `history_growing`: the history is far larger than the records, which often means a client writing in a loop."
|
|
6987
7026
|
}),
|
|
6988
7027
|
revisions: count3.meta({ description: "Entries in the history of all the collection's records." }),
|
|
6989
7028
|
history_bytes: count3.meta({ description: "The size of that history in bytes." }),
|
|
6990
7029
|
updated_at: timestamp.nullable().meta({ description: "When a record of the collection last changed. Null if it never held one." })
|
|
6991
7030
|
}).meta({ description: "A collection as the developer's overview shows it." });
|
|
6992
|
-
var collectionListResponse =
|
|
7031
|
+
var collectionListResponse = import_zod30.z.object({
|
|
6993
7032
|
version: schemaVersion.nullable().meta({ description: "The published schema version. Null before anything was published." }),
|
|
6994
|
-
collections:
|
|
7033
|
+
collections: import_zod30.z.array(collectionSummary)
|
|
6995
7034
|
}).meta({ description: "The collections of an app." });
|
|
6996
|
-
var collectionCan =
|
|
6997
|
-
read:
|
|
6998
|
-
create:
|
|
6999
|
-
update:
|
|
7000
|
-
delete:
|
|
7035
|
+
var collectionCan = import_zod30.z.object({
|
|
7036
|
+
read: import_zod30.z.boolean(),
|
|
7037
|
+
create: import_zod30.z.boolean(),
|
|
7038
|
+
update: import_zod30.z.union([import_zod30.z.enum(["all", "own"]), import_zod30.z.literal(false)]).meta({ description: "`all`: any record. `own`: only records the caller created. `false`: none." }),
|
|
7039
|
+
delete: import_zod30.z.union([import_zod30.z.enum(["all", "own"]), import_zod30.z.literal(false)]).meta({ description: "`all`: any record. `own`: only records the caller created. `false`: none." })
|
|
7001
7040
|
}).meta({ description: "What the caller may do with the records of this collection." });
|
|
7002
|
-
var collectionDefinitionsResponse =
|
|
7041
|
+
var collectionDefinitionsResponse = import_zod30.z.object({
|
|
7003
7042
|
version: schemaVersion.nullable().meta({ description: "The published schema version. Null before anything was published." }),
|
|
7004
|
-
collections:
|
|
7043
|
+
collections: import_zod30.z.array(import_zod30.z.object({
|
|
7005
7044
|
key: collectionKey,
|
|
7006
|
-
label:
|
|
7007
|
-
description:
|
|
7045
|
+
label: import_zod30.z.string(),
|
|
7046
|
+
description: import_zod30.z.string(),
|
|
7008
7047
|
binding: collectionBinding,
|
|
7009
|
-
display:
|
|
7010
|
-
fields:
|
|
7048
|
+
display: import_zod30.z.string().meta({ description: "The template that names a record of this collection." }),
|
|
7049
|
+
fields: import_zod30.z.record(collectionKey, collectionField),
|
|
7011
7050
|
can: collectionCan
|
|
7012
7051
|
}))
|
|
7013
7052
|
}).meta({ description: "The collections the caller may read, with their field definitions and the caller's rights." });
|
|
7014
7053
|
|
|
7015
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
7016
|
-
var clientAuth =
|
|
7017
|
-
type:
|
|
7018
|
-
token:
|
|
7054
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/realtime.js
|
|
7055
|
+
var clientAuth = import_zod31.z.object({
|
|
7056
|
+
type: import_zod31.z.literal("auth"),
|
|
7057
|
+
token: import_zod31.z.string().min(1)
|
|
7019
7058
|
});
|
|
7020
|
-
var authOk =
|
|
7021
|
-
type:
|
|
7059
|
+
var authOk = import_zod31.z.object({
|
|
7060
|
+
type: import_zod31.z.literal("auth_ok"),
|
|
7022
7061
|
identity: clientIdentity
|
|
7023
7062
|
});
|
|
7024
|
-
var authError =
|
|
7025
|
-
type:
|
|
7026
|
-
code:
|
|
7027
|
-
message:
|
|
7063
|
+
var authError = import_zod31.z.object({
|
|
7064
|
+
type: import_zod31.z.literal("auth_error"),
|
|
7065
|
+
code: import_zod31.z.string().min(1),
|
|
7066
|
+
message: import_zod31.z.string().min(1)
|
|
7028
7067
|
});
|
|
7029
|
-
var clientInvoke =
|
|
7030
|
-
type:
|
|
7031
|
-
request_id:
|
|
7032
|
-
robot_id:
|
|
7068
|
+
var clientInvoke = import_zod31.z.object({
|
|
7069
|
+
type: import_zod31.z.literal("invoke"),
|
|
7070
|
+
request_id: import_zod31.z.string().min(1).max(64),
|
|
7071
|
+
robot_id: import_zod31.z.uuid(),
|
|
7033
7072
|
slug,
|
|
7034
7073
|
/** Parameters by field path, validated against the configuration's rules. */
|
|
7035
|
-
params:
|
|
7074
|
+
params: import_zod31.z.record(import_zod31.z.string(), import_zod31.z.unknown()),
|
|
7036
7075
|
/**
|
|
7037
7076
|
* How long this one call is worth waiting for — the same field, meaning and
|
|
7038
7077
|
* cap as `invokeRequest.patience_ms`; absent means `DEFAULT_PATIENCE_MS`.
|
|
@@ -7042,12 +7081,12 @@ var clientInvoke = import_zod30.z.object({
|
|
|
7042
7081
|
* unreachable to every caller that invokes over the realtime channel, while
|
|
7043
7082
|
* still appearing in the documentation.
|
|
7044
7083
|
*/
|
|
7045
|
-
patience_ms:
|
|
7084
|
+
patience_ms: import_zod31.z.number().int().min(MIN_PATIENCE_MS).max(MAX_PATIENCE_MS).optional()
|
|
7046
7085
|
});
|
|
7047
|
-
var clientCancel =
|
|
7048
|
-
type:
|
|
7049
|
-
request_id:
|
|
7050
|
-
robot_id:
|
|
7086
|
+
var clientCancel = import_zod31.z.object({
|
|
7087
|
+
type: import_zod31.z.literal("cancel"),
|
|
7088
|
+
request_id: import_zod31.z.string().min(1).max(64),
|
|
7089
|
+
robot_id: import_zod31.z.uuid(),
|
|
7051
7090
|
/** Which slug — required, and the coarse address of a cancel. */
|
|
7052
7091
|
slug,
|
|
7053
7092
|
/**
|
|
@@ -7065,19 +7104,19 @@ var clientCancel = import_zod30.z.object({
|
|
|
7065
7104
|
* back to the slug. Falling back would be the platform deciding that the
|
|
7066
7105
|
* caller did not really mean the id they typed.
|
|
7067
7106
|
*/
|
|
7068
|
-
job_id:
|
|
7107
|
+
job_id: import_zod31.z.uuid().nullable()
|
|
7069
7108
|
});
|
|
7070
|
-
var clientPublish =
|
|
7071
|
-
type:
|
|
7072
|
-
request_id:
|
|
7073
|
-
robot_id:
|
|
7109
|
+
var clientPublish = import_zod31.z.object({
|
|
7110
|
+
type: import_zod31.z.literal("publish"),
|
|
7111
|
+
request_id: import_zod31.z.string().min(1).max(64),
|
|
7112
|
+
robot_id: import_zod31.z.uuid(),
|
|
7074
7113
|
slug,
|
|
7075
|
-
message:
|
|
7114
|
+
message: import_zod31.z.record(import_zod31.z.string(), import_zod31.z.unknown())
|
|
7076
7115
|
});
|
|
7077
|
-
var commandResult =
|
|
7078
|
-
type:
|
|
7079
|
-
request_id:
|
|
7080
|
-
ok:
|
|
7116
|
+
var commandResult = import_zod31.z.object({
|
|
7117
|
+
type: import_zod31.z.literal("command_result"),
|
|
7118
|
+
request_id: import_zod31.z.string().min(1).max(64),
|
|
7119
|
+
ok: import_zod31.z.boolean(),
|
|
7081
7120
|
/**
|
|
7082
7121
|
* The job this reply is *about* — which is not always the caller's own.
|
|
7083
7122
|
*
|
|
@@ -7101,9 +7140,9 @@ var commandResult = import_zod30.z.object({
|
|
|
7101
7140
|
* later. Returning the kind lets a client refuse its own mistake at once,
|
|
7102
7141
|
* instead of reporting it as the machine's.
|
|
7103
7142
|
*/
|
|
7104
|
-
kind:
|
|
7105
|
-
code:
|
|
7106
|
-
message:
|
|
7143
|
+
kind: import_zod31.z.enum(["datapoint", "action", "service", "publisher", "camera"]).nullable(),
|
|
7144
|
+
code: import_zod31.z.string().nullable(),
|
|
7145
|
+
message: import_zod31.z.string().nullable(),
|
|
7107
7146
|
/**
|
|
7108
7147
|
* The same payload the REST envelope carries in `apiError.details` — for
|
|
7109
7148
|
* `parameter_invalid`, a `parameterInvalidDetails`.
|
|
@@ -7114,16 +7153,16 @@ var commandResult = import_zod30.z.object({
|
|
|
7114
7153
|
* socket. A client cannot bind an error to the input that caused it from a
|
|
7115
7154
|
* code alone, which is the entire point of the flat parameter shape.
|
|
7116
7155
|
*/
|
|
7117
|
-
details:
|
|
7156
|
+
details: import_zod31.z.unknown().optional()
|
|
7118
7157
|
});
|
|
7119
|
-
var errorFrame =
|
|
7120
|
-
type:
|
|
7121
|
-
code:
|
|
7122
|
-
message:
|
|
7158
|
+
var errorFrame = import_zod31.z.object({
|
|
7159
|
+
type: import_zod31.z.literal("error"),
|
|
7160
|
+
code: import_zod31.z.string().min(1),
|
|
7161
|
+
message: import_zod31.z.string().min(1)
|
|
7123
7162
|
});
|
|
7124
|
-
var clientSubscribe =
|
|
7125
|
-
type:
|
|
7126
|
-
robot_id:
|
|
7163
|
+
var clientSubscribe = import_zod31.z.object({
|
|
7164
|
+
type: import_zod31.z.literal("subscribe"),
|
|
7165
|
+
robot_id: import_zod31.z.uuid(),
|
|
7127
7166
|
slug,
|
|
7128
7167
|
/**
|
|
7129
7168
|
* What the subscriber expects, and how it wants it.
|
|
@@ -7143,35 +7182,45 @@ var clientSubscribe = import_zod30.z.object({
|
|
|
7143
7182
|
* request was the same mistake as the silent wrong-verb subscribe this
|
|
7144
7183
|
* field was added to fix.
|
|
7145
7184
|
*/
|
|
7146
|
-
kind:
|
|
7147
|
-
options:
|
|
7185
|
+
kind: import_zod31.z.enum(["datapoint", "action", "service", "publisher", "camera"]).optional(),
|
|
7186
|
+
options: import_zod31.z.record(import_zod31.z.string(), import_zod31.z.unknown()).optional()
|
|
7148
7187
|
});
|
|
7149
|
-
var clientUnsubscribe =
|
|
7150
|
-
type:
|
|
7151
|
-
robot_id:
|
|
7188
|
+
var clientUnsubscribe = import_zod31.z.object({
|
|
7189
|
+
type: import_zod31.z.literal("unsubscribe"),
|
|
7190
|
+
robot_id: import_zod31.z.uuid(),
|
|
7152
7191
|
slug
|
|
7153
7192
|
});
|
|
7154
|
-
var subscribeError =
|
|
7155
|
-
type:
|
|
7156
|
-
robot_id:
|
|
7157
|
-
slug:
|
|
7158
|
-
code:
|
|
7159
|
-
message:
|
|
7193
|
+
var subscribeError = import_zod31.z.object({
|
|
7194
|
+
type: import_zod31.z.literal("subscribe_error"),
|
|
7195
|
+
robot_id: import_zod31.z.string(),
|
|
7196
|
+
slug: import_zod31.z.string(),
|
|
7197
|
+
code: import_zod31.z.string().min(1),
|
|
7198
|
+
message: import_zod31.z.string().min(1)
|
|
7160
7199
|
});
|
|
7161
|
-
var datapointEvent =
|
|
7162
|
-
type:
|
|
7163
|
-
robot_id:
|
|
7200
|
+
var datapointEvent = import_zod31.z.object({
|
|
7201
|
+
type: import_zod31.z.literal("datapoint"),
|
|
7202
|
+
robot_id: import_zod31.z.uuid(),
|
|
7164
7203
|
slug,
|
|
7165
|
-
value:
|
|
7166
|
-
timestamp_ms:
|
|
7204
|
+
value: import_zod31.z.unknown(),
|
|
7205
|
+
timestamp_ms: import_zod31.z.number().int().nonnegative()
|
|
7167
7206
|
});
|
|
7168
|
-
var liveSessionEndReason =
|
|
7207
|
+
var liveSessionEndReason = import_zod31.z.enum([
|
|
7169
7208
|
/** Another holder of this camera released it — another tab, or another client. */
|
|
7170
7209
|
"released_by_peer",
|
|
7171
7210
|
/** The robot's configuration was published and this camera changed with it. */
|
|
7172
7211
|
"config_changed",
|
|
7173
|
-
/**
|
|
7212
|
+
/**
|
|
7213
|
+
* The robot said publishing died after it had started. `detail` is `null`:
|
|
7214
|
+
* the robot's own words never travel here (see `detail`).
|
|
7215
|
+
*/
|
|
7174
7216
|
"publish_failed",
|
|
7217
|
+
/**
|
|
7218
|
+
* The robot refused to start this camera's live video: the first start,
|
|
7219
|
+
* or the restart after a bridge reconnect (fleetless/fleetless#1126).
|
|
7220
|
+
* Distinct from `publish_failed`, which means a running stream stopped. `detail` is the
|
|
7221
|
+
* cloud's fixed sentence for the refusal and `refusal` names its class.
|
|
7222
|
+
*/
|
|
7223
|
+
"start_refused",
|
|
7175
7224
|
/** The bridge stopped answering. */
|
|
7176
7225
|
"robot_offline",
|
|
7177
7226
|
/** The grant this session was minted under was withdrawn. */
|
|
@@ -7194,12 +7243,12 @@ var liveSessionEndReason = import_zod30.z.enum([
|
|
|
7194
7243
|
*/
|
|
7195
7244
|
"unknown"
|
|
7196
7245
|
]);
|
|
7197
|
-
var liveSessionEvent =
|
|
7198
|
-
type:
|
|
7199
|
-
robot_id:
|
|
7246
|
+
var liveSessionEvent = import_zod31.z.object({
|
|
7247
|
+
type: import_zod31.z.literal("live_session"),
|
|
7248
|
+
robot_id: import_zod31.z.uuid(),
|
|
7200
7249
|
slug,
|
|
7201
|
-
session_id:
|
|
7202
|
-
state:
|
|
7250
|
+
session_id: import_zod31.z.uuid(),
|
|
7251
|
+
state: import_zod31.z.literal("ended"),
|
|
7203
7252
|
reason: liveSessionEndReason,
|
|
7204
7253
|
/**
|
|
7205
7254
|
* **Classified text the cloud produced, never text the robot sent.**
|
|
@@ -7214,47 +7263,53 @@ var liveSessionEvent = import_zod30.z.object({
|
|
|
7214
7263
|
* code with fixed text, the way camera health already does it — not as
|
|
7215
7264
|
* forwarded foreign text on a channel a client reads.
|
|
7216
7265
|
*/
|
|
7217
|
-
detail:
|
|
7266
|
+
detail: import_zod31.z.string().max(200).nullable(),
|
|
7267
|
+
/**
|
|
7268
|
+
* Why the robot refused the start, as a class: set with `reason:
|
|
7269
|
+
* 'start_refused'` (fleetless/fleetless#1126), absent or `null` for every
|
|
7270
|
+
* other reason. `detail` carries the matching sentence.
|
|
7271
|
+
*/
|
|
7272
|
+
refusal: liveStartRefusal.nullable().optional(),
|
|
7218
7273
|
/** When it ended — not when this frame was sent. Same reasoning as `changed_at_ms`. */
|
|
7219
|
-
ended_at_ms:
|
|
7220
|
-
});
|
|
7221
|
-
var resourceHealthCleared =
|
|
7222
|
-
type:
|
|
7223
|
-
robot_id:
|
|
7224
|
-
kind:
|
|
7225
|
-
ref:
|
|
7226
|
-
facet:
|
|
7227
|
-
cleared_at_ms:
|
|
7228
|
-
});
|
|
7229
|
-
var resourceHealthEvent =
|
|
7230
|
-
type:
|
|
7231
|
-
robot_id:
|
|
7232
|
-
kind:
|
|
7233
|
-
ref:
|
|
7274
|
+
ended_at_ms: import_zod31.z.number().int().nonnegative()
|
|
7275
|
+
});
|
|
7276
|
+
var resourceHealthCleared = import_zod31.z.object({
|
|
7277
|
+
type: import_zod31.z.literal("resource_health_cleared"),
|
|
7278
|
+
robot_id: import_zod31.z.uuid(),
|
|
7279
|
+
kind: import_zod31.z.enum(RESOURCE_HEALTH_KINDS),
|
|
7280
|
+
ref: import_zod31.z.string().min(1).max(64),
|
|
7281
|
+
facet: import_zod31.z.enum(["source", "publish"]),
|
|
7282
|
+
cleared_at_ms: import_zod31.z.number().int().nonnegative()
|
|
7283
|
+
});
|
|
7284
|
+
var resourceHealthEvent = import_zod31.z.object({
|
|
7285
|
+
type: import_zod31.z.literal("resource_health"),
|
|
7286
|
+
robot_id: import_zod31.z.uuid(),
|
|
7287
|
+
kind: import_zod31.z.enum(RESOURCE_HEALTH_KINDS),
|
|
7288
|
+
ref: import_zod31.z.string().min(1).max(64),
|
|
7234
7289
|
/** Which of the two questions this entry answers — see `resourceHealthState.facet`. */
|
|
7235
|
-
facet:
|
|
7236
|
-
state:
|
|
7237
|
-
reason:
|
|
7238
|
-
changed_at_ms:
|
|
7290
|
+
facet: import_zod31.z.enum(["source", "publish"]),
|
|
7291
|
+
state: import_zod31.z.enum(RESOURCE_HEALTH_STATES),
|
|
7292
|
+
reason: import_zod31.z.string().max(200).nullable(),
|
|
7293
|
+
changed_at_ms: import_zod31.z.number().int().nonnegative()
|
|
7239
7294
|
});
|
|
7240
7295
|
var ORG_EVENT_BUFFER_SIZE = 200;
|
|
7241
|
-
var orgEventKind =
|
|
7242
|
-
var orgEventSeverity =
|
|
7243
|
-
var orgEvent =
|
|
7244
|
-
type:
|
|
7296
|
+
var orgEventKind = import_zod31.z.enum(["datapoint", "health", "job", "bridge", "audit", "alert"]);
|
|
7297
|
+
var orgEventSeverity = import_zod31.z.enum(["info", "warning", "error"]);
|
|
7298
|
+
var orgEvent = import_zod31.z.object({
|
|
7299
|
+
type: import_zod31.z.literal("org_event"),
|
|
7245
7300
|
/**
|
|
7246
7301
|
* **Per org, per process.** Like `job.seq` and unlike `job_runs.seq`, which
|
|
7247
7302
|
* is a postgres `bigserial` and durable. All three say which they are,
|
|
7248
7303
|
* because anyone who confuses them will confuse them in both directions.
|
|
7249
7304
|
*/
|
|
7250
|
-
seq:
|
|
7251
|
-
at:
|
|
7305
|
+
seq: import_zod31.z.number().int().positive(),
|
|
7306
|
+
at: import_zod31.z.iso.datetime(),
|
|
7252
7307
|
kind: orgEventKind,
|
|
7253
7308
|
severity: orgEventSeverity,
|
|
7254
7309
|
/** `null` for an org-level event — an invitation, a quota change — which belongs to no robot. */
|
|
7255
|
-
robot_id:
|
|
7310
|
+
robot_id: import_zod31.z.uuid().nullable(),
|
|
7256
7311
|
/** What the line is about: a slug, a camera, an actor's email. */
|
|
7257
|
-
subject:
|
|
7312
|
+
subject: import_zod31.z.string().min(1).max(200),
|
|
7258
7313
|
/**
|
|
7259
7314
|
* Kind-specific, and **capped at `ORG_EVENT_DETAIL_MAX_BYTES`** — above it
|
|
7260
7315
|
* the producer substitutes `{ omitted: 'too_large', bytes }`. Truncated,
|
|
@@ -7263,13 +7318,13 @@ var orgEvent = import_zod30.z.object({
|
|
|
7263
7318
|
* Never a pre-formatted line: the reader decides language, number format
|
|
7264
7319
|
* and truncation, so changing how a line reads is not a cloud deploy.
|
|
7265
7320
|
*/
|
|
7266
|
-
detail:
|
|
7321
|
+
detail: import_zod31.z.unknown().nullable()
|
|
7267
7322
|
}).strict();
|
|
7268
|
-
var orgEventSubscribe =
|
|
7269
|
-
var orgEventUnsubscribe =
|
|
7270
|
-
var orgEventReplay =
|
|
7271
|
-
type:
|
|
7272
|
-
events:
|
|
7323
|
+
var orgEventSubscribe = import_zod31.z.object({ type: import_zod31.z.literal("org_event_subscribe") }).strict();
|
|
7324
|
+
var orgEventUnsubscribe = import_zod31.z.object({ type: import_zod31.z.literal("org_event_unsubscribe") }).strict();
|
|
7325
|
+
var orgEventReplay = import_zod31.z.object({
|
|
7326
|
+
type: import_zod31.z.literal("org_event_replay"),
|
|
7327
|
+
events: import_zod31.z.array(orgEvent).max(ORG_EVENT_BUFFER_SIZE),
|
|
7273
7328
|
/**
|
|
7274
7329
|
* **`false` means three different things, on purpose**: the buffer was
|
|
7275
7330
|
* already full, the cloud restarted, or this org's buffer had expired. All
|
|
@@ -7277,10 +7332,10 @@ var orgEventReplay = import_zod30.z.object({
|
|
|
7277
7332
|
* line* — and a field separating them would claim a distinction nobody
|
|
7278
7333
|
* would act on differently.
|
|
7279
7334
|
*/
|
|
7280
|
-
complete:
|
|
7335
|
+
complete: import_zod31.z.boolean()
|
|
7281
7336
|
}).strict();
|
|
7282
|
-
var orgEventDropped =
|
|
7283
|
-
type:
|
|
7337
|
+
var orgEventDropped = import_zod31.z.object({
|
|
7338
|
+
type: import_zod31.z.literal("org_event_dropped"),
|
|
7284
7339
|
/**
|
|
7285
7340
|
* **An epoch instant in milliseconds (`Date.now()`), not a duration.**
|
|
7286
7341
|
* The moment this socket last reported a drop — or the moment it
|
|
@@ -7291,75 +7346,75 @@ var orgEventDropped = import_zod30.z.object({
|
|
|
7291
7346
|
* it as "milliseconds ago" renders a drop that happened seconds ago as
|
|
7292
7347
|
* having happened in 1970.
|
|
7293
7348
|
*/
|
|
7294
|
-
since_ms:
|
|
7349
|
+
since_ms: import_zod31.z.number().int().nonnegative(),
|
|
7295
7350
|
/** Always at least one — a frame reporting nothing lost is noise on a channel built to be quiet. */
|
|
7296
|
-
dropped:
|
|
7351
|
+
dropped: import_zod31.z.number().int().positive()
|
|
7297
7352
|
}).strict();
|
|
7298
|
-
var collectionRequestId =
|
|
7353
|
+
var collectionRequestId = import_zod31.z.string().min(1).max(64).meta({
|
|
7299
7354
|
description: "Chosen by the client, unique among the collection subscriptions open on this socket: a `request_id` that is already in use is refused with `validation_error`. Every frame about the subscription carries it."
|
|
7300
7355
|
});
|
|
7301
|
-
var collectionSubscribe =
|
|
7302
|
-
type:
|
|
7356
|
+
var collectionSubscribe = import_zod31.z.object({
|
|
7357
|
+
type: import_zod31.z.literal("collection_subscribe"),
|
|
7303
7358
|
request_id: collectionRequestId,
|
|
7304
|
-
app_id:
|
|
7359
|
+
app_id: import_zod31.z.uuid().meta({
|
|
7305
7360
|
description: "The app whose collection to follow. Required on the connection of a developer, whose token belongs to the organization and so to no app: without it the subscribe is refused with `validation_error`. On the connection of an app user or a server key it can be left out, because the token names the app; if it is sent, it must be that app, otherwise `validation_error`. An app that does not exist or belongs to another organization is answered `collection_not_found`."
|
|
7306
7361
|
}).optional(),
|
|
7307
7362
|
collection: collectionKey.meta({ description: "The key of the collection." }),
|
|
7308
|
-
robot_id:
|
|
7363
|
+
robot_id: import_zod31.z.uuid().meta({ description: "Only the records of this robot, in a collection that belongs to robots." }).optional(),
|
|
7309
7364
|
filter: collectionFilter.meta({
|
|
7310
7365
|
description: "Only records matching this filter are delivered, with the grammar of the `filter` of the record list but as an object, not JSON text. The whole frame is at most 16,384 bytes; a larger frame closes the socket with code 1009 (message too big) instead of being answered, so a filter with many long values may not fit."
|
|
7311
7366
|
}).optional()
|
|
7312
7367
|
}).strict().meta({
|
|
7313
7368
|
description: "Subscribes to the changes of the records of one collection. The cloud answers an accepted subscription with `collection_subscribed` and a refused one with `collection_subscribe_error`."
|
|
7314
7369
|
});
|
|
7315
|
-
var collectionSubscribed =
|
|
7316
|
-
type:
|
|
7370
|
+
var collectionSubscribed = import_zod31.z.object({
|
|
7371
|
+
type: import_zod31.z.literal("collection_subscribed"),
|
|
7317
7372
|
request_id: collectionRequestId.meta({ description: "The `request_id` of the subscription that is now registered." })
|
|
7318
7373
|
}).strict().meta({ description: "A collection subscription is registered: every change it covers is delivered from now on." });
|
|
7319
|
-
var collectionUnsubscribe =
|
|
7320
|
-
type:
|
|
7374
|
+
var collectionUnsubscribe = import_zod31.z.object({
|
|
7375
|
+
type: import_zod31.z.literal("collection_unsubscribe"),
|
|
7321
7376
|
request_id: collectionRequestId.meta({ description: "The `request_id` of the subscription to end." })
|
|
7322
7377
|
}).strict().meta({ description: "Ends a collection subscription." });
|
|
7323
|
-
var collectionEvent =
|
|
7324
|
-
type:
|
|
7378
|
+
var collectionEvent = import_zod31.z.object({
|
|
7379
|
+
type: import_zod31.z.literal("collection_event"),
|
|
7325
7380
|
request_id: collectionRequestId.meta({ description: "The `request_id` of the subscription the event belongs to." }),
|
|
7326
|
-
event:
|
|
7381
|
+
event: import_zod31.z.enum(["created", "updated", "deleted", "removed", "entered"]).meta({
|
|
7327
7382
|
description: "`created`, `updated` and `deleted`: the record was written. `removed`: the record left the view of this subscription without being deleted, because its values no longer match the filter, the role lost the right to read it or its robot was detached. `entered`: the record came into view the same way."
|
|
7328
7383
|
}),
|
|
7329
|
-
id:
|
|
7384
|
+
id: import_zod31.z.uuid().meta({ description: "The id of the record." }),
|
|
7330
7385
|
record: collectionRecord.meta({
|
|
7331
7386
|
description: "The record: as it is now for `created`, `updated`, `entered` and `removed`, and as it was for `deleted`. Absent only on a `removed` event for a record the subscriber may no longer read, so that its values are not told: that is the case when the robot of the record was detached, or when the role lost the right to read the collection."
|
|
7332
7387
|
}).optional()
|
|
7333
7388
|
}).strict().meta({ description: "A record came into view, changed or went away." });
|
|
7334
|
-
var collectionSubscribeError =
|
|
7335
|
-
type:
|
|
7336
|
-
request_id:
|
|
7337
|
-
code:
|
|
7338
|
-
message:
|
|
7389
|
+
var collectionSubscribeError = import_zod31.z.object({
|
|
7390
|
+
type: import_zod31.z.literal("collection_subscribe_error"),
|
|
7391
|
+
request_id: import_zod31.z.string().meta({ description: "The `request_id` of the subscription, as the client sent it." }),
|
|
7392
|
+
code: import_zod31.z.string().min(1).meta({ description: "A stable error code, as in REST; `unauthorized` is also possible here, for a subscribe sent before `auth`." }),
|
|
7393
|
+
message: import_zod31.z.string().min(1)
|
|
7339
7394
|
}).strict().meta({ description: "A collection subscription was refused or has ended." });
|
|
7340
|
-
var collectionsSchemaPublished =
|
|
7341
|
-
type:
|
|
7342
|
-
version:
|
|
7395
|
+
var collectionsSchemaPublished = import_zod31.z.object({
|
|
7396
|
+
type: import_zod31.z.literal("collections_schema_published"),
|
|
7397
|
+
version: import_zod31.z.number().int().min(1).meta({ description: "The version that is in force now." })
|
|
7343
7398
|
}).strict().meta({ description: "A new schema version is in force for the app." });
|
|
7344
7399
|
|
|
7345
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
7346
|
-
var
|
|
7400
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/feedback.js
|
|
7401
|
+
var import_zod32 = require("zod");
|
|
7347
7402
|
var FEEDBACK_KINDS = ["idea", "problem", "question", "other"];
|
|
7348
|
-
var feedbackKind =
|
|
7403
|
+
var feedbackKind = import_zod32.z.enum(FEEDBACK_KINDS);
|
|
7349
7404
|
var FEEDBACK_MESSAGE_MAX = 5e3;
|
|
7350
|
-
var feedbackRequest =
|
|
7405
|
+
var feedbackRequest = import_zod32.z.object({
|
|
7351
7406
|
kind: feedbackKind.meta({
|
|
7352
7407
|
description: "What the message is: an `idea`, a `problem`, a `question` or `other`. It only sorts the inbox; it changes nothing about how the message is handled."
|
|
7353
7408
|
}),
|
|
7354
|
-
message:
|
|
7409
|
+
message: import_zod32.z.string().trim().min(1).max(FEEDBACK_MESSAGE_MAX).meta({
|
|
7355
7410
|
description: "What the developer wrote, trimmed. At most 5000 characters; a message that is only whitespace is refused."
|
|
7356
7411
|
}),
|
|
7357
|
-
page:
|
|
7412
|
+
page: import_zod32.z.string().startsWith("/").max(512).meta({
|
|
7358
7413
|
description: "The console path the message was sent from, e.g. `/robots/:id/jobs` with its real id. A path, never a full URL, so no host and no query string reach the inbox by accident."
|
|
7359
7414
|
})
|
|
7360
7415
|
}).strict();
|
|
7361
|
-
var feedbackResponse =
|
|
7362
|
-
id:
|
|
7416
|
+
var feedbackResponse = import_zod32.z.object({
|
|
7417
|
+
id: import_zod32.z.uuid().meta({
|
|
7363
7418
|
description: "The stored message. It exists whatever `mail` says."
|
|
7364
7419
|
}),
|
|
7365
7420
|
mail: mailStatus.meta({
|
|
@@ -7367,91 +7422,91 @@ var feedbackResponse = import_zod31.z.object({
|
|
|
7367
7422
|
})
|
|
7368
7423
|
}).strict();
|
|
7369
7424
|
|
|
7370
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
7371
|
-
var
|
|
7372
|
-
var supportSessionInfo =
|
|
7373
|
-
session_id:
|
|
7425
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/support.js
|
|
7426
|
+
var import_zod33 = require("zod");
|
|
7427
|
+
var supportSessionInfo = import_zod33.z.object({
|
|
7428
|
+
session_id: import_zod33.z.uuid().meta({
|
|
7374
7429
|
description: "The support session this token or response describes. Stable for the life of the session."
|
|
7375
7430
|
}),
|
|
7376
|
-
mode:
|
|
7431
|
+
mode: import_zod33.z.enum(["read", "edit"]).meta({
|
|
7377
7432
|
description: "The session's current mode. Every support session starts `read`; an operator-admin switches one session into `edit`, never the other way, and the switch is a one-way door for the life of the session."
|
|
7378
7433
|
}),
|
|
7379
|
-
operator_name:
|
|
7434
|
+
operator_name: import_zod33.z.string().min(1).max(200).meta({
|
|
7380
7435
|
description: "The name of the operator-admin holding this session, for the console banner the operator-admin sees. Only the operator-admin's own console receives it; the customer's audit names every edit as Fleetless-Support, never this name."
|
|
7381
7436
|
}),
|
|
7382
|
-
expires_at:
|
|
7437
|
+
expires_at: import_zod33.z.iso.datetime().meta({
|
|
7383
7438
|
description: "When the session stops being usable regardless of activity, as an ISO 8601 timestamp. A support session has a hard ceiling; nothing extends it past this instant."
|
|
7384
7439
|
})
|
|
7385
7440
|
}).strict();
|
|
7386
|
-
var supportTokenRequest =
|
|
7387
|
-
grant:
|
|
7441
|
+
var supportTokenRequest = import_zod33.z.object({
|
|
7442
|
+
grant: import_zod33.z.string().regex(/^[A-Za-z0-9_-]{43}$/).meta({
|
|
7388
7443
|
description: "The one-time grant minted when the support session was started: 32 random bytes, base64url, no padding. Consumed atomically by this exchange \u2014 presenting it again answers the same refusal a forged one would."
|
|
7389
7444
|
}),
|
|
7390
|
-
code_verifier:
|
|
7445
|
+
code_verifier: import_zod33.z.string().regex(/^[A-Za-z0-9._~-]{43,128}$/).meta({
|
|
7391
7446
|
description: "The PKCE verifier whose `S256` hash was sent as the grant's challenge when the session was started. Between 43 and 128 unreserved characters, RFC 7636 \xA74.1's charset \u2014 the same shape `oauthCodeTokenRequest.code_verifier` checks, compared rather than parsed."
|
|
7392
7447
|
})
|
|
7393
7448
|
}).strict();
|
|
7394
|
-
var supportTokenResponse =
|
|
7395
|
-
access_token:
|
|
7449
|
+
var supportTokenResponse = import_zod33.z.object({
|
|
7450
|
+
access_token: import_zod33.z.string().min(1).meta({
|
|
7396
7451
|
description: "The token to send as `Authorization: Bearer <token>`. Short-lived: read `expires_in`, never assume a lifetime."
|
|
7397
7452
|
}),
|
|
7398
|
-
token_type:
|
|
7453
|
+
token_type: import_zod33.z.literal("Bearer").meta({
|
|
7399
7454
|
description: "`Bearer`, the same spelling every other session token on this wire uses."
|
|
7400
7455
|
}),
|
|
7401
|
-
expires_in:
|
|
7456
|
+
expires_in: import_zod33.z.number().int().min(1).max(3600).meta({
|
|
7402
7457
|
description: "How long the access token stays valid, in seconds from now \u2014 at most 3600 (sixty minutes), the hard ceiling of any support session. Not a timestamp, and not milliseconds."
|
|
7403
7458
|
}),
|
|
7404
|
-
org_id:
|
|
7459
|
+
org_id: import_zod33.z.uuid().meta({
|
|
7405
7460
|
description: "The organisation this session was scoped to when the grant was minted."
|
|
7406
7461
|
}),
|
|
7407
7462
|
support: supportSessionInfo.meta({
|
|
7408
7463
|
description: "The session as it stands at the moment of exchange: freshly started, in `read` mode."
|
|
7409
7464
|
})
|
|
7410
7465
|
}).strict();
|
|
7411
|
-
var supportRenewFailRequest =
|
|
7412
|
-
flow_id:
|
|
7413
|
-
code_verifier:
|
|
7466
|
+
var supportRenewFailRequest = import_zod33.z.object({
|
|
7467
|
+
flow_id: import_zod33.z.uuid().meta({ description: "The pending Cloud renewal flow created with the original support bearer." }),
|
|
7468
|
+
code_verifier: import_zod33.z.string().regex(/^[A-Za-z0-9._~-]{43,128}$/).meta({
|
|
7414
7469
|
description: "The server-held RFC 7636 verifier matching the flow's S256 challenge; never sent to the browser."
|
|
7415
7470
|
}),
|
|
7416
|
-
reason:
|
|
7471
|
+
reason: import_zod33.z.literal("authority_failed").meta({ description: "A fixed category; browser and IdP error text is not forwarded." })
|
|
7417
7472
|
}).strict();
|
|
7418
|
-
var supportRenewFailRefusal =
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
|
|
7473
|
+
var supportRenewFailRefusal = import_zod33.z.union([
|
|
7474
|
+
import_zod33.z.object({ code: import_zod33.z.literal("validation_error"), message: import_zod33.z.string().min(1), details: import_zod33.z.object({ rule: import_zod33.z.literal("invalid_flow") }).strict() }).strict(),
|
|
7475
|
+
import_zod33.z.object({ code: import_zod33.z.literal("unauthorized"), message: import_zod33.z.string().min(1), details: import_zod33.z.object({ rule: import_zod33.z.literal("invalid_authority") }).strict() }).strict(),
|
|
7476
|
+
import_zod33.z.object({ code: import_zod33.z.literal("not_found"), message: import_zod33.z.string().min(1), details: import_zod33.z.object({ rule: import_zod33.z.enum(["invalid_flow", "identity_mismatch"]) }).strict() }).strict(),
|
|
7477
|
+
import_zod33.z.object({ code: import_zod33.z.literal("target_state_conflict"), message: import_zod33.z.string().min(1), details: import_zod33.z.object({ rule: import_zod33.z.enum(["expired", "replayed", "session_inactive", "stale_generation"]) }).strict() }).strict()
|
|
7423
7478
|
]);
|
|
7424
7479
|
var authMeSupportResponse = authMeResponse.extend({ support: supportSessionInfo.optional() });
|
|
7425
7480
|
|
|
7426
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
7427
|
-
var
|
|
7428
|
-
var clientRobotListItem =
|
|
7481
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/client-robots.js
|
|
7482
|
+
var import_zod34 = require("zod");
|
|
7483
|
+
var clientRobotListItem = import_zod34.z.object({
|
|
7429
7484
|
...robot2.shape,
|
|
7430
7485
|
bridge_state: bridgeState.meta({
|
|
7431
7486
|
description: "The built-in `bridge_state` datapoint as the cloud observes it right now: whether the bridge is connected, and its latency when it is."
|
|
7432
7487
|
}),
|
|
7433
|
-
published_version:
|
|
7488
|
+
published_version: import_zod34.z.number().int().positive().nullable().meta({
|
|
7434
7489
|
description: 'The published configuration version, or `null` when nothing has been published yet. A robot with nothing published is still listed \u2014 "not configured yet" is a real state, and the caller is entitled to it \u2014 and its datasheet answers an empty exposure list.'
|
|
7435
7490
|
})
|
|
7436
7491
|
});
|
|
7437
|
-
var clientRobotListResponse =
|
|
7438
|
-
robots:
|
|
7492
|
+
var clientRobotListResponse = import_zod34.z.object({
|
|
7493
|
+
robots: import_zod34.z.array(clientRobotListItem).meta({
|
|
7439
7494
|
description: "Every robot the caller reaches, in name order with the id as the tiebreak. An app user reaches the robots their app attaches on which their role grants at least one slug or capability; a server key reaches every robot its app attaches; a developer reaches every robot of the organisation."
|
|
7440
7495
|
})
|
|
7441
7496
|
});
|
|
7442
7497
|
|
|
7443
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
7444
|
-
var
|
|
7445
|
-
var legalAcceptanceCursor =
|
|
7446
|
-
var legalAcceptanceListQuery =
|
|
7447
|
-
limit:
|
|
7498
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/legal-acceptances.js
|
|
7499
|
+
var import_zod35 = require("zod");
|
|
7500
|
+
var legalAcceptanceCursor = import_zod35.z.string().min(1).max(512).regex(/^[A-Za-z0-9_-]+$/);
|
|
7501
|
+
var legalAcceptanceListQuery = import_zod35.z.object({
|
|
7502
|
+
limit: import_zod35.z.union([import_zod35.z.string().regex(/^(?:0{0,2}[1-9]|0?[1-9][0-9]|100)$/), import_zod35.z.number().int().min(1).max(100)]).transform(Number).pipe(import_zod35.z.number().int().min(1).max(100)).optional(),
|
|
7448
7503
|
cursor: legalAcceptanceCursor.optional()
|
|
7449
7504
|
}).strict();
|
|
7450
|
-
var legalAcceptanceVersionRow =
|
|
7451
|
-
id:
|
|
7452
|
-
context:
|
|
7453
|
-
accepted_at:
|
|
7454
|
-
text_id:
|
|
7505
|
+
var legalAcceptanceVersionRow = import_zod35.z.object({
|
|
7506
|
+
id: import_zod35.z.uuid(),
|
|
7507
|
+
context: import_zod35.z.enum(["registration", "invitation", "order", "existing_org", "amendment", "price_offer"]),
|
|
7508
|
+
accepted_at: import_zod35.z.iso.datetime({ precision: 6 }),
|
|
7509
|
+
text_id: import_zod35.z.string().min(1).max(80).regex(/\S/),
|
|
7455
7510
|
terms: legalDocumentReference,
|
|
7456
7511
|
dpa: legalDocumentReference.nullable()
|
|
7457
7512
|
}).strict().superRefine((value, ctx) => {
|
|
@@ -7462,22 +7517,22 @@ var legalAcceptanceVersionRow = import_zod34.z.object({
|
|
|
7462
7517
|
if: { properties: { context: { enum: ["amendment", "price_offer"] } }, required: ["context"] },
|
|
7463
7518
|
then: { properties: { dpa: { type: "null" } }, required: ["dpa"] }
|
|
7464
7519
|
}] });
|
|
7465
|
-
var legalAcceptanceListResponse =
|
|
7466
|
-
acceptances:
|
|
7520
|
+
var legalAcceptanceListResponse = import_zod35.z.object({
|
|
7521
|
+
acceptances: import_zod35.z.array(legalAcceptanceVersionRow),
|
|
7467
7522
|
next_cursor: legalAcceptanceCursor.nullable()
|
|
7468
7523
|
}).strict();
|
|
7469
7524
|
|
|
7470
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
7471
|
-
var
|
|
7472
|
-
var auditActor =
|
|
7473
|
-
kind:
|
|
7474
|
-
id:
|
|
7475
|
-
label:
|
|
7476
|
-
});
|
|
7477
|
-
var auditEvent =
|
|
7478
|
-
id:
|
|
7479
|
-
org_id:
|
|
7480
|
-
at:
|
|
7525
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/audit.js
|
|
7526
|
+
var import_zod36 = require("zod");
|
|
7527
|
+
var auditActor = import_zod36.z.object({
|
|
7528
|
+
kind: import_zod36.z.enum(["developer", "end_user", "app_user", "server_key", "bridge", "fleetless"]),
|
|
7529
|
+
id: import_zod36.z.uuid(),
|
|
7530
|
+
label: import_zod36.z.string().min(1).max(200)
|
|
7531
|
+
});
|
|
7532
|
+
var auditEvent = import_zod36.z.object({
|
|
7533
|
+
id: import_zod36.z.uuid(),
|
|
7534
|
+
org_id: import_zod36.z.uuid(),
|
|
7535
|
+
at: import_zod36.z.iso.datetime(),
|
|
7481
7536
|
/**
|
|
7482
7537
|
* A monotonic counter, ascending in write order, unique across the log.
|
|
7483
7538
|
*
|
|
@@ -7496,18 +7551,18 @@ var auditEvent = import_zod35.z.object({
|
|
|
7496
7551
|
* Required, not optional: an event without a sequence cannot be ordered
|
|
7497
7552
|
* against one that has it, and a log with two orderings has none.
|
|
7498
7553
|
*/
|
|
7499
|
-
seq:
|
|
7554
|
+
seq: import_zod36.z.number().int().positive(),
|
|
7500
7555
|
actor: auditActor,
|
|
7501
7556
|
/** Stable dotted name, e.g. `app_user.login`, `config.published`. */
|
|
7502
|
-
action:
|
|
7557
|
+
action: import_zod36.z.string().min(1).max(80),
|
|
7503
7558
|
/**
|
|
7504
7559
|
* What the action was about, if anything — a robot, an app, a user. Free
|
|
7505
7560
|
* of ids the console cannot resolve: carry the label with it.
|
|
7506
7561
|
*/
|
|
7507
|
-
target:
|
|
7508
|
-
kind:
|
|
7509
|
-
id:
|
|
7510
|
-
label:
|
|
7562
|
+
target: import_zod36.z.object({
|
|
7563
|
+
kind: import_zod36.z.string().min(1).max(40),
|
|
7564
|
+
id: import_zod36.z.string().min(1),
|
|
7565
|
+
label: import_zod36.z.string().min(1).max(200)
|
|
7511
7566
|
}).nullable(),
|
|
7512
7567
|
/**
|
|
7513
7568
|
* Action-specific extras.
|
|
@@ -7521,10 +7576,10 @@ var auditEvent = import_zod35.z.object({
|
|
|
7521
7576
|
* So: never credentials, never tokens. That is a rule, not a guarantee the
|
|
7522
7577
|
* schema enforces.
|
|
7523
7578
|
*/
|
|
7524
|
-
details:
|
|
7579
|
+
details: import_zod36.z.record(import_zod36.z.string(), import_zod36.z.unknown()).nullable()
|
|
7525
7580
|
});
|
|
7526
7581
|
var auditTimestampMs = wireTimestampMs;
|
|
7527
|
-
var auditQuery =
|
|
7582
|
+
var auditQuery = import_zod36.z.object({
|
|
7528
7583
|
/** Only events with a smaller `seq` — the next, older page. */
|
|
7529
7584
|
before_seq: wireSeqCursor.optional(),
|
|
7530
7585
|
/**
|
|
@@ -7533,9 +7588,9 @@ var auditQuery = import_zod35.z.object({
|
|
|
7533
7588
|
* coercion's result in either `io` direction, so the artifact would describe
|
|
7534
7589
|
* a shape a query string can never carry.
|
|
7535
7590
|
*/
|
|
7536
|
-
limit:
|
|
7591
|
+
limit: import_zod36.z.union([import_zod36.z.string().regex(/^\d{1,4}$/), import_zod36.z.number().int()]).transform((v) => Number(v)).pipe(import_zod36.z.number().int().positive().max(500)).optional(),
|
|
7537
7592
|
/** Exact action name, e.g. `config.published`. No prefix matching: a filter that matches more than it says is not one. */
|
|
7538
|
-
action:
|
|
7593
|
+
action: import_zod36.z.string().min(1).max(80).optional(),
|
|
7539
7594
|
/**
|
|
7540
7595
|
* Everything under a dotted prefix, e.g. `server_key.` for all three
|
|
7541
7596
|
* server-key actions.
|
|
@@ -7552,7 +7607,7 @@ var auditQuery = import_zod35.z.object({
|
|
|
7552
7607
|
* happily. The cloud is the only enforcement point — the same residual
|
|
7553
7608
|
* `orgLatencyQuery` and `orgUsageQuery` already name.
|
|
7554
7609
|
*/
|
|
7555
|
-
action_prefix:
|
|
7610
|
+
action_prefix: import_zod36.z.string().min(1).max(80).optional(),
|
|
7556
7611
|
/**
|
|
7557
7612
|
* Only events by this actor.
|
|
7558
7613
|
*
|
|
@@ -7564,9 +7619,9 @@ var auditQuery = import_zod35.z.object({
|
|
|
7564
7619
|
* Not an injection question — the query is parameterised either way. It is a
|
|
7565
7620
|
* **500 where a 400 belongs**, and a 500 is the answer that explains nothing.
|
|
7566
7621
|
*/
|
|
7567
|
-
actor_id:
|
|
7622
|
+
actor_id: import_zod36.z.uuid().optional(),
|
|
7568
7623
|
/** Only events about this kind of target, e.g. `robot`. */
|
|
7569
|
-
target_kind:
|
|
7624
|
+
target_kind: import_zod36.z.string().min(1).max(40).optional(),
|
|
7570
7625
|
/**
|
|
7571
7626
|
* Only events about this target — and, for a robot, also the events that
|
|
7572
7627
|
* name it in `details.robot_id`, so a robot's log includes what was
|
|
@@ -7576,7 +7631,7 @@ var auditQuery = import_zod35.z.object({
|
|
|
7576
7631
|
* string in this contract and text in the cloud's table, so a uuid rule
|
|
7577
7632
|
* here would refuse ids the log can hold, and no value can fail a cast.
|
|
7578
7633
|
*/
|
|
7579
|
-
target_id:
|
|
7634
|
+
target_id: import_zod36.z.string().min(1).max(200).optional().meta({
|
|
7580
7635
|
description: "Events whose target is this id; for a robot also the events that name it in `details.robot_id` (`action.invoked`, `service.called`, \u2026), so a robot's events include what was started on it."
|
|
7581
7636
|
}),
|
|
7582
7637
|
/**
|
|
@@ -7594,8 +7649,8 @@ var auditQuery = import_zod35.z.object({
|
|
|
7594
7649
|
message: "action and action_prefix cannot be combined",
|
|
7595
7650
|
path: ["action_prefix"]
|
|
7596
7651
|
});
|
|
7597
|
-
var auditListResponse =
|
|
7598
|
-
events:
|
|
7652
|
+
var auditListResponse = import_zod36.z.object({
|
|
7653
|
+
events: import_zod36.z.array(auditEvent),
|
|
7599
7654
|
/**
|
|
7600
7655
|
* The `seq` a caller sends as `before_seq` to keep reading — or `null` when
|
|
7601
7656
|
* there is nothing further.
|
|
@@ -7606,41 +7661,41 @@ var auditListResponse = import_zod35.z.object({
|
|
|
7606
7661
|
* not mean *no more* here. The same distinction `historySamples` was given
|
|
7607
7662
|
* `truncated` for.
|
|
7608
7663
|
*/
|
|
7609
|
-
next_cursor:
|
|
7664
|
+
next_cursor: import_zod36.z.number().int().positive().nullable()
|
|
7610
7665
|
});
|
|
7611
7666
|
|
|
7612
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
7613
|
-
var
|
|
7614
|
-
var apiError =
|
|
7615
|
-
code:
|
|
7616
|
-
message:
|
|
7617
|
-
details:
|
|
7667
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/errors.js
|
|
7668
|
+
var import_zod37 = require("zod");
|
|
7669
|
+
var apiError = import_zod37.z.object({
|
|
7670
|
+
code: import_zod37.z.string().min(1),
|
|
7671
|
+
message: import_zod37.z.string().min(1),
|
|
7672
|
+
details: import_zod37.z.unknown().optional()
|
|
7618
7673
|
});
|
|
7619
|
-
var parameterViolation =
|
|
7620
|
-
field:
|
|
7674
|
+
var parameterViolation = import_zod37.z.object({
|
|
7675
|
+
field: import_zod37.z.string().min(1),
|
|
7621
7676
|
/** Which rule failed — `min`, `max`, `enum`, `pattern`, `required`, `undeclared`. */
|
|
7622
|
-
rule:
|
|
7623
|
-
message:
|
|
7677
|
+
rule: import_zod37.z.string().min(1),
|
|
7678
|
+
message: import_zod37.z.string().min(1)
|
|
7624
7679
|
});
|
|
7625
|
-
var parameterInvalidDetails =
|
|
7626
|
-
violations:
|
|
7680
|
+
var parameterInvalidDetails = import_zod37.z.object({
|
|
7681
|
+
violations: import_zod37.z.array(parameterViolation).min(1)
|
|
7627
7682
|
});
|
|
7628
|
-
var cancelRejectedDetails =
|
|
7629
|
-
goals:
|
|
7683
|
+
var cancelRejectedDetails = import_zod37.z.object({
|
|
7684
|
+
goals: import_zod37.z.array(bridgeCancelResultEntry).min(1)
|
|
7630
7685
|
});
|
|
7631
|
-
var invalidCodeDetails =
|
|
7632
|
-
attempts_left:
|
|
7686
|
+
var invalidCodeDetails = import_zod37.z.object({
|
|
7687
|
+
attempts_left: import_zod37.z.number().int().min(0).meta({
|
|
7633
7688
|
description: "How many more wrong codes this code or challenge takes before it is spent. `0` means the next attempt answers `410 token_spent`."
|
|
7634
7689
|
})
|
|
7635
7690
|
});
|
|
7636
|
-
var planLimitDetails =
|
|
7691
|
+
var planLimitDetails = import_zod37.z.object({
|
|
7637
7692
|
limit: planLimitKey.exclude(["history_days", "audit_days"]).meta({ description: "The limit the action would exceed." }),
|
|
7638
|
-
used:
|
|
7639
|
-
max:
|
|
7693
|
+
used: import_zod37.z.number().int().nonnegative().meta({ description: "How much of the limit the org uses now." }),
|
|
7694
|
+
max: import_zod37.z.number().int().nonnegative().meta({
|
|
7640
7695
|
description: "The limit. For `asset_bytes_per_robot`, the org's whole pool: robots \xD7 the plan's bytes per robot."
|
|
7641
7696
|
}),
|
|
7642
7697
|
plan: planId.meta({ description: "The plan whose limit refused: the target plan while a move to a lower plan is pending." }),
|
|
7643
|
-
lifted_by:
|
|
7698
|
+
lifted_by: import_zod37.z.object({
|
|
7644
7699
|
plan: planId.nullable().meta({ description: "The cheapest higher plan that raises this limit, or `null` when none does." }),
|
|
7645
7700
|
addon: addonKey.nullable().meta({
|
|
7646
7701
|
description: "The add-on that raises this limit, when the org's plan can buy add-ons; otherwise `null`."
|
|
@@ -7656,59 +7711,59 @@ var assetPlanLimitDetails = planLimitDetails.extend({
|
|
|
7656
7711
|
description: "Bytes the org's assets occupy, across every robot, before this upload."
|
|
7657
7712
|
})
|
|
7658
7713
|
});
|
|
7659
|
-
var planRequiredDetails =
|
|
7714
|
+
var planRequiredDetails = import_zod37.z.object({
|
|
7660
7715
|
feature: planFeature.meta({ description: "The feature the action needs." }),
|
|
7661
7716
|
plan: planId.meta({ description: "The org's current plan." }),
|
|
7662
7717
|
required_plan: planId.meta({ description: "The cheapest plan that has the feature." })
|
|
7663
7718
|
});
|
|
7664
|
-
var orgLockedDetails =
|
|
7665
|
-
reason:
|
|
7719
|
+
var orgLockedDetails = import_zod37.z.object({
|
|
7720
|
+
reason: import_zod37.z.enum(["payment", "migration"]).meta({
|
|
7666
7721
|
description: "`payment`: a payment is missing. `migration`: the org did not choose what stays when the beta ended."
|
|
7667
7722
|
})
|
|
7668
7723
|
});
|
|
7669
|
-
var paymentProviderUnavailableDetails =
|
|
7670
|
-
provider:
|
|
7671
|
-
status:
|
|
7724
|
+
var paymentProviderUnavailableDetails = import_zod37.z.object({
|
|
7725
|
+
provider: import_zod37.z.literal("mollie").meta({ description: "The payment provider. Always `mollie` today." }),
|
|
7726
|
+
status: import_zod37.z.number().int().nullable().meta({ description: "Mollie's own HTTP status, or `null` when the request timed out instead of answering." })
|
|
7672
7727
|
});
|
|
7673
|
-
var billingDocumentsUnavailableDetails =
|
|
7674
|
-
reason:
|
|
7728
|
+
var billingDocumentsUnavailableDetails = import_zod37.z.object({
|
|
7729
|
+
reason: import_zod37.z.enum(["provider_unavailable", "rate_limited", "list_limit_exceeded", "list_changed", "unsupported_document", "profile_mismatch"]).meta({
|
|
7675
7730
|
description: "Why Cloud refused rather than answering with a partial or unchecked document: `provider_unavailable` (Lexware did not answer or answered with an error), `rate_limited` (Lexware throttled the request; nothing was read), `list_limit_exceeded` (Lexware reports more than 10,000 documents for the org), `list_changed` (the document list changed while it was being paged, so no consistent list exists), `unsupported_document` (the detail or the file only: Lexware answered with an e-invoice profile or a file this cloud cannot present as the document), `profile_mismatch` (the Lexware account this cloud is configured with failed its account check, so every Lexware read stays closed)."
|
|
7676
7731
|
})
|
|
7677
7732
|
}).strict();
|
|
7678
|
-
var confirmationRequiredDetails =
|
|
7679
|
-
preview:
|
|
7733
|
+
var confirmationRequiredDetails = import_zod37.z.object({
|
|
7734
|
+
preview: import_zod37.z.unknown().meta({
|
|
7680
7735
|
description: "The current preview of the operation, with its `token`: a `collectionsSchemaPreview` for a publish, a `collectionsRestorePreview` for a restore, a `collectionsPurgePreview` for a purge and a `collectionImportPreview` for an import. Confirm it by sending that `token` as `confirm`. A publish that names a `source_sha256` which is not the saved draft's, because the draft was saved again since it was previewed, is refused the same way with a preview whose `token` can be `null` (no effects, nothing to confirm): read this preview, then publish again with its `source_sha256`, and with its `token` as `confirm` when it has one."
|
|
7681
7736
|
})
|
|
7682
7737
|
}).strict();
|
|
7683
|
-
var recordReferencedDetails =
|
|
7684
|
-
references:
|
|
7685
|
-
collection:
|
|
7686
|
-
count:
|
|
7738
|
+
var recordReferencedDetails = import_zod37.z.object({
|
|
7739
|
+
references: import_zod37.z.array(import_zod37.z.object({
|
|
7740
|
+
collection: import_zod37.z.string().min(1).meta({ description: "The key of a collection that has records pointing at this one." }),
|
|
7741
|
+
count: import_zod37.z.number().int().min(1).meta({ description: "How many records of that collection point at it." })
|
|
7687
7742
|
}).strict()).meta({
|
|
7688
7743
|
description: "The collections whose records reference the record, each with how many. Only collections the caller may read are named, so the list is empty when the records that point here are all in collections the caller cannot read; the refusal still stands."
|
|
7689
7744
|
})
|
|
7690
7745
|
}).strict();
|
|
7691
|
-
var recordChangedDetails =
|
|
7692
|
-
revision:
|
|
7746
|
+
var recordChangedDetails = import_zod37.z.object({
|
|
7747
|
+
revision: import_zod37.z.number().int().min(1).meta({ description: "The current revision of the record, which is not the `expected_revision` that was sent." })
|
|
7693
7748
|
}).strict();
|
|
7694
|
-
var referenceInvalidDetails =
|
|
7695
|
-
field:
|
|
7696
|
-
reason:
|
|
7749
|
+
var referenceInvalidDetails = import_zod37.z.object({
|
|
7750
|
+
field: import_zod37.z.string().min(1).meta({ description: "The key of the reference field." }),
|
|
7751
|
+
reason: import_zod37.z.enum(["missing", "other_robot", "not_readable"]).meta({
|
|
7697
7752
|
description: "`missing`: no record of the target collection has that id. `other_robot`: the target belongs to another robot than the record that points at it. `not_readable`: the caller may not read the target collection."
|
|
7698
7753
|
})
|
|
7699
7754
|
}).strict();
|
|
7700
|
-
var requiredMissingDetails =
|
|
7701
|
-
fields:
|
|
7755
|
+
var requiredMissingDetails = import_zod37.z.object({
|
|
7756
|
+
fields: import_zod37.z.array(import_zod37.z.string().min(1)).min(1).meta({ description: "The keys of the required fields that have no value." })
|
|
7702
7757
|
}).strict();
|
|
7703
|
-
var roleCycleDetails =
|
|
7704
|
-
cycle:
|
|
7758
|
+
var roleCycleDetails = import_zod37.z.object({
|
|
7759
|
+
cycle: import_zod37.z.array(import_zod37.z.string()).min(2).meta({
|
|
7705
7760
|
description: 'The keys along the loop, in order, ending with the key the loop started from: `["a", "b", "a"]`.'
|
|
7706
7761
|
})
|
|
7707
7762
|
});
|
|
7708
7763
|
|
|
7709
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
7710
|
-
var
|
|
7711
|
-
var oauthErrorCode =
|
|
7764
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/oauth.js
|
|
7765
|
+
var import_zod38 = require("zod");
|
|
7766
|
+
var oauthErrorCode = import_zod38.z.enum([
|
|
7712
7767
|
"invalid_request",
|
|
7713
7768
|
"invalid_client",
|
|
7714
7769
|
"invalid_grant",
|
|
@@ -7721,11 +7776,11 @@ var oauthErrorCode = import_zod37.z.enum([
|
|
|
7721
7776
|
/** RFC 8707: the `resource` named is not one this server issues tokens for. */
|
|
7722
7777
|
"invalid_target"
|
|
7723
7778
|
]);
|
|
7724
|
-
var oauthError =
|
|
7779
|
+
var oauthError = import_zod38.z.object({
|
|
7725
7780
|
error: oauthErrorCode,
|
|
7726
|
-
error_description:
|
|
7781
|
+
error_description: import_zod38.z.string().min(1).max(500).optional(),
|
|
7727
7782
|
/** Echoed back per RFC 6749 §4.1.2.1 so a client can match the response. */
|
|
7728
|
-
state:
|
|
7783
|
+
state: import_zod38.z.string().min(1).max(500).optional(),
|
|
7729
7784
|
/**
|
|
7730
7785
|
* **A Fleetless reason carried inside a standard envelope, and it exists
|
|
7731
7786
|
* because the alternative lost a distinction.**
|
|
@@ -7743,9 +7798,9 @@ var oauthError = import_zod37.z.object({
|
|
|
7743
7798
|
* our own tooling switches on. RFC 6749 §5.2 permits additional members, and
|
|
7744
7799
|
* a client that ignores this one still behaves correctly.
|
|
7745
7800
|
*/
|
|
7746
|
-
fleetless_code:
|
|
7801
|
+
fleetless_code: import_zod38.z.string().min(1).max(60).optional()
|
|
7747
7802
|
});
|
|
7748
|
-
var redirectUri =
|
|
7803
|
+
var redirectUri = import_zod38.z.string().min(1).max(2e3).refine((v) => {
|
|
7749
7804
|
let url;
|
|
7750
7805
|
try {
|
|
7751
7806
|
url = new URL(v);
|
|
@@ -7760,183 +7815,183 @@ var redirectUri = import_zod37.z.string().min(1).max(2e3).refine((v) => {
|
|
|
7760
7815
|
return ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname);
|
|
7761
7816
|
return false;
|
|
7762
7817
|
}, { message: "redirect_uri must be an https URL, or http on an explicit loopback address, and carry no fragment" });
|
|
7763
|
-
var codeChallengeMethod =
|
|
7818
|
+
var codeChallengeMethod = import_zod38.z.enum(["S256"]);
|
|
7764
7819
|
var MCP_DCR_MAX_REDIRECT_URIS = 5;
|
|
7765
|
-
var dynamicClientRegistrationRequest =
|
|
7766
|
-
redirect_uris:
|
|
7820
|
+
var dynamicClientRegistrationRequest = import_zod38.z.object({
|
|
7821
|
+
redirect_uris: import_zod38.z.array(redirectUri).min(1).max(MCP_DCR_MAX_REDIRECT_URIS).meta({
|
|
7767
7822
|
description: `Where the authorization code may be returned, and the one field a registration cannot omit. Each must be an \`https\` URL, or \`http\` on an explicit loopback address for a native app that cannot hold a certificate, and none may carry a fragment. Between \`1\` and \`${MCP_DCR_MAX_REDIRECT_URIS}\` of them; duplicates are collapsed rather than counted twice. Matched **exactly** at the authorize step against what was registered here.`
|
|
7768
7823
|
}),
|
|
7769
|
-
client_name:
|
|
7824
|
+
client_name: import_zod38.z.string().min(1).max(200).optional().meta({
|
|
7770
7825
|
description: 'The name the client calls itself. Optional: RFC 7591 makes every metadata field optional, so a registration without one is recorded under a default name. It is **not** vouched for by Fleetless and must never be rendered as if it were: a self-registered client chooses this string, and one has called itself *"Fleetless Official Helper"*.'
|
|
7771
7826
|
}),
|
|
7772
|
-
token_endpoint_auth_method:
|
|
7827
|
+
token_endpoint_auth_method: import_zod38.z.enum(["none"]).optional().meta({
|
|
7773
7828
|
description: "`none`, RFC 7591's value for a public client, and the only value either server registers. Any other value is **refused rather than silently downgraded**: a client that believes it holds a secret and does not has a wrong mental model of its own security. There is no client secret to hold \u2014 mandatory PKCE (`S256`) is the defence."
|
|
7774
7829
|
}),
|
|
7775
|
-
grant_types:
|
|
7830
|
+
grant_types: import_zod38.z.array(import_zod38.z.enum(["authorization_code", "refresh_token"])).optional().meta({
|
|
7776
7831
|
description: "Accepted for conformance with RFC 7591 and then **ignored**: both MCP authorization servers grant `authorization_code` and `refresh_token` to every registration, and the answer states what was granted (\xA73.2.1) rather than what was asked."
|
|
7777
7832
|
}),
|
|
7778
|
-
response_types:
|
|
7833
|
+
response_types: import_zod38.z.array(import_zod38.z.enum(["code"])).optional().meta({
|
|
7779
7834
|
description: "Accepted for conformance and then **ignored**; the response names `code`, which is the only response type OAuth 2.1 leaves, the implicit grant having been removed."
|
|
7780
7835
|
}),
|
|
7781
|
-
scope:
|
|
7836
|
+
scope: import_zod38.z.string().max(500).optional().meta({
|
|
7782
7837
|
description: "Accepted for conformance and then **ignored**. This authorization server issues no scopes at all, which is why the registration answer carries no `scope` field to echo one back in."
|
|
7783
7838
|
})
|
|
7784
7839
|
}).meta({
|
|
7785
7840
|
description: "What an MCP client sends to register itself, per RFC 7591. Unknown metadata is ignored rather than refused (\xA73.1), and the answer states what was actually granted rather than what was asked for (\xA73.2.1)."
|
|
7786
7841
|
});
|
|
7787
|
-
var dynamicClientRegistrationResponse =
|
|
7788
|
-
client_id:
|
|
7842
|
+
var dynamicClientRegistrationResponse = import_zod38.z.object({
|
|
7843
|
+
client_id: import_zod38.z.string().min(1).max(200).meta({
|
|
7789
7844
|
description: "The identifier this client sends at the authorize and token endpoints. Opaque, and not the app identifier."
|
|
7790
7845
|
}),
|
|
7791
|
-
client_name:
|
|
7846
|
+
client_name: import_zod38.z.string().min(1).max(200).meta({
|
|
7792
7847
|
description: "The name the client registered under, echoed back. Chosen by the client and not vouched for by Fleetless."
|
|
7793
7848
|
}),
|
|
7794
|
-
redirect_uris:
|
|
7849
|
+
redirect_uris: import_zod38.z.array(redirectUri).meta({
|
|
7795
7850
|
description: "The redirect URIs this registration was accepted for. A code is returned to one of these and nowhere else."
|
|
7796
7851
|
}),
|
|
7797
|
-
grant_types:
|
|
7852
|
+
grant_types: import_zod38.z.array(import_zod38.z.string()).meta({
|
|
7798
7853
|
description: 'The grants this client may use. Always exactly `["authorization_code", "refresh_token"]` \u2014 an exchange mints a refresh token and the token endpoint rotates it.'
|
|
7799
7854
|
}),
|
|
7800
|
-
response_types:
|
|
7855
|
+
response_types: import_zod38.z.array(import_zod38.z.string()).meta({
|
|
7801
7856
|
description: "The response types this client may ask for: `code`."
|
|
7802
7857
|
}),
|
|
7803
|
-
token_endpoint_auth_method:
|
|
7858
|
+
token_endpoint_auth_method: import_zod38.z.literal("none").meta({
|
|
7804
7859
|
description: "`none` \u2014 this server registers public clients only, and PKCE rather than a secret is what protects the exchange."
|
|
7805
7860
|
}),
|
|
7806
|
-
client_id_issued_at:
|
|
7861
|
+
client_id_issued_at: import_zod38.z.number().int().nonnegative().meta({
|
|
7807
7862
|
description: "When the registration was created, in seconds since the epoch, per RFC 7591."
|
|
7808
7863
|
}),
|
|
7809
|
-
client_secret_expires_at:
|
|
7864
|
+
client_secret_expires_at: import_zod38.z.literal(0).meta({
|
|
7810
7865
|
description: "Always `0`, which is RFC 7591's way of saying the client secret never expires \u2014 there is none. The **registration** itself does expire: a self-registered client that never completes a flow is an unauthenticated write somebody left behind."
|
|
7811
7866
|
})
|
|
7812
7867
|
});
|
|
7813
|
-
var oauthCodeTokenRequest =
|
|
7814
|
-
grant_type:
|
|
7868
|
+
var oauthCodeTokenRequest = import_zod38.z.object({
|
|
7869
|
+
grant_type: import_zod38.z.literal("authorization_code").meta({
|
|
7815
7870
|
description: "`authorization_code`: this request exchanges the code from the authorize redirect for an access token and a refresh token."
|
|
7816
7871
|
}),
|
|
7817
|
-
code:
|
|
7872
|
+
code: import_zod38.z.string().min(1).max(500).meta({
|
|
7818
7873
|
description: "The authorization code from the redirect. It may be exchanged once; a second presentation is `invalid_grant`, the same answer a fabricated code gets."
|
|
7819
7874
|
}),
|
|
7820
7875
|
redirect_uri: redirectUri.meta({
|
|
7821
7876
|
description: "The same redirect URI the authorize request used. It is compared, not merely recorded."
|
|
7822
7877
|
}),
|
|
7823
|
-
client_id:
|
|
7878
|
+
client_id: import_zod38.z.string().min(1).max(200).meta({
|
|
7824
7879
|
description: "The client making the exchange, as registered."
|
|
7825
7880
|
}),
|
|
7826
|
-
code_verifier:
|
|
7881
|
+
code_verifier: import_zod38.z.string().regex(/^[A-Za-z0-9\-._~]{43,128}$/, "code_verifier must be 43-128 unreserved characters (RFC 7636 \xA74.1)").meta({
|
|
7827
7882
|
description: "The PKCE verifier whose `S256` hash was sent as the challenge at the authorize step. Between `43` and `128` unreserved characters, per RFC 7636 \xA74.1 \u2014 it is compared rather than parsed, so a length nobody checks is a length an attacker chooses. PKCE is mandatory for every client under OAuth 2.1."
|
|
7828
7883
|
}),
|
|
7829
|
-
resource:
|
|
7884
|
+
resource: import_zod38.z.url().optional().meta({
|
|
7830
7885
|
description: "The resource the token is requested for, per RFC 8707. It must match the audience the code was authorized for, or the answer is `invalid_target`; omitted, the code's own audience stands. It becomes the token's `aud`, and a resource refuses a token whose audience names something else \u2014 which is what keeps a token minted for one app out of another app's endpoint."
|
|
7831
7886
|
})
|
|
7832
7887
|
}).meta({
|
|
7833
7888
|
description: "RFC 6749 \xA74.1.3's authorization-code exchange with PKCE, as either MCP authorization server reads it. Sent as `application/x-www-form-urlencoded`, per \xA74.1.3, though the server accepts a JSON body too."
|
|
7834
7889
|
});
|
|
7835
|
-
var oauthRefreshTokenRequest =
|
|
7836
|
-
grant_type:
|
|
7890
|
+
var oauthRefreshTokenRequest = import_zod38.z.object({
|
|
7891
|
+
grant_type: import_zod38.z.literal("refresh_token").meta({
|
|
7837
7892
|
description: "`refresh_token`: this request rotates a refresh token into a new access token and a new refresh token. The presented token is consumed; presenting it again revokes the whole session."
|
|
7838
7893
|
}),
|
|
7839
|
-
refresh_token:
|
|
7894
|
+
refresh_token: import_zod38.z.string().min(1).max(500).meta({
|
|
7840
7895
|
description: "The refresh token from the last token response. Bound to the client that received it and to one identity space: presented by another client, or at the other MCP server, it is `invalid_grant` and stays unconsumed."
|
|
7841
7896
|
}),
|
|
7842
|
-
client_id:
|
|
7897
|
+
client_id: import_zod38.z.string().min(1).max(200).meta({
|
|
7843
7898
|
description: "The client the refresh token was issued to, as registered. A refresh token is not transferable between clients."
|
|
7844
7899
|
}),
|
|
7845
|
-
resource:
|
|
7900
|
+
resource: import_zod38.z.url().optional().meta({
|
|
7846
7901
|
description: "The resource the new token is for, per RFC 8707. Optional; when named it must be the audience the session was issued for, or the answer is `invalid_target` and the refresh token is left untouched. The successor carries the same audience either way."
|
|
7847
7902
|
})
|
|
7848
7903
|
}).meta({
|
|
7849
7904
|
description: "RFC 6749 \xA76's refresh, as either MCP authorization server reads it. Every use rotates: the answer carries a new refresh token and the presented one is dead."
|
|
7850
7905
|
});
|
|
7851
|
-
var oauthTokenRequest =
|
|
7906
|
+
var oauthTokenRequest = import_zod38.z.discriminatedUnion("grant_type", [oauthCodeTokenRequest, oauthRefreshTokenRequest]).meta({
|
|
7852
7907
|
description: "What an MCP token endpoint accepts: the authorization-code exchange, or a refresh. Any other `grant_type` is `unsupported_grant_type`, refused before a lookup happens."
|
|
7853
7908
|
});
|
|
7854
|
-
var oauthTokenResponse =
|
|
7855
|
-
access_token:
|
|
7909
|
+
var oauthTokenResponse = import_zod38.z.object({
|
|
7910
|
+
access_token: import_zod38.z.string().min(1).meta({
|
|
7856
7911
|
description: "The bearer token. It is the same token the client login mints \u2014 only the envelope differs, because an RFC-compliant client parses this one and knows nothing about Fleetless."
|
|
7857
7912
|
}),
|
|
7858
|
-
token_type:
|
|
7913
|
+
token_type: import_zod38.z.literal("Bearer").meta({
|
|
7859
7914
|
description: "`Bearer`. RFC 6749 \xA75.1 makes the value case-insensitive for a client reading it; this is the spelling this server emits."
|
|
7860
7915
|
}),
|
|
7861
|
-
expires_in:
|
|
7916
|
+
expires_in: import_zod38.z.number().int().positive().meta({
|
|
7862
7917
|
description: "How long the access token is valid, in **seconds**, per RFC 6749 \xA75.1. Not a timestamp, and not milliseconds."
|
|
7863
7918
|
}),
|
|
7864
|
-
refresh_token:
|
|
7919
|
+
refresh_token: import_zod38.z.string().min(1).optional().meta({
|
|
7865
7920
|
description: "The refresh token. Both MCP token endpoints issue one on every exchange and every refresh; it rotates on every use, lives ninety days from its last use, and dies with the account's sessions \u2014 a block, a password change, a withdrawn consent. The console's own OAuth portal issues none."
|
|
7866
7921
|
}),
|
|
7867
|
-
scope:
|
|
7922
|
+
scope: import_zod38.z.string().max(500).optional().meta({
|
|
7868
7923
|
description: "The scopes the issued token actually carries, space-separated."
|
|
7869
7924
|
})
|
|
7870
7925
|
});
|
|
7871
|
-
var authorizationServerMetadata =
|
|
7872
|
-
issuer:
|
|
7926
|
+
var authorizationServerMetadata = import_zod38.z.object({
|
|
7927
|
+
issuer: import_zod38.z.url().meta({
|
|
7873
7928
|
description: "The issuer identifier of this authorization server, per RFC 8414 \xA72. It is what a client checks a token's `iss` against."
|
|
7874
7929
|
}),
|
|
7875
|
-
authorization_endpoint:
|
|
7930
|
+
authorization_endpoint: import_zod38.z.url().meta({
|
|
7876
7931
|
description: "Where a client sends the user to authorize."
|
|
7877
7932
|
}),
|
|
7878
|
-
token_endpoint:
|
|
7933
|
+
token_endpoint: import_zod38.z.url().meta({
|
|
7879
7934
|
description: "The URL where a client exchanges an authorization code, or a refresh token, for tokens."
|
|
7880
7935
|
}),
|
|
7881
|
-
registration_endpoint:
|
|
7936
|
+
registration_endpoint: import_zod38.z.url().optional().meta({
|
|
7882
7937
|
description: "The URL where a client may register itself, per RFC 7591. Absent when the app does not accept dynamic clients."
|
|
7883
7938
|
}),
|
|
7884
|
-
client_id_metadata_document_supported:
|
|
7939
|
+
client_id_metadata_document_supported: import_zod38.z.boolean().optional().meta({
|
|
7885
7940
|
description: "`true` when a client may use the HTTPS URL of its Client ID Metadata Document as `client_id` (draft-ietf-oauth-client-id-metadata-document) instead of registering. Both MCP authorization servers answer `true` and keep `registration_endpoint` beside it."
|
|
7886
7941
|
}),
|
|
7887
|
-
response_types_supported:
|
|
7942
|
+
response_types_supported: import_zod38.z.array(import_zod38.z.literal("code")).meta({
|
|
7888
7943
|
description: "The response types this server offers: `code` only, the implicit grant being gone with OAuth 2.1."
|
|
7889
7944
|
}),
|
|
7890
|
-
grant_types_supported:
|
|
7945
|
+
grant_types_supported: import_zod38.z.array(import_zod38.z.enum(["authorization_code", "refresh_token"])).meta({
|
|
7891
7946
|
description: "The grants this server offers: `authorization_code` and `refresh_token`. OAuth 2.1 removes the implicit and password grants, so neither appears here."
|
|
7892
7947
|
}),
|
|
7893
|
-
code_challenge_methods_supported:
|
|
7948
|
+
code_challenge_methods_supported: import_zod38.z.array(codeChallengeMethod).meta({
|
|
7894
7949
|
description: "The PKCE challenge methods accepted: `S256` only. `plain` is not offered \u2014 a challenge equal to its verifier defends against nothing, and offering it would make a downgrade negotiable."
|
|
7895
7950
|
}),
|
|
7896
|
-
token_endpoint_auth_methods_supported:
|
|
7951
|
+
token_endpoint_auth_methods_supported: import_zod38.z.array(import_zod38.z.literal("none")).meta({
|
|
7897
7952
|
description: "How a client authenticates at the token endpoint: `none`, the public-client method, with PKCE protecting the exchange."
|
|
7898
7953
|
}),
|
|
7899
|
-
scopes_supported:
|
|
7954
|
+
scopes_supported: import_zod38.z.array(import_zod38.z.string()).optional().meta({
|
|
7900
7955
|
description: "The scopes this server knows about, where it publishes a list."
|
|
7901
7956
|
})
|
|
7902
7957
|
});
|
|
7903
|
-
var protectedResourceMetadata =
|
|
7904
|
-
resource:
|
|
7958
|
+
var protectedResourceMetadata = import_zod38.z.object({
|
|
7959
|
+
resource: import_zod38.z.url().meta({
|
|
7905
7960
|
description: "The resource identifier this document describes, per RFC 9728. A token whose audience names something else is rejected here rather than merely noted."
|
|
7906
7961
|
}),
|
|
7907
|
-
authorization_servers:
|
|
7962
|
+
authorization_servers: import_zod38.z.array(import_zod38.z.url()).min(1).meta({
|
|
7908
7963
|
description: "The authorization servers that may issue tokens for this resource. There is always at least one."
|
|
7909
7964
|
}),
|
|
7910
|
-
bearer_methods_supported:
|
|
7965
|
+
bearer_methods_supported: import_zod38.z.array(import_zod38.z.literal("header")).meta({
|
|
7911
7966
|
description: "How a token may be presented: in the `Authorization` header only, never in a query parameter or a form field."
|
|
7912
7967
|
}),
|
|
7913
|
-
scopes_supported:
|
|
7968
|
+
scopes_supported: import_zod38.z.array(import_zod38.z.string()).optional().meta({
|
|
7914
7969
|
description: "The scopes this resource understands, where it publishes a list."
|
|
7915
7970
|
})
|
|
7916
7971
|
});
|
|
7917
|
-
var oauthRedirectResponse =
|
|
7918
|
-
redirect_to:
|
|
7972
|
+
var oauthRedirectResponse = import_zod38.z.object({
|
|
7973
|
+
redirect_to: import_zod38.z.string().min(1).max(2e3)
|
|
7919
7974
|
});
|
|
7920
|
-
var oauthAuthorizeQuery =
|
|
7921
|
-
response_type:
|
|
7975
|
+
var oauthAuthorizeQuery = import_zod38.z.object({
|
|
7976
|
+
response_type: import_zod38.z.literal("code").meta({
|
|
7922
7977
|
description: "Always `code`. RFC 6749 \xA74.1.2.1 names `unsupported_response_type` for any other value, but `oauthErrorCode` has no such member \u2014 this server issues no other grant from this endpoint \u2014 so an unsupported value comes back on the callback as `invalid_request`."
|
|
7923
7978
|
}),
|
|
7924
|
-
client_id:
|
|
7979
|
+
client_id: import_zod38.z.string().min(1).meta({
|
|
7925
7980
|
description: "The OAuth client, self-registered or the one well-known central client \u2014 **not** the app identifier. Unknown, expired-dynamic and mismatched clients all collapse into the same `400 invalid_client`, answered without a redirect."
|
|
7926
7981
|
}),
|
|
7927
|
-
redirect_uri:
|
|
7982
|
+
redirect_uri: import_zod38.z.string().min(1).meta({
|
|
7928
7983
|
description: "One of the client's registered redirect URIs, compared **exactly** \u2014 string equality against the registered list, never a prefix or a host match. Both the shape (`redirectUri`) and the registration are checked, and a failure of either is a `400 invalid_request` with no redirect."
|
|
7929
7984
|
}),
|
|
7930
|
-
code_challenge:
|
|
7985
|
+
code_challenge: import_zod38.z.string().min(1).meta({
|
|
7931
7986
|
description: "The PKCE challenge; the verifier is presented at the token endpoint. Only non-emptiness is checked here \u2014 length and alphabet are not \u2014 since the verifier is what has to match."
|
|
7932
7987
|
}),
|
|
7933
|
-
code_challenge_method:
|
|
7988
|
+
code_challenge_method: import_zod38.z.literal("S256").meta({
|
|
7934
7989
|
description: "Only `S256`. `plain` is refused: a challenge equal to its verifier defends against nothing."
|
|
7935
7990
|
}),
|
|
7936
|
-
state:
|
|
7991
|
+
state: import_zod38.z.string().optional().meta({
|
|
7937
7992
|
description: "Returned unchanged on the callback, and on the error redirect too, so a client can bind either answer to its own request."
|
|
7938
7993
|
}),
|
|
7939
|
-
resource:
|
|
7994
|
+
resource: import_zod38.z.string().optional().meta({
|
|
7940
7995
|
description: "RFC 8707 resource indicator: the API origin or the MCP endpoint the token is for. Checked against the resources this server issues tokens for **on behalf of this client's app**; a mismatch is `invalid_target` on the callback."
|
|
7941
7996
|
})
|
|
7942
7997
|
// **No `scope`, because this authorization server issues none.** The field
|
|
@@ -7949,15 +8004,15 @@ var oauthAuthorizeQuery = import_zod37.z.object({
|
|
|
7949
8004
|
description: "The authorization request an MCP client sends, per RFC 6749 \xA74.1.1 with mandatory PKCE. The handler reads it parameter by parameter rather than through one parse, because the answers differ: `client_id` and `redirect_uri` are refused flat, with no redirect, since until both are confirmed there is no trusted target to bounce a browser to, and everything after them is reported to the client's own callback as query parameters."
|
|
7950
8005
|
});
|
|
7951
8006
|
|
|
7952
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
8007
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-schema.js
|
|
8008
|
+
var import_zod41 = require("zod");
|
|
8009
|
+
|
|
8010
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-issues.js
|
|
7953
8011
|
var import_zod40 = require("zod");
|
|
7954
8012
|
|
|
7955
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
8013
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-templates.js
|
|
7956
8014
|
var import_zod39 = require("zod");
|
|
7957
|
-
|
|
7958
|
-
// node_modules/.pnpm/@fleetless+contracts@18.2.0/node_modules/@fleetless/contracts/dist/collections-templates.js
|
|
7959
|
-
var import_zod38 = require("zod");
|
|
7960
|
-
var collectionJsonTemplateName = import_zod38.z.enum(["pose2d", "point2d", "polygon2d", "range1d"]).meta({ description: "The name of a built-in JSON template: `pose2d`, `point2d`, `polygon2d` or `range1d`." });
|
|
8015
|
+
var collectionJsonTemplateName = import_zod39.z.enum(["pose2d", "point2d", "polygon2d", "range1d"]).meta({ description: "The name of a built-in JSON template: `pose2d`, `point2d`, `polygon2d` or `range1d`." });
|
|
7961
8016
|
function deepFreeze(value) {
|
|
7962
8017
|
if (value !== null && typeof value === "object") {
|
|
7963
8018
|
for (const inner of Object.values(value))
|
|
@@ -8013,29 +8068,29 @@ var COLLECTION_JSON_TEMPLATES = deepFreeze({
|
|
|
8013
8068
|
}
|
|
8014
8069
|
});
|
|
8015
8070
|
|
|
8016
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
8071
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-values.js
|
|
8017
8072
|
var TOO_DEEP_JSON = `The value nests arrays and objects more than ${COLLECTION_LIMITS.jsonDepth} levels deep.`;
|
|
8018
8073
|
|
|
8019
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
8020
|
-
var collectionsIssue =
|
|
8021
|
-
path:
|
|
8022
|
-
code:
|
|
8023
|
-
message:
|
|
8024
|
-
severity:
|
|
8074
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-issues.js
|
|
8075
|
+
var collectionsIssue = import_zod40.z.object({
|
|
8076
|
+
path: import_zod40.z.string().min(1).meta({ description: "Where in the document, with dots between the keys: `collections.chargers.fields.location.to`." }),
|
|
8077
|
+
code: import_zod40.z.string().meta({ description: "A stable name for the kind of finding, for code to branch on." }),
|
|
8078
|
+
message: import_zod40.z.string().meta({ description: "What is wrong, in a sentence for a person." }),
|
|
8079
|
+
severity: import_zod40.z.enum(["error", "warning", "info"]).meta({
|
|
8025
8080
|
description: "An error makes the document invalid and it cannot be saved or published. A warning and information leave it valid."
|
|
8026
8081
|
})
|
|
8027
8082
|
}).meta({ description: "One finding about a collections document." });
|
|
8028
8083
|
|
|
8029
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
8030
|
-
var timestamp2 =
|
|
8031
|
-
var count4 =
|
|
8032
|
-
var schemaVersion2 =
|
|
8084
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-schema.js
|
|
8085
|
+
var timestamp2 = import_zod41.z.iso.datetime();
|
|
8086
|
+
var count4 = import_zod41.z.number().int().min(0);
|
|
8087
|
+
var schemaVersion2 = import_zod41.z.number().int().min(1);
|
|
8033
8088
|
var UNIQUE_DISCARDED_LISTED = 1e3;
|
|
8034
|
-
var token =
|
|
8089
|
+
var token = import_zod41.z.string().min(1);
|
|
8035
8090
|
var confirm = token.meta({
|
|
8036
8091
|
description: "The `token` of the preview of exactly this request. Needed when the preview lists effects; a missing or outdated token is answered with `confirmation_required` and the current preview."
|
|
8037
8092
|
});
|
|
8038
|
-
var sha256 =
|
|
8093
|
+
var sha256 = import_zod41.z.string().regex(/^[0-9a-f]{64}$/);
|
|
8039
8094
|
var purgeConfirm = token.meta({
|
|
8040
8095
|
description: "The `token` of the preview of exactly this purge. A purge is always confirmed: without a token, or with one that no longer holds, the answer is `confirmation_required` with the current preview."
|
|
8041
8096
|
});
|
|
@@ -8057,16 +8112,16 @@ function utf8Length(text3) {
|
|
|
8057
8112
|
}
|
|
8058
8113
|
var collection = collectionKey.meta({ description: "The key of the collection." });
|
|
8059
8114
|
var field = collectionKey.meta({ description: "The key of the field." });
|
|
8060
|
-
var collectionsEffect =
|
|
8061
|
-
|
|
8062
|
-
kind:
|
|
8115
|
+
var collectionsEffect = import_zod41.z.discriminatedUnion("kind", [
|
|
8116
|
+
import_zod41.z.object({
|
|
8117
|
+
kind: import_zod41.z.literal("collection_removed"),
|
|
8063
8118
|
collection,
|
|
8064
8119
|
records: count4.meta({ description: "Records deleted with the collection." })
|
|
8065
8120
|
}).strict().meta({
|
|
8066
8121
|
description: "The collection is gone from the document, so its records are deleted. Their history is deleted 90 days after the publish or restore that removed the collection, also when it held no records any more by then; until then a restore of an earlier version with its data can bring the records back."
|
|
8067
8122
|
}),
|
|
8068
|
-
|
|
8069
|
-
kind:
|
|
8123
|
+
import_zod41.z.object({
|
|
8124
|
+
kind: import_zod41.z.literal("collection_recreated"),
|
|
8070
8125
|
collection,
|
|
8071
8126
|
records: count4.meta({ description: "Records deleted by the re-creation." }),
|
|
8072
8127
|
from: collectionBinding,
|
|
@@ -8074,101 +8129,101 @@ var collectionsEffect = import_zod40.z.discriminatedUnion("kind", [
|
|
|
8074
8129
|
}).strict().meta({
|
|
8075
8130
|
description: "The binding of the collection changed, which deletes its records and starts the collection again. The history of the deleted records is kept 90 days after the publish or restore, as for a removed collection."
|
|
8076
8131
|
}),
|
|
8077
|
-
|
|
8078
|
-
kind:
|
|
8132
|
+
import_zod41.z.object({
|
|
8133
|
+
kind: import_zod41.z.literal("records_created"),
|
|
8079
8134
|
collection,
|
|
8080
8135
|
count: count4.meta({ description: "Records created, one for each robot attached to the app." })
|
|
8081
8136
|
}).strict().meta({ description: "A collection with one record per robot got the records of the robots that have none." }),
|
|
8082
|
-
|
|
8083
|
-
kind:
|
|
8137
|
+
import_zod41.z.object({
|
|
8138
|
+
kind: import_zod41.z.literal("field_removed"),
|
|
8084
8139
|
collection,
|
|
8085
8140
|
field,
|
|
8086
8141
|
values: count4.meta({ description: "Values removed from records." })
|
|
8087
8142
|
}).strict().meta({ description: "The field is gone from the document, so its values are removed from the records." }),
|
|
8088
|
-
|
|
8089
|
-
kind:
|
|
8143
|
+
import_zod41.z.object({
|
|
8144
|
+
kind: import_zod41.z.literal("defaults_filled"),
|
|
8090
8145
|
collection,
|
|
8091
8146
|
field,
|
|
8092
8147
|
records: count4.meta({ description: "Records that receive the default." })
|
|
8093
8148
|
}).strict().meta({ description: "Records without a value get the default of a new or newly required field." }),
|
|
8094
|
-
|
|
8095
|
-
kind:
|
|
8149
|
+
import_zod41.z.object({
|
|
8150
|
+
kind: import_zod41.z.literal("values_converted"),
|
|
8096
8151
|
collection,
|
|
8097
8152
|
field,
|
|
8098
8153
|
converted: count4.meta({ description: "Values that became a value of the new type." }),
|
|
8099
8154
|
discarded: count4.meta({ description: "Values that could not be converted and were removed." })
|
|
8100
8155
|
}).strict().meta({ description: "The type of the field changed: values are converted where the conversion rules allow it and removed where they do not." }),
|
|
8101
|
-
|
|
8102
|
-
kind:
|
|
8156
|
+
import_zod41.z.object({
|
|
8157
|
+
kind: import_zod41.z.literal("values_discarded"),
|
|
8103
8158
|
collection,
|
|
8104
8159
|
field,
|
|
8105
|
-
reason:
|
|
8160
|
+
reason: import_zod41.z.enum(["reference_target_changed", "option_removed", "constraint"]).meta({
|
|
8106
8161
|
description: "`reference_target_changed`: the field points at another collection now. `option_removed`: a select option is gone. `constraint`: a limit such as `max_length`, `pattern`, `min`, `max`, `integer` or the JSON schema now excludes the value."
|
|
8107
8162
|
}),
|
|
8108
8163
|
values: count4.meta({ description: "Values removed from records." })
|
|
8109
8164
|
}).strict().meta({ description: "Values that the changed field no longer accepts are removed." }),
|
|
8110
|
-
|
|
8111
|
-
kind:
|
|
8165
|
+
import_zod41.z.object({
|
|
8166
|
+
kind: import_zod41.z.literal("unique_discarded"),
|
|
8112
8167
|
collection,
|
|
8113
8168
|
field,
|
|
8114
8169
|
total: count4.meta({ description: "The exact number of values removed." }),
|
|
8115
|
-
records:
|
|
8116
|
-
id:
|
|
8117
|
-
display:
|
|
8118
|
-
value:
|
|
8170
|
+
records: import_zod41.z.array(import_zod41.z.object({
|
|
8171
|
+
id: import_zod41.z.uuid(),
|
|
8172
|
+
display: import_zod41.z.string().meta({ description: "The record's display text." }),
|
|
8173
|
+
value: import_zod41.z.unknown().meta({ description: "The value the record loses." })
|
|
8119
8174
|
}).strict()).max(UNIQUE_DISCARDED_LISTED).meta({ description: `The records that lose their value, at most ${UNIQUE_DISCARDED_LISTED}; \`total\` is the exact number.` })
|
|
8120
8175
|
}).strict().meta({
|
|
8121
8176
|
description: "The field became unique, or unique across a wider scope, and records share a value: the record created first keeps it and the others lose it."
|
|
8122
8177
|
}),
|
|
8123
|
-
|
|
8124
|
-
kind:
|
|
8178
|
+
import_zod41.z.object({
|
|
8179
|
+
kind: import_zod41.z.literal("required_left_empty"),
|
|
8125
8180
|
collection,
|
|
8126
8181
|
field,
|
|
8127
8182
|
records: count4.meta({ description: "Records left without a value." })
|
|
8128
8183
|
}).strict().meta({ description: "The field is required now and these records have no value and no default to fill in; they stay updatable in their other fields." }),
|
|
8129
|
-
|
|
8130
|
-
kind:
|
|
8184
|
+
import_zod41.z.object({
|
|
8185
|
+
kind: import_zod41.z.literal("references_cleared"),
|
|
8131
8186
|
collection,
|
|
8132
8187
|
field,
|
|
8133
8188
|
values: count4.meta({ description: "References removed." })
|
|
8134
8189
|
}).strict().meta({ description: "References that pointed at records deleted by this change are cleared." })
|
|
8135
8190
|
]).meta({ description: "One effect of a publish or restore on existing data. Effects that would change nothing are not listed." });
|
|
8136
|
-
var collectionsAccessChange =
|
|
8191
|
+
var collectionsAccessChange = import_zod41.z.object({
|
|
8137
8192
|
collection,
|
|
8138
|
-
action:
|
|
8139
|
-
from:
|
|
8140
|
-
to:
|
|
8193
|
+
action: import_zod41.z.enum(["read", "create", "update", "delete"]),
|
|
8194
|
+
from: import_zod41.z.unknown().meta({ description: "The access before, as written in the document. `null` means nobody." }),
|
|
8195
|
+
to: import_zod41.z.unknown().meta({ description: "The access after, as written in the document. `null` means nobody." })
|
|
8141
8196
|
}).meta({ description: "A change of the roles that may do one thing with the records of a collection. Information only; it does not need confirming." });
|
|
8142
|
-
var collectionsSchemaPreview =
|
|
8197
|
+
var collectionsSchemaPreview = import_zod41.z.object({
|
|
8143
8198
|
from_version: schemaVersion2.nullable().meta({ description: "The version that is published now. Null before the first publish." }),
|
|
8144
8199
|
to_version: schemaVersion2.meta({ description: "The number the new version would get." }),
|
|
8145
|
-
valid:
|
|
8146
|
-
issues:
|
|
8147
|
-
effects:
|
|
8148
|
-
access_changes:
|
|
8200
|
+
valid: import_zod41.z.boolean().meta({ description: "False when the draft has errors; it cannot be published and no effects are computed." }),
|
|
8201
|
+
issues: import_zod41.z.array(collectionsIssue).meta({ description: "Everything found in the draft: errors that block publishing, warnings and information." }),
|
|
8202
|
+
effects: import_zod41.z.array(collectionsEffect).meta({ description: "What would happen to existing data, computed against the data as it is now." }),
|
|
8203
|
+
access_changes: import_zod41.z.array(collectionsAccessChange),
|
|
8149
8204
|
source_sha256: sha256.meta({
|
|
8150
8205
|
description: "The SHA-256 of the draft text this preview is for (UTF-8, lowercase hex). Send it as `source_sha256` when publishing to publish exactly this draft, also when there are no effects and so no token."
|
|
8151
8206
|
}),
|
|
8152
|
-
token:
|
|
8207
|
+
token: import_zod41.z.string().nullable().meta({
|
|
8153
8208
|
description: "Stands for exactly this list of effects, on exactly this draft text and the version in force now: send it as `confirm` when publishing. If the draft was saved again, or the data or the version changed, the token no longer holds. Null when there are no effects, since publishing then needs no confirmation."
|
|
8154
8209
|
})
|
|
8155
8210
|
}).meta({ description: "The preview of publishing the draft: its problems, its effects on existing data and the token that confirms them." });
|
|
8156
|
-
var collectionsDraftResponse =
|
|
8157
|
-
source:
|
|
8211
|
+
var collectionsDraftResponse = import_zod41.z.object({
|
|
8212
|
+
source: import_zod41.z.string().meta({ description: "The document as text. The saved draft; without one, the published version's text; before the first publish, empty." }),
|
|
8158
8213
|
doc: collectionsDocument.nullable().meta({ description: "The document the source parses to. Null when the source is empty." }),
|
|
8159
8214
|
updated_at: timestamp2.nullable().meta({ description: "When the draft was saved. Null when no draft is saved." }),
|
|
8160
8215
|
updated_by: collectionActor.nullable().meta({ description: "Who saved the draft. Null when no draft is saved." }),
|
|
8161
|
-
issues:
|
|
8216
|
+
issues: import_zod41.z.array(collectionsIssue).meta({ description: "Warnings and information about the document. A draft is saved only when it has no errors." })
|
|
8162
8217
|
}).meta({ description: "The draft of the schema document, or the current version when there is no draft." });
|
|
8163
|
-
var putCollectionsDraftRequest =
|
|
8218
|
+
var putCollectionsDraftRequest = import_zod41.z.object({
|
|
8164
8219
|
// A character is at least one byte, so the cheap bound on characters holds for every source and rules out the long ones before they are measured.
|
|
8165
|
-
source:
|
|
8220
|
+
source: import_zod41.z.string().max(COLLECTION_LIMITS.schemaSourceBytes).refine((text3) => utf8Length(text3) <= COLLECTION_LIMITS.schemaSourceBytes, {
|
|
8166
8221
|
message: `The source is longer than ${COLLECTION_LIMITS.schemaSourceBytes.toLocaleString("en-US")} bytes of UTF-8.`
|
|
8167
8222
|
}).meta({
|
|
8168
8223
|
description: `The whole document as YAML or JSON text, at most ${COLLECTION_LIMITS.schemaSourceBytes.toLocaleString("en-US")} bytes of UTF-8, which is fewer characters when some are not plain ASCII. It replaces the draft and is refused with the problems found if it is not valid.`
|
|
8169
8224
|
})
|
|
8170
8225
|
}).strict().meta({ description: "Replaces the draft with a whole document." });
|
|
8171
|
-
var collectionsPublishRequest =
|
|
8226
|
+
var collectionsPublishRequest = import_zod41.z.object({
|
|
8172
8227
|
confirm: confirm.optional(),
|
|
8173
8228
|
source_sha256: sha256.meta({
|
|
8174
8229
|
description: "The `source_sha256` of the preview that was looked at. When it is sent and the saved draft is another text, because somebody saved it again since, nothing is published and the answer is `409 confirmation_required` with the current preview. Leave it out to publish whichever draft is saved; a token (`confirm`) already binds the draft it was made for."
|
|
@@ -8176,27 +8231,27 @@ var collectionsPublishRequest = import_zod40.z.object({
|
|
|
8176
8231
|
}).strict().meta({
|
|
8177
8232
|
description: "Publishes the draft. The body may be empty when the preview lists no effects; otherwise it carries the preview's token as `confirm`. Send `source_sha256` as well to be sure that the draft published is the one that was looked at."
|
|
8178
8233
|
});
|
|
8179
|
-
var collectionsPublishResponse =
|
|
8234
|
+
var collectionsPublishResponse = import_zod41.z.object({
|
|
8180
8235
|
version: schemaVersion2,
|
|
8181
8236
|
published_at: timestamp2,
|
|
8182
|
-
effects:
|
|
8183
|
-
issues:
|
|
8237
|
+
effects: import_zod41.z.array(collectionsEffect).meta({ description: "What the publish did to existing data." }),
|
|
8238
|
+
issues: import_zod41.z.array(collectionsIssue).meta({ description: "Warnings and information about the published document." })
|
|
8184
8239
|
}).meta({ description: "The version that was published and the effects it had." });
|
|
8185
|
-
var collectionsVersionSummary =
|
|
8240
|
+
var collectionsVersionSummary = import_zod41.z.object({
|
|
8186
8241
|
version: schemaVersion2,
|
|
8187
8242
|
published_at: timestamp2,
|
|
8188
8243
|
published_by: collectionActor,
|
|
8189
|
-
effect_counts:
|
|
8244
|
+
effect_counts: import_zod41.z.record(import_zod41.z.string(), count4).meta({
|
|
8190
8245
|
description: "For each kind of effect the publish had, how many records or values it touched, by effect `kind`. Empty when it had none."
|
|
8191
8246
|
}),
|
|
8192
8247
|
restored_from: schemaVersion2.nullable().meta({ description: "The version this one restored. Null for an ordinary publish." }),
|
|
8193
|
-
restore_with_data:
|
|
8248
|
+
restore_with_data: import_zod41.z.boolean().meta({
|
|
8194
8249
|
description: `Whether restoring this version can also put records back: its restore point is at most ${COLLECTION_LIMITS.restoreDays} days old, has not been purged, and it is not the current version.`
|
|
8195
8250
|
}),
|
|
8196
|
-
with_data:
|
|
8251
|
+
with_data: import_zod41.z.boolean().meta({
|
|
8197
8252
|
description: "Whether this version came from a restore that also put records back. `false` for an ordinary publish and for a restore of the document alone."
|
|
8198
8253
|
}),
|
|
8199
|
-
reverted_totals:
|
|
8254
|
+
reverted_totals: import_zod41.z.object({
|
|
8200
8255
|
changes: count4.meta({ description: "Changes made since the restore point that were reverted." }),
|
|
8201
8256
|
records_back: count4.meta({ description: "Deleted records that came back." }),
|
|
8202
8257
|
records_deleted: count4.meta({ description: "Records created since the restore point that were deleted." }),
|
|
@@ -8205,110 +8260,110 @@ var collectionsVersionSummary = import_zod40.z.object({
|
|
|
8205
8260
|
description: "What putting the records back did, in all the collections together, so that the history of versions can say what came back. Null unless `with_data`."
|
|
8206
8261
|
})
|
|
8207
8262
|
}).meta({ description: "A published version of the schema document." });
|
|
8208
|
-
var collectionsVersionsResponse =
|
|
8263
|
+
var collectionsVersionsResponse = import_zod41.z.object({
|
|
8209
8264
|
current: schemaVersion2.nullable().meta({ description: "The version in force. Null before the first publish." }),
|
|
8210
|
-
versions:
|
|
8265
|
+
versions: import_zod41.z.array(collectionsVersionSummary).meta({ description: "Newest first." })
|
|
8211
8266
|
}).meta({ description: "The published versions of the schema document." });
|
|
8212
8267
|
var collectionsVersionResponse = collectionsVersionSummary.extend({
|
|
8213
|
-
source:
|
|
8268
|
+
source: import_zod41.z.string().meta({ description: "The document as it was published, as text." }),
|
|
8214
8269
|
doc: collectionsDocument
|
|
8215
8270
|
}).meta({ description: "One published version with its document." });
|
|
8216
|
-
var collectionsRestorePreview =
|
|
8271
|
+
var collectionsRestorePreview = import_zod41.z.object({
|
|
8217
8272
|
version: schemaVersion2.meta({ description: "The version that would be restored." }),
|
|
8218
|
-
with_data:
|
|
8219
|
-
data_possible:
|
|
8220
|
-
data_reason:
|
|
8273
|
+
with_data: import_zod41.z.boolean().meta({ description: "Whether this preview is for a restore that also puts records back." }),
|
|
8274
|
+
data_possible: import_zod41.z.boolean().meta({ description: "Whether records can be put back at all." }),
|
|
8275
|
+
data_reason: import_zod41.z.enum(["ok", "expired", "purged", "current_version"]).meta({
|
|
8221
8276
|
description: `\`ok\`: records can be put back. \`expired\`: the restore point is more than ${COLLECTION_LIMITS.restoreDays} days old. \`purged\`: an owner removed the history it needs. \`current_version\`: this version is already in force.`
|
|
8222
8277
|
}),
|
|
8223
|
-
touched:
|
|
8224
|
-
selected:
|
|
8225
|
-
reverted:
|
|
8278
|
+
touched: import_zod41.z.array(collection).meta({ description: "The collections that differ between the current version and this one; only these can get records back." }),
|
|
8279
|
+
selected: import_zod41.z.array(collection).meta({ description: "The touched collections whose records would be put back. The caller may deselect some." }),
|
|
8280
|
+
reverted: import_zod41.z.array(import_zod41.z.object({
|
|
8226
8281
|
collection,
|
|
8227
8282
|
changes: count4.meta({ description: "Changes made since the restore point that would be reverted." }),
|
|
8228
8283
|
records_back: count4.meta({ description: "Deleted records that would come back." }),
|
|
8229
8284
|
records_deleted: count4.meta({ description: "Records created since the restore point that would be deleted." })
|
|
8230
8285
|
}).strict()).meta({ description: "What putting the records back would do, per selected collection." }),
|
|
8231
8286
|
robots_gone: count4.meta({ description: "Records of robots that were deleted since cannot come back; this is how many." }),
|
|
8232
|
-
effects:
|
|
8233
|
-
access_changes:
|
|
8234
|
-
issues:
|
|
8235
|
-
token:
|
|
8287
|
+
effects: import_zod41.z.array(collectionsEffect).meta({ description: "The ordinary effects of publishing this version's document." }),
|
|
8288
|
+
access_changes: import_zod41.z.array(collectionsAccessChange),
|
|
8289
|
+
issues: import_zod41.z.array(collectionsIssue),
|
|
8290
|
+
token: import_zod41.z.string().nullable().meta({
|
|
8236
8291
|
description: "Stands for exactly what this restore would do: send it as `confirm`. Null when the restore changes no data and needs no confirmation."
|
|
8237
8292
|
})
|
|
8238
8293
|
}).meta({ description: "The preview of restoring a version, with the token that confirms it." });
|
|
8239
|
-
var collectionsRestorePreviewQuery =
|
|
8240
|
-
data:
|
|
8241
|
-
collections:
|
|
8294
|
+
var collectionsRestorePreviewQuery = import_zod41.z.object({
|
|
8295
|
+
data: import_zod41.z.enum(["true", "false"]).meta({ description: "`true` also puts records back to their state at the version's restore point. Default `false`." }).optional(),
|
|
8296
|
+
collections: import_zod41.z.string().min(1).meta({ description: "The touched collections to put records back in, separated by commas. Default: all of them." }).optional()
|
|
8242
8297
|
}).strict();
|
|
8243
|
-
var collectionsRestoreRequest =
|
|
8244
|
-
data:
|
|
8245
|
-
collections:
|
|
8298
|
+
var collectionsRestoreRequest = import_zod41.z.object({
|
|
8299
|
+
data: import_zod41.z.boolean().meta({ description: "Also put records back to their state at the restore point, in the touched collections. Default `false`." }).optional(),
|
|
8300
|
+
collections: import_zod41.z.array(collectionKey).max(COLLECTION_LIMITS.collections).meta({ description: "Limits putting records back to these touched collections. Default: all of them." }).optional(),
|
|
8246
8301
|
confirm: confirm.optional()
|
|
8247
8302
|
}).strict().meta({ description: "Restores a version. Send the `data` and `collections` of the preview together with its token as `confirm`." });
|
|
8248
|
-
var collectionsRestoreResponse = collectionsPublishResponse.extend({ with_data:
|
|
8249
|
-
var collectionsPurgeRequest =
|
|
8303
|
+
var collectionsRestoreResponse = collectionsPublishResponse.extend({ with_data: import_zod41.z.boolean().meta({ description: "Whether records were put back as well." }) }).meta({ description: "The version that the restore published and what it did." });
|
|
8304
|
+
var collectionsPurgeRequest = import_zod41.z.object({
|
|
8250
8305
|
before: timestamp2.meta({
|
|
8251
8306
|
description: "Revisions older than this UTC time are removed. The current values of records stay. It must lie in the past (`400 validation_error`, field `before`, rule `not_in_past`), and a date older than every revision is refused as well (rule `nothing_to_purge`)."
|
|
8252
8307
|
}),
|
|
8253
8308
|
collection: collectionKey.meta({ description: "Purge only this collection. Default: the whole app." }).optional(),
|
|
8254
8309
|
confirm: purgeConfirm.optional()
|
|
8255
8310
|
}).strict().meta({ description: "Removes the history older than a date. The preview answers with a token; send it as `confirm` to purge." });
|
|
8256
|
-
var collectionsPurgePreview =
|
|
8311
|
+
var collectionsPurgePreview = import_zod41.z.object({
|
|
8257
8312
|
before: timestamp2,
|
|
8258
8313
|
collection: collectionKey.nullable().meta({ description: "The collection the purge is limited to. Null for the whole app." }),
|
|
8259
8314
|
revisions: count4.meta({ description: "Revisions that would be removed." }),
|
|
8260
8315
|
bytes: count4.meta({ description: "Their size in bytes." }),
|
|
8261
|
-
restore_points_lost:
|
|
8316
|
+
restore_points_lost: import_zod41.z.array(schemaVersion2).meta({
|
|
8262
8317
|
description: "Versions whose records could be put back today and could not once the history is gone, judged the way `restore_with_data` of the version list is. For the purge of one collection only the versions whose restore touches that collection are named."
|
|
8263
8318
|
}),
|
|
8264
8319
|
token: token.meta({ description: "Stands for exactly this purge: send it as `confirm` to carry it out." })
|
|
8265
8320
|
}).meta({ description: "What a purge would remove, with the token that confirms it." });
|
|
8266
|
-
var collectionsPurgeResponse =
|
|
8321
|
+
var collectionsPurgeResponse = import_zod41.z.object({
|
|
8267
8322
|
revisions: count4.meta({ description: "Revisions removed." }),
|
|
8268
8323
|
bytes: count4.meta({ description: "Their size in bytes." }),
|
|
8269
8324
|
purged_at: timestamp2
|
|
8270
8325
|
}).meta({ description: "What a purge removed." });
|
|
8271
8326
|
|
|
8272
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
8273
|
-
var
|
|
8327
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-transfer.js
|
|
8328
|
+
var import_zod42 = require("zod");
|
|
8274
8329
|
var IMPORT_ERRORS_LISTED = 1e3;
|
|
8275
|
-
var count5 =
|
|
8276
|
-
var confirm2 =
|
|
8330
|
+
var count5 = import_zod42.z.number().int().min(0);
|
|
8331
|
+
var confirm2 = import_zod42.z.string().min(1).meta({
|
|
8277
8332
|
description: "The `token` of the preview of exactly this import. Without it the import route answers the preview and imports nothing. A token that is not the one of the current preview, because the data moved on or it belongs to another import, is answered `409 confirmation_required` with the current preview in `details.preview`. A file with errors is never imported: its preview comes back with `token: null`, whatever `confirm` says."
|
|
8278
8333
|
});
|
|
8279
|
-
var mappingTarget = collectionKey.or(
|
|
8334
|
+
var mappingTarget = collectionKey.or(import_zod42.z.literal("")).meta({
|
|
8280
8335
|
description: "The key of the field the column is imported into, the literal `robot`, or an empty string to leave the column out."
|
|
8281
8336
|
});
|
|
8282
|
-
var importScope =
|
|
8337
|
+
var importScope = import_zod42.z.object({
|
|
8283
8338
|
filter: collectionFilter.meta({ description: "Only records matching this filter can be deleted. The same filter object that record lists take as JSON text." }).optional(),
|
|
8284
|
-
robot_id:
|
|
8339
|
+
robot_id: import_zod42.z.uuid().meta({ description: "Only records of this robot can be deleted." }).optional()
|
|
8285
8340
|
}).strict().refine((scope) => !(scope.filter !== void 0 && scope.robot_id !== void 0), {
|
|
8286
8341
|
message: "A scope is a filter or a robot, not both",
|
|
8287
8342
|
path: ["robot_id"]
|
|
8288
8343
|
}).meta({
|
|
8289
8344
|
description: "Limits which records `mirror` may delete: those matching a filter, or those of one robot. Name exactly one of them: an empty `scope` is `400 validation_error` (rule `empty`), and so is a `scope` on an import that is not a `mirror` (rule `needs_mirror`). Without a scope the whole collection is mirrored, every robot's records included. `robot_id` of the request does not narrow a mirror; use `scope.robot_id`."
|
|
8290
8345
|
});
|
|
8291
|
-
var collectionImportRequest =
|
|
8292
|
-
format:
|
|
8346
|
+
var collectionImportRequest = import_zod42.z.object({
|
|
8347
|
+
format: import_zod42.z.enum(["csv", "json"]).meta({
|
|
8293
8348
|
description: "`csv`: UTF-8 text with a header row, as in RFC 4180; a `json` field is written as JSON text in its cell. `json`: an array of objects, one per record."
|
|
8294
8349
|
}),
|
|
8295
|
-
content:
|
|
8350
|
+
content: import_zod42.z.string().max(COLLECTION_LIMITS.importBytes).meta({
|
|
8296
8351
|
description: `The file as text, at most ${COLLECTION_LIMITS.importBytes.toLocaleString("en-US")} characters and as many bytes of UTF-8, and ${COLLECTION_LIMITS.importRows.toLocaleString("en-US")} rows (\`400 validation_error\`, rule \`too_large\` or \`too_many_rows\`; the latter is raised as soon as the 50,001st row is read, so it does not say how many there are). A byte order mark at the start of a JSON file is ignored.`
|
|
8297
8352
|
}),
|
|
8298
|
-
mapping:
|
|
8353
|
+
mapping: import_zod42.z.record(import_zod42.z.string(), mappingTarget).meta({
|
|
8299
8354
|
description: "Where each column of the file goes, by the column name in the header (for JSON, the property name). A column that is not listed is imported into the field with the same key. A column named after a system field (`id`, `created_at`, `created_by`, `updated_at`, `updated_by`, `revision`, `robot_id`) is left out unless it is mapped."
|
|
8300
8355
|
}).optional(),
|
|
8301
|
-
references:
|
|
8356
|
+
references: import_zod42.z.record(collectionKey, collectionKey).meta({
|
|
8302
8357
|
description: "For each reference field, by its key: the unique field of the target collection that the values in its column identify, for example `name`. A reference field that is not listed takes record ids."
|
|
8303
8358
|
}).optional(),
|
|
8304
8359
|
key: collectionKey.meta({
|
|
8305
8360
|
description: "A unique field that matches rows to existing records: a row whose value is found updates that record, the rest create records. Without a key every row creates a record. A collection with one record per robot is only updated, matched by robot, takes no key and no mirror, and two rows for one robot are an error."
|
|
8306
8361
|
}).optional(),
|
|
8307
|
-
mode:
|
|
8362
|
+
mode: import_zod42.z.enum(["upsert", "mirror"]).meta({
|
|
8308
8363
|
description: "`upsert` (the default) creates and updates records. `mirror` also deletes the records of `scope` that are not in the file, and needs `key`. A mirror deletes at most 50,000 records, a file without rows is refused, and a deletion that a `prevent` reference blocks fails the whole import. A collection with one record per robot takes neither a `key` nor a `mirror` (`400 validation_error`, rule `one_per_robot_is_automatic`)."
|
|
8309
8364
|
}).optional(),
|
|
8310
8365
|
scope: importScope.optional(),
|
|
8311
|
-
robot_id:
|
|
8366
|
+
robot_id: import_zod42.z.uuid().meta({
|
|
8312
8367
|
description: "The robot every row belongs to, in a collection that belongs to robots, when the file has no `robot` column; sent together with a `robot` column it is refused (rule `robot_column_present`). It says which robot the rows are for and does not narrow a `mirror`: that is `scope.robot_id`."
|
|
8313
8368
|
}).optional(),
|
|
8314
8369
|
confirm: confirm2.optional()
|
|
@@ -8316,77 +8371,77 @@ var collectionImportRequest = import_zod41.z.object({
|
|
|
8316
8371
|
message: 'Mode "mirror" needs a key: records are matched to the file by it',
|
|
8317
8372
|
path: ["key"]
|
|
8318
8373
|
}).meta({ description: "Imports a file of records into a collection, all or nothing." });
|
|
8319
|
-
var importError =
|
|
8374
|
+
var importError = import_zod42.z.object({
|
|
8320
8375
|
row: count5.meta({
|
|
8321
8376
|
description: "The row the problem is in, counted from 1 over the records of the file, so the header of a CSV is not counted. 0 marks a problem with the file as a whole, and a deletion of a `mirror` that a `prevent` reference blocks (the column is then the key column and the value the key of the record)."
|
|
8322
8377
|
}),
|
|
8323
|
-
column:
|
|
8324
|
-
value:
|
|
8325
|
-
reason:
|
|
8378
|
+
column: import_zod42.z.string().max(COLLECTION_LIMITS.importErrorText).meta({ description: "The column as named in the file. Empty when the problem is not about one column. Cut to 200 characters, an ellipsis included." }),
|
|
8379
|
+
value: import_zod42.z.string().max(COLLECTION_LIMITS.importErrorText).meta({ description: "The value as found in the file, cut to 200 characters with an ellipsis (`\u2026`) at the end when it was longer." }),
|
|
8380
|
+
reason: import_zod42.z.string().min(1).meta({ description: "What is wrong with it, in words." })
|
|
8326
8381
|
}).meta({ description: "A row, column and value that stop the import, with the reason." });
|
|
8327
|
-
var collectionImportPreview =
|
|
8328
|
-
counts:
|
|
8382
|
+
var collectionImportPreview = import_zod42.z.object({
|
|
8383
|
+
counts: import_zod42.z.object({
|
|
8329
8384
|
unchanged: count5.meta({ description: "Rows that match a record that already has these values." }),
|
|
8330
8385
|
new: count5.meta({ description: "Records that would be created." }),
|
|
8331
8386
|
updated: count5.meta({ description: "Records that would change." }),
|
|
8332
8387
|
deleted: count5.meta({ description: "Records that `mirror` would delete." }),
|
|
8333
8388
|
errors: count5.meta({ description: "Problems found in the file. The same number as `errors_total`." })
|
|
8334
8389
|
}).meta({ description: "What the import would do, counted." }),
|
|
8335
|
-
errors:
|
|
8390
|
+
errors: import_zod42.z.array(importError).max(IMPORT_ERRORS_LISTED).meta({
|
|
8336
8391
|
description: `The problems found, in file order, at most ${IMPORT_ERRORS_LISTED.toLocaleString("en-US")}; \`errors_total\` is the exact number.`
|
|
8337
8392
|
}),
|
|
8338
8393
|
errors_total: count5.meta({ description: "The exact number of problems found." }),
|
|
8339
|
-
mirror_scope:
|
|
8394
|
+
mirror_scope: import_zod42.z.enum(["collection", "filter", "robot"]).nullable().meta({
|
|
8340
8395
|
description: "Where `mirror` would delete records: `collection` is every record of the collection, which the preview should say prominently; `filter` and `robot` are the scope that was sent. Null when the mode is not `mirror`."
|
|
8341
8396
|
}),
|
|
8342
|
-
warnings:
|
|
8397
|
+
warnings: import_zod42.z.array(import_zod42.z.enum(["plan_limit"])).meta({
|
|
8343
8398
|
description: "`plan_limit`: importing the file would take the organization over a limit of its plan, so the import itself would be refused."
|
|
8344
8399
|
}),
|
|
8345
|
-
token:
|
|
8400
|
+
token: import_zod42.z.string().min(1).nullable().meta({
|
|
8346
8401
|
description: "Stands for exactly this import: send it as `confirm` to carry it out. Null while the file has errors. It is not single-use; see the note on the import routes."
|
|
8347
8402
|
})
|
|
8348
8403
|
}).meta({ description: "The preview of an import: what it would do, the problems that stop it and the token that confirms it." });
|
|
8349
|
-
var collectionImportResult =
|
|
8404
|
+
var collectionImportResult = import_zod42.z.object({
|
|
8350
8405
|
created: count5.meta({ description: "Records created." }),
|
|
8351
8406
|
updated: count5.meta({ description: "Records changed." }),
|
|
8352
8407
|
deleted: count5.meta({ description: "Records deleted by `mirror`." }),
|
|
8353
8408
|
unchanged: count5.meta({ description: "Rows that matched a record that already had these values." })
|
|
8354
8409
|
}).meta({ description: "What an import did." });
|
|
8355
|
-
var collectionExportQuery =
|
|
8356
|
-
format:
|
|
8410
|
+
var collectionExportQuery = import_zod42.z.object({
|
|
8411
|
+
format: import_zod42.z.enum(["csv", "json"]).meta({ description: "`csv`: UTF-8 text with a header row. `json`: an array of objects." }),
|
|
8357
8412
|
// The same four parameters, in the same words, as the record list they narrow down.
|
|
8358
8413
|
...collectionRecordListQuery.pick({ filter: true, search: true, sort: true, robot: true }).shape,
|
|
8359
|
-
fields:
|
|
8360
|
-
references:
|
|
8414
|
+
fields: import_zod42.z.string().min(1).meta({ description: "The fields to export by key, separated by commas, in the order given. Default: all fields, in the order of the schema." }).optional(),
|
|
8415
|
+
references: import_zod42.z.string().min(1).meta({
|
|
8361
8416
|
description: "How reference fields are written: `id` (the default) or the key of a unique field of the target collection, such as `name`, so that the file can be imported again. A reference field in the file whose target collection has no such unique field is `400 validation_error` (field `references`, rule `not_unique`); with no reference field among the columns the value is ignored."
|
|
8362
8417
|
}).optional(),
|
|
8363
|
-
system:
|
|
8418
|
+
system: import_zod42.z.enum(["true", "false"]).meta({
|
|
8364
8419
|
description: "`true` adds the system fields after the fields: `robot_id` in a collection that belongs to robots, then `id`, `created_at`, `created_by`, `updated_at`, `updated_by` and `revision`. `created_by` and `updated_by` are the actors' labels. Default `false`."
|
|
8365
8420
|
}).optional()
|
|
8366
8421
|
}).strict();
|
|
8367
8422
|
|
|
8368
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
8369
|
-
var
|
|
8370
|
-
var text2 = (max) =>
|
|
8371
|
-
var email =
|
|
8372
|
-
var controllerRegisterAddress =
|
|
8423
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/controller-register.js
|
|
8424
|
+
var import_zod43 = require("zod");
|
|
8425
|
+
var text2 = (max) => import_zod43.z.string().regex(/^\P{Cc}*$/u).trim().min(1).max(max);
|
|
8426
|
+
var email = import_zod43.z.string().regex(/^\P{Cc}*$/u).trim().email().max(320);
|
|
8427
|
+
var controllerRegisterAddress = import_zod43.z.object({
|
|
8373
8428
|
line1: text2(200),
|
|
8374
8429
|
line2: text2(200).nullable().default(null),
|
|
8375
8430
|
postalCode: text2(32),
|
|
8376
8431
|
city: text2(120),
|
|
8377
|
-
country:
|
|
8432
|
+
country: import_zod43.z.string().regex(/^\P{Cc}*$/u).trim().regex(/^[A-Z]{2}$/)
|
|
8378
8433
|
}).strict();
|
|
8379
|
-
var controllerRegisterPrivacyContact =
|
|
8434
|
+
var controllerRegisterPrivacyContact = import_zod43.z.object({
|
|
8380
8435
|
name: text2(200),
|
|
8381
8436
|
email,
|
|
8382
|
-
role:
|
|
8437
|
+
role: import_zod43.z.enum(["general", "appointed_dpo"])
|
|
8383
8438
|
}).strict();
|
|
8384
|
-
var controllerRegisterRepresentative =
|
|
8439
|
+
var controllerRegisterRepresentative = import_zod43.z.object({
|
|
8385
8440
|
name: text2(200),
|
|
8386
8441
|
email,
|
|
8387
8442
|
address: text2(500)
|
|
8388
8443
|
}).strict();
|
|
8389
|
-
var controllerRegisterWrite =
|
|
8444
|
+
var controllerRegisterWrite = import_zod43.z.object({
|
|
8390
8445
|
legalName: text2(200),
|
|
8391
8446
|
address: controllerRegisterAddress,
|
|
8392
8447
|
privacyContact: controllerRegisterPrivacyContact.nullable(),
|
|
@@ -8396,19 +8451,19 @@ var controllerRegisterWrite = import_zod42.z.object({
|
|
|
8396
8451
|
var controllerRegisterOrgRecord = controllerRegisterWrite.extend({
|
|
8397
8452
|
legalName: text2(200).nullable(),
|
|
8398
8453
|
address: controllerRegisterAddress.nullable(),
|
|
8399
|
-
updatedAt:
|
|
8400
|
-
updatedByKind:
|
|
8401
|
-
updatedById:
|
|
8454
|
+
updatedAt: import_zod43.z.iso.datetime(),
|
|
8455
|
+
updatedByKind: import_zod43.z.enum(["owner", "operator"]),
|
|
8456
|
+
updatedById: import_zod43.z.uuid()
|
|
8402
8457
|
}).strict();
|
|
8403
|
-
var controllerRegisterOrgResponse =
|
|
8404
|
-
orgId:
|
|
8458
|
+
var controllerRegisterOrgResponse = import_zod43.z.object({
|
|
8459
|
+
orgId: import_zod43.z.uuid(),
|
|
8405
8460
|
details: controllerRegisterOrgRecord.nullable()
|
|
8406
8461
|
}).strict();
|
|
8407
8462
|
|
|
8408
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
8409
|
-
var
|
|
8463
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/billing.js
|
|
8464
|
+
var import_zod44 = require("zod");
|
|
8410
8465
|
|
|
8411
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
8466
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/iana-time-zones.js
|
|
8412
8467
|
var ianaTimeZones = [
|
|
8413
8468
|
"UTC",
|
|
8414
8469
|
"Etc/UTC",
|
|
@@ -8833,8 +8888,8 @@ var ianaTimeZones = [
|
|
|
8833
8888
|
"Pacific/Wallis"
|
|
8834
8889
|
];
|
|
8835
8890
|
|
|
8836
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
8837
|
-
var countryCode =
|
|
8891
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/billing.js
|
|
8892
|
+
var countryCode = import_zod44.z.string().regex(/^[A-Z]{2}$/);
|
|
8838
8893
|
var EU_COUNTRIES = [
|
|
8839
8894
|
"AT",
|
|
8840
8895
|
"BE",
|
|
@@ -8868,52 +8923,52 @@ var SELLER_COUNTRY = "DE";
|
|
|
8868
8923
|
function isEuCountry(country) {
|
|
8869
8924
|
return EU_COUNTRIES.includes(country);
|
|
8870
8925
|
}
|
|
8871
|
-
var payerKind =
|
|
8872
|
-
var billingCycle =
|
|
8873
|
-
var vatTreatment =
|
|
8874
|
-
var payerRefusalRule =
|
|
8875
|
-
var viesPendingReason =
|
|
8876
|
-
var viesOutage =
|
|
8877
|
-
scope:
|
|
8926
|
+
var payerKind = import_zod44.z.enum(["company", "person"]);
|
|
8927
|
+
var billingCycle = import_zod44.z.enum(["monthly", "yearly"]);
|
|
8928
|
+
var vatTreatment = import_zod44.z.enum(["de_standard", "reverse_charge", "outside_eu"]);
|
|
8929
|
+
var payerRefusalRule = import_zod44.z.enum(["company_required", "vat_id_required", "vat_id_invalid"]);
|
|
8930
|
+
var viesPendingReason = import_zod44.z.enum(["vies_unavailable", "vies_unverified", "vies_identifier_missing"]);
|
|
8931
|
+
var viesOutage = import_zod44.z.object({
|
|
8932
|
+
scope: import_zod44.z.enum(["member_state", "vies"]).meta({
|
|
8878
8933
|
description: "`member_state`: the VAT register of `country` does not answer VIES. `vies`: VIES itself does not answer."
|
|
8879
8934
|
}),
|
|
8880
8935
|
country: countryCode.meta({ description: "The billing address's country whose VAT ID was asked for. Greece is `GR`, never VIES's `EL`." })
|
|
8881
8936
|
}).strict();
|
|
8882
8937
|
function viesPending(shape) {
|
|
8883
|
-
return
|
|
8884
|
-
|
|
8885
|
-
|
|
8938
|
+
return import_zod44.z.discriminatedUnion("reason", [
|
|
8939
|
+
import_zod44.z.object({ ...shape, reason: import_zod44.z.literal("vies_unavailable"), vies_outage: viesOutage }).strict(),
|
|
8940
|
+
import_zod44.z.object({ ...shape, reason: viesPendingReason.exclude(["vies_unavailable"]) }).strict()
|
|
8886
8941
|
]);
|
|
8887
8942
|
}
|
|
8888
|
-
var vatDecision =
|
|
8889
|
-
|
|
8890
|
-
viesPending({ state:
|
|
8891
|
-
|
|
8943
|
+
var vatDecision = import_zod44.z.discriminatedUnion("state", [
|
|
8944
|
+
import_zod44.z.object({ state: import_zod44.z.literal("eligible"), treatment: vatTreatment, rate_percent: import_zod44.z.number().int().min(0).max(100) }).strict(),
|
|
8945
|
+
viesPending({ state: import_zod44.z.literal("pending") }),
|
|
8946
|
+
import_zod44.z.object({ state: import_zod44.z.literal("refused"), rule: payerRefusalRule }).strict()
|
|
8892
8947
|
]);
|
|
8893
|
-
var billingAddress =
|
|
8894
|
-
line1:
|
|
8895
|
-
line2:
|
|
8896
|
-
postal_code:
|
|
8897
|
-
city:
|
|
8948
|
+
var billingAddress = import_zod44.z.object({
|
|
8949
|
+
line1: import_zod44.z.string().trim().min(1).max(200).meta({ description: "Street and number, or the first address line." }),
|
|
8950
|
+
line2: import_zod44.z.string().trim().max(200).nullable().meta({ description: "A second address line, or `null` when there is none." }),
|
|
8951
|
+
postal_code: import_zod44.z.string().trim().min(1).max(20).meta({ description: "Postal or ZIP code." }),
|
|
8952
|
+
city: import_zod44.z.string().trim().min(1).max(100).meta({ description: "City or town." }),
|
|
8898
8953
|
country: countryCode.meta({ description: "The billing country, used for purchase eligibility and VAT." }),
|
|
8899
|
-
state:
|
|
8954
|
+
state: import_zod44.z.string().trim().min(1).max(100).optional().meta({ description: "State or region. A new US purchase requires a two-letter state code; historical addresses may omit it." })
|
|
8900
8955
|
}).strict();
|
|
8901
|
-
var billingDetails =
|
|
8902
|
-
|
|
8903
|
-
kind:
|
|
8904
|
-
company_name:
|
|
8905
|
-
vat_id:
|
|
8956
|
+
var billingDetails = import_zod44.z.discriminatedUnion("kind", [
|
|
8957
|
+
import_zod44.z.object({
|
|
8958
|
+
kind: import_zod44.z.literal("company").meta({ description: "Billed as a company." }),
|
|
8959
|
+
company_name: import_zod44.z.string().trim().min(1).max(200).meta({ description: "The company's legal name, printed on the invoice." }),
|
|
8960
|
+
vat_id: import_zod44.z.string().trim().max(20).nullable().meta({
|
|
8906
8961
|
description: "The company's VAT ID, or `null` for none. Required for a new purchase in another EU country; direct VIES must confirm it with an identifier."
|
|
8907
8962
|
}),
|
|
8908
|
-
tax_id:
|
|
8963
|
+
tax_id: import_zod44.z.string().trim().max(100).nullable().optional().meta({ description: "Free-text Tax ID. Required for a new non-EU purchase; historical records may omit it." }),
|
|
8909
8964
|
address: billingAddress.meta({ description: "The billing address." }),
|
|
8910
|
-
invoice_email:
|
|
8965
|
+
invoice_email: import_zod44.z.email().meta({ description: "Where invoices and billing mail are sent." })
|
|
8911
8966
|
}).strict().meta({ description: "A company: name and an optional VAT ID, never 'full name'." }),
|
|
8912
|
-
|
|
8913
|
-
kind:
|
|
8914
|
-
full_name:
|
|
8967
|
+
import_zod44.z.object({
|
|
8968
|
+
kind: import_zod44.z.literal("person").meta({ description: "Billed as a person." }),
|
|
8969
|
+
full_name: import_zod44.z.string().trim().min(1).max(200).meta({ description: "The person's full name, printed on the invoice." }),
|
|
8915
8970
|
address: billingAddress.meta({ description: "The billing address." }),
|
|
8916
|
-
invoice_email:
|
|
8971
|
+
invoice_email: import_zod44.z.email().meta({ description: "Where invoices and billing mail are sent." })
|
|
8917
8972
|
}).strict().meta({ description: "A person: a full name, never a VAT ID \u2014 only a company can be VAT-registered." })
|
|
8918
8973
|
]);
|
|
8919
8974
|
var purchaseBillingDetails = billingDetails.options[0].superRefine((payer, ctx) => {
|
|
@@ -8928,55 +8983,55 @@ var purchaseBillingDetails = billingDetails.options[0].superRefine((payer, ctx)
|
|
|
8928
8983
|
ctx.addIssue({ code: "custom", path: ["address", "state"], message: "us_state_required" });
|
|
8929
8984
|
}
|
|
8930
8985
|
}).meta({ description: "New company purchase. Other EU countries require VAT ID; non-EU requires Tax ID; US requires two-letter state. Cloud additionally checks the versioned public-email policy and current VIES evidence." });
|
|
8931
|
-
var purchaseOperation =
|
|
8986
|
+
var purchaseOperation = import_zod44.z.enum(["checkout", "paid_change", "invoice_payment", "payment_method_invoice", "mandate_setup"]);
|
|
8932
8987
|
var chargeOperation = purchaseOperation.exclude(["mandate_setup"]);
|
|
8933
|
-
var checkoutRequest =
|
|
8988
|
+
var checkoutRequest = import_zod44.z.object({
|
|
8934
8989
|
operation_key: purchaseOperationKey,
|
|
8935
|
-
plan:
|
|
8990
|
+
plan: import_zod44.z.enum(["plus", "pro"]).meta({ description: "The paid plan to buy; Basic requires no checkout." }),
|
|
8936
8991
|
cycle: billingCycle.meta({ description: "Monthly, or yearly at 15 percent off." }),
|
|
8937
8992
|
addons: orgAddons.partial().strict().optional().meta({ description: "Add-on units to buy; Pro only. Cloud refuses add-ons on Plus." }),
|
|
8938
8993
|
billing: purchaseBillingDetails.meta({ description: "The company buying the plan. Country requirements, current VIES and the email policy must pass before charging." }),
|
|
8939
|
-
accept_terms:
|
|
8994
|
+
accept_terms: import_zod44.z.literal(true).optional().meta({ description: "Deprecated draft input. It is not evidence of a displayed C.4 declaration and never confirms an order." })
|
|
8940
8995
|
}).strict();
|
|
8941
|
-
var purchaseCents =
|
|
8942
|
-
var purchaseQuote =
|
|
8943
|
-
currency:
|
|
8996
|
+
var purchaseCents = import_zod44.z.number().int().nonnegative();
|
|
8997
|
+
var purchaseQuote = import_zod44.z.object({
|
|
8998
|
+
currency: import_zod44.z.literal("eur").meta({ description: "Every new quote is in EUR." }),
|
|
8944
8999
|
net_cents: purchaseCents.meta({ description: "Current charge excluding VAT, in cents." }),
|
|
8945
9000
|
vat_cents: purchaseCents.meta({ description: "VAT on the current charge, in cents." }),
|
|
8946
9001
|
gross_cents: purchaseCents.meta({ description: "Total to confirm, including VAT, in cents." }),
|
|
8947
|
-
rate_percent:
|
|
9002
|
+
rate_percent: import_zod44.z.number().int().min(0).max(100).meta({ description: "VAT rate in whole percent." })
|
|
8948
9003
|
}).strict();
|
|
8949
9004
|
var quoteIdentity = {
|
|
8950
|
-
quote_revision:
|
|
8951
|
-
buyer_fingerprint:
|
|
9005
|
+
quote_revision: import_zod44.z.string().trim().min(1).max(200).meta({ description: "Opaque revision of the displayed quote; echo it when confirming." }),
|
|
9006
|
+
buyer_fingerprint: import_zod44.z.string().trim().min(1).max(200).meta({ description: "Opaque revision of buyer details and email policy; never full VIES evidence." })
|
|
8952
9007
|
};
|
|
8953
|
-
var billingDecisionDisplayRequest =
|
|
9008
|
+
var billingDecisionDisplayRequest = import_zod44.z.object({
|
|
8954
9009
|
operation_key: purchaseOperationKey,
|
|
8955
|
-
operation:
|
|
9010
|
+
operation: import_zod44.z.enum(["checkout", "paid_change"])
|
|
8956
9011
|
}).strict();
|
|
8957
9012
|
var selectionBase = {
|
|
8958
|
-
plan:
|
|
9013
|
+
plan: import_zod44.z.enum(["basic", "plus", "pro"]),
|
|
8959
9014
|
cycle: billingCycle,
|
|
8960
9015
|
addons: orgAddons
|
|
8961
9016
|
};
|
|
8962
|
-
var purchaseSelection =
|
|
8963
|
-
var planChangeSelection =
|
|
8964
|
-
var addonLine =
|
|
9017
|
+
var purchaseSelection = import_zod44.z.object(selectionBase).strict();
|
|
9018
|
+
var planChangeSelection = import_zod44.z.object({ ...selectionBase, keep: planChangeKeep.nullable() }).strict();
|
|
9019
|
+
var addonLine = import_zod44.z.object({ addon: addonKey, quantity: import_zod44.z.number().int().positive(), net_cents: purchaseCents }).strict();
|
|
8965
9020
|
var treatmentRules = [
|
|
8966
9021
|
{ if: { properties: { vat_treatment: { const: "de_standard" } }, required: ["vat_treatment"] }, then: { properties: { quote: { properties: { rate_percent: { const: 19 } } } } } },
|
|
8967
9022
|
{ if: { properties: { vat_treatment: { const: "reverse_charge" } }, required: ["vat_treatment"] }, then: { properties: { quote: { properties: { rate_percent: { const: 0 }, vat_cents: { const: 0 } } }, period_vat_cents: { const: 0 }, vat_treatment_line: { const: "Reverse charge \u2014 VAT payable by the recipient" } } } },
|
|
8968
9023
|
{ if: { properties: { vat_treatment: { const: "outside_eu" } }, required: ["vat_treatment"] }, then: { properties: { quote: { properties: { rate_percent: { const: 0 }, vat_cents: { const: 0 } } }, period_vat_cents: { const: 0 }, vat_treatment_line: { const: "Not taxable in Germany" } } } }
|
|
8969
9024
|
];
|
|
8970
|
-
var billingDecisionAmounts =
|
|
8971
|
-
currency:
|
|
9025
|
+
var billingDecisionAmounts = import_zod44.z.object({
|
|
9026
|
+
currency: import_zod44.z.literal("eur"),
|
|
8972
9027
|
quote: purchaseQuote,
|
|
8973
9028
|
plan_net_cents: purchaseCents,
|
|
8974
|
-
addon_lines:
|
|
9029
|
+
addon_lines: import_zod44.z.array(addonLine),
|
|
8975
9030
|
period_net_cents: purchaseCents,
|
|
8976
9031
|
period_vat_cents: purchaseCents,
|
|
8977
9032
|
period_gross_cents: purchaseCents,
|
|
8978
9033
|
vat_treatment: vatTreatment,
|
|
8979
|
-
vat_treatment_line:
|
|
9034
|
+
vat_treatment_line: import_zod44.z.string().min(1),
|
|
8980
9035
|
due_today_gross_cents: purchaseCents,
|
|
8981
9036
|
prorated_net_cents: purchaseCents.nullable(),
|
|
8982
9037
|
renewal_net_cents: purchaseCents
|
|
@@ -8997,8 +9052,8 @@ var billingDecisionAmounts = import_zod43.z.object({
|
|
|
8997
9052
|
invalid("vat_treatment", "Zero-rated treatment, rate, VAT and line must agree.");
|
|
8998
9053
|
}
|
|
8999
9054
|
}).meta({ allOf: treatmentRules });
|
|
9000
|
-
var utcInstant =
|
|
9001
|
-
var ianaTimeZone =
|
|
9055
|
+
var utcInstant = import_zod44.z.iso.datetime().regex(/Z$/);
|
|
9056
|
+
var ianaTimeZone = import_zod44.z.enum(ianaTimeZones);
|
|
9002
9057
|
function localDate(instant, timeZone) {
|
|
9003
9058
|
try {
|
|
9004
9059
|
const parts = new Intl.DateTimeFormat("en-US", { timeZone, year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(new Date(instant));
|
|
@@ -9008,16 +9063,16 @@ function localDate(instant, timeZone) {
|
|
|
9008
9063
|
return null;
|
|
9009
9064
|
}
|
|
9010
9065
|
}
|
|
9011
|
-
var existingBillingPeriod =
|
|
9012
|
-
anchor:
|
|
9066
|
+
var existingBillingPeriod = import_zod44.z.object({
|
|
9067
|
+
anchor: import_zod44.z.literal("existing_period"),
|
|
9013
9068
|
display_time_zone: ianaTimeZone,
|
|
9014
|
-
starts_on:
|
|
9069
|
+
starts_on: import_zod44.z.iso.date(),
|
|
9015
9070
|
starts_at: utcInstant.nullable(),
|
|
9016
9071
|
current_period_ends_at: utcInstant,
|
|
9017
9072
|
renews_at: utcInstant,
|
|
9018
|
-
effective:
|
|
9019
|
-
|
|
9020
|
-
|
|
9073
|
+
effective: import_zod44.z.discriminatedUnion("mode", [
|
|
9074
|
+
import_zod44.z.object({ mode: import_zod44.z.literal("on_confirmation"), quoted_as_of_at: utcInstant, local_date: import_zod44.z.iso.date() }).strict(),
|
|
9075
|
+
import_zod44.z.object({ mode: import_zod44.z.literal("scheduled"), at: utcInstant, at_period_end: import_zod44.z.boolean() }).strict()
|
|
9021
9076
|
])
|
|
9022
9077
|
}).strict().superRefine((period, ctx) => {
|
|
9023
9078
|
if (period.starts_at && localDate(period.starts_at, period.display_time_zone) !== period.starts_on)
|
|
@@ -9027,21 +9082,21 @@ var existingBillingPeriod = import_zod43.z.object({
|
|
|
9027
9082
|
if (period.effective.mode === "on_confirmation" && localDate(period.effective.quoted_as_of_at, period.display_time_zone) !== period.effective.local_date)
|
|
9028
9083
|
ctx.addIssue({ code: "custom", path: ["effective", "local_date"], message: "Quoted local date must match the display zone." });
|
|
9029
9084
|
});
|
|
9030
|
-
var firstPaymentPeriod =
|
|
9031
|
-
|
|
9032
|
-
anchor:
|
|
9033
|
-
cycle:
|
|
9034
|
-
start_statement:
|
|
9035
|
-
period_statement:
|
|
9085
|
+
var firstPaymentPeriod = import_zod44.z.discriminatedUnion("cycle", [
|
|
9086
|
+
import_zod44.z.strictObject({
|
|
9087
|
+
anchor: import_zod44.z.literal("on_first_successful_payment"),
|
|
9088
|
+
cycle: import_zod44.z.literal("monthly"),
|
|
9089
|
+
start_statement: import_zod44.z.literal("Starts when your first payment succeeds"),
|
|
9090
|
+
period_statement: import_zod44.z.literal("First billing period: one full month from successful payment; renews at the end of that period")
|
|
9036
9091
|
}),
|
|
9037
|
-
|
|
9038
|
-
anchor:
|
|
9039
|
-
cycle:
|
|
9040
|
-
start_statement:
|
|
9041
|
-
period_statement:
|
|
9092
|
+
import_zod44.z.strictObject({
|
|
9093
|
+
anchor: import_zod44.z.literal("on_first_successful_payment"),
|
|
9094
|
+
cycle: import_zod44.z.literal("yearly"),
|
|
9095
|
+
start_statement: import_zod44.z.literal("Starts when your first payment succeeds"),
|
|
9096
|
+
period_statement: import_zod44.z.literal("First billing period: one full year from successful payment; renews at the end of that period")
|
|
9042
9097
|
})
|
|
9043
9098
|
]);
|
|
9044
|
-
var billingDecisionPeriod =
|
|
9099
|
+
var billingDecisionPeriod = import_zod44.z.union([existingBillingPeriod, firstPaymentPeriod]);
|
|
9045
9100
|
function formatEur(cents3) {
|
|
9046
9101
|
if (!Number.isSafeInteger(cents3))
|
|
9047
9102
|
throw new Error(`formatEur: ${cents3} is not a whole number of cents`);
|
|
@@ -9133,10 +9188,10 @@ var labelRules = {
|
|
|
9133
9188
|
"C4-1168-cancel": { const: "Cancel at period end" },
|
|
9134
9189
|
"C4-1168-keep-basic": { const: "Delete the rest and stay on Basic" }
|
|
9135
9190
|
};
|
|
9136
|
-
var declaration =
|
|
9137
|
-
text_id:
|
|
9138
|
-
text:
|
|
9139
|
-
action_label:
|
|
9191
|
+
var declaration = import_zod44.z.object({
|
|
9192
|
+
text_id: import_zod44.z.enum(C4_TEXT_IDS).meta({ description: "The approved sentence this display shows, one per action." }),
|
|
9193
|
+
text: import_zod44.z.string().min(1).regex(/^By selecting “/).meta({ description: "The consent sentence shown directly above the button, naming the button." }),
|
|
9194
|
+
action_label: import_zod44.z.string().min(1).meta({ description: "The label of the one button that confirms this decision." }),
|
|
9140
9195
|
...legalLinks
|
|
9141
9196
|
}).strict().superRefine(separateLegalLinks).meta({
|
|
9142
9197
|
allOf: C4_TEXT_IDS.map((textId) => ({
|
|
@@ -9144,32 +9199,32 @@ var declaration = import_zod43.z.object({
|
|
|
9144
9199
|
then: { properties: { action_label: labelRules[textId] } }
|
|
9145
9200
|
}))
|
|
9146
9201
|
});
|
|
9147
|
-
var legacyDeclaration =
|
|
9148
|
-
text_id:
|
|
9149
|
-
text:
|
|
9202
|
+
var legacyDeclaration = import_zod44.z.object({
|
|
9203
|
+
text_id: import_zod44.z.literal(LEGACY_C4_TEXT_ID),
|
|
9204
|
+
text: import_zod44.z.string().min(1),
|
|
9150
9205
|
...legalLinks
|
|
9151
9206
|
}).strict().superRefine(separateLegalLinks);
|
|
9152
|
-
var snapshotBase =
|
|
9153
|
-
snapshot_id:
|
|
9154
|
-
decision_id:
|
|
9207
|
+
var snapshotBase = import_zod44.z.object({
|
|
9208
|
+
snapshot_id: import_zod44.z.uuid(),
|
|
9209
|
+
decision_id: import_zod44.z.uuid(),
|
|
9155
9210
|
operation_key: purchaseOperationKey,
|
|
9156
|
-
owner_id:
|
|
9157
|
-
organization_id:
|
|
9158
|
-
organization_name:
|
|
9211
|
+
owner_id: import_zod44.z.uuid(),
|
|
9212
|
+
organization_id: import_zod44.z.uuid(),
|
|
9213
|
+
organization_name: import_zod44.z.string().min(1),
|
|
9159
9214
|
...quoteIdentity,
|
|
9160
9215
|
amounts: billingDecisionAmounts,
|
|
9161
9216
|
period: billingDecisionPeriod,
|
|
9162
|
-
future_price_replacement:
|
|
9217
|
+
future_price_replacement: import_zod44.z.strictObject({ agreement_id: import_zod44.z.uuid(), text: import_zod44.z.string().min(1).regex(/\S/) }).nullable(),
|
|
9163
9218
|
declaration,
|
|
9164
9219
|
expires_at: utcInstant
|
|
9165
9220
|
}).strict();
|
|
9166
9221
|
var snapshotVariants = [
|
|
9167
|
-
snapshotBase.extend({ decision_kind:
|
|
9168
|
-
snapshotBase.extend({ decision_kind:
|
|
9169
|
-
snapshotBase.extend({ decision_kind:
|
|
9222
|
+
snapshotBase.extend({ decision_kind: import_zod44.z.literal("checkout"), selection: purchaseSelection }).strict(),
|
|
9223
|
+
snapshotBase.extend({ decision_kind: import_zod44.z.literal("paid_change"), selection: purchaseSelection, period: existingBillingPeriod }).strict(),
|
|
9224
|
+
snapshotBase.extend({ decision_kind: import_zod44.z.literal("plan_change"), selection: planChangeSelection, period: existingBillingPeriod }).strict()
|
|
9170
9225
|
];
|
|
9171
|
-
var storedDeclaration =
|
|
9172
|
-
var storedSnapshotVariants =
|
|
9226
|
+
var storedDeclaration = import_zod44.z.union([declaration, legacyDeclaration]);
|
|
9227
|
+
var storedSnapshotVariants = import_zod44.z.discriminatedUnion("decision_kind", [
|
|
9173
9228
|
snapshotVariants[0].extend({ declaration: storedDeclaration }).strict(),
|
|
9174
9229
|
snapshotVariants[1].extend({ declaration: storedDeclaration }).strict(),
|
|
9175
9230
|
snapshotVariants[2].extend({ declaration: storedDeclaration }).strict()
|
|
@@ -9221,9 +9276,9 @@ var snapshotRules = { allOf: ["monthly", "yearly"].map((cycle) => ({
|
|
|
9221
9276
|
if: { properties: { period: { properties: { anchor: { const: "on_first_successful_payment" }, cycle: { const: cycle } }, required: ["anchor", "cycle"] } }, required: ["period"] },
|
|
9222
9277
|
then: { properties: { selection: { properties: { cycle: { const: cycle } }, required: ["cycle"] } }, required: ["selection"] }
|
|
9223
9278
|
})) };
|
|
9224
|
-
var billingDecisionSnapshot =
|
|
9279
|
+
var billingDecisionSnapshot = import_zod44.z.discriminatedUnion("decision_kind", snapshotVariants).superRefine(refineSnapshot).meta(snapshotRules);
|
|
9225
9280
|
var storedBillingDecisionSnapshot = storedSnapshotVariants.superRefine(refineSnapshot).meta(snapshotRules);
|
|
9226
|
-
var billingDecisionDisplayResponse =
|
|
9281
|
+
var billingDecisionDisplayResponse = import_zod44.z.object({
|
|
9227
9282
|
confirmation_proof: confirmationProof,
|
|
9228
9283
|
expires_at: utcInstant,
|
|
9229
9284
|
snapshot: billingDecisionSnapshot
|
|
@@ -9231,8 +9286,8 @@ var billingDecisionDisplayResponse = import_zod43.z.object({
|
|
|
9231
9286
|
if (value.expires_at !== value.snapshot.expires_at)
|
|
9232
9287
|
ctx.addIssue({ code: "custom", path: ["expires_at"], message: "Display and snapshot expiry must match." });
|
|
9233
9288
|
});
|
|
9234
|
-
var planChangePrepareResponse =
|
|
9235
|
-
change_id:
|
|
9289
|
+
var planChangePrepareResponse = import_zod44.z.object({
|
|
9290
|
+
change_id: import_zod44.z.uuid(),
|
|
9236
9291
|
display: billingDecisionDisplayResponse
|
|
9237
9292
|
}).strict().superRefine((value, ctx) => {
|
|
9238
9293
|
if (value.display.snapshot.decision_kind !== "plan_change")
|
|
@@ -9241,20 +9296,20 @@ var planChangePrepareResponse = import_zod43.z.object({
|
|
|
9241
9296
|
ctx.addIssue({ code: "custom", path: ["display", "snapshot", "decision_id"], message: "Display must refer to the prepared change." });
|
|
9242
9297
|
}).meta({ allOf: [{ properties: { display: { properties: { snapshot: { properties: { decision_kind: { const: "plan_change" } } } } } } }] });
|
|
9243
9298
|
var intentIdentity = {
|
|
9244
|
-
intent_id:
|
|
9299
|
+
intent_id: import_zod44.z.uuid().meta({ description: "Opaque persisted purchase intent identity." }),
|
|
9245
9300
|
operation_key: purchaseOperationKey,
|
|
9246
9301
|
operation: chargeOperation,
|
|
9247
|
-
invoice_id:
|
|
9302
|
+
invoice_id: import_zod44.z.uuid().optional().meta({
|
|
9248
9303
|
description: "For an invoice-paying operation, the due charge or issued invoice being paid. For a confirmed paid_change with payment_started, the charge or invoice created for that decision; when the charge was issued through Lexware (`charged` is `null`), it identifies the matching billing.charges[].id. Absent on a paid_change in any other state."
|
|
9249
9304
|
})
|
|
9250
9305
|
};
|
|
9251
|
-
var purchaseHoldReason =
|
|
9306
|
+
var purchaseHoldReason = import_zod44.z.enum([
|
|
9252
9307
|
"legacy_usd_invoice",
|
|
9253
9308
|
"legacy_payer_unresolved",
|
|
9254
9309
|
"mandate_policy_unresolved",
|
|
9255
9310
|
"issuer_cutover_in_progress"
|
|
9256
9311
|
]);
|
|
9257
|
-
var purchaseRefusalRule =
|
|
9312
|
+
var purchaseRefusalRule = import_zod44.z.enum(["company_required", "vat_id_required", "vat_id_invalid", "tax_id_required", "us_state_required", "public_email_domain", "invoice_not_open"]);
|
|
9258
9313
|
var intentRules = [
|
|
9259
9314
|
{ if: { properties: { operation: { enum: ["invoice_payment", "payment_method_invoice"] } }, required: ["operation"] }, then: { required: ["invoice_id"] } },
|
|
9260
9315
|
{ if: { properties: { operation: { const: "mandate_setup" } }, required: ["operation"] }, then: { properties: { state: { enum: ["held", "payment_started"] } } } },
|
|
@@ -9279,49 +9334,49 @@ function validateIntent(intent, ctx) {
|
|
|
9279
9334
|
ctx.addIssue({ code: "custom", path: ["payment"], message: "Owner checkout, invoice payment and mandate setup require a hosted payment." });
|
|
9280
9335
|
}
|
|
9281
9336
|
}
|
|
9282
|
-
var awaitingVies = { ...intentIdentity, state:
|
|
9337
|
+
var awaitingVies = { ...intentIdentity, state: import_zod44.z.literal("awaiting_vies"), next_attempt_at: import_zod44.z.iso.datetime() };
|
|
9283
9338
|
var draftVariants = [
|
|
9284
9339
|
viesPending(awaitingVies),
|
|
9285
|
-
|
|
9286
|
-
|
|
9340
|
+
import_zod44.z.object({ ...intentIdentity, ...quoteIdentity, state: import_zod44.z.literal("eligible"), quote: purchaseQuote }).strict(),
|
|
9341
|
+
import_zod44.z.object({
|
|
9287
9342
|
...intentIdentity,
|
|
9288
9343
|
operation: purchaseOperation,
|
|
9289
|
-
state:
|
|
9344
|
+
state: import_zod44.z.literal("held"),
|
|
9290
9345
|
reason: purchaseHoldReason,
|
|
9291
|
-
original_amount:
|
|
9346
|
+
original_amount: import_zod44.z.object({ currency: planCurrency, gross_cents: purchaseCents }).strict().optional().meta({ description: "Recorded balance of a held invoice; not a new quote or authorization." })
|
|
9292
9347
|
}).strict(),
|
|
9293
|
-
|
|
9294
|
-
|
|
9348
|
+
import_zod44.z.object({ ...intentIdentity, state: import_zod44.z.literal("invalid_vat_id"), field: import_zod44.z.literal("billing.vat_id"), rule: import_zod44.z.literal("vat_id_invalid") }).strict(),
|
|
9349
|
+
import_zod44.z.object({ ...intentIdentity, state: import_zod44.z.literal("refused"), field: import_zod44.z.string().min(1), rule: purchaseRefusalRule }).strict()
|
|
9295
9350
|
];
|
|
9296
|
-
var purchaseIntentDraft =
|
|
9297
|
-
var paymentStartedVariant =
|
|
9351
|
+
var purchaseIntentDraft = import_zod44.z.discriminatedUnion("state", draftVariants).superRefine(validateIntent).meta({ allOf: intentRules });
|
|
9352
|
+
var paymentStartedVariant = import_zod44.z.object({
|
|
9298
9353
|
...intentIdentity,
|
|
9299
9354
|
operation: purchaseOperation,
|
|
9300
|
-
state:
|
|
9301
|
-
payment_id:
|
|
9302
|
-
payment:
|
|
9303
|
-
|
|
9304
|
-
|
|
9355
|
+
state: import_zod44.z.literal("payment_started"),
|
|
9356
|
+
payment_id: import_zod44.z.uuid(),
|
|
9357
|
+
payment: import_zod44.z.discriminatedUnion("kind", [
|
|
9358
|
+
import_zod44.z.object({ kind: import_zod44.z.literal("hosted"), checkout_id: import_zod44.z.uuid(), checkout_url: import_zod44.z.url() }).strict(),
|
|
9359
|
+
import_zod44.z.object({ kind: import_zod44.z.literal("mandate") }).strict()
|
|
9305
9360
|
])
|
|
9306
9361
|
}).strict();
|
|
9307
9362
|
var purchaseIntentPaymentStarted = paymentStartedVariant.superRefine(validateIntent).meta({ allOf: intentRules });
|
|
9308
|
-
var purchaseIntentAcceptedWithoutPayment =
|
|
9309
|
-
intent_id:
|
|
9363
|
+
var purchaseIntentAcceptedWithoutPayment = import_zod44.z.object({
|
|
9364
|
+
intent_id: import_zod44.z.uuid(),
|
|
9310
9365
|
operation_key: purchaseOperationKey,
|
|
9311
|
-
operation:
|
|
9312
|
-
state:
|
|
9366
|
+
operation: import_zod44.z.literal("paid_change"),
|
|
9367
|
+
state: import_zod44.z.literal("accepted_no_payment"),
|
|
9313
9368
|
...quoteIdentity,
|
|
9314
|
-
quote: purchaseQuote.extend({ net_cents:
|
|
9369
|
+
quote: purchaseQuote.extend({ net_cents: import_zod44.z.literal(0), vat_cents: import_zod44.z.literal(0), gross_cents: import_zod44.z.literal(0) }).strict(),
|
|
9315
9370
|
accepted_at: utcInstant
|
|
9316
9371
|
}).strict();
|
|
9317
|
-
var purchaseIntent =
|
|
9372
|
+
var purchaseIntent = import_zod44.z.discriminatedUnion("state", [
|
|
9318
9373
|
...draftVariants,
|
|
9319
9374
|
paymentStartedVariant,
|
|
9320
9375
|
purchaseIntentAcceptedWithoutPayment
|
|
9321
9376
|
]).superRefine(validateIntent).meta({ allOf: intentRules });
|
|
9322
9377
|
var nonChangeOperation = purchaseOperation.exclude(["paid_change"]);
|
|
9323
9378
|
var nonChangeChargeOperation = chargeOperation.exclude(["paid_change"]);
|
|
9324
|
-
var nonChangeDraft =
|
|
9379
|
+
var nonChangeDraft = import_zod44.z.discriminatedUnion("state", [
|
|
9325
9380
|
viesPending({ ...awaitingVies, operation: nonChangeChargeOperation }),
|
|
9326
9381
|
draftVariants[1].safeExtend({ operation: nonChangeChargeOperation }),
|
|
9327
9382
|
draftVariants[2].safeExtend({ operation: nonChangeOperation }),
|
|
@@ -9329,37 +9384,37 @@ var nonChangeDraft = import_zod43.z.discriminatedUnion("state", [
|
|
|
9329
9384
|
draftVariants[4].safeExtend({ operation: nonChangeChargeOperation })
|
|
9330
9385
|
]).superRefine(validateIntent).meta({ allOf: intentRules });
|
|
9331
9386
|
var nonChangePaymentStarted = paymentStartedVariant.safeExtend({ operation: nonChangeOperation }).superRefine(validateIntent).meta({ allOf: intentRules });
|
|
9332
|
-
var paidChangeOperation =
|
|
9333
|
-
var paidChangeDraft =
|
|
9387
|
+
var paidChangeOperation = import_zod44.z.literal("paid_change");
|
|
9388
|
+
var paidChangeDraft = import_zod44.z.discriminatedUnion("state", [
|
|
9334
9389
|
draftVariants[1].safeExtend({ operation: paidChangeOperation }),
|
|
9335
9390
|
draftVariants[2].safeExtend({ operation: paidChangeOperation }),
|
|
9336
9391
|
draftVariants[3].safeExtend({ operation: paidChangeOperation }),
|
|
9337
9392
|
draftVariants[4].safeExtend({ operation: paidChangeOperation })
|
|
9338
9393
|
]).superRefine(validateIntent).meta({ allOf: intentRules });
|
|
9339
|
-
var checkoutResponse =
|
|
9394
|
+
var checkoutResponse = import_zod44.z.union([nonChangeDraft, nonChangePaymentStarted]);
|
|
9340
9395
|
var checkoutIntentIdentity = {
|
|
9341
|
-
intent_id:
|
|
9396
|
+
intent_id: import_zod44.z.uuid().meta({ description: "The persisted checkout intent; confirm it with `POST /api/billing/intents/:id/confirm`." }),
|
|
9342
9397
|
operation_key: purchaseOperationKey,
|
|
9343
|
-
operation:
|
|
9398
|
+
operation: import_zod44.z.literal("checkout")
|
|
9344
9399
|
};
|
|
9345
|
-
var vatIdField =
|
|
9346
|
-
var checkoutStartResponse =
|
|
9347
|
-
|
|
9400
|
+
var vatIdField = import_zod44.z.literal("billing.vat_id");
|
|
9401
|
+
var checkoutStartResponse = import_zod44.z.discriminatedUnion("state", [
|
|
9402
|
+
import_zod44.z.object({
|
|
9348
9403
|
...checkoutIntentIdentity,
|
|
9349
|
-
state:
|
|
9404
|
+
state: import_zod44.z.literal("eligible"),
|
|
9350
9405
|
...quoteIdentity,
|
|
9351
9406
|
quote: purchaseQuote,
|
|
9352
9407
|
display: billingDecisionDisplayResponse
|
|
9353
9408
|
}).strict().meta({ description: "Eligible: the price is frozen and the display shown; one click on its button confirms." }),
|
|
9354
|
-
viesPending({ state:
|
|
9355
|
-
|
|
9356
|
-
|
|
9357
|
-
|
|
9358
|
-
|
|
9409
|
+
viesPending({ state: import_zod44.z.literal("vies_unavailable"), field: vatIdField }).meta({ description: "VIES did not confirm the VAT ID within its retries; with `vies_unavailable`, `vies_outage` says which side was down. Nothing is stored; check again." }),
|
|
9410
|
+
import_zod44.z.object({ state: import_zod44.z.literal("invalid_vat_id"), field: vatIdField, rule: import_zod44.z.literal("vat_id_invalid") }).strict().meta({ description: "VIES says the VAT ID is invalid. Nothing is stored." }),
|
|
9411
|
+
import_zod44.z.object({ state: import_zod44.z.literal("refused"), field: import_zod44.z.string().min(1), rule: purchaseRefusalRule }).strict().meta({ description: "A field the purchase cannot accept. Nothing is stored." }),
|
|
9412
|
+
import_zod44.z.object({ ...checkoutIntentIdentity, state: import_zod44.z.literal("held"), reason: import_zod44.z.literal("issuer_cutover_in_progress") }).strict().meta({ description: "An issuer cutover is running; try again in a few minutes." }),
|
|
9413
|
+
import_zod44.z.object({
|
|
9359
9414
|
...checkoutIntentIdentity,
|
|
9360
|
-
state:
|
|
9361
|
-
payment_id:
|
|
9362
|
-
payment:
|
|
9415
|
+
state: import_zod44.z.literal("payment_started"),
|
|
9416
|
+
payment_id: import_zod44.z.uuid(),
|
|
9417
|
+
payment: import_zod44.z.object({ kind: import_zod44.z.literal("hosted"), checkout_id: import_zod44.z.uuid(), checkout_url: import_zod44.z.url() }).strict()
|
|
9363
9418
|
}).strict().meta({ description: "The key was already confirmed: the hosted payment it started." })
|
|
9364
9419
|
]).superRefine((value, ctx) => {
|
|
9365
9420
|
if (value.state !== "eligible")
|
|
@@ -9383,29 +9438,29 @@ var checkoutStartResponse = import_zod43.z.discriminatedUnion("state", [
|
|
|
9383
9438
|
if: { properties: { state: { const: "eligible" } }, required: ["state"] },
|
|
9384
9439
|
then: { properties: { display: { properties: { snapshot: { properties: { decision_kind: { const: "checkout" } } } } } } }
|
|
9385
9440
|
}] });
|
|
9386
|
-
var checkoutDraft =
|
|
9387
|
-
plan:
|
|
9441
|
+
var checkoutDraft = import_zod44.z.object({
|
|
9442
|
+
plan: import_zod44.z.enum(["plus", "pro"]).meta({ description: "The plan last chosen on the checkout page." }),
|
|
9388
9443
|
cycle: billingCycle.meta({ description: "The cycle last chosen." }),
|
|
9389
9444
|
billing: purchaseBillingDetails.meta({ description: "The company details last sent to the checkout start." }),
|
|
9390
|
-
updated_at:
|
|
9445
|
+
updated_at: import_zod44.z.iso.datetime().meta({ description: "When the draft was last saved." })
|
|
9391
9446
|
}).strict();
|
|
9392
|
-
var checkoutDraftResponse =
|
|
9447
|
+
var checkoutDraftResponse = import_zod44.z.object({
|
|
9393
9448
|
draft: checkoutDraft.nullable().meta({ description: "The saved checkout draft, or `null`. Deleted once the checkout is paid." }),
|
|
9394
9449
|
prefill: billingDetails.nullable().meta({ description: "The org's earlier billing details when there is no draft, else `null`." })
|
|
9395
9450
|
}).strict().superRefine((value, ctx) => {
|
|
9396
9451
|
if (value.draft !== null && value.prefill !== null)
|
|
9397
9452
|
ctx.addIssue({ code: "custom", path: ["prefill"], message: "A draft answers alone; prefill is null beside it." });
|
|
9398
9453
|
}).meta({ not: { properties: { draft: { type: "object" }, prefill: { type: "object" } }, required: ["draft", "prefill"] } });
|
|
9399
|
-
var checkoutOpenDetails =
|
|
9400
|
-
field:
|
|
9401
|
-
rule:
|
|
9402
|
-
expires_at:
|
|
9403
|
-
checkout_url:
|
|
9454
|
+
var checkoutOpenDetails = import_zod44.z.object({
|
|
9455
|
+
field: import_zod44.z.literal("billing"),
|
|
9456
|
+
rule: import_zod44.z.literal("checkout_open"),
|
|
9457
|
+
expires_at: import_zod44.z.iso.datetime().nullable().meta({ description: "When the open payment expires at the provider, or `null` when unknown." }),
|
|
9458
|
+
checkout_url: import_zod44.z.url().nullable().meta({ description: "Where the open payment continues, or `null` when the provider no longer offers it." })
|
|
9404
9459
|
}).strict();
|
|
9405
|
-
var viesUnavailableDetails = viesPending({ field: vatIdField, rule:
|
|
9406
|
-
var purchaseIntentLookupQuery =
|
|
9460
|
+
var viesUnavailableDetails = viesPending({ field: vatIdField, rule: import_zod44.z.literal("vies_unavailable") });
|
|
9461
|
+
var purchaseIntentLookupQuery = import_zod44.z.object({
|
|
9407
9462
|
operation_key: purchaseOperationKey.optional().meta({ description: "The client operation key; supply this or intent_id, never both." }),
|
|
9408
|
-
intent_id:
|
|
9463
|
+
intent_id: import_zod44.z.uuid().optional().meta({ description: "The persisted intent ID; supply this or operation_key, never both." }),
|
|
9409
9464
|
operation: purchaseOperation.meta({ description: "Expected operation; a mismatch returns 404 without disclosure." })
|
|
9410
9465
|
}).strict().refine((q) => q.operation_key !== void 0 !== (q.intent_id !== void 0), {
|
|
9411
9466
|
message: "Supply exactly one of operation_key or intent_id."
|
|
@@ -9418,163 +9473,160 @@ var purchaseIntentLookupQuery = import_zod43.z.object({
|
|
|
9418
9473
|
});
|
|
9419
9474
|
var provedConfirmation = { operation_key: purchaseOperationKey, ...quoteIdentity, confirmation_proof: confirmationProof };
|
|
9420
9475
|
var invoiceConfirmation = { operation_key: purchaseOperationKey, ...quoteIdentity };
|
|
9421
|
-
var purchaseIntentConfirmRequest =
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
|
|
9476
|
+
var purchaseIntentConfirmRequest = import_zod44.z.discriminatedUnion("operation", [
|
|
9477
|
+
import_zod44.z.object({ ...provedConfirmation, operation: import_zod44.z.literal("checkout") }).strict(),
|
|
9478
|
+
import_zod44.z.object({ ...provedConfirmation, operation: import_zod44.z.literal("paid_change") }).strict(),
|
|
9479
|
+
import_zod44.z.object({ ...invoiceConfirmation, operation: import_zod44.z.literal("invoice_payment") }).strict(),
|
|
9480
|
+
import_zod44.z.object({ ...invoiceConfirmation, operation: import_zod44.z.literal("payment_method_invoice") }).strict()
|
|
9426
9481
|
]);
|
|
9427
|
-
var purchaseConflictDetails =
|
|
9428
|
-
|
|
9429
|
-
|
|
9430
|
-
|
|
9482
|
+
var purchaseConflictDetails = import_zod44.z.discriminatedUnion("rule", [
|
|
9483
|
+
import_zod44.z.object({ field: import_zod44.z.literal("operation_key"), rule: import_zod44.z.literal("operation_key_reused") }).strict(),
|
|
9484
|
+
import_zod44.z.object({ field: import_zod44.z.literal("confirmation_proof"), rule: import_zod44.z.literal("display_stale") }).strict().meta({ description: "The display was spent, expired or no longer matches: fetch a fresh one and press again." }),
|
|
9485
|
+
import_zod44.z.object({ field: import_zod44.z.literal("intent"), rule: import_zod44.z.enum(["stale_quote", "buyer_changed", "not_eligible", "invoice_not_open"]), current_intent: purchaseIntent }).strict()
|
|
9431
9486
|
]);
|
|
9432
|
-
var invoicePayRequest =
|
|
9433
|
-
var checkoutStatus =
|
|
9434
|
-
checkout_id:
|
|
9435
|
-
status:
|
|
9487
|
+
var invoicePayRequest = import_zod44.z.object({ operation_key: purchaseOperationKey }).strict();
|
|
9488
|
+
var checkoutStatus = import_zod44.z.object({
|
|
9489
|
+
checkout_id: import_zod44.z.uuid().meta({ description: "The checkout this status is for." }),
|
|
9490
|
+
status: import_zod44.z.enum(["pending", "paid", "failed", "canceled", "expired"]).meta({
|
|
9436
9491
|
description: "Mollie's payment status, as `reconcilePayment` last read it."
|
|
9437
9492
|
}),
|
|
9438
|
-
purpose:
|
|
9493
|
+
purpose: import_zod44.z.enum(["upgrade", "payment_method", "invoice"]).meta({
|
|
9439
9494
|
description: "What this checkout paid for: a plan upgrade, a payment-method change, or an open invoice."
|
|
9440
9495
|
}),
|
|
9441
9496
|
plan: planId.meta({ description: "The org's plan after applying \u2014 unchanged unless `purpose` is `upgrade` and `status` is `paid`." })
|
|
9442
9497
|
});
|
|
9443
|
-
var vatIdStatus =
|
|
9444
|
-
var vatIdCheckRequest =
|
|
9498
|
+
var vatIdStatus = import_zod44.z.enum(["valid", "unverified", "invalid", "unavailable"]);
|
|
9499
|
+
var vatIdCheckRequest = import_zod44.z.object({
|
|
9445
9500
|
country: countryCode.meta({ description: "The VAT ID's country." }),
|
|
9446
|
-
vat_id:
|
|
9501
|
+
vat_id: import_zod44.z.string().trim().min(1).max(20).meta({ description: "The VAT ID as typed; normalized before the VIES lookup (`normalizeVatId`)." })
|
|
9447
9502
|
}).strict();
|
|
9448
|
-
var vatCheckIdentity = { vat_id:
|
|
9449
|
-
var vatIdCheckResponse =
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
viesPending({ ...vatCheckIdentity, state:
|
|
9503
|
+
var vatCheckIdentity = { vat_id: import_zod44.z.string(), name: import_zod44.z.string().nullable() };
|
|
9504
|
+
var vatIdCheckResponse = import_zod44.z.discriminatedUnion("state", [
|
|
9505
|
+
import_zod44.z.object({ ...vatCheckIdentity, state: import_zod44.z.literal("eligible"), status: import_zod44.z.literal("valid") }).strict(),
|
|
9506
|
+
import_zod44.z.object({ ...vatCheckIdentity, state: import_zod44.z.literal("refused"), status: import_zod44.z.literal("invalid"), rule: import_zod44.z.literal("vat_id_invalid") }).strict(),
|
|
9507
|
+
viesPending({ ...vatCheckIdentity, state: import_zod44.z.literal("pending"), status: import_zod44.z.enum(["valid", "unverified", "unavailable"]) })
|
|
9453
9508
|
]);
|
|
9454
|
-
var billingChangeRequest =
|
|
9509
|
+
var billingChangeRequest = import_zod44.z.object({
|
|
9455
9510
|
operation_key: purchaseOperationKey,
|
|
9456
|
-
plan:
|
|
9511
|
+
plan: import_zod44.z.enum(["plus", "pro"]).optional().meta({ description: "The target plan. Omitted leaves the plan as it is." }),
|
|
9457
9512
|
cycle: billingCycle.optional().meta({ description: "The target cycle. Omitted leaves the cycle as it is." }),
|
|
9458
9513
|
addons: orgAddons.partial().strict().optional().meta({
|
|
9459
9514
|
description: "Absolute add-on counts to end up with, not a delta. Omitted leaves add-ons as they are."
|
|
9460
9515
|
})
|
|
9461
9516
|
}).strict().refine((r) => r.plan !== void 0 || r.cycle !== void 0 || r.addons !== void 0, { message: "Name a plan, a cycle or add-ons." });
|
|
9462
|
-
var billingCancelRequest =
|
|
9463
|
-
reason:
|
|
9517
|
+
var billingCancelRequest = import_zod44.z.object({
|
|
9518
|
+
reason: import_zod44.z.string().trim().max(500).optional().meta({ description: "An optional free-text reason. Shown to nobody but Fleetless." })
|
|
9464
9519
|
}).strict();
|
|
9465
|
-
var billingDetailsUpdate =
|
|
9466
|
-
company_name:
|
|
9520
|
+
var billingDetailsUpdate = import_zod44.z.object({
|
|
9521
|
+
company_name: import_zod44.z.string().trim().min(1).max(200).optional(),
|
|
9467
9522
|
address: billingAddress.optional(),
|
|
9468
|
-
tax_id:
|
|
9469
|
-
invoice_email:
|
|
9470
|
-
vat_id:
|
|
9523
|
+
tax_id: import_zod44.z.string().trim().max(100).nullable().optional(),
|
|
9524
|
+
invoice_email: import_zod44.z.email().optional().meta({ description: "Replaces the invoice email. Omitted leaves it as it is." }),
|
|
9525
|
+
vat_id: import_zod44.z.string().trim().max(20).nullable().optional().meta({
|
|
9471
9526
|
description: "Replaces the VAT ID; `null` clears it. Omitted leaves it as it is. A new ID is re-checked through VIES."
|
|
9472
9527
|
})
|
|
9473
9528
|
}).strict();
|
|
9474
|
-
var billingDetailsConflictDetails =
|
|
9475
|
-
|
|
9529
|
+
var billingDetailsConflictDetails = import_zod44.z.union([
|
|
9530
|
+
import_zod44.z.object({ field: import_zod44.z.string().min(1), rule: purchaseRefusalRule }).strict().meta({ description: "A field a purchase would refuse. Nothing is saved." }),
|
|
9476
9531
|
viesUnavailableDetails,
|
|
9477
|
-
|
|
9532
|
+
import_zod44.z.object({ field: import_zod44.z.literal("billing"), rule: import_zod44.z.literal("buyer_changed") }).strict().meta({ description: "The billing details changed meanwhile. Nothing is saved." })
|
|
9478
9533
|
]);
|
|
9479
|
-
var paymentMethodKind =
|
|
9480
|
-
var paymentMethodChangeRequest =
|
|
9481
|
-
operation_key: purchaseOperationKey
|
|
9482
|
-
method: paymentMethodKind.meta({
|
|
9483
|
-
description: "The new mandate's method. Offer what `billingView.payment_method_options` lists: `applepay` may be refused with `400 validation_error` `{ field: 'method', rule: 'applepay_needs_open_invoice' }` unless an invoice is open."
|
|
9484
|
-
})
|
|
9534
|
+
var paymentMethodKind = import_zod44.z.enum(["card", "paypal", "applepay"]);
|
|
9535
|
+
var paymentMethodChangeRequest = import_zod44.z.object({
|
|
9536
|
+
operation_key: purchaseOperationKey
|
|
9485
9537
|
}).strict();
|
|
9486
|
-
var billingAccountStatus =
|
|
9487
|
-
var paymentMethod =
|
|
9488
|
-
|
|
9489
|
-
kind:
|
|
9490
|
-
brand:
|
|
9491
|
-
last4:
|
|
9492
|
-
expires:
|
|
9493
|
-
}),
|
|
9494
|
-
|
|
9495
|
-
kind:
|
|
9496
|
-
brand:
|
|
9497
|
-
last4:
|
|
9498
|
-
expires:
|
|
9499
|
-
}),
|
|
9500
|
-
|
|
9501
|
-
kind:
|
|
9502
|
-
account:
|
|
9538
|
+
var billingAccountStatus = import_zod44.z.enum(["pending", "active", "past_due", "canceled"]);
|
|
9539
|
+
var paymentMethod = import_zod44.z.discriminatedUnion("kind", [
|
|
9540
|
+
import_zod44.z.object({
|
|
9541
|
+
kind: import_zod44.z.literal("card").meta({ description: "A card mandate." }),
|
|
9542
|
+
brand: import_zod44.z.string().meta({ description: "The card network, as Mollie's mandate reports it, e.g. 'Visa'." }),
|
|
9543
|
+
last4: import_zod44.z.string().regex(/^\d{4}$/).meta({ description: "The last four digits of the card." }),
|
|
9544
|
+
expires: import_zod44.z.string().regex(/^\d{2}\/\d{2}$/).meta({ description: "Expiry as Mollie's mandate shows it, 'MM/YY'." })
|
|
9545
|
+
}),
|
|
9546
|
+
import_zod44.z.object({
|
|
9547
|
+
kind: import_zod44.z.literal("applepay").meta({ description: "A card mandate from an Apple Pay first payment \u2014 Mollie stores it as `creditcard`; Fleetless labels it Apple Pay." }),
|
|
9548
|
+
brand: import_zod44.z.string().meta({ description: "The card network, as Mollie's mandate reports it, e.g. 'Mastercard'." }),
|
|
9549
|
+
last4: import_zod44.z.string().regex(/^\d{4}$/).meta({ description: "The last four digits of the card behind Apple Pay." }),
|
|
9550
|
+
expires: import_zod44.z.string().regex(/^\d{2}\/\d{2}$/).meta({ description: "Expiry as Mollie's mandate shows it, 'MM/YY'." })
|
|
9551
|
+
}),
|
|
9552
|
+
import_zod44.z.object({
|
|
9553
|
+
kind: import_zod44.z.literal("paypal").meta({ description: "A PayPal mandate." }),
|
|
9554
|
+
account: import_zod44.z.string().meta({ description: "The PayPal account Mollie's mandate names." })
|
|
9503
9555
|
})
|
|
9504
9556
|
]);
|
|
9505
|
-
var invoiceStatus =
|
|
9506
|
-
var billingInvoice =
|
|
9507
|
-
id:
|
|
9508
|
-
number:
|
|
9557
|
+
var invoiceStatus = import_zod44.z.enum(["open", "paid", "uncollectible", "cancelled"]);
|
|
9558
|
+
var billingInvoice = import_zod44.z.object({
|
|
9559
|
+
id: import_zod44.z.uuid().meta({ description: "The invoice's id." }),
|
|
9560
|
+
number: import_zod44.z.string().regex(/^FL-\d{4}-\d{4,}$/).meta({
|
|
9509
9561
|
description: "The invoice number: `FL-<year>-<seq>`, `seq` zero-padded to four digits, gapless per calendar year in `Europe/Berlin`."
|
|
9510
9562
|
}),
|
|
9511
|
-
issued_at:
|
|
9563
|
+
issued_at: import_zod44.z.iso.datetime().meta({ description: "When the invoice was issued." }),
|
|
9512
9564
|
status: invoiceStatus.meta({ description: "This invoice's own status." }),
|
|
9513
|
-
cancellation_document_url:
|
|
9565
|
+
cancellation_document_url: import_zod44.z.string().nullable().meta({
|
|
9514
9566
|
description: "Cloud always returns `null` for this field, including cancelled historical Cloud invoices. Cancellation documents are held in Lexware."
|
|
9515
9567
|
}),
|
|
9516
9568
|
currency: planCurrency.meta({ description: "The org's billing currency." }),
|
|
9517
|
-
net_cents:
|
|
9518
|
-
vat_rate_percent:
|
|
9519
|
-
vat_cents:
|
|
9520
|
-
gross_cents:
|
|
9569
|
+
net_cents: import_zod44.z.number().int().nonnegative().meta({ description: "The charge, excluding VAT, in integer cents." }),
|
|
9570
|
+
vat_rate_percent: import_zod44.z.number().int().min(0).max(100).meta({ description: "The VAT rate applied, in whole percent." }),
|
|
9571
|
+
vat_cents: import_zod44.z.number().int().nonnegative().meta({ description: "VAT, in integer cents (`vatCents`)." }),
|
|
9572
|
+
gross_cents: import_zod44.z.number().int().nonnegative().meta({ description: "Net plus VAT, in integer cents." })
|
|
9521
9573
|
});
|
|
9522
|
-
var billingInvoicePdfQuery =
|
|
9523
|
-
kind:
|
|
9574
|
+
var billingInvoicePdfQuery = import_zod44.z.object({
|
|
9575
|
+
kind: import_zod44.z.enum(["invoice", "cancellation"]).optional().meta({ description: "Omitted or `invoice` selects the original invoice PDF. `cancellation` is accepted but returns `404 not_found`: Cloud has no cancellation PDFs." })
|
|
9524
9576
|
}).strict();
|
|
9525
|
-
var billingAccount =
|
|
9577
|
+
var billingAccount = import_zod44.z.object({
|
|
9526
9578
|
payer: billingDetails.meta({ description: "Who is paying, and the invoice address and email." }),
|
|
9527
9579
|
vat_id_status: vatIdStatus.nullable().meta({ description: "The payer's VAT ID check, or `null` when no VAT ID was given." }),
|
|
9528
|
-
vat:
|
|
9580
|
+
vat: import_zod44.z.object({
|
|
9529
9581
|
treatment: vatTreatment.meta({ description: "How the account is taxed." }),
|
|
9530
|
-
rate_percent:
|
|
9582
|
+
rate_percent: import_zod44.z.number().int().meta({ description: "The VAT rate, in whole percent." })
|
|
9531
9583
|
}).nullable().meta({ description: "Recorded VAT treatment; null while the current buyer has no eligible decision. Never infer zero rating from a pending account." }),
|
|
9532
9584
|
currency: planCurrency.meta({ description: "The org's billing currency, fixed at the first payment." }),
|
|
9533
9585
|
cycle: billingCycle.meta({ description: "The current billing cycle." }),
|
|
9534
9586
|
status: billingAccountStatus.meta({ description: "The account's own status." }),
|
|
9535
|
-
period_starts_at:
|
|
9536
|
-
period_ends_at:
|
|
9537
|
-
next_charge:
|
|
9538
|
-
at:
|
|
9539
|
-
net_cents:
|
|
9540
|
-
vat_cents:
|
|
9541
|
-
gross_cents:
|
|
9587
|
+
period_starts_at: import_zod44.z.iso.datetime().nullable().meta({ description: "The current period's start. `null` before the first payment." }),
|
|
9588
|
+
period_ends_at: import_zod44.z.iso.datetime().nullable().meta({ description: "The current period's end. `null` before the first payment." }),
|
|
9589
|
+
next_charge: import_zod44.z.object({
|
|
9590
|
+
at: import_zod44.z.iso.datetime().meta({ description: "When the next charge is due." }),
|
|
9591
|
+
net_cents: import_zod44.z.number().int().meta({ description: "The next charge, excluding VAT, in integer cents." }),
|
|
9592
|
+
vat_cents: import_zod44.z.number().int().meta({ description: "VAT on the next charge, in integer cents." }),
|
|
9593
|
+
gross_cents: import_zod44.z.number().int().meta({ description: "The next charge including VAT, in integer cents." })
|
|
9542
9594
|
}).nullable().meta({ description: "`null` while a cancel is pending or nothing else renews." }),
|
|
9543
|
-
current_price:
|
|
9544
|
-
net_cents:
|
|
9595
|
+
current_price: import_zod44.z.object({
|
|
9596
|
+
net_cents: import_zod44.z.number().int().meta({
|
|
9545
9597
|
description: "One period of the current plan, cycle and add-ons at the agreed price, excluding VAT, in integer cents."
|
|
9546
9598
|
})
|
|
9547
9599
|
}).nullable().meta({
|
|
9548
9600
|
description: "What one period (`cycle`) of the current plan costs this organization: the price it agreed, which stays when the catalogue changes. Show this, not the catalogue price, as the price of a billed organization. `null` when no agreed price is recorded for the current plan, cycle and add-ons."
|
|
9549
9601
|
}),
|
|
9550
|
-
scheduled:
|
|
9602
|
+
scheduled: import_zod44.z.object({
|
|
9551
9603
|
cycle: billingCycle.nullable().meta({ description: "A cycle change queued for the period's end, or `null`." }),
|
|
9552
9604
|
addons: orgAddons.nullable().meta({ description: "Add-on counts queued for the period's end, or `null`." })
|
|
9553
9605
|
}).meta({ description: "What takes effect at the period's end." }),
|
|
9554
|
-
dunning:
|
|
9555
|
-
invoice_id:
|
|
9606
|
+
dunning: import_zod44.z.object({
|
|
9607
|
+
invoice_id: import_zod44.z.uuid().meta({
|
|
9556
9608
|
description: "What dunning is chasing: a historical open `FL-\u2026` invoice, or a due charge. Before the issuer cutover a due charge appears here only while the payer's VAT ID is unsettled; it has no number yet, is not in `invoices`, and `POST /api/billing/invoices/:id/pay` takes either. After the cutover this is always a due charge (in `charges`): pay it with `POST /api/billing/charges/:id/pay`."
|
|
9557
9609
|
}),
|
|
9558
|
-
gross_cents:
|
|
9610
|
+
gross_cents: import_zod44.z.number().int().meta({
|
|
9559
9611
|
description: "The amount owed, in integer cents \u2014 after a partial chargeback only the charged-back part."
|
|
9560
9612
|
}),
|
|
9561
|
-
due_at:
|
|
9562
|
-
next_retry_at:
|
|
9613
|
+
due_at: import_zod44.z.iso.datetime().meta({ description: "The charge's due date; retries and the lock count from here." }),
|
|
9614
|
+
next_retry_at: import_zod44.z.iso.datetime().nullable().meta({
|
|
9563
9615
|
description: "The next automatic retry, or `null` once retries are exhausted. Always `null` after a chargeback: a charged-back payment is never charged again automatically."
|
|
9564
9616
|
}),
|
|
9565
|
-
lock_at:
|
|
9566
|
-
failure:
|
|
9617
|
+
lock_at: import_zod44.z.iso.datetime().meta({ description: "When the org is locked if still unpaid (`BILLING_LOCK_DAY`)." }),
|
|
9618
|
+
failure: import_zod44.z.string().nullable().meta({
|
|
9567
9619
|
description: "Mollie's own reason, e.g. 'card_expired'; 'vat_id_invalid' while a renewal is held because VIES does not confirm the VAT ID; 'charged_back' after a chargeback or a lost PayPal dispute."
|
|
9568
9620
|
})
|
|
9569
9621
|
}).nullable().meta({ description: "`null` while nothing is overdue. During a VAT-ID hold the charge is due but not yet invoiced." })
|
|
9570
9622
|
});
|
|
9571
|
-
var billingIssuer =
|
|
9572
|
-
var billingChargeInvoice =
|
|
9573
|
-
|
|
9574
|
-
|
|
9575
|
-
|
|
9576
|
-
state:
|
|
9577
|
-
document_id:
|
|
9623
|
+
var billingIssuer = import_zod44.z.enum(["cloud", "lexware"]);
|
|
9624
|
+
var billingChargeInvoice = import_zod44.z.discriminatedUnion("state", [
|
|
9625
|
+
import_zod44.z.object({ state: import_zod44.z.literal("not_issued").meta({ description: "Not collected (due, a failed retry, or uncollectible): no invoice exists." }) }).strict(),
|
|
9626
|
+
import_zod44.z.object({ state: import_zod44.z.literal("pending").meta({ description: "Collected; the Lexware invoice is not yet confirmed." }) }).strict(),
|
|
9627
|
+
import_zod44.z.object({
|
|
9628
|
+
state: import_zod44.z.literal("issued").meta({ description: "Lexware has confirmed the invoice." }),
|
|
9629
|
+
document_id: import_zod44.z.uuid().meta({ description: "The Lexware document's id \u2014 read it with `GET /api/billing/documents/:id`." })
|
|
9578
9630
|
}).strict()
|
|
9579
9631
|
]);
|
|
9580
9632
|
var chargeInvoiceRules = [
|
|
@@ -9587,55 +9639,54 @@ function refuseChargeInvoiceMismatch(charge, ctx) {
|
|
|
9587
9639
|
ctx.addIssue({ code: "custom", path: ["invoice"], message: "A paid charge has an invoice (pending or issued); every other status has none yet." });
|
|
9588
9640
|
}
|
|
9589
9641
|
}
|
|
9590
|
-
var billingCharge =
|
|
9591
|
-
id:
|
|
9592
|
-
kind:
|
|
9593
|
-
status:
|
|
9642
|
+
var billingCharge = import_zod44.z.object({
|
|
9643
|
+
id: import_zod44.z.uuid().meta({ description: "The due charge's id \u2014 never a Cloud invoice number. Pay it with `POST /api/billing/charges/:id/pay`." }),
|
|
9644
|
+
kind: import_zod44.z.enum(["first", "renewal", "change"]).meta({ description: "What caused the charge: the first charge after checkout, a scheduled renewal, or a mid-period plan change." }),
|
|
9645
|
+
status: import_zod44.z.enum(["due", "paid", "uncollectible", "cancelled"]).meta({
|
|
9594
9646
|
description: "The charge's own status. A charged back or manually refunded charge stays `paid` \u2014 refunds and chargebacks are handled in Mollie or Lexware by hand; this status and the invoice it names are unchanged, and the resulting Lexware credit note appears under `GET /api/billing/documents` instead."
|
|
9595
9647
|
}),
|
|
9596
|
-
currency:
|
|
9597
|
-
net_cents:
|
|
9598
|
-
vat_rate_percent:
|
|
9599
|
-
vat_cents:
|
|
9600
|
-
gross_cents:
|
|
9601
|
-
period_start:
|
|
9602
|
-
period_end:
|
|
9603
|
-
due_at:
|
|
9604
|
-
paid_at:
|
|
9648
|
+
currency: import_zod44.z.literal("eur").meta({ description: "Every charge billed through Lexware is EUR." }),
|
|
9649
|
+
net_cents: import_zod44.z.number().int().nonnegative().meta({ description: "The charge, excluding VAT, in integer cents." }),
|
|
9650
|
+
vat_rate_percent: import_zod44.z.number().int().min(0).max(100).meta({ description: "The VAT rate applied, in whole percent." }),
|
|
9651
|
+
vat_cents: import_zod44.z.number().int().nonnegative().meta({ description: "VAT, in integer cents (`vatCents`)." }),
|
|
9652
|
+
gross_cents: import_zod44.z.number().int().nonnegative().meta({ description: "Net plus VAT, in integer cents." }),
|
|
9653
|
+
period_start: import_zod44.z.iso.datetime().meta({ description: "The covered period's start." }),
|
|
9654
|
+
period_end: import_zod44.z.iso.datetime().meta({ description: "The covered period's end." }),
|
|
9655
|
+
due_at: import_zod44.z.iso.datetime().meta({ description: "When this charge is due." }),
|
|
9656
|
+
paid_at: import_zod44.z.iso.datetime().nullable().meta({ description: "When this charge was paid, or `null` while unpaid." }),
|
|
9605
9657
|
invoice: billingChargeInvoice.meta({ description: "Whether a Lexware invoice exists for this charge yet, and which document it names once it does." })
|
|
9606
9658
|
}).strict().superRefine(refuseChargeInvoiceMismatch).meta({ allOf: chargeInvoiceRules });
|
|
9607
9659
|
var chargePayRequest = invoicePayRequest;
|
|
9608
|
-
var billingView =
|
|
9609
|
-
available:
|
|
9660
|
+
var billingView = import_zod44.z.object({
|
|
9661
|
+
available: import_zod44.z.boolean().meta({ description: "Whether this cloud takes payments at all \u2014 `false` when no Mollie key is configured." }),
|
|
9610
9662
|
account: billingAccount.nullable().meta({ description: "`null` before the org has ever checked out." }),
|
|
9611
9663
|
payment_method: paymentMethod.nullable().meta({ description: "The payment method on file, or `null`." }),
|
|
9612
|
-
payment_method_options:
|
|
9613
|
-
method: paymentMethodKind.meta({ description: "A method
|
|
9614
|
-
pays_invoice: import_zod43.z.boolean().meta({ description: "Whether changing to it also pays the open invoice \u2014 `true` only for `applepay` when a zero-amount Apple Pay payment is not available." })
|
|
9664
|
+
payment_method_options: import_zod44.z.array(import_zod44.z.object({
|
|
9665
|
+
method: paymentMethodKind.meta({ description: "A method Mollie's page offers for a change started now." })
|
|
9615
9666
|
})).meta({
|
|
9616
|
-
description: "
|
|
9667
|
+
description: "The methods a payment-method change offers on Mollie's page right now, where the payer chooses one: card and PayPal, and Apple Pay where this cloud takes a zero-amount Apple Pay payment. `[]` when no change is possible: the org has no active or past-due billing account."
|
|
9617
9668
|
}),
|
|
9618
9669
|
issuer: billingIssuer.meta({ description: "Which system issues this org's charges: `cloud` before the issuer cutover, or `lexware` after it." }),
|
|
9619
|
-
invoices:
|
|
9620
|
-
charges:
|
|
9670
|
+
invoices: import_zod44.z.array(billingInvoice).meta({ description: "Cloud-issued invoices from before the issuer cutover; read-only, never grows after it. Newest first, at most 24." }),
|
|
9671
|
+
charges: import_zod44.z.array(billingCharge).meta({
|
|
9621
9672
|
description: "Newest first, at most 24. Lists only due charges with issuer `lexware` \u2014 never a pre-cutover charge, a legacy payment (legacy_issued/legacy_held/legacy_person/legacy_usd) or a late USD collection: none of those carry a Lexware intent, and they stay in `invoices` or nowhere. `[]` while `issuer` is `cloud`."
|
|
9622
9673
|
})
|
|
9623
9674
|
});
|
|
9624
|
-
var billingDocumentKind =
|
|
9625
|
-
var billingDocumentStatus =
|
|
9626
|
-
var billingDocumentProfile =
|
|
9627
|
-
var billingDocumentFormat =
|
|
9628
|
-
var billingDocumentBase =
|
|
9629
|
-
id:
|
|
9675
|
+
var billingDocumentKind = import_zod44.z.enum(["invoice", "credit_note", "down_payment_invoice", "bookkeeping_invoice", "bookkeeping_credit_note"]);
|
|
9676
|
+
var billingDocumentStatus = import_zod44.z.enum(["open", "overdue", "paid", "paidoff", "voided", "transferred", "sepadebit"]);
|
|
9677
|
+
var billingDocumentProfile = import_zod44.z.enum(["NONE", "EN16931", "XRechnung"]);
|
|
9678
|
+
var billingDocumentFormat = import_zod44.z.enum(["pdf", "xml"]);
|
|
9679
|
+
var billingDocumentBase = import_zod44.z.object({
|
|
9680
|
+
id: import_zod44.z.uuid().meta({ description: "The Lexware voucher id. Opaque; read the document or its file by this id, never a locally invented one." }),
|
|
9630
9681
|
kind: billingDocumentKind.meta({ description: "The document's kind." }),
|
|
9631
9682
|
status: billingDocumentStatus.meta({ description: "The document's own status." }),
|
|
9632
|
-
number:
|
|
9633
|
-
document_date:
|
|
9634
|
-
currency:
|
|
9635
|
-
gross_cents:
|
|
9683
|
+
number: import_zod44.z.string().nullable().meta({ description: "The Lexware voucher number, for display only \u2014 never a key to read by. `null` for a voucher Lexware has not numbered." }),
|
|
9684
|
+
document_date: import_zod44.z.iso.datetime({ offset: true }).meta({ description: "The date printed on the document." }),
|
|
9685
|
+
currency: import_zod44.z.literal("EUR").meta({ description: "Every Lexware voucher this reads is EUR; nothing here reads a foreign-currency voucher." }),
|
|
9686
|
+
gross_cents: import_zod44.z.number().int().meta({
|
|
9636
9687
|
description: "The gross amount, in integer cents, signed by `kind` and never by the sign Lexware itself reports: `credit_note` and `bookkeeping_credit_note` are zero or negative, every other kind is zero or positive."
|
|
9637
9688
|
}),
|
|
9638
|
-
file:
|
|
9689
|
+
file: import_zod44.z.enum(["available", "unavailable"]).meta({ description: "Whether Lexware holds a file for this document at all." })
|
|
9639
9690
|
});
|
|
9640
9691
|
function refuseWrongGrossSign(doc, ctx) {
|
|
9641
9692
|
const isCredit = doc.kind === "credit_note" || doc.kind === "bookkeeping_credit_note";
|
|
@@ -9647,18 +9698,18 @@ function refuseWrongGrossSign(doc, ctx) {
|
|
|
9647
9698
|
}
|
|
9648
9699
|
}
|
|
9649
9700
|
var billingDocument = billingDocumentBase.strict().superRefine(refuseWrongGrossSign);
|
|
9650
|
-
var billingDocumentList =
|
|
9651
|
-
available:
|
|
9652
|
-
complete:
|
|
9653
|
-
unsupported_count:
|
|
9654
|
-
documents:
|
|
9701
|
+
var billingDocumentList = import_zod44.z.object({
|
|
9702
|
+
available: import_zod44.z.boolean().meta({ description: "Whether this cloud can list Lexware documents at all for this org \u2014 `false` when this cloud has no Lexware configured, its Lexware account failed the account check, or the org has no Lexware contact." }),
|
|
9703
|
+
complete: import_zod44.z.boolean().meta({ description: "`false` when a document of an unsupported type or status was skipped rather than listed, counted in `unsupported_count`." }),
|
|
9704
|
+
unsupported_count: import_zod44.z.number().int().nonnegative().meta({ description: "How many documents of an unsupported type or status were skipped; `complete` is `false` whenever this is above zero." }),
|
|
9705
|
+
documents: import_zod44.z.array(billingDocument).meta({ description: "Every supported document this org has, complete or not \u2014 never a truncated page." })
|
|
9655
9706
|
}).strict().superRefine((list, ctx) => {
|
|
9656
9707
|
if (!list.available && (list.documents.length > 0 || !list.complete || list.unsupported_count > 0)) {
|
|
9657
9708
|
ctx.addIssue({ code: "custom", path: ["available"], message: "available: false carries no documents, is complete and has no unsupported document." });
|
|
9658
9709
|
}
|
|
9659
9710
|
});
|
|
9660
|
-
var billingDocumentFileRole =
|
|
9661
|
-
var billingDocumentFormatEntry =
|
|
9711
|
+
var billingDocumentFileRole = import_zod44.z.enum(["e_invoice", "preview", "document"]);
|
|
9712
|
+
var billingDocumentFormatEntry = import_zod44.z.object({ format: billingDocumentFormat, role: billingDocumentFileRole }).strict();
|
|
9662
9713
|
function sameFormats(a, b) {
|
|
9663
9714
|
return a.length === b.length && a.every((entry2, i) => entry2.format === b[i].format && entry2.role === b[i].role);
|
|
9664
9715
|
}
|
|
@@ -9670,14 +9721,14 @@ function refuseWrongFormats(doc, ctx) {
|
|
|
9670
9721
|
}
|
|
9671
9722
|
var billingDocumentDetail = billingDocumentBase.extend({
|
|
9672
9723
|
electronic_document_profile: billingDocumentProfile.nullable().meta({ description: "The e-invoice profile, or `null` for a bookkeeping voucher \u2014 it has none." }),
|
|
9673
|
-
formats:
|
|
9724
|
+
formats: import_zod44.z.array(billingDocumentFormatEntry).meta({
|
|
9674
9725
|
description: '`NONE`: `[{ format: "pdf", role: "document" }]`. `EN16931`: `[{ format: "pdf", role: "e_invoice" }]`. `XRechnung`: `[{ format: "xml", role: "e_invoice" }, { format: "pdf", role: "preview" }]`. `null` profile: `[{ format: "pdf", role: "document" }]` when `file` is `available`, otherwise `[]`.'
|
|
9675
9726
|
})
|
|
9676
9727
|
}).strict().superRefine((doc, ctx) => {
|
|
9677
9728
|
refuseWrongGrossSign(doc, ctx);
|
|
9678
9729
|
refuseWrongFormats(doc, ctx);
|
|
9679
9730
|
});
|
|
9680
|
-
var billingDocumentFileQuery =
|
|
9731
|
+
var billingDocumentFileQuery = import_zod44.z.object({
|
|
9681
9732
|
format: billingDocumentFormat.default("pdf").meta({ description: "The file format to read. `xml` answers `404` unless the document is `XRechnung`." })
|
|
9682
9733
|
}).strict();
|
|
9683
9734
|
var acceptedBillingFields = {
|
|
@@ -9686,30 +9737,30 @@ var acceptedBillingFields = {
|
|
|
9686
9737
|
description: "The Fleetless invoice charged now, or `null` when nothing was charged now (a change scheduled for the period end, or an increase that cost nothing) or the change was charged through Lexware (then the charge is in `billing.charges`)."
|
|
9687
9738
|
})
|
|
9688
9739
|
};
|
|
9689
|
-
var acceptedPaidChange =
|
|
9740
|
+
var acceptedPaidChange = import_zod44.z.object({
|
|
9690
9741
|
...acceptedBillingFields,
|
|
9691
|
-
intent: paymentStartedVariant.safeExtend({ operation:
|
|
9742
|
+
intent: paymentStartedVariant.safeExtend({ operation: import_zod44.z.literal("paid_change") })
|
|
9692
9743
|
}).strict();
|
|
9693
|
-
var acceptedNoPaymentChange =
|
|
9744
|
+
var acceptedNoPaymentChange = import_zod44.z.object({
|
|
9694
9745
|
billing: billingView,
|
|
9695
|
-
charged:
|
|
9746
|
+
charged: import_zod44.z.null().meta({
|
|
9696
9747
|
description: "Always `null`: nothing was charged now (a scheduled change or an increase that cost nothing)."
|
|
9697
9748
|
}),
|
|
9698
9749
|
intent: purchaseIntentAcceptedWithoutPayment
|
|
9699
9750
|
}).strict();
|
|
9700
|
-
var billingChangeResponse =
|
|
9701
|
-
|
|
9751
|
+
var billingChangeResponse = import_zod44.z.union([
|
|
9752
|
+
import_zod44.z.object({ intent: paidChangeDraft }).strict(),
|
|
9702
9753
|
acceptedPaidChange,
|
|
9703
9754
|
acceptedNoPaymentChange
|
|
9704
9755
|
]);
|
|
9705
|
-
var purchaseIntentResponse =
|
|
9756
|
+
var purchaseIntentResponse = import_zod44.z.union([
|
|
9706
9757
|
purchaseIntentDraft,
|
|
9707
9758
|
nonChangePaymentStarted,
|
|
9708
9759
|
acceptedPaidChange,
|
|
9709
9760
|
acceptedNoPaymentChange
|
|
9710
9761
|
]);
|
|
9711
9762
|
|
|
9712
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
9763
|
+
// node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/routes.js
|
|
9713
9764
|
var MCP_APP = MCP_APP_PATHS(":appIdentifier");
|
|
9714
9765
|
var APP_IDENTIFIER = {
|
|
9715
9766
|
name: "appIdentifier",
|
|
@@ -13246,7 +13297,7 @@ var ROUTES = [
|
|
|
13246
13297
|
response: liveSessionResponse,
|
|
13247
13298
|
errors: [...CLIENT_GUARD, "invalid_uuid", "not_found", "robot_offline", "camera_offline", "live_unavailable"],
|
|
13248
13299
|
transport: "http",
|
|
13249
|
-
notes: "Refcounted: the first viewer starts the robot publishing and the last release stops it. No token is ever minted for an ungranted or offline camera \u2014 both refusals return before the hold is taken. `409 camera_offline` means the **robot itself** reported the failure; `502 live_unavailable` means this cloud could not start the stream. The difference matters, and it is why a failure the robot named is never dressed up as one this side invented."
|
|
13300
|
+
notes: "Refcounted: the first viewer starts the robot publishing and the last release stops it. No token is ever minted for an ungranted or offline camera \u2014 both refusals return before the hold is taken. `409 camera_offline` means the **robot itself** reported the failure; `502 live_unavailable` means this cloud could not start the stream. The difference matters, and it is why a failure the robot named is never dressed up as one this side invented. The `409` carries `details.refusal` (`cameraOfflineDetails`) and the cloud's fixed sentence for it as `message`, never the robot's own words. A start the robot refuses after the `201` ends the session with a `live_session` frame, reason `start_refused`, the same sentence as `detail` and the class as `refusal`; the next viewer of an emptied room gets a fresh try."
|
|
13250
13301
|
},
|
|
13251
13302
|
{
|
|
13252
13303
|
method: "DELETE",
|
|
@@ -13905,7 +13956,7 @@ var ROUTES = [
|
|
|
13905
13956
|
response: checkoutResponse,
|
|
13906
13957
|
errors: ["target_state_conflict", ...DEVELOPER_GUARD, "tier_required", "support_forbidden", "validation_error", "not_found", "rate_limited", ...BILLING_OFF, ...MOLLIE],
|
|
13907
13958
|
transport: "http",
|
|
13908
|
-
notes: "
|
|
13959
|
+
notes: "The body is `{ operation_key }` only: a body that still sends `method` is 400 validation_error. A change is a 0.00 `first` payment on the provider's hosted page, which offers every method `payment_method_options` lists (card, PayPal and, where a zero-amount Apple Pay payment is taken, Apple Pay); the payer chooses there, and the method paid with becomes the mandate. Offer the change only while `payment_method_options` is not empty. The answer is operation `mandate_setup` in `payment_started` with `payment.kind` hosted at once; redirect to its `checkout_url`. Nothing is quoted, so there is no `eligible` step, no confirmation and no VIES. It pays no invoice and clears no dunning or lock: open invoices stay open. When the provider reports it paid, the new mandate is the account's and every other valid mandate of the customer is revoked; canceled, expired or failed, nothing changes. `GET /api/billing/checkout/:id` with the `checkout_id` reads the outcome (`purpose: payment_method`). Keep one operation_key until its payment is finished. The same key again answers 200 with the same `payment_started` while the payment is open. 502 payment_provider_unavailable when the provider did not answer: the same key again resumes, and sends the same payment again under the same idempotency key. 409 target_state_conflict with `{ field: billing, rule: checkout_not_open }` when the key's payment is finished or can no longer be sent: start again with a new key. A key first used for another operation, or before this route took no method, is a typed operation_key_reused conflict. A change stored while changes were on hold reads `held` with `mandate_policy_unresolved`; start again with a new key. 404 not_found when no billing account is active or past due. Owner only: a support session is answered 403 support_forbidden."
|
|
13909
13960
|
},
|
|
13910
13961
|
{
|
|
13911
13962
|
method: "POST",
|
|
@@ -14039,7 +14090,7 @@ var ROUTES = [
|
|
|
14039
14090
|
response: checkoutResponse,
|
|
14040
14091
|
errors: ["validation_error", ...DEVELOPER_GUARD, "tier_required", "not_found", "target_state_conflict", "rate_limited", ...BILLING_OFF, ...MOLLIE],
|
|
14041
14092
|
transport: "http",
|
|
14042
|
-
notes: "The required operation_key binds the org, invoice and request; reuse with changed input is 409 target_state_conflict (purchaseConflictDetails). :id may be an issued invoice or a due charge with no number. Recheck current buyer eligibility, VIES, invoice status, owed amount and original currency before every new provider call. Invalid VAT is state invalid_vat_id with rule vat_id_invalid, without a payment. Pending/eligible/held has no redirect; after VIES recovers, the owner must confirm the current quote. An issued USD invoice remains held/legacy_usd_invoice: never convert it or call the provider anew until the integration decision resolves the conflict. Already-created payments retain recorded currency/amount and are looked up/reconciled, never replaced. Under the org lock, confirmation checks the current owed amount and returns the same payment identity on retries. invoice_not_open is a typed conflict; 404 not_found for unknown/foreign invoice. Pending itself never pays an invoice, lifts a lock or resets dunning. After the issuer cutover, :id names a historical open FL-\u2026 invoice only; a due charge after the cutover answers 404 not_found here \u2014 pay it with POST /api/billing/charges/:id/pay instead."
|
|
14093
|
+
notes: "The required operation_key binds the org, invoice and request; reuse with changed input is 409 target_state_conflict (purchaseConflictDetails). :id may be an issued invoice or a due charge with no number. Recheck current buyer eligibility, VIES, invoice status, owed amount and original currency before every new provider call. Invalid VAT is state invalid_vat_id with rule vat_id_invalid, without a payment. Pending/eligible/held has no redirect; after VIES recovers, the owner must confirm the current quote. An issued USD invoice remains held/legacy_usd_invoice: never convert it or call the provider anew until the integration decision resolves the conflict. Already-created payments retain recorded currency/amount and are looked up/reconciled, never replaced. Under the org lock, confirmation checks the current owed amount and returns the same payment identity on retries. invoice_not_open is a typed conflict; 404 not_found for unknown/foreign invoice. Pending itself never pays an invoice, lifts a lock or resets dunning. An invoice charged back is never retried automatically. After the issuer cutover, :id names a historical open FL-\u2026 invoice only; a due charge after the cutover answers 404 not_found here \u2014 pay it with POST /api/billing/charges/:id/pay instead."
|
|
14043
14094
|
},
|
|
14044
14095
|
{
|
|
14045
14096
|
method: "POST",
|
|
@@ -15194,7 +15245,7 @@ function headerNumber(headers, name) {
|
|
|
15194
15245
|
const value = Number(raw);
|
|
15195
15246
|
return Number.isFinite(value) ? value : null;
|
|
15196
15247
|
}
|
|
15197
|
-
function createCamerasApi(http) {
|
|
15248
|
+
function createCamerasApi(http, endings) {
|
|
15198
15249
|
return {
|
|
15199
15250
|
async list(robotId) {
|
|
15200
15251
|
const response = await http.request(`/api/robots/${pathSegment(robotId)}/cameras`, {});
|
|
@@ -15232,6 +15283,7 @@ function createCamerasApi(http) {
|
|
|
15232
15283
|
}
|
|
15233
15284
|
},
|
|
15234
15285
|
async live(robotId, slug2) {
|
|
15286
|
+
if (endings) await endings.ready();
|
|
15235
15287
|
const response = await http.request(`/api/robots/${pathSegment(robotId)}/cameras/${pathSegment(slug2)}/live`, {
|
|
15236
15288
|
method: "POST"
|
|
15237
15289
|
});
|
|
@@ -15249,11 +15301,113 @@ function createCamerasApi(http) {
|
|
|
15249
15301
|
room: response.room,
|
|
15250
15302
|
token: response.token,
|
|
15251
15303
|
expires_at: response.expires_at,
|
|
15252
|
-
release
|
|
15304
|
+
release,
|
|
15305
|
+
onEnded: (handler) => endings ? endings.onEnded(response.session_id, handler) : () => {
|
|
15306
|
+
}
|
|
15307
|
+
};
|
|
15308
|
+
}
|
|
15309
|
+
};
|
|
15310
|
+
}
|
|
15311
|
+
|
|
15312
|
+
// src/live-sessions.ts
|
|
15313
|
+
var LIVE_CHANNEL_READY_TIMEOUT_MS = 5e3;
|
|
15314
|
+
var ENDINGS_KEPT = 64;
|
|
15315
|
+
function createLiveSessionEndings(channel, options = {}) {
|
|
15316
|
+
const readyTimeoutMs = options.readyTimeoutMs ?? LIVE_CHANNEL_READY_TIMEOUT_MS;
|
|
15317
|
+
const ended = /* @__PURE__ */ new Map();
|
|
15318
|
+
const handlers = /* @__PURE__ */ new Map();
|
|
15319
|
+
let listening = false;
|
|
15320
|
+
function listen() {
|
|
15321
|
+
if (listening) return;
|
|
15322
|
+
listening = true;
|
|
15323
|
+
channel.on("live_session", (frame) => {
|
|
15324
|
+
const parsed = parseEnding(frame);
|
|
15325
|
+
if (!parsed) return;
|
|
15326
|
+
ended.set(parsed.sessionId, parsed.ended);
|
|
15327
|
+
if (ended.size > ENDINGS_KEPT) ended.delete(ended.keys().next().value);
|
|
15328
|
+
const waiting = handlers.get(parsed.sessionId);
|
|
15329
|
+
if (!waiting) return;
|
|
15330
|
+
handlers.delete(parsed.sessionId);
|
|
15331
|
+
for (const handler of waiting) deliver(handler, parsed.ended);
|
|
15332
|
+
});
|
|
15333
|
+
}
|
|
15334
|
+
return {
|
|
15335
|
+
ready() {
|
|
15336
|
+
listen();
|
|
15337
|
+
if (channel.isReady) return Promise.resolve();
|
|
15338
|
+
return new Promise((resolve) => {
|
|
15339
|
+
let settled = false;
|
|
15340
|
+
const unlistenReady = channel.onReady(() => settle());
|
|
15341
|
+
const unlistenFailed = channel.onAuthFailed(() => settle());
|
|
15342
|
+
const timer = setTimeout(() => settle(), readyTimeoutMs);
|
|
15343
|
+
function settle() {
|
|
15344
|
+
if (settled) return;
|
|
15345
|
+
settled = true;
|
|
15346
|
+
clearTimeout(timer);
|
|
15347
|
+
unlistenReady();
|
|
15348
|
+
unlistenFailed();
|
|
15349
|
+
resolve();
|
|
15350
|
+
}
|
|
15351
|
+
channel.connect();
|
|
15352
|
+
});
|
|
15353
|
+
},
|
|
15354
|
+
onEnded(sessionId, handler) {
|
|
15355
|
+
listen();
|
|
15356
|
+
let active = true;
|
|
15357
|
+
const known = ended.get(sessionId);
|
|
15358
|
+
if (known) {
|
|
15359
|
+
queueMicrotask(() => {
|
|
15360
|
+
if (!active) return;
|
|
15361
|
+
active = false;
|
|
15362
|
+
deliver(handler, known);
|
|
15363
|
+
});
|
|
15364
|
+
return () => {
|
|
15365
|
+
active = false;
|
|
15366
|
+
};
|
|
15367
|
+
}
|
|
15368
|
+
const once = (ending) => {
|
|
15369
|
+
if (!active) return;
|
|
15370
|
+
active = false;
|
|
15371
|
+
handler(ending);
|
|
15372
|
+
};
|
|
15373
|
+
let set = handlers.get(sessionId);
|
|
15374
|
+
if (!set) {
|
|
15375
|
+
set = /* @__PURE__ */ new Set();
|
|
15376
|
+
handlers.set(sessionId, set);
|
|
15377
|
+
}
|
|
15378
|
+
set.add(once);
|
|
15379
|
+
return () => {
|
|
15380
|
+
active = false;
|
|
15381
|
+
const current = handlers.get(sessionId);
|
|
15382
|
+
current?.delete(once);
|
|
15383
|
+
if (current?.size === 0) handlers.delete(sessionId);
|
|
15253
15384
|
};
|
|
15254
15385
|
}
|
|
15255
15386
|
};
|
|
15256
15387
|
}
|
|
15388
|
+
function deliver(handler, ended) {
|
|
15389
|
+
try {
|
|
15390
|
+
handler(ended);
|
|
15391
|
+
} catch (error) {
|
|
15392
|
+
queueMicrotask(() => {
|
|
15393
|
+
throw error;
|
|
15394
|
+
});
|
|
15395
|
+
}
|
|
15396
|
+
}
|
|
15397
|
+
function parseEnding(frame) {
|
|
15398
|
+
const { session_id: sessionId, state, reason, detail, refusal } = frame;
|
|
15399
|
+
if (typeof sessionId !== "string" || state !== "ended" || typeof reason !== "string") return null;
|
|
15400
|
+
if (detail !== null && typeof detail !== "string") return null;
|
|
15401
|
+
if (refusal !== void 0 && refusal !== null && typeof refusal !== "string") return null;
|
|
15402
|
+
return {
|
|
15403
|
+
sessionId,
|
|
15404
|
+
ended: {
|
|
15405
|
+
reason,
|
|
15406
|
+
detail,
|
|
15407
|
+
refusal: typeof refusal === "string" ? refusal : null
|
|
15408
|
+
}
|
|
15409
|
+
};
|
|
15410
|
+
}
|
|
15257
15411
|
|
|
15258
15412
|
// src/filter-json.ts
|
|
15259
15413
|
function filterJson(filter) {
|
|
@@ -16159,7 +16313,7 @@ function createClient(options) {
|
|
|
16159
16313
|
const actions = createActionsApi(commandTransport, jobSubscriptions);
|
|
16160
16314
|
const services = createServicesApi(commandTransport, jobSubscriptions);
|
|
16161
16315
|
const publishers = createPublishersApi(commandTransport);
|
|
16162
|
-
const cameras = createCamerasApi(http);
|
|
16316
|
+
const cameras = createCamerasApi(http, createLiveSessionEndings(channel));
|
|
16163
16317
|
const jobs = createJobsApi(http);
|
|
16164
16318
|
const assets = createAssetsApi(http);
|
|
16165
16319
|
const robots = createRobotsApi(http);
|
|
@@ -16202,7 +16356,9 @@ function deriveRealtimeUrl(apiUrl) {
|
|
|
16202
16356
|
CANCEL_RETURN_CODES,
|
|
16203
16357
|
FleetlessError,
|
|
16204
16358
|
InMemoryTokenStore,
|
|
16359
|
+
LIVE_START_REFUSALS,
|
|
16205
16360
|
SDK_ERROR_CODES,
|
|
16361
|
+
cameraOfflineDetails,
|
|
16206
16362
|
cancelRejectedDetails,
|
|
16207
16363
|
createClient,
|
|
16208
16364
|
parameterInvalidDetails,
|