Generated from services/fleetd/node/packages/contracts/src/setup.ts at
52bf0279Definitions#
These TypeScript definitions document server validation. check.object rejects unknown fields. Custom functions and refinements specify additional checks.
Imported definitions#
services/crossfire/node/packages/contracts/src/schema/validation.tsservices/crossfire/node/packages/kernel/src/result.tsservices/crossfire/node/packages/contracts/src/onboarding.tsservices/crossfire/node/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.matrixUserId(url.searchParams.get('ownerMatrixId'));
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('ownerMatrixId').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: