Generated from services/fleetd/packages/contracts/src/setup.ts at
41af2124Definitions#
All code blocks below are TypeScript declarations copied from the server. They document validation, not JSON to send or code to paste into a chat. Clients can use any HTTP library without importing these declarations. check.object rejects unknown fields. Custom functions and refinements specify additional checks.
Imported definitions#
services/crossfire/packages/contracts/src/schema/validation.tsservices/crossfire/packages/kernel/src/result.tsservices/crossfire/packages/contracts/src/onboarding.tsservices/crossfire/packages/contracts/src/origin.ts
setupInput#
setupInput = check.object({ descriptor: setupDescriptorSchema, workspace: check.text(4096), configuration: check.optional(check.text(4096)) })Related definitions:
SetupInput#
export type SetupInput = check.Parsed<typeof setupInput>;Related definitions:
descriptorUrl#
export function descriptorUrl(value: string): Result<URL> {
try {
const url = new URL(value), trusted = endpoint(url.origin), owner = check.backendUserId(url.searchParams.get('ownerBackendUserId'));
if (!trusted.ok)
return trusted;
if (!owner.ok)
return owner;
if (url.pathname !== '/onboarding/setup.json' || url.username || url.password || url.hash || [...url.searchParams.keys()].length !== 1
|| url.searchParams.getAll('ownerBackendUserId').length !== 1)
return failure('invalid', 'Use the personalized Crossfire setup descriptor URL');
return success(url);
}
catch {
return failure('invalid', 'Invalid Crossfire setup descriptor URL');
}
}Related definitions: