@fleetless/sdk 4.4.0 → 4.6.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 +18 -0
- package/CONTRIBUTING.md +4 -4
- package/README.md +12 -0
- package/dist/index.cjs +2402 -553
- package/dist/index.d.cts +10 -5
- package/dist/index.d.ts +10 -5
- package/dist/index.js +2402 -553
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -151,15 +151,15 @@ var HttpClient = class {
|
|
|
151
151
|
*/
|
|
152
152
|
async request(path, options) {
|
|
153
153
|
const response = await this.#send(path, options, true);
|
|
154
|
-
const
|
|
155
|
-
if (
|
|
154
|
+
const text2 = await response.text();
|
|
155
|
+
if (text2.length === 0) {
|
|
156
156
|
if (options.expectEmptyBody) return void 0;
|
|
157
157
|
throw new FleetlessError(
|
|
158
158
|
"unexpected_response",
|
|
159
159
|
`${options.method ?? "GET"} ${path} answered ok (${response.status}) but the body was empty; this route is expected to always return one.`
|
|
160
160
|
);
|
|
161
161
|
}
|
|
162
|
-
return JSON.parse(
|
|
162
|
+
return JSON.parse(text2);
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
165
|
* Like `request`, but for an endpoint that answers with raw bytes instead
|
|
@@ -442,7 +442,7 @@ function createAssetsApi(http) {
|
|
|
442
442
|
};
|
|
443
443
|
}
|
|
444
444
|
|
|
445
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
445
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/common.js
|
|
446
446
|
var import_zod = require("zod");
|
|
447
447
|
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.";
|
|
448
448
|
var slug = import_zod.z.string().min(2).max(63).regex(/^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$/, SLUG_RULE);
|
|
@@ -473,7 +473,7 @@ var applyError = import_zod.z.object({
|
|
|
473
473
|
details: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional()
|
|
474
474
|
});
|
|
475
475
|
|
|
476
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
476
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/mcp.js
|
|
477
477
|
var import_zod2 = require("zod");
|
|
478
478
|
function mcpAppEndpointPath(appIdentifier2) {
|
|
479
479
|
return `/mcp/${appIdentifier2}`;
|
|
@@ -522,10 +522,10 @@ var mcpRolePreviewResponse = import_zod2.z.object({
|
|
|
522
522
|
});
|
|
523
523
|
var MCP_ASSET_LINK_TTL_MS = 15 * 60 * 1e3;
|
|
524
524
|
|
|
525
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
525
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/protocol.js
|
|
526
526
|
var import_zod8 = require("zod");
|
|
527
527
|
|
|
528
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
528
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/assets.js
|
|
529
529
|
var import_zod3 = require("zod");
|
|
530
530
|
var assetKind = import_zod3.z.enum(["urdf", "mesh", "texture"]);
|
|
531
531
|
var asset = import_zod3.z.object({
|
|
@@ -845,10 +845,10 @@ var assetSyncBusyDetails = import_zod3.z.object({
|
|
|
845
845
|
started_at_ms: import_zod3.z.number().int().nonnegative()
|
|
846
846
|
});
|
|
847
847
|
|
|
848
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
848
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/config.js
|
|
849
849
|
var import_zod5 = require("zod");
|
|
850
850
|
|
|
851
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
851
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/alerts.js
|
|
852
852
|
var import_zod4 = require("zod");
|
|
853
853
|
var alertRowCondition = import_zod4.z.discriminatedUnion("kind", [
|
|
854
854
|
import_zod4.z.strictObject({
|
|
@@ -918,7 +918,7 @@ var putDatapointDisplayRequest = import_zod4.z.object({
|
|
|
918
918
|
y_max: import_zod4.z.number().finite().nullable()
|
|
919
919
|
}).strict();
|
|
920
920
|
|
|
921
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
921
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/config.js
|
|
922
922
|
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:`.";
|
|
923
923
|
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:`.";
|
|
924
924
|
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.";
|
|
@@ -1033,7 +1033,7 @@ var parameterSpec = strictObject({
|
|
|
1033
1033
|
examples: ["^[a-z_]+$"]
|
|
1034
1034
|
}).optional(),
|
|
1035
1035
|
description: parameterDescription.meta({
|
|
1036
|
-
description: "What this parameter means, in the developer's own words, and documentation only \u2014 the robot does nothing with it. It travels into the input schema `
|
|
1036
|
+
description: "What this parameter means, in the developer's own words, and documentation only \u2014 the robot does nothing with it. It travels into the input schema `robots.describe` publishes for this call, beside the bounds, so `type` and the range say what the value *is* and this is the only place that says what it *does*.",
|
|
1037
1037
|
/** The sentence `PARAMETER_SNIPPET` already places here, verbatim. */
|
|
1038
1038
|
examples: ["What a caller is choosing when they set this."]
|
|
1039
1039
|
})
|
|
@@ -1211,11 +1211,11 @@ var datapointNumeric = strictObject({
|
|
|
1211
1211
|
examples: [-273.15]
|
|
1212
1212
|
}).optional(),
|
|
1213
1213
|
unit: import_zod5.z.string().max(32).meta({
|
|
1214
|
-
description: "The unit of the value **after** `scale` and `offset`, not the robot's own. It is shown beside the value and carried by `
|
|
1214
|
+
description: "The unit of the value **after** `scale` and `offset`, not the robot's own. It is shown beside the value and carried by `robots.describe` as its own field, so a model does not have to guess whether 15 means percent, volts or minutes.",
|
|
1215
1215
|
examples: ["%"]
|
|
1216
1216
|
}).optional(),
|
|
1217
1217
|
decimals: import_zod5.z.number().int().min(0).max(6).meta({
|
|
1218
|
-
description: "How many fraction digits the console shows the value with \u2014 value tile, chart axis and tooltip, and the datapoint detail page \u2014 and the number `
|
|
1218
|
+
description: "How many fraction digits the console shows the value with \u2014 value tile, chart axis and tooltip, and the datapoint detail page \u2014 and the number `robots.describe` reports as its own field, so a model formats the value the way the console does. Presentation only: the stored value keeps the precision it arrived with, and absent means the console's own default rather than zero.",
|
|
1219
1219
|
examples: [1]
|
|
1220
1220
|
}).optional()
|
|
1221
1221
|
});
|
|
@@ -1313,7 +1313,7 @@ var datapointConfig = strictObject({
|
|
|
1313
1313
|
description: "`keep` exempts this datapoint from the low-bandwidth rate cap; its backfill still pauses."
|
|
1314
1314
|
}),
|
|
1315
1315
|
description: serviceDescription.meta({
|
|
1316
|
-
description: "Prose about what this value is, for whoever meets it in the console. It changes nothing the robot does, so a publish that touches only it pushes no configuration at all \u2014 but it is carried verbatim into `
|
|
1316
|
+
description: "Prose about what this value is, for whoever meets it in the console. It changes nothing the robot does, so a publish that touches only it pushes no configuration at all \u2014 but it is carried verbatim into `robots.describe`, where a model that has never seen this robot reads it. The datapoint is offered whenever the role grants it; without one it is offered with `description: null` and the model has less to go on, as for actions, services, publishers and cameras. Omission is the only way to say nothing; an empty string is refused, here and on all five.",
|
|
1317
1317
|
/**
|
|
1318
1318
|
* The sentence both datapoint snippets already place here, verbatim. Its
|
|
1319
1319
|
* four siblings — an action's, a service's, a publisher's, a camera's —
|
|
@@ -1526,7 +1526,7 @@ var actionConfig = strictObject({
|
|
|
1526
1526
|
message: messageBody.optional(),
|
|
1527
1527
|
parameters: parameterMap.optional(),
|
|
1528
1528
|
description: serviceDescription.meta({
|
|
1529
|
-
description: "What this action does, in the developer's own words \u2014 documentation for the console and for MCP clients, which is all it is: the robot does nothing with it. It is carried verbatim into `
|
|
1529
|
+
description: "What this action does, in the developer's own words \u2014 documentation for the console and for MCP clients, which is all it is: the robot does nothing with it. It is carried verbatim into `robots.describe` and read by a model that has never seen this robot. The action is offered whenever the role grants it; without one it is offered with `description: null`, and the model has nothing but the slug.",
|
|
1530
1530
|
examples: ["Drives to a target pose on the map."]
|
|
1531
1531
|
})
|
|
1532
1532
|
}).meta({
|
|
@@ -1902,7 +1902,7 @@ var cameraConfig = strictObject({
|
|
|
1902
1902
|
examples: [5]
|
|
1903
1903
|
}),
|
|
1904
1904
|
description: serviceDescription.meta({
|
|
1905
|
-
description: "What this camera shows, in the developer's own words \u2014 documentation for whoever reads the configuration, for the console and for MCP clients; the robot does nothing with it. A camera without one is still offered, with `description: null`, as for actions, services and publishers. What `
|
|
1905
|
+
description: "What this camera shows, in the developer's own words \u2014 documentation for whoever reads the configuration, for the console and for MCP clients; the robot does nothing with it. A camera without one is still offered, with `description: null`, as for actions, services and publishers. What `camera.snapshot` serves is the latest snapshot with its age; a live session is never a tool.",
|
|
1906
1906
|
examples: ["Forward-facing camera on the mast."]
|
|
1907
1907
|
})
|
|
1908
1908
|
}).meta({
|
|
@@ -2010,7 +2010,7 @@ var configState = import_zod5.z.object({
|
|
|
2010
2010
|
applied_errors: import_zod5.z.array(applyError).nullable()
|
|
2011
2011
|
});
|
|
2012
2012
|
|
|
2013
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2013
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/introspection.js
|
|
2014
2014
|
var import_zod6 = require("zod");
|
|
2015
2015
|
var rosGraphEntry = import_zod6.z.object({
|
|
2016
2016
|
name: rosName,
|
|
@@ -2049,7 +2049,7 @@ var typeDefinition = import_zod6.z.discriminatedUnion("kind", [
|
|
|
2049
2049
|
})
|
|
2050
2050
|
]);
|
|
2051
2051
|
|
|
2052
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2052
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/jobs.js
|
|
2053
2053
|
var import_zod7 = require("zod");
|
|
2054
2054
|
var jobState = import_zod7.z.enum(["running", "unknown", "succeeded", "failed", "cancelled", "lost"]);
|
|
2055
2055
|
var reportedJobState = jobState.exclude(["unknown"]);
|
|
@@ -2063,7 +2063,7 @@ var job = import_zod7.z.object({
|
|
|
2063
2063
|
description: "The action or service this job is running, as the published configuration exposes it. One slug carries one job at a time, so every observer of that slug sees the same one."
|
|
2064
2064
|
}),
|
|
2065
2065
|
state: jobState.meta({
|
|
2066
|
-
description: "Where the job stands: `running`, `unknown`, `succeeded`, `failed`, `cancelled` or `lost`. `unknown` is not an outcome \u2014 the robot went offline or silent and the cloud does not know yet; the slug stays occupied and the bridge's next statement resolves it, `error` naming why the cloud lost sight of it. `lost` is final
|
|
2066
|
+
description: "Where the job stands: `running`, `unknown`, `succeeded`, `failed`, `cancelled` or `lost`. `unknown` is not an outcome \u2014 the robot went offline or silent and the cloud does not know yet; the slug stays occupied and the bridge's next statement resolves it, `error` naming why the cloud lost sight of it. `lost` is final after an action server disappears before terminal status (`action_server_lost`), a later query confirms the bridge does not know the job and no active goal accounts for it (`job_unknown_to_bridge`), or a terminal goal status is observed but its result cannot be recovered within the bounded wait (`job_lost`). An unqualified bridge loss report also uses `job_lost`, with a message distinguishing it from terminal-result loss. Cloud cleanup may settle a superseded job or a deleted robot's job as `lost` without an error code. A reconnect or omission from `hello.active_jobs` alone is not final."
|
|
2067
2067
|
}),
|
|
2068
2068
|
origin: jobOrigin.meta({
|
|
2069
2069
|
description: "Who started this job. `fleetless` for everything minted by the cloud; `external` for a goal the bridge found active on a published action without having sent it \u2014 no parameters, no starter, never written to `job_runs`."
|
|
@@ -2193,7 +2193,7 @@ var jobRun = import_zod7.z.object({
|
|
|
2193
2193
|
description: "Whether the slug was an `action` or a `service`."
|
|
2194
2194
|
}),
|
|
2195
2195
|
state: jobState.meta({
|
|
2196
|
-
description: "How the run ended, or `running` while it is still going. `unknown` while the robot has not accounted for it \u2014 offline or silent \u2014 and updated once the bridge says how it stands. `lost` is final
|
|
2196
|
+
description: "How the run ended, or `running` while it is still going. `unknown` while the robot has not accounted for it \u2014 offline or silent \u2014 and updated once the bridge says how it stands. `lost` is final after an action server disappears before terminal status (`action_server_lost`), a later query confirms the bridge does not know the job and no active goal accounts for it (`job_unknown_to_bridge`), or a terminal goal status is observed but its result cannot be recovered within the bounded wait (`job_lost`). An unqualified bridge loss report also uses `job_lost`, with a message distinguishing it from terminal-result loss. Cloud cleanup may settle a superseded run or a deleted robot's run as `lost` without an error code. A reconnect or omission from `hello.active_jobs` alone is not final."
|
|
2197
2197
|
}),
|
|
2198
2198
|
started_at: import_zod7.z.iso.datetime().meta({
|
|
2199
2199
|
description: "When the run started, as an ISO 8601 timestamp. Runs are listed and filtered by this instant."
|
|
@@ -2286,7 +2286,7 @@ var jobRunSummary = import_zod7.z.object({
|
|
|
2286
2286
|
since_ms: import_zod7.z.number().int().nonnegative()
|
|
2287
2287
|
});
|
|
2288
2288
|
|
|
2289
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2289
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/protocol.js
|
|
2290
2290
|
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
2291
2291
|
var MAX_PATIENCE_MS = 12e4;
|
|
2292
2292
|
var MIN_PATIENCE_MS = 1e3;
|
|
@@ -2520,7 +2520,8 @@ var bridgeTypeDefinitions = import_zod8.z.object({
|
|
|
2520
2520
|
var bridgeState = import_zod8.z.object({
|
|
2521
2521
|
online: import_zod8.z.boolean(),
|
|
2522
2522
|
latency_ms: import_zod8.z.number().nonnegative().nullable(),
|
|
2523
|
-
low_bandwidth: import_zod8.z.boolean().meta({ description: "Whether the bridge is in its low-bandwidth mode: datapoints capped, cameras reduced or stopped. Bridge-reported." })
|
|
2523
|
+
low_bandwidth: import_zod8.z.boolean().meta({ description: "Whether the bridge is in its low-bandwidth mode: datapoints capped, cameras reduced or stopped. Bridge-reported." }),
|
|
2524
|
+
health_reason: import_zod8.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." })
|
|
2524
2525
|
});
|
|
2525
2526
|
var snapshotHeader = import_zod8.z.object({
|
|
2526
2527
|
type: import_zod8.z.literal("snapshot"),
|
|
@@ -2684,11 +2685,11 @@ var bridgeCameraState = import_zod8.z.object({
|
|
|
2684
2685
|
request_id: import_zod8.z.string().min(1).max(64).nullable()
|
|
2685
2686
|
});
|
|
2686
2687
|
|
|
2687
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2688
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/config-issues.js
|
|
2688
2689
|
var EXPOSURE_SECTIONS = ["datapoints", "actions", "services", "publishers", "cameras"];
|
|
2689
2690
|
var EXPOSURE_SECTION_NAMES = new Set(EXPOSURE_SECTIONS);
|
|
2690
2691
|
|
|
2691
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2692
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/rest.js
|
|
2692
2693
|
var import_zod9 = require("zod");
|
|
2693
2694
|
var robot = import_zod9.z.object({
|
|
2694
2695
|
id: import_zod9.z.uuid().meta({
|
|
@@ -2890,6 +2891,12 @@ var cancelRequest = import_zod9.z.object({
|
|
|
2890
2891
|
description: "The one job to stop. Absent or `null` cancels whatever is currently running on the slug, which is what every caller written before this field existed means. Unknown keys are refused rather than stripped, so a misspelling cannot silently become the slug-wide cancel."
|
|
2891
2892
|
})
|
|
2892
2893
|
}).strict();
|
|
2894
|
+
var recoverHeldJobRequest = import_zod9.z.object({
|
|
2895
|
+
job_id: import_zod9.z.uuid().meta({ description: "The exact held job id read from the robot job state; another job must never be released by a stale request." }),
|
|
2896
|
+
verified_stopped: import_zod9.z.literal(true).meta({ description: "The Owner confirms a physical stop and safety check; this is not a cloud sensor reading." }),
|
|
2897
|
+
reason: import_zod9.z.string().trim().min(10).max(500).meta({ description: "The Owner's reason and safety-check record, 10\u2013500 characters after trimming; retained in the audit trail." })
|
|
2898
|
+
}).strict();
|
|
2899
|
+
var recoverHeldJobResponse = import_zod9.z.object({ job });
|
|
2893
2900
|
var releaseLiveQuery = import_zod9.z.object({
|
|
2894
2901
|
session_id: import_zod9.z.uuid().optional().meta({
|
|
2895
2902
|
description: "The one hold to release, as the live session returned it. Absent releases **all** of this identity's holds on this camera \u2014 the blunt form, still needed by a client that has lost its id or is going away, and the one that strands the identity's other tabs."
|
|
@@ -3453,13 +3460,13 @@ var slugUsageResponse = import_zod9.z.object({
|
|
|
3453
3460
|
alert_count: import_zod9.z.number().int().nonnegative()
|
|
3454
3461
|
});
|
|
3455
3462
|
|
|
3456
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
3457
|
-
var
|
|
3463
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/realtime.js
|
|
3464
|
+
var import_zod15 = require("zod");
|
|
3458
3465
|
|
|
3459
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
3460
|
-
var
|
|
3466
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/client-auth.js
|
|
3467
|
+
var import_zod14 = require("zod");
|
|
3461
3468
|
|
|
3462
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
3469
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/apps.js
|
|
3463
3470
|
var import_zod10 = require("zod");
|
|
3464
3471
|
var appIdentifier = slug;
|
|
3465
3472
|
var app = import_zod10.z.object({
|
|
@@ -3682,10 +3689,10 @@ var rolePermissions = import_zod10.z.object({
|
|
|
3682
3689
|
})
|
|
3683
3690
|
});
|
|
3684
3691
|
|
|
3685
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
3686
|
-
var
|
|
3692
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/app-users.js
|
|
3693
|
+
var import_zod13 = require("zod");
|
|
3687
3694
|
|
|
3688
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
3695
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/identity.js
|
|
3689
3696
|
var import_zod11 = require("zod");
|
|
3690
3697
|
var password = import_zod11.z.string().min(12).max(256);
|
|
3691
3698
|
var USER_DISPLAY_NAME_MAX = 120;
|
|
@@ -3764,7 +3771,12 @@ var twoFactorSetupResponse = import_zod11.z.object({
|
|
|
3764
3771
|
description: "The same secret as an `otpauth://totp/` URL, to render as a QR code. It carries the secret: never log it."
|
|
3765
3772
|
})
|
|
3766
3773
|
});
|
|
3767
|
-
var waitlistRequest = import_zod11.z.object({
|
|
3774
|
+
var waitlistRequest = import_zod11.z.object({
|
|
3775
|
+
email: import_zod11.z.email().max(254),
|
|
3776
|
+
consent_text_version: import_zod11.z.string().min(1).max(80).regex(/\S/).meta({
|
|
3777
|
+
description: "Version of the F.1 text shown at submission. Cloud rejects unsupported versions and stores the submitted value in a consent record separate from the waiting list."
|
|
3778
|
+
})
|
|
3779
|
+
});
|
|
3768
3780
|
var mailStatus = import_zod11.z.enum(["sent", "not_requested", "not_configured", "failed"]);
|
|
3769
3781
|
var createTeamInviteRequest = import_zod11.z.object({
|
|
3770
3782
|
email: import_zod11.z.email().meta({
|
|
@@ -3903,24 +3915,44 @@ var recoveryCodesResponse = import_zod11.z.object({
|
|
|
3903
3915
|
recovery_codes: recoveryCodesList.meta({ description: "The ten new recovery codes, lowercase, shown once. Every earlier code is void." })
|
|
3904
3916
|
});
|
|
3905
3917
|
|
|
3906
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
3918
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/legal.js
|
|
3919
|
+
var import_zod12 = require("zod");
|
|
3920
|
+
var httpsLegalUrl = import_zod12.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) => {
|
|
3921
|
+
try {
|
|
3922
|
+
const url = new URL(value);
|
|
3923
|
+
return url.protocol === "https:" && !url.username && !url.password;
|
|
3924
|
+
} catch {
|
|
3925
|
+
return false;
|
|
3926
|
+
}
|
|
3927
|
+
}, { message: "must be an absolute HTTPS URL without credentials" }).meta({ format: "uri" });
|
|
3928
|
+
var legalDocumentReference = import_zod12.z.object({
|
|
3929
|
+
version: import_zod12.z.string().trim().min(1).max(80),
|
|
3930
|
+
version_date: import_zod12.z.iso.date(),
|
|
3931
|
+
url: httpsLegalUrl
|
|
3932
|
+
}).strict();
|
|
3933
|
+
var legalTextReferences = import_zod12.z.object({
|
|
3934
|
+
terms: legalDocumentReference,
|
|
3935
|
+
dpa: legalDocumentReference.nullable()
|
|
3936
|
+
}).strict();
|
|
3937
|
+
|
|
3938
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/app-users.js
|
|
3907
3939
|
var APP_USER_DISPLAY_NAME_MAX = 120;
|
|
3908
|
-
var providerSlug =
|
|
3909
|
-
var appUserStatus =
|
|
3910
|
-
var appUser =
|
|
3911
|
-
id:
|
|
3940
|
+
var providerSlug = import_zod13.z.string().max(40).regex(/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/, "must be lowercase and hyphen-separated, starting with a letter");
|
|
3941
|
+
var appUserStatus = import_zod13.z.enum(["pending_verification", "active", "blocked"]);
|
|
3942
|
+
var appUser = import_zod13.z.object({
|
|
3943
|
+
id: import_zod13.z.uuid().meta({
|
|
3912
3944
|
description: "The app user in the API, assigned by the cloud and stable for the life of the account."
|
|
3913
3945
|
}),
|
|
3914
|
-
app_id:
|
|
3946
|
+
app_id: import_zod13.z.uuid().meta({
|
|
3915
3947
|
description: "The app this user belongs to, and the whole of their scope. An app user of one app is nobody at another, even inside the same organisation."
|
|
3916
3948
|
}),
|
|
3917
|
-
email:
|
|
3949
|
+
email: import_zod13.z.email().meta({
|
|
3918
3950
|
description: "The address the account is identified by. Unique **per app**, case-insensitively \u2014 the same address may exist as an unrelated account in another app of the same organisation."
|
|
3919
3951
|
}),
|
|
3920
|
-
display_name:
|
|
3952
|
+
display_name: import_zod13.z.string().min(1).max(APP_USER_DISPLAY_NAME_MAX).nullable().meta({
|
|
3921
3953
|
description: "Optional human name, shown by the developer's own UI instead of the address where present. `null` when the user never supplied one; never used for authentication."
|
|
3922
3954
|
}),
|
|
3923
|
-
role_id:
|
|
3955
|
+
role_id: import_zod13.z.uuid().meta({
|
|
3924
3956
|
description: "The role that decides what this user may reach. Roles are the only visibility filter: what a role does not grant does not exist for that user."
|
|
3925
3957
|
}),
|
|
3926
3958
|
status: appUserStatus.meta({
|
|
@@ -3932,83 +3964,83 @@ var appUser = import_zod12.z.object({
|
|
|
3932
3964
|
* response. `false` is an OIDC-only account or an invitation not yet
|
|
3933
3965
|
* accepted — it does not mean blocked and it does not mean without access.
|
|
3934
3966
|
*/
|
|
3935
|
-
has_password:
|
|
3967
|
+
has_password: import_zod13.z.boolean().meta({
|
|
3936
3968
|
description: 'Whether this account has a Fleetless-held password. `false` is an identity-provider-only account, or an invitation not yet accepted \u2014 it does not mean blocked and it does not mean without access. No hash, no algorithm and no "last changed" travels here, and nothing on the wire can say whether a password is strong or already known to somebody else.'
|
|
3937
3969
|
}),
|
|
3938
|
-
providers:
|
|
3970
|
+
providers: import_zod13.z.array(providerSlug).max(20).meta({
|
|
3939
3971
|
description: "The slugs of the identity providers this account is linked to, empty for a password-only user. Lets a developer's user list say where an account came from without a second request."
|
|
3940
3972
|
}),
|
|
3941
|
-
last_login_at:
|
|
3973
|
+
last_login_at: import_zod13.z.iso.datetime().nullable().meta({
|
|
3942
3974
|
description: "When this user last signed in, or `null` if they never have. Required and nullable rather than optional, so *never logged in* stays distinguishable from *this field was not loaded*."
|
|
3943
3975
|
}),
|
|
3944
|
-
two_factor:
|
|
3945
|
-
enabled:
|
|
3976
|
+
two_factor: import_zod13.z.object({
|
|
3977
|
+
enabled: import_zod13.z.boolean().meta({
|
|
3946
3978
|
description: "Whether the account has a confirmed authenticator app (TOTP). When it has, every sign-in that yields a session asks for a code as well \u2014 whatever the app's policy \u2014 except a sign-in through an identity provider, which owns that sign-in."
|
|
3947
3979
|
}),
|
|
3948
|
-
enabled_at:
|
|
3980
|
+
enabled_at: import_zod13.z.iso.datetime().nullable().meta({
|
|
3949
3981
|
description: "When the authenticator was confirmed, or `null` while `enabled` is `false`."
|
|
3950
3982
|
}),
|
|
3951
|
-
recovery_codes_left:
|
|
3983
|
+
recovery_codes_left: import_zod13.z.number().int().min(0).max(10).meta({
|
|
3952
3984
|
description: "How many of the ten single-use recovery codes are still unspent. `0` while `enabled` is `false`."
|
|
3953
3985
|
})
|
|
3954
3986
|
}).meta({
|
|
3955
3987
|
description: "The account's second factor, as a developer's user list shows it. No secret and no code travels here; resetting it is `DELETE /api/apps/:id/users/:userId/two-factor`."
|
|
3956
3988
|
}),
|
|
3957
|
-
created_at:
|
|
3989
|
+
created_at: import_zod13.z.iso.datetime().meta({
|
|
3958
3990
|
description: "When the account was created, as an ISO 8601 timestamp."
|
|
3959
3991
|
})
|
|
3960
3992
|
});
|
|
3961
|
-
var appUserListResponse =
|
|
3962
|
-
users:
|
|
3993
|
+
var appUserListResponse = import_zod13.z.object({
|
|
3994
|
+
users: import_zod13.z.array(appUser).meta({
|
|
3963
3995
|
description: "Every user of this app. An app with no users answers an empty array, not an absent key."
|
|
3964
3996
|
})
|
|
3965
3997
|
});
|
|
3966
|
-
var createAppUserRequest =
|
|
3967
|
-
email:
|
|
3998
|
+
var createAppUserRequest = import_zod13.z.object({
|
|
3999
|
+
email: import_zod13.z.email().meta({
|
|
3968
4000
|
description: "The address, unique per app case-insensitively. An address this app already knows is refused with `email_taken` \u2014 a developer-authenticated route may say so, unlike the public registration route."
|
|
3969
4001
|
}),
|
|
3970
4002
|
password: password.meta({
|
|
3971
4003
|
description: "The initial password. At least 12 characters: length only, because a rule a user cannot predict is a rule they work around."
|
|
3972
4004
|
}),
|
|
3973
|
-
display_name:
|
|
4005
|
+
display_name: import_zod13.z.string().min(1).max(APP_USER_DISPLAY_NAME_MAX).nullable().optional().meta({
|
|
3974
4006
|
description: "Optional human name. Absent leaves it unset; an explicit `null` is the same end state."
|
|
3975
4007
|
}),
|
|
3976
|
-
role_id:
|
|
4008
|
+
role_id: import_zod13.z.uuid().optional().meta({
|
|
3977
4009
|
description: "The role the new user holds. Absent means the app's `default_role_id`, and `409 target_state_conflict` when the app has none or its default no longer resolves; a role belonging to another app is `404 not_found`, the same refusal a role that never existed gets."
|
|
3978
4010
|
})
|
|
3979
4011
|
}).strict();
|
|
3980
|
-
var patchAppUserRequest =
|
|
3981
|
-
display_name:
|
|
4012
|
+
var patchAppUserRequest = import_zod13.z.object({
|
|
4013
|
+
display_name: import_zod13.z.string().min(1).max(APP_USER_DISPLAY_NAME_MAX).nullable().optional().meta({
|
|
3982
4014
|
description: "The user's display name. Absent leaves it alone; an explicit `null` clears it."
|
|
3983
4015
|
}),
|
|
3984
|
-
role_id:
|
|
4016
|
+
role_id: import_zod13.z.uuid().optional().meta({
|
|
3985
4017
|
description: "The role the user holds from now on. A role belonging to another app is `404 not_found`, the same refusal a role that never existed gets; re-roling closes the user's live subscriptions."
|
|
3986
4018
|
}),
|
|
3987
|
-
status:
|
|
4019
|
+
status: import_zod13.z.enum(["active", "blocked"]).meta({
|
|
3988
4020
|
description: "Block the account or let it back in. **`pending_verification` cannot be set here**: it is reached only by self-registration and left only by spending the mailed verification token, so a developer setting it would strand the account in a state nothing re-mails them out of."
|
|
3989
4021
|
}).optional()
|
|
3990
4022
|
}).strict();
|
|
3991
|
-
var createAppInvitationRequest =
|
|
3992
|
-
email:
|
|
4023
|
+
var createAppInvitationRequest = import_zod13.z.object({
|
|
4024
|
+
email: import_zod13.z.email().meta({
|
|
3993
4025
|
description: "The address to invite. An invitation always bypasses the domain whitelist \u2014 a developer inviting somebody by hand has already made the decision the whitelist automates."
|
|
3994
4026
|
}),
|
|
3995
|
-
role_id:
|
|
4027
|
+
role_id: import_zod13.z.uuid().optional().meta({
|
|
3996
4028
|
description: "The role the invitee gets on acceptance. Absent means the app's `default_role_id`."
|
|
3997
4029
|
}),
|
|
3998
|
-
display_name:
|
|
4030
|
+
display_name: import_zod13.z.string().min(1).max(APP_USER_DISPLAY_NAME_MAX).nullable().optional().meta({
|
|
3999
4031
|
description: "An optional name to pre-fill the account with; the invitee can change it afterwards."
|
|
4000
4032
|
}),
|
|
4001
|
-
send_mail:
|
|
4033
|
+
send_mail: import_zod13.z.boolean().meta({
|
|
4002
4034
|
description: "Whether Fleetless mails the invitation. The link points at the app's `invite_url`, or at the Fleetless-hosted invitation page when the app has configured none \u2014 so the mail always leads somewhere, and nothing is refused for a missing URL."
|
|
4003
4035
|
})
|
|
4004
4036
|
}).strict();
|
|
4005
|
-
var appInvitation =
|
|
4006
|
-
id:
|
|
4007
|
-
app_id:
|
|
4008
|
-
email:
|
|
4009
|
-
role_id:
|
|
4010
|
-
expires_at:
|
|
4011
|
-
accept_url:
|
|
4037
|
+
var appInvitation = import_zod13.z.object({
|
|
4038
|
+
id: import_zod13.z.uuid().meta({ description: "The invitation, as listed and revoked by the developer." }),
|
|
4039
|
+
app_id: import_zod13.z.uuid().meta({ description: "The app the invitee will belong to." }),
|
|
4040
|
+
email: import_zod13.z.email().meta({ description: "The address the invitation was addressed to." }),
|
|
4041
|
+
role_id: import_zod13.z.uuid().meta({ description: "The role the invitee holds once they accept. Resolved at creation, so a later change to the app's default role does not silently re-aim an outstanding invitation." }),
|
|
4042
|
+
expires_at: import_zod13.z.iso.datetime().meta({ description: "When the token stops working. Seven days from issue; an expired token answers exactly as an unknown one does." }),
|
|
4043
|
+
accept_url: import_zod13.z.url().max(500).meta({
|
|
4012
4044
|
description: "The link to give the invitee: the app's `invite_url` with the token substituted for `{token}`, or the Fleetless-hosted invitation page when the app has configured none. Bounded like every other URL that gets mailed, logged and rendered."
|
|
4013
4045
|
}),
|
|
4014
4046
|
mail: mailStatus.meta({
|
|
@@ -4016,77 +4048,77 @@ var appInvitation = import_zod12.z.object({
|
|
|
4016
4048
|
})
|
|
4017
4049
|
});
|
|
4018
4050
|
var pendingAppInvitation = appInvitation.omit({ accept_url: true, mail: true });
|
|
4019
|
-
var appInvitationListResponse =
|
|
4020
|
-
invitations:
|
|
4051
|
+
var appInvitationListResponse = import_zod13.z.object({
|
|
4052
|
+
invitations: import_zod13.z.array(pendingAppInvitation).meta({
|
|
4021
4053
|
description: "The app's outstanding invitations, without their tokens. An accepted one is history and does not appear."
|
|
4022
4054
|
})
|
|
4023
4055
|
});
|
|
4024
|
-
var appOidcProvider =
|
|
4025
|
-
id:
|
|
4026
|
-
app_id:
|
|
4056
|
+
var appOidcProvider = import_zod13.z.object({
|
|
4057
|
+
id: import_zod13.z.uuid().meta({ description: "The provider row, as listed, patched and deleted by the developer." }),
|
|
4058
|
+
app_id: import_zod13.z.uuid().meta({ description: "The app this provider signs users in to." }),
|
|
4027
4059
|
slug: providerSlug.meta({
|
|
4028
4060
|
description: "The stable handle in the sign-in URL (`/api/client/oidc/:slug/start`) and on the developer's own button. Unique per app, lowercase and hyphen-separated \u2014 **not** the underscore-separated grammar `identifier` uses. Immutable: linked identities are keyed by it."
|
|
4029
4061
|
}),
|
|
4030
|
-
name:
|
|
4062
|
+
name: import_zod13.z.string().min(1).max(80).meta({
|
|
4031
4063
|
description: 'What the developer\'s sign-in page calls this provider, e.g. "Sign in with Azure AD". Free text; the only field of this shape the public `GET /api/client/providers` reveals besides the slug.'
|
|
4032
4064
|
}),
|
|
4033
4065
|
issuer: idpIssuer.meta({
|
|
4034
4066
|
description: "The provider's issuer URL, from which discovery and the JWKS are read. http(s) only, with no credentials, query or fragment \u2014 RFC 8414 \xA73 builds the discovery URL from the issuer's path, so a query there is meaningless and an `@` is a redirect trick. **This is not the SSRF defence**: it cannot tell a loopback dev provider from a loopback database, and the real check refuses loopback, link-local and private ranges at the fetch."
|
|
4035
4067
|
}),
|
|
4036
|
-
client_id:
|
|
4068
|
+
client_id: import_zod13.z.string().min(1).max(200).meta({
|
|
4037
4069
|
description: "The OAuth client the developer registered at their provider for Fleetless."
|
|
4038
4070
|
}),
|
|
4039
|
-
scopes:
|
|
4071
|
+
scopes: import_zod13.z.array(import_zod13.z.string().min(1).max(60)).min(1).max(20).meta({
|
|
4040
4072
|
description: "The scopes requested at the provider. At least one \u2014 a request that asks for nothing learns nothing \u2014 and bounded, because an unbounded array on a stored, logged and rendered shape is a size nobody chose."
|
|
4041
4073
|
}),
|
|
4042
|
-
link_verified_emails:
|
|
4074
|
+
link_verified_emails: import_zod13.z.boolean().meta({
|
|
4043
4075
|
description: "Whether a federated login may join an **existing** app user with the same address. It needs the provider to assert `email_verified` as well: either condition alone is account takeover, since a provider that lets anyone type any address into a profile would otherwise hand over every matching account, and a developer who connects a provider for a subset of their users would otherwise silently merge strangers."
|
|
4044
4076
|
}),
|
|
4045
|
-
enabled:
|
|
4077
|
+
enabled: import_zod13.z.boolean().meta({
|
|
4046
4078
|
description: "Whether this provider is offered. A disabled provider disappears from `GET /api/client/providers` and refuses a start with `provider_disabled`, without the row and its linked identities being deleted."
|
|
4047
4079
|
}),
|
|
4048
|
-
created_at:
|
|
4080
|
+
created_at: import_zod13.z.iso.datetime().meta({ description: "When the provider was configured, as an ISO 8601 timestamp." })
|
|
4049
4081
|
}).strict();
|
|
4050
|
-
var appOidcProviderListResponse =
|
|
4051
|
-
providers:
|
|
4082
|
+
var appOidcProviderListResponse = import_zod13.z.object({
|
|
4083
|
+
providers: import_zod13.z.array(appOidcProvider).meta({
|
|
4052
4084
|
description: "Every provider configured on this app, disabled ones included \u2014 this is the developer's management view, unlike the public `GET /api/client/providers`, which lists only what a user can actually press."
|
|
4053
4085
|
})
|
|
4054
4086
|
});
|
|
4055
|
-
var createAppOidcProviderRequest =
|
|
4087
|
+
var createAppOidcProviderRequest = import_zod13.z.object({
|
|
4056
4088
|
slug: providerSlug.meta({
|
|
4057
4089
|
description: "The handle for this provider, unique per app. Immutable once created \u2014 identities are keyed by it, so a rename would orphan every linked account."
|
|
4058
4090
|
}),
|
|
4059
|
-
name:
|
|
4091
|
+
name: import_zod13.z.string().min(1).max(80).meta({ description: "What the developer's sign-in page calls this provider." }),
|
|
4060
4092
|
issuer: idpIssuer.meta({
|
|
4061
4093
|
description: "The provider's issuer URL. Shape-checked here (http(s), no credentials, query or fragment); the authoritative SSRF defence is at the discovery fetch."
|
|
4062
4094
|
}),
|
|
4063
|
-
client_id:
|
|
4064
|
-
client_secret:
|
|
4095
|
+
client_id: import_zod13.z.string().min(1).max(200).meta({ description: "The OAuth client registered at the provider for Fleetless." }),
|
|
4096
|
+
client_secret: import_zod13.z.string().min(16).max(500).meta({
|
|
4065
4097
|
description: "The client secret, **write-only**: it is stored encrypted and comes back through nothing \u2014 not the read, not this route's own answer, not an audit detail. Required on create, since a provider with no secret cannot exchange a code; the minimum length refuses a value that is a misconfiguration rather than a secret."
|
|
4066
4098
|
}),
|
|
4067
|
-
scopes:
|
|
4099
|
+
scopes: import_zod13.z.array(import_zod13.z.string().min(1).max(60)).min(1).max(20).default(["openid", "email", "profile"]).meta({
|
|
4068
4100
|
description: "The scopes to request. Defaults to `openid email profile`, which is what account linking actually reads: the subject, the address and its verified flag, and a name."
|
|
4069
4101
|
}),
|
|
4070
|
-
link_verified_emails:
|
|
4102
|
+
link_verified_emails: import_zod13.z.boolean().default(false).meta({
|
|
4071
4103
|
description: "Whether a federated login may join an existing app user by verified address. **Defaults to off**, because relaxing later is additive and admitting duplicates now and tightening afterwards is not."
|
|
4072
4104
|
}),
|
|
4073
|
-
enabled:
|
|
4105
|
+
enabled: import_zod13.z.boolean().default(true).meta({
|
|
4074
4106
|
description: "Whether the provider is offered immediately. Defaults to on: a developer who just typed a client secret is configuring a provider they mean to use."
|
|
4075
4107
|
})
|
|
4076
4108
|
}).strict();
|
|
4077
|
-
var patchAppOidcProviderRequest =
|
|
4078
|
-
name:
|
|
4109
|
+
var patchAppOidcProviderRequest = import_zod13.z.object({
|
|
4110
|
+
name: import_zod13.z.string().min(1).max(80).optional().meta({ description: "A new display name for the provider." }),
|
|
4079
4111
|
issuer: idpIssuer.optional().meta({ description: "A new issuer URL. Changing it re-runs discovery; identities linked under the old one keep their `(provider, subject)` key." }),
|
|
4080
|
-
client_id:
|
|
4081
|
-
client_secret:
|
|
4112
|
+
client_id: import_zod13.z.string().min(1).max(200).optional().meta({ description: "A new client id." }),
|
|
4113
|
+
client_secret: import_zod13.z.string().min(16).max(500).optional().meta({
|
|
4082
4114
|
description: "A replacement client secret. **Absent means keep the stored one**, so a routine edit need not put the secret back on the wire; it is never echoed back by any route."
|
|
4083
4115
|
}),
|
|
4084
|
-
scopes:
|
|
4085
|
-
link_verified_emails:
|
|
4086
|
-
enabled:
|
|
4116
|
+
scopes: import_zod13.z.array(import_zod13.z.string().min(1).max(60)).min(1).max(20).optional().meta({ description: "A replacement scope list. A replace, not a merge." }),
|
|
4117
|
+
link_verified_emails: import_zod13.z.boolean().optional().meta({ description: "Whether a federated login may join an existing app user by verified address." }),
|
|
4118
|
+
enabled: import_zod13.z.boolean().optional().meta({ description: "Turn the provider off or back on without deleting it or its linked identities." })
|
|
4087
4119
|
}).strict();
|
|
4088
4120
|
function appUrlTemplate(placeholder) {
|
|
4089
|
-
return
|
|
4121
|
+
return import_zod13.z.string().max(500).refine((v) => {
|
|
4090
4122
|
try {
|
|
4091
4123
|
const u = new URL(v.replace(placeholder, "x"));
|
|
4092
4124
|
const schemeOk = u.protocol === "https:" || u.protocol === "http:" && (u.hostname === "localhost" || u.hostname === "127.0.0.1");
|
|
@@ -4096,7 +4128,7 @@ function appUrlTemplate(placeholder) {
|
|
|
4096
4128
|
}
|
|
4097
4129
|
}, { message: `must be an https URL (or http://localhost) containing ${placeholder} exactly once` });
|
|
4098
4130
|
}
|
|
4099
|
-
var allowedOrigin =
|
|
4131
|
+
var allowedOrigin = import_zod13.z.string().max(200).refine((v) => {
|
|
4100
4132
|
try {
|
|
4101
4133
|
const u = new URL(v);
|
|
4102
4134
|
return u.origin === v && (u.protocol === "https:" || u.hostname === "localhost" || u.hostname === "127.0.0.1");
|
|
@@ -4104,17 +4136,17 @@ var allowedOrigin = import_zod12.z.string().max(200).refine((v) => {
|
|
|
4104
4136
|
return false;
|
|
4105
4137
|
}
|
|
4106
4138
|
}, { message: "must be a bare origin (scheme, host, port) over https, or over http on localhost" });
|
|
4107
|
-
var emailDomain =
|
|
4108
|
-
var appSignInMethods =
|
|
4109
|
-
password:
|
|
4139
|
+
var emailDomain = import_zod13.z.string().min(1).max(253).regex(/^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/, "must be a lowercase domain name with at least two labels");
|
|
4140
|
+
var appSignInMethods = import_zod13.z.object({
|
|
4141
|
+
password: import_zod13.z.boolean().meta({
|
|
4110
4142
|
description: "Whether app users may sign in with a password. Off refuses `POST /api/client/login` with `method_not_allowed`, and registration and invitations then take no password."
|
|
4111
4143
|
}),
|
|
4112
|
-
email_code:
|
|
4144
|
+
email_code: import_zod13.z.boolean().meta({
|
|
4113
4145
|
description: "Whether app users may sign in with a six-digit code mailed to them, valid ten minutes. A code needs no URL, so it works in local development and in an app with no web UI."
|
|
4114
4146
|
})
|
|
4115
4147
|
}).strict().refine((m) => m.password || m.email_code, { message: "At least one sign-in method must be on.", path: ["password"] });
|
|
4116
|
-
var appTwoFactorPolicy =
|
|
4117
|
-
var appHomeUrl =
|
|
4148
|
+
var appTwoFactorPolicy = import_zod13.z.enum(["off", "optional", "required"]);
|
|
4149
|
+
var appHomeUrl = import_zod13.z.url().max(500).refine((v) => {
|
|
4118
4150
|
try {
|
|
4119
4151
|
const u = new URL(v);
|
|
4120
4152
|
const hostOk = u.protocol === "https:" || u.protocol === "http:" && ["localhost", "127.0.0.1"].includes(u.hostname);
|
|
@@ -4123,24 +4155,24 @@ var appHomeUrl = import_zod12.z.url().max(500).refine((v) => {
|
|
|
4123
4155
|
return false;
|
|
4124
4156
|
}
|
|
4125
4157
|
}, { message: "An https URL (http only on localhost) without a placeholder." });
|
|
4126
|
-
var hostedAccent =
|
|
4127
|
-
var appHostedPages =
|
|
4128
|
-
invite_url:
|
|
4129
|
-
verify_url:
|
|
4130
|
-
reset_url:
|
|
4131
|
-
mcp_login_url:
|
|
4132
|
-
});
|
|
4133
|
-
var appAuthConfig =
|
|
4134
|
-
self_registration:
|
|
4158
|
+
var hostedAccent = import_zod13.z.string().regex(/^#[0-9a-f]{6}$/, "must be a lowercase hex colour, #rrggbb");
|
|
4159
|
+
var appHostedPages = import_zod13.z.object({
|
|
4160
|
+
invite_url: import_zod13.z.url().meta({ description: "The hosted invitation page, `<portal>/app/<identifier>/invite/{token}`." }),
|
|
4161
|
+
verify_url: import_zod13.z.url().meta({ description: "The hosted email-confirmation page, `<portal>/app/<identifier>/verify/{token}`." }),
|
|
4162
|
+
reset_url: import_zod13.z.url().meta({ description: "The hosted new-password page, `<portal>/app/<identifier>/reset/{token}`." }),
|
|
4163
|
+
mcp_login_url: import_zod13.z.url().meta({ description: "The hosted MCP sign-in, `<portal>/app/<identifier>/mcp/{interaction}`." })
|
|
4164
|
+
});
|
|
4165
|
+
var appAuthConfig = import_zod13.z.object({
|
|
4166
|
+
self_registration: import_zod13.z.boolean().meta({
|
|
4135
4167
|
description: "Whether a stranger may create an account in this app. Off refuses `POST /api/client/register` with `403 registration_closed`, and refuses an unknown identity at an OIDC callback with the same reasoning \u2014 one switch for one decision, whichever door the person arrives at."
|
|
4136
4168
|
}),
|
|
4137
|
-
allowed_domains:
|
|
4169
|
+
allowed_domains: import_zod13.z.array(emailDomain).max(50).meta({
|
|
4138
4170
|
description: 'The email domains self-registration accepts, lowercase. An empty list means no domain restriction, not "nobody" \u2014 the switch above is what closes the door. **An invitation always bypasses this**, by password and through a provider alike.'
|
|
4139
4171
|
}),
|
|
4140
|
-
allowed_origins:
|
|
4172
|
+
allowed_origins: import_zod13.z.array(allowedOrigin).max(20).meta({
|
|
4141
4173
|
description: "The origins the client auth API answers CORS for, and the only origins an OIDC `redirect_uri` may name. Bare origins: scheme, host and port, with no path \u2014 a browser sends nothing longer, so an entry carrying one could never match."
|
|
4142
4174
|
}),
|
|
4143
|
-
mcp_enabled:
|
|
4175
|
+
mcp_enabled: import_zod13.z.boolean().meta({
|
|
4144
4176
|
description: "Whether this app serves an MCP endpoint at `/mcp/<identifier>`. Off refuses the whole OAuth surface for the app, not merely the tool calls, and is re-read on every request rather than cached off a token."
|
|
4145
4177
|
}),
|
|
4146
4178
|
invite_url: appUrlTemplate("{token}").nullable().meta({
|
|
@@ -4158,13 +4190,19 @@ var appAuthConfig = import_zod12.z.object({
|
|
|
4158
4190
|
app_url: appHomeUrl.nullable().meta({
|
|
4159
4191
|
description: "The app's own home page, linked as `Open <app>` when a hosted flow is done. `null` makes the hosted done page say `You can close this tab`."
|
|
4160
4192
|
}),
|
|
4193
|
+
operator_info_url: httpsLegalUrl.nullable().meta({
|
|
4194
|
+
description: "Operator information / legal notice URL for this customer app. `null` means unset; cloud checks reachability and public addresses before allowing new app-user access flows."
|
|
4195
|
+
}),
|
|
4196
|
+
privacy_policy_url: httpsLegalUrl.nullable().meta({
|
|
4197
|
+
description: "Privacy policy URL for this customer app. `null` means unset; cloud checks reachability and public addresses before allowing new app-user access flows."
|
|
4198
|
+
}),
|
|
4161
4199
|
sign_in_methods: appSignInMethods.meta({
|
|
4162
4200
|
description: "Which sign-in methods the app offers: password, emailed code, or both \u2014 at least one. Identity providers stay on top of either. The default is password only."
|
|
4163
4201
|
}),
|
|
4164
4202
|
two_factor: appTwoFactorPolicy.meta({
|
|
4165
4203
|
description: "Whether the app asks for an authenticator code: `off` (the default), `optional` or `required`. A person with a confirmed authenticator is asked at every sign-in whatever the policy; a sign-in through an identity provider is never asked."
|
|
4166
4204
|
}),
|
|
4167
|
-
hosted_logo_url:
|
|
4205
|
+
hosted_logo_url: import_zod13.z.url().nullable().meta({
|
|
4168
4206
|
description: "Where the hosted pages load the app's logo from, `<portal>/app/<identifier>/logo`, or `null` when no logo is stored. **Read-only** \u2014 the logo is written through `PUT /api/apps/:id/auth-config/logo`."
|
|
4169
4207
|
}),
|
|
4170
4208
|
hosted_accent: hostedAccent.nullable().meta({
|
|
@@ -4173,212 +4211,278 @@ var appAuthConfig = import_zod12.z.object({
|
|
|
4173
4211
|
hosted_pages: appHostedPages.meta({
|
|
4174
4212
|
description: "The Fleetless-hosted pages an unset URL falls back to, as templates. **Read-only**: minted by the cloud from the auth portal and the app's identifier."
|
|
4175
4213
|
}),
|
|
4176
|
-
oidc_callback_url:
|
|
4214
|
+
oidc_callback_url: import_zod13.z.url().meta({
|
|
4177
4215
|
description: "The one callback URL to register at every identity provider, the same for every app and every provider. **Read-only** \u2014 it is minted by the cloud from its own public base URL, and a writable version of this field would let a caller point the return leg, which carries an authorization code, at a host they own."
|
|
4178
4216
|
}),
|
|
4179
|
-
updated_at:
|
|
4217
|
+
updated_at: import_zod13.z.iso.datetime().meta({ description: "When the configuration was last written, as an ISO 8601 timestamp." })
|
|
4180
4218
|
});
|
|
4181
4219
|
var putAppAuthRegistrationRequest = appAuthConfig.pick({ self_registration: true, allowed_domains: true, allowed_origins: true }).strict();
|
|
4182
4220
|
var putAppAuthSignInRequest = appAuthConfig.pick({ sign_in_methods: true, two_factor: true }).strict();
|
|
4183
|
-
var putAppAuthUrlsRequest = appAuthConfig.pick({
|
|
4221
|
+
var putAppAuthUrlsRequest = appAuthConfig.pick({
|
|
4222
|
+
app_url: true,
|
|
4223
|
+
invite_url: true,
|
|
4224
|
+
verify_url: true,
|
|
4225
|
+
reset_url: true,
|
|
4226
|
+
mcp_login_url: true,
|
|
4227
|
+
operator_info_url: true,
|
|
4228
|
+
privacy_policy_url: true
|
|
4229
|
+
}).strict();
|
|
4184
4230
|
var putAppAuthMcpRequest = appAuthConfig.pick({ mcp_enabled: true }).strict();
|
|
4185
4231
|
var putAppAuthLookRequest = appAuthConfig.pick({ hosted_accent: true }).strict();
|
|
4186
|
-
var mailTemplateKind =
|
|
4187
|
-
var
|
|
4232
|
+
var mailTemplateKind = import_zod13.z.enum(["invite", "verify", "reset", "login_code"]);
|
|
4233
|
+
var APP_LEGAL_MAIL_FOOTER = `{% if app.operator_info_url and app.privacy_policy_url %}
|
|
4234
|
+
|
|
4235
|
+
{{ app.name }} \xB7 Operator information: {{ app.operator_info_url }} \xB7 Privacy policy: {{ app.privacy_policy_url }}
|
|
4236
|
+
{% endif %}`;
|
|
4237
|
+
var DEFAULT_MAIL_TEMPLATES = {
|
|
4238
|
+
invite: {
|
|
4239
|
+
subject: "You're invited to {{ app.name }}",
|
|
4240
|
+
text: `Hello {{ user.display_name | default: user.email }},
|
|
4241
|
+
|
|
4242
|
+
{{ org.name }} has invited you to {{ app.name }} as {{ role.name }}.
|
|
4243
|
+
|
|
4244
|
+
Accept the invitation:
|
|
4245
|
+
{{ link }}
|
|
4246
|
+
|
|
4247
|
+
The link works for the next {% if expires_in_hours >= 48 %}{{ expires_in_hours | divided_by: 24 }} days{% elsif expires_in_hours == 1 %}1 hour{% else %}{{ expires_in_hours }} hours{% endif %}. If you were not expecting this invitation, ignore this mail \u2014 no account is created until you accept.
|
|
4248
|
+
${APP_LEGAL_MAIL_FOOTER}
|
|
4249
|
+
`,
|
|
4250
|
+
html: null
|
|
4251
|
+
},
|
|
4252
|
+
verify: {
|
|
4253
|
+
subject: "Confirm your email for {{ app.name }}",
|
|
4254
|
+
text: `Hello {{ user.email }},
|
|
4255
|
+
|
|
4256
|
+
Confirm this address so you can sign in to {{ app.name }}:
|
|
4257
|
+
{{ link }}
|
|
4258
|
+
|
|
4259
|
+
The link works for the next {% if expires_in_hours >= 48 %}{{ expires_in_hours | divided_by: 24 }} days{% elsif expires_in_hours == 1 %}1 hour{% else %}{{ expires_in_hours }} hours{% endif %}. If you did not create this account, ignore this mail \u2014 the account stays unconfirmed and cannot be used.
|
|
4260
|
+
${APP_LEGAL_MAIL_FOOTER}
|
|
4261
|
+
`,
|
|
4262
|
+
html: null
|
|
4263
|
+
},
|
|
4264
|
+
reset: {
|
|
4265
|
+
subject: "Reset your {{ app.name }} password",
|
|
4266
|
+
text: `Hello {{ user.email }},
|
|
4267
|
+
|
|
4268
|
+
Someone asked to reset the password for this address at {{ app.name }}.
|
|
4269
|
+
|
|
4270
|
+
Choose a new password:
|
|
4271
|
+
{{ link }}
|
|
4272
|
+
|
|
4273
|
+
The link works for the next {% if expires_in_hours >= 48 %}{{ expires_in_hours | divided_by: 24 }} days{% elsif expires_in_hours == 1 %}1 hour{% else %}{{ expires_in_hours }} hours{% endif %}. If it was not you, ignore this mail \u2014 your current password keeps working and nothing changes.
|
|
4274
|
+
${APP_LEGAL_MAIL_FOOTER}
|
|
4275
|
+
`,
|
|
4276
|
+
html: null
|
|
4277
|
+
},
|
|
4278
|
+
login_code: {
|
|
4279
|
+
subject: "Your {{ app.name }} sign-in code",
|
|
4280
|
+
text: `Your sign-in code for {{ app.name }} is {{ code }}.
|
|
4281
|
+
|
|
4282
|
+
It works once, for {{ expires_in_minutes }} minutes. If you did not ask for it, ignore this mail.
|
|
4283
|
+
|
|
4284
|
+
${APP_LEGAL_MAIL_FOOTER}`,
|
|
4285
|
+
html: null
|
|
4286
|
+
}
|
|
4287
|
+
};
|
|
4288
|
+
var appMailTemplate = import_zod13.z.object({
|
|
4188
4289
|
kind: mailTemplateKind.meta({ description: "Which of the four mails this template replaces." }),
|
|
4189
|
-
subject:
|
|
4190
|
-
text:
|
|
4191
|
-
html:
|
|
4192
|
-
updated_at:
|
|
4290
|
+
subject: import_zod13.z.string().min(1).max(200).meta({ description: "The subject line, a Liquid template. Bounded because a subject is rendered into a header." }),
|
|
4291
|
+
text: import_zod13.z.string().min(1).max(2e4).meta({ description: "The plain-text body, a Liquid template. Required even when an HTML part is given: a mail with no text part is unreadable to a client that refuses HTML." }),
|
|
4292
|
+
html: import_zod13.z.string().min(1).max(1e5).nullable().meta({ description: "The optional HTML body, a Liquid template. `null` means this template is text-only, which is a complete mail and not a half-configured one." }),
|
|
4293
|
+
updated_at: import_zod13.z.iso.datetime().meta({ description: "When the template was last written, as an ISO 8601 timestamp." })
|
|
4193
4294
|
});
|
|
4194
|
-
var appMailTemplateListResponse =
|
|
4195
|
-
templates:
|
|
4295
|
+
var appMailTemplateListResponse = import_zod13.z.object({
|
|
4296
|
+
templates: import_zod13.z.array(appMailTemplate).max(4).meta({
|
|
4196
4297
|
description: "The app's custom templates. A kind that does not appear is one using the Fleetless default text \u2014 an ordinary state, not a missing row."
|
|
4197
4298
|
})
|
|
4198
4299
|
});
|
|
4199
|
-
var mailTemplateBody = appMailTemplate.omit({ kind: true, updated_at: true }).extend({ html:
|
|
4300
|
+
var mailTemplateBody = appMailTemplate.omit({ kind: true, updated_at: true }).extend({ html: import_zod13.z.string().min(1).max(1e5).nullable().optional() });
|
|
4200
4301
|
var putAppMailTemplateRequest = mailTemplateBody.strict();
|
|
4201
4302
|
var mailTemplatePreviewRequest = mailTemplateBody.strict();
|
|
4202
|
-
var mailTemplatePreviewResponse =
|
|
4203
|
-
subject:
|
|
4204
|
-
text:
|
|
4205
|
-
html:
|
|
4303
|
+
var mailTemplatePreviewResponse = import_zod13.z.object({
|
|
4304
|
+
subject: import_zod13.z.string().meta({ description: "The rendered subject line." }),
|
|
4305
|
+
text: import_zod13.z.string().meta({ description: "The rendered plain-text body." }),
|
|
4306
|
+
html: import_zod13.z.string().nullable().meta({ description: "The rendered HTML body, or `null` when the template is text-only." })
|
|
4206
4307
|
});
|
|
4207
|
-
var mailTemplateProblemDetails =
|
|
4208
|
-
part:
|
|
4209
|
-
message:
|
|
4308
|
+
var mailTemplateProblemDetails = import_zod13.z.object({
|
|
4309
|
+
part: import_zod13.z.enum(["subject", "text", "html"]).meta({ description: "Which of the three rendered parts failed." }),
|
|
4310
|
+
message: import_zod13.z.string().meta({ description: "The renderer's own message \u2014 the unknown variable, or the syntax error and where it is." })
|
|
4210
4311
|
});
|
|
4211
|
-
var mailOutcome =
|
|
4312
|
+
var mailOutcome = import_zod13.z.object({
|
|
4212
4313
|
mail: mailStatus.meta({
|
|
4213
4314
|
description: "What happened to the mail this call triggered. `sent` means the SMTP server accepted it, not that it was delivered; `not_requested` means none was attempted, because the caller asked for none or there was no link to carry; `not_configured` is an expected state and not a failure; `failed` is the one worth somebody's attention."
|
|
4214
4315
|
})
|
|
4215
4316
|
});
|
|
4216
4317
|
|
|
4217
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
4218
|
-
var clientLoginRequest =
|
|
4318
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/client-auth.js
|
|
4319
|
+
var clientLoginRequest = import_zod14.z.object({
|
|
4219
4320
|
app_identifier: appIdentifier.meta({
|
|
4220
4321
|
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."
|
|
4221
4322
|
}),
|
|
4222
|
-
email:
|
|
4323
|
+
email: import_zod14.z.email().meta({
|
|
4223
4324
|
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."
|
|
4224
4325
|
}),
|
|
4225
|
-
password:
|
|
4326
|
+
password: import_zod14.z.string().min(1).meta({
|
|
4226
4327
|
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."
|
|
4227
4328
|
})
|
|
4228
4329
|
});
|
|
4229
|
-
var clientRefreshRequest =
|
|
4230
|
-
refresh_token:
|
|
4330
|
+
var clientRefreshRequest = import_zod14.z.object({
|
|
4331
|
+
refresh_token: import_zod14.z.string().min(1).meta({
|
|
4231
4332
|
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."
|
|
4232
4333
|
})
|
|
4233
4334
|
});
|
|
4234
|
-
var clientLogoutRequest =
|
|
4235
|
-
refresh_token:
|
|
4335
|
+
var clientLogoutRequest = import_zod14.z.object({
|
|
4336
|
+
refresh_token: import_zod14.z.string().min(1).meta({
|
|
4236
4337
|
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."
|
|
4237
4338
|
})
|
|
4238
4339
|
});
|
|
4239
|
-
var clientLoginCodeRequest =
|
|
4340
|
+
var clientLoginCodeRequest = import_zod14.z.object({
|
|
4240
4341
|
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." }),
|
|
4241
|
-
email:
|
|
4342
|
+
email: import_zod14.z.email().meta({
|
|
4242
4343
|
description: "The address to mail the code to, trimmed and compared case-insensitively. `202` whether or not it names an account of this app."
|
|
4243
4344
|
})
|
|
4244
4345
|
}).strict();
|
|
4245
|
-
var clientLoginCodeVerifyRequest =
|
|
4346
|
+
var clientLoginCodeVerifyRequest = import_zod14.z.object({
|
|
4246
4347
|
app_identifier: appIdentifier.meta({ description: "The app the code was requested for." }),
|
|
4247
|
-
email:
|
|
4348
|
+
email: import_zod14.z.email().meta({ description: "The address the code was mailed to, as typed when it was requested; trimmed and compared case-insensitively." }),
|
|
4248
4349
|
code: loginCode.meta({ description: "The six digits from the mail, exactly \u2014 leading zeros included, no spaces." })
|
|
4249
4350
|
}).strict();
|
|
4250
|
-
var twoFactorChallenge =
|
|
4251
|
-
status:
|
|
4351
|
+
var twoFactorChallenge = import_zod14.z.object({
|
|
4352
|
+
status: import_zod14.z.enum(["two_factor_required", "two_factor_setup_required"]).meta({
|
|
4252
4353
|
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."
|
|
4253
4354
|
}),
|
|
4254
|
-
challenge:
|
|
4355
|
+
challenge: import_zod14.z.string().min(1).meta({
|
|
4255
4356
|
description: "The handle the next step spends. Valid five minutes; afterwards it answers `410 token_spent` and the sign-in starts over."
|
|
4256
4357
|
})
|
|
4257
4358
|
});
|
|
4258
|
-
var clientSignInResult =
|
|
4259
|
-
var clientTwoFactorVerifyRequest =
|
|
4260
|
-
challenge:
|
|
4359
|
+
var clientSignInResult = import_zod14.z.union([sessionTokens, twoFactorChallenge]);
|
|
4360
|
+
var clientTwoFactorVerifyRequest = import_zod14.z.object({
|
|
4361
|
+
challenge: import_zod14.z.string().min(1).meta({ description: "The challenge the sign-in step answered." }),
|
|
4261
4362
|
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." }),
|
|
4262
4363
|
recovery_code: recoveryCode.optional().meta({ description: "One of the ten recovery codes, `xxxxx-xxxxx`, in either case. Spent by its use." })
|
|
4263
4364
|
}).strict().refine((b) => b.code === void 0 !== (b.recovery_code === void 0), { message: "Send exactly one of code and recovery_code." });
|
|
4264
|
-
var clientTwoFactorSetupRequest =
|
|
4265
|
-
challenge:
|
|
4365
|
+
var clientTwoFactorSetupRequest = import_zod14.z.object({
|
|
4366
|
+
challenge: import_zod14.z.string().min(1).optional().meta({
|
|
4266
4367
|
description: "The `two_factor_setup_required` challenge, during sign-in. Absent when the call carries the app user's bearer instead."
|
|
4267
4368
|
})
|
|
4268
4369
|
}).strict();
|
|
4269
|
-
var clientTwoFactorSetupConfirmRequest =
|
|
4270
|
-
challenge:
|
|
4370
|
+
var clientTwoFactorSetupConfirmRequest = import_zod14.z.object({
|
|
4371
|
+
challenge: import_zod14.z.string().min(1).optional().meta({ description: "The same challenge as at `setup`, during sign-in; absent with a bearer." }),
|
|
4271
4372
|
code: totpCode.meta({ description: "A code the new authenticator shows now. It proves the secret was copied correctly before anything depends on it." })
|
|
4272
4373
|
}).strict();
|
|
4273
|
-
var clientTwoFactorSetupConfirmResponse =
|
|
4374
|
+
var clientTwoFactorSetupConfirmResponse = import_zod14.z.object({
|
|
4274
4375
|
recovery_codes: recoveryCodesList.meta({
|
|
4275
4376
|
description: "The ten single-use recovery codes, lowercase, shown once. Any earlier set is void."
|
|
4276
4377
|
}),
|
|
4277
4378
|
session: sessionTokens.meta({ description: "The session the sign-in was waiting for, or a fresh one for the account settings." })
|
|
4278
4379
|
});
|
|
4279
|
-
var clientTwoFactorDisableRequest =
|
|
4380
|
+
var clientTwoFactorDisableRequest = import_zod14.z.object({
|
|
4280
4381
|
code: totpCode.meta({ description: "A code the authenticator shows now." })
|
|
4281
4382
|
}).strict();
|
|
4282
|
-
var clientRegisterRequest =
|
|
4383
|
+
var clientRegisterRequest = import_zod14.z.object({
|
|
4283
4384
|
app_identifier: appIdentifier.meta({
|
|
4284
4385
|
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."
|
|
4285
4386
|
}),
|
|
4286
|
-
email:
|
|
4387
|
+
email: import_zod14.z.email().meta({
|
|
4287
4388
|
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."
|
|
4288
4389
|
}),
|
|
4289
4390
|
password: password.optional().meta({
|
|
4290
4391
|
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."
|
|
4291
4392
|
}),
|
|
4292
|
-
display_name:
|
|
4393
|
+
display_name: import_zod14.z.string().min(1).max(APP_USER_DISPLAY_NAME_MAX).nullable().optional().meta({
|
|
4293
4394
|
description: "An optional human name for the account. The developer's own UI decides whether to ask for it."
|
|
4294
4395
|
})
|
|
4295
4396
|
}).strict();
|
|
4296
|
-
var clientVerifyEmailRequest =
|
|
4297
|
-
token:
|
|
4397
|
+
var clientVerifyEmailRequest = import_zod14.z.object({
|
|
4398
|
+
token: import_zod14.z.string().min(1).meta({
|
|
4298
4399
|
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."
|
|
4299
4400
|
})
|
|
4300
4401
|
}).strict();
|
|
4301
|
-
var clientResendVerificationRequest =
|
|
4402
|
+
var clientResendVerificationRequest = import_zod14.z.object({
|
|
4302
4403
|
app_identifier: appIdentifier.meta({ description: "The app the address belongs to." }),
|
|
4303
|
-
email:
|
|
4404
|
+
email: import_zod14.z.email().meta({
|
|
4304
4405
|
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."
|
|
4305
4406
|
})
|
|
4306
4407
|
}).strict();
|
|
4307
|
-
var clientPasswordResetRequest =
|
|
4408
|
+
var clientPasswordResetRequest = import_zod14.z.object({
|
|
4308
4409
|
app_identifier: appIdentifier.meta({ description: "The app the address belongs to." }),
|
|
4309
|
-
email:
|
|
4410
|
+
email: import_zod14.z.email().meta({
|
|
4310
4411
|
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."
|
|
4311
4412
|
})
|
|
4312
4413
|
}).strict();
|
|
4313
|
-
var clientPasswordResetConfirmRequest =
|
|
4314
|
-
token:
|
|
4414
|
+
var clientPasswordResetConfirmRequest = import_zod14.z.object({
|
|
4415
|
+
token: import_zod14.z.string().min(1).meta({
|
|
4315
4416
|
description: "The opaque token from the reset link, valid one hour. Single-use; unknown, expired and spent all answer `410 token_spent`."
|
|
4316
4417
|
}),
|
|
4317
4418
|
new_password: password.meta({
|
|
4318
4419
|
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."
|
|
4319
4420
|
})
|
|
4320
4421
|
}).strict();
|
|
4321
|
-
var clientAcceptInvitationRequest =
|
|
4322
|
-
token:
|
|
4422
|
+
var clientAcceptInvitationRequest = import_zod14.z.object({
|
|
4423
|
+
token: import_zod14.z.string().min(1).meta({
|
|
4323
4424
|
description: "The opaque token from the invitation link, valid seven days. Unknown, expired, revoked and already-accepted all answer `410 token_spent`."
|
|
4324
4425
|
}),
|
|
4325
4426
|
password: password.optional().meta({
|
|
4326
4427
|
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."
|
|
4327
4428
|
}),
|
|
4328
|
-
display_name:
|
|
4429
|
+
display_name: import_zod14.z.string().min(1).max(APP_USER_DISPLAY_NAME_MAX).nullable().optional().meta({
|
|
4329
4430
|
description: "An optional name, overriding whatever the invitation pre-filled."
|
|
4330
4431
|
})
|
|
4331
4432
|
}).strict();
|
|
4332
4433
|
var CLIENT_OIDC_CALLBACK_PATH = "/api/client/oidc/callback";
|
|
4333
|
-
var clientProviderListQuery =
|
|
4434
|
+
var clientProviderListQuery = import_zod14.z.object({
|
|
4334
4435
|
app_identifier: appIdentifier.meta({ description: "The app whose enabled providers to list." })
|
|
4335
4436
|
}).meta({ description: "The one parameter of the public provider listing." });
|
|
4336
|
-
var clientProviderListResponse =
|
|
4337
|
-
providers:
|
|
4437
|
+
var clientProviderListResponse = import_zod14.z.object({
|
|
4438
|
+
providers: import_zod14.z.array(import_zod14.z.object({
|
|
4338
4439
|
slug: providerSlug.meta({ description: "The handle to put in the start URL: `GET /api/client/oidc/<slug>/start`." }),
|
|
4339
|
-
name:
|
|
4440
|
+
name: import_zod14.z.string().meta({ description: "What to write on the button, as the developer configured it." })
|
|
4340
4441
|
})).meta({
|
|
4341
4442
|
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."
|
|
4342
4443
|
}),
|
|
4343
4444
|
sign_in_methods: appSignInMethods.meta({
|
|
4344
4445
|
description: "Which of password and emailed code the app accepts, so its sign-in page draws the right fields without guessing. The same value the developer set; public, like the provider buttons."
|
|
4446
|
+
}),
|
|
4447
|
+
two_factor: appTwoFactorPolicy.meta({
|
|
4448
|
+
description: "The app's off, optional or required two-factor policy; not the caller's enrollment state."
|
|
4345
4449
|
})
|
|
4346
4450
|
});
|
|
4347
|
-
var clientOidcStartQuery =
|
|
4451
|
+
var clientOidcStartQuery = import_zod14.z.object({
|
|
4348
4452
|
app_identifier: appIdentifier.meta({ description: "The app being signed in to." }),
|
|
4349
|
-
redirect_uri:
|
|
4453
|
+
redirect_uri: import_zod14.z.url().max(2e3).meta({
|
|
4350
4454
|
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."
|
|
4351
4455
|
}),
|
|
4352
|
-
state:
|
|
4456
|
+
state: import_zod14.z.string().min(8).max(512).meta({
|
|
4353
4457
|
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."
|
|
4354
4458
|
}),
|
|
4355
|
-
code_challenge:
|
|
4459
|
+
code_challenge: import_zod14.z.string().regex(/^[A-Za-z0-9_-]{43,128}$/).meta({
|
|
4356
4460
|
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."
|
|
4357
4461
|
})
|
|
4358
4462
|
});
|
|
4359
|
-
var clientOidcCallbackQuery =
|
|
4360
|
-
state:
|
|
4463
|
+
var clientOidcCallbackQuery = import_zod14.z.object({
|
|
4464
|
+
state: import_zod14.z.string().min(1).meta({
|
|
4361
4465
|
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."
|
|
4362
4466
|
}),
|
|
4363
|
-
code:
|
|
4467
|
+
code: import_zod14.z.string().min(1).optional().meta({
|
|
4364
4468
|
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`."
|
|
4365
4469
|
}),
|
|
4366
|
-
error:
|
|
4470
|
+
error: import_zod14.z.string().min(1).optional().meta({
|
|
4367
4471
|
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."
|
|
4368
4472
|
}),
|
|
4369
|
-
error_description:
|
|
4473
|
+
error_description: import_zod14.z.string().optional().meta({
|
|
4370
4474
|
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."
|
|
4371
4475
|
})
|
|
4372
4476
|
});
|
|
4373
|
-
var clientOidcExchangeRequest =
|
|
4374
|
-
code:
|
|
4477
|
+
var clientOidcExchangeRequest = import_zod14.z.object({
|
|
4478
|
+
code: import_zod14.z.string().min(1).meta({
|
|
4375
4479
|
description: "The one-time code from the callback redirect. Valid 60 seconds, single-use, and bound to the PKCE challenge the start step carried."
|
|
4376
4480
|
}),
|
|
4377
|
-
code_verifier:
|
|
4481
|
+
code_verifier: import_zod14.z.string().regex(/^[A-Za-z0-9_.~-]{43,128}$/).meta({
|
|
4378
4482
|
description: "The verifier for the challenge sent at `start`. RFC 7636 \xA74.1's alphabet and length."
|
|
4379
4483
|
})
|
|
4380
4484
|
}).strict();
|
|
4381
|
-
var clientOidcErrorCode =
|
|
4485
|
+
var clientOidcErrorCode = import_zod14.z.enum([
|
|
4382
4486
|
"no_access",
|
|
4383
4487
|
"email_taken",
|
|
4384
4488
|
"email_unverified",
|
|
@@ -4393,89 +4497,89 @@ var clientOidcErrorCode = import_zod13.z.enum([
|
|
|
4393
4497
|
"quota_exceeded",
|
|
4394
4498
|
"plan_limit"
|
|
4395
4499
|
]);
|
|
4396
|
-
var clientMcpInteraction =
|
|
4397
|
-
id:
|
|
4398
|
-
app_id:
|
|
4399
|
-
client_name:
|
|
4400
|
-
client_name_verified:
|
|
4500
|
+
var clientMcpInteraction = import_zod14.z.object({
|
|
4501
|
+
id: import_zod14.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." }),
|
|
4502
|
+
app_id: import_zod14.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." }),
|
|
4503
|
+
client_name: import_zod14.z.string().nullable().meta({ description: "What the MCP client calls itself, or `null` if it named nothing. **Unverified** \u2014 see `client_name_verified`." }),
|
|
4504
|
+
client_name_verified: import_zod14.z.literal(false).meta({
|
|
4401
4505
|
description: "Always `false`. The client registered itself without authentication and named itself, so it must be rendered as a claim and never as an identity. 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."
|
|
4402
4506
|
}),
|
|
4403
|
-
scopes:
|
|
4404
|
-
already_granted:
|
|
4405
|
-
expires_at:
|
|
4507
|
+
scopes: import_zod14.z.array(import_zod14.z.string()).meta({ description: "The scopes the client asked for, to show the person before they approve." }),
|
|
4508
|
+
already_granted: import_zod14.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." }),
|
|
4509
|
+
expires_at: import_zod14.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`." })
|
|
4406
4510
|
});
|
|
4407
|
-
var clientMcpInteractionDecisionResponse =
|
|
4408
|
-
redirect_to:
|
|
4511
|
+
var clientMcpInteractionDecisionResponse = import_zod14.z.object({
|
|
4512
|
+
redirect_to: import_zod14.z.url().meta({
|
|
4409
4513
|
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."
|
|
4410
4514
|
})
|
|
4411
4515
|
});
|
|
4412
|
-
var mcpConsentGrant =
|
|
4413
|
-
client_id:
|
|
4516
|
+
var mcpConsentGrant = import_zod14.z.object({
|
|
4517
|
+
client_id: import_zod14.z.string().meta({
|
|
4414
4518
|
description: "The MCP client this consent is for, as its dynamic registration was issued. It is the value the withdrawal routes take in their path, and it is the only stable handle on a client \u2014 the name beside it is not one."
|
|
4415
4519
|
}),
|
|
4416
|
-
client_name:
|
|
4520
|
+
client_name: import_zod14.z.string().nullable().meta({
|
|
4417
4521
|
description: "What the client calls itself, or `null` once its registration is gone. **Unverified** \u2014 see `client_name_verified`."
|
|
4418
4522
|
}),
|
|
4419
|
-
client_name_verified:
|
|
4523
|
+
client_name_verified: import_zod14.z.literal(false).meta({
|
|
4420
4524
|
description: "Always `false`. The client registered itself without authentication and named itself, so it must be rendered as a claim and never as an identity. 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."
|
|
4421
4525
|
}),
|
|
4422
|
-
granted_at:
|
|
4526
|
+
granted_at: import_zod14.z.iso.datetime().meta({
|
|
4423
4527
|
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."
|
|
4424
4528
|
})
|
|
4425
4529
|
});
|
|
4426
|
-
var mcpConsentGrantListResponse =
|
|
4427
|
-
grants:
|
|
4530
|
+
var mcpConsentGrantListResponse = import_zod14.z.object({
|
|
4531
|
+
grants: import_zod14.z.array(mcpConsentGrant).meta({
|
|
4428
4532
|
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."
|
|
4429
4533
|
})
|
|
4430
4534
|
});
|
|
4431
|
-
var clientIdentity =
|
|
4432
|
-
kind:
|
|
4535
|
+
var clientIdentity = import_zod14.z.object({
|
|
4536
|
+
kind: import_zod14.z.enum(["developer", "app_user", "server_key"]).meta({
|
|
4433
4537
|
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."
|
|
4434
4538
|
}),
|
|
4435
|
-
developer_id:
|
|
4539
|
+
developer_id: import_zod14.z.uuid().nullable().meta({
|
|
4436
4540
|
description: "The Fleetless user behind this session, or `null` when `kind` is not `developer`."
|
|
4437
4541
|
}),
|
|
4438
|
-
app_user_id:
|
|
4542
|
+
app_user_id: import_zod14.z.uuid().nullable().meta({
|
|
4439
4543
|
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."
|
|
4440
4544
|
}),
|
|
4441
|
-
server_key_id:
|
|
4545
|
+
server_key_id: import_zod14.z.uuid().nullable().meta({
|
|
4442
4546
|
description: "The server key this session was authenticated with, or `null` when `kind` is not `server_key`."
|
|
4443
4547
|
}),
|
|
4444
|
-
app_id:
|
|
4548
|
+
app_id: import_zod14.z.uuid().nullable().meta({
|
|
4445
4549
|
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."
|
|
4446
4550
|
}),
|
|
4447
|
-
role_id:
|
|
4551
|
+
role_id: import_zod14.z.uuid().nullable().meta({
|
|
4448
4552
|
description: "The role that decides what this caller may reach, and `null` for a developer. Roles are the only visibility filter: what a role does not grant does not exist for that user."
|
|
4449
4553
|
}),
|
|
4450
|
-
email:
|
|
4554
|
+
email: import_zod14.z.email().nullable().meta({
|
|
4451
4555
|
description: "The address of the Fleetless user or app user behind this session, and `null` for a server key, which is not a person."
|
|
4452
4556
|
}),
|
|
4453
|
-
two_factor_enabled:
|
|
4557
|
+
two_factor_enabled: import_zod14.z.boolean().nullable().meta({
|
|
4454
4558
|
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`."
|
|
4455
4559
|
})
|
|
4456
4560
|
});
|
|
4457
4561
|
|
|
4458
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
4459
|
-
var clientAuth =
|
|
4460
|
-
type:
|
|
4461
|
-
token:
|
|
4562
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/realtime.js
|
|
4563
|
+
var clientAuth = import_zod15.z.object({
|
|
4564
|
+
type: import_zod15.z.literal("auth"),
|
|
4565
|
+
token: import_zod15.z.string().min(1)
|
|
4462
4566
|
});
|
|
4463
|
-
var authOk =
|
|
4464
|
-
type:
|
|
4567
|
+
var authOk = import_zod15.z.object({
|
|
4568
|
+
type: import_zod15.z.literal("auth_ok"),
|
|
4465
4569
|
identity: clientIdentity
|
|
4466
4570
|
});
|
|
4467
|
-
var authError =
|
|
4468
|
-
type:
|
|
4469
|
-
code:
|
|
4470
|
-
message:
|
|
4571
|
+
var authError = import_zod15.z.object({
|
|
4572
|
+
type: import_zod15.z.literal("auth_error"),
|
|
4573
|
+
code: import_zod15.z.string().min(1),
|
|
4574
|
+
message: import_zod15.z.string().min(1)
|
|
4471
4575
|
});
|
|
4472
|
-
var clientInvoke =
|
|
4473
|
-
type:
|
|
4474
|
-
request_id:
|
|
4475
|
-
robot_id:
|
|
4576
|
+
var clientInvoke = import_zod15.z.object({
|
|
4577
|
+
type: import_zod15.z.literal("invoke"),
|
|
4578
|
+
request_id: import_zod15.z.string().min(1).max(64),
|
|
4579
|
+
robot_id: import_zod15.z.uuid(),
|
|
4476
4580
|
slug,
|
|
4477
4581
|
/** Parameters by field path, validated against the configuration's rules. */
|
|
4478
|
-
params:
|
|
4582
|
+
params: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.unknown()),
|
|
4479
4583
|
/**
|
|
4480
4584
|
* How long this one call is worth waiting for — the same field, meaning and
|
|
4481
4585
|
* cap as `invokeRequest.patience_ms`; absent means `DEFAULT_PATIENCE_MS`.
|
|
@@ -4485,12 +4589,12 @@ var clientInvoke = import_zod14.z.object({
|
|
|
4485
4589
|
* unreachable to every caller that invokes over the realtime channel, while
|
|
4486
4590
|
* still appearing in the documentation.
|
|
4487
4591
|
*/
|
|
4488
|
-
patience_ms:
|
|
4592
|
+
patience_ms: import_zod15.z.number().int().min(MIN_PATIENCE_MS).max(MAX_PATIENCE_MS).optional()
|
|
4489
4593
|
});
|
|
4490
|
-
var clientCancel =
|
|
4491
|
-
type:
|
|
4492
|
-
request_id:
|
|
4493
|
-
robot_id:
|
|
4594
|
+
var clientCancel = import_zod15.z.object({
|
|
4595
|
+
type: import_zod15.z.literal("cancel"),
|
|
4596
|
+
request_id: import_zod15.z.string().min(1).max(64),
|
|
4597
|
+
robot_id: import_zod15.z.uuid(),
|
|
4494
4598
|
/** Which slug — required, and the coarse address of a cancel. */
|
|
4495
4599
|
slug,
|
|
4496
4600
|
/**
|
|
@@ -4508,19 +4612,19 @@ var clientCancel = import_zod14.z.object({
|
|
|
4508
4612
|
* back to the slug. Falling back would be the platform deciding that the
|
|
4509
4613
|
* caller did not really mean the id they typed.
|
|
4510
4614
|
*/
|
|
4511
|
-
job_id:
|
|
4615
|
+
job_id: import_zod15.z.uuid().nullable()
|
|
4512
4616
|
});
|
|
4513
|
-
var clientPublish =
|
|
4514
|
-
type:
|
|
4515
|
-
request_id:
|
|
4516
|
-
robot_id:
|
|
4617
|
+
var clientPublish = import_zod15.z.object({
|
|
4618
|
+
type: import_zod15.z.literal("publish"),
|
|
4619
|
+
request_id: import_zod15.z.string().min(1).max(64),
|
|
4620
|
+
robot_id: import_zod15.z.uuid(),
|
|
4517
4621
|
slug,
|
|
4518
|
-
message:
|
|
4622
|
+
message: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.unknown())
|
|
4519
4623
|
});
|
|
4520
|
-
var commandResult =
|
|
4521
|
-
type:
|
|
4522
|
-
request_id:
|
|
4523
|
-
ok:
|
|
4624
|
+
var commandResult = import_zod15.z.object({
|
|
4625
|
+
type: import_zod15.z.literal("command_result"),
|
|
4626
|
+
request_id: import_zod15.z.string().min(1).max(64),
|
|
4627
|
+
ok: import_zod15.z.boolean(),
|
|
4524
4628
|
/**
|
|
4525
4629
|
* The job this reply is *about* — which is not always the caller's own.
|
|
4526
4630
|
*
|
|
@@ -4544,9 +4648,9 @@ var commandResult = import_zod14.z.object({
|
|
|
4544
4648
|
* later. Returning the kind lets a client refuse its own mistake at once,
|
|
4545
4649
|
* instead of reporting it as the machine's.
|
|
4546
4650
|
*/
|
|
4547
|
-
kind:
|
|
4548
|
-
code:
|
|
4549
|
-
message:
|
|
4651
|
+
kind: import_zod15.z.enum(["datapoint", "action", "service", "publisher", "camera"]).nullable(),
|
|
4652
|
+
code: import_zod15.z.string().nullable(),
|
|
4653
|
+
message: import_zod15.z.string().nullable(),
|
|
4550
4654
|
/**
|
|
4551
4655
|
* The same payload the REST envelope carries in `apiError.details` — for
|
|
4552
4656
|
* `parameter_invalid`, a `parameterInvalidDetails`.
|
|
@@ -4557,16 +4661,16 @@ var commandResult = import_zod14.z.object({
|
|
|
4557
4661
|
* socket. A client cannot bind an error to the input that caused it from a
|
|
4558
4662
|
* code alone, which is the entire point of the flat parameter shape.
|
|
4559
4663
|
*/
|
|
4560
|
-
details:
|
|
4664
|
+
details: import_zod15.z.unknown().optional()
|
|
4561
4665
|
});
|
|
4562
|
-
var errorFrame =
|
|
4563
|
-
type:
|
|
4564
|
-
code:
|
|
4565
|
-
message:
|
|
4666
|
+
var errorFrame = import_zod15.z.object({
|
|
4667
|
+
type: import_zod15.z.literal("error"),
|
|
4668
|
+
code: import_zod15.z.string().min(1),
|
|
4669
|
+
message: import_zod15.z.string().min(1)
|
|
4566
4670
|
});
|
|
4567
|
-
var clientSubscribe =
|
|
4568
|
-
type:
|
|
4569
|
-
robot_id:
|
|
4671
|
+
var clientSubscribe = import_zod15.z.object({
|
|
4672
|
+
type: import_zod15.z.literal("subscribe"),
|
|
4673
|
+
robot_id: import_zod15.z.uuid(),
|
|
4570
4674
|
slug,
|
|
4571
4675
|
/**
|
|
4572
4676
|
* What the subscriber expects, and how it wants it.
|
|
@@ -4586,29 +4690,29 @@ var clientSubscribe = import_zod14.z.object({
|
|
|
4586
4690
|
* request was the same mistake as the silent wrong-verb subscribe this
|
|
4587
4691
|
* field was added to fix.
|
|
4588
4692
|
*/
|
|
4589
|
-
kind:
|
|
4590
|
-
options:
|
|
4693
|
+
kind: import_zod15.z.enum(["datapoint", "action", "service", "publisher", "camera"]).optional(),
|
|
4694
|
+
options: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.unknown()).optional()
|
|
4591
4695
|
});
|
|
4592
|
-
var clientUnsubscribe =
|
|
4593
|
-
type:
|
|
4594
|
-
robot_id:
|
|
4696
|
+
var clientUnsubscribe = import_zod15.z.object({
|
|
4697
|
+
type: import_zod15.z.literal("unsubscribe"),
|
|
4698
|
+
robot_id: import_zod15.z.uuid(),
|
|
4595
4699
|
slug
|
|
4596
4700
|
});
|
|
4597
|
-
var subscribeError =
|
|
4598
|
-
type:
|
|
4599
|
-
robot_id:
|
|
4600
|
-
slug:
|
|
4601
|
-
code:
|
|
4602
|
-
message:
|
|
4701
|
+
var subscribeError = import_zod15.z.object({
|
|
4702
|
+
type: import_zod15.z.literal("subscribe_error"),
|
|
4703
|
+
robot_id: import_zod15.z.string(),
|
|
4704
|
+
slug: import_zod15.z.string(),
|
|
4705
|
+
code: import_zod15.z.string().min(1),
|
|
4706
|
+
message: import_zod15.z.string().min(1)
|
|
4603
4707
|
});
|
|
4604
|
-
var datapointEvent =
|
|
4605
|
-
type:
|
|
4606
|
-
robot_id:
|
|
4708
|
+
var datapointEvent = import_zod15.z.object({
|
|
4709
|
+
type: import_zod15.z.literal("datapoint"),
|
|
4710
|
+
robot_id: import_zod15.z.uuid(),
|
|
4607
4711
|
slug,
|
|
4608
|
-
value:
|
|
4609
|
-
timestamp_ms:
|
|
4712
|
+
value: import_zod15.z.unknown(),
|
|
4713
|
+
timestamp_ms: import_zod15.z.number().int().nonnegative()
|
|
4610
4714
|
});
|
|
4611
|
-
var liveSessionEndReason =
|
|
4715
|
+
var liveSessionEndReason = import_zod15.z.enum([
|
|
4612
4716
|
/** Another holder of this camera released it — another tab, or another client. */
|
|
4613
4717
|
"released_by_peer",
|
|
4614
4718
|
/** The robot's configuration was published and this camera changed with it. */
|
|
@@ -4637,12 +4741,12 @@ var liveSessionEndReason = import_zod14.z.enum([
|
|
|
4637
4741
|
*/
|
|
4638
4742
|
"unknown"
|
|
4639
4743
|
]);
|
|
4640
|
-
var liveSessionEvent =
|
|
4641
|
-
type:
|
|
4642
|
-
robot_id:
|
|
4744
|
+
var liveSessionEvent = import_zod15.z.object({
|
|
4745
|
+
type: import_zod15.z.literal("live_session"),
|
|
4746
|
+
robot_id: import_zod15.z.uuid(),
|
|
4643
4747
|
slug,
|
|
4644
|
-
session_id:
|
|
4645
|
-
state:
|
|
4748
|
+
session_id: import_zod15.z.uuid(),
|
|
4749
|
+
state: import_zod15.z.literal("ended"),
|
|
4646
4750
|
reason: liveSessionEndReason,
|
|
4647
4751
|
/**
|
|
4648
4752
|
* **Classified text the cloud produced, never text the robot sent.**
|
|
@@ -4657,47 +4761,47 @@ var liveSessionEvent = import_zod14.z.object({
|
|
|
4657
4761
|
* code with fixed text, the way camera health already does it — not as
|
|
4658
4762
|
* forwarded foreign text on a channel a client reads.
|
|
4659
4763
|
*/
|
|
4660
|
-
detail:
|
|
4764
|
+
detail: import_zod15.z.string().max(200).nullable(),
|
|
4661
4765
|
/** When it ended — not when this frame was sent. Same reasoning as `changed_at_ms`. */
|
|
4662
|
-
ended_at_ms:
|
|
4663
|
-
});
|
|
4664
|
-
var resourceHealthCleared =
|
|
4665
|
-
type:
|
|
4666
|
-
robot_id:
|
|
4667
|
-
kind:
|
|
4668
|
-
ref:
|
|
4669
|
-
facet:
|
|
4670
|
-
cleared_at_ms:
|
|
4671
|
-
});
|
|
4672
|
-
var resourceHealthEvent =
|
|
4673
|
-
type:
|
|
4674
|
-
robot_id:
|
|
4675
|
-
kind:
|
|
4676
|
-
ref:
|
|
4766
|
+
ended_at_ms: import_zod15.z.number().int().nonnegative()
|
|
4767
|
+
});
|
|
4768
|
+
var resourceHealthCleared = import_zod15.z.object({
|
|
4769
|
+
type: import_zod15.z.literal("resource_health_cleared"),
|
|
4770
|
+
robot_id: import_zod15.z.uuid(),
|
|
4771
|
+
kind: import_zod15.z.enum(["camera"]),
|
|
4772
|
+
ref: import_zod15.z.string().min(1).max(64),
|
|
4773
|
+
facet: import_zod15.z.enum(["source", "publish"]),
|
|
4774
|
+
cleared_at_ms: import_zod15.z.number().int().nonnegative()
|
|
4775
|
+
});
|
|
4776
|
+
var resourceHealthEvent = import_zod15.z.object({
|
|
4777
|
+
type: import_zod15.z.literal("resource_health"),
|
|
4778
|
+
robot_id: import_zod15.z.uuid(),
|
|
4779
|
+
kind: import_zod15.z.enum(["camera"]),
|
|
4780
|
+
ref: import_zod15.z.string().min(1).max(64),
|
|
4677
4781
|
/** Which of the two questions this entry answers — see `resourceHealthState.facet`. */
|
|
4678
|
-
facet:
|
|
4679
|
-
state:
|
|
4680
|
-
reason:
|
|
4681
|
-
changed_at_ms:
|
|
4782
|
+
facet: import_zod15.z.enum(["source", "publish"]),
|
|
4783
|
+
state: import_zod15.z.enum(RESOURCE_HEALTH_STATES),
|
|
4784
|
+
reason: import_zod15.z.string().max(200).nullable(),
|
|
4785
|
+
changed_at_ms: import_zod15.z.number().int().nonnegative()
|
|
4682
4786
|
});
|
|
4683
4787
|
var ORG_EVENT_BUFFER_SIZE = 200;
|
|
4684
|
-
var orgEventKind =
|
|
4685
|
-
var orgEventSeverity =
|
|
4686
|
-
var orgEvent =
|
|
4687
|
-
type:
|
|
4788
|
+
var orgEventKind = import_zod15.z.enum(["datapoint", "health", "job", "bridge", "audit", "alert"]);
|
|
4789
|
+
var orgEventSeverity = import_zod15.z.enum(["info", "warning", "error"]);
|
|
4790
|
+
var orgEvent = import_zod15.z.object({
|
|
4791
|
+
type: import_zod15.z.literal("org_event"),
|
|
4688
4792
|
/**
|
|
4689
4793
|
* **Per org, per process.** Like `job.seq` and unlike `job_runs.seq`, which
|
|
4690
4794
|
* is a postgres `bigserial` and durable. All three say which they are,
|
|
4691
4795
|
* because anyone who confuses them will confuse them in both directions.
|
|
4692
4796
|
*/
|
|
4693
|
-
seq:
|
|
4694
|
-
at:
|
|
4797
|
+
seq: import_zod15.z.number().int().positive(),
|
|
4798
|
+
at: import_zod15.z.iso.datetime(),
|
|
4695
4799
|
kind: orgEventKind,
|
|
4696
4800
|
severity: orgEventSeverity,
|
|
4697
4801
|
/** `null` for an org-level event — an invitation, a quota change — which belongs to no robot. */
|
|
4698
|
-
robot_id:
|
|
4802
|
+
robot_id: import_zod15.z.uuid().nullable(),
|
|
4699
4803
|
/** What the line is about: a slug, a camera, an actor's email. */
|
|
4700
|
-
subject:
|
|
4804
|
+
subject: import_zod15.z.string().min(1).max(200),
|
|
4701
4805
|
/**
|
|
4702
4806
|
* Kind-specific, and **capped at `ORG_EVENT_DETAIL_MAX_BYTES`** — above it
|
|
4703
4807
|
* the producer substitutes `{ omitted: 'too_large', bytes }`. Truncated,
|
|
@@ -4706,13 +4810,13 @@ var orgEvent = import_zod14.z.object({
|
|
|
4706
4810
|
* Never a pre-formatted line: the reader decides language, number format
|
|
4707
4811
|
* and truncation, so changing how a line reads is not a cloud deploy.
|
|
4708
4812
|
*/
|
|
4709
|
-
detail:
|
|
4813
|
+
detail: import_zod15.z.unknown().nullable()
|
|
4710
4814
|
}).strict();
|
|
4711
|
-
var orgEventSubscribe =
|
|
4712
|
-
var orgEventUnsubscribe =
|
|
4713
|
-
var orgEventReplay =
|
|
4714
|
-
type:
|
|
4715
|
-
events:
|
|
4815
|
+
var orgEventSubscribe = import_zod15.z.object({ type: import_zod15.z.literal("org_event_subscribe") }).strict();
|
|
4816
|
+
var orgEventUnsubscribe = import_zod15.z.object({ type: import_zod15.z.literal("org_event_unsubscribe") }).strict();
|
|
4817
|
+
var orgEventReplay = import_zod15.z.object({
|
|
4818
|
+
type: import_zod15.z.literal("org_event_replay"),
|
|
4819
|
+
events: import_zod15.z.array(orgEvent).max(ORG_EVENT_BUFFER_SIZE),
|
|
4716
4820
|
/**
|
|
4717
4821
|
* **`false` means three different things, on purpose**: the buffer was
|
|
4718
4822
|
* already full, the cloud restarted, or this org's buffer had expired. All
|
|
@@ -4720,10 +4824,10 @@ var orgEventReplay = import_zod14.z.object({
|
|
|
4720
4824
|
* line* — and a field separating them would claim a distinction nobody
|
|
4721
4825
|
* would act on differently.
|
|
4722
4826
|
*/
|
|
4723
|
-
complete:
|
|
4827
|
+
complete: import_zod15.z.boolean()
|
|
4724
4828
|
}).strict();
|
|
4725
|
-
var orgEventDropped =
|
|
4726
|
-
type:
|
|
4829
|
+
var orgEventDropped = import_zod15.z.object({
|
|
4830
|
+
type: import_zod15.z.literal("org_event_dropped"),
|
|
4727
4831
|
/**
|
|
4728
4832
|
* **An epoch instant in milliseconds (`Date.now()`), not a duration.**
|
|
4729
4833
|
* The moment this socket last reported a drop — or the moment it
|
|
@@ -4734,29 +4838,29 @@ var orgEventDropped = import_zod14.z.object({
|
|
|
4734
4838
|
* it as "milliseconds ago" renders a drop that happened seconds ago as
|
|
4735
4839
|
* having happened in 1970.
|
|
4736
4840
|
*/
|
|
4737
|
-
since_ms:
|
|
4841
|
+
since_ms: import_zod15.z.number().int().nonnegative(),
|
|
4738
4842
|
/** Always at least one — a frame reporting nothing lost is noise on a channel built to be quiet. */
|
|
4739
|
-
dropped:
|
|
4843
|
+
dropped: import_zod15.z.number().int().positive()
|
|
4740
4844
|
}).strict();
|
|
4741
4845
|
|
|
4742
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
4743
|
-
var
|
|
4846
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/feedback.js
|
|
4847
|
+
var import_zod16 = require("zod");
|
|
4744
4848
|
var FEEDBACK_KINDS = ["idea", "problem", "question", "other"];
|
|
4745
|
-
var feedbackKind =
|
|
4849
|
+
var feedbackKind = import_zod16.z.enum(FEEDBACK_KINDS);
|
|
4746
4850
|
var FEEDBACK_MESSAGE_MAX = 5e3;
|
|
4747
|
-
var feedbackRequest =
|
|
4851
|
+
var feedbackRequest = import_zod16.z.object({
|
|
4748
4852
|
kind: feedbackKind.meta({
|
|
4749
4853
|
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."
|
|
4750
4854
|
}),
|
|
4751
|
-
message:
|
|
4855
|
+
message: import_zod16.z.string().trim().min(1).max(FEEDBACK_MESSAGE_MAX).meta({
|
|
4752
4856
|
description: "What the developer wrote, trimmed. At most 5000 characters; a message that is only whitespace is refused."
|
|
4753
4857
|
}),
|
|
4754
|
-
page:
|
|
4858
|
+
page: import_zod16.z.string().startsWith("/").max(512).meta({
|
|
4755
4859
|
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."
|
|
4756
4860
|
})
|
|
4757
4861
|
}).strict();
|
|
4758
|
-
var feedbackResponse =
|
|
4759
|
-
id:
|
|
4862
|
+
var feedbackResponse = import_zod16.z.object({
|
|
4863
|
+
id: import_zod16.z.uuid().meta({
|
|
4760
4864
|
description: "The stored message. It exists whatever `mail` says."
|
|
4761
4865
|
}),
|
|
4762
4866
|
mail: mailStatus.meta({
|
|
@@ -4764,34 +4868,110 @@ var feedbackResponse = import_zod15.z.object({
|
|
|
4764
4868
|
})
|
|
4765
4869
|
}).strict();
|
|
4766
4870
|
|
|
4767
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
4768
|
-
var
|
|
4769
|
-
var
|
|
4871
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/support.js
|
|
4872
|
+
var import_zod17 = require("zod");
|
|
4873
|
+
var supportSessionInfo = import_zod17.z.object({
|
|
4874
|
+
session_id: import_zod17.z.uuid().meta({
|
|
4875
|
+
description: "The support session this token or response describes. Stable for the life of the session."
|
|
4876
|
+
}),
|
|
4877
|
+
mode: import_zod17.z.enum(["read", "edit"]).meta({
|
|
4878
|
+
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."
|
|
4879
|
+
}),
|
|
4880
|
+
operator_name: import_zod17.z.string().min(1).max(200).meta({
|
|
4881
|
+
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."
|
|
4882
|
+
}),
|
|
4883
|
+
expires_at: import_zod17.z.iso.datetime().meta({
|
|
4884
|
+
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."
|
|
4885
|
+
})
|
|
4886
|
+
}).strict();
|
|
4887
|
+
var supportTokenRequest = import_zod17.z.object({
|
|
4888
|
+
grant: import_zod17.z.string().regex(/^[A-Za-z0-9_-]{43}$/).meta({
|
|
4889
|
+
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."
|
|
4890
|
+
}),
|
|
4891
|
+
code_verifier: import_zod17.z.string().regex(/^[A-Za-z0-9._~-]{43,128}$/).meta({
|
|
4892
|
+
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."
|
|
4893
|
+
})
|
|
4894
|
+
}).strict();
|
|
4895
|
+
var supportTokenResponse = import_zod17.z.object({
|
|
4896
|
+
access_token: import_zod17.z.string().min(1).meta({
|
|
4897
|
+
description: "The token to send as `Authorization: Bearer <token>`. Short-lived: read `expires_in`, never assume a lifetime."
|
|
4898
|
+
}),
|
|
4899
|
+
token_type: import_zod17.z.literal("Bearer").meta({
|
|
4900
|
+
description: "`Bearer`, the same spelling every other session token on this wire uses."
|
|
4901
|
+
}),
|
|
4902
|
+
expires_in: import_zod17.z.number().int().min(1).max(3600).meta({
|
|
4903
|
+
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."
|
|
4904
|
+
}),
|
|
4905
|
+
org_id: import_zod17.z.uuid().meta({
|
|
4906
|
+
description: "The organisation this session was scoped to when the grant was minted."
|
|
4907
|
+
}),
|
|
4908
|
+
support: supportSessionInfo.meta({
|
|
4909
|
+
description: "The session as it stands at the moment of exchange: freshly started, in `read` mode."
|
|
4910
|
+
})
|
|
4911
|
+
}).strict();
|
|
4912
|
+
var supportRenewFailRequest = import_zod17.z.object({
|
|
4913
|
+
flow_id: import_zod17.z.uuid().meta({ description: "The pending Cloud renewal flow created with the original support bearer." }),
|
|
4914
|
+
code_verifier: import_zod17.z.string().regex(/^[A-Za-z0-9._~-]{43,128}$/).meta({
|
|
4915
|
+
description: "The server-held RFC 7636 verifier matching the flow's S256 challenge; never sent to the browser."
|
|
4916
|
+
}),
|
|
4917
|
+
reason: import_zod17.z.literal("authority_failed").meta({ description: "A fixed category; browser and IdP error text is not forwarded." })
|
|
4918
|
+
}).strict();
|
|
4919
|
+
var supportRenewFailRefusal = import_zod17.z.union([
|
|
4920
|
+
import_zod17.z.object({ code: import_zod17.z.literal("validation_error"), message: import_zod17.z.string().min(1), details: import_zod17.z.object({ rule: import_zod17.z.literal("invalid_flow") }).strict() }).strict(),
|
|
4921
|
+
import_zod17.z.object({ code: import_zod17.z.literal("unauthorized"), message: import_zod17.z.string().min(1), details: import_zod17.z.object({ rule: import_zod17.z.literal("invalid_authority") }).strict() }).strict(),
|
|
4922
|
+
import_zod17.z.object({ code: import_zod17.z.literal("not_found"), message: import_zod17.z.string().min(1), details: import_zod17.z.object({ rule: import_zod17.z.enum(["invalid_flow", "identity_mismatch"]) }).strict() }).strict(),
|
|
4923
|
+
import_zod17.z.object({ code: import_zod17.z.literal("target_state_conflict"), message: import_zod17.z.string().min(1), details: import_zod17.z.object({ rule: import_zod17.z.enum(["expired", "replayed", "session_inactive", "stale_generation"]) }).strict() }).strict()
|
|
4924
|
+
]);
|
|
4925
|
+
var authMeSupportResponse = authMeResponse.extend({ support: supportSessionInfo.optional() });
|
|
4926
|
+
|
|
4927
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/client-robots.js
|
|
4928
|
+
var import_zod18 = require("zod");
|
|
4929
|
+
var clientRobotListItem = import_zod18.z.object({
|
|
4770
4930
|
...robot.shape,
|
|
4771
4931
|
bridge_state: bridgeState.meta({
|
|
4772
4932
|
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."
|
|
4773
4933
|
}),
|
|
4774
|
-
published_version:
|
|
4934
|
+
published_version: import_zod18.z.number().int().positive().nullable().meta({
|
|
4775
4935
|
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.'
|
|
4776
4936
|
})
|
|
4777
4937
|
});
|
|
4778
|
-
var clientRobotListResponse =
|
|
4779
|
-
robots:
|
|
4938
|
+
var clientRobotListResponse = import_zod18.z.object({
|
|
4939
|
+
robots: import_zod18.z.array(clientRobotListItem).meta({
|
|
4780
4940
|
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."
|
|
4781
4941
|
})
|
|
4782
4942
|
});
|
|
4783
4943
|
|
|
4784
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
4785
|
-
var
|
|
4786
|
-
var
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
});
|
|
4791
|
-
var
|
|
4792
|
-
id:
|
|
4793
|
-
|
|
4794
|
-
|
|
4944
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/legal-acceptances.js
|
|
4945
|
+
var import_zod19 = require("zod");
|
|
4946
|
+
var legalAcceptanceCursor = import_zod19.z.string().min(1).max(512).regex(/^[A-Za-z0-9_-]+$/);
|
|
4947
|
+
var legalAcceptanceListQuery = import_zod19.z.object({
|
|
4948
|
+
limit: import_zod19.z.union([import_zod19.z.string().regex(/^(?:0{0,2}[1-9]|0?[1-9][0-9]|100)$/), import_zod19.z.number().int().min(1).max(100)]).transform(Number).pipe(import_zod19.z.number().int().min(1).max(100)).optional(),
|
|
4949
|
+
cursor: legalAcceptanceCursor.optional()
|
|
4950
|
+
}).strict();
|
|
4951
|
+
var legalAcceptanceVersionRow = import_zod19.z.object({
|
|
4952
|
+
id: import_zod19.z.uuid(),
|
|
4953
|
+
context: import_zod19.z.enum(["registration", "invitation", "order", "existing_org"]),
|
|
4954
|
+
accepted_at: import_zod19.z.iso.datetime({ precision: 6 }),
|
|
4955
|
+
text_id: import_zod19.z.string().min(1).max(80).regex(/\S/),
|
|
4956
|
+
terms: legalDocumentReference,
|
|
4957
|
+
dpa: legalDocumentReference.nullable()
|
|
4958
|
+
}).strict();
|
|
4959
|
+
var legalAcceptanceListResponse = import_zod19.z.object({
|
|
4960
|
+
acceptances: import_zod19.z.array(legalAcceptanceVersionRow),
|
|
4961
|
+
next_cursor: legalAcceptanceCursor.nullable()
|
|
4962
|
+
}).strict();
|
|
4963
|
+
|
|
4964
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/audit.js
|
|
4965
|
+
var import_zod20 = require("zod");
|
|
4966
|
+
var auditActor = import_zod20.z.object({
|
|
4967
|
+
kind: import_zod20.z.enum(["developer", "end_user", "app_user", "server_key", "bridge", "fleetless"]),
|
|
4968
|
+
id: import_zod20.z.uuid(),
|
|
4969
|
+
label: import_zod20.z.string().min(1).max(200)
|
|
4970
|
+
});
|
|
4971
|
+
var auditEvent = import_zod20.z.object({
|
|
4972
|
+
id: import_zod20.z.uuid(),
|
|
4973
|
+
org_id: import_zod20.z.uuid(),
|
|
4974
|
+
at: import_zod20.z.iso.datetime(),
|
|
4795
4975
|
/**
|
|
4796
4976
|
* A monotonic counter, ascending in write order, unique across the log.
|
|
4797
4977
|
*
|
|
@@ -4810,18 +4990,18 @@ var auditEvent = import_zod17.z.object({
|
|
|
4810
4990
|
* Required, not optional: an event without a sequence cannot be ordered
|
|
4811
4991
|
* against one that has it, and a log with two orderings has none.
|
|
4812
4992
|
*/
|
|
4813
|
-
seq:
|
|
4993
|
+
seq: import_zod20.z.number().int().positive(),
|
|
4814
4994
|
actor: auditActor,
|
|
4815
4995
|
/** Stable dotted name, e.g. `app_user.login`, `config.published`. */
|
|
4816
|
-
action:
|
|
4996
|
+
action: import_zod20.z.string().min(1).max(80),
|
|
4817
4997
|
/**
|
|
4818
4998
|
* What the action was about, if anything — a robot, an app, a user. Free
|
|
4819
4999
|
* of ids the console cannot resolve: carry the label with it.
|
|
4820
5000
|
*/
|
|
4821
|
-
target:
|
|
4822
|
-
kind:
|
|
4823
|
-
id:
|
|
4824
|
-
label:
|
|
5001
|
+
target: import_zod20.z.object({
|
|
5002
|
+
kind: import_zod20.z.string().min(1).max(40),
|
|
5003
|
+
id: import_zod20.z.string().min(1),
|
|
5004
|
+
label: import_zod20.z.string().min(1).max(200)
|
|
4825
5005
|
}).nullable(),
|
|
4826
5006
|
/**
|
|
4827
5007
|
* Action-specific extras.
|
|
@@ -4835,10 +5015,10 @@ var auditEvent = import_zod17.z.object({
|
|
|
4835
5015
|
* So: never credentials, never tokens. That is a rule, not a guarantee the
|
|
4836
5016
|
* schema enforces.
|
|
4837
5017
|
*/
|
|
4838
|
-
details:
|
|
5018
|
+
details: import_zod20.z.record(import_zod20.z.string(), import_zod20.z.unknown()).nullable()
|
|
4839
5019
|
});
|
|
4840
5020
|
var auditTimestampMs = wireTimestampMs;
|
|
4841
|
-
var auditQuery =
|
|
5021
|
+
var auditQuery = import_zod20.z.object({
|
|
4842
5022
|
/** Only events with a smaller `seq` — the next, older page. */
|
|
4843
5023
|
before_seq: wireSeqCursor.optional(),
|
|
4844
5024
|
/**
|
|
@@ -4847,9 +5027,9 @@ var auditQuery = import_zod17.z.object({
|
|
|
4847
5027
|
* coercion's result in either `io` direction, so the artifact would describe
|
|
4848
5028
|
* a shape a query string can never carry.
|
|
4849
5029
|
*/
|
|
4850
|
-
limit:
|
|
5030
|
+
limit: import_zod20.z.union([import_zod20.z.string().regex(/^\d{1,4}$/), import_zod20.z.number().int()]).transform((v) => Number(v)).pipe(import_zod20.z.number().int().positive().max(500)).optional(),
|
|
4851
5031
|
/** Exact action name, e.g. `config.published`. No prefix matching: a filter that matches more than it says is not one. */
|
|
4852
|
-
action:
|
|
5032
|
+
action: import_zod20.z.string().min(1).max(80).optional(),
|
|
4853
5033
|
/**
|
|
4854
5034
|
* Everything under a dotted prefix, e.g. `server_key.` for all three
|
|
4855
5035
|
* server-key actions.
|
|
@@ -4866,7 +5046,7 @@ var auditQuery = import_zod17.z.object({
|
|
|
4866
5046
|
* happily. The cloud is the only enforcement point — the same residual
|
|
4867
5047
|
* `orgLatencyQuery` and `orgUsageQuery` already name.
|
|
4868
5048
|
*/
|
|
4869
|
-
action_prefix:
|
|
5049
|
+
action_prefix: import_zod20.z.string().min(1).max(80).optional(),
|
|
4870
5050
|
/**
|
|
4871
5051
|
* Only events by this actor.
|
|
4872
5052
|
*
|
|
@@ -4878,9 +5058,9 @@ var auditQuery = import_zod17.z.object({
|
|
|
4878
5058
|
* Not an injection question — the query is parameterised either way. It is a
|
|
4879
5059
|
* **500 where a 400 belongs**, and a 500 is the answer that explains nothing.
|
|
4880
5060
|
*/
|
|
4881
|
-
actor_id:
|
|
5061
|
+
actor_id: import_zod20.z.uuid().optional(),
|
|
4882
5062
|
/** Only events about this kind of target, e.g. `robot`. */
|
|
4883
|
-
target_kind:
|
|
5063
|
+
target_kind: import_zod20.z.string().min(1).max(40).optional(),
|
|
4884
5064
|
/**
|
|
4885
5065
|
* Only events about this target — and, for a robot, also the events that
|
|
4886
5066
|
* name it in `details.robot_id`, so a robot's log includes what was
|
|
@@ -4890,7 +5070,7 @@ var auditQuery = import_zod17.z.object({
|
|
|
4890
5070
|
* string in this contract and text in the cloud's table, so a uuid rule
|
|
4891
5071
|
* here would refuse ids the log can hold, and no value can fail a cast.
|
|
4892
5072
|
*/
|
|
4893
|
-
target_id:
|
|
5073
|
+
target_id: import_zod20.z.string().min(1).max(200).optional().meta({
|
|
4894
5074
|
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."
|
|
4895
5075
|
}),
|
|
4896
5076
|
/**
|
|
@@ -4908,8 +5088,8 @@ var auditQuery = import_zod17.z.object({
|
|
|
4908
5088
|
message: "action and action_prefix cannot be combined",
|
|
4909
5089
|
path: ["action_prefix"]
|
|
4910
5090
|
});
|
|
4911
|
-
var auditListResponse =
|
|
4912
|
-
events:
|
|
5091
|
+
var auditListResponse = import_zod20.z.object({
|
|
5092
|
+
events: import_zod20.z.array(auditEvent),
|
|
4913
5093
|
/**
|
|
4914
5094
|
* The `seq` a caller sends as `before_seq` to keep reading — or `null` when
|
|
4915
5095
|
* there is nothing further.
|
|
@@ -4920,16 +5100,28 @@ var auditListResponse = import_zod17.z.object({
|
|
|
4920
5100
|
* not mean *no more* here. The same distinction `historySamples` was given
|
|
4921
5101
|
* `truncated` for.
|
|
4922
5102
|
*/
|
|
4923
|
-
next_cursor:
|
|
5103
|
+
next_cursor: import_zod20.z.number().int().positive().nullable()
|
|
4924
5104
|
});
|
|
4925
5105
|
|
|
4926
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
4927
|
-
var
|
|
5106
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/errors.js
|
|
5107
|
+
var import_zod24 = require("zod");
|
|
4928
5108
|
|
|
4929
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
4930
|
-
var
|
|
4931
|
-
|
|
4932
|
-
|
|
5109
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/plans.js
|
|
5110
|
+
var import_zod23 = require("zod");
|
|
5111
|
+
|
|
5112
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/purchase-operation-key.js
|
|
5113
|
+
var import_zod21 = require("zod");
|
|
5114
|
+
var purchaseOperationKey = import_zod21.z.uuid().meta({ description: "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input." });
|
|
5115
|
+
|
|
5116
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/confirmation-proof.js
|
|
5117
|
+
var import_zod22 = require("zod");
|
|
5118
|
+
var confirmationProof = import_zod22.z.string().regex(/^[A-Za-z0-9_-]{43}$/).meta({
|
|
5119
|
+
description: "Opaque 32-byte Cloud proof, unpadded base64url. Syntax alone is not evidence."
|
|
5120
|
+
});
|
|
5121
|
+
|
|
5122
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/plans.js
|
|
5123
|
+
var planId = import_zod23.z.enum(["basic", "plus", "pro", "enterprise"]);
|
|
5124
|
+
var planLimitKey = import_zod23.z.enum([
|
|
4933
5125
|
"seats",
|
|
4934
5126
|
"robots",
|
|
4935
5127
|
"apps",
|
|
@@ -4939,8 +5131,8 @@ var planLimitKey = import_zod18.z.enum([
|
|
|
4939
5131
|
"history_days",
|
|
4940
5132
|
"audit_days"
|
|
4941
5133
|
]);
|
|
4942
|
-
var limit =
|
|
4943
|
-
var planLimits =
|
|
5134
|
+
var limit = import_zod23.z.number().int().positive().nullable();
|
|
5135
|
+
var planLimits = import_zod23.z.object({
|
|
4944
5136
|
seats: limit.meta({ description: "Developers, owners included, plus pending team invitations." }),
|
|
4945
5137
|
robots: limit.meta({ description: "Robots in the org." }),
|
|
4946
5138
|
apps: limit.meta({ description: "Apps in the org." }),
|
|
@@ -4954,7 +5146,7 @@ var planLimits = import_zod18.z.object({
|
|
|
4954
5146
|
history_days: limit.meta({ description: "Days the org's robot history is kept." }),
|
|
4955
5147
|
audit_days: limit.meta({ description: "Days the org's audit log is kept." })
|
|
4956
5148
|
});
|
|
4957
|
-
var planFeature =
|
|
5149
|
+
var planFeature = import_zod23.z.enum(["app_mcp", "two_factor", "require_two_factor", "app_oidc", "hosted_logo", "audit_export", "addons"]);
|
|
4958
5150
|
var FEATURE_DESCRIPTIONS = {
|
|
4959
5151
|
app_mcp: "An app's own MCP endpoint, for its app users.",
|
|
4960
5152
|
two_factor: "Two-factor sign-in for developers.",
|
|
@@ -4964,33 +5156,28 @@ var FEATURE_DESCRIPTIONS = {
|
|
|
4964
5156
|
audit_export: "The audit log can be exported as CSV.",
|
|
4965
5157
|
addons: "Add-ons can be bought on top of the plan."
|
|
4966
5158
|
};
|
|
4967
|
-
var planFeatures =
|
|
4968
|
-
var cents =
|
|
4969
|
-
var planPrices =
|
|
5159
|
+
var planFeatures = import_zod23.z.object(Object.fromEntries(planFeature.options.map((f) => [f, import_zod23.z.boolean().meta({ description: FEATURE_DESCRIPTIONS[f] })])));
|
|
5160
|
+
var cents = import_zod23.z.number().int().nonnegative();
|
|
5161
|
+
var planPrices = import_zod23.z.object({
|
|
4970
5162
|
eur_month: cents.meta({ description: "Per month in euro cents, excluding VAT." }),
|
|
4971
|
-
|
|
4972
|
-
eur_year: cents.meta({ description: "Per year in euro cents, excluding VAT: twelve months less 15 %." }),
|
|
4973
|
-
usd_year: cents.meta({ description: "Per year in US dollar cents, excluding VAT: the yearly euro price \xD7 1.15, rounded up to a whole dollar." })
|
|
5163
|
+
eur_year: cents.meta({ description: "Per year in euro cents, excluding VAT: twelve months less 15 %." })
|
|
4974
5164
|
});
|
|
4975
|
-
var planSupport =
|
|
4976
|
-
var planCatalogueEntry =
|
|
5165
|
+
var planSupport = import_zod23.z.enum(["community", "email", "priority", "named_contact"]);
|
|
5166
|
+
var planCatalogueEntry = import_zod23.z.object({
|
|
4977
5167
|
id: planId.meta({ description: "The plan." }),
|
|
4978
|
-
name:
|
|
5168
|
+
name: import_zod23.z.string().min(1).meta({ description: "The plan's display name: Basic, Plus, Pro or Enterprise." }),
|
|
4979
5169
|
limits: planLimits.meta({ description: "What the plan allows. `null` means by contract." }),
|
|
4980
5170
|
features: planFeatures.meta({ description: "What the plan unlocks." }),
|
|
4981
5171
|
prices: planPrices.nullable().meta({ description: "`null` for Enterprise: sold by contract, on request." }),
|
|
4982
5172
|
support: planSupport.meta({ description: "The support that comes with the plan." })
|
|
4983
5173
|
});
|
|
4984
|
-
var addonKey =
|
|
4985
|
-
var addonCatalogueEntry =
|
|
5174
|
+
var addonKey = import_zod23.z.enum(["seats", "robots", "apps", "app_user_packs", "live_video_packs"]);
|
|
5175
|
+
var addonCatalogueEntry = import_zod23.z.object({
|
|
4986
5176
|
key: addonKey.meta({ description: "The add-on." }),
|
|
4987
5177
|
raises: planLimitKey.meta({ description: "The plan limit this add-on raises." }),
|
|
4988
|
-
per_unit:
|
|
5178
|
+
per_unit: import_zod23.z.number().int().positive().meta({ description: "How much one unit of this add-on raises `raises` by." }),
|
|
4989
5179
|
prices: planPrices.meta({ description: "The price of one unit." })
|
|
4990
5180
|
});
|
|
4991
|
-
function usdCentsFromEurCents(eurCents) {
|
|
4992
|
-
return Math.floor((eurCents * 115 + 9999) / 1e4) * 100;
|
|
4993
|
-
}
|
|
4994
5181
|
function yearlyEurCents(monthEurCents) {
|
|
4995
5182
|
return Math.round(monthEurCents * 12 * 85 / 100);
|
|
4996
5183
|
}
|
|
@@ -4998,9 +5185,7 @@ function pricesFromEurMonth(eurMonthCents) {
|
|
|
4998
5185
|
const eurYear = yearlyEurCents(eurMonthCents);
|
|
4999
5186
|
return {
|
|
5000
5187
|
eur_month: eurMonthCents,
|
|
5001
|
-
|
|
5002
|
-
eur_year: eurYear,
|
|
5003
|
-
usd_year: usdCentsFromEurCents(eurYear)
|
|
5188
|
+
eur_year: eurYear
|
|
5004
5189
|
};
|
|
5005
5190
|
}
|
|
5006
5191
|
var PLANS = {
|
|
@@ -5112,17 +5297,17 @@ var ADDONS = {
|
|
|
5112
5297
|
app_user_packs: { key: "app_user_packs", raises: "app_users", per_unit: 5, prices: pricesFromEurMonth(1e3) },
|
|
5113
5298
|
live_video_packs: { key: "live_video_packs", raises: "live_video_ms_per_month", per_unit: 9e8, prices: pricesFromEurMonth(900) }
|
|
5114
5299
|
};
|
|
5115
|
-
var planCurrency =
|
|
5116
|
-
var addonCount =
|
|
5117
|
-
var orgAddons =
|
|
5300
|
+
var planCurrency = import_zod23.z.enum(["eur", "usd"]);
|
|
5301
|
+
var addonCount = import_zod23.z.number().int().nonnegative();
|
|
5302
|
+
var orgAddons = import_zod23.z.object({
|
|
5118
5303
|
seats: addonCount.meta({ description: "Extra developer seats, one each." }),
|
|
5119
5304
|
robots: addonCount.meta({ description: "Extra robots, one each." }),
|
|
5120
5305
|
apps: addonCount.meta({ description: "Extra apps, one each." }),
|
|
5121
5306
|
app_user_packs: addonCount.meta({ description: "Packs of five extra app users." }),
|
|
5122
5307
|
live_video_packs: addonCount.meta({ description: "Packs of 250 extra hours of app-user live video per month." })
|
|
5123
5308
|
});
|
|
5124
|
-
var usageCount =
|
|
5125
|
-
var orgPlanUsage =
|
|
5309
|
+
var usageCount = import_zod23.z.number().int().nonnegative();
|
|
5310
|
+
var orgPlanUsage = import_zod23.z.object({
|
|
5126
5311
|
seats: usageCount.meta({ description: "Developers, owners included, plus pending team invitations." }),
|
|
5127
5312
|
robots: usageCount.meta({ description: "Robots in the org." }),
|
|
5128
5313
|
apps: usageCount.meta({ description: "Apps in the org." }),
|
|
@@ -5132,42 +5317,42 @@ var orgPlanUsage = import_zod18.z.object({
|
|
|
5132
5317
|
}),
|
|
5133
5318
|
asset_bytes: usageCount.meta({ description: "Bytes the assets of every robot of the org occupy, together." })
|
|
5134
5319
|
});
|
|
5135
|
-
var planChangeKeep =
|
|
5136
|
-
robots:
|
|
5137
|
-
apps:
|
|
5138
|
-
app_users:
|
|
5320
|
+
var planChangeKeep = import_zod23.z.object({
|
|
5321
|
+
robots: import_zod23.z.array(import_zod23.z.uuid()).meta({ description: "The robots that stay, by id. Every other robot is deleted when the change takes effect." }),
|
|
5322
|
+
apps: import_zod23.z.array(import_zod23.z.uuid()).meta({ description: "The apps that stay, by id. Every other app is deleted when the change takes effect." }),
|
|
5323
|
+
app_users: import_zod23.z.array(import_zod23.z.uuid()).meta({
|
|
5139
5324
|
description: "The app users that stay, by id, across every app. Every other app user is deleted when the change takes effect."
|
|
5140
5325
|
}),
|
|
5141
|
-
developers:
|
|
5326
|
+
developers: import_zod23.z.array(import_zod23.z.uuid()).meta({
|
|
5142
5327
|
description: "The developers that stay, by user id, owners never among them: every owner stays. Every other developer is removed from the org when the change takes effect."
|
|
5143
5328
|
})
|
|
5144
5329
|
}).strict();
|
|
5145
|
-
var planChangeReason =
|
|
5146
|
-
var pendingPlanChange =
|
|
5330
|
+
var planChangeReason = import_zod23.z.enum(["downgrade", "cancel", "migration", "lock"]);
|
|
5331
|
+
var pendingPlanChange = import_zod23.z.object({
|
|
5147
5332
|
target_plan: planId.meta({ description: "The plan the org moves to." }),
|
|
5148
5333
|
reason: planChangeReason.meta({ description: "Why the change is pending: `downgrade`, `cancel`, `migration` or `lock`." }),
|
|
5149
|
-
effective_at:
|
|
5334
|
+
effective_at: import_zod23.z.iso.datetime().nullable().meta({
|
|
5150
5335
|
description: "When the change takes effect. `null` only for a move off the beta whose date is not set yet."
|
|
5151
5336
|
}),
|
|
5152
5337
|
keep: planChangeKeep.nullable().meta({
|
|
5153
5338
|
description: "What stays. `null` when the org already fits the target plan and nothing is deleted."
|
|
5154
5339
|
}),
|
|
5155
|
-
history_days_after:
|
|
5340
|
+
history_days_after: import_zod23.z.number().int().positive().meta({
|
|
5156
5341
|
description: "Days of history and audit log the org keeps on the target plan."
|
|
5157
5342
|
}),
|
|
5158
|
-
chosen_by:
|
|
5159
|
-
chosen_at:
|
|
5343
|
+
chosen_by: import_zod23.z.uuid().meta({ description: "The user id of the owner who chose the change, or the nil UUID when Fleetless queued it." }),
|
|
5344
|
+
chosen_at: import_zod23.z.iso.datetime().meta({ description: "When the change was chosen." })
|
|
5160
5345
|
});
|
|
5161
|
-
var orgLock =
|
|
5162
|
-
reason:
|
|
5346
|
+
var orgLock = import_zod23.z.object({
|
|
5347
|
+
reason: import_zod23.z.enum(["payment", "migration"]).meta({
|
|
5163
5348
|
description: "`payment`: a payment is missing. `migration`: the org did not choose what stays when the beta ended."
|
|
5164
5349
|
}),
|
|
5165
|
-
since:
|
|
5350
|
+
since: import_zod23.z.iso.datetime().meta({ description: "When the org was locked." })
|
|
5166
5351
|
});
|
|
5167
|
-
var orgPlan =
|
|
5352
|
+
var orgPlan = import_zod23.z.object({
|
|
5168
5353
|
plan: planId.meta({ description: "The org's current plan." }),
|
|
5169
5354
|
currency: planCurrency.meta({ description: "The currency the org's prices are shown and billed in." }),
|
|
5170
|
-
period_ends_at:
|
|
5355
|
+
period_ends_at: import_zod23.z.iso.datetime().meta({
|
|
5171
5356
|
description: "The end of the organization's current billing period; while no payment period exists yet, the end of the current UTC calendar month. A pending downward plan change normally takes effect at this exact instant \u2014 except one chosen while the org was locked, which lands at once, and the platform's own move off the beta, which lands at its switch date instead."
|
|
5172
5357
|
}),
|
|
5173
5358
|
addons: orgAddons.meta({ description: "The add-ons the org has bought. All zero on a plan without the `addons` feature." }),
|
|
@@ -5178,66 +5363,82 @@ var orgPlan = import_zod18.z.object({
|
|
|
5178
5363
|
usage: orgPlanUsage.meta({ description: "What the org uses now, counted the way each limit counts it." }),
|
|
5179
5364
|
pending_change: pendingPlanChange.nullable().meta({ description: "A move to a lower plan that has not taken effect yet, or `null`." }),
|
|
5180
5365
|
lock: orgLock.nullable().meta({ description: "Why and since when the org is locked, or `null` when it is not." }),
|
|
5181
|
-
switch:
|
|
5182
|
-
at:
|
|
5366
|
+
switch: import_zod23.z.object({
|
|
5367
|
+
at: import_zod23.z.iso.datetime().nullable().meta({
|
|
5183
5368
|
description: "When the org moves from the beta onto its plan. `null` while the date is not set."
|
|
5184
5369
|
}),
|
|
5185
|
-
needs_choice:
|
|
5370
|
+
needs_choice: import_zod23.z.boolean().meta({
|
|
5186
5371
|
description: "Whether the org uses more than Basic allows, so an owner has to choose what stays before `at`."
|
|
5187
5372
|
})
|
|
5188
5373
|
}).nullable().meta({ description: "Set only while the org is still on the beta; `null` for every other org." })
|
|
5189
5374
|
});
|
|
5190
|
-
var
|
|
5375
|
+
var planChangePrepareRequest = import_zod23.z.object({
|
|
5376
|
+
operation_key: purchaseOperationKey,
|
|
5191
5377
|
target_plan: planId.meta({ description: "The lower plan to move to; `basic` cancels." }),
|
|
5192
5378
|
keep: planChangeKeep.nullable().meta({
|
|
5193
5379
|
description: "What stays. `null` when the org already fits the target plan, so nothing is deleted."
|
|
5194
5380
|
})
|
|
5195
5381
|
}).strict();
|
|
5196
|
-
var
|
|
5382
|
+
var finalPlanChangeFields = {
|
|
5383
|
+
change_id: import_zod23.z.uuid(),
|
|
5384
|
+
operation_key: purchaseOperationKey,
|
|
5385
|
+
keep: planChangeKeep.nullable(),
|
|
5386
|
+
confirmation_proof: confirmationProof
|
|
5387
|
+
};
|
|
5388
|
+
var planChangeRequest = import_zod23.z.discriminatedUnion("target_plan", [
|
|
5389
|
+
import_zod23.z.object({ ...finalPlanChangeFields, target_plan: import_zod23.z.literal("basic"), cancellation_reason: import_zod23.z.string().max(500).trim().optional() }).strict(),
|
|
5390
|
+
import_zod23.z.object({ ...finalPlanChangeFields, target_plan: planId.exclude(["basic"]) }).strict()
|
|
5391
|
+
]);
|
|
5392
|
+
var planChangeDecisionLookupQuery = import_zod23.z.object({ operation_key: purchaseOperationKey }).strict();
|
|
5393
|
+
var planChangeDecisionStatusResponse = import_zod23.z.discriminatedUnion("state", [
|
|
5394
|
+
import_zod23.z.object({ state: import_zod23.z.literal("prepared"), change_id: import_zod23.z.uuid() }).strict(),
|
|
5395
|
+
import_zod23.z.object({ state: import_zod23.z.literal("accepted"), change_id: import_zod23.z.uuid(), result: orgPlan }).strict()
|
|
5396
|
+
]);
|
|
5397
|
+
var planOverrides = import_zod23.z.object(Object.fromEntries(planLimitKey.options.map((k) => [
|
|
5197
5398
|
k,
|
|
5198
5399
|
limit.optional().meta({ description: `Replaces the plan's \`${k}\`. \`null\` clears the override.` })
|
|
5199
5400
|
]))).strict();
|
|
5200
|
-
var adminPlanChangeRequest =
|
|
5401
|
+
var adminPlanChangeRequest = import_zod23.z.object({
|
|
5201
5402
|
plan: planId.meta({ description: "The plan the org is on after this request." }),
|
|
5202
5403
|
addons: orgAddons.partial().strict().optional().meta({ description: "Add-on counts to set. Counts not named stay as they are." }),
|
|
5203
5404
|
overrides: planOverrides.optional().meta({ description: "Limits to override. `null` clears an override." }),
|
|
5204
5405
|
currency: planCurrency.optional().meta({ description: "The currency the org is billed in." }),
|
|
5205
|
-
period_ends_at:
|
|
5406
|
+
period_ends_at: import_zod23.z.iso.datetime().nullable().optional().meta({
|
|
5206
5407
|
description: "The end of the org's billing period. `null` falls back to the end of the current UTC month."
|
|
5207
5408
|
})
|
|
5208
5409
|
}).strict();
|
|
5209
5410
|
|
|
5210
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
5211
|
-
var apiError =
|
|
5212
|
-
code:
|
|
5213
|
-
message:
|
|
5214
|
-
details:
|
|
5215
|
-
});
|
|
5216
|
-
var parameterViolation =
|
|
5217
|
-
field:
|
|
5411
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/errors.js
|
|
5412
|
+
var apiError = import_zod24.z.object({
|
|
5413
|
+
code: import_zod24.z.string().min(1),
|
|
5414
|
+
message: import_zod24.z.string().min(1),
|
|
5415
|
+
details: import_zod24.z.unknown().optional()
|
|
5416
|
+
});
|
|
5417
|
+
var parameterViolation = import_zod24.z.object({
|
|
5418
|
+
field: import_zod24.z.string().min(1),
|
|
5218
5419
|
/** Which rule failed — `min`, `max`, `enum`, `pattern`, `required`, `undeclared`. */
|
|
5219
|
-
rule:
|
|
5220
|
-
message:
|
|
5420
|
+
rule: import_zod24.z.string().min(1),
|
|
5421
|
+
message: import_zod24.z.string().min(1)
|
|
5221
5422
|
});
|
|
5222
|
-
var parameterInvalidDetails =
|
|
5223
|
-
violations:
|
|
5423
|
+
var parameterInvalidDetails = import_zod24.z.object({
|
|
5424
|
+
violations: import_zod24.z.array(parameterViolation).min(1)
|
|
5224
5425
|
});
|
|
5225
|
-
var cancelRejectedDetails =
|
|
5226
|
-
goals:
|
|
5426
|
+
var cancelRejectedDetails = import_zod24.z.object({
|
|
5427
|
+
goals: import_zod24.z.array(bridgeCancelResultEntry).min(1)
|
|
5227
5428
|
});
|
|
5228
|
-
var invalidCodeDetails =
|
|
5229
|
-
attempts_left:
|
|
5429
|
+
var invalidCodeDetails = import_zod24.z.object({
|
|
5430
|
+
attempts_left: import_zod24.z.number().int().min(0).meta({
|
|
5230
5431
|
description: "How many more wrong codes this code or challenge takes before it is spent. `0` means the next attempt answers `410 token_spent`."
|
|
5231
5432
|
})
|
|
5232
5433
|
});
|
|
5233
|
-
var planLimitDetails =
|
|
5434
|
+
var planLimitDetails = import_zod24.z.object({
|
|
5234
5435
|
limit: planLimitKey.exclude(["history_days", "audit_days"]).meta({ description: "The limit the action would exceed." }),
|
|
5235
|
-
used:
|
|
5236
|
-
max:
|
|
5436
|
+
used: import_zod24.z.number().int().nonnegative().meta({ description: "How much of the limit the org uses now." }),
|
|
5437
|
+
max: import_zod24.z.number().int().nonnegative().meta({
|
|
5237
5438
|
description: "The limit. For `asset_bytes_per_robot`, the org's whole pool: robots \xD7 the plan's bytes per robot."
|
|
5238
5439
|
}),
|
|
5239
5440
|
plan: planId.meta({ description: "The plan whose limit refused: the target plan while a move to a lower plan is pending." }),
|
|
5240
|
-
lifted_by:
|
|
5441
|
+
lifted_by: import_zod24.z.object({
|
|
5241
5442
|
plan: planId.nullable().meta({ description: "The cheapest higher plan that raises this limit, or `null` when none does." }),
|
|
5242
5443
|
addon: addonKey.nullable().meta({
|
|
5243
5444
|
description: "The add-on that raises this limit, when the org's plan can buy add-ons; otherwise `null`."
|
|
@@ -5253,28 +5454,37 @@ var assetPlanLimitDetails = planLimitDetails.extend({
|
|
|
5253
5454
|
description: "Bytes the org's assets occupy, across every robot, before this upload."
|
|
5254
5455
|
})
|
|
5255
5456
|
});
|
|
5256
|
-
var planRequiredDetails =
|
|
5457
|
+
var planRequiredDetails = import_zod24.z.object({
|
|
5257
5458
|
feature: planFeature.meta({ description: "The feature the action needs." }),
|
|
5258
5459
|
plan: planId.meta({ description: "The org's current plan." }),
|
|
5259
5460
|
required_plan: planId.meta({ description: "The cheapest plan that has the feature." })
|
|
5260
5461
|
});
|
|
5261
|
-
var orgLockedDetails =
|
|
5262
|
-
reason:
|
|
5462
|
+
var orgLockedDetails = import_zod24.z.object({
|
|
5463
|
+
reason: import_zod24.z.enum(["payment", "migration"]).meta({
|
|
5263
5464
|
description: "`payment`: a payment is missing. `migration`: the org did not choose what stays when the beta ended."
|
|
5264
5465
|
})
|
|
5265
5466
|
});
|
|
5266
|
-
var fileTooLargeDetails =
|
|
5267
|
-
max_bytes:
|
|
5467
|
+
var fileTooLargeDetails = import_zod24.z.object({
|
|
5468
|
+
max_bytes: import_zod24.z.number().int().positive().meta({
|
|
5268
5469
|
description: "The most one asset file can be, in bytes: `ASSET_FILE_MAX_BYTES`, the same on every plan."
|
|
5269
5470
|
}),
|
|
5270
|
-
size_bytes:
|
|
5471
|
+
size_bytes: import_zod24.z.number().int().positive().nullable().meta({
|
|
5271
5472
|
description: "The refused file's size, in bytes: the announced size, or the bytes that arrived when none (or a false one) was announced; `null` only when the body limit stopped the upload and nobody counted the bytes."
|
|
5272
5473
|
})
|
|
5273
5474
|
});
|
|
5475
|
+
var paymentProviderUnavailableDetails = import_zod24.z.object({
|
|
5476
|
+
provider: import_zod24.z.literal("mollie").meta({ description: "The payment provider. Always `mollie` today." }),
|
|
5477
|
+
status: import_zod24.z.number().int().nullable().meta({ description: "Mollie's own HTTP status, or `null` when the request timed out instead of answering." })
|
|
5478
|
+
});
|
|
5479
|
+
var billingDocumentsUnavailableDetails = import_zod24.z.object({
|
|
5480
|
+
reason: import_zod24.z.enum(["provider_unavailable", "rate_limited", "list_limit_exceeded", "list_changed", "unsupported_document", "profile_mismatch"]).meta({
|
|
5481
|
+
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)."
|
|
5482
|
+
})
|
|
5483
|
+
}).strict();
|
|
5274
5484
|
|
|
5275
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
5276
|
-
var
|
|
5277
|
-
var oauthErrorCode =
|
|
5485
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/oauth.js
|
|
5486
|
+
var import_zod25 = require("zod");
|
|
5487
|
+
var oauthErrorCode = import_zod25.z.enum([
|
|
5278
5488
|
"invalid_request",
|
|
5279
5489
|
"invalid_client",
|
|
5280
5490
|
"invalid_grant",
|
|
@@ -5287,11 +5497,11 @@ var oauthErrorCode = import_zod20.z.enum([
|
|
|
5287
5497
|
/** RFC 8707: the `resource` named is not one this server issues tokens for. */
|
|
5288
5498
|
"invalid_target"
|
|
5289
5499
|
]);
|
|
5290
|
-
var oauthError =
|
|
5500
|
+
var oauthError = import_zod25.z.object({
|
|
5291
5501
|
error: oauthErrorCode,
|
|
5292
|
-
error_description:
|
|
5502
|
+
error_description: import_zod25.z.string().min(1).max(500).optional(),
|
|
5293
5503
|
/** Echoed back per RFC 6749 §4.1.2.1 so a client can match the response. */
|
|
5294
|
-
state:
|
|
5504
|
+
state: import_zod25.z.string().min(1).max(500).optional(),
|
|
5295
5505
|
/**
|
|
5296
5506
|
* **A Fleetless reason carried inside a standard envelope, and it exists
|
|
5297
5507
|
* because the alternative lost a distinction.**
|
|
@@ -5309,9 +5519,9 @@ var oauthError = import_zod20.z.object({
|
|
|
5309
5519
|
* our own tooling switches on. RFC 6749 §5.2 permits additional members, and
|
|
5310
5520
|
* a client that ignores this one still behaves correctly.
|
|
5311
5521
|
*/
|
|
5312
|
-
fleetless_code:
|
|
5522
|
+
fleetless_code: import_zod25.z.string().min(1).max(60).optional()
|
|
5313
5523
|
});
|
|
5314
|
-
var redirectUri =
|
|
5524
|
+
var redirectUri = import_zod25.z.string().min(1).max(2e3).refine((v) => {
|
|
5315
5525
|
let url;
|
|
5316
5526
|
try {
|
|
5317
5527
|
url = new URL(v);
|
|
@@ -5326,180 +5536,180 @@ var redirectUri = import_zod20.z.string().min(1).max(2e3).refine((v) => {
|
|
|
5326
5536
|
return ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname);
|
|
5327
5537
|
return false;
|
|
5328
5538
|
}, { message: "redirect_uri must be an https URL, or http on an explicit loopback address, and carry no fragment" });
|
|
5329
|
-
var codeChallengeMethod =
|
|
5539
|
+
var codeChallengeMethod = import_zod25.z.enum(["S256"]);
|
|
5330
5540
|
var MCP_DCR_MAX_REDIRECT_URIS = 5;
|
|
5331
|
-
var dynamicClientRegistrationRequest =
|
|
5332
|
-
redirect_uris:
|
|
5541
|
+
var dynamicClientRegistrationRequest = import_zod25.z.object({
|
|
5542
|
+
redirect_uris: import_zod25.z.array(redirectUri).min(1).max(MCP_DCR_MAX_REDIRECT_URIS).meta({
|
|
5333
5543
|
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.`
|
|
5334
5544
|
}),
|
|
5335
|
-
client_name:
|
|
5545
|
+
client_name: import_zod25.z.string().min(1).max(200).optional().meta({
|
|
5336
5546
|
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"*.'
|
|
5337
5547
|
}),
|
|
5338
|
-
token_endpoint_auth_method:
|
|
5548
|
+
token_endpoint_auth_method: import_zod25.z.enum(["none"]).optional().meta({
|
|
5339
5549
|
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."
|
|
5340
5550
|
}),
|
|
5341
|
-
grant_types:
|
|
5551
|
+
grant_types: import_zod25.z.array(import_zod25.z.enum(["authorization_code", "refresh_token"])).optional().meta({
|
|
5342
5552
|
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."
|
|
5343
5553
|
}),
|
|
5344
|
-
response_types:
|
|
5554
|
+
response_types: import_zod25.z.array(import_zod25.z.enum(["code"])).optional().meta({
|
|
5345
5555
|
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."
|
|
5346
5556
|
}),
|
|
5347
|
-
scope:
|
|
5557
|
+
scope: import_zod25.z.string().max(500).optional().meta({
|
|
5348
5558
|
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."
|
|
5349
5559
|
})
|
|
5350
5560
|
}).meta({
|
|
5351
5561
|
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)."
|
|
5352
5562
|
});
|
|
5353
|
-
var dynamicClientRegistrationResponse =
|
|
5354
|
-
client_id:
|
|
5563
|
+
var dynamicClientRegistrationResponse = import_zod25.z.object({
|
|
5564
|
+
client_id: import_zod25.z.string().min(1).max(200).meta({
|
|
5355
5565
|
description: "The identifier this client sends at the authorize and token endpoints. Opaque, and not the app identifier."
|
|
5356
5566
|
}),
|
|
5357
|
-
client_name:
|
|
5567
|
+
client_name: import_zod25.z.string().min(1).max(200).meta({
|
|
5358
5568
|
description: "The name the client registered under, echoed back. Chosen by the client and not vouched for by Fleetless."
|
|
5359
5569
|
}),
|
|
5360
|
-
redirect_uris:
|
|
5570
|
+
redirect_uris: import_zod25.z.array(redirectUri).meta({
|
|
5361
5571
|
description: "The redirect URIs this registration was accepted for. A code is returned to one of these and nowhere else."
|
|
5362
5572
|
}),
|
|
5363
|
-
grant_types:
|
|
5573
|
+
grant_types: import_zod25.z.array(import_zod25.z.string()).meta({
|
|
5364
5574
|
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.'
|
|
5365
5575
|
}),
|
|
5366
|
-
response_types:
|
|
5576
|
+
response_types: import_zod25.z.array(import_zod25.z.string()).meta({
|
|
5367
5577
|
description: "The response types this client may ask for: `code`."
|
|
5368
5578
|
}),
|
|
5369
|
-
token_endpoint_auth_method:
|
|
5579
|
+
token_endpoint_auth_method: import_zod25.z.literal("none").meta({
|
|
5370
5580
|
description: "`none` \u2014 this server registers public clients only, and PKCE rather than a secret is what protects the exchange."
|
|
5371
5581
|
}),
|
|
5372
|
-
client_id_issued_at:
|
|
5582
|
+
client_id_issued_at: import_zod25.z.number().int().nonnegative().meta({
|
|
5373
5583
|
description: "When the registration was created, in seconds since the epoch, per RFC 7591."
|
|
5374
5584
|
}),
|
|
5375
|
-
client_secret_expires_at:
|
|
5585
|
+
client_secret_expires_at: import_zod25.z.literal(0).meta({
|
|
5376
5586
|
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."
|
|
5377
5587
|
})
|
|
5378
5588
|
});
|
|
5379
|
-
var oauthCodeTokenRequest =
|
|
5380
|
-
grant_type:
|
|
5589
|
+
var oauthCodeTokenRequest = import_zod25.z.object({
|
|
5590
|
+
grant_type: import_zod25.z.literal("authorization_code").meta({
|
|
5381
5591
|
description: "`authorization_code`: this request exchanges the code from the authorize redirect for an access token and a refresh token."
|
|
5382
5592
|
}),
|
|
5383
|
-
code:
|
|
5593
|
+
code: import_zod25.z.string().min(1).max(500).meta({
|
|
5384
5594
|
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."
|
|
5385
5595
|
}),
|
|
5386
5596
|
redirect_uri: redirectUri.meta({
|
|
5387
5597
|
description: "The same redirect URI the authorize request used. It is compared, not merely recorded."
|
|
5388
5598
|
}),
|
|
5389
|
-
client_id:
|
|
5599
|
+
client_id: import_zod25.z.string().min(1).max(200).meta({
|
|
5390
5600
|
description: "The client making the exchange, as registered."
|
|
5391
5601
|
}),
|
|
5392
|
-
code_verifier:
|
|
5602
|
+
code_verifier: import_zod25.z.string().regex(/^[A-Za-z0-9\-._~]{43,128}$/, "code_verifier must be 43-128 unreserved characters (RFC 7636 \xA74.1)").meta({
|
|
5393
5603
|
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."
|
|
5394
5604
|
}),
|
|
5395
|
-
resource:
|
|
5605
|
+
resource: import_zod25.z.url().optional().meta({
|
|
5396
5606
|
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."
|
|
5397
5607
|
})
|
|
5398
5608
|
}).meta({
|
|
5399
5609
|
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."
|
|
5400
5610
|
});
|
|
5401
|
-
var oauthRefreshTokenRequest =
|
|
5402
|
-
grant_type:
|
|
5611
|
+
var oauthRefreshTokenRequest = import_zod25.z.object({
|
|
5612
|
+
grant_type: import_zod25.z.literal("refresh_token").meta({
|
|
5403
5613
|
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."
|
|
5404
5614
|
}),
|
|
5405
|
-
refresh_token:
|
|
5615
|
+
refresh_token: import_zod25.z.string().min(1).max(500).meta({
|
|
5406
5616
|
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."
|
|
5407
5617
|
}),
|
|
5408
|
-
client_id:
|
|
5618
|
+
client_id: import_zod25.z.string().min(1).max(200).meta({
|
|
5409
5619
|
description: "The client the refresh token was issued to, as registered. A refresh token is not transferable between clients."
|
|
5410
5620
|
}),
|
|
5411
|
-
resource:
|
|
5621
|
+
resource: import_zod25.z.url().optional().meta({
|
|
5412
5622
|
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."
|
|
5413
5623
|
})
|
|
5414
5624
|
}).meta({
|
|
5415
5625
|
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."
|
|
5416
5626
|
});
|
|
5417
|
-
var oauthTokenRequest =
|
|
5627
|
+
var oauthTokenRequest = import_zod25.z.discriminatedUnion("grant_type", [oauthCodeTokenRequest, oauthRefreshTokenRequest]).meta({
|
|
5418
5628
|
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."
|
|
5419
5629
|
});
|
|
5420
|
-
var oauthTokenResponse =
|
|
5421
|
-
access_token:
|
|
5630
|
+
var oauthTokenResponse = import_zod25.z.object({
|
|
5631
|
+
access_token: import_zod25.z.string().min(1).meta({
|
|
5422
5632
|
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."
|
|
5423
5633
|
}),
|
|
5424
|
-
token_type:
|
|
5634
|
+
token_type: import_zod25.z.literal("Bearer").meta({
|
|
5425
5635
|
description: "`Bearer`. RFC 6749 \xA75.1 makes the value case-insensitive for a client reading it; this is the spelling this server emits."
|
|
5426
5636
|
}),
|
|
5427
|
-
expires_in:
|
|
5637
|
+
expires_in: import_zod25.z.number().int().positive().meta({
|
|
5428
5638
|
description: "How long the access token is valid, in **seconds**, per RFC 6749 \xA75.1. Not a timestamp, and not milliseconds."
|
|
5429
5639
|
}),
|
|
5430
|
-
refresh_token:
|
|
5640
|
+
refresh_token: import_zod25.z.string().min(1).optional().meta({
|
|
5431
5641
|
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."
|
|
5432
5642
|
}),
|
|
5433
|
-
scope:
|
|
5643
|
+
scope: import_zod25.z.string().max(500).optional().meta({
|
|
5434
5644
|
description: "The scopes the issued token actually carries, space-separated."
|
|
5435
5645
|
})
|
|
5436
5646
|
});
|
|
5437
|
-
var authorizationServerMetadata =
|
|
5438
|
-
issuer:
|
|
5647
|
+
var authorizationServerMetadata = import_zod25.z.object({
|
|
5648
|
+
issuer: import_zod25.z.url().meta({
|
|
5439
5649
|
description: "The issuer identifier of this authorization server, per RFC 8414 \xA72. It is what a client checks a token's `iss` against."
|
|
5440
5650
|
}),
|
|
5441
|
-
authorization_endpoint:
|
|
5651
|
+
authorization_endpoint: import_zod25.z.url().meta({
|
|
5442
5652
|
description: "Where a client sends the user to authorize."
|
|
5443
5653
|
}),
|
|
5444
|
-
token_endpoint:
|
|
5654
|
+
token_endpoint: import_zod25.z.url().meta({
|
|
5445
5655
|
description: "The URL where a client exchanges an authorization code, or a refresh token, for tokens."
|
|
5446
5656
|
}),
|
|
5447
|
-
registration_endpoint:
|
|
5657
|
+
registration_endpoint: import_zod25.z.url().optional().meta({
|
|
5448
5658
|
description: "The URL where a client may register itself, per RFC 7591. Absent when the app does not accept dynamic clients."
|
|
5449
5659
|
}),
|
|
5450
|
-
response_types_supported:
|
|
5660
|
+
response_types_supported: import_zod25.z.array(import_zod25.z.literal("code")).meta({
|
|
5451
5661
|
description: "The response types this server offers: `code` only, the implicit grant being gone with OAuth 2.1."
|
|
5452
5662
|
}),
|
|
5453
|
-
grant_types_supported:
|
|
5663
|
+
grant_types_supported: import_zod25.z.array(import_zod25.z.enum(["authorization_code", "refresh_token"])).meta({
|
|
5454
5664
|
description: "The grants this server offers: `authorization_code` and `refresh_token`. OAuth 2.1 removes the implicit and password grants, so neither appears here."
|
|
5455
5665
|
}),
|
|
5456
|
-
code_challenge_methods_supported:
|
|
5666
|
+
code_challenge_methods_supported: import_zod25.z.array(codeChallengeMethod).meta({
|
|
5457
5667
|
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."
|
|
5458
5668
|
}),
|
|
5459
|
-
token_endpoint_auth_methods_supported:
|
|
5669
|
+
token_endpoint_auth_methods_supported: import_zod25.z.array(import_zod25.z.literal("none")).meta({
|
|
5460
5670
|
description: "How a client authenticates at the token endpoint: `none`, the public-client method, with PKCE protecting the exchange."
|
|
5461
5671
|
}),
|
|
5462
|
-
scopes_supported:
|
|
5672
|
+
scopes_supported: import_zod25.z.array(import_zod25.z.string()).optional().meta({
|
|
5463
5673
|
description: "The scopes this server knows about, where it publishes a list."
|
|
5464
5674
|
})
|
|
5465
5675
|
});
|
|
5466
|
-
var protectedResourceMetadata =
|
|
5467
|
-
resource:
|
|
5676
|
+
var protectedResourceMetadata = import_zod25.z.object({
|
|
5677
|
+
resource: import_zod25.z.url().meta({
|
|
5468
5678
|
description: "The resource identifier this document describes, per RFC 9728. A token whose audience names something else is rejected here rather than merely noted."
|
|
5469
5679
|
}),
|
|
5470
|
-
authorization_servers:
|
|
5680
|
+
authorization_servers: import_zod25.z.array(import_zod25.z.url()).min(1).meta({
|
|
5471
5681
|
description: "The authorization servers that may issue tokens for this resource. There is always at least one."
|
|
5472
5682
|
}),
|
|
5473
|
-
bearer_methods_supported:
|
|
5683
|
+
bearer_methods_supported: import_zod25.z.array(import_zod25.z.literal("header")).meta({
|
|
5474
5684
|
description: "How a token may be presented: in the `Authorization` header only, never in a query parameter or a form field."
|
|
5475
5685
|
}),
|
|
5476
|
-
scopes_supported:
|
|
5686
|
+
scopes_supported: import_zod25.z.array(import_zod25.z.string()).optional().meta({
|
|
5477
5687
|
description: "The scopes this resource understands, where it publishes a list."
|
|
5478
5688
|
})
|
|
5479
5689
|
});
|
|
5480
|
-
var oauthRedirectResponse =
|
|
5481
|
-
redirect_to:
|
|
5690
|
+
var oauthRedirectResponse = import_zod25.z.object({
|
|
5691
|
+
redirect_to: import_zod25.z.string().min(1).max(2e3)
|
|
5482
5692
|
});
|
|
5483
|
-
var oauthAuthorizeQuery =
|
|
5484
|
-
response_type:
|
|
5693
|
+
var oauthAuthorizeQuery = import_zod25.z.object({
|
|
5694
|
+
response_type: import_zod25.z.literal("code").meta({
|
|
5485
5695
|
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`."
|
|
5486
5696
|
}),
|
|
5487
|
-
client_id:
|
|
5697
|
+
client_id: import_zod25.z.string().min(1).meta({
|
|
5488
5698
|
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."
|
|
5489
5699
|
}),
|
|
5490
|
-
redirect_uri:
|
|
5700
|
+
redirect_uri: import_zod25.z.string().min(1).meta({
|
|
5491
5701
|
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."
|
|
5492
5702
|
}),
|
|
5493
|
-
code_challenge:
|
|
5703
|
+
code_challenge: import_zod25.z.string().min(1).meta({
|
|
5494
5704
|
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."
|
|
5495
5705
|
}),
|
|
5496
|
-
code_challenge_method:
|
|
5706
|
+
code_challenge_method: import_zod25.z.literal("S256").meta({
|
|
5497
5707
|
description: "Only `S256`. `plain` is refused: a challenge equal to its verifier defends against nothing."
|
|
5498
5708
|
}),
|
|
5499
|
-
state:
|
|
5709
|
+
state: import_zod25.z.string().optional().meta({
|
|
5500
5710
|
description: "Returned unchanged on the callback, and on the error redirect too, so a client can bind either answer to its own request."
|
|
5501
5711
|
}),
|
|
5502
|
-
resource:
|
|
5712
|
+
resource: import_zod25.z.string().optional().meta({
|
|
5503
5713
|
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."
|
|
5504
5714
|
})
|
|
5505
5715
|
// **No `scope`, because this authorization server issues none.** The field
|
|
@@ -5512,13 +5722,1106 @@ var oauthAuthorizeQuery = import_zod20.z.object({
|
|
|
5512
5722
|
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."
|
|
5513
5723
|
});
|
|
5514
5724
|
|
|
5515
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
5725
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/controller-register.js
|
|
5726
|
+
var import_zod26 = require("zod");
|
|
5727
|
+
var text = (max) => import_zod26.z.string().regex(/^\P{Cc}*$/u).trim().min(1).max(max);
|
|
5728
|
+
var email = import_zod26.z.string().regex(/^\P{Cc}*$/u).trim().email().max(320);
|
|
5729
|
+
var controllerRegisterAddress = import_zod26.z.object({
|
|
5730
|
+
line1: text(200),
|
|
5731
|
+
line2: text(200).nullable().default(null),
|
|
5732
|
+
postalCode: text(32),
|
|
5733
|
+
city: text(120),
|
|
5734
|
+
country: import_zod26.z.string().regex(/^\P{Cc}*$/u).trim().regex(/^[A-Z]{2}$/)
|
|
5735
|
+
}).strict();
|
|
5736
|
+
var controllerRegisterPrivacyContact = import_zod26.z.object({
|
|
5737
|
+
name: text(200),
|
|
5738
|
+
email,
|
|
5739
|
+
role: import_zod26.z.enum(["general", "appointed_dpo"])
|
|
5740
|
+
}).strict();
|
|
5741
|
+
var controllerRegisterRepresentative = import_zod26.z.object({
|
|
5742
|
+
name: text(200),
|
|
5743
|
+
email,
|
|
5744
|
+
address: text(500)
|
|
5745
|
+
}).strict();
|
|
5746
|
+
var controllerRegisterWrite = import_zod26.z.object({
|
|
5747
|
+
legalName: text(200),
|
|
5748
|
+
address: controllerRegisterAddress,
|
|
5749
|
+
privacyContact: controllerRegisterPrivacyContact.nullable(),
|
|
5750
|
+
euRepresentative: controllerRegisterRepresentative.nullable(),
|
|
5751
|
+
confirmationSource: text(500)
|
|
5752
|
+
}).strict();
|
|
5753
|
+
var controllerRegisterOrgRecord = controllerRegisterWrite.extend({
|
|
5754
|
+
legalName: text(200).nullable(),
|
|
5755
|
+
address: controllerRegisterAddress.nullable(),
|
|
5756
|
+
updatedAt: import_zod26.z.iso.datetime(),
|
|
5757
|
+
updatedByKind: import_zod26.z.enum(["owner", "operator"]),
|
|
5758
|
+
updatedById: import_zod26.z.uuid()
|
|
5759
|
+
}).strict();
|
|
5760
|
+
var controllerRegisterOrgResponse = import_zod26.z.object({
|
|
5761
|
+
orgId: import_zod26.z.uuid(),
|
|
5762
|
+
details: controllerRegisterOrgRecord.nullable()
|
|
5763
|
+
}).strict();
|
|
5764
|
+
|
|
5765
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/billing.js
|
|
5766
|
+
var import_zod27 = require("zod");
|
|
5767
|
+
|
|
5768
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/iana-time-zones.js
|
|
5769
|
+
var ianaTimeZones = [
|
|
5770
|
+
"UTC",
|
|
5771
|
+
"Etc/UTC",
|
|
5772
|
+
"Etc/GMT",
|
|
5773
|
+
"Africa/Abidjan",
|
|
5774
|
+
"Africa/Accra",
|
|
5775
|
+
"Africa/Addis_Ababa",
|
|
5776
|
+
"Africa/Algiers",
|
|
5777
|
+
"Africa/Asmera",
|
|
5778
|
+
"Africa/Bamako",
|
|
5779
|
+
"Africa/Bangui",
|
|
5780
|
+
"Africa/Banjul",
|
|
5781
|
+
"Africa/Bissau",
|
|
5782
|
+
"Africa/Blantyre",
|
|
5783
|
+
"Africa/Brazzaville",
|
|
5784
|
+
"Africa/Bujumbura",
|
|
5785
|
+
"Africa/Cairo",
|
|
5786
|
+
"Africa/Casablanca",
|
|
5787
|
+
"Africa/Ceuta",
|
|
5788
|
+
"Africa/Conakry",
|
|
5789
|
+
"Africa/Dakar",
|
|
5790
|
+
"Africa/Dar_es_Salaam",
|
|
5791
|
+
"Africa/Djibouti",
|
|
5792
|
+
"Africa/Douala",
|
|
5793
|
+
"Africa/El_Aaiun",
|
|
5794
|
+
"Africa/Freetown",
|
|
5795
|
+
"Africa/Gaborone",
|
|
5796
|
+
"Africa/Harare",
|
|
5797
|
+
"Africa/Johannesburg",
|
|
5798
|
+
"Africa/Juba",
|
|
5799
|
+
"Africa/Kampala",
|
|
5800
|
+
"Africa/Khartoum",
|
|
5801
|
+
"Africa/Kigali",
|
|
5802
|
+
"Africa/Kinshasa",
|
|
5803
|
+
"Africa/Lagos",
|
|
5804
|
+
"Africa/Libreville",
|
|
5805
|
+
"Africa/Lome",
|
|
5806
|
+
"Africa/Luanda",
|
|
5807
|
+
"Africa/Lubumbashi",
|
|
5808
|
+
"Africa/Lusaka",
|
|
5809
|
+
"Africa/Malabo",
|
|
5810
|
+
"Africa/Maputo",
|
|
5811
|
+
"Africa/Maseru",
|
|
5812
|
+
"Africa/Mbabane",
|
|
5813
|
+
"Africa/Mogadishu",
|
|
5814
|
+
"Africa/Monrovia",
|
|
5815
|
+
"Africa/Nairobi",
|
|
5816
|
+
"Africa/Ndjamena",
|
|
5817
|
+
"Africa/Niamey",
|
|
5818
|
+
"Africa/Nouakchott",
|
|
5819
|
+
"Africa/Ouagadougou",
|
|
5820
|
+
"Africa/Porto-Novo",
|
|
5821
|
+
"Africa/Sao_Tome",
|
|
5822
|
+
"Africa/Tripoli",
|
|
5823
|
+
"Africa/Tunis",
|
|
5824
|
+
"Africa/Windhoek",
|
|
5825
|
+
"America/Adak",
|
|
5826
|
+
"America/Anchorage",
|
|
5827
|
+
"America/Anguilla",
|
|
5828
|
+
"America/Antigua",
|
|
5829
|
+
"America/Araguaina",
|
|
5830
|
+
"America/Argentina/La_Rioja",
|
|
5831
|
+
"America/Argentina/Rio_Gallegos",
|
|
5832
|
+
"America/Argentina/Salta",
|
|
5833
|
+
"America/Argentina/San_Juan",
|
|
5834
|
+
"America/Argentina/San_Luis",
|
|
5835
|
+
"America/Argentina/Tucuman",
|
|
5836
|
+
"America/Argentina/Ushuaia",
|
|
5837
|
+
"America/Aruba",
|
|
5838
|
+
"America/Asuncion",
|
|
5839
|
+
"America/Bahia",
|
|
5840
|
+
"America/Bahia_Banderas",
|
|
5841
|
+
"America/Barbados",
|
|
5842
|
+
"America/Belem",
|
|
5843
|
+
"America/Belize",
|
|
5844
|
+
"America/Blanc-Sablon",
|
|
5845
|
+
"America/Boa_Vista",
|
|
5846
|
+
"America/Bogota",
|
|
5847
|
+
"America/Boise",
|
|
5848
|
+
"America/Buenos_Aires",
|
|
5849
|
+
"America/Cambridge_Bay",
|
|
5850
|
+
"America/Campo_Grande",
|
|
5851
|
+
"America/Cancun",
|
|
5852
|
+
"America/Caracas",
|
|
5853
|
+
"America/Catamarca",
|
|
5854
|
+
"America/Cayenne",
|
|
5855
|
+
"America/Cayman",
|
|
5856
|
+
"America/Chicago",
|
|
5857
|
+
"America/Chihuahua",
|
|
5858
|
+
"America/Ciudad_Juarez",
|
|
5859
|
+
"America/Coral_Harbour",
|
|
5860
|
+
"America/Cordoba",
|
|
5861
|
+
"America/Costa_Rica",
|
|
5862
|
+
"America/Coyhaique",
|
|
5863
|
+
"America/Creston",
|
|
5864
|
+
"America/Cuiaba",
|
|
5865
|
+
"America/Curacao",
|
|
5866
|
+
"America/Danmarkshavn",
|
|
5867
|
+
"America/Dawson",
|
|
5868
|
+
"America/Dawson_Creek",
|
|
5869
|
+
"America/Denver",
|
|
5870
|
+
"America/Detroit",
|
|
5871
|
+
"America/Dominica",
|
|
5872
|
+
"America/Edmonton",
|
|
5873
|
+
"America/Eirunepe",
|
|
5874
|
+
"America/El_Salvador",
|
|
5875
|
+
"America/Fort_Nelson",
|
|
5876
|
+
"America/Fortaleza",
|
|
5877
|
+
"America/Glace_Bay",
|
|
5878
|
+
"America/Godthab",
|
|
5879
|
+
"America/Goose_Bay",
|
|
5880
|
+
"America/Grand_Turk",
|
|
5881
|
+
"America/Grenada",
|
|
5882
|
+
"America/Guadeloupe",
|
|
5883
|
+
"America/Guatemala",
|
|
5884
|
+
"America/Guayaquil",
|
|
5885
|
+
"America/Guyana",
|
|
5886
|
+
"America/Halifax",
|
|
5887
|
+
"America/Havana",
|
|
5888
|
+
"America/Hermosillo",
|
|
5889
|
+
"America/Indiana/Knox",
|
|
5890
|
+
"America/Indiana/Marengo",
|
|
5891
|
+
"America/Indiana/Petersburg",
|
|
5892
|
+
"America/Indiana/Tell_City",
|
|
5893
|
+
"America/Indiana/Vevay",
|
|
5894
|
+
"America/Indiana/Vincennes",
|
|
5895
|
+
"America/Indiana/Winamac",
|
|
5896
|
+
"America/Indianapolis",
|
|
5897
|
+
"America/Inuvik",
|
|
5898
|
+
"America/Iqaluit",
|
|
5899
|
+
"America/Jamaica",
|
|
5900
|
+
"America/Jujuy",
|
|
5901
|
+
"America/Juneau",
|
|
5902
|
+
"America/Kentucky/Monticello",
|
|
5903
|
+
"America/Kralendijk",
|
|
5904
|
+
"America/La_Paz",
|
|
5905
|
+
"America/Lima",
|
|
5906
|
+
"America/Los_Angeles",
|
|
5907
|
+
"America/Louisville",
|
|
5908
|
+
"America/Lower_Princes",
|
|
5909
|
+
"America/Maceio",
|
|
5910
|
+
"America/Managua",
|
|
5911
|
+
"America/Manaus",
|
|
5912
|
+
"America/Marigot",
|
|
5913
|
+
"America/Martinique",
|
|
5914
|
+
"America/Matamoros",
|
|
5915
|
+
"America/Mazatlan",
|
|
5916
|
+
"America/Mendoza",
|
|
5917
|
+
"America/Menominee",
|
|
5918
|
+
"America/Merida",
|
|
5919
|
+
"America/Metlakatla",
|
|
5920
|
+
"America/Mexico_City",
|
|
5921
|
+
"America/Miquelon",
|
|
5922
|
+
"America/Moncton",
|
|
5923
|
+
"America/Monterrey",
|
|
5924
|
+
"America/Montevideo",
|
|
5925
|
+
"America/Montserrat",
|
|
5926
|
+
"America/Nassau",
|
|
5927
|
+
"America/New_York",
|
|
5928
|
+
"America/Nome",
|
|
5929
|
+
"America/Noronha",
|
|
5930
|
+
"America/North_Dakota/Beulah",
|
|
5931
|
+
"America/North_Dakota/Center",
|
|
5932
|
+
"America/North_Dakota/New_Salem",
|
|
5933
|
+
"America/Ojinaga",
|
|
5934
|
+
"America/Panama",
|
|
5935
|
+
"America/Paramaribo",
|
|
5936
|
+
"America/Phoenix",
|
|
5937
|
+
"America/Port-au-Prince",
|
|
5938
|
+
"America/Port_of_Spain",
|
|
5939
|
+
"America/Porto_Velho",
|
|
5940
|
+
"America/Puerto_Rico",
|
|
5941
|
+
"America/Punta_Arenas",
|
|
5942
|
+
"America/Rankin_Inlet",
|
|
5943
|
+
"America/Recife",
|
|
5944
|
+
"America/Regina",
|
|
5945
|
+
"America/Resolute",
|
|
5946
|
+
"America/Rio_Branco",
|
|
5947
|
+
"America/Santarem",
|
|
5948
|
+
"America/Santiago",
|
|
5949
|
+
"America/Santo_Domingo",
|
|
5950
|
+
"America/Sao_Paulo",
|
|
5951
|
+
"America/Scoresbysund",
|
|
5952
|
+
"America/Sitka",
|
|
5953
|
+
"America/St_Barthelemy",
|
|
5954
|
+
"America/St_Johns",
|
|
5955
|
+
"America/St_Kitts",
|
|
5956
|
+
"America/St_Lucia",
|
|
5957
|
+
"America/St_Thomas",
|
|
5958
|
+
"America/St_Vincent",
|
|
5959
|
+
"America/Swift_Current",
|
|
5960
|
+
"America/Tegucigalpa",
|
|
5961
|
+
"America/Thule",
|
|
5962
|
+
"America/Tijuana",
|
|
5963
|
+
"America/Toronto",
|
|
5964
|
+
"America/Tortola",
|
|
5965
|
+
"America/Vancouver",
|
|
5966
|
+
"America/Whitehorse",
|
|
5967
|
+
"America/Winnipeg",
|
|
5968
|
+
"America/Yakutat",
|
|
5969
|
+
"Antarctica/Casey",
|
|
5970
|
+
"Antarctica/Davis",
|
|
5971
|
+
"Antarctica/DumontDUrville",
|
|
5972
|
+
"Antarctica/Macquarie",
|
|
5973
|
+
"Antarctica/Mawson",
|
|
5974
|
+
"Antarctica/McMurdo",
|
|
5975
|
+
"Antarctica/Palmer",
|
|
5976
|
+
"Antarctica/Rothera",
|
|
5977
|
+
"Antarctica/Syowa",
|
|
5978
|
+
"Antarctica/Troll",
|
|
5979
|
+
"Antarctica/Vostok",
|
|
5980
|
+
"Arctic/Longyearbyen",
|
|
5981
|
+
"Asia/Aden",
|
|
5982
|
+
"Asia/Almaty",
|
|
5983
|
+
"Asia/Amman",
|
|
5984
|
+
"Asia/Anadyr",
|
|
5985
|
+
"Asia/Aqtau",
|
|
5986
|
+
"Asia/Aqtobe",
|
|
5987
|
+
"Asia/Ashgabat",
|
|
5988
|
+
"Asia/Atyrau",
|
|
5989
|
+
"Asia/Baghdad",
|
|
5990
|
+
"Asia/Bahrain",
|
|
5991
|
+
"Asia/Baku",
|
|
5992
|
+
"Asia/Bangkok",
|
|
5993
|
+
"Asia/Barnaul",
|
|
5994
|
+
"Asia/Beirut",
|
|
5995
|
+
"Asia/Bishkek",
|
|
5996
|
+
"Asia/Brunei",
|
|
5997
|
+
"Asia/Calcutta",
|
|
5998
|
+
"Asia/Chita",
|
|
5999
|
+
"Asia/Colombo",
|
|
6000
|
+
"Asia/Damascus",
|
|
6001
|
+
"Asia/Dhaka",
|
|
6002
|
+
"Asia/Dili",
|
|
6003
|
+
"Asia/Dubai",
|
|
6004
|
+
"Asia/Dushanbe",
|
|
6005
|
+
"Asia/Famagusta",
|
|
6006
|
+
"Asia/Gaza",
|
|
6007
|
+
"Asia/Hebron",
|
|
6008
|
+
"Asia/Hong_Kong",
|
|
6009
|
+
"Asia/Hovd",
|
|
6010
|
+
"Asia/Irkutsk",
|
|
6011
|
+
"Asia/Jakarta",
|
|
6012
|
+
"Asia/Jayapura",
|
|
6013
|
+
"Asia/Jerusalem",
|
|
6014
|
+
"Asia/Kabul",
|
|
6015
|
+
"Asia/Kamchatka",
|
|
6016
|
+
"Asia/Karachi",
|
|
6017
|
+
"Asia/Katmandu",
|
|
6018
|
+
"Asia/Khandyga",
|
|
6019
|
+
"Asia/Krasnoyarsk",
|
|
6020
|
+
"Asia/Kuala_Lumpur",
|
|
6021
|
+
"Asia/Kuching",
|
|
6022
|
+
"Asia/Kuwait",
|
|
6023
|
+
"Asia/Macau",
|
|
6024
|
+
"Asia/Magadan",
|
|
6025
|
+
"Asia/Makassar",
|
|
6026
|
+
"Asia/Manila",
|
|
6027
|
+
"Asia/Muscat",
|
|
6028
|
+
"Asia/Nicosia",
|
|
6029
|
+
"Asia/Novokuznetsk",
|
|
6030
|
+
"Asia/Novosibirsk",
|
|
6031
|
+
"Asia/Omsk",
|
|
6032
|
+
"Asia/Oral",
|
|
6033
|
+
"Asia/Phnom_Penh",
|
|
6034
|
+
"Asia/Pontianak",
|
|
6035
|
+
"Asia/Pyongyang",
|
|
6036
|
+
"Asia/Qatar",
|
|
6037
|
+
"Asia/Qostanay",
|
|
6038
|
+
"Asia/Qyzylorda",
|
|
6039
|
+
"Asia/Rangoon",
|
|
6040
|
+
"Asia/Riyadh",
|
|
6041
|
+
"Asia/Saigon",
|
|
6042
|
+
"Asia/Sakhalin",
|
|
6043
|
+
"Asia/Samarkand",
|
|
6044
|
+
"Asia/Seoul",
|
|
6045
|
+
"Asia/Shanghai",
|
|
6046
|
+
"Asia/Singapore",
|
|
6047
|
+
"Asia/Srednekolymsk",
|
|
6048
|
+
"Asia/Taipei",
|
|
6049
|
+
"Asia/Tashkent",
|
|
6050
|
+
"Asia/Tbilisi",
|
|
6051
|
+
"Asia/Tehran",
|
|
6052
|
+
"Asia/Thimphu",
|
|
6053
|
+
"Asia/Tokyo",
|
|
6054
|
+
"Asia/Tomsk",
|
|
6055
|
+
"Asia/Ulaanbaatar",
|
|
6056
|
+
"Asia/Urumqi",
|
|
6057
|
+
"Asia/Ust-Nera",
|
|
6058
|
+
"Asia/Vientiane",
|
|
6059
|
+
"Asia/Vladivostok",
|
|
6060
|
+
"Asia/Yakutsk",
|
|
6061
|
+
"Asia/Yekaterinburg",
|
|
6062
|
+
"Asia/Yerevan",
|
|
6063
|
+
"Atlantic/Azores",
|
|
6064
|
+
"Atlantic/Bermuda",
|
|
6065
|
+
"Atlantic/Canary",
|
|
6066
|
+
"Atlantic/Cape_Verde",
|
|
6067
|
+
"Atlantic/Faeroe",
|
|
6068
|
+
"Atlantic/Madeira",
|
|
6069
|
+
"Atlantic/Reykjavik",
|
|
6070
|
+
"Atlantic/South_Georgia",
|
|
6071
|
+
"Atlantic/St_Helena",
|
|
6072
|
+
"Atlantic/Stanley",
|
|
6073
|
+
"Australia/Adelaide",
|
|
6074
|
+
"Australia/Brisbane",
|
|
6075
|
+
"Australia/Broken_Hill",
|
|
6076
|
+
"Australia/Darwin",
|
|
6077
|
+
"Australia/Eucla",
|
|
6078
|
+
"Australia/Hobart",
|
|
6079
|
+
"Australia/Lindeman",
|
|
6080
|
+
"Australia/Lord_Howe",
|
|
6081
|
+
"Australia/Melbourne",
|
|
6082
|
+
"Australia/Perth",
|
|
6083
|
+
"Australia/Sydney",
|
|
6084
|
+
"Europe/Amsterdam",
|
|
6085
|
+
"Europe/Andorra",
|
|
6086
|
+
"Europe/Astrakhan",
|
|
6087
|
+
"Europe/Athens",
|
|
6088
|
+
"Europe/Belgrade",
|
|
6089
|
+
"Europe/Berlin",
|
|
6090
|
+
"Europe/Bratislava",
|
|
6091
|
+
"Europe/Brussels",
|
|
6092
|
+
"Europe/Bucharest",
|
|
6093
|
+
"Europe/Budapest",
|
|
6094
|
+
"Europe/Busingen",
|
|
6095
|
+
"Europe/Chisinau",
|
|
6096
|
+
"Europe/Copenhagen",
|
|
6097
|
+
"Europe/Dublin",
|
|
6098
|
+
"Europe/Gibraltar",
|
|
6099
|
+
"Europe/Guernsey",
|
|
6100
|
+
"Europe/Helsinki",
|
|
6101
|
+
"Europe/Isle_of_Man",
|
|
6102
|
+
"Europe/Istanbul",
|
|
6103
|
+
"Europe/Jersey",
|
|
6104
|
+
"Europe/Kaliningrad",
|
|
6105
|
+
"Europe/Kiev",
|
|
6106
|
+
"Europe/Kirov",
|
|
6107
|
+
"Europe/Lisbon",
|
|
6108
|
+
"Europe/Ljubljana",
|
|
6109
|
+
"Europe/London",
|
|
6110
|
+
"Europe/Luxembourg",
|
|
6111
|
+
"Europe/Madrid",
|
|
6112
|
+
"Europe/Malta",
|
|
6113
|
+
"Europe/Mariehamn",
|
|
6114
|
+
"Europe/Minsk",
|
|
6115
|
+
"Europe/Monaco",
|
|
6116
|
+
"Europe/Moscow",
|
|
6117
|
+
"Europe/Oslo",
|
|
6118
|
+
"Europe/Paris",
|
|
6119
|
+
"Europe/Podgorica",
|
|
6120
|
+
"Europe/Prague",
|
|
6121
|
+
"Europe/Riga",
|
|
6122
|
+
"Europe/Rome",
|
|
6123
|
+
"Europe/Samara",
|
|
6124
|
+
"Europe/San_Marino",
|
|
6125
|
+
"Europe/Sarajevo",
|
|
6126
|
+
"Europe/Saratov",
|
|
6127
|
+
"Europe/Simferopol",
|
|
6128
|
+
"Europe/Skopje",
|
|
6129
|
+
"Europe/Sofia",
|
|
6130
|
+
"Europe/Stockholm",
|
|
6131
|
+
"Europe/Tallinn",
|
|
6132
|
+
"Europe/Tirane",
|
|
6133
|
+
"Europe/Ulyanovsk",
|
|
6134
|
+
"Europe/Vaduz",
|
|
6135
|
+
"Europe/Vatican",
|
|
6136
|
+
"Europe/Vienna",
|
|
6137
|
+
"Europe/Vilnius",
|
|
6138
|
+
"Europe/Volgograd",
|
|
6139
|
+
"Europe/Warsaw",
|
|
6140
|
+
"Europe/Zagreb",
|
|
6141
|
+
"Europe/Zurich",
|
|
6142
|
+
"Indian/Antananarivo",
|
|
6143
|
+
"Indian/Chagos",
|
|
6144
|
+
"Indian/Christmas",
|
|
6145
|
+
"Indian/Cocos",
|
|
6146
|
+
"Indian/Comoro",
|
|
6147
|
+
"Indian/Kerguelen",
|
|
6148
|
+
"Indian/Mahe",
|
|
6149
|
+
"Indian/Maldives",
|
|
6150
|
+
"Indian/Mauritius",
|
|
6151
|
+
"Indian/Mayotte",
|
|
6152
|
+
"Indian/Reunion",
|
|
6153
|
+
"Pacific/Apia",
|
|
6154
|
+
"Pacific/Auckland",
|
|
6155
|
+
"Pacific/Bougainville",
|
|
6156
|
+
"Pacific/Chatham",
|
|
6157
|
+
"Pacific/Easter",
|
|
6158
|
+
"Pacific/Efate",
|
|
6159
|
+
"Pacific/Enderbury",
|
|
6160
|
+
"Pacific/Fakaofo",
|
|
6161
|
+
"Pacific/Fiji",
|
|
6162
|
+
"Pacific/Funafuti",
|
|
6163
|
+
"Pacific/Galapagos",
|
|
6164
|
+
"Pacific/Gambier",
|
|
6165
|
+
"Pacific/Guadalcanal",
|
|
6166
|
+
"Pacific/Guam",
|
|
6167
|
+
"Pacific/Honolulu",
|
|
6168
|
+
"Pacific/Kiritimati",
|
|
6169
|
+
"Pacific/Kosrae",
|
|
6170
|
+
"Pacific/Kwajalein",
|
|
6171
|
+
"Pacific/Majuro",
|
|
6172
|
+
"Pacific/Marquesas",
|
|
6173
|
+
"Pacific/Midway",
|
|
6174
|
+
"Pacific/Nauru",
|
|
6175
|
+
"Pacific/Niue",
|
|
6176
|
+
"Pacific/Norfolk",
|
|
6177
|
+
"Pacific/Noumea",
|
|
6178
|
+
"Pacific/Pago_Pago",
|
|
6179
|
+
"Pacific/Palau",
|
|
6180
|
+
"Pacific/Pitcairn",
|
|
6181
|
+
"Pacific/Ponape",
|
|
6182
|
+
"Pacific/Port_Moresby",
|
|
6183
|
+
"Pacific/Rarotonga",
|
|
6184
|
+
"Pacific/Saipan",
|
|
6185
|
+
"Pacific/Tahiti",
|
|
6186
|
+
"Pacific/Tarawa",
|
|
6187
|
+
"Pacific/Tongatapu",
|
|
6188
|
+
"Pacific/Truk",
|
|
6189
|
+
"Pacific/Wake",
|
|
6190
|
+
"Pacific/Wallis"
|
|
6191
|
+
];
|
|
6192
|
+
|
|
6193
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/billing.js
|
|
6194
|
+
var countryCode = import_zod27.z.string().regex(/^[A-Z]{2}$/);
|
|
6195
|
+
var EU_COUNTRIES = [
|
|
6196
|
+
"AT",
|
|
6197
|
+
"BE",
|
|
6198
|
+
"BG",
|
|
6199
|
+
"CY",
|
|
6200
|
+
"CZ",
|
|
6201
|
+
"DE",
|
|
6202
|
+
"DK",
|
|
6203
|
+
"EE",
|
|
6204
|
+
"ES",
|
|
6205
|
+
"FI",
|
|
6206
|
+
"FR",
|
|
6207
|
+
"GR",
|
|
6208
|
+
"HR",
|
|
6209
|
+
"HU",
|
|
6210
|
+
"IE",
|
|
6211
|
+
"IT",
|
|
6212
|
+
"LT",
|
|
6213
|
+
"LU",
|
|
6214
|
+
"LV",
|
|
6215
|
+
"MT",
|
|
6216
|
+
"NL",
|
|
6217
|
+
"PL",
|
|
6218
|
+
"PT",
|
|
6219
|
+
"RO",
|
|
6220
|
+
"SE",
|
|
6221
|
+
"SI",
|
|
6222
|
+
"SK"
|
|
6223
|
+
];
|
|
6224
|
+
var SELLER_COUNTRY = "DE";
|
|
6225
|
+
function isEuCountry(country) {
|
|
6226
|
+
return EU_COUNTRIES.includes(country);
|
|
6227
|
+
}
|
|
6228
|
+
var payerKind = import_zod27.z.enum(["company", "person"]);
|
|
6229
|
+
var billingCycle = import_zod27.z.enum(["monthly", "yearly"]);
|
|
6230
|
+
var vatTreatment = import_zod27.z.enum(["de_standard", "reverse_charge", "outside_eu"]);
|
|
6231
|
+
var payerRefusalRule = import_zod27.z.enum(["company_required", "vat_id_required", "vat_id_invalid"]);
|
|
6232
|
+
var viesPendingReason = import_zod27.z.enum(["vies_unavailable", "vies_unverified", "vies_identifier_missing"]);
|
|
6233
|
+
var vatDecision = import_zod27.z.discriminatedUnion("state", [
|
|
6234
|
+
import_zod27.z.object({ state: import_zod27.z.literal("eligible"), treatment: vatTreatment, rate_percent: import_zod27.z.number().int().min(0).max(100) }).strict(),
|
|
6235
|
+
import_zod27.z.object({ state: import_zod27.z.literal("pending"), reason: viesPendingReason }).strict(),
|
|
6236
|
+
import_zod27.z.object({ state: import_zod27.z.literal("refused"), rule: payerRefusalRule }).strict()
|
|
6237
|
+
]);
|
|
6238
|
+
var billingAddress = import_zod27.z.object({
|
|
6239
|
+
line1: import_zod27.z.string().trim().min(1).max(200).meta({ description: "Street and number, or the first address line." }),
|
|
6240
|
+
line2: import_zod27.z.string().trim().max(200).nullable().meta({ description: "A second address line, or `null` when there is none." }),
|
|
6241
|
+
postal_code: import_zod27.z.string().trim().min(1).max(20).meta({ description: "Postal or ZIP code." }),
|
|
6242
|
+
city: import_zod27.z.string().trim().min(1).max(100).meta({ description: "City or town." }),
|
|
6243
|
+
country: countryCode.meta({ description: "The billing country, used for purchase eligibility and VAT." }),
|
|
6244
|
+
state: import_zod27.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." })
|
|
6245
|
+
}).strict();
|
|
6246
|
+
var billingDetails = import_zod27.z.discriminatedUnion("kind", [
|
|
6247
|
+
import_zod27.z.object({
|
|
6248
|
+
kind: import_zod27.z.literal("company").meta({ description: "Billed as a company." }),
|
|
6249
|
+
company_name: import_zod27.z.string().trim().min(1).max(200).meta({ description: "The company's legal name, printed on the invoice." }),
|
|
6250
|
+
vat_id: import_zod27.z.string().trim().max(20).nullable().meta({
|
|
6251
|
+
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."
|
|
6252
|
+
}),
|
|
6253
|
+
tax_id: import_zod27.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." }),
|
|
6254
|
+
address: billingAddress.meta({ description: "The billing address." }),
|
|
6255
|
+
invoice_email: import_zod27.z.email().meta({ description: "Where invoices and billing mail are sent." })
|
|
6256
|
+
}).strict().meta({ description: "A company: name and an optional VAT ID, never 'full name'." }),
|
|
6257
|
+
import_zod27.z.object({
|
|
6258
|
+
kind: import_zod27.z.literal("person").meta({ description: "Billed as a person." }),
|
|
6259
|
+
full_name: import_zod27.z.string().trim().min(1).max(200).meta({ description: "The person's full name, printed on the invoice." }),
|
|
6260
|
+
address: billingAddress.meta({ description: "The billing address." }),
|
|
6261
|
+
invoice_email: import_zod27.z.email().meta({ description: "Where invoices and billing mail are sent." })
|
|
6262
|
+
}).strict().meta({ description: "A person: a full name, never a VAT ID \u2014 only a company can be VAT-registered." })
|
|
6263
|
+
]);
|
|
6264
|
+
var purchaseBillingDetails = billingDetails.options[0].superRefine((payer, ctx) => {
|
|
6265
|
+
const country = payer.address.country;
|
|
6266
|
+
if (isEuCountry(country) && country !== SELLER_COUNTRY && !payer.vat_id?.trim()) {
|
|
6267
|
+
ctx.addIssue({ code: "custom", path: ["vat_id"], message: "vat_id_required" });
|
|
6268
|
+
}
|
|
6269
|
+
if (!isEuCountry(country) && !payer.tax_id?.trim()) {
|
|
6270
|
+
ctx.addIssue({ code: "custom", path: ["tax_id"], message: "tax_id_required" });
|
|
6271
|
+
}
|
|
6272
|
+
if (country === "US" && !/^[A-Z]{2}$/.test(payer.address.state ?? "")) {
|
|
6273
|
+
ctx.addIssue({ code: "custom", path: ["address", "state"], message: "us_state_required" });
|
|
6274
|
+
}
|
|
6275
|
+
}).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." });
|
|
6276
|
+
var purchaseOperation = import_zod27.z.enum(["checkout", "paid_change", "invoice_payment", "payment_method_invoice", "mandate_setup"]);
|
|
6277
|
+
var chargeOperation = purchaseOperation.exclude(["mandate_setup"]);
|
|
6278
|
+
var checkoutRequest = import_zod27.z.object({
|
|
6279
|
+
operation_key: purchaseOperationKey,
|
|
6280
|
+
plan: import_zod27.z.enum(["plus", "pro"]).meta({ description: "The paid plan to buy; Basic requires no checkout." }),
|
|
6281
|
+
cycle: billingCycle.meta({ description: "Monthly, or yearly at 15 percent off." }),
|
|
6282
|
+
addons: orgAddons.partial().strict().optional().meta({ description: "Add-on units to buy; Pro only. Cloud refuses add-ons on Plus." }),
|
|
6283
|
+
billing: purchaseBillingDetails.meta({ description: "The company buying the plan. Country requirements, current VIES and the email policy must pass before charging." }),
|
|
6284
|
+
accept_terms: import_zod27.z.literal(true).optional().meta({ description: "Deprecated draft input. It is not evidence of a displayed C.4 declaration and never confirms an order." })
|
|
6285
|
+
}).strict();
|
|
6286
|
+
var purchaseCents = import_zod27.z.number().int().nonnegative();
|
|
6287
|
+
var purchaseQuote = import_zod27.z.object({
|
|
6288
|
+
currency: import_zod27.z.literal("eur").meta({ description: "Every new quote is in EUR." }),
|
|
6289
|
+
net_cents: purchaseCents.meta({ description: "Current charge excluding VAT, in cents." }),
|
|
6290
|
+
vat_cents: purchaseCents.meta({ description: "VAT on the current charge, in cents." }),
|
|
6291
|
+
gross_cents: purchaseCents.meta({ description: "Total to confirm, including VAT, in cents." }),
|
|
6292
|
+
rate_percent: import_zod27.z.number().int().min(0).max(100).meta({ description: "VAT rate in whole percent." })
|
|
6293
|
+
}).strict();
|
|
6294
|
+
var quoteIdentity = {
|
|
6295
|
+
quote_revision: import_zod27.z.string().trim().min(1).max(200).meta({ description: "Opaque revision of the displayed quote; echo it when confirming." }),
|
|
6296
|
+
buyer_fingerprint: import_zod27.z.string().trim().min(1).max(200).meta({ description: "Opaque revision of buyer details and email policy; never full VIES evidence." })
|
|
6297
|
+
};
|
|
6298
|
+
var billingDecisionDisplayRequest = import_zod27.z.object({
|
|
6299
|
+
operation_key: purchaseOperationKey,
|
|
6300
|
+
operation: import_zod27.z.enum(["checkout", "paid_change"])
|
|
6301
|
+
}).strict();
|
|
6302
|
+
var selectionBase = {
|
|
6303
|
+
plan: import_zod27.z.enum(["basic", "plus", "pro"]),
|
|
6304
|
+
cycle: billingCycle,
|
|
6305
|
+
addons: orgAddons
|
|
6306
|
+
};
|
|
6307
|
+
var purchaseSelection = import_zod27.z.object(selectionBase).strict();
|
|
6308
|
+
var planChangeSelection = import_zod27.z.object({ ...selectionBase, keep: planChangeKeep.nullable() }).strict();
|
|
6309
|
+
var addonLine = import_zod27.z.object({ addon: addonKey, quantity: import_zod27.z.number().int().positive(), net_cents: purchaseCents }).strict();
|
|
6310
|
+
var treatmentRules = [
|
|
6311
|
+
{ if: { properties: { vat_treatment: { const: "de_standard" } }, required: ["vat_treatment"] }, then: { properties: { quote: { properties: { rate_percent: { const: 19 } } } } } },
|
|
6312
|
+
{ 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" } } } },
|
|
6313
|
+
{ 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" } } } }
|
|
6314
|
+
];
|
|
6315
|
+
var billingDecisionAmounts = import_zod27.z.object({
|
|
6316
|
+
currency: import_zod27.z.literal("eur"),
|
|
6317
|
+
quote: purchaseQuote,
|
|
6318
|
+
plan_net_cents: purchaseCents,
|
|
6319
|
+
addon_lines: import_zod27.z.array(addonLine),
|
|
6320
|
+
period_net_cents: purchaseCents,
|
|
6321
|
+
period_vat_cents: purchaseCents,
|
|
6322
|
+
period_gross_cents: purchaseCents,
|
|
6323
|
+
vat_treatment: vatTreatment,
|
|
6324
|
+
vat_treatment_line: import_zod27.z.string().min(1),
|
|
6325
|
+
due_today_gross_cents: purchaseCents,
|
|
6326
|
+
prorated_net_cents: purchaseCents.nullable(),
|
|
6327
|
+
renewal_net_cents: purchaseCents
|
|
6328
|
+
}).strict().superRefine((value, ctx) => {
|
|
6329
|
+
const invalid = (field, message) => ctx.addIssue({ code: "custom", path: [field], message });
|
|
6330
|
+
if (value.quote.gross_cents !== value.quote.net_cents + value.quote.vat_cents)
|
|
6331
|
+
invalid("quote", "Quote gross must equal net plus VAT.");
|
|
6332
|
+
if (value.period_gross_cents !== value.period_net_cents + value.period_vat_cents)
|
|
6333
|
+
invalid("period_gross_cents", "Period gross must equal net plus VAT.");
|
|
6334
|
+
if (value.period_net_cents !== value.plan_net_cents + value.addon_lines.reduce((sum, line) => sum + line.net_cents, 0))
|
|
6335
|
+
invalid("period_net_cents", "Plan and add-on lines must reconcile.");
|
|
6336
|
+
if (value.due_today_gross_cents !== value.quote.gross_cents)
|
|
6337
|
+
invalid("due_today_gross_cents", "Due today must equal the quote gross.");
|
|
6338
|
+
if (value.vat_treatment === "de_standard") {
|
|
6339
|
+
if (value.quote.rate_percent !== 19 || !value.vat_treatment_line.startsWith("19% German VAT: "))
|
|
6340
|
+
invalid("vat_treatment", "German VAT requires 19 percent and its display line.");
|
|
6341
|
+
} else if (value.quote.rate_percent !== 0 || value.quote.vat_cents !== 0 || value.period_vat_cents !== 0 || value.vat_treatment_line !== (value.vat_treatment === "reverse_charge" ? "Reverse charge \u2014 VAT payable by the recipient" : "Not taxable in Germany")) {
|
|
6342
|
+
invalid("vat_treatment", "Zero-rated treatment, rate, VAT and line must agree.");
|
|
6343
|
+
}
|
|
6344
|
+
}).meta({ allOf: treatmentRules });
|
|
6345
|
+
var utcInstant = import_zod27.z.iso.datetime().regex(/Z$/);
|
|
6346
|
+
var ianaTimeZone = import_zod27.z.enum(ianaTimeZones);
|
|
6347
|
+
function localDate(instant, timeZone) {
|
|
6348
|
+
try {
|
|
6349
|
+
const parts = new Intl.DateTimeFormat("en-US", { timeZone, year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(new Date(instant));
|
|
6350
|
+
const get = (type) => parts.find((part) => part.type === type)?.value ?? "";
|
|
6351
|
+
return `${get("year")}-${get("month")}-${get("day")}`;
|
|
6352
|
+
} catch {
|
|
6353
|
+
return null;
|
|
6354
|
+
}
|
|
6355
|
+
}
|
|
6356
|
+
var billingDecisionPeriod = import_zod27.z.object({
|
|
6357
|
+
display_time_zone: ianaTimeZone,
|
|
6358
|
+
starts_on: import_zod27.z.iso.date(),
|
|
6359
|
+
starts_at: utcInstant.nullable(),
|
|
6360
|
+
current_period_ends_at: utcInstant,
|
|
6361
|
+
renews_at: utcInstant,
|
|
6362
|
+
effective: import_zod27.z.discriminatedUnion("mode", [
|
|
6363
|
+
import_zod27.z.object({ mode: import_zod27.z.literal("on_confirmation"), quoted_as_of_at: utcInstant, local_date: import_zod27.z.iso.date() }).strict(),
|
|
6364
|
+
import_zod27.z.object({ mode: import_zod27.z.literal("scheduled"), at: utcInstant, at_period_end: import_zod27.z.boolean() }).strict()
|
|
6365
|
+
])
|
|
6366
|
+
}).strict().superRefine((period, ctx) => {
|
|
6367
|
+
if (period.starts_at && localDate(period.starts_at, period.display_time_zone) !== period.starts_on)
|
|
6368
|
+
ctx.addIssue({ code: "custom", path: ["starts_on"], message: "Start date must match the instant in the display zone." });
|
|
6369
|
+
if (period.effective.mode === "scheduled" && period.effective.at_period_end && period.effective.at !== period.current_period_ends_at)
|
|
6370
|
+
ctx.addIssue({ code: "custom", path: ["effective", "at"], message: "Period-end effect must equal the current period boundary." });
|
|
6371
|
+
if (period.effective.mode === "on_confirmation" && localDate(period.effective.quoted_as_of_at, period.display_time_zone) !== period.effective.local_date)
|
|
6372
|
+
ctx.addIssue({ code: "custom", path: ["effective", "local_date"], message: "Quoted local date must match the display zone." });
|
|
6373
|
+
});
|
|
6374
|
+
var declaration = import_zod27.z.object({
|
|
6375
|
+
text_id: import_zod27.z.literal("DR-1374-draft-3-C.4"),
|
|
6376
|
+
text: import_zod27.z.string().min(1),
|
|
6377
|
+
terms: legalDocumentReference,
|
|
6378
|
+
dpa: legalDocumentReference
|
|
6379
|
+
}).strict().superRefine((value, ctx) => {
|
|
6380
|
+
if (value.terms.url === value.dpa.url)
|
|
6381
|
+
ctx.addIssue({ code: "custom", path: ["dpa"], message: "Terms and DPA require separate version URLs." });
|
|
6382
|
+
});
|
|
6383
|
+
var snapshotBase = import_zod27.z.object({
|
|
6384
|
+
snapshot_id: import_zod27.z.uuid(),
|
|
6385
|
+
decision_id: import_zod27.z.uuid(),
|
|
6386
|
+
operation_key: purchaseOperationKey,
|
|
6387
|
+
owner_id: import_zod27.z.uuid(),
|
|
6388
|
+
organization_id: import_zod27.z.uuid(),
|
|
6389
|
+
organization_name: import_zod27.z.string().min(1),
|
|
6390
|
+
...quoteIdentity,
|
|
6391
|
+
amounts: billingDecisionAmounts,
|
|
6392
|
+
period: billingDecisionPeriod,
|
|
6393
|
+
declaration,
|
|
6394
|
+
expires_at: utcInstant
|
|
6395
|
+
}).strict();
|
|
6396
|
+
var billingDecisionSnapshot = import_zod27.z.discriminatedUnion("decision_kind", [
|
|
6397
|
+
snapshotBase.extend({ decision_kind: import_zod27.z.literal("checkout"), selection: purchaseSelection }).strict(),
|
|
6398
|
+
snapshotBase.extend({ decision_kind: import_zod27.z.literal("paid_change"), selection: purchaseSelection }).strict(),
|
|
6399
|
+
snapshotBase.extend({ decision_kind: import_zod27.z.literal("plan_change"), selection: planChangeSelection }).strict()
|
|
6400
|
+
]).superRefine((value, ctx) => {
|
|
6401
|
+
const expected = `By selecting \u201COrder and pay\u201D, you agree to the Terms of Service and the Data Processing Agreement for ${value.organization_name}.`;
|
|
6402
|
+
if (value.declaration.text !== expected)
|
|
6403
|
+
ctx.addIssue({ code: "custom", path: ["declaration", "text"], message: "Declaration must match the approved C.4 sentence and organization." });
|
|
6404
|
+
if (value.amounts.vat_treatment === "de_standard") {
|
|
6405
|
+
const euro = (cents2) => new Intl.NumberFormat("en-US", { style: "currency", currency: "EUR" }).format(cents2 / 100);
|
|
6406
|
+
const period = value.selection.cycle === "monthly" ? "month" : "year";
|
|
6407
|
+
const line = `19% German VAT: ${euro(value.amounts.period_vat_cents)}; total ${euro(value.amounts.period_gross_cents)} per ${period}`;
|
|
6408
|
+
if (value.amounts.vat_treatment_line !== line)
|
|
6409
|
+
ctx.addIssue({ code: "custom", path: ["amounts", "vat_treatment_line"], message: "German VAT line must match the displayed period amounts and cycle." });
|
|
6410
|
+
}
|
|
6411
|
+
const lines = value.amounts.addon_lines;
|
|
6412
|
+
const expectedAddons = addonKey.options.filter((key) => value.selection.addons[key] > 0);
|
|
6413
|
+
if (lines.length !== expectedAddons.length || lines.some((line, i) => line.addon !== expectedAddons[i] || line.quantity !== value.selection.addons[line.addon]))
|
|
6414
|
+
ctx.addIssue({ code: "custom", path: ["amounts", "addon_lines"], message: "Add-on lines must match absolute selection in catalogue order." });
|
|
6415
|
+
});
|
|
6416
|
+
var billingDecisionDisplayResponse = import_zod27.z.object({
|
|
6417
|
+
confirmation_proof: confirmationProof,
|
|
6418
|
+
expires_at: utcInstant,
|
|
6419
|
+
snapshot: billingDecisionSnapshot
|
|
6420
|
+
}).strict().superRefine((value, ctx) => {
|
|
6421
|
+
if (value.expires_at !== value.snapshot.expires_at)
|
|
6422
|
+
ctx.addIssue({ code: "custom", path: ["expires_at"], message: "Display and snapshot expiry must match." });
|
|
6423
|
+
});
|
|
6424
|
+
var planChangePrepareResponse = import_zod27.z.object({
|
|
6425
|
+
change_id: import_zod27.z.uuid(),
|
|
6426
|
+
display: billingDecisionDisplayResponse
|
|
6427
|
+
}).strict().superRefine((value, ctx) => {
|
|
6428
|
+
if (value.display.snapshot.decision_kind !== "plan_change")
|
|
6429
|
+
ctx.addIssue({ code: "custom", path: ["display", "snapshot", "decision_kind"], message: "Prepared plan changes require a plan-change display." });
|
|
6430
|
+
if (value.display.snapshot.decision_id !== value.change_id)
|
|
6431
|
+
ctx.addIssue({ code: "custom", path: ["display", "snapshot", "decision_id"], message: "Display must refer to the prepared change." });
|
|
6432
|
+
}).meta({ allOf: [{ properties: { display: { properties: { snapshot: { properties: { decision_kind: { const: "plan_change" } } } } } } }] });
|
|
6433
|
+
var intentIdentity = {
|
|
6434
|
+
intent_id: import_zod27.z.uuid().meta({ description: "Opaque persisted purchase intent identity." }),
|
|
6435
|
+
operation_key: purchaseOperationKey,
|
|
6436
|
+
operation: chargeOperation,
|
|
6437
|
+
invoice_id: import_zod27.z.uuid().optional().meta({ description: "The due charge or issued invoice, for invoice-paying operations." })
|
|
6438
|
+
};
|
|
6439
|
+
var purchaseHoldReason = import_zod27.z.enum([
|
|
6440
|
+
"legacy_usd_invoice",
|
|
6441
|
+
"legacy_payer_unresolved",
|
|
6442
|
+
"mandate_policy_unresolved",
|
|
6443
|
+
// The Lexware issuer cutover (2026-10-19, fleetless/fleetless#327): holds
|
|
6444
|
+
// during and after the move from Cloud-issued invoices to charges billed
|
|
6445
|
+
// through Lexware.
|
|
6446
|
+
"lexware_contact_pending",
|
|
6447
|
+
"lexware_contact_changed",
|
|
6448
|
+
"issuer_cutover_in_progress",
|
|
6449
|
+
"lexware_issuance_paused"
|
|
6450
|
+
]);
|
|
6451
|
+
var purchaseRefusalRule = import_zod27.z.enum(["company_required", "vat_id_required", "vat_id_invalid", "tax_id_required", "us_state_required", "public_email_domain", "invoice_not_open"]);
|
|
6452
|
+
var intentRules = [
|
|
6453
|
+
{ if: { properties: { operation: { enum: ["invoice_payment", "payment_method_invoice"] } }, required: ["operation"] }, then: { required: ["invoice_id"] } },
|
|
6454
|
+
{ if: { properties: { operation: { const: "mandate_setup" } }, required: ["operation"] }, then: { properties: { state: { const: "held" }, reason: { const: "mandate_policy_unresolved" } }, required: ["reason"] } },
|
|
6455
|
+
{ if: { properties: { reason: { const: "mandate_policy_unresolved" } }, required: ["reason"] }, then: { properties: { operation: { const: "mandate_setup" } } } },
|
|
6456
|
+
{ if: { properties: { payment: { properties: { kind: { const: "mandate" } }, required: ["kind"] } }, required: ["payment"] }, then: { properties: { operation: { const: "paid_change" } } } }
|
|
6457
|
+
];
|
|
6458
|
+
function validateIntent(intent, ctx) {
|
|
6459
|
+
if (["invoice_payment", "payment_method_invoice"].includes(intent.operation) && !intent.invoice_id) {
|
|
6460
|
+
ctx.addIssue({ code: "custom", path: ["invoice_id"], message: "An invoice-paying intent must name the invoice or due charge." });
|
|
6461
|
+
}
|
|
6462
|
+
if (intent.operation === "mandate_setup" !== (intent.reason === "mandate_policy_unresolved")) {
|
|
6463
|
+
ctx.addIssue({ code: "custom", path: ["reason"], message: "Mandate setup remains held until its integration policy is resolved." });
|
|
6464
|
+
}
|
|
6465
|
+
if (intent.payment?.kind === "mandate" && intent.operation !== "paid_change") {
|
|
6466
|
+
ctx.addIssue({ code: "custom", path: ["payment"], message: "Owner checkout and invoice payment require a hosted payment." });
|
|
6467
|
+
}
|
|
6468
|
+
}
|
|
6469
|
+
var draftVariants = [
|
|
6470
|
+
import_zod27.z.object({ ...intentIdentity, state: import_zod27.z.literal("awaiting_vies"), reason: viesPendingReason, next_attempt_at: import_zod27.z.iso.datetime() }).strict(),
|
|
6471
|
+
import_zod27.z.object({ ...intentIdentity, ...quoteIdentity, state: import_zod27.z.literal("eligible"), quote: purchaseQuote }).strict(),
|
|
6472
|
+
import_zod27.z.object({
|
|
6473
|
+
...intentIdentity,
|
|
6474
|
+
operation: purchaseOperation,
|
|
6475
|
+
state: import_zod27.z.literal("held"),
|
|
6476
|
+
reason: purchaseHoldReason,
|
|
6477
|
+
original_amount: import_zod27.z.object({ currency: planCurrency, gross_cents: purchaseCents }).strict().optional().meta({ description: "Recorded balance of a held invoice; not a new quote or authorization." })
|
|
6478
|
+
}).strict(),
|
|
6479
|
+
import_zod27.z.object({ ...intentIdentity, state: import_zod27.z.literal("invalid_vat_id"), field: import_zod27.z.literal("billing.vat_id"), rule: import_zod27.z.literal("vat_id_invalid") }).strict(),
|
|
6480
|
+
import_zod27.z.object({ ...intentIdentity, state: import_zod27.z.literal("refused"), field: import_zod27.z.string().min(1), rule: purchaseRefusalRule }).strict()
|
|
6481
|
+
];
|
|
6482
|
+
var purchaseIntentDraft = import_zod27.z.discriminatedUnion("state", draftVariants).superRefine(validateIntent).meta({ allOf: intentRules });
|
|
6483
|
+
var paymentStartedVariant = import_zod27.z.object({
|
|
6484
|
+
...intentIdentity,
|
|
6485
|
+
state: import_zod27.z.literal("payment_started"),
|
|
6486
|
+
payment_id: import_zod27.z.uuid(),
|
|
6487
|
+
payment: import_zod27.z.discriminatedUnion("kind", [
|
|
6488
|
+
import_zod27.z.object({ kind: import_zod27.z.literal("hosted"), checkout_id: import_zod27.z.uuid(), checkout_url: import_zod27.z.url() }).strict(),
|
|
6489
|
+
import_zod27.z.object({ kind: import_zod27.z.literal("mandate") }).strict()
|
|
6490
|
+
])
|
|
6491
|
+
}).strict();
|
|
6492
|
+
var purchaseIntentPaymentStarted = paymentStartedVariant.superRefine(validateIntent).meta({ allOf: intentRules });
|
|
6493
|
+
var purchaseIntentAcceptedWithoutPayment = import_zod27.z.object({
|
|
6494
|
+
intent_id: import_zod27.z.uuid(),
|
|
6495
|
+
operation_key: purchaseOperationKey,
|
|
6496
|
+
operation: import_zod27.z.literal("paid_change"),
|
|
6497
|
+
state: import_zod27.z.literal("accepted_no_payment"),
|
|
6498
|
+
...quoteIdentity,
|
|
6499
|
+
quote: purchaseQuote.extend({ net_cents: import_zod27.z.literal(0), vat_cents: import_zod27.z.literal(0), gross_cents: import_zod27.z.literal(0) }).strict(),
|
|
6500
|
+
accepted_at: utcInstant
|
|
6501
|
+
}).strict();
|
|
6502
|
+
var purchaseIntent = import_zod27.z.discriminatedUnion("state", [
|
|
6503
|
+
...draftVariants,
|
|
6504
|
+
paymentStartedVariant,
|
|
6505
|
+
purchaseIntentAcceptedWithoutPayment
|
|
6506
|
+
]).superRefine(validateIntent).meta({ allOf: intentRules });
|
|
6507
|
+
var nonChangeOperation = purchaseOperation.exclude(["paid_change"]);
|
|
6508
|
+
var nonChangeChargeOperation = chargeOperation.exclude(["paid_change"]);
|
|
6509
|
+
var nonChangeDraft = import_zod27.z.discriminatedUnion("state", [
|
|
6510
|
+
draftVariants[0].safeExtend({ operation: nonChangeChargeOperation }),
|
|
6511
|
+
draftVariants[1].safeExtend({ operation: nonChangeChargeOperation }),
|
|
6512
|
+
draftVariants[2].safeExtend({ operation: nonChangeOperation }),
|
|
6513
|
+
draftVariants[3].safeExtend({ operation: nonChangeChargeOperation }),
|
|
6514
|
+
draftVariants[4].safeExtend({ operation: nonChangeChargeOperation })
|
|
6515
|
+
]).superRefine(validateIntent).meta({ allOf: intentRules });
|
|
6516
|
+
var nonChangePaymentStarted = paymentStartedVariant.safeExtend({ operation: nonChangeChargeOperation }).superRefine(validateIntent).meta({ allOf: intentRules });
|
|
6517
|
+
var paidChangeOperation = import_zod27.z.literal("paid_change");
|
|
6518
|
+
var paidChangeDraft = import_zod27.z.discriminatedUnion("state", [
|
|
6519
|
+
draftVariants[0].safeExtend({ operation: paidChangeOperation }),
|
|
6520
|
+
draftVariants[1].safeExtend({ operation: paidChangeOperation }),
|
|
6521
|
+
draftVariants[2].safeExtend({ operation: paidChangeOperation }),
|
|
6522
|
+
draftVariants[3].safeExtend({ operation: paidChangeOperation }),
|
|
6523
|
+
draftVariants[4].safeExtend({ operation: paidChangeOperation })
|
|
6524
|
+
]).superRefine(validateIntent).meta({ allOf: intentRules });
|
|
6525
|
+
var checkoutResponse = import_zod27.z.union([nonChangeDraft, nonChangePaymentStarted]);
|
|
6526
|
+
var purchaseIntentLookupQuery = import_zod27.z.object({
|
|
6527
|
+
operation_key: purchaseOperationKey.optional().meta({ description: "The client operation key; supply this or intent_id, never both." }),
|
|
6528
|
+
intent_id: import_zod27.z.uuid().optional().meta({ description: "The persisted intent ID; supply this or operation_key, never both." }),
|
|
6529
|
+
operation: purchaseOperation.meta({ description: "Expected operation; a mismatch returns 404 without disclosure." })
|
|
6530
|
+
}).strict().refine((q) => q.operation_key !== void 0 !== (q.intent_id !== void 0), {
|
|
6531
|
+
message: "Supply exactly one of operation_key or intent_id."
|
|
6532
|
+
}).meta({
|
|
6533
|
+
description: "Owner lookup by exactly one identity and the expected operation.",
|
|
6534
|
+
oneOf: [
|
|
6535
|
+
{ required: ["operation_key"], not: { required: ["intent_id"] } },
|
|
6536
|
+
{ required: ["intent_id"], not: { required: ["operation_key"] } }
|
|
6537
|
+
]
|
|
6538
|
+
});
|
|
6539
|
+
var provedConfirmation = { operation_key: purchaseOperationKey, ...quoteIdentity, confirmation_proof: confirmationProof };
|
|
6540
|
+
var invoiceConfirmation = { operation_key: purchaseOperationKey, ...quoteIdentity };
|
|
6541
|
+
var purchaseIntentConfirmRequest = import_zod27.z.discriminatedUnion("operation", [
|
|
6542
|
+
import_zod27.z.object({ ...provedConfirmation, operation: import_zod27.z.literal("checkout") }).strict(),
|
|
6543
|
+
import_zod27.z.object({ ...provedConfirmation, operation: import_zod27.z.literal("paid_change") }).strict(),
|
|
6544
|
+
import_zod27.z.object({ ...invoiceConfirmation, operation: import_zod27.z.literal("invoice_payment") }).strict(),
|
|
6545
|
+
import_zod27.z.object({ ...invoiceConfirmation, operation: import_zod27.z.literal("payment_method_invoice") }).strict()
|
|
6546
|
+
]);
|
|
6547
|
+
var purchaseConflictDetails = import_zod27.z.discriminatedUnion("rule", [
|
|
6548
|
+
import_zod27.z.object({ field: import_zod27.z.literal("operation_key"), rule: import_zod27.z.literal("operation_key_reused") }).strict(),
|
|
6549
|
+
import_zod27.z.object({ field: import_zod27.z.literal("intent"), rule: import_zod27.z.enum(["stale_quote", "buyer_changed", "not_eligible", "invoice_not_open"]), current_intent: purchaseIntent }).strict()
|
|
6550
|
+
]);
|
|
6551
|
+
var invoicePayRequest = import_zod27.z.object({ operation_key: purchaseOperationKey }).strict();
|
|
6552
|
+
var checkoutStatus = import_zod27.z.object({
|
|
6553
|
+
checkout_id: import_zod27.z.uuid().meta({ description: "The checkout this status is for." }),
|
|
6554
|
+
status: import_zod27.z.enum(["pending", "paid", "failed", "canceled", "expired"]).meta({
|
|
6555
|
+
description: "Mollie's payment status, as `reconcilePayment` last read it."
|
|
6556
|
+
}),
|
|
6557
|
+
purpose: import_zod27.z.enum(["upgrade", "payment_method", "invoice"]).meta({
|
|
6558
|
+
description: "What this checkout paid for: a plan upgrade, a payment-method change, or an open invoice."
|
|
6559
|
+
}),
|
|
6560
|
+
plan: planId.meta({ description: "The org's plan after applying \u2014 unchanged unless `purpose` is `upgrade` and `status` is `paid`." })
|
|
6561
|
+
});
|
|
6562
|
+
var vatIdStatus = import_zod27.z.enum(["valid", "unverified", "invalid", "unavailable"]);
|
|
6563
|
+
var vatIdCheckRequest = import_zod27.z.object({
|
|
6564
|
+
country: countryCode.meta({ description: "The VAT ID's country." }),
|
|
6565
|
+
vat_id: import_zod27.z.string().trim().min(1).max(20).meta({ description: "The VAT ID as typed; normalized before the VIES lookup (`normalizeVatId`)." })
|
|
6566
|
+
}).strict();
|
|
6567
|
+
var vatCheckIdentity = { vat_id: import_zod27.z.string(), name: import_zod27.z.string().nullable() };
|
|
6568
|
+
var vatIdCheckResponse = import_zod27.z.discriminatedUnion("state", [
|
|
6569
|
+
import_zod27.z.object({ ...vatCheckIdentity, state: import_zod27.z.literal("eligible"), status: import_zod27.z.literal("valid") }).strict(),
|
|
6570
|
+
import_zod27.z.object({ ...vatCheckIdentity, state: import_zod27.z.literal("refused"), status: import_zod27.z.literal("invalid"), rule: import_zod27.z.literal("vat_id_invalid") }).strict(),
|
|
6571
|
+
import_zod27.z.object({ ...vatCheckIdentity, state: import_zod27.z.literal("pending"), status: import_zod27.z.enum(["valid", "unverified", "unavailable"]), reason: viesPendingReason }).strict()
|
|
6572
|
+
]);
|
|
6573
|
+
var billingChangeRequest = import_zod27.z.object({
|
|
6574
|
+
operation_key: purchaseOperationKey,
|
|
6575
|
+
plan: import_zod27.z.enum(["plus", "pro"]).optional().meta({ description: "The target plan. Omitted leaves the plan as it is." }),
|
|
6576
|
+
cycle: billingCycle.optional().meta({ description: "The target cycle. Omitted leaves the cycle as it is." }),
|
|
6577
|
+
addons: orgAddons.partial().strict().optional().meta({
|
|
6578
|
+
description: "Absolute add-on counts to end up with, not a delta. Omitted leaves add-ons as they are."
|
|
6579
|
+
})
|
|
6580
|
+
}).strict().refine((r) => r.plan !== void 0 || r.cycle !== void 0 || r.addons !== void 0, { message: "Name a plan, a cycle or add-ons." });
|
|
6581
|
+
var billingCancelRequest = import_zod27.z.object({
|
|
6582
|
+
reason: import_zod27.z.string().trim().max(500).optional().meta({ description: "An optional free-text reason. Shown to nobody but Fleetless." })
|
|
6583
|
+
}).strict();
|
|
6584
|
+
var billingDetailsUpdate = import_zod27.z.object({
|
|
6585
|
+
company_name: import_zod27.z.string().trim().min(1).max(200).optional(),
|
|
6586
|
+
address: billingAddress.optional(),
|
|
6587
|
+
tax_id: import_zod27.z.string().trim().max(100).nullable().optional(),
|
|
6588
|
+
invoice_email: import_zod27.z.email().optional().meta({ description: "Replaces the invoice email. Omitted leaves it as it is." }),
|
|
6589
|
+
vat_id: import_zod27.z.string().trim().max(20).nullable().optional().meta({
|
|
6590
|
+
description: "Replaces the VAT ID; `null` clears it. Omitted leaves it as it is. A new ID is re-checked through VIES."
|
|
6591
|
+
})
|
|
6592
|
+
}).strict();
|
|
6593
|
+
var paymentMethodKind = import_zod27.z.enum(["card", "paypal", "applepay"]);
|
|
6594
|
+
var paymentMethodChangeRequest = import_zod27.z.object({
|
|
6595
|
+
operation_key: purchaseOperationKey,
|
|
6596
|
+
method: paymentMethodKind.meta({
|
|
6597
|
+
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."
|
|
6598
|
+
})
|
|
6599
|
+
}).strict();
|
|
6600
|
+
var billingAccountStatus = import_zod27.z.enum(["pending", "active", "past_due", "canceled"]);
|
|
6601
|
+
var paymentMethod = import_zod27.z.discriminatedUnion("kind", [
|
|
6602
|
+
import_zod27.z.object({
|
|
6603
|
+
kind: import_zod27.z.literal("card").meta({ description: "A card mandate." }),
|
|
6604
|
+
brand: import_zod27.z.string().meta({ description: "The card network, as Mollie's mandate reports it, e.g. 'Visa'." }),
|
|
6605
|
+
last4: import_zod27.z.string().regex(/^\d{4}$/).meta({ description: "The last four digits of the card." }),
|
|
6606
|
+
expires: import_zod27.z.string().regex(/^\d{2}\/\d{2}$/).meta({ description: "Expiry as Mollie's mandate shows it, 'MM/YY'." })
|
|
6607
|
+
}),
|
|
6608
|
+
import_zod27.z.object({
|
|
6609
|
+
kind: import_zod27.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." }),
|
|
6610
|
+
brand: import_zod27.z.string().meta({ description: "The card network, as Mollie's mandate reports it, e.g. 'Mastercard'." }),
|
|
6611
|
+
last4: import_zod27.z.string().regex(/^\d{4}$/).meta({ description: "The last four digits of the card behind Apple Pay." }),
|
|
6612
|
+
expires: import_zod27.z.string().regex(/^\d{2}\/\d{2}$/).meta({ description: "Expiry as Mollie's mandate shows it, 'MM/YY'." })
|
|
6613
|
+
}),
|
|
6614
|
+
import_zod27.z.object({
|
|
6615
|
+
kind: import_zod27.z.literal("paypal").meta({ description: "A PayPal mandate." }),
|
|
6616
|
+
account: import_zod27.z.string().meta({ description: "The PayPal account Mollie's mandate names." })
|
|
6617
|
+
})
|
|
6618
|
+
]);
|
|
6619
|
+
var invoiceStatus = import_zod27.z.enum(["open", "paid", "uncollectible", "cancelled"]);
|
|
6620
|
+
var billingInvoice = import_zod27.z.object({
|
|
6621
|
+
id: import_zod27.z.uuid().meta({ description: "The invoice's id." }),
|
|
6622
|
+
number: import_zod27.z.string().regex(/^FL-\d{4}-\d{4,}$/).meta({
|
|
6623
|
+
description: "The invoice number: `FL-<year>-<seq>`, `seq` zero-padded to four digits, gapless per calendar year in `Europe/Berlin`."
|
|
6624
|
+
}),
|
|
6625
|
+
issued_at: import_zod27.z.iso.datetime().meta({ description: "When the invoice was issued." }),
|
|
6626
|
+
status: invoiceStatus.meta({ description: "This invoice's own status." }),
|
|
6627
|
+
cancellation_document_url: import_zod27.z.string().nullable().meta({
|
|
6628
|
+
description: "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
|
|
6629
|
+
}),
|
|
6630
|
+
currency: planCurrency.meta({ description: "The org's billing currency." }),
|
|
6631
|
+
net_cents: import_zod27.z.number().int().nonnegative().meta({ description: "The charge, excluding VAT, in integer cents." }),
|
|
6632
|
+
vat_rate_percent: import_zod27.z.number().int().min(0).max(100).meta({ description: "The VAT rate applied, in whole percent." }),
|
|
6633
|
+
vat_cents: import_zod27.z.number().int().nonnegative().meta({ description: "VAT, in integer cents (`vatCents`)." }),
|
|
6634
|
+
gross_cents: import_zod27.z.number().int().nonnegative().meta({ description: "Net plus VAT, in integer cents." })
|
|
6635
|
+
});
|
|
6636
|
+
var billingInvoicePdfQuery = import_zod27.z.object({
|
|
6637
|
+
kind: import_zod27.z.enum(["invoice", "cancellation"]).optional().meta({ description: "The original invoice or its stored cancellation PDF; omitted means `invoice`." })
|
|
6638
|
+
}).strict();
|
|
6639
|
+
var billingAccount = import_zod27.z.object({
|
|
6640
|
+
payer: billingDetails.meta({ description: "Who is paying, and the invoice address and email." }),
|
|
6641
|
+
vat_id_status: vatIdStatus.nullable().meta({ description: "The payer's VAT ID check, or `null` when no VAT ID was given." }),
|
|
6642
|
+
vat: import_zod27.z.object({
|
|
6643
|
+
treatment: vatTreatment.meta({ description: "How the account is taxed." }),
|
|
6644
|
+
rate_percent: import_zod27.z.number().int().meta({ description: "The VAT rate, in whole percent." })
|
|
6645
|
+
}).nullable().meta({ description: "Recorded VAT treatment; null while the current buyer has no eligible decision. Never infer zero rating from a pending account." }),
|
|
6646
|
+
currency: planCurrency.meta({ description: "The org's billing currency, fixed at the first payment." }),
|
|
6647
|
+
cycle: billingCycle.meta({ description: "The current billing cycle." }),
|
|
6648
|
+
status: billingAccountStatus.meta({ description: "The account's own status." }),
|
|
6649
|
+
period_starts_at: import_zod27.z.iso.datetime().nullable().meta({ description: "The current period's start. `null` before the first payment." }),
|
|
6650
|
+
period_ends_at: import_zod27.z.iso.datetime().nullable().meta({ description: "The current period's end. `null` before the first payment." }),
|
|
6651
|
+
next_charge: import_zod27.z.object({
|
|
6652
|
+
at: import_zod27.z.iso.datetime().meta({ description: "When the next charge is due." }),
|
|
6653
|
+
net_cents: import_zod27.z.number().int().meta({ description: "The next charge, excluding VAT, in integer cents." }),
|
|
6654
|
+
vat_cents: import_zod27.z.number().int().meta({ description: "VAT on the next charge, in integer cents." }),
|
|
6655
|
+
gross_cents: import_zod27.z.number().int().meta({ description: "The next charge including VAT, in integer cents." })
|
|
6656
|
+
}).nullable().meta({ description: "`null` while a cancel is pending or nothing else renews." }),
|
|
6657
|
+
scheduled: import_zod27.z.object({
|
|
6658
|
+
cycle: billingCycle.nullable().meta({ description: "A cycle change queued for the period's end, or `null`." }),
|
|
6659
|
+
addons: orgAddons.nullable().meta({ description: "Add-on counts queued for the period's end, or `null`." })
|
|
6660
|
+
}).meta({ description: "What takes effect at the period's end." }),
|
|
6661
|
+
dunning: import_zod27.z.object({
|
|
6662
|
+
invoice_id: import_zod27.z.uuid().meta({
|
|
6663
|
+
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`."
|
|
6664
|
+
}),
|
|
6665
|
+
gross_cents: import_zod27.z.number().int().meta({
|
|
6666
|
+
description: "The amount owed, in integer cents \u2014 after a partial chargeback only the charged-back part."
|
|
6667
|
+
}),
|
|
6668
|
+
due_at: import_zod27.z.iso.datetime().meta({ description: "The charge's due date; retries and the lock count from here." }),
|
|
6669
|
+
next_retry_at: import_zod27.z.iso.datetime().nullable().meta({
|
|
6670
|
+
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."
|
|
6671
|
+
}),
|
|
6672
|
+
lock_at: import_zod27.z.iso.datetime().meta({ description: "When the org is locked if still unpaid (`BILLING_LOCK_DAY`)." }),
|
|
6673
|
+
failure: import_zod27.z.string().nullable().meta({
|
|
6674
|
+
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."
|
|
6675
|
+
})
|
|
6676
|
+
}).nullable().meta({ description: "`null` while nothing is overdue. During a VAT-ID hold the charge is due but not yet invoiced." })
|
|
6677
|
+
});
|
|
6678
|
+
var billingIssuer = import_zod27.z.enum(["cloud", "lexware"]);
|
|
6679
|
+
var billingChargeInvoice = import_zod27.z.discriminatedUnion("state", [
|
|
6680
|
+
import_zod27.z.object({ state: import_zod27.z.literal("not_issued").meta({ description: "Not collected (due, a failed retry, or uncollectible): no invoice exists." }) }).strict(),
|
|
6681
|
+
import_zod27.z.object({ state: import_zod27.z.literal("pending").meta({ description: "Collected; the Lexware invoice is not yet confirmed." }) }).strict(),
|
|
6682
|
+
import_zod27.z.object({
|
|
6683
|
+
state: import_zod27.z.literal("issued").meta({ description: "Lexware has confirmed the invoice." }),
|
|
6684
|
+
document_id: import_zod27.z.uuid().meta({ description: "The Lexware document's id \u2014 read it with `GET /api/billing/documents/:id`." })
|
|
6685
|
+
}).strict()
|
|
6686
|
+
]);
|
|
6687
|
+
var chargeInvoiceRules = [
|
|
6688
|
+
{ if: { properties: { status: { const: "paid" } }, required: ["status"] }, then: { properties: { invoice: { properties: { state: { enum: ["pending", "issued"] } } } } } },
|
|
6689
|
+
{ if: { properties: { status: { enum: ["due", "uncollectible", "cancelled"] } }, required: ["status"] }, then: { properties: { invoice: { properties: { state: { const: "not_issued" } } } } } }
|
|
6690
|
+
];
|
|
6691
|
+
function refuseChargeInvoiceMismatch(charge, ctx) {
|
|
6692
|
+
const notIssued = charge.invoice.state === "not_issued";
|
|
6693
|
+
if (charge.status === "paid" === notIssued) {
|
|
6694
|
+
ctx.addIssue({ code: "custom", path: ["invoice"], message: "A paid charge has an invoice (pending or issued); every other status has none yet." });
|
|
6695
|
+
}
|
|
6696
|
+
}
|
|
6697
|
+
var billingCharge = import_zod27.z.object({
|
|
6698
|
+
id: import_zod27.z.uuid().meta({ description: "The due charge's id \u2014 never a Cloud invoice number. Pay it with `POST /api/billing/charges/:id/pay`." }),
|
|
6699
|
+
kind: import_zod27.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." }),
|
|
6700
|
+
status: import_zod27.z.enum(["due", "paid", "uncollectible", "cancelled"]).meta({
|
|
6701
|
+
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."
|
|
6702
|
+
}),
|
|
6703
|
+
currency: import_zod27.z.literal("eur").meta({ description: "Every charge billed through Lexware is EUR." }),
|
|
6704
|
+
net_cents: import_zod27.z.number().int().nonnegative().meta({ description: "The charge, excluding VAT, in integer cents." }),
|
|
6705
|
+
vat_rate_percent: import_zod27.z.number().int().min(0).max(100).meta({ description: "The VAT rate applied, in whole percent." }),
|
|
6706
|
+
vat_cents: import_zod27.z.number().int().nonnegative().meta({ description: "VAT, in integer cents (`vatCents`)." }),
|
|
6707
|
+
gross_cents: import_zod27.z.number().int().nonnegative().meta({ description: "Net plus VAT, in integer cents." }),
|
|
6708
|
+
period_start: import_zod27.z.iso.datetime().meta({ description: "The covered period's start." }),
|
|
6709
|
+
period_end: import_zod27.z.iso.datetime().meta({ description: "The covered period's end." }),
|
|
6710
|
+
due_at: import_zod27.z.iso.datetime().meta({ description: "When this charge is due." }),
|
|
6711
|
+
paid_at: import_zod27.z.iso.datetime().nullable().meta({ description: "When this charge was paid, or `null` while unpaid." }),
|
|
6712
|
+
invoice: billingChargeInvoice.meta({ description: "Whether a Lexware invoice exists for this charge yet, and which document it names once it does." })
|
|
6713
|
+
}).strict().superRefine(refuseChargeInvoiceMismatch).meta({ allOf: chargeInvoiceRules });
|
|
6714
|
+
var chargePayRequest = invoicePayRequest;
|
|
6715
|
+
var billingView = import_zod27.z.object({
|
|
6716
|
+
available: import_zod27.z.boolean().meta({ description: "Whether this cloud takes payments at all \u2014 `false` when no Mollie key is configured." }),
|
|
6717
|
+
account: billingAccount.nullable().meta({ description: "`null` before the org has ever checked out." }),
|
|
6718
|
+
payment_method: paymentMethod.nullable().meta({ description: "The payment method on file, or `null`." }),
|
|
6719
|
+
payment_method_options: import_zod27.z.array(import_zod27.z.object({
|
|
6720
|
+
method: paymentMethodKind.meta({ description: "A method `POST /api/billing/payment-method` accepts now." }),
|
|
6721
|
+
pays_invoice: import_zod27.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." })
|
|
6722
|
+
})).meta({
|
|
6723
|
+
description: "What a payment-method change may offer right now, so a client offers exactly what the cloud accepts. `applepay` is absent when it needs an open invoice and none is open; `[]` when the org has no billing account."
|
|
6724
|
+
}),
|
|
6725
|
+
issuer: billingIssuer.meta({ description: "Which system issues this org's charges: `cloud` before the issuer cutover, or `lexware` after it." }),
|
|
6726
|
+
invoices: import_zod27.z.array(billingInvoice).meta({ description: "Cloud-issued invoices from before the issuer cutover; read-only, never grows after it. Newest first, at most 24." }),
|
|
6727
|
+
charges: import_zod27.z.array(billingCharge).meta({
|
|
6728
|
+
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`."
|
|
6729
|
+
})
|
|
6730
|
+
});
|
|
6731
|
+
var billingDocumentKind = import_zod27.z.enum(["invoice", "credit_note", "down_payment_invoice", "bookkeeping_invoice", "bookkeeping_credit_note"]);
|
|
6732
|
+
var billingDocumentStatus = import_zod27.z.enum(["open", "overdue", "paid", "paidoff", "voided", "transferred", "sepadebit"]);
|
|
6733
|
+
var billingDocumentProfile = import_zod27.z.enum(["NONE", "EN16931", "XRechnung"]);
|
|
6734
|
+
var billingDocumentFormat = import_zod27.z.enum(["pdf", "xml"]);
|
|
6735
|
+
var billingDocumentBase = import_zod27.z.object({
|
|
6736
|
+
id: import_zod27.z.uuid().meta({ description: "The Lexware voucher id. Opaque; read the document or its file by this id, never a locally invented one." }),
|
|
6737
|
+
kind: billingDocumentKind.meta({ description: "The document's kind." }),
|
|
6738
|
+
status: billingDocumentStatus.meta({ description: "The document's own status." }),
|
|
6739
|
+
number: import_zod27.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." }),
|
|
6740
|
+
document_date: import_zod27.z.iso.datetime({ offset: true }).meta({ description: "The date printed on the document." }),
|
|
6741
|
+
currency: import_zod27.z.literal("EUR").meta({ description: "Every Lexware voucher this reads is EUR; nothing here reads a foreign-currency voucher." }),
|
|
6742
|
+
gross_cents: import_zod27.z.number().int().meta({
|
|
6743
|
+
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."
|
|
6744
|
+
}),
|
|
6745
|
+
file: import_zod27.z.enum(["available", "unavailable"]).meta({ description: "Whether Lexware holds a file for this document at all." })
|
|
6746
|
+
});
|
|
6747
|
+
function refuseWrongGrossSign(doc, ctx) {
|
|
6748
|
+
const isCredit = doc.kind === "credit_note" || doc.kind === "bookkeeping_credit_note";
|
|
6749
|
+
if (isCredit && doc.gross_cents > 0) {
|
|
6750
|
+
ctx.addIssue({ code: "custom", path: ["gross_cents"], message: "A credit note is zero or negative." });
|
|
6751
|
+
}
|
|
6752
|
+
if (!isCredit && doc.gross_cents < 0) {
|
|
6753
|
+
ctx.addIssue({ code: "custom", path: ["gross_cents"], message: "Only a credit note is negative." });
|
|
6754
|
+
}
|
|
6755
|
+
}
|
|
6756
|
+
var billingDocument = billingDocumentBase.strict().superRefine(refuseWrongGrossSign);
|
|
6757
|
+
var billingDocumentList = import_zod27.z.object({
|
|
6758
|
+
available: import_zod27.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." }),
|
|
6759
|
+
complete: import_zod27.z.boolean().meta({ description: "`false` when a document of an unsupported type or status was skipped rather than listed, counted in `unsupported_count`." }),
|
|
6760
|
+
unsupported_count: import_zod27.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." }),
|
|
6761
|
+
documents: import_zod27.z.array(billingDocument).meta({ description: "Every supported document this org has, complete or not \u2014 never a truncated page." })
|
|
6762
|
+
}).strict().superRefine((list, ctx) => {
|
|
6763
|
+
if (!list.available && (list.documents.length > 0 || !list.complete || list.unsupported_count > 0)) {
|
|
6764
|
+
ctx.addIssue({ code: "custom", path: ["available"], message: "available: false carries no documents, is complete and has no unsupported document." });
|
|
6765
|
+
}
|
|
6766
|
+
});
|
|
6767
|
+
var billingDocumentFileRole = import_zod27.z.enum(["e_invoice", "preview", "document"]);
|
|
6768
|
+
var billingDocumentFormatEntry = import_zod27.z.object({ format: billingDocumentFormat, role: billingDocumentFileRole }).strict();
|
|
6769
|
+
function sameFormats(a, b) {
|
|
6770
|
+
return a.length === b.length && a.every((entry, i) => entry.format === b[i].format && entry.role === b[i].role);
|
|
6771
|
+
}
|
|
6772
|
+
function refuseWrongFormats(doc, ctx) {
|
|
6773
|
+
const expected = doc.electronic_document_profile === "NONE" ? [{ format: "pdf", role: "document" }] : doc.electronic_document_profile === "EN16931" ? [{ format: "pdf", role: "e_invoice" }] : doc.electronic_document_profile === "XRechnung" ? [{ format: "xml", role: "e_invoice" }, { format: "pdf", role: "preview" }] : doc.file === "available" ? [{ format: "pdf", role: "document" }] : [];
|
|
6774
|
+
if (!sameFormats(doc.formats, expected)) {
|
|
6775
|
+
ctx.addIssue({ code: "custom", path: ["formats"], message: "formats must match electronic_document_profile (or, for a bookkeeping voucher, file) exactly." });
|
|
6776
|
+
}
|
|
6777
|
+
}
|
|
6778
|
+
var billingDocumentDetail = billingDocumentBase.extend({
|
|
6779
|
+
electronic_document_profile: billingDocumentProfile.nullable().meta({ description: "The e-invoice profile, or `null` for a bookkeeping voucher \u2014 it has none." }),
|
|
6780
|
+
formats: import_zod27.z.array(billingDocumentFormatEntry).meta({
|
|
6781
|
+
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 `[]`.'
|
|
6782
|
+
})
|
|
6783
|
+
}).strict().superRefine((doc, ctx) => {
|
|
6784
|
+
refuseWrongGrossSign(doc, ctx);
|
|
6785
|
+
refuseWrongFormats(doc, ctx);
|
|
6786
|
+
});
|
|
6787
|
+
var billingDocumentFileQuery = import_zod27.z.object({
|
|
6788
|
+
format: billingDocumentFormat.default("pdf").meta({ description: "The file format to read. `xml` answers `404` unless the document is `XRechnung`." })
|
|
6789
|
+
}).strict();
|
|
6790
|
+
var acceptedBillingFields = {
|
|
6791
|
+
billing: billingView.meta({ description: "The billing view after the change." }),
|
|
6792
|
+
charged: billingInvoice.nullable().meta({ description: "The invoice charged now, or `null` when the change was only scheduled for the period's end." })
|
|
6793
|
+
};
|
|
6794
|
+
var acceptedPaidChange = import_zod27.z.object({
|
|
6795
|
+
...acceptedBillingFields,
|
|
6796
|
+
intent: paymentStartedVariant.safeExtend({ operation: import_zod27.z.literal("paid_change") })
|
|
6797
|
+
}).strict();
|
|
6798
|
+
var acceptedNoPaymentChange = import_zod27.z.object({
|
|
6799
|
+
billing: billingView,
|
|
6800
|
+
charged: import_zod27.z.null(),
|
|
6801
|
+
intent: purchaseIntentAcceptedWithoutPayment
|
|
6802
|
+
}).strict();
|
|
6803
|
+
var billingChangeResponse = import_zod27.z.union([
|
|
6804
|
+
import_zod27.z.object({ intent: paidChangeDraft }).strict(),
|
|
6805
|
+
acceptedPaidChange,
|
|
6806
|
+
acceptedNoPaymentChange
|
|
6807
|
+
]);
|
|
6808
|
+
var purchaseIntentResponse = import_zod27.z.union([
|
|
6809
|
+
purchaseIntentDraft,
|
|
6810
|
+
nonChangePaymentStarted,
|
|
6811
|
+
acceptedPaidChange,
|
|
6812
|
+
acceptedNoPaymentChange
|
|
6813
|
+
]);
|
|
6814
|
+
|
|
6815
|
+
// node_modules/.pnpm/@fleetless+contracts@12.0.0/node_modules/@fleetless/contracts/dist/routes.js
|
|
5516
6816
|
var MCP_APP = MCP_APP_PATHS(":appIdentifier");
|
|
5517
6817
|
var APP_IDENTIFIER = {
|
|
5518
6818
|
name: "appIdentifier",
|
|
5519
6819
|
description: "The app's public identifier \u2014 `app.identifier`, what the console prints beside its copy button. It is not a secret: it appears in this path, in both metadata documents, and in the URL an app user pastes into their AI tool."
|
|
5520
6820
|
};
|
|
5521
6821
|
var IN_HANDLER_ROUTES = [
|
|
6822
|
+
// The old support bearer must reach the flow transaction after a newer
|
|
6823
|
+
// generation wins; a generic current-generation guard would hide that race.
|
|
6824
|
+
"POST /console/support/renew/fail",
|
|
5522
6825
|
"POST /mcp",
|
|
5523
6826
|
// The per-app endpoint, all three verbs: the bearer decides which app user
|
|
5524
6827
|
// is calling, and the path names none of that. Built from `MCP_APP` so the
|
|
@@ -5538,6 +6841,8 @@ var IN_HANDLER_ROUTES = [
|
|
|
5538
6841
|
"GET /api/asset-links/:token"
|
|
5539
6842
|
];
|
|
5540
6843
|
var DEVELOPER_GUARD = ["unauthorized", "token_expired", "token_revoked"];
|
|
6844
|
+
var BILLING_OFF = ["billing_unavailable"];
|
|
6845
|
+
var MOLLIE = ["payment_provider_unavailable"];
|
|
5541
6846
|
var CLIENT_GUARD = ["unauthorized", "token_expired", "token_revoked", "forbidden"];
|
|
5542
6847
|
function developerSignInRoutes(prefix) {
|
|
5543
6848
|
const section = prefix === "/console/oauth" ? "developer-auth" : "mcp";
|
|
@@ -5738,6 +7043,24 @@ var ROUTES = [
|
|
|
5738
7043
|
transport: "http",
|
|
5739
7044
|
notes: "No Owner tier: this can only ever touch the caller's own row, so there is nothing for a tier check to gate. Saving the name already held writes nothing and records no audit event \u2014 the org activity stream reaches every developer with the console open, and an event for a no-op would misreport that something changed."
|
|
5740
7045
|
},
|
|
7046
|
+
{
|
|
7047
|
+
method: "POST",
|
|
7048
|
+
path: "/api/auth/support/end",
|
|
7049
|
+
section: "developer-auth",
|
|
7050
|
+
summary: "Ends the calling support session immediately, from the console side.",
|
|
7051
|
+
audience: "internal",
|
|
7052
|
+
auth: "developer",
|
|
7053
|
+
rateLimited: false,
|
|
7054
|
+
ownerTier: false,
|
|
7055
|
+
status: 204,
|
|
7056
|
+
params: [],
|
|
7057
|
+
query: null,
|
|
7058
|
+
request: null,
|
|
7059
|
+
response: null,
|
|
7060
|
+
errors: [...DEVELOPER_GUARD, "forbidden"],
|
|
7061
|
+
transport: "http",
|
|
7062
|
+
notes: "Internal: the console calls this so the person a support session is driving can end it themselves \u2014 the counterpart to the operator side's `support_session_end` command, each ending the same session through its own path. The bearer must be a support token (`kind: 'support'`, `aud: 'console'`, minted by `POST /console/support/token`); any other token, including an ordinary developer session, answers `403 forbidden`. The session row behind the token is re-read on every request rather than trusted from its own claims, so a session already ended elsewhere is reflected here immediately."
|
|
7063
|
+
},
|
|
5741
7064
|
/* ------------------------------------ a developer's own second factors */
|
|
5742
7065
|
{
|
|
5743
7066
|
method: "GET",
|
|
@@ -5938,6 +7261,60 @@ var ROUTES = [
|
|
|
5938
7261
|
notes: "Answers `202` whether or not the address was already listed: the landing page's form must not be an oracle for who signed up. The operator notification is detached from the response \u2014 awaiting it made latency answer the question the status code refuses to \u2014 and is capped by its own global ceiling, above which the row is still written and the mail is skipped."
|
|
5939
7262
|
},
|
|
5940
7263
|
/* ---------------------------------------------------------------- org */
|
|
7264
|
+
{
|
|
7265
|
+
method: "GET",
|
|
7266
|
+
path: "/api/org/legal/acceptances",
|
|
7267
|
+
section: "org",
|
|
7268
|
+
summary: "Lists the calling organization's accepted legal document versions, newest first.",
|
|
7269
|
+
audience: "developer",
|
|
7270
|
+
auth: "developer",
|
|
7271
|
+
rateLimited: false,
|
|
7272
|
+
ownerTier: true,
|
|
7273
|
+
status: 200,
|
|
7274
|
+
params: [],
|
|
7275
|
+
query: legalAcceptanceListQuery,
|
|
7276
|
+
request: null,
|
|
7277
|
+
response: legalAcceptanceListResponse,
|
|
7278
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "support_forbidden", "validation_error"],
|
|
7279
|
+
transport: "http",
|
|
7280
|
+
notes: "A real Owner reads only the authenticated organization; Developer and support sessions cannot read it. Rows carry stored Terms and applicable DPA references, never the current versions substituted for history. The default page limit is 50, maximum 100. The opaque cursor is unpadded base64url of UTF-8 JSON `[accepted_at,id]`, with a six-digit UTC timestamp and lowercase UUID; Cloud rejects noncanonical tokens. Follow `next_cursor` until null. Equal timestamps sort by id descending; a new acceptance cannot displace older rows."
|
|
7281
|
+
},
|
|
7282
|
+
{
|
|
7283
|
+
method: "GET",
|
|
7284
|
+
path: "/api/org/controller-register",
|
|
7285
|
+
section: "org",
|
|
7286
|
+
summary: "Reads the calling owner's customer-confirmed controller register details.",
|
|
7287
|
+
audience: "developer",
|
|
7288
|
+
auth: "developer",
|
|
7289
|
+
rateLimited: false,
|
|
7290
|
+
ownerTier: true,
|
|
7291
|
+
status: 200,
|
|
7292
|
+
params: [],
|
|
7293
|
+
query: null,
|
|
7294
|
+
request: null,
|
|
7295
|
+
response: controllerRegisterOrgResponse,
|
|
7296
|
+
errors: [...DEVELOPER_GUARD, "tier_required"],
|
|
7297
|
+
transport: "http",
|
|
7298
|
+
notes: "The authenticated org is the only source. Members and support sessions receive no register data. A missing detail record is null. Billing data never populates this response. Access is audited."
|
|
7299
|
+
},
|
|
7300
|
+
{
|
|
7301
|
+
method: "PUT",
|
|
7302
|
+
path: "/api/org/controller-register",
|
|
7303
|
+
section: "org",
|
|
7304
|
+
summary: "Replaces the calling owner's confirmed controller register details.",
|
|
7305
|
+
audience: "developer",
|
|
7306
|
+
auth: "developer",
|
|
7307
|
+
rateLimited: false,
|
|
7308
|
+
ownerTier: true,
|
|
7309
|
+
status: 200,
|
|
7310
|
+
params: [],
|
|
7311
|
+
query: null,
|
|
7312
|
+
request: controllerRegisterWrite,
|
|
7313
|
+
response: controllerRegisterOrgResponse,
|
|
7314
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "validation_error"],
|
|
7315
|
+
transport: "http",
|
|
7316
|
+
notes: "The authenticated org is the only target. Null contacts explicitly clear earlier values. The write is atomic and audited; billing data is never an implicit source. Support sessions cannot write."
|
|
7317
|
+
},
|
|
5941
7318
|
{
|
|
5942
7319
|
method: "GET",
|
|
5943
7320
|
path: "/api/audit",
|
|
@@ -6180,7 +7557,7 @@ var ROUTES = [
|
|
|
6180
7557
|
response: mcpRolePreviewResponse,
|
|
6181
7558
|
errors: [...DEVELOPER_GUARD, "invalid_uuid", "not_found"],
|
|
6182
7559
|
transport: "http",
|
|
6183
|
-
notes: "Built by the same builder the MCP server's own `
|
|
7560
|
+
notes: "Built by the same builder the MCP server's own `robots.describe` uses, so the two cannot drift. It answers what the role *would* be offered and consults nothing about any user's actual MCP entitlement. A robot the role grants nothing on still appears, with an empty `exposures` \u2014 dropping it would read as \"not attached\", which is a different fact."
|
|
6184
7561
|
},
|
|
6185
7562
|
{
|
|
6186
7563
|
method: "PATCH",
|
|
@@ -7304,6 +8681,24 @@ var ROUTES = [
|
|
|
7304
8681
|
notes: "HTML: the email field, `Email me a code`, and `Sign in with a passkey`. Opening it binds the interaction to this browser with the browser-proof cookie, which every sign-in step after it checks. An expired, consumed, unknown or hand-edited interaction renders one page at `410`: which of the four it was is not a fact a stranger may learn, and to the person it is one fact anyway. The page resolves nothing about the address typed into it, so there is no enumeration oracle here at all."
|
|
7305
8682
|
},
|
|
7306
8683
|
...developerSignInRoutes("/console/oauth"),
|
|
8684
|
+
{
|
|
8685
|
+
method: "GET",
|
|
8686
|
+
path: "/waitlist-invite/:token",
|
|
8687
|
+
section: "developer-auth",
|
|
8688
|
+
summary: "Starts invite-bound console sign-up for a new Basic organization.",
|
|
8689
|
+
audience: "internal",
|
|
8690
|
+
auth: "none",
|
|
8691
|
+
rateLimited: true,
|
|
8692
|
+
ownerTier: false,
|
|
8693
|
+
status: 303,
|
|
8694
|
+
params: [{ name: "token", description: "The opaque waiting-list invitation token from the mailed link; never a query parameter." }],
|
|
8695
|
+
query: null,
|
|
8696
|
+
request: null,
|
|
8697
|
+
response: null,
|
|
8698
|
+
errors: ["rate_limited"],
|
|
8699
|
+
transport: "http",
|
|
8700
|
+
notes: "Exchanges a valid seven-day invitation for a short-lived browser-proof cookie, then redirects with `303` into console sign-up. The response uses `Cache-Control: no-store` and `Referrer-Policy: no-referrer`; no caller-supplied redirect is accepted. Invalid, expired, used, declined or replaced links render the same `410` page; the per-IP backstop answers `429 rate_limited`. Only the invited normalized email address may register a new Basic organization under `SIGNUP_MODE=closed`, and the signup code still proves control of that address. Every step rechecks the unspent generation, expiry and address; re-inviting immediately invalidates the old link and any signup it started. The GET does not consume the invitation: final organization/Owner creation, waiting-list transition and single-use consumption share one transaction. The interaction binds the invitation id/generation, never the raw token. Tokens, proof values and recipient links stay out of the directory, logs and operator responses. Team invitations through `/accept-invite/:token` still join an existing organization."
|
|
8701
|
+
},
|
|
7307
8702
|
{
|
|
7308
8703
|
method: "GET",
|
|
7309
8704
|
path: "/console/oauth/signup/:id",
|
|
@@ -7320,7 +8715,7 @@ var ROUTES = [
|
|
|
7320
8715
|
response: null,
|
|
7321
8716
|
errors: [],
|
|
7322
8717
|
transport: "http",
|
|
7323
|
-
notes: 'HTML: the email field and `Email me a code`, the first of three steps \u2014 email, code, organization. While the deployment runs in closed beta this renders the "sign-up is closed" card at `403` instead, keeping the interaction alive and pointing back at sign-in and the waiting list \u2014 the person may well already have an account.'
|
|
8718
|
+
notes: 'HTML: the email field and `Email me a code`, the first of three steps \u2014 email, code, organization. While the deployment runs in closed beta this renders the "sign-up is closed" card at `403` instead, keeping the interaction alive and pointing back at sign-in and the waiting list \u2014 the person may well already have an account. Under `SIGNUP_MODE=closed`, only a valid invite-bound interaction may continue for the invited normalized email address and a new Basic organization. Each step rechecks its unspent invitation generation, expiry and address; ordinary public sign-up remains refused.'
|
|
7324
8719
|
},
|
|
7325
8720
|
{
|
|
7326
8721
|
method: "POST",
|
|
@@ -7338,7 +8733,7 @@ var ROUTES = [
|
|
|
7338
8733
|
response: null,
|
|
7339
8734
|
errors: ["rate_limited", "token_spent", "signup_closed", "validation_error", "email_taken"],
|
|
7340
8735
|
transport: "http",
|
|
7341
|
-
notes: 'A browser form post gets the code card; a JSON caller gets `{ "next", "email" }`, which has no schema. **No password**: the code mailed here, six digits valid ten minutes, proves the address. A per-interaction proof cookie is set here \u2014 it is what stops a third party from finishing a sign-up somebody else started. Sign-up is the one surface whose job is to say an address is taken, so `409 email_taken` is not a leak here.'
|
|
8736
|
+
notes: 'A browser form post gets the code card; a JSON caller gets `{ "next", "email" }`, which has no schema. **No password**: the code mailed here, six digits valid ten minutes, proves the address. A per-interaction proof cookie is set here \u2014 it is what stops a third party from finishing a sign-up somebody else started. Sign-up is the one surface whose job is to say an address is taken, so `409 email_taken` is not a leak here. Under `SIGNUP_MODE=closed`, only a valid invite-bound interaction may request the code for the invited normalized email address; the unspent invitation generation, expiry and address are rechecked. Ordinary public sign-up still answers `403 signup_closed`.'
|
|
7342
8737
|
},
|
|
7343
8738
|
{
|
|
7344
8739
|
method: "POST",
|
|
@@ -7356,7 +8751,7 @@ var ROUTES = [
|
|
|
7356
8751
|
response: null,
|
|
7357
8752
|
errors: ["rate_limited", "token_spent", "signup_closed", "wrong_browser", "validation_error", "invalid_code"],
|
|
7358
8753
|
transport: "http",
|
|
7359
|
-
notes: 'A wrong code renders the code card again with the attempts left (`400 invalid_code`); a spent, expired or exhausted one is `410 token_spent`. The step before must have run in **this** browser (`401 wrong_browser`). A browser form post gets the organization card, the address shown `confirmed`; a JSON caller gets `{ "next" }`, which has no schema.'
|
|
8754
|
+
notes: 'A wrong code renders the code card again with the attempts left (`400 invalid_code`); a spent, expired or exhausted one is `410 token_spent`. The step before must have run in **this** browser (`401 wrong_browser`). A browser form post gets the organization card, the address shown `confirmed`; a JSON caller gets `{ "next" }`, which has no schema. Under `SIGNUP_MODE=closed`, only a valid invite-bound interaction may continue after rechecking its unspent invitation generation, expiry and invited normalized email address. Ordinary public sign-up still answers `403 signup_closed`.'
|
|
7360
8755
|
},
|
|
7361
8756
|
{
|
|
7362
8757
|
method: "POST",
|
|
@@ -7374,7 +8769,7 @@ var ROUTES = [
|
|
|
7374
8769
|
response: oauthRedirectResponse,
|
|
7375
8770
|
errors: ["rate_limited", "token_spent", "signup_closed", "wrong_browser", "validation_error", "email_taken"],
|
|
7376
8771
|
transport: "http",
|
|
7377
|
-
notes: "The form carries `org_name` only. The org and its founding Owner are created in one transaction, and only after the code step confirmed the address. Both steps before must have run in **this** browser: a missing or mismatched proof cookie is `401 wrong_browser` and the person is sent back to step one. `409 email_taken` when the address was taken meanwhile. A browser form post gets a `303` to the console callback; a JSON caller gets `redirect_to` at `200`. This is the only way an organisation is created: `POST /api/auth/signup` is gone, because without a password it would hand a session to anybody who names an address."
|
|
8772
|
+
notes: "The form carries `org_name` only. The org and its founding Owner are created in one transaction, and only after the code step confirmed the address. Both steps before must have run in **this** browser: a missing or mismatched proof cookie is `401 wrong_browser` and the person is sent back to step one. `409 email_taken` when the address was taken meanwhile. A browser form post gets a `303` to the console callback; a JSON caller gets `redirect_to` at `200`. This is the only way an organisation is created: `POST /api/auth/signup` is gone, because without a password it would hand a session to anybody who names an address. Under `SIGNUP_MODE=closed`, only a valid invite-bound interaction may create a new Basic organization for the invited normalized email address. Rechecking the unspent invitation generation, expiry and address, creating the org/Owner, transitioning the waiting-list entry and consuming the invitation happen in that same transaction. Ordinary public sign-up still answers `403 signup_closed`."
|
|
7378
8773
|
},
|
|
7379
8774
|
{
|
|
7380
8775
|
method: "POST",
|
|
@@ -7394,24 +8789,60 @@ var ROUTES = [
|
|
|
7394
8789
|
transport: "http",
|
|
7395
8790
|
notes: "Called by the console's own server, never by a browser. Refusals use RFC 6749 \xA75.2's flat `oauthError` shape \u2014 it is a token endpoint, and that is the dialect a caller of one expects \u2014 so it emits none of the codes in this reference. Proof of possession is checked before the replay check, and the single-use consume is atomic, so exactly one caller ever mints. The Org Admins membership is re-read here: the code was minted earlier, and a user moved out in between must not get a console session."
|
|
7396
8791
|
},
|
|
7397
|
-
/* --------------------------------- the Fleetless-hosted app pages */
|
|
7398
|
-
...HOSTED_APP_ROUTES,
|
|
7399
|
-
/* ---------------------------------------------------- mcp (the endpoint) */
|
|
7400
8792
|
{
|
|
7401
|
-
method: "
|
|
7402
|
-
path: "/
|
|
7403
|
-
section: "
|
|
7404
|
-
summary: "
|
|
8793
|
+
method: "POST",
|
|
8794
|
+
path: "/console/support/token",
|
|
8795
|
+
section: "developer-auth",
|
|
8796
|
+
summary: "Exchanges an operator's one-time support grant for a console session scoped to one org.",
|
|
7405
8797
|
audience: "internal",
|
|
7406
8798
|
auth: "none",
|
|
7407
|
-
rateLimited:
|
|
8799
|
+
rateLimited: true,
|
|
7408
8800
|
ownerTier: false,
|
|
7409
8801
|
status: 200,
|
|
7410
8802
|
params: [],
|
|
7411
8803
|
query: null,
|
|
7412
|
-
request:
|
|
7413
|
-
response:
|
|
7414
|
-
errors: [],
|
|
8804
|
+
request: supportTokenRequest,
|
|
8805
|
+
response: supportTokenResponse,
|
|
8806
|
+
errors: ["rate_limited"],
|
|
8807
|
+
transport: "http",
|
|
8808
|
+
notes: "Called by the console's own server, never by a browser \u2014 server to server only, exactly like `/console/oauth/token` beside it, but rate-limited where that one is not: the grant this exchanges is short-lived and worth guessing at, which a replay of the code exchange is not. `rate_limited` is the one code in this reference it can still answer, from the limiter itself, before the route's own dialect applies. Every other refusal uses the same RFC 6749 \xA75.2 flat `oauthError` shape, so this emits no other code in this reference: `invalid_grant` for a grant that is unknown, already used or expired, or for a verifier that does not match. Proof of possession is checked before the replay check, and the single-use consume is atomic, so exactly one caller ever mints from a given grant. The minted access token carries `kind: 'support'` and `aud: 'console'`, lives at most sixty minutes with no extension, and carries **no refresh token**: a support session that outlives its ceiling is a new grant and a new exchange, not a renewal. The session starts in `read` mode; switching one to `edit` is the operator side's `support_session_edit` command, not anything this route does."
|
|
8809
|
+
},
|
|
8810
|
+
{
|
|
8811
|
+
method: "POST",
|
|
8812
|
+
path: "/console/support/renew/fail",
|
|
8813
|
+
section: "developer-auth",
|
|
8814
|
+
summary: "Ends a current-generation support session after Console proves renewal authority failed.",
|
|
8815
|
+
audience: "internal",
|
|
8816
|
+
auth: "in_handler",
|
|
8817
|
+
rateLimited: false,
|
|
8818
|
+
ownerTier: false,
|
|
8819
|
+
status: 204,
|
|
8820
|
+
params: [],
|
|
8821
|
+
query: null,
|
|
8822
|
+
request: supportRenewFailRequest,
|
|
8823
|
+
response: null,
|
|
8824
|
+
errors: ["validation_error", "unauthorized", "not_found", "target_state_conflict"],
|
|
8825
|
+
transport: "http",
|
|
8826
|
+
notes: "Internal Console-to-Cloud POST only, no CORS. Console must first verify and consume signed Operator failure evidence bound to its original browser flow, or let Cloud timeout/sweep close an uncompleted flow; browser flow_id or error alone must never trigger this call. The evidence stays at Console: this strict Cloud request has no Operator or browser field. Authorization: Bearer <original fl_support>; a valid old bearer must reach the transaction even after another flow wins its generation, so a current-generation pre-handler must not intercept it. Cloud checks signature, audience, original expiry, exact stored bearer hash, S256 verifier, and bound session, org, mode and immutable creator subject. Lock session and flow in redemption order. After proof and before mutation, compare the saved credential generation: stale_generation takes precedence and cannot touch the winner. Only a live, pending, unauthorised current-generation flow before min(flow_created_at + 120 seconds, old credential expiry) atomically records failedAt, endedAt and audit/event. Success is 204 with no body. Missing callback closes an unauthorised expired flow at the next session check or sweep under the same generation fence. No failure extends a lease or compensates a committed redemption. Every refusal is Cache-Control: no-store with supportRenewFailRefusal body: 400 validation_error/invalid_flow for malformed JSON; 401 unauthorized/invalid_authority for missing or invalid bearer or proof; 404 not_found/invalid_flow for unknown or foreign flow, or /identity_mismatch for bound identity mismatch; 409 target_state_conflict/expired, /replayed, /session_inactive or /stale_generation. No failure response sets or clears fl_support. Network ambiguity is never a 204 and does not trigger an unconditional support_session.end."
|
|
8827
|
+
},
|
|
8828
|
+
/* --------------------------------- the Fleetless-hosted app pages */
|
|
8829
|
+
...HOSTED_APP_ROUTES,
|
|
8830
|
+
/* ---------------------------------------------------- mcp (the endpoint) */
|
|
8831
|
+
{
|
|
8832
|
+
method: "GET",
|
|
8833
|
+
path: "/mcp/welcome",
|
|
8834
|
+
section: "mcp",
|
|
8835
|
+
summary: "Serves the page that tells a person which URL to paste into their MCP client.",
|
|
8836
|
+
audience: "internal",
|
|
8837
|
+
auth: "none",
|
|
8838
|
+
rateLimited: false,
|
|
8839
|
+
ownerTier: false,
|
|
8840
|
+
status: 200,
|
|
8841
|
+
params: [],
|
|
8842
|
+
query: null,
|
|
8843
|
+
request: null,
|
|
8844
|
+
response: null,
|
|
8845
|
+
errors: [],
|
|
7415
8846
|
transport: "http",
|
|
7416
8847
|
notes: "HTML, one fixed document rendered once at startup \u2014 its inputs are process configuration, not request state. Cached for five minutes rather than a day, because the URLs it names can change with a deployment. Its content security policy admits the page's own inline style and script by SHA-256 rather than by `unsafe-inline`, and forbids every external fetch outright. A configured friendly URL that is not a usable absolute http(s) URL is ignored rather than rendered: a typo in a deployment variable must not put a broken URL in front of every end user."
|
|
7417
8848
|
},
|
|
@@ -7431,7 +8862,7 @@ var ROUTES = [
|
|
|
7431
8862
|
response: null,
|
|
7432
8863
|
errors: ["unauthorized", "forbidden"],
|
|
7433
8864
|
transport: "http",
|
|
7434
|
-
notes: "JSON-RPC over MCP's Streamable HTTP, so neither the request nor the response is a shape contracts describes; the tool arguments and results are the schemas in each tool definition. **Fleetless users only** \u2014 an app's users reach their own app endpoint instead. **The bearer is verified inside the handler**, not by a route guard: the identity comes from the token and the path names none, and the refusal has to carry a `WWW-Authenticate` challenge that a guard shared with the REST surface does not send. `Origin` is checked against the cloud's own, and a foreign one is the `403 forbidden` above. **Both catalogs, unconditionally**: every caller admitted here is a Fleetless user, so the tool list has nothing left to vary with and the admin-ness check on `tools/call` is gone \u2014 a console tool that is still narrower than the catalog refuses for itself (`
|
|
8865
|
+
notes: "JSON-RPC over MCP's Streamable HTTP, so neither the request nor the response is a shape contracts describes; the tool arguments and results are the schemas in each tool definition. **Fleetless users only** \u2014 an app's users reach their own app endpoint instead. **The bearer is verified inside the handler**, not by a route guard: the identity comes from the token and the path names none, and the refusal has to carry a `WWW-Authenticate` challenge that a guard shared with the REST surface does not send. `Origin` is checked against the cloud's own, and a foreign one is the `403 forbidden` above. **Both catalogs, unconditionally**: every caller admitted here is a Fleetless user, so the tool list has nothing left to vary with and the admin-ness check on `tools/call` is gone \u2014 a console tool that is still narrower than the catalog refuses for itself (`console_robots_write.delete` answers `tier_required` to a non-Owner). `403 forbidden` is also what an `mcp_session` token whose subject is an **app user** gets: this endpoint serves the team only, and such a token belongs to its own app's endpoint. The code is `forbidden` rather than `mcp_disabled` because nothing is switched off \u2014 the caller is at the wrong server \u2014 and per-app sign-in mints exactly such tokens, so the two states must not share a word. `mcp_access_denied` is gone with the per-user override and the group flag it read: every Fleetless user has MCP access here. Stateless: a fresh transport per request, no session id, nothing survives the call."
|
|
7435
8866
|
},
|
|
7436
8867
|
/* --------------------------------------------- mcp (one app's own server) */
|
|
7437
8868
|
{
|
|
@@ -8288,7 +9719,7 @@ var ROUTES = [
|
|
|
8288
9719
|
response: clientRobotListResponse,
|
|
8289
9720
|
errors: [...CLIENT_GUARD],
|
|
8290
9721
|
transport: "http",
|
|
8291
|
-
notes: "**The REST twin of the MCP
|
|
9722
|
+
notes: "**The REST twin of the MCP action `robots.list`**, and the one robot question no robot-scoped route can answer: which robots may I name at all. An app user sees the robots their app attaches on which their role grants at least one slug or capability; a server key sees every robot its app attaches; a developer bearer sees the organisation's robots. Name order, id as the tiebreak. A robot on which the role grants nothing is absent rather than listed empty \u2014 the same answer `robots.list` gives, for the same reason: reach is a grant, not an attachment. Under `/api/client/` because it names no robot; every robot-scoped read stays under `/api/robots/:id/\u2026`."
|
|
8292
9723
|
},
|
|
8293
9724
|
{
|
|
8294
9725
|
method: "GET",
|
|
@@ -8306,7 +9737,7 @@ var ROUTES = [
|
|
|
8306
9737
|
response: mcpRobotDatasheet,
|
|
8307
9738
|
errors: [...CLIENT_GUARD, "invalid_uuid", "not_found"],
|
|
8308
9739
|
transport: "http",
|
|
8309
|
-
notes: "**The REST twin of the MCP
|
|
9740
|
+
notes: "**The REST twin of the MCP action `robots.describe`**: one answer per robot \u2014 every datapoint, action, service, publisher and camera the role grants, each with its `input_schema` where it takes parameters, plus the two capabilities that gate whole features, `action_history` and `assets`. A robot with nothing published answers an empty `exposures` list, never a refusal. A robot the caller does not reach \u2014 not attached to their app, or attached with a role that grants nothing on it \u2014 answers `404` exactly as one that does not exist. The app-user datapoint and camera listings under this prefix stay; this is the one read that also names actions, services, publishers and capabilities, which is what an app needs before it can draw a screen."
|
|
8310
9741
|
},
|
|
8311
9742
|
/* ------------------------------------------------- config (draft/publish) */
|
|
8312
9743
|
{
|
|
@@ -8426,7 +9857,7 @@ var ROUTES = [
|
|
|
8426
9857
|
method: "POST",
|
|
8427
9858
|
path: "/api/robots/:id/config/rename-slug",
|
|
8428
9859
|
section: "config",
|
|
8429
|
-
summary: "Renames a slug in the draft and
|
|
9860
|
+
summary: "Renames a slug in the draft and moves every role grant and the recorded history with the name.",
|
|
8430
9861
|
audience: "developer",
|
|
8431
9862
|
auth: "developer",
|
|
8432
9863
|
rateLimited: false,
|
|
@@ -8445,10 +9876,11 @@ var ROUTES = [
|
|
|
8445
9876
|
"unknown_slug",
|
|
8446
9877
|
"reserved_slug",
|
|
8447
9878
|
"duplicate_slug",
|
|
9879
|
+
"history_migrating",
|
|
8448
9880
|
"internal_error"
|
|
8449
9881
|
],
|
|
8450
9882
|
transport: "http",
|
|
8451
|
-
notes: "One transaction
|
|
9883
|
+
notes: "One transaction: the draft document and every app-role grant carrying the slug are rewritten, and the recorded history moves with the name without rewriting any stored sample, so a rename takes the same time however much history there is. Samples the robot still sends under the old slug until the next publish join the renamed history. The published configuration is immutable, so `requires_publish` says the rename is not live on the robot yet. A draft that is not a document is `409 draft_not_a_document` \u2014 the same word the usage preview uses for the same state. While the recorded history is being migrated the rename is refused with `409 history_migrating`; nothing is written, and the same request succeeds once the migration has finished."
|
|
8452
9884
|
},
|
|
8453
9885
|
{
|
|
8454
9886
|
method: "GET",
|
|
@@ -8704,6 +10136,27 @@ var ROUTES = [
|
|
|
8704
10136
|
transport: "http",
|
|
8705
10137
|
notes: "The body is optional: a bodyless `POST` was every caller's shape before `job_id` existed, and absent or `job_id: null` both mean \"cancel whatever is running\". A named `job_id` that is **not** what is running cancels nothing and answers `404` \u2014 the caller named an id and thereby ruled the other one out. An `external` job is cancelled the same way, through its goal id. Cancelling an `unknown` job also cancels every external goal on its action, since one of them may be that job. A service is `422 not_cancellable`: a service call has no goal to cancel. Nothing running is a `200` with `job: null`. The answer waits for the bridge's `cancel_result`: a `200` means the action server accepted the cancel request, not that the goal has ended \u2014 the job's end arrives as its own update. Any goal answered `ERROR_REJECTED` makes it `409 cancel_rejected`, with every goal and its `return_code` in `details.goals`; no answer within `JOB_HEARTBEAT_TIMEOUT_MS` is `504 bridge_timeout`; a cancel the bridge could not send at all is `502` carrying the bridge's own code (`unknown_slug`, `action_server_lost`, `internal_error`)."
|
|
8706
10138
|
},
|
|
10139
|
+
{
|
|
10140
|
+
method: "POST",
|
|
10141
|
+
path: "/api/robots/:id/jobs/:slug/recover",
|
|
10142
|
+
section: "commands",
|
|
10143
|
+
summary: "Releases one held job after an Owner verifies the robot is stopped.",
|
|
10144
|
+
audience: "developer",
|
|
10145
|
+
auth: "developer",
|
|
10146
|
+
rateLimited: false,
|
|
10147
|
+
ownerTier: true,
|
|
10148
|
+
status: 200,
|
|
10149
|
+
params: [
|
|
10150
|
+
{ name: "id", description: "The robot uuid in the authenticated Owner's organization." },
|
|
10151
|
+
{ name: "slug", description: "The action slug holding the exact job named in the body." }
|
|
10152
|
+
],
|
|
10153
|
+
query: null,
|
|
10154
|
+
request: recoverHeldJobRequest,
|
|
10155
|
+
response: recoverHeldJobResponse,
|
|
10156
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "support_forbidden", "invalid_uuid", "not_found", "validation_error", "job_state_conflict", "internal_error"],
|
|
10157
|
+
transport: "http",
|
|
10158
|
+
notes: "Use only after physically stopping or isolating the robot and checking that it cannot move. Read the held job id, then submit that exact id with a reason and `verified_stopped: true`. The assertion is a human safety check, not a sensor reading. The cloud records the Owner and reason in the audit trail and returns the job settled to `lost`. App users, server keys, other developers and support sessions cannot use this route. A connected bridge or a changed job returns `409 job_state_conflict`; a normal cancel is not recovery and never releases an uncertain job."
|
|
10159
|
+
},
|
|
8707
10160
|
{
|
|
8708
10161
|
method: "POST",
|
|
8709
10162
|
path: "/api/robots/:id/publishers/:slug",
|
|
@@ -9168,11 +10621,29 @@ var ROUTES = [
|
|
|
9168
10621
|
transport: "http",
|
|
9169
10622
|
notes: "The one read the console's Plan & billing page, its usage and limit gauges, and every upgrade prompt and feature gate draw from \u2014 nothing else computes `limits` or `usage` on its own. `limits` is already the effective ceiling, the catalogue row raised by `addons` or replaced by an operator's override, so a consumer never recomputes it from the catalogue. `usage` is counted fresh on every call, never cached. `switch` is present only for an organization still on the beta that has not yet landed on a priced plan."
|
|
9170
10623
|
},
|
|
10624
|
+
{
|
|
10625
|
+
method: "POST",
|
|
10626
|
+
path: "/api/org/plan/change/prepare",
|
|
10627
|
+
section: "org",
|
|
10628
|
+
summary: "Prepares a nonbinding downward-plan decision and its C.4 display.",
|
|
10629
|
+
audience: "developer",
|
|
10630
|
+
auth: "developer",
|
|
10631
|
+
rateLimited: false,
|
|
10632
|
+
ownerTier: true,
|
|
10633
|
+
status: 200,
|
|
10634
|
+
params: [],
|
|
10635
|
+
query: null,
|
|
10636
|
+
request: planChangePrepareRequest,
|
|
10637
|
+
response: planChangePrepareResponse,
|
|
10638
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "plan_limit", "target_state_conflict"],
|
|
10639
|
+
transport: "http",
|
|
10640
|
+
notes: "Owner only. Persists a prepared change reference and a short-lived display, without mutating the plan, pending_change, or legal acceptance. A same-key, same-input retry while undecided returns the same change_id with a fresh display. A Basic cancellation reason belongs only in the final PUT."
|
|
10641
|
+
},
|
|
9171
10642
|
{
|
|
9172
10643
|
method: "PUT",
|
|
9173
10644
|
path: "/api/org/plan/change",
|
|
9174
10645
|
section: "org",
|
|
9175
|
-
summary: "
|
|
10646
|
+
summary: "Confirms a prepared downward-plan decision with its C.4 proof.",
|
|
9176
10647
|
audience: "developer",
|
|
9177
10648
|
auth: "developer",
|
|
9178
10649
|
rateLimited: false,
|
|
@@ -9184,7 +10655,25 @@ var ROUTES = [
|
|
|
9184
10655
|
response: orgPlan,
|
|
9185
10656
|
errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "plan_limit", "target_state_conflict"],
|
|
9186
10657
|
transport: "http",
|
|
9187
|
-
notes: "Owner tier, and **downward only**: this route moves the org to a lower plan or cancels it outright to Basic. It never moves the org up \u2014
|
|
10658
|
+
notes: "Owner tier, and **downward only**: a prior prepare returns change_id and a displayed snapshot; this final PUT requires its confirmation_proof and the same operation_key, target_plan and keep. Only Basic permits cancellation_reason (at most 500 input characters). The reason is final idempotency metadata, not price or legal evidence. An exact replay returns the original result; a changed reason with the same key conflicts before effect. The decision and legal acceptance commit together. This route moves the org to a lower plan or cancels it outright to Basic. It never moves the org up \u2014 an upgrade or an add-on goes through the billing routes instead (`POST /api/billing/checkout`, `POST /api/billing/change`). `409 target_state_conflict` names `target_plan` with rule `not_lower` when the chosen plan is not below the org's current one; with rule `locked_basic_only` when the org is locked (`orgLock`) and the chosen plan is anything but Basic; and with rule `migration_basic_only` when the org is still on the beta, awaiting the switch to priced plans, and the chosen plan is anything but Basic \u2014 that choice is exactly what the org lands on at the switch. An owner is never named in `keep` and always stays, but still counts against the target plan's `seats`; `409 plan_limit` names `seats` when the owners alone already exceed it, and names whichever other limit `keep` still exceeds otherwise. `keep` is `null` when the org's current usage already fits the target plan outright and nothing is deleted; named, it lists exactly the robots, apps, app users and developers that stay. The choice is stored as `pending_change` and takes effect at `period_ends_at` \u2014 **everything of the chosen kind not named in `keep` is deleted at that instant, never before** \u2014 except a choice made while the org is locked, which takes effect at once, and a beta org's choice, which takes effect at the switch date instead. Anything created while the choice is pending is checked against the target plan too and, when it passes, is folded into `keep`, so exactly what the confirmation counted is what is actually deleted. Replacing a still-pending choice requires a new prepare and proof-bound final PUT."
|
|
10659
|
+
},
|
|
10660
|
+
{
|
|
10661
|
+
method: "GET",
|
|
10662
|
+
path: "/api/org/plan/change/decisions",
|
|
10663
|
+
section: "org",
|
|
10664
|
+
summary: "Looks up the prepared or accepted owner plan decision by operation key.",
|
|
10665
|
+
audience: "developer",
|
|
10666
|
+
auth: "developer",
|
|
10667
|
+
rateLimited: false,
|
|
10668
|
+
ownerTier: true,
|
|
10669
|
+
status: 200,
|
|
10670
|
+
params: [],
|
|
10671
|
+
query: planChangeDecisionLookupQuery,
|
|
10672
|
+
request: null,
|
|
10673
|
+
response: planChangeDecisionStatusResponse,
|
|
10674
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "not_found"],
|
|
10675
|
+
transport: "http",
|
|
10676
|
+
notes: "Scope the operation key to the authenticated real Owner and organization. An unknown or foreign key returns 404 without disclosure. Prepared returns only change_id; accepted returns the stored original orgPlan result. No proof is returned. Console checks this before asking for a fresh display after a lost final response."
|
|
9188
10677
|
},
|
|
9189
10678
|
{
|
|
9190
10679
|
method: "DELETE",
|
|
@@ -9202,7 +10691,7 @@ var ROUTES = [
|
|
|
9202
10691
|
response: null,
|
|
9203
10692
|
errors: [...DEVELOPER_GUARD, "tier_required", "not_found"],
|
|
9204
10693
|
transport: "http",
|
|
9205
|
-
notes: "Owner tier. `404 not_found` when the org has no `pending_change` to withdraw. The org stays on its current plan, unchanged, as if the choice had never been made;
|
|
10694
|
+
notes: "Owner tier. `404 not_found` when the org has no `pending_change` to withdraw. The org stays on its current plan, unchanged, as if the choice had never been made; an Owner who wants a different one prepares a new display and confirms it with a final PUT."
|
|
9206
10695
|
},
|
|
9207
10696
|
{
|
|
9208
10697
|
method: "PATCH",
|
|
@@ -9218,9 +10707,369 @@ var ROUTES = [
|
|
|
9218
10707
|
query: null,
|
|
9219
10708
|
request: adminPlanChangeRequest,
|
|
9220
10709
|
response: orgPlan,
|
|
9221
|
-
errors: ["unauthorized", "not_found", "validation_error", "plan_limit", "rate_limited"],
|
|
10710
|
+
errors: ["unauthorized", "not_found", "validation_error", "plan_limit", "rate_limited", "target_state_conflict"],
|
|
10711
|
+
transport: "http",
|
|
10712
|
+
notes: "Every public host answers `404 not_found` for every `/api/admin/*` path \u2014 this route is reachable only on the cloud's private address \u2014 and that same address answers `404` here too while `OPS_API_TOKEN` is not configured, so a door with no key behind it reads exactly like one nobody opened. An unknown `:id` is the same `404`. Applies at once, never queued as a `pending_change`, and only when the org's current usage fits the result: `409 plan_limit` when a lower plan, a lowered override or a removed add-on would leave the org over a limit \u2014 the operator never deletes an org's things, only the owner's own choice does. On success it also withdraws any `pending_change`, ends a beta org's wait for the switch and lifts a lock. Audited as `org.plan_changed` with the `fleetless` actor, never a developer's \u2014 the row names what an operator did, not who in the org asked for it. `409 target_state_conflict` names `currency` or `period_ends_at` with rule `billed` when the org has a billing account in `active` or `past_due` and the request names either field: both are fixed at the first payment and billing, not the operator, owns them from then on. The plan itself keeps working on a billed org \u2014 a plan, an add-on or an override the operator sets here is charged from the next renewal, except `enterprise` and `basic`, which the sweep cancels the billing account for instead."
|
|
10713
|
+
},
|
|
10714
|
+
/* --- billing (2026-10-04, fleetless/fleetless#104) ----------------------
|
|
10715
|
+
*
|
|
10716
|
+
* Every route here but the webhook is owner-only (`ownerTier: true`), a
|
|
10717
|
+
* developer answers `403 tier_required` and `GET /api/billing`
|
|
10718
|
+
* is no exception — a developer reads #103's plan cards from
|
|
10719
|
+
* `GET /api/org/plan` instead, without the payer, payment method or
|
|
10720
|
+
* invoices. The routes that list `billing_unavailable` and
|
|
10721
|
+
* `payment_provider_unavailable` spread them from the `BILLING_OFF` and
|
|
10722
|
+
* `MOLLIE` constants near the top of this file.
|
|
10723
|
+
*/
|
|
10724
|
+
{
|
|
10725
|
+
method: "GET",
|
|
10726
|
+
path: "/api/billing",
|
|
10727
|
+
section: "billing",
|
|
10728
|
+
summary: "Reads the org's billing account, payment method and invoices.",
|
|
10729
|
+
audience: "developer",
|
|
10730
|
+
auth: "developer",
|
|
10731
|
+
rateLimited: false,
|
|
10732
|
+
ownerTier: true,
|
|
10733
|
+
status: 200,
|
|
10734
|
+
params: [],
|
|
10735
|
+
query: null,
|
|
10736
|
+
request: null,
|
|
10737
|
+
response: billingView,
|
|
10738
|
+
errors: [...DEVELOPER_GUARD, "tier_required"],
|
|
10739
|
+
transport: "http",
|
|
10740
|
+
notes: "`available: false` when `MOLLIE_API_KEY` is not configured \u2014 this cloud takes no payments, and every billing route that charges or opens a Mollie checkout answers `503 billing_unavailable` instead of acting; plan-change prepare, resume, the details and the VAT-ID check need no Mollie and answer normally. `account` is `null` before the org has ever checked out; the plan and its limits still come from `GET /api/org/plan` (fleetless/fleetless issue 103) and are not repeated here."
|
|
10741
|
+
},
|
|
10742
|
+
{
|
|
10743
|
+
method: "POST",
|
|
10744
|
+
path: "/api/billing/checkout",
|
|
10745
|
+
section: "billing",
|
|
10746
|
+
summary: "Records a company purchase intent for the first paid plan.",
|
|
10747
|
+
audience: "developer",
|
|
10748
|
+
auth: "developer",
|
|
10749
|
+
rateLimited: true,
|
|
10750
|
+
ownerTier: true,
|
|
10751
|
+
status: 201,
|
|
10752
|
+
params: [],
|
|
10753
|
+
query: null,
|
|
10754
|
+
request: checkoutRequest,
|
|
10755
|
+
response: checkoutResponse,
|
|
10756
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "plan_limit", "target_state_conflict", "rate_limited", ...BILLING_OFF, ...MOLLIE],
|
|
10757
|
+
transport: "http",
|
|
10758
|
+
notes: "Basic stays free for every payer. This start creates only a nonbinding draft; accept_terms is deprecated and cannot confirm an order. Current company, buyer, VIES and EUR quote checks still apply. Persist operation_key before POST; the same key and input return 200 with the existing intent (and its hosted checkout when payment_started), without another Mollie payment; changed input conflicts. A different operation_key while a first payment is open returns 409 target_state_conflict with rule checkout_open and details expires_at: null. An eligible Owner obtains a no-store C.4 display, then explicitly confirms with its proof. No payment or acceptance occurs at start. Hosted payment later offers card, PayPal or Apple Pay; its return is <console>/settings/billing?checkout=<checkout_id>. An active/past_due account uses billing/change."
|
|
10759
|
+
},
|
|
10760
|
+
{
|
|
10761
|
+
method: "GET",
|
|
10762
|
+
path: "/api/billing/intents",
|
|
10763
|
+
section: "billing",
|
|
10764
|
+
summary: "Recovers a purchase intent by operation key or intent ID.",
|
|
10765
|
+
audience: "developer",
|
|
10766
|
+
auth: "developer",
|
|
10767
|
+
rateLimited: false,
|
|
10768
|
+
ownerTier: true,
|
|
10769
|
+
status: 200,
|
|
10770
|
+
params: [],
|
|
10771
|
+
query: purchaseIntentLookupQuery,
|
|
10772
|
+
request: null,
|
|
10773
|
+
response: purchaseIntentResponse,
|
|
10774
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "not_found"],
|
|
10775
|
+
transport: "http",
|
|
10776
|
+
notes: "Supply exactly one of operation_key or intent_id and the expected operation. Scope lookup to the authenticated owner and org; unknown, foreign-org or mismatched-operation intents return 404 without disclosure. Repeating a lookup after restart or lost response returns the same intent/payment identity and, for a paid change, its billing result. A proof is never returned here; a still-eligible decision needs a fresh C.4 display and explicit Owner click."
|
|
10777
|
+
},
|
|
10778
|
+
{
|
|
10779
|
+
method: "POST",
|
|
10780
|
+
path: "/api/billing/intents/:id/display",
|
|
10781
|
+
section: "billing",
|
|
10782
|
+
summary: "Issues a short-lived C.4 decision display and opaque confirmation proof.",
|
|
10783
|
+
audience: "developer",
|
|
10784
|
+
auth: "developer",
|
|
10785
|
+
rateLimited: false,
|
|
10786
|
+
ownerTier: true,
|
|
10787
|
+
status: 200,
|
|
10788
|
+
params: [{ name: "id", description: "The eligible intent ID returned by checkout or billing change." }],
|
|
10789
|
+
query: null,
|
|
10790
|
+
request: billingDecisionDisplayRequest,
|
|
10791
|
+
response: billingDecisionDisplayResponse,
|
|
10792
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "not_found", "target_state_conflict"],
|
|
10793
|
+
transport: "http",
|
|
10794
|
+
notes: "Owner only, Cache-Control: no-store. Cloud persists the snapshot and proof hash for an eligible current checkout or paid-change intent of this Owner and org. Pending, held, refused or accepted intents cannot mint a new proof. The proof never appears in lookup, billing views or logs."
|
|
10795
|
+
},
|
|
10796
|
+
{
|
|
10797
|
+
method: "POST",
|
|
10798
|
+
path: "/api/billing/intents/:id/confirm",
|
|
10799
|
+
section: "billing",
|
|
10800
|
+
summary: "Confirms the current purchase quote exactly once.",
|
|
10801
|
+
audience: "developer",
|
|
10802
|
+
auth: "developer",
|
|
10803
|
+
rateLimited: true,
|
|
10804
|
+
ownerTier: true,
|
|
10805
|
+
status: 200,
|
|
10806
|
+
params: [{ name: "id", description: "The intent ID returned by the start or lookup response." }],
|
|
10807
|
+
query: null,
|
|
10808
|
+
request: purchaseIntentConfirmRequest,
|
|
10809
|
+
response: purchaseIntentResponse,
|
|
10810
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "not_found", "target_state_conflict", "plan_limit", "rate_limited", ...BILLING_OFF, ...MOLLIE],
|
|
10811
|
+
transport: "http",
|
|
10812
|
+
notes: "Checkout and paid-change decisions require confirmation_proof along with the operation key, quote revision and buyer fingerprint shown in the persisted C.4 display. Cloud rechecks buyer, quote, selection, legal references, period and current state under the org lock; stale or spent proof conflicts without effect. One decision and one legal acceptance commit together. An exact same-key replay returns the original result without another payment or acceptance. A paid change can return 409 target_state_conflict with field billing and rule charge_in_progress while an earlier charge is unresolved; it does not start another charge. Foreign ownership answers 404 without disclosure; pending or held cannot charge."
|
|
10813
|
+
},
|
|
10814
|
+
{
|
|
10815
|
+
method: "GET",
|
|
10816
|
+
path: "/api/billing/checkout/:id",
|
|
10817
|
+
section: "billing",
|
|
10818
|
+
summary: "Reads a checkout's status, for the return page's poll.",
|
|
10819
|
+
audience: "developer",
|
|
10820
|
+
auth: "developer",
|
|
10821
|
+
rateLimited: false,
|
|
10822
|
+
ownerTier: true,
|
|
10823
|
+
status: 200,
|
|
10824
|
+
params: [{ name: "id", description: "The checkout id from `checkoutResponse.checkout_id`, carried on the return URL." }],
|
|
10825
|
+
query: null,
|
|
10826
|
+
request: null,
|
|
10827
|
+
response: checkoutStatus,
|
|
10828
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "not_found"],
|
|
10829
|
+
transport: "http",
|
|
10830
|
+
notes: "Calls the same `reconcilePayment(deps, molliePaymentId)` the webhook calls, so a return page that lands before the webhook does still sees the payment applied \u2014 this route, not the webhook, is what the dev stack and the test-mode suite rely on, since Mollie refuses an unreachable webhook URL. `plan` is the org's plan after applying, unchanged unless `purpose` is `upgrade` and `status` is `paid`."
|
|
10831
|
+
},
|
|
10832
|
+
{
|
|
10833
|
+
method: "POST",
|
|
10834
|
+
path: "/api/billing/vat-id/check",
|
|
10835
|
+
section: "billing",
|
|
10836
|
+
summary: "Checks a VAT ID using requester-aware direct VIES.",
|
|
10837
|
+
audience: "developer",
|
|
10838
|
+
auth: "developer",
|
|
10839
|
+
rateLimited: true,
|
|
10840
|
+
ownerTier: true,
|
|
10841
|
+
status: 200,
|
|
10842
|
+
params: [],
|
|
10843
|
+
query: null,
|
|
10844
|
+
request: vatIdCheckRequest,
|
|
10845
|
+
response: vatIdCheckResponse,
|
|
10846
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "rate_limited"],
|
|
10847
|
+
transport: "http",
|
|
10848
|
+
notes: "Reports status and optional display name only; full evidence stays in protected Finance storage. valid with a missing identifier remains pending/vies_identifier_missing. unverified or unavailable remains pending without zero rating or payment. A form check never authorizes a later charge; Cloud binds current evidence to the buyer and quote at confirmation. Rate limited on billing.vat_check."
|
|
10849
|
+
},
|
|
10850
|
+
{
|
|
10851
|
+
method: "PATCH",
|
|
10852
|
+
path: "/api/billing/details",
|
|
10853
|
+
section: "billing",
|
|
10854
|
+
summary: "Edits company billing details for revalidation before the next charge.",
|
|
10855
|
+
audience: "developer",
|
|
10856
|
+
auth: "developer",
|
|
10857
|
+
rateLimited: false,
|
|
10858
|
+
ownerTier: true,
|
|
10859
|
+
status: 200,
|
|
10860
|
+
params: [],
|
|
10861
|
+
query: null,
|
|
10862
|
+
request: billingDetailsUpdate,
|
|
10863
|
+
response: billingView,
|
|
10864
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "not_found"],
|
|
10865
|
+
transport: "http",
|
|
10866
|
+
notes: "404 not_found when no billing account exists. Edits may change company name, full address/state, Tax ID, VAT ID and invoice email. Validate the merged buyer before a later charge; edits invalidate old evidence and quote revisions. Revalidate the email policy and country requirements. An edit does not create a payment, activate a plan, pay an invoice, clear dunning or lift a lock."
|
|
10867
|
+
},
|
|
10868
|
+
{
|
|
10869
|
+
method: "POST",
|
|
10870
|
+
path: "/api/billing/change",
|
|
10871
|
+
section: "billing",
|
|
10872
|
+
summary: "Records a nonbinding paid-change intent for a plan, cycle or add-on target.",
|
|
10873
|
+
audience: "developer",
|
|
10874
|
+
auth: "developer",
|
|
10875
|
+
rateLimited: false,
|
|
10876
|
+
ownerTier: true,
|
|
10877
|
+
status: 200,
|
|
10878
|
+
params: [],
|
|
10879
|
+
query: null,
|
|
10880
|
+
request: billingChangeRequest,
|
|
10881
|
+
response: billingChangeResponse,
|
|
10882
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "plan_limit", "target_state_conflict", ...BILLING_OFF, ...MOLLIE],
|
|
10883
|
+
transport: "http",
|
|
10884
|
+
notes: "The request names an absolute plan/cycle/add-on target and a stable operation_key. Start is nonbinding for every change, including zero-charge, scheduled and formerly immediate decreases: it neither changes the plan nor writes legal acceptance. An eligible Owner obtains a C.4 display and explicitly confirms with its proof. Confirmation may return accepted_no_payment with charged: null and no provider payment or redirect, or payment_started for a charged change. Exact-key lookup recovers the accepted result. Existing no_account, past_due, no_valid_mandate and plan_limit conflicts remain. A later paid-change confirmation can return 409 target_state_conflict with field billing and rule charge_in_progress while an earlier charge is unresolved; no second charge starts."
|
|
10885
|
+
},
|
|
10886
|
+
{
|
|
10887
|
+
method: "POST",
|
|
10888
|
+
path: "/api/billing/payment-method",
|
|
10889
|
+
section: "billing",
|
|
10890
|
+
summary: "Records an invoice-paying method intent or a held mandate setup.",
|
|
10891
|
+
audience: "developer",
|
|
10892
|
+
auth: "developer",
|
|
10893
|
+
rateLimited: true,
|
|
10894
|
+
ownerTier: true,
|
|
10895
|
+
status: 201,
|
|
10896
|
+
params: [],
|
|
10897
|
+
query: null,
|
|
10898
|
+
request: paymentMethodChangeRequest,
|
|
10899
|
+
response: checkoutResponse,
|
|
10900
|
+
errors: ["target_state_conflict", ...DEVELOPER_GUARD, "tier_required", "validation_error", "not_found", "rate_limited", ...BILLING_OFF, ...MOLLIE],
|
|
10901
|
+
transport: "http",
|
|
10902
|
+
notes: "Use a stable operation_key and owner intent lookup after reload/timeout. Offer payment_method_options. Apple Pay with zero-amount changes disabled pays an open invoice through operation payment_method_invoice; without one, 400 validation_error has field method and rule applepay_needs_open_invoice. Apply the same buyer/VIES gate, current-amount reconfirmation and USD legacy hold as invoices/:id/pay. Pending, eligible and held contain no checkout URL; redirect only on payment_started.payment.kind hosted. A 0.00 mandate-only setup uses operation mandate_setup and held/mandate_policy_unresolved until the integration decision settles eligibility and currency. It pays no invoice and clears no dunning or lock. An invoice charged back is never retried automatically. 404 not_found when no account exists. Same key with changed input is a typed operation_key_reused conflict."
|
|
10903
|
+
},
|
|
10904
|
+
{
|
|
10905
|
+
method: "POST",
|
|
10906
|
+
path: "/api/billing/cancel",
|
|
10907
|
+
section: "billing",
|
|
10908
|
+
summary: "Rejects legacy direct cancellation after the C.4 gate is active.",
|
|
10909
|
+
audience: "developer",
|
|
10910
|
+
auth: "developer",
|
|
10911
|
+
rateLimited: false,
|
|
10912
|
+
ownerTier: true,
|
|
10913
|
+
status: 409,
|
|
10914
|
+
params: [],
|
|
10915
|
+
query: null,
|
|
10916
|
+
request: billingCancelRequest,
|
|
10917
|
+
requestOptional: true,
|
|
10918
|
+
response: null,
|
|
10919
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "target_state_conflict"],
|
|
10920
|
+
transport: "http",
|
|
10921
|
+
notes: "The C.4 gate rejects this legacy POST with 409 target_state_conflict before mutation, audit or mail. Console uses POST /api/org/plan/change/prepare and the proof-bound final PUT for Basic, including an optional reason there. This route cannot confirm a customer decision."
|
|
10922
|
+
},
|
|
10923
|
+
{
|
|
10924
|
+
method: "POST",
|
|
10925
|
+
path: "/api/billing/resume",
|
|
10926
|
+
section: "billing",
|
|
10927
|
+
summary: "Withdraws a scheduled cancel, keeping the current plan.",
|
|
10928
|
+
audience: "developer",
|
|
10929
|
+
auth: "developer",
|
|
10930
|
+
rateLimited: false,
|
|
10931
|
+
ownerTier: true,
|
|
10932
|
+
status: 200,
|
|
10933
|
+
params: [],
|
|
10934
|
+
query: null,
|
|
10935
|
+
request: null,
|
|
10936
|
+
response: billingView,
|
|
10937
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "not_found"],
|
|
10938
|
+
transport: "http",
|
|
10939
|
+
notes: "`404 not_found` when nothing is pending \u2014 there is no scheduled cancel to withdraw. The org stays on its current plan, unchanged."
|
|
10940
|
+
},
|
|
10941
|
+
{
|
|
10942
|
+
method: "GET",
|
|
10943
|
+
path: "/api/billing/invoices/:id/pdf",
|
|
10944
|
+
section: "billing",
|
|
10945
|
+
summary: "Downloads an invoice's original or cancellation PDF.",
|
|
10946
|
+
audience: "developer",
|
|
10947
|
+
auth: "developer",
|
|
10948
|
+
rateLimited: false,
|
|
10949
|
+
ownerTier: true,
|
|
10950
|
+
status: 200,
|
|
10951
|
+
params: [{ name: "id", description: "The invoice id, from `billingInvoice.id` in `GET /api/billing`'s `invoices`." }],
|
|
10952
|
+
query: billingInvoicePdfQuery,
|
|
10953
|
+
request: null,
|
|
10954
|
+
response: null,
|
|
10955
|
+
contentType: "application/pdf",
|
|
10956
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "not_found"],
|
|
10957
|
+
transport: "http",
|
|
10958
|
+
notes: "Owner-only. Omitted `kind` or `kind=invoice` returns the original PDF, rendered once with `pdfkit` when issued and stored as bytes. `kind=cancellation` returns the stored cancellation PDF for this same invoice id; no read renders a new PDF. `404 not_found` for an unknown id, one from another org, or a missing cancellation number or PDF. This reads historical Cloud invoices only: a due charge has no PDF of its own here \u2014 its eventual Lexware invoice is a document, read through `GET /api/billing/documents/:id/file`."
|
|
10959
|
+
},
|
|
10960
|
+
/* --- billing documents (2026-10-19, fleetless/fleetless#544) -------
|
|
10961
|
+
*
|
|
10962
|
+
* A read-only view of the Lexware vouchers issued to the org's company. Cloud resolves the org's own Lexware contact itself; the
|
|
10963
|
+
* contact is never supplied by the caller.
|
|
10964
|
+
*/
|
|
10965
|
+
{
|
|
10966
|
+
method: "GET",
|
|
10967
|
+
path: "/api/billing/documents",
|
|
10968
|
+
section: "billing",
|
|
10969
|
+
summary: "Lists the org's finalized Lexware billing documents.",
|
|
10970
|
+
audience: "developer",
|
|
10971
|
+
auth: "developer",
|
|
10972
|
+
rateLimited: true,
|
|
10973
|
+
ownerTier: true,
|
|
10974
|
+
status: 200,
|
|
10975
|
+
params: [],
|
|
10976
|
+
query: null,
|
|
10977
|
+
request: null,
|
|
10978
|
+
response: billingDocumentList,
|
|
10979
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "billing_documents_unavailable", "rate_limited"],
|
|
10980
|
+
transport: "http",
|
|
10981
|
+
notes: "Cloud resolves the org's own Lexware contact itself; the contact is never client supplied. The list is complete (every page) or an error \u2014 never a truncated page a caller could mistake for the whole thing: more than 10,000 documents answers 503 list_limit_exceeded. A draft, a quotation, an order confirmation, a delivery note or a purchase voucher never appears; a voided document does. `complete: false` with `unsupported_count` set means a document of an unsupported type or status was skipped rather than listed. `available: false` when this cloud has no Lexware configured, its Lexware account failed the account check, or the org has no Lexware contact \u2014 then `documents` is always `[]`."
|
|
10982
|
+
},
|
|
10983
|
+
{
|
|
10984
|
+
method: "GET",
|
|
10985
|
+
path: "/api/billing/documents/:id",
|
|
10986
|
+
section: "billing",
|
|
10987
|
+
summary: "Reads one billing document, with its e-invoice profile and available files.",
|
|
10988
|
+
audience: "developer",
|
|
10989
|
+
auth: "developer",
|
|
10990
|
+
rateLimited: true,
|
|
10991
|
+
ownerTier: true,
|
|
10992
|
+
status: 200,
|
|
10993
|
+
params: [{ name: "id", description: "The Lexware voucher id from the document list." }],
|
|
10994
|
+
query: null,
|
|
10995
|
+
request: null,
|
|
10996
|
+
response: billingDocumentDetail,
|
|
10997
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "billing_documents_unavailable", "rate_limited", "not_found"],
|
|
10998
|
+
transport: "http",
|
|
10999
|
+
notes: "`404 not_found` for an id from another organization or a guessed id \u2014 indistinguishable from an unknown one. `NONE` is a plain PDF and not an e-invoice; `EN16931` (ZUGFeRD) is a PDF with the e-invoice embedded in it; `XRechnung` is an XML e-invoice with a PDF that is only a preview. `electronic_document_profile` is `null` for a bookkeeping voucher \u2014 it has none. A fresh list must still contain the id. `502 billing_documents_unavailable` with reason `unsupported_document` for an e-invoice profile this cloud does not know."
|
|
11000
|
+
},
|
|
11001
|
+
{
|
|
11002
|
+
method: "GET",
|
|
11003
|
+
path: "/api/billing/documents/:id/file",
|
|
11004
|
+
section: "billing",
|
|
11005
|
+
summary: "Downloads one billing document's file.",
|
|
11006
|
+
audience: "developer",
|
|
11007
|
+
auth: "developer",
|
|
11008
|
+
rateLimited: true,
|
|
11009
|
+
ownerTier: true,
|
|
11010
|
+
status: 200,
|
|
11011
|
+
params: [{ name: "id", description: "The Lexware voucher id from the document list." }],
|
|
11012
|
+
query: billingDocumentFileQuery,
|
|
11013
|
+
request: null,
|
|
11014
|
+
response: null,
|
|
11015
|
+
contentType: "application/pdf",
|
|
11016
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "billing_documents_unavailable", "rate_limited", "not_found", "validation_error"],
|
|
11017
|
+
transport: "http",
|
|
11018
|
+
notes: "`format=xml` answers `application/xml` for an `XRechnung` document only; every other document answers 404 for `format=xml`, because it has no XML to serve \u2014 a NONE document is a plain PDF and not an e-invoice, so it never has one either. `Cache-Control: no-store`; the bytes are streamed from Lexware and never persisted on this cloud's own side. 404 for a document of another organization or a guessed id \u2014 indistinguishable from an unknown one. A fresh list must still contain the id, and the org's Lexware contact is rechecked at file time, not only when the document was first listed. `502 billing_documents_unavailable` with reason `unsupported_document` when Lexware answers something that is not the document itself."
|
|
11019
|
+
},
|
|
11020
|
+
{
|
|
11021
|
+
method: "POST",
|
|
11022
|
+
path: "/api/billing/invoices/:id/pay",
|
|
11023
|
+
section: "billing",
|
|
11024
|
+
summary: "Records an owner-confirmed payment intent for an open invoice or due charge.",
|
|
11025
|
+
audience: "developer",
|
|
11026
|
+
auth: "developer",
|
|
11027
|
+
rateLimited: true,
|
|
11028
|
+
ownerTier: true,
|
|
11029
|
+
status: 201,
|
|
11030
|
+
params: [{ name: "id", description: "The invoice id, from `billingInvoice.id`, of the open invoice to pay \u2014 or, before the issuer cutover, a due charge's id, from `dunning.invoice_id`." }],
|
|
11031
|
+
query: null,
|
|
11032
|
+
request: invoicePayRequest,
|
|
11033
|
+
response: checkoutResponse,
|
|
11034
|
+
errors: ["validation_error", ...DEVELOPER_GUARD, "tier_required", "not_found", "target_state_conflict", "rate_limited", ...BILLING_OFF, ...MOLLIE],
|
|
11035
|
+
transport: "http",
|
|
11036
|
+
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."
|
|
11037
|
+
},
|
|
11038
|
+
{
|
|
11039
|
+
method: "POST",
|
|
11040
|
+
path: "/api/billing/charges/:id/pay",
|
|
11041
|
+
section: "billing",
|
|
11042
|
+
summary: "Records an owner-confirmed payment intent for a due Lexware-issuer charge.",
|
|
11043
|
+
audience: "developer",
|
|
11044
|
+
auth: "developer",
|
|
11045
|
+
rateLimited: true,
|
|
11046
|
+
ownerTier: true,
|
|
11047
|
+
status: 201,
|
|
11048
|
+
params: [{ name: "id", description: "The due charge id, from `billingCharge.id` in `GET /api/billing`'s `charges`." }],
|
|
11049
|
+
query: null,
|
|
11050
|
+
request: chargePayRequest,
|
|
11051
|
+
response: checkoutResponse,
|
|
11052
|
+
errors: ["validation_error", ...DEVELOPER_GUARD, "tier_required", "not_found", "target_state_conflict", "rate_limited", ...BILLING_OFF, ...MOLLIE],
|
|
11053
|
+
transport: "http",
|
|
11054
|
+
notes: "The required operation_key binds the org, charge and request, exactly like POST /api/billing/invoices/:id/pay; reuse with changed input is 409 target_state_conflict (purchaseConflictDetails). :id is a due charge's own id (billingCharge.id) \u2014 never a historical Cloud invoice; an invoice id, an unknown id or one from another org all answer 404 not_found alike. Recheck current buyer eligibility, the charge's own status and the owed amount before every new provider call: a charge already paid, cancelled or uncollectible is invoice_not_open, a typed 409 conflict. Pending/eligible/held has no redirect; after recovery the owner must confirm the current quote. Already-created payments retain their 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."
|
|
11055
|
+
},
|
|
11056
|
+
{
|
|
11057
|
+
method: "POST",
|
|
11058
|
+
path: "/api/billing/mollie/webhook",
|
|
11059
|
+
section: "billing",
|
|
11060
|
+
summary: "Takes Mollie's payment-changed notification and reconciles the payment.",
|
|
11061
|
+
audience: "internal",
|
|
11062
|
+
auth: "none",
|
|
11063
|
+
rateLimited: true,
|
|
11064
|
+
ownerTier: false,
|
|
11065
|
+
status: 200,
|
|
11066
|
+
params: [],
|
|
11067
|
+
query: null,
|
|
11068
|
+
request: null,
|
|
11069
|
+
response: null,
|
|
11070
|
+
errors: ["rate_limited"],
|
|
9222
11071
|
transport: "http",
|
|
9223
|
-
notes: "
|
|
11072
|
+
notes: "**The body is never trusted**: it names only a payment id (`id=tr_\u2026`, form-encoded, Mollie's own shape), and this route does nothing with it but call `reconcilePayment(deps, molliePaymentId)` \u2014 the same function `GET /api/billing/checkout/:id` and the hourly sweep call \u2014 which fetches the payment from Mollie itself and applies what Mollie says, idempotently. Rate limited on the `billing.webhook` bucket, per ip, 600/min \u2014 generous, because this is Mollie's own infrastructure calling, not a browser; over it the answer is `429 rate_limited`, and Mollie retries the notification later. **Every other answer is `200`**, including an id this cloud does not recognise, which is logged and otherwise ignored, **except a processing fault, which is `500`** so Mollie retries the notification rather than this cloud losing it. `auth: 'none'` because Mollie signs nothing Fleetless checks here \u2014 the payment is only ever trusted once fetched back from Mollie's own API with the configured key."
|
|
9224
11073
|
},
|
|
9225
11074
|
/* ------------------------------------------------- assets (robot upload) */
|
|
9226
11075
|
{
|
|
@@ -9381,16 +11230,16 @@ function createPublicAuthCalls(http, appIdentifier2) {
|
|
|
9381
11230
|
};
|
|
9382
11231
|
await http.request("/api/client/register", { method: "POST", skipAuth: true, expectEmptyBody: true, body });
|
|
9383
11232
|
},
|
|
9384
|
-
async resendVerification(
|
|
9385
|
-
const body = { app_identifier: appIdentifier2, email };
|
|
11233
|
+
async resendVerification(email2) {
|
|
11234
|
+
const body = { app_identifier: appIdentifier2, email: email2 };
|
|
9386
11235
|
await http.request("/api/client/resend-verification", { method: "POST", skipAuth: true, expectEmptyBody: true, body });
|
|
9387
11236
|
},
|
|
9388
|
-
async requestPasswordReset(
|
|
9389
|
-
const body = { app_identifier: appIdentifier2, email };
|
|
11237
|
+
async requestPasswordReset(email2) {
|
|
11238
|
+
const body = { app_identifier: appIdentifier2, email: email2 };
|
|
9390
11239
|
await http.request("/api/client/password/reset", { method: "POST", skipAuth: true, expectEmptyBody: true, body });
|
|
9391
11240
|
},
|
|
9392
|
-
async requestLoginCode(
|
|
9393
|
-
const body = { app_identifier: appIdentifier2, email };
|
|
11241
|
+
async requestLoginCode(email2) {
|
|
11242
|
+
const body = { app_identifier: appIdentifier2, email: email2 };
|
|
9394
11243
|
await http.request("/api/client/login/code", { method: "POST", skipAuth: true, expectEmptyBody: true, body });
|
|
9395
11244
|
}
|
|
9396
11245
|
};
|
|
@@ -9414,13 +11263,13 @@ function createSessionAuth(http, tokenStore, appIdentifier2) {
|
|
|
9414
11263
|
const result = await http.request("/api/client/verify-email", { method: "POST", skipAuth: true, body });
|
|
9415
11264
|
return completeSignIn(result);
|
|
9416
11265
|
},
|
|
9417
|
-
async login(
|
|
9418
|
-
const body = { app_identifier: appIdentifier2, email, password: password2 };
|
|
11266
|
+
async login(email2, password2) {
|
|
11267
|
+
const body = { app_identifier: appIdentifier2, email: email2, password: password2 };
|
|
9419
11268
|
const result = await http.request("/api/client/login", { method: "POST", skipAuth: true, body });
|
|
9420
11269
|
return completeSignIn(result);
|
|
9421
11270
|
},
|
|
9422
|
-
async verifyLoginCode(
|
|
9423
|
-
const body = { app_identifier: appIdentifier2, email, code };
|
|
11271
|
+
async verifyLoginCode(email2, code) {
|
|
11272
|
+
const body = { app_identifier: appIdentifier2, email: email2, code };
|
|
9424
11273
|
const result = await http.request("/api/client/login/code/verify", { method: "POST", skipAuth: true, body });
|
|
9425
11274
|
return completeSignIn(result);
|
|
9426
11275
|
},
|
|
@@ -9505,7 +11354,7 @@ function createSessionAuth(http, tokenStore, appIdentifier2) {
|
|
|
9505
11354
|
async signInMethods() {
|
|
9506
11355
|
const query = new URLSearchParams({ app_identifier: appIdentifier2 });
|
|
9507
11356
|
const response = await http.request(`/api/client/providers?${query.toString()}`, { skipAuth: true });
|
|
9508
|
-
return { password: response.sign_in_methods.password, emailCode: response.sign_in_methods.email_code };
|
|
11357
|
+
return { password: response.sign_in_methods.password, emailCode: response.sign_in_methods.email_code, twoFactor: response.two_factor };
|
|
9509
11358
|
},
|
|
9510
11359
|
async beginOidcLogin(input) {
|
|
9511
11360
|
const state = generateState();
|
|
@@ -9643,7 +11492,7 @@ function createServerKeyAuth(http, appIdentifier2, option = "serverKey") {
|
|
|
9643
11492
|
async signInMethods() {
|
|
9644
11493
|
const query = new URLSearchParams({ app_identifier: appIdentifier2 });
|
|
9645
11494
|
const response = await http.request(`/api/client/providers?${query.toString()}`, { skipAuth: true });
|
|
9646
|
-
return { password: response.sign_in_methods.password, emailCode: response.sign_in_methods.email_code };
|
|
11495
|
+
return { password: response.sign_in_methods.password, emailCode: response.sign_in_methods.email_code, twoFactor: response.two_factor };
|
|
9647
11496
|
},
|
|
9648
11497
|
async beginOidcLogin() {
|
|
9649
11498
|
serverKeyRefusal("beginOidcLogin", "a federated sign-in is inherently an app user's browser flow");
|