@deadair/sdk 0.13.3 → 0.15.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/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/sdk-options.ts","../src/activity/types/activity.types.ts","../src/activity/activity.client.ts","../src/art/art.client.ts","../src/authentication/types/authentication.types.ts","../src/authentication/authentication.apikeys.client.ts","../src/authentication/types/registration.types.ts","../src/authentication/authentication.factor.client.ts","../src/authentication/authentication.sessions.client.ts","../src/authentication/authentication.client.ts","../src/catalog/types/catalog.types.ts","../src/catalog/catalog.client.ts","../src/charts/charts.client.ts","../src/director/director.client.ts","../src/history/types/history.types.ts","../src/history/history.client.ts","../src/news/news.client.ts","../src/nowplaying/nowplaying.client.ts","../src/onboarding/onboarding.client.ts","../src/personas/personas.client.ts","../src/playlists/playlists.client.ts","../src/playout/playout.client.ts","../src/plugins/types/plugins.types.ts","../src/plugins/plugins.client.ts","../src/podcasts/podcasts.client.ts","../src/productions/types/productions.types.ts","../src/productions/productions.client.ts","../src/render/types/render.types.ts","../src/render/render.client.ts","../src/schedule/schedule.client.ts","../src/settings/settings.client.ts","../src/station/types/logs.types.ts","../src/station/types/station.types.ts","../src/station/types/traces.types.ts","../src/station/station.client.ts","../src/storage/types/storage.types.ts","../src/storage/storage.client.ts","../src/stream/stream.client.ts","../src/topics/topics.client.ts","../src/deadair.sdk.ts"],"sourcesContent":["export class SdkError<TBody = unknown> extends Error {\n constructor(\n public readonly status: number,\n public readonly statusText: string,\n public readonly body: TBody,\n public readonly headers: Headers,\n ) {\n super(`${status} ${statusText}`);\n this.name = 'SdkError';\n }\n}\n\nexport interface SdkRequestInit extends RequestInit {\n /**\n * Statuses this operation declares as values rather than errors — a 304 from\n * conditional-GET middleware, or an error status the service returns deliberately.\n * Anything else at or above 400 still throws SdkError.\n */\n expectStatuses?: number[];\n}\n\nexport type SdkFetch = (url: string, init: SdkRequestInit) => Promise<Response>;\n\nexport interface SdkOptions {\n baseUrl: string;\n headers?: Record<string, string> | (() => Record<string, string> | Promise<Record<string, string>>);\n fetch?: SdkFetch;\n /** Called once per request to produce a unique X-Request-ID header value */\n requestIdFactory?: () => string;\n}\n\nexport const bigIntReplacer = (_: string, value: any): any => {\n if (typeof value === 'bigint') {\n return value.toString() + 'n';\n }\n return value;\n};\n\nexport const bigIntReviver = (_: string, value: any): any => {\n if (typeof value === 'string' && /^-?\\d+n$/.test(value)) {\n return BigInt(value.slice(0, -1));\n }\n return value;\n};\n\nexport type JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue };\n\nexport function readContentType(res: Response): string {\n return res.headers.get('content-type')?.split(';')[0]?.trim() ?? '';\n}\n\n/** A v4 UUID. `crypto.randomUUID` exists only in a secure context, so plain HTTP builds one by hand. */\nfunction randomRequestId(): string {\n if (typeof crypto.randomUUID === 'function') return crypto.randomUUID();\n const bytes = crypto.getRandomValues(new Uint8Array(16));\n bytes[6] = (bytes[6]! & 0x0f) | 0x40;\n bytes[8] = (bytes[8]! & 0x3f) | 0x80;\n const hex = Array.from(bytes, b => b.toString(16).padStart(2, '0')).join('');\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;\n}\n\nexport function createSdkFetch(options: SdkOptions): SdkFetch {\n const getRequestId = options.requestIdFactory ?? randomRequestId;\n return async (url: string, init: SdkRequestInit): Promise<Response> => {\n const baseHeaders = typeof options.headers === 'function' ? await options.headers() : (options.headers ?? {});\n const res = await fetch(`${options.baseUrl}${url}`, {\n ...init,\n headers: { ...baseHeaders, 'X-Request-ID': getRequestId(), ...(init.headers as Record<string, string>) },\n });\n if (!res.ok && !(init.expectStatuses ?? []).includes(res.status)) {\n const text = await res.text();\n let body: unknown;\n try {\n body = JSON.parse(text);\n } catch {\n body = text;\n }\n throw new SdkError(res.status, res.statusText, body, res.headers);\n }\n return res;\n };\n}\n\nexport function buildQueryString(query: object | undefined): string {\n const searchParams = new URLSearchParams();\n if (query) {\n for (const [k, v] of Object.entries(query)) {\n if (v === undefined || v === null) continue;\n if (Array.isArray(v)) {\n for (const item of v) searchParams.append(k, String(item));\n } else searchParams.set(k, String(v));\n }\n }\n const qs = searchParams.toString();\n return qs ? `?${qs}` : '';\n}\n\nexport function buildHeaders(headers: object | undefined): Record<string, string> {\n const out: Record<string, string> = {};\n if (headers) {\n for (const [k, v] of Object.entries(headers)) {\n if (v === undefined || v === null) continue;\n out[k] = Array.isArray(v) ? v.map(String).join(', ') : String(v);\n }\n }\n return out;\n}\n\nexport function parseBigIntHeader(name: string, value: string): bigint {\n if (/^-?\\d+n?$/.test(value)) return BigInt(value.replace(/n$/, ''));\n throw new Error(`Response header '${name}' is not a bigint: ${JSON.stringify(value)}`);\n}\n\n/**\n * Read a JSON response body.\n *\n * No reviver: `bigIntReviver` matches any string of the form `123n` anywhere in the\n * document, so a contract with no bigint field would still have a legitimate string like\n * \"123n\" silently turned into a BigInt. Clients whose contracts do use bigint import\n * `parseJsonWithBigInt` under this name instead.\n */\nexport async function parseJson<T>(res: Response): Promise<T> {\n return JSON.parse(await res.text()) as T;\n}\n\n/** `parseJson` for contracts that declare a bigint, applying the `123n` reviver. */\nexport async function parseJsonWithBigInt<T>(res: Response): Promise<T> {\n return JSON.parse(await res.text(), bigIntReviver) as T;\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * Which part of the station an entry came from, and the console's one filter axis\n * generated from [ActivityModule](../../../../../apps/api/data/contracts/activity/activity.types.ck#L8)\n */\nexport type ActivityModule = 'playout' | 'director' | 'render' | 'catalog' | 'plugins';\n\n/**\n * How an entry reads, not how bad it is. There is deliberately no `waiting`: a station idling for\n * want of a listener says so in its own words and stays `info`, for the same reason the transport\n * reports it as `ready` rather than as a mild fault\n * generated from [ActivitySeverity](../../../../../apps/api/data/contracts/activity/activity.types.ck#L13)\n */\nexport type ActivitySeverity = 'info' | 'warn' | 'fault';\n\n/**\n * One thing that happened, from whichever of the feed's sources holds it\n * generated from [ActivityEntry](../../../../../apps/api/data/contracts/activity/activity.types.ck#L15)\n */\nexport interface ActivityEntry {\n /** Unique across the whole feed, and half of the cursor below */\n id: string;\n /** When it happened, as the database recorded it */\n at: DateTime;\n module: ActivityModule;\n /** Dotted and stable: `silence.cause`, `air.on`, `segment.ready`, `track.aired`. What a console draws a line with, never something a decision is made on */\n kind: string;\n severity: ActivitySeverity;\n /** The sentence a person reads, phrased by whatever produced it */\n detail: string;\n /** The structured half, for a reader that wants to filter or chart rather than read */\n data?: Record<string, unknown>;\n /** The segment this is about, for an entry that came from one */\n segmentId?: string;\n /** The catalog track this is about, for an entry that came from one */\n trackId?: string;\n}\n\n/** Rehydrates every wire-encoded scalar in a ActivityEntry into its runtime type. Mutates and returns `raw`. */\nexport function reviveActivityEntry(raw: ActivityEntry): ActivityEntry {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['at'] = __dt(__o0['at'], 'ActivityEntry.at');\n return raw;\n}\n\n/**\n * One page of the feed, newest first\n * generated from [ActivityQuery](../../../../../apps/api/data/contracts/activity/activity.types.ck#L27)\n */\nexport interface ActivityQuery {\n limit?: number;\n /** Where the previous page ended. Opaque, and a keyset rather than an offset because rows arrive at the head continuously: an offset would re-show a row on every page as the feed grew under it. Pass back whatever `nextBefore` said and nothing else */\n before?: string;\n module?: ActivityModule;\n /** The floor, not the exact match: `warn` answers with warnings and faults. Absent is everything */\n minSeverity?: ActivitySeverity;\n}\n\n/**\n * generated from [ActivityPage](../../../../../apps/api/data/contracts/activity/activity.types.ck#L34)\n */\nexport interface ActivityPage {\n entries: ActivityEntry[];\n /** The cursor for the page after this one, absent once the feed has been read to its end */\n nextBefore?: string;\n}\n\n/** Rehydrates every wire-encoded scalar in a ActivityPage into its runtime type. Mutates and returns `raw`. */\nexport function reviveActivityPage(raw: ActivityPage): ActivityPage {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['entries'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveActivityEntry(__a1[__i2] as never);\n }\n }\n return raw;\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson, buildQueryString } from '../sdk-options.js';\nimport type { ActivityPage, ActivityQuery } from './types/activity.types.js';\nimport { reviveActivityPage } from './types/activity.types.js';\n\nexport class ActivityClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name Read activity\n * @description The feed, newest first, one page at a time\n */\n async readActivity(query?: ActivityQuery): Promise<ActivityPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/activity${qs}`, {\n method: 'GET',\n });\n return reviveActivityPage(await parseJson<ActivityPage>(result));\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { readContentType } from '../sdk-options.js';\n\nexport class ArtClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name Get art\n * @description The bytes of one cached image, addressed by its id alone\n */\n async getArt(id: string): Promise<\n | {\n status: 200;\n contentType: 'image/jpeg' | 'image/png' | 'image/webp' | 'image/gif';\n data: Blob;\n headers: { cacheControl?: string; etag?: string };\n }\n | { status: 304 }\n > {\n const result = await this.fetch(`/art/${encodeURIComponent(id)}`, {\n method: 'GET',\n expectStatuses: [304],\n });\n switch (result.status) {\n case 304:\n return { status: 304 };\n default:\n return {\n status: 200,\n contentType: readContentType(result) as 'image/jpeg' | 'image/png' | 'image/webp' | 'image/gif',\n data: await result.blob(),\n headers: { cacheControl: result.headers.get('cache-control') ?? undefined, etag: result.headers.get('etag') ?? undefined },\n };\n }\n }\n\n /**\n * @name Get art file\n * @description The bytes of one cached image, under any filename\n */\n async getArtFile(\n id: string,\n filename: string,\n ): Promise<\n | {\n status: 200;\n contentType: 'image/jpeg' | 'image/png' | 'image/webp' | 'image/gif';\n data: Blob;\n headers: { cacheControl?: string; etag?: string };\n }\n | { status: 304 }\n > {\n const result = await this.fetch(`/art/${encodeURIComponent(id)}/${encodeURIComponent(filename)}`, {\n method: 'GET',\n expectStatuses: [304],\n });\n switch (result.status) {\n case 304:\n return { status: 304 };\n default:\n return {\n status: 200,\n contentType: readContentType(result) as 'image/jpeg' | 'image/png' | 'image/webp' | 'image/gif',\n data: await result.blob(),\n headers: { cacheControl: result.headers.get('cache-control') ?? undefined, etag: result.headers.get('etag') ?? undefined },\n };\n }\n }\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * Denotes the authorization flow to use\n * generated from [AuthenticationGrantType](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L7)\n */\nexport type AuthenticationGrantType = 'client_credentials' | 'password' | 'refresh_token' | 'link' | 'code' | 'fido' | 'authenticator' | 'oidc';\n\n/**\n * Denotes the authorization flow to use\n * generated from [PasswordlessAuthenticationGrantType](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L18)\n */\nexport type PasswordlessAuthenticationGrantType = 'link' | 'code' | 'fido' | 'oidc';\n\n/**\n * The type of the factor\n * generated from [AuthenticationFactorMethod](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L20)\n */\nexport type AuthenticationFactorMethod = 'phone' | 'password' | 'email' | 'authenticator' | 'fido' | 'oidc';\n\n/**\n * The kind of the factor\n * generated from [AuthenticationFactorKind](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L22)\n */\nexport type AuthenticationFactorKind = 'knowledge' | 'possession' | 'biometric';\n\n/**\n * The OIDC identity provider\n * generated from [OidcProvider](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L24)\n */\nexport type OidcProvider = 'google';\n\n/**\n * Represents an authentication token\n * generated from [AuthenticationToken](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L84)\n */\nexport interface AuthenticationToken {\n /** The access token string as issued by the authorization server */\n accessToken: string;\n /** A refresh token which applications can use to obtain another access token */\n refreshToken?: string;\n /** Unix timestamp (seconds) when the access token expires */\n expiresIn: number;\n /** The type of token this is, typically just the string *Bearer* */\n tokenType: string;\n /** Space-separated list of scopes granted to this token */\n scope: string;\n}\n\nexport interface AuthenticationTokenOutput {\n /** The access token string as issued by the authorization server */\n access_token: string;\n /** A refresh token which applications can use to obtain another access token */\n refresh_token?: string;\n /** Unix timestamp (seconds) when the access token expires */\n expires_in: number;\n /** The type of token this is, typically just the string *Bearer* */\n token_type: string;\n /** Space-separated list of scopes granted to this token */\n scope: string;\n}\n\n/**\n * Issued-token arm of /auth/token response\n * generated from [AuthenticationTokenIssued](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L92)\n */\nexport interface AuthenticationTokenIssued {\n /** Discriminator */\n result: 'token';\n /** The access token string as issued by the authorization server */\n accessToken: string;\n /** A refresh token which applications can use to obtain another access token */\n refreshToken?: string;\n /** Unix timestamp (seconds) when the access token expires */\n expiresIn: number;\n /** The type of token this is, typically just the string *Bearer* */\n tokenType: string;\n /** Space-separated list of scopes granted to this token */\n scope: string;\n}\n\nexport interface AuthenticationTokenIssuedOutput {\n /** Discriminator */\n result: 'token';\n /** The access token string as issued by the authorization server */\n access_token: string;\n /** A refresh token which applications can use to obtain another access token */\n refresh_token?: string;\n /** Unix timestamp (seconds) when the access token expires */\n expires_in: number;\n /** The type of token this is, typically just the string *Bearer* */\n token_type: string;\n /** Space-separated list of scopes granted to this token */\n scope: string;\n}\n\n/**\n * Returned by /auth/step-up/start when no enrolled factor satisfies the requirement. The SPA should drive the user through enrollment and retry the gated action afterwards.\n * generated from [EnrollmentRequiredResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L115)\n */\nexport interface EnrollmentRequiredResponse {\n /** Discriminator */\n result: 'enrollment_required';\n}\n\nexport interface EnrollmentRequiredResponseOutput {\n /** Discriminator */\n result: 'enrollment_required';\n}\n\n/**\n * Represents a common shape of a `PublicKeyCredential` after the client serializes the `id` and `rawId` fields to base64 strings for transport\n * generated from [PublicKeyCredential](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L123)\n */\nexport interface PublicKeyCredential {\n /** The base64url encoding of `rawId` */\n id: string;\n /** This enumeration defines the valid credential types. It is an extension point; values can be added to it in the future, as more credential types are defined. The values of this enumeration are used for versioning the Authentication Assertion and attestation structures according to the type of the authenticator. Currently one credential type is defined, namely `public-key`. */\n type: 'public-key';\n /** The credential identifier */\n rawId: string;\n /** The authenticator attachment */\n authenticatorAttachment?: 'cross-platform' | 'platform';\n}\n\n/**\n * Subset of the WebAuthn client extension results the service round-trips\n * generated from [SimpleClientExtensionResults](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L130)\n */\nexport interface SimpleClientExtensionResults {\n /** Whether the client is an application */\n appid?: boolean;\n /** Whether the client is excluded from appid verification */\n appidExclude?: boolean;\n credProps?: { rk: boolean };\n}\n\n/**\n * generated from [FidoAuthenticatorAssertionResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L138)\n */\nexport interface FidoAuthenticatorAssertionResponse {\n /** The client data JSON */\n clientDataJSON: string;\n /** The authenticator data */\n authenticatorData: string;\n /** The signature */\n signature: string;\n /** The user handle */\n userHandle?: string;\n}\n\n/**\n * generated from [AuthenticationRegistration](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L150)\n */\nexport interface AuthenticationRegistration {\n /** The registration identifier */\n registrationId: string;\n /** The registration expiration timestamp */\n expiresAt: DateTime;\n}\n\nexport interface AuthenticationRegistrationInput {\n /** User's email address */\n email: string;\n /** optionally set a password for the user */\n password?: string;\n}\n\n/** Rehydrates every wire-encoded scalar in a AuthenticationRegistration into its runtime type. Mutates and returns `raw`. */\nexport function reviveAuthenticationRegistration(raw: AuthenticationRegistration): AuthenticationRegistration {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'AuthenticationRegistration.expiresAt');\n return raw;\n}\n\n/**\n * generated from [AuthenticationRegistrationVerification](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L157)\n */\nexport interface AuthenticationRegistrationVerification {\n /** The registration identifier */\n registrationId: string;\n /** The verification code */\n code: string;\n}\n\n/**\n * A credential the relying party expects the user to be able to present\n * generated from [PublicKeyCredentialDescriptor](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L191)\n */\nexport interface PublicKeyCredentialDescriptor {\n /** The credential type — currently always `public-key` */\n type: 'public-key';\n /** The base64url-encoded credential identifier */\n id: string;\n /** Transports the authenticator advertises */\n transports?: ('usb' | 'nfc' | 'ble' | 'internal' | 'hybrid')[];\n}\n\n/**\n * The transport used by the authenticator\n * generated from [FidoAuthenticatorTransport](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L235)\n */\nexport type FidoAuthenticatorTransport = 'hybrid' | 'ble' | 'internal' | 'nfc' | 'usb';\n\n/**\n * Response from `/auth/login/oidc/start` instructing the client to navigate to `authorize_url`\n * generated from [OidcLoginStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L260)\n */\nexport interface OidcLoginStartResponse {\n /** Fully-formed authorize URL the user-agent should be redirected to */\n authorize_url: string;\n /** Opaque state token bound to this authorization round-trip */\n state: string;\n /** When the cached state record expires */\n expires_at: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a OidcLoginStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveOidcLoginStartResponse(raw: OidcLoginStartResponse): OidcLoginStartResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expires_at'] = __dt(__o0['expires_at'], 'OidcLoginStartResponse.expires_at');\n return raw;\n}\n\n/**\n * Request to complete an OIDC sign-in flow\n * generated from [OidcLoginCallback](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L266)\n */\nexport interface OidcLoginCallback {\n /** The issuer of the token */\n iss?: string;\n /** The scope of the token */\n scope?: string;\n /** The user ID */\n authuser?: string;\n /** The host domain */\n hd?: string;\n /** The prompt of the token */\n prompt?: string;\n /** The authorization code returned by the IdP (absent when the IdP rejected the request) */\n code?: string;\n /** The opaque state token bound to the original authorize request */\n state?: string;\n /** OAuth 2.0 error code per RFC 6749 §4.1.2.1 (e.g. access_denied) */\n error?: string;\n /** Human-readable explanation of `error` */\n error_description?: string;\n /** URL to a page describing `error` */\n error_uri?: string;\n}\n\n/**\n * Issue a phone SMS challenge during a pending MFA round\n * generated from [FactorChallengePhoneStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L279)\n */\nexport interface FactorChallengePhoneStart {\n /** Discriminator */\n method: 'phone';\n /** Delivery channel — only `sms` is supported in this phase */\n transport: 'sms';\n /** The MFA challenge to which this factor challenge is bound */\n mfa_challenge_id: string;\n}\n\n/**\n * Issue a WebAuthn assertion challenge during a pending MFA round\n * generated from [FactorChallengeFidoStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L285)\n */\nexport interface FactorChallengeFidoStart {\n /** Discriminator */\n method: 'fido';\n /** The MFA challenge to which this factor challenge is bound */\n mfa_challenge_id: string;\n}\n\n/**\n * Issue an email one-time-code challenge during a pending MFA round. Always a code: a magic link cannot complete an MFA round, since the `code` grant that redeems one takes `code(min=6, max=10)` and a link token is 43 characters\n * generated from [FactorChallengeEmailStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L290)\n */\nexport interface FactorChallengeEmailStart {\n /** Discriminator */\n method: 'email';\n /** The MFA challenge to which this factor challenge is bound */\n mfa_challenge_id: string;\n}\n\n/**\n * Response for a phone SMS challenge\n * generated from [FactorChallengePhoneStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L297)\n */\nexport interface FactorChallengePhoneStartResponse {\n /** Discriminator */\n method: 'phone';\n /** Echo of the chosen delivery channel */\n transport: 'sms';\n /** The phone-factor challenge id — echo back on the `code` grant as `challenge_id` */\n phoneChallengeId: string;\n /** When the phone challenge expires */\n expiresAt: DateTime;\n}\n\nexport interface FactorChallengePhoneStartResponseOutput {\n /** Discriminator */\n method: 'phone';\n /** Echo of the chosen delivery channel */\n transport: 'sms';\n /** The phone-factor challenge id — echo back on the `code` grant as `challenge_id` */\n phone_challenge_id: string;\n /** When the phone challenge expires */\n expires_at: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a FactorChallengePhoneStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveFactorChallengePhoneStartResponse(raw: FactorChallengePhoneStartResponse): FactorChallengePhoneStartResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'FactorChallengePhoneStartResponse.expiresAt');\n return raw;\n}\n\n/** Rehydrates every wire-encoded scalar in a FactorChallengePhoneStartResponseOutput into its runtime type. Mutates and returns `raw`. */\nexport function reviveFactorChallengePhoneStartResponseOutput(raw: FactorChallengePhoneStartResponseOutput): FactorChallengePhoneStartResponseOutput {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expires_at'] = __dt(__o0['expires_at'], 'FactorChallengePhoneStartResponse.expires_at');\n return raw;\n}\n\n/**\n * Response for an email one-time-code challenge\n * generated from [FactorChallengeEmailStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L311)\n */\nexport interface FactorChallengeEmailStartResponse {\n /** Discriminator */\n method: 'email';\n /** The email-factor challenge id — echo back on the `code` grant as `challenge_id` */\n emailChallengeId: string;\n /** When the email challenge expires */\n expiresAt: DateTime;\n}\n\nexport interface FactorChallengeEmailStartResponseOutput {\n /** Discriminator */\n method: 'email';\n /** The email-factor challenge id — echo back on the `code` grant as `challenge_id` */\n email_challenge_id: string;\n /** When the email challenge expires */\n expires_at: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a FactorChallengeEmailStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveFactorChallengeEmailStartResponse(raw: FactorChallengeEmailStartResponse): FactorChallengeEmailStartResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'FactorChallengeEmailStartResponse.expiresAt');\n return raw;\n}\n\n/** Rehydrates every wire-encoded scalar in a FactorChallengeEmailStartResponseOutput into its runtime type. Mutates and returns `raw`. */\nexport function reviveFactorChallengeEmailStartResponseOutput(raw: FactorChallengeEmailStartResponseOutput): FactorChallengeEmailStartResponseOutput {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expires_at'] = __dt(__o0['expires_at'], 'FactorChallengeEmailStartResponse.expires_at');\n return raw;\n}\n\n/**\n * A factor satisfied by the session\n * generated from [SessionFactor](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L325)\n */\nexport interface SessionFactor {\n /** The verification method */\n method: 'phone' | 'password' | 'authenticator' | 'email' | 'fido' | 'oidc';\n /** Stable identifier for the specific factor record */\n methodId: string;\n /** MFA category for the factor */\n kind: 'knowledge' | 'possession' | 'biometric';\n /** When this factor entry was first added to the session */\n issuedAt: DateTime;\n /** When the factor was most recently re-verified */\n authenticatedAt: DateTime;\n}\n\nexport interface SessionFactorInput {\n /** The verification method */\n method: 'phone' | 'password' | 'authenticator' | 'email' | 'fido' | 'oidc';\n /** Stable identifier for the specific factor record */\n methodId: string;\n /** MFA category for the factor */\n kind: 'knowledge' | 'possession' | 'biometric';\n}\n\n/** Rehydrates every wire-encoded scalar in a SessionFactor into its runtime type. Mutates and returns `raw`. */\nexport function reviveSessionFactor(raw: SessionFactor): SessionFactor {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['issuedAt'] = __dt(__o0['issuedAt'], 'SessionFactor.issuedAt');\n __o0['authenticatedAt'] = __dt(__o0['authenticatedAt'], 'SessionFactor.authenticatedAt');\n return raw;\n}\n\n/**\n * Optional metadata supplied to a revoke action\n * generated from [SessionRevoke](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L345)\n */\nexport interface SessionRevoke {\n /** Free-form reason recorded with the revoke */\n reason?: string | null;\n}\n\n/**\n * A platform-wide role held on `platform:main`. `admin` grants every operation; `listener` grants the reads\n * generated from [PlatformRole](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L350)\n */\nexport type PlatformRole = 'admin' | 'listener';\n\n/**\n * A successful authentication record\n * generated from [Login](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L357)\n */\nexport interface Login {\n /** The login event identifier */\n id: bigint;\n /** The actor that authenticated */\n actorId: string;\n /** The factor that satisfied the primary authentication, or `apikey` for a request made with one of the account's API keys */\n factorType: 'phone' | 'password' | 'authenticator' | 'email' | 'fido' | 'oidc' | 'apikey';\n /** The specific factor record id, when available */\n factorId?: string | null;\n /** The session minted at this login, when available */\n sessionToken?: string | null;\n /** Whether MFA was required and satisfied at login */\n mfaSatisfied: boolean;\n /** IP address recorded at login */\n ip?: string | null;\n /** User agent recorded at login */\n userAgent?: string | null;\n /** When the login occurred */\n occurredAt: DateTime;\n}\n\nexport interface LoginInput {}\n\n/** Rehydrates every wire-encoded scalar in a Login into its runtime type. Mutates and returns `raw`. */\nexport function reviveLogin(raw: Login): Login {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['occurredAt'] = __dt(__o0['occurredAt'], 'Login.occurredAt');\n return raw;\n}\n\n/**\n * The current user's display preferences, auto-detected by the SPA from the browser (Intl timezone + navigator.language). Omitted fields are left unchanged (absent = never set).\n * generated from [ActorPreferences](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L377)\n */\nexport interface ActorPreferences {\n /** RFC 5646 locale, e.g. \"en-US\" */\n locale?: string;\n /** Olson timezone, e.g. \"America/New_York\" */\n timezone?: string;\n}\n\n/**\n * What an API key may be granted. `view` covers every route a listener may read; `manage` covers the rest, and includes `view`\n * generated from [ApiKeyScope](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L383)\n */\nexport type ApiKeyScope = 'view' | 'manage';\n\n/**\n * generated from [BaseAuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L26)\n */\nexport interface BaseAuthenticationRequest {\n /** The grant type for the request */\n grant_type: AuthenticationGrantType;\n /** The scope of the request */\n scope?: string;\n /** The application's client identifier, if available */\n client_id?: string;\n}\n\n/**\n * generated from [BaseAuthenticationLoginStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L162)\n */\nexport interface BaseAuthenticationLoginStart {\n /** The grant type for the request */\n grant_type: PasswordlessAuthenticationGrantType;\n /** The application's client identifier, if available */\n client_id?: string;\n}\n\n/**\n * generated from [BaseAuthenticationLoginStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L197)\n */\nexport interface BaseAuthenticationLoginStartResponse {\n /** The grant type for the response */\n grant_type: PasswordlessAuthenticationGrantType;\n /** The challenge identifier */\n challengeId: string;\n /** The challenge expiration timestamp */\n expiresAt: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a BaseAuthenticationLoginStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveBaseAuthenticationLoginStartResponse(raw: BaseAuthenticationLoginStartResponse): BaseAuthenticationLoginStartResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'BaseAuthenticationLoginStartResponse.expiresAt');\n return raw;\n}\n\n/**\n * A factor the SPA may use to satisfy the MFA challenge\n * generated from [MfaChallengeFactor](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L101)\n */\nexport interface MfaChallengeFactor {\n /** The factor method */\n method: AuthenticationFactorMethod;\n /** The id of the enrolled factor (opaque to the SPA, must be echoed back in the proof for methods that don't bind another way) */\n methodId: string;\n /** The factor kind (knowledge, possession, biometric) — the SPA filters against step-up `acceptableKinds`/`excludeKinds` hints */\n kind: AuthenticationFactorKind;\n /** Optional human-readable label (e.g. provider name for OIDC, friendly name for FIDO) */\n label?: string;\n}\n\nexport interface MfaChallengeFactorOutput {\n /** The factor method */\n method: AuthenticationFactorMethod;\n /** The id of the enrolled factor (opaque to the SPA, must be echoed back in the proof for methods that don't bind another way) */\n method_id: string;\n /** The factor kind (knowledge, possession, biometric) — the SPA filters against step-up `acceptableKinds`/`excludeKinds` hints */\n kind: AuthenticationFactorKind;\n /** Optional human-readable label (e.g. provider name for OIDC, friendly name for FIDO) */\n label?: string;\n}\n\n/**\n * generated from [AuthenticationFactor](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L248)\n */\nexport interface AuthenticationFactor {\n /** The method of the factor */\n method: AuthenticationFactorMethod;\n /** The kind of the factor */\n kind: AuthenticationFactorKind;\n /** The method identifier */\n methodId: string;\n /** The label for the factor */\n label?: string;\n}\n\n/**\n * Mint a fresh MFA challenge for the current session so the SPA can satisfy a `step_up_required` denial. Filters mirror `StepUpRequirement` from `@maroonedsoftware/policies`.\n * generated from [StepUpStartRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L319)\n */\nexport interface StepUpStartRequest {\n /** If set, only these factor methods are listed as eligible */\n acceptableMethods?: AuthenticationFactorMethod[];\n /** If set, only these factor kinds are listed as eligible */\n acceptableKinds?: AuthenticationFactorKind[];\n /** If set, factors with these methods are never listed */\n excludeMethods?: AuthenticationFactorMethod[];\n}\n\n/**\n * Request to begin an OIDC sign-in flow\n * generated from [OidcLoginStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L255)\n */\nexport interface OidcLoginStart {\n /** The IdP to authorize against */\n provider: OidcProvider;\n /** Optional URL the SPA wants the callback to land on after token issuance */\n redirect_after?: string;\n}\n\n/**\n * generated from [PublicKeyCredentialWithAssertion](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L145)\n */\nexport interface PublicKeyCredentialWithAssertion extends PublicKeyCredential {\n /** The client extension results */\n clientExtensionResults: SimpleClientExtensionResults;\n /** The authenticator assertion response */\n response: FidoAuthenticatorAssertionResponse;\n}\n\n/**\n * generated from [FidoPublicKeyCredentialRequestOptions](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L211)\n */\nexport interface FidoPublicKeyCredentialRequestOptions {\n challenge: string;\n /** WebAuthn timeout hint in milliseconds */\n timeout?: number;\n rpId?: string;\n /** The attestation */\n attestation?: 'direct' | 'indirect' | 'none';\n /** Whether the authenticator must verify the user */\n userVerification?: 'required' | 'preferred' | 'discouraged';\n /** The raw challenge */\n rawChallenge?: Blob;\n extensions?: Record<string, unknown>;\n allowCredentials?: PublicKeyCredentialDescriptor[];\n}\n\n/**\n * Serialized form of `AuthenticatorAttestationResponse` — produced by the browser at registration; all binary fields are base64-encoded for transport\n * generated from [FidoAuthenticatorAttestationResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L237)\n */\nexport interface FidoAuthenticatorAttestationResponse {\n /** The client data JSON */\n clientDataJSON: string;\n /** The attestation object */\n attestationObject: string;\n /** The transports used by the authenticator */\n transports?: FidoAuthenticatorTransport[];\n}\n\n/**\n * generated from [FactorChallengeStartRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L295)\n */\nexport type FactorChallengeStartRequest = FactorChallengePhoneStart | FactorChallengeFidoStart | FactorChallengeEmailStart;\n\n/**\n * An active authentication session\n * generated from [Session](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L333)\n */\nexport interface Session {\n /** Opaque session token used as the cache key and embedded in JWTs */\n sessionToken: string;\n /** The actor that owns this session */\n actorId: string;\n /** When the session was originally issued */\n issuedAt: DateTime;\n /** When the session expires */\n expiresAt: DateTime;\n /** When the session was last accessed */\n lastAccessedAt: DateTime;\n /** Factors that have been satisfied in this session */\n factors: SessionFactor[];\n /** IP address recorded when the session was created */\n ip?: string | null;\n /** User agent recorded when the session was created */\n userAgent?: string | null;\n /** True when this session matches the requesting session */\n isCurrent: boolean;\n}\n\nexport interface SessionInput {}\n\n/** Rehydrates every wire-encoded scalar in a Session into its runtime type. Mutates and returns `raw`. */\nexport function reviveSession(raw: Session): Session {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['issuedAt'] = __dt(__o0['issuedAt'], 'Session.issuedAt');\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'Session.expiresAt');\n __o0['lastAccessedAt'] = __dt(__o0['lastAccessedAt'], 'Session.lastAccessedAt');\n {\n const __a1 = __o0['factors'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveSessionFactor(__a1[__i2] as never);\n }\n }\n return raw;\n}\n\n/**\n * Who the caller is, as the station sees them\n * generated from [AuthSession](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L352)\n */\nexport interface AuthSession {\n /** The actor the session belongs to */\n actorId: string;\n /** Every platform role the caller holds, sorted. Empty for an account nobody has granted one, which today is any account that did not come in through onboarding */\n roles: PlatformRole[];\n}\n\n/**\n * A personal API key, as its owner sees it in a list. The token itself is never returned after it is issued\n * generated from [ApiKey](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L385)\n */\nexport interface ApiKey {\n /** The key's identifier, for rotating or revoking it */\n id: string;\n /** What the account called the key */\n name: string;\n /** The token's first characters, enough to recognise the key in a config file and far too few to use */\n hint: string;\n /** What the key was granted. A key never does more than the account that owns it */\n scopes: ApiKeyScope[];\n /** When the key was issued */\n createdAt: DateTime;\n /** When the key stops working. Absent means it never expires */\n expiresAt?: DateTime;\n /** When the key was last used, to within five minutes. Absent means it has not been used */\n lastUsedAt?: DateTime;\n /** When the key was revoked. Present means every request made with it is refused */\n revokedAt?: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a ApiKey into its runtime type. Mutates and returns `raw`. */\nexport function reviveApiKey(raw: ApiKey): ApiKey {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['createdAt'] = __dt(__o0['createdAt'], 'ApiKey.createdAt');\n if (__o0['expiresAt'] != null) {\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'ApiKey.expiresAt');\n }\n if (__o0['lastUsedAt'] != null) {\n __o0['lastUsedAt'] = __dt(__o0['lastUsedAt'], 'ApiKey.lastUsedAt');\n }\n if (__o0['revokedAt'] != null) {\n __o0['revokedAt'] = __dt(__o0['revokedAt'], 'ApiKey.revokedAt');\n }\n return raw;\n}\n\n/**\n * A new API key\n * generated from [ApiKeyCreate](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L400)\n */\nexport interface ApiKeyCreate {\n /** What to call the key, so a list of several says which is which */\n name: string;\n /** What the key may do. At least one; `manage` includes `view` */\n scopes: ApiKeyScope[];\n /** When the key should stop working. Omit for a key that never expires */\n expiresAt?: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a ApiKeyCreate into its runtime type. Mutates and returns `raw`. */\nexport function reviveApiKeyCreate(raw: ApiKeyCreate): ApiKeyCreate {\n const __o0 = raw as unknown as Record<string, unknown>;\n if (__o0['expiresAt'] != null) {\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'ApiKeyCreate.expiresAt');\n }\n return raw;\n}\n\n/**\n * Represents an application authentication request\n * generated from [ClientCredentialsAuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L32)\n */\nexport interface ClientCredentialsAuthenticationRequest extends Omit<BaseAuthenticationRequest, 'grant_type' | 'client_id'> {\n /** The grant type for the request */\n grant_type: 'client_credentials';\n /** The client identifier */\n client_id: string;\n /** The client secret */\n client_secret: string;\n}\n\n/**\n * Represents an authentication password request\n * generated from [PasswordAuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L38)\n */\nexport interface PasswordAuthenticationRequest extends Omit<BaseAuthenticationRequest, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'password';\n /** User's identifier, usually an email address */\n username: string;\n /** User's password */\n password: string;\n}\n\n/**\n * Represents an authentication refresh request\n * generated from [RefreshTokenAuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L44)\n */\nexport interface RefreshTokenAuthenticationRequest extends Omit<BaseAuthenticationRequest, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'refresh_token';\n /** The refresh token issued by the authorization server. Optional: browser clients omit it and present the httpOnly refresh cookie instead */\n refresh_token?: string;\n}\n\n/**\n * Represents an authentication magic link request\n * generated from [LinkAuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L49)\n */\nexport interface LinkAuthenticationRequest extends Omit<BaseAuthenticationRequest, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'link';\n /** The email challenge id returned by `POST /auth/login/start` — binds the link to the issued challenge so cross-device clicks work */\n challenge_id: string;\n /** The magic link token */\n link: string;\n}\n\n/**\n * Represents an authentication one-time-code request\n * generated from [CodeAuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L55)\n */\nexport interface CodeAuthenticationRequest extends Omit<BaseAuthenticationRequest, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'code';\n /** The one-time code */\n code: string;\n /** PKCE verifier — required for a primary code login; absent when mfa_challenge_id is set */\n code_verifier?: string;\n /** When set, completes a pending MFA challenge; replaces code_verifier as proof-of-origin */\n mfa_challenge_id?: string;\n /** The phone/email challenge id (returned by POST /auth/factors/start for phone-MFA). Required when mfa_challenge_id is set; ignored otherwise (resolved via PKCE) */\n challenge_id?: string;\n}\n\n/**\n * Submit a TOTP code as a second factor against a pending MFA challenge\n * generated from [AuthenticatorAuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L70)\n */\nexport interface AuthenticatorAuthenticationRequest extends Omit<BaseAuthenticationRequest, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'authenticator';\n /** The TOTP code */\n code: string;\n /** The pending MFA challenge — required, TOTP has no other actor binding at initial login */\n mfa_challenge_id: string;\n /** The id of the enrolled authenticator factor to verify against (must be present in the MFA challenge's eligible list) */\n method_id: string;\n}\n\n/**\n * Redeem a completed OIDC authorization that the callback stashed under a one-time id\n * generated from [OidcAuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L77)\n */\nexport interface OidcAuthenticationRequest extends Omit<BaseAuthenticationRequest, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'oidc';\n /** The one-time stash id from the OIDC callback redirect (the value after `?token=oidc:` on `/auth/callback`). Single-use — the API consumes it via `OidcFactorService.redeemAuthenticatedExchange`. */\n challenge_id: string;\n}\n\n/**\n * generated from [BaseAuthenticationLoginStartWithEmail](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L167)\n */\nexport interface BaseAuthenticationLoginStartWithEmail extends BaseAuthenticationLoginStart {\n /** User's email address */\n email: string;\n}\n\n/**\n * Request to begin an OIDC sign-in flow\n * generated from [OidcAuthenticationLoginStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L184)\n */\nexport interface OidcAuthenticationLoginStart extends Omit<BaseAuthenticationLoginStart, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'oidc';\n /** The IdP to authorize against */\n provider: OidcProvider;\n}\n\n/**\n * generated from [CodeAuthenticationLoginStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L203)\n */\nexport interface CodeAuthenticationLoginStartResponse extends Omit<BaseAuthenticationLoginStartResponse, 'grant_type'> {\n /** The grant type for the response */\n grant_type: 'code';\n}\n\n/** Rehydrates every wire-encoded scalar in a CodeAuthenticationLoginStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveCodeAuthenticationLoginStartResponse(raw: CodeAuthenticationLoginStartResponse): CodeAuthenticationLoginStartResponse {\n reviveBaseAuthenticationLoginStartResponse(raw as never);\n return raw;\n}\n\n/**\n * generated from [LinkAuthenticationLoginStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L207)\n */\nexport interface LinkAuthenticationLoginStartResponse extends Omit<BaseAuthenticationLoginStartResponse, 'grant_type'> {\n /** The grant type for the response */\n grant_type: 'link';\n}\n\n/** Rehydrates every wire-encoded scalar in a LinkAuthenticationLoginStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveLinkAuthenticationLoginStartResponse(raw: LinkAuthenticationLoginStartResponse): LinkAuthenticationLoginStartResponse {\n reviveBaseAuthenticationLoginStartResponse(raw as never);\n return raw;\n}\n\n/**\n * Response from `/auth/login/oidc/start` instructing the client to navigate to `authorize_url`\n * generated from [OidcAuthenticationLoginStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L227)\n */\nexport interface OidcAuthenticationLoginStartResponse extends Omit<BaseAuthenticationLoginStartResponse, 'grant_type'> {\n /** The grant type for the response */\n grant_type: 'oidc';\n /** Fully-formed authorize URL the user-agent should be redirected to */\n authorize_url: string;\n /** Opaque state token bound to this authorization round-trip */\n state: string;\n}\n\n/** Rehydrates every wire-encoded scalar in a OidcAuthenticationLoginStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveOidcAuthenticationLoginStartResponse(raw: OidcAuthenticationLoginStartResponse): OidcAuthenticationLoginStartResponse {\n reviveBaseAuthenticationLoginStartResponse(raw as never);\n return raw;\n}\n\n/**\n * MFA-required arm of /auth/token response\n * generated from [MfaRequiredResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L108)\n */\nexport interface MfaRequiredResponse {\n /** Discriminator */\n result: 'mfa_required';\n /** The MFA challenge identifier — pass back as `mfa_challenge_id` on the proof grant */\n challengeId: string;\n /** When the MFA challenge expires */\n expiresAt: DateTime;\n /** Eligible factors the SPA may use to complete the challenge */\n factors: MfaChallengeFactor[];\n}\n\nexport interface MfaRequiredResponseOutput {\n /** Discriminator */\n result: 'mfa_required';\n /** The MFA challenge identifier — pass back as `mfa_challenge_id` on the proof grant */\n challenge_id: string;\n /** When the MFA challenge expires */\n expires_at: DateTime;\n /** Eligible factors the SPA may use to complete the challenge */\n factors: MfaChallengeFactorOutput[];\n}\n\n/** Rehydrates every wire-encoded scalar in a MfaRequiredResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveMfaRequiredResponse(raw: MfaRequiredResponse): MfaRequiredResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'MfaRequiredResponse.expiresAt');\n return raw;\n}\n\n/** Rehydrates every wire-encoded scalar in a MfaRequiredResponseOutput into its runtime type. Mutates and returns `raw`. */\nexport function reviveMfaRequiredResponseOutput(raw: MfaRequiredResponseOutput): MfaRequiredResponseOutput {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expires_at'] = __dt(__o0['expires_at'], 'MfaRequiredResponse.expires_at');\n return raw;\n}\n\n/**\n * Represents an authentication passkey request\n * generated from [FidoAuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L63)\n */\nexport interface FidoAuthenticationRequest extends Omit<BaseAuthenticationRequest, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'fido';\n /** A passkey credential object */\n credential: PublicKeyCredentialWithAssertion;\n /** The FIDO assertion challenge id returned by `POST /auth/login/start` (primary) or `POST /auth/factors/start` (MFA second factor). Must be the per-challenge id, not the actor id. */\n challenge_id: string;\n /** When set, completes a pending MFA challenge instead of issuing a single-factor session */\n mfa_challenge_id?: string;\n}\n\n/**\n * WebAuthn assertion options for `navigator.credentials.get`\n * generated from [FidoAuthenticationLoginStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L222)\n */\nexport interface FidoAuthenticationLoginStartResponse extends Omit<BaseAuthenticationLoginStartResponse, 'grant_type'> {\n /** The grant type for the response */\n grant_type: 'fido';\n /** The WebAuthn assertion options */\n assertion: FidoPublicKeyCredentialRequestOptions;\n}\n\n/** Rehydrates every wire-encoded scalar in a FidoAuthenticationLoginStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveFidoAuthenticationLoginStartResponse(raw: FidoAuthenticationLoginStartResponse): FidoAuthenticationLoginStartResponse {\n reviveBaseAuthenticationLoginStartResponse(raw as never);\n return raw;\n}\n\n/**\n * Response for a FIDO assertion challenge\n * generated from [FactorChallengeFidoStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L304)\n */\nexport interface FactorChallengeFidoStartResponse {\n /** Discriminator */\n method: 'fido';\n /** The FIDO-factor challenge id — echo back on the `fido` grant as `challenge_id` */\n fidoChallengeId: string;\n /** WebAuthn assertion options for navigator.credentials.get */\n assertion: FidoPublicKeyCredentialRequestOptions;\n /** When the FIDO challenge expires */\n expiresAt: DateTime;\n}\n\nexport interface FactorChallengeFidoStartResponseOutput {\n /** Discriminator */\n method: 'fido';\n /** The FIDO-factor challenge id — echo back on the `fido` grant as `challenge_id` */\n fido_challenge_id: string;\n /** WebAuthn assertion options for navigator.credentials.get */\n assertion: FidoPublicKeyCredentialRequestOptions;\n /** When the FIDO challenge expires */\n expires_at: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a FactorChallengeFidoStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveFactorChallengeFidoStartResponse(raw: FactorChallengeFidoStartResponse): FactorChallengeFidoStartResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'FactorChallengeFidoStartResponse.expiresAt');\n return raw;\n}\n\n/** Rehydrates every wire-encoded scalar in a FactorChallengeFidoStartResponseOutput into its runtime type. Mutates and returns `raw`. */\nexport function reviveFactorChallengeFidoStartResponseOutput(raw: FactorChallengeFidoStartResponseOutput): FactorChallengeFidoStartResponseOutput {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expires_at'] = __dt(__o0['expires_at'], 'FactorChallengeFidoStartResponse.expires_at');\n return raw;\n}\n\n/**\n * The credential the client posts back to complete registration\n * generated from [PublicKeyCredentialWithAttestation](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L243)\n */\nexport interface PublicKeyCredentialWithAttestation extends PublicKeyCredential {\n /** The client extension results */\n clientExtensionResults: SimpleClientExtensionResults;\n /** The authenticator attestation response */\n response: FidoAuthenticatorAttestationResponse;\n}\n\n/**\n * Every API key the account holds, newest first, revoked and expired keys included\n * generated from [ApiKeyList](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L396)\n */\nexport interface ApiKeyList {\n keys: ApiKey[];\n}\n\n/** Rehydrates every wire-encoded scalar in a ApiKeyList into its runtime type. Mutates and returns `raw`. */\nexport function reviveApiKeyList(raw: ApiKeyList): ApiKeyList {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['keys'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveApiKey(__a1[__i2] as never);\n }\n }\n return raw;\n}\n\n/**\n * A key and its token. The only time the token is ever returned: store it now, because nothing can show it again\n * generated from [ApiKeyIssued](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L406)\n */\nexport interface ApiKeyIssued {\n /** The key as it will appear in the list */\n key: ApiKey;\n /** The bearer token, sent as `Authorization: Bearer <token>` */\n token: string;\n}\n\n/** Rehydrates every wire-encoded scalar in a ApiKeyIssued into its runtime type. Mutates and returns `raw`. */\nexport function reviveApiKeyIssued(raw: ApiKeyIssued): ApiKeyIssued {\n const __o0 = raw as unknown as Record<string, unknown>;\n reviveApiKey(__o0['key'] as never);\n return raw;\n}\n\n/**\n * generated from [LinkAuthenticationLoginStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L171)\n */\nexport interface LinkAuthenticationLoginStart extends Omit<BaseAuthenticationLoginStartWithEmail, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'link';\n}\n\n/**\n * generated from [CodeAuthenticationLoginStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L175)\n */\nexport interface CodeAuthenticationLoginStart extends Omit<BaseAuthenticationLoginStartWithEmail, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'code';\n /** A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device */\n code_challenge: string;\n}\n\n/**\n * generated from [FidoAuthenticationLoginStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L180)\n */\nexport interface FidoAuthenticationLoginStart extends Omit<BaseAuthenticationLoginStartWithEmail, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'fido';\n}\n\n/**\n * generated from [StepUpStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L119)\n */\nexport type StepUpStartResponse = MfaRequiredResponse | EnrollmentRequiredResponse;\nexport type StepUpStartResponseOutput = MfaRequiredResponseOutput | EnrollmentRequiredResponseOutput;\n\n/** Rehydrates every wire-encoded scalar in a StepUpStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveStepUpStartResponse(raw: StepUpStartResponse): StepUpStartResponse {\n const __v = [raw] as unknown[];\n {\n const __d0 = (__v[0] as Record<string, unknown>)['result'];\n if (__d0 === 'mfa_required') {\n reviveMfaRequiredResponse(__v[0] as never);\n }\n }\n return __v[0] as StepUpStartResponse;\n}\n\n/** Rehydrates every wire-encoded scalar in a StepUpStartResponseOutput into its runtime type. Mutates and returns `raw`. */\nexport function reviveStepUpStartResponseOutput(raw: StepUpStartResponseOutput): StepUpStartResponseOutput {\n const __v = [raw] as unknown[];\n {\n const __d0 = (__v[0] as Record<string, unknown>)['result'];\n if (__d0 === 'mfa_required') {\n reviveMfaRequiredResponseOutput(__v[0] as never);\n }\n }\n return __v[0] as StepUpStartResponseOutput;\n}\n\n/**\n * generated from [AuthenticationTokenResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L121)\n */\nexport type AuthenticationTokenResponse = AuthenticationTokenIssued | MfaRequiredResponse;\nexport type AuthenticationTokenResponseOutput = AuthenticationTokenIssuedOutput | MfaRequiredResponseOutput;\n\n/** Rehydrates every wire-encoded scalar in a AuthenticationTokenResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveAuthenticationTokenResponse(raw: AuthenticationTokenResponse): AuthenticationTokenResponse {\n const __v = [raw] as unknown[];\n {\n const __d0 = (__v[0] as Record<string, unknown>)['result'];\n if (__d0 === 'mfa_required') {\n reviveMfaRequiredResponse(__v[0] as never);\n }\n }\n return __v[0] as AuthenticationTokenResponse;\n}\n\n/** Rehydrates every wire-encoded scalar in a AuthenticationTokenResponseOutput into its runtime type. Mutates and returns `raw`. */\nexport function reviveAuthenticationTokenResponseOutput(raw: AuthenticationTokenResponseOutput): AuthenticationTokenResponseOutput {\n const __v = [raw] as unknown[];\n {\n const __d0 = (__v[0] as Record<string, unknown>)['result'];\n if (__d0 === 'mfa_required') {\n reviveMfaRequiredResponseOutput(__v[0] as never);\n }\n }\n return __v[0] as AuthenticationTokenResponseOutput;\n}\n\n/**\n * generated from [AuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L82)\n */\nexport type AuthenticationRequest =\n | PasswordAuthenticationRequest\n | ClientCredentialsAuthenticationRequest\n | RefreshTokenAuthenticationRequest\n | LinkAuthenticationRequest\n | CodeAuthenticationRequest\n | FidoAuthenticationRequest\n | AuthenticatorAuthenticationRequest\n | OidcAuthenticationRequest;\n\n/**\n * generated from [AuthenticationLoginStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L233)\n */\nexport type AuthenticationLoginStartResponse =\n | CodeAuthenticationLoginStartResponse\n | LinkAuthenticationLoginStartResponse\n | FidoAuthenticationLoginStartResponse\n | OidcAuthenticationLoginStartResponse;\n\n/** Rehydrates every wire-encoded scalar in a AuthenticationLoginStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveAuthenticationLoginStartResponse(raw: AuthenticationLoginStartResponse): AuthenticationLoginStartResponse {\n const __v = [raw] as unknown[];\n {\n const __d0 = (__v[0] as Record<string, unknown>)['grant_type'];\n if (__d0 === 'code') {\n reviveCodeAuthenticationLoginStartResponse(__v[0] as never);\n }\n if (__d0 === 'link') {\n reviveLinkAuthenticationLoginStartResponse(__v[0] as never);\n }\n if (__d0 === 'fido') {\n reviveFidoAuthenticationLoginStartResponse(__v[0] as never);\n }\n if (__d0 === 'oidc') {\n reviveOidcAuthenticationLoginStartResponse(__v[0] as never);\n }\n }\n return __v[0] as AuthenticationLoginStartResponse;\n}\n\n/**\n * generated from [FactorChallengeStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L317)\n */\nexport type FactorChallengeStartResponse = FactorChallengePhoneStartResponse | FactorChallengeFidoStartResponse | FactorChallengeEmailStartResponse;\nexport type FactorChallengeStartResponseOutput =\n FactorChallengePhoneStartResponseOutput | FactorChallengeFidoStartResponseOutput | FactorChallengeEmailStartResponseOutput;\n\n/** Rehydrates every wire-encoded scalar in a FactorChallengeStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveFactorChallengeStartResponse(raw: FactorChallengeStartResponse): FactorChallengeStartResponse {\n const __v = [raw] as unknown[];\n {\n const __d0 = (__v[0] as Record<string, unknown>)['method'];\n if (__d0 === 'phone') {\n reviveFactorChallengePhoneStartResponse(__v[0] as never);\n }\n if (__d0 === 'fido') {\n reviveFactorChallengeFidoStartResponse(__v[0] as never);\n }\n if (__d0 === 'email') {\n reviveFactorChallengeEmailStartResponse(__v[0] as never);\n }\n }\n return __v[0] as FactorChallengeStartResponse;\n}\n\n/** Rehydrates every wire-encoded scalar in a FactorChallengeStartResponseOutput into its runtime type. Mutates and returns `raw`. */\nexport function reviveFactorChallengeStartResponseOutput(raw: FactorChallengeStartResponseOutput): FactorChallengeStartResponseOutput {\n const __v = [raw] as unknown[];\n {\n const __d0 = (__v[0] as Record<string, unknown>)['method'];\n if (__d0 === 'phone') {\n reviveFactorChallengePhoneStartResponseOutput(__v[0] as never);\n }\n if (__d0 === 'fido') {\n reviveFactorChallengeFidoStartResponseOutput(__v[0] as never);\n }\n if (__d0 === 'email') {\n reviveFactorChallengeEmailStartResponseOutput(__v[0] as never);\n }\n }\n return __v[0] as FactorChallengeStartResponseOutput;\n}\n\n/**\n * generated from [AuthenticationLoginStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L189)\n */\nexport type AuthenticationLoginStart =\n LinkAuthenticationLoginStart | CodeAuthenticationLoginStart | FidoAuthenticationLoginStart | OidcAuthenticationLoginStart;\n","import type { ApiKeyCreate, ApiKeyIssued, ApiKeyList } from './types/authentication.types.js';\nimport { reviveApiKeyIssued, reviveApiKeyList } from './types/authentication.types.js';\nimport type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\n\n/**\n * generated from [authentication.apikeys.ck](../../../../apps/api/data/contracts/authentication/authentication.apikeys.ck)\n */\nexport class AuthenticationApikeysClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List API keys\n * @description The signed-in account's API keys, newest first, including revoked and expired ones so the list says what was withdrawn and when\n */\n async listAPIKeys(): Promise<ApiKeyList> {\n const result = await this.fetch(`/auth/apikeys`, { method: 'GET' });\n return reviveApiKeyList(await parseJson<ApiKeyList>(result));\n }\n\n /**\n * @name Create API key\n * @description Issue a new API key for the signed-in account. The token is in this response and nowhere else, ever. Once the account has a strong second factor, this needs one verified in the last five minutes\n */\n async createAPIKey(body: ApiKeyCreate): Promise<ApiKeyIssued> {\n const result = await this.fetch(`/auth/apikeys`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return reviveApiKeyIssued(await parseJson<ApiKeyIssued>(result));\n }\n\n /**\n * @name Rotate API key\n * @description Give a key a new token, so the old one stops working at once. The key keeps its name, scopes and expiry. Needs the same recent second factor as creating one\n */\n async rotateAPIKey(id: string): Promise<ApiKeyIssued> {\n const result = await this.fetch(`/auth/apikeys/${encodeURIComponent(id)}/rotate`, { method: 'POST' });\n return reviveApiKeyIssued(await parseJson<ApiKeyIssued>(result));\n }\n\n /**\n * @name Revoke API key\n * @description Revoke a key. Every request made with it is refused from the next one on. The key stays in the list, marked revoked\n */\n async revokeAPIKey(id: string): Promise<void> {\n await this.fetch(`/auth/apikeys/${encodeURIComponent(id)}`, { method: 'DELETE' });\n }\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\nimport type { PublicKeyCredentialWithAttestation } from './authentication.types.js';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * generated from [PhoneFactorRegistration](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L7)\n */\nexport interface PhoneFactorRegistration {\n /** The method of the factor */\n method: 'phone';\n /** The phone number in E.164 format (e.g. `+12025550123`) */\n value: string;\n /** A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device */\n codeChallenge: string;\n}\n\n/**\n * generated from [PasswordFactorRegistration](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L13)\n */\nexport interface PasswordFactorRegistration {\n /** The method of the factor */\n method: 'password';\n /** The password */\n value: string;\n}\n\n/**\n * generated from [EmailFactorRegistration](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L18)\n */\nexport interface EmailFactorRegistration {\n /** The method of the factor */\n method: 'email';\n /** The email address */\n value: string;\n /** A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device */\n codeChallenge: string;\n}\n\n/**\n * generated from [AuthenticatorFactorRegistration](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L24)\n */\nexport interface AuthenticatorFactorRegistration {\n /** The method of the factor */\n method: 'authenticator';\n /** A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device */\n codeChallenge: string;\n /** The label for the authenticator factor */\n label?: string;\n}\n\n/**\n * generated from [FidoFactorRegistration](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L30)\n */\nexport interface FidoFactorRegistration {\n /** The method of the factor */\n method: 'fido';\n /** The label for the FIDO factor */\n label?: string;\n}\n\n/**\n * generated from [PhoneFactorRegistrationResponse](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L37)\n */\nexport interface PhoneFactorRegistrationResponse {\n /** The method of the factor */\n method: 'phone';\n /** The registration identifier */\n registrationId: string;\n /** The expiration timestamp */\n expiresAt: DateTime;\n /** The issuance timestamp */\n issuedAt: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a PhoneFactorRegistrationResponse into its runtime type. Mutates and returns `raw`. */\nexport function revivePhoneFactorRegistrationResponse(raw: PhoneFactorRegistrationResponse): PhoneFactorRegistrationResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'PhoneFactorRegistrationResponse.expiresAt');\n __o0['issuedAt'] = __dt(__o0['issuedAt'], 'PhoneFactorRegistrationResponse.issuedAt');\n return raw;\n}\n\n/**\n * generated from [PasswordFactorRegistrationResponse](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L44)\n */\nexport interface PasswordFactorRegistrationResponse {\n /** The method of the factor */\n method: 'password';\n /** Whether the password needs to be reset */\n needsReset: boolean;\n}\n\n/**\n * generated from [EmailFactorRegistrationResponse](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L49)\n */\nexport interface EmailFactorRegistrationResponse {\n /** The method of the factor */\n method: 'email';\n /** The registration identifier */\n registrationId: string;\n /** The expiration timestamp */\n expiresAt: DateTime;\n /** The issuance timestamp */\n issuedAt: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a EmailFactorRegistrationResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveEmailFactorRegistrationResponse(raw: EmailFactorRegistrationResponse): EmailFactorRegistrationResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'EmailFactorRegistrationResponse.expiresAt');\n __o0['issuedAt'] = __dt(__o0['issuedAt'], 'EmailFactorRegistrationResponse.issuedAt');\n return raw;\n}\n\n/**\n * generated from [AuthenticatorFactorRegistrationResponse](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L56)\n */\nexport interface AuthenticatorFactorRegistrationResponse {\n /** The method of the factor */\n method: 'authenticator';\n /** The registration identifier */\n registrationId: string;\n /** The secret for the authenticator */\n secret: string;\n /** The URI for the authenticator */\n uri: string;\n /** The QR code for the authenticator */\n qrCode: string;\n /** The expiration timestamp */\n expiresAt: DateTime;\n /** The issuance timestamp */\n issuedAt: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a AuthenticatorFactorRegistrationResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveAuthenticatorFactorRegistrationResponse(raw: AuthenticatorFactorRegistrationResponse): AuthenticatorFactorRegistrationResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'AuthenticatorFactorRegistrationResponse.expiresAt');\n __o0['issuedAt'] = __dt(__o0['issuedAt'], 'AuthenticatorFactorRegistrationResponse.issuedAt');\n return raw;\n}\n\n/**\n * The FIDO factor attestation information\n * generated from [FidoFactorAttestation](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L66)\n */\nexport interface FidoFactorAttestation {\n /** The relying party */\n rp: { name: string; id: string; icon?: string };\n user: { id: string; name: string; displayName: string };\n /** The challenge */\n challenge: string;\n /** The public key credential parameters */\n pubKeyCredParams: { type: 'public-key'; alg: number }[];\n /** The timeout */\n timeout?: number;\n /** The attestation */\n attestation: 'direct' | 'indirect' | 'none';\n}\n\n/**\n * generated from [PhoneFactorRegistrationVerification](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L93)\n */\nexport interface PhoneFactorRegistrationVerification {\n /** The method of the factor */\n method: 'phone';\n /** The registration identifier */\n registrationId: string;\n /** The verification code */\n code: string;\n /** A base64url encoded one time secret used to validate that the request starts and ends on the same device */\n codeVerifier: string;\n}\n\n/**\n * generated from [EmailFactorRegistrationVerification](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L100)\n */\nexport interface EmailFactorRegistrationVerification {\n /** The method of the factor */\n method: 'email';\n /** The registration identifier */\n registrationId: string;\n /** The verification code */\n code: string;\n /** A base64url encoded one time secret used to validate that the request starts and ends on the same device */\n codeVerifier: string;\n}\n\n/**\n * generated from [AuthenticatorFactorRegistrationVerification](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L107)\n */\nexport interface AuthenticatorFactorRegistrationVerification {\n /** The method of the factor */\n method: 'authenticator';\n /** The registration identifier */\n registrationId: string;\n /** The verification code */\n code: string;\n /** A base64url encoded one time secret used to validate that the request starts and ends on the same device */\n codeVerifier: string;\n}\n\n/**\n * generated from [FidoFactorRegistrationVerification](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L114)\n */\nexport interface FidoFactorRegistrationVerification {\n /** The method of the factor */\n method: 'fido';\n /** The registration identifier */\n registrationId: string;\n /** The credential the client posts back to complete registration */\n credential: PublicKeyCredentialWithAttestation;\n}\n\n/**\n * Begin enrolling a TOTP authenticator during a pending login MFA challenge (no session — authorized by the challenge)\n * generated from [MfaEnrollAuthenticatorStart](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L122)\n */\nexport interface MfaEnrollAuthenticatorStart {\n /** The pending MFA challenge from the `mfa_required` login response */\n mfa_challenge_id: string;\n /** Optional label for the new authenticator factor */\n label?: string;\n}\n\n/**\n * Verify the first TOTP code, persist the authenticator, and complete login\n * generated from [MfaEnrollAuthenticatorVerify](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L127)\n */\nexport interface MfaEnrollAuthenticatorVerify {\n /** The same pending MFA challenge */\n mfa_challenge_id: string;\n /** The registration id returned by the enroll-start response */\n registrationId: string;\n /** The first TOTP code from the user's authenticator app */\n code: string;\n}\n\n/**\n * A second-factor method a user may enroll\n * generated from [EnrollmentMethod](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L133)\n */\nexport type EnrollmentMethod = 'authenticator' | 'phone' | 'fido';\n\n/**\n * Begin enrolling an SMS phone factor during a pending login MFA challenge (no session — authorized by the challenge)\n * generated from [MfaEnrollPhoneStart](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L139)\n */\nexport interface MfaEnrollPhoneStart {\n /** The pending MFA challenge from the `mfa_required` login response */\n mfa_challenge_id: string;\n /** The phone number in E.164 format (e.g. `+12025550123`) */\n value: string;\n}\n\n/**\n * Acknowledges the phone registration and that an OTP was texted\n * generated from [MfaEnrollPhoneStartResponse](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L144)\n */\nexport interface MfaEnrollPhoneStartResponse {\n /** The method of the factor */\n method: 'phone';\n /** The registration id — echo back on the verify call */\n registrationId: string;\n /** When the registration expires */\n expiresAt: DateTime;\n /** When the registration was issued */\n issuedAt: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a MfaEnrollPhoneStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveMfaEnrollPhoneStartResponse(raw: MfaEnrollPhoneStartResponse): MfaEnrollPhoneStartResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'MfaEnrollPhoneStartResponse.expiresAt');\n __o0['issuedAt'] = __dt(__o0['issuedAt'], 'MfaEnrollPhoneStartResponse.issuedAt');\n return raw;\n}\n\n/**\n * Verify the texted OTP, persist the phone factor, and complete login\n * generated from [MfaEnrollPhoneVerify](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L151)\n */\nexport interface MfaEnrollPhoneVerify {\n /** The same pending MFA challenge */\n mfa_challenge_id: string;\n /** The registration id returned by the enroll-start response */\n registrationId: string;\n /** The one-time code texted to the phone */\n code: string;\n}\n\n/**\n * Begin enrolling a passkey during a pending login MFA challenge (no session — authorized by the challenge)\n * generated from [MfaEnrollFidoStart](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L157)\n */\nexport interface MfaEnrollFidoStart {\n /** The pending MFA challenge from the `mfa_required` login response */\n mfa_challenge_id: string;\n /** Optional label for the new passkey factor */\n label?: string;\n}\n\n/**\n * Post the new credential back, persist the passkey factor, and complete login\n * generated from [MfaEnrollFidoVerify](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L170)\n */\nexport interface MfaEnrollFidoVerify {\n /** The same pending MFA challenge */\n mfa_challenge_id: string;\n /** The registration id returned by the enroll-start response */\n registrationId: string;\n /** The credential produced by `navigator.credentials.create` */\n credential: PublicKeyCredentialWithAttestation;\n}\n\n/**\n * generated from [AuthenticationFactorRegistration](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L35)\n */\nexport type AuthenticationFactorRegistration =\n PhoneFactorRegistration | PasswordFactorRegistration | EmailFactorRegistration | AuthenticatorFactorRegistration | FidoFactorRegistration;\n\n/**\n * generated from [FidoFactorRegistrationResponse](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L83)\n */\nexport interface FidoFactorRegistrationResponse {\n /** The method of the factor */\n method: 'fido';\n /** The registration identifier */\n registrationId: string;\n /** The expiration timestamp */\n expiresAt: DateTime;\n /** The issuance timestamp */\n issuedAt: DateTime;\n /** The FIDO factor attestation information */\n attestation: FidoFactorAttestation;\n}\n\n/** Rehydrates every wire-encoded scalar in a FidoFactorRegistrationResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveFidoFactorRegistrationResponse(raw: FidoFactorRegistrationResponse): FidoFactorRegistrationResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'FidoFactorRegistrationResponse.expiresAt');\n __o0['issuedAt'] = __dt(__o0['issuedAt'], 'FidoFactorRegistrationResponse.issuedAt');\n return raw;\n}\n\n/**\n * WebAuthn attestation options for `navigator.credentials.create`\n * generated from [MfaEnrollFidoStartResponse](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L162)\n */\nexport interface MfaEnrollFidoStartResponse {\n /** The method of the factor */\n method: 'fido';\n /** The registration id — echo back on the verify call */\n registrationId: string;\n /** When the registration expires */\n expiresAt: DateTime;\n /** When the registration was issued */\n issuedAt: DateTime;\n /** The WebAuthn attestation (credential-creation) options */\n attestation: FidoFactorAttestation;\n}\n\n/** Rehydrates every wire-encoded scalar in a MfaEnrollFidoStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveMfaEnrollFidoStartResponse(raw: MfaEnrollFidoStartResponse): MfaEnrollFidoStartResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'MfaEnrollFidoStartResponse.expiresAt');\n __o0['issuedAt'] = __dt(__o0['issuedAt'], 'MfaEnrollFidoStartResponse.issuedAt');\n return raw;\n}\n\n/**\n * generated from [AuthenticationFactorRegistrationVerification](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L120)\n */\nexport type AuthenticationFactorRegistrationVerification =\n | PhoneFactorRegistrationVerification\n | EmailFactorRegistrationVerification\n | AuthenticatorFactorRegistrationVerification\n | FidoFactorRegistrationVerification;\n\n/**\n * Which second factors this instance permits enrolling. `phone` is present only when an SMS provider is configured (SMS_DELIVERY != noop); `authenticator` and `fido` are always available.\n * generated from [EnrollmentMethods](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L135)\n */\nexport interface EnrollmentMethods {\n /** The enrollable factor methods, in suggested display order */\n methods: EnrollmentMethod[];\n}\n\n/**\n * generated from [AuthenticationFactorRegistrationResponse](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L91)\n */\nexport type AuthenticationFactorRegistrationResponse =\n | PhoneFactorRegistrationResponse\n | PasswordFactorRegistrationResponse\n | EmailFactorRegistrationResponse\n | AuthenticatorFactorRegistrationResponse\n | FidoFactorRegistrationResponse;\n\n/** Rehydrates every wire-encoded scalar in a AuthenticationFactorRegistrationResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveAuthenticationFactorRegistrationResponse(\n raw: AuthenticationFactorRegistrationResponse,\n): AuthenticationFactorRegistrationResponse {\n const __v = [raw] as unknown[];\n {\n const __d0 = (__v[0] as Record<string, unknown>)['method'];\n if (__d0 === 'phone') {\n revivePhoneFactorRegistrationResponse(__v[0] as never);\n }\n if (__d0 === 'email') {\n reviveEmailFactorRegistrationResponse(__v[0] as never);\n }\n if (__d0 === 'authenticator') {\n reviveAuthenticatorFactorRegistrationResponse(__v[0] as never);\n }\n if (__d0 === 'fido') {\n reviveFidoFactorRegistrationResponse(__v[0] as never);\n }\n }\n return __v[0] as AuthenticationFactorRegistrationResponse;\n}\n","import type {\n AuthenticationFactor,\n AuthenticationFactorMethod,\n AuthenticationTokenOutput,\n FactorChallengeStartRequest,\n FactorChallengeStartResponseOutput,\n StepUpStartRequest,\n StepUpStartResponseOutput,\n} from './types/authentication.types.js';\nimport { reviveFactorChallengeStartResponseOutput, reviveStepUpStartResponseOutput } from './types/authentication.types.js';\nimport type {\n AuthenticationFactorRegistration,\n AuthenticationFactorRegistrationResponse,\n AuthenticationFactorRegistrationVerification,\n} from './types/registration.types.js';\nimport { reviveAuthenticationFactorRegistrationResponse } from './types/registration.types.js';\nimport type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\n\n/**\n * generated from [authentication.factor.ck](../../../../apps/api/data/contracts/authentication/authentication.factor.ck)\n */\nexport class AuthenticationFactorsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List factors\n * @description List authentication factors\n */\n async listFactors(): Promise<AuthenticationFactor[]> {\n const result = await this.fetch(`/auth/factors`, { method: 'GET' });\n return await parseJson<AuthenticationFactor[]>(result);\n }\n\n /**\n * @name Register factor\n * @description Register an authentication factor\n */\n async registerFactor(body: AuthenticationFactorRegistration): Promise<AuthenticationFactorRegistrationResponse> {\n const result = await this.fetch(`/auth/factors/register`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return reviveAuthenticationFactorRegistrationResponse(await parseJson<AuthenticationFactorRegistrationResponse>(result));\n }\n\n /**\n * @name Verify factor registration\n * @description Verify an authentication factor registration\n */\n async verifyFactorRegistration(body: AuthenticationFactorRegistrationVerification): Promise<AuthenticationTokenOutput> {\n const result = await this.fetch(`/auth/factors/verify`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<AuthenticationTokenOutput>(result);\n }\n\n /**\n * @name Start factor challenge\n * @description Issue a factor verification challenge for a pending MFA round. Authenticated via the short-lived `mfa_challenge_id` in the body, not by session — this is the only /auth/factors/* route that does not require an authenticated session.\n */\n async startFactorChallenge(body: FactorChallengeStartRequest): Promise<FactorChallengeStartResponseOutput> {\n const result = await this.fetch(`/auth/factors/start`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return reviveFactorChallengeStartResponseOutput(await parseJson<FactorChallengeStartResponseOutput>(result));\n }\n\n /**\n * @name Start MFA challenge\n * @description Mint a fresh MFA challenge for the *current* authenticated session so the SPA can satisfy a `step_up_required` denial. Optionally filters eligible factors against an inbound `StepUpRequirement` hint. Returns `enrollment_required` when no enrolled factor matches the requirement so the SPA can route the user into enrollment instead of getting stuck.\n */\n async startMFAChallenge(body: StepUpStartRequest): Promise<StepUpStartResponseOutput> {\n const result = await this.fetch(`/auth/mfa/start`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return reviveStepUpStartResponseOutput(await parseJson<StepUpStartResponseOutput>(result));\n }\n\n /**\n * @name Remove factor\n * @description Remove one of the caller's own factors. Answered only for `authenticator` today, and only after a recent strong-factor verification: the same gate enrolment sits behind once a strong factor exists, so a stolen session cannot quietly switch the second factor off. Removing the last authenticator turns the sign-in challenge off for that account.\n */\n async removeFactor(method: AuthenticationFactorMethod, methodId: string): Promise<void> {\n await this.fetch(`/auth/factors/${encodeURIComponent(method)}/${encodeURIComponent(methodId)}`, { method: 'DELETE' });\n }\n}\n","import type { AuthSession } from './types/authentication.types.js';\nimport type { SdkFetch } from '../sdk-options.js';\nimport { parseJson } from '../sdk-options.js';\n\n/**\n * generated from [authentication.sessions.ck](../../../../apps/api/data/contracts/authentication/authentication.sessions.ck)\n */\nexport class AuthenticationSessionsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name Logout\n * @description revoke the caller's current session (self sign-out). Deliberately carries no policy gate: signing out must always clear the browser's httpOnly refresh cookie, including for a caller whose access token has already expired. A 401 here would leave a 30-day refresh cookie behind that silently signs the user back in on the next page load. SessionsService revokes the session only when the caller is actually authenticated; an anonymous caller still gets 204 and a cleared cookie.\n */\n async logout(): Promise<void> {\n await this.fetch(`/auth/logout`, { method: 'POST' });\n }\n\n /**\n * @name Read session\n * @description Who the caller is and which platform roles they hold\n */\n async readSession(): Promise<AuthSession> {\n const result = await this.fetch(`/auth/session`, { method: 'GET' });\n return await parseJson<AuthSession>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\nimport type {\n AuthenticationLoginStart,\n AuthenticationLoginStartResponse,\n AuthenticationRegistration,\n AuthenticationRegistrationInput,\n AuthenticationRegistrationVerification,\n AuthenticationRequest,\n AuthenticationTokenOutput,\n AuthenticationTokenResponseOutput,\n} from './types/authentication.types.js';\nimport {\n reviveAuthenticationLoginStartResponse,\n reviveAuthenticationRegistration,\n reviveAuthenticationTokenResponseOutput,\n} from './types/authentication.types.js';\nimport { AuthenticationApikeysClient } from './authentication.apikeys.client.js';\nimport { AuthenticationFactorsClient } from './authentication.factor.client.js';\nimport { AuthenticationSessionsClient } from './authentication.sessions.client.js';\n\nexport class AuthenticationClient {\n readonly apikeys: AuthenticationApikeysClient;\n readonly factors: AuthenticationFactorsClient;\n readonly sessions: AuthenticationSessionsClient;\n\n constructor(private fetch: SdkFetch) {\n this.apikeys = new AuthenticationApikeysClient(fetch);\n this.factors = new AuthenticationFactorsClient(fetch);\n this.sessions = new AuthenticationSessionsClient(fetch);\n }\n\n /**\n * @name Request token\n * @description Request authenticated token\n */\n async requestToken(\n body: AuthenticationRequest,\n options?: { contentType?: 'application/x-www-form-urlencoded' | 'application/json' },\n ): Promise<AuthenticationTokenResponseOutput> {\n const __contentType = options?.contentType ?? 'application/x-www-form-urlencoded';\n const __serialized =\n __contentType === 'application/x-www-form-urlencoded'\n ? new URLSearchParams(body as unknown as Record<string, string>).toString()\n : JSON.stringify(body, bigIntReplacer);\n const result = await this.fetch(`/auth/token`, {\n method: 'POST',\n headers: { 'Content-Type': __contentType },\n body: __serialized,\n });\n return reviveAuthenticationTokenResponseOutput(await parseJson<AuthenticationTokenResponseOutput>(result));\n }\n\n /**\n * @name Register login\n * @description Register a new login\n */\n async registerLogin(body: AuthenticationRegistrationInput): Promise<AuthenticationRegistration> {\n const result = await this.fetch(`/auth/login/register`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return reviveAuthenticationRegistration(await parseJson<AuthenticationRegistration>(result));\n }\n\n /**\n * @name Verify login registration\n * @description Verify a login registration\n */\n async verifyLoginRegistration(body: AuthenticationRegistrationVerification): Promise<AuthenticationTokenOutput> {\n const result = await this.fetch(`/auth/login/verify`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<AuthenticationTokenOutput>(result);\n }\n\n /**\n * @name Start login\n * @description Start a password-less login process\n */\n async startLogin(body: AuthenticationLoginStart): Promise<AuthenticationLoginStartResponse> {\n const result = await this.fetch(`/auth/login/start`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return reviveAuthenticationLoginStartResponse(await parseJson<AuthenticationLoginStartResponse>(result));\n }\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\nimport type { Pagination } from '../../shared/types/pagination.js';\nimport type { PaginationInput } from '../../shared/types/pagination.js';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * What the station has been told about a record. `neutral` is the absence of an opinion rather than\n * a middling one, and it is what rating something back to nothing means.\n * generated from [Rating](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L9)\n */\nexport type Rating = 'liked' | 'neutral' | 'disliked';\n\n/**\n * One provider's copy of a record, with whatever the station holds of it.\n *\n * PER BINDING and never per track, which is the rule the whole page is built on: one canonical\n * record may bind to several copies inside one provider, those copies are different files with\n * different loudness and different cue points, and the one that airs is the one that was resolved.\n * Collapsing them would make \"clear the audio\" ambiguous about which file it took.\n *\n * The failure columns are here rather than hidden because that is the question this page exists to\n * answer. A row with `attempts` and no `fetchedAt` is a remembered failure, and `lastError` with\n * `nextAttemptAt` is the whole of why a perfectly good-looking record will not play.\n * generated from [TrackBinding](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L73)\n */\nexport interface TrackBinding {\n /** `track_sources.id`, which is also what the audio URL carries */\n sourceId: string;\n pluginId: string;\n externalId: string;\n /** False when the provider still knows the record but will not serve it here */\n playable: boolean;\n /** When the station gave up on this copy. Cleared by the next sync that sees it again */\n missingAt?: DateTime;\n /** `sync` if a playlist walk saw it, `discovered` if something looked it up */\n origin: string;\n bitrate?: number;\n format?: string;\n lastSeenAt?: DateTime;\n /** What the station holds of this copy, absent when nothing has ever fetched it. */\n byteSize?: number;\n fetchedAt?: DateTime;\n lastServedAt?: DateTime;\n /** CONSECUTIVE failures. Reset by a fetch that works */\n attempts: number;\n lastError?: string;\n nextAttemptAt?: DateTime;\n}\n\nexport interface TrackBindingInput {}\n\n/** Rehydrates every wire-encoded scalar in a TrackBinding into its runtime type. Mutates and returns `raw`. */\nexport function reviveTrackBinding(raw: TrackBinding): TrackBinding {\n const __o0 = raw as unknown as Record<string, unknown>;\n if (__o0['missingAt'] != null) {\n __o0['missingAt'] = __dt(__o0['missingAt'], 'TrackBinding.missingAt');\n }\n if (__o0['lastSeenAt'] != null) {\n __o0['lastSeenAt'] = __dt(__o0['lastSeenAt'], 'TrackBinding.lastSeenAt');\n }\n if (__o0['fetchedAt'] != null) {\n __o0['fetchedAt'] = __dt(__o0['fetchedAt'], 'TrackBinding.fetchedAt');\n }\n if (__o0['lastServedAt'] != null) {\n __o0['lastServedAt'] = __dt(__o0['lastServedAt'], 'TrackBinding.lastServedAt');\n }\n if (__o0['nextAttemptAt'] != null) {\n __o0['nextAttemptAt'] = __dt(__o0['nextAttemptAt'], 'TrackBinding.nextAttemptAt');\n }\n return raw;\n}\n\n/**\n * What the measurement sidecar made of a record.\n *\n * `complete` is NOT `analyzedAt`, and the two are separate fields for a reason `0005_music.sql`\n * argues at length: a measurement of a truncated download is confident and wrong, so every reader in\n * the app filters on `complete` and a page that showed only a date would be reporting a record as\n * measured that nothing will use the measurement of.\n * generated from [TrackAnalysis](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L98)\n */\nexport interface TrackAnalysis {\n schemaVersion: number;\n complete: boolean;\n /** The measuring thing itself, which is not the plugin adapting it */\n analyzer?: string;\n analyzerPluginId?: string;\n analyzedAt?: DateTime;\n failedAt?: DateTime;\n failureReason?: string;\n}\n\nexport interface TrackAnalysisInput {}\n\n/** Rehydrates every wire-encoded scalar in a TrackAnalysis into its runtime type. Mutates and returns `raw`. */\nexport function reviveTrackAnalysis(raw: TrackAnalysis): TrackAnalysis {\n const __o0 = raw as unknown as Record<string, unknown>;\n if (__o0['analyzedAt'] != null) {\n __o0['analyzedAt'] = __dt(__o0['analyzedAt'], 'TrackAnalysis.analyzedAt');\n }\n if (__o0['failedAt'] != null) {\n __o0['failedAt'] = __dt(__o0['failedAt'], 'TrackAnalysis.failedAt');\n }\n return raw;\n}\n\n/**\n * One airing of a record, as this page needs it: when, and under which broadcast.\n * generated from [TrackPlay](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L109)\n */\nexport interface TrackPlay {\n airedAt: DateTime;\n broadcastId?: string;\n /** What put it in the running order */\n source: string;\n}\n\nexport interface TrackPlayInput {}\n\n/** Rehydrates every wire-encoded scalar in a TrackPlay into its runtime type. Mutates and returns `raw`. */\nexport function reviveTrackPlay(raw: TrackPlay): TrackPlay {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['airedAt'] = __dt(__o0['airedAt'], 'TrackPlay.airedAt');\n return raw;\n}\n\n/**\n * What a clear actually did.\n *\n * A count rather than a bare 204, because the interesting answers are the small ones: clearing the\n * audio of a record with three copies and being told `1` is the station saying two of them were\n * never here — which is a fact about the record and not about the button.\n * generated from [TrackClearResult](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L132)\n */\nexport interface TrackClearResult {\n trackId: string;\n /** Rows this affected. Zero is an ordinary answer, not a failure */\n cleared: number;\n /** What happened, in the words the console shows */\n detail: string;\n}\n\nexport interface TrackClearResultInput {}\n\n/**\n * Narrow a clear to one provider's answer, for the case where one source is wrong and the rest are\n * not. Absent clears every provider's.\n * generated from [ClearEnrichmentQuery](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L140)\n */\nexport interface ClearEnrichmentQuery {\n provider?: string;\n}\n\n/**\n * What an artist or album list is ordered BY, where `Pagination.sort` says only which direction.\n *\n * name the default, and the only key every row here has\n * albums how many records the station holds of them. Artists only\n * tracks how many songs. Artists only\n * year when the record came out. Albums only\n * rating the operator's own opinion\n *\n * One enum for both lists rather than two, because the alternative is a second near-identical\n * contract whose only content is which two keys it drops. A key the row cannot answer falls back to\n * name order rather than failing: an ordering nobody can serve is a page an operator cannot open.\n * generated from [CatalogSort](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L155)\n */\nexport type CatalogSort = 'name' | 'albums' | 'tracks' | 'year' | 'rating';\n\n/**\n * Which records to show, by what the station has of them rather than by what they are.\n *\n * cached the audio is on this machine, so it can be committed to the running order now\n * uncached it is not, which for most of a library is ordinary rather than wrong\n * unmeasured no trustworthy measurement, so no cue points and no level decided before air\n * benched every copy written off, which is the one state that means it CANNOT air\n * failing a fetch has failed and is backing off. Not benched yet, and often the state before it\n * generated from [TrackState](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L171)\n */\nexport type TrackState = 'cached' | 'uncached' | 'unmeasured' | 'benched' | 'failing';\n\n/**\n * What a track list is ordered BY. Its own enum for `TrackQuery`'s own reason: none of these keys\n * means anything about an artist, and `name` is spelled `title` on a song.\n *\n * `state` is deliberately absent. It is three independent booleans rather than one column, so there\n * is no ordering of it an operator would agree with: a benched record and an unmeasured one are not\n * more or less than each other.\n * generated from [TrackSort](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L179)\n */\nexport type TrackSort = 'title' | 'artist' | 'album' | 'year' | 'duration' | 'rating';\n\n/**\n * How much of the library is in each state, over the whole filtered set rather than this page.\n *\n * The aggregate is what an operator reads first — \"13 of 581 measured\" is the sentence that made\n * [analysis-queue-ordering](https://github.com/robert-dean/deadair/discussions/5) necessary, and it was a psql query then. `total` is the\n * same number as `meta.total` when nothing is filtered, and is repeated here so the counts can be\n * read as N of M without reaching into the pager.\n * generated from [TrackStateCounts](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L196)\n */\nexport interface TrackStateCounts {\n total: number;\n cached: number;\n measured: number;\n enriched: number;\n benched: number;\n failing: number;\n}\n\nexport interface TrackStateCountsInput {}\n\n/**\n * generated from [EnrichmentExternalId](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L244)\n */\nexport interface EnrichmentExternalId {\n /** e.g. `musicbrainz`, `wikidata` */\n source: string;\n id: string;\n}\n\n/**\n * Narrowed to http(s) by the host before it is stored, since the console renders these as\n * something a human clicks.\n * generated from [EnrichmentLink](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L251)\n */\nexport interface EnrichmentLink {\n label: string;\n url: string;\n}\n\n/**\n * One thing the station believes, and the words it read that say so. Extracted by the host out of\n * an article a plugin handed over, rather than said by any plugin: `sourceUrl` is where a person\n * checks it and `sourceQuote` is the span that supports it, and neither is ever absent.\n * generated from [FactClaim](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L344)\n */\nexport interface FactClaim {\n id: string;\n /** One sentence, as the DJ would say it */\n claim: string;\n category: string;\n /** `lead` for the article's own opening, `model` for what a model found */\n source: string;\n sourceProvider: string;\n sourceUrl: string;\n sourceQuote: string;\n confidence?: number;\n model?: string;\n /** Absent means never said on air */\n lastUsedAt?: DateTime;\n}\n\nexport interface FactClaimInput {}\n\n/** Rehydrates every wire-encoded scalar in a FactClaim into its runtime type. Mutates and returns `raw`. */\nexport function reviveFactClaim(raw: FactClaim): FactClaim {\n const __o0 = raw as unknown as Record<string, unknown>;\n if (__o0['lastUsedAt'] != null) {\n __o0['lastUsedAt'] = __dt(__o0['lastUsedAt'], 'FactClaim.lastUsedAt');\n }\n return raw;\n}\n\n/**\n * Rate an artist, a record or a song. Ratings are absolute: a dislike anywhere above a track\n * excludes it, and nothing the station programmes may turn that off.\n * generated from [RateInput](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L13)\n */\nexport interface RateInput {\n rating: Rating;\n}\n\n/**\n * The canonical work, not a binding to a provider. `deadair.artists` minus the columns that\n * only ingest cares about: `artist_key` is a match key, and a row with `merged_into_id` set is\n * never read out at all.\n *\n * `imageUrl` on both contracts below is one field with two spellings. An absolute URL is the\n * provider's own, still hotlinked because nothing has cached it yet; a relative `art/<uuid>` is\n * the station's copy, to be resolved against the API base the client already configures (the API\n * mounts at the root and does not know the `/api` prefix the edge adds). Prefer the local one by\n * doing nothing: the switch happens server-side as soon as the art cache pass has the bytes.\n * generated from [Artist](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L26)\n */\nexport interface Artist {\n id: string;\n name: string;\n /** MusicBrainz artist id, absent until enrichment resolves one */\n mbid?: string;\n /** Absolute upstream URL, or an API-relative path to the local copy */\n imageUrl?: string;\n rating?: Rating;\n /** Unmerged albums credited to this artist */\n albumCount: number;\n /** Unmerged tracks credited to this artist */\n trackCount: number;\n}\n\nexport interface ArtistInput {\n name: string;\n /** MusicBrainz artist id, absent until enrichment resolves one */\n mbid?: string;\n /** Absolute upstream URL, or an API-relative path to the local copy */\n imageUrl?: string;\n rating?: Rating;\n}\n\n/**\n * generated from [Album](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L36)\n */\nexport interface Album {\n id: string;\n name: string;\n artistId: string;\n /** Joined, so a list renders without a second request per row */\n artistName: string;\n /** MusicBrainz release-group id, absent until enrichment resolves one */\n mbid?: string;\n year?: number;\n /** Absolute upstream URL, or an API-relative path to the local copy */\n imageUrl?: string;\n rating?: Rating;\n trackCount: number;\n}\n\nexport interface AlbumInput {\n name: string;\n /** MusicBrainz release-group id, absent until enrichment resolves one */\n mbid?: string;\n year?: number;\n /** Absolute upstream URL, or an API-relative path to the local copy */\n imageUrl?: string;\n rating?: Rating;\n}\n\n/**\n * generated from [Track](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L48)\n */\nexport interface Track {\n id: string;\n title: string;\n artistId: string;\n artistName: string;\n /** Absent on a single ingested outside any release: `tracks.album_id` is nullable */\n albumId?: string;\n albumName?: string;\n /** The record's cover, in the two spellings `Album.imageUrl` has. Nothing hangs art off a recording */\n albumImageUrl?: string;\n /** Display credit as written on the release (\"X feat. Y\"), not a join key */\n artists: string;\n genre?: string;\n year?: number;\n durationMs?: number;\n rating?: Rating;\n}\n\nexport interface TrackInput {\n title: string;\n /** Display credit as written on the release (\"X feat. Y\"), not a join key */\n artists: string;\n genre?: string;\n year?: number;\n durationMs?: number;\n rating?: Rating;\n}\n\n/**\n * Pagination plus a name filter. Every list operation here takes it, so the console's search box\n * narrows server-side rather than filtering one page client-side and lying about the total.\n * generated from [CatalogQuery](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L159)\n */\nexport interface CatalogQuery extends Pagination {\n search?: string;\n sortBy?: CatalogSort;\n}\n\nexport interface CatalogQueryInput extends PaginationInput {\n search?: string;\n sortBy?: CatalogSort;\n}\n\n/**\n * `releaseDate` is a string and not `datetime` because it is a partial date: MusicBrainz answers\n * `1997`, `1997-06` or `1997-06-24` depending on what is actually known about the release, and the\n * SDK types it the same way. A `datetime` would reject the first two or invent a day and a time\n * for them, which is a precision the source never claimed.\n * generated from [TrackEnrichmentData](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L260)\n */\nexport interface TrackEnrichmentData {\n artist?: string;\n title?: string;\n album?: string;\n year?: number;\n releaseDate?: string;\n genres?: string[];\n moods?: string[];\n biography?: string;\n /** Short lines, each independently speakable */\n facts?: string[];\n /** Not an integer: a tempo a source measured rather than declared is fractional */\n bpm?: number;\n musicalKey?: string;\n label?: string;\n isrc?: string;\n artworkUrl?: string;\n externalIds?: EnrichmentExternalId[];\n links?: EnrichmentLink[];\n /** What the plugin said that the SDK has no field for. Per provider only: the merged view drops it */\n extra?: Record<string, unknown>;\n}\n\n/**\n * generated from [ArtistEnrichmentData](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L280)\n */\nexport interface ArtistEnrichmentData {\n name?: string;\n biography?: string;\n imageUrl?: string;\n genres?: string[];\n facts?: string[];\n externalIds?: EnrichmentExternalId[];\n links?: EnrichmentLink[];\n extra?: Record<string, unknown>;\n}\n\n/**\n * generated from [AlbumEnrichmentData](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L291)\n */\nexport interface AlbumEnrichmentData {\n name?: string;\n /** The record's own credit, which is not always the track's */\n artist?: string;\n year?: number;\n /** Partial, exactly as on TrackEnrichmentData */\n releaseDate?: string;\n label?: string;\n genres?: string[];\n facts?: string[];\n artworkUrl?: string;\n externalIds?: EnrichmentExternalId[];\n links?: EnrichmentLink[];\n extra?: Record<string, unknown>;\n}\n\n/**\n * One page of artists, with the totals the request was counted against\n * generated from [ArtistPage](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L224)\n */\nexport interface ArtistPage {\n meta: Pagination;\n data: Artist[];\n}\n\nexport interface ArtistPageInput {\n meta: PaginationInput;\n data: ArtistInput[];\n}\n\n/**\n * One page of albums\n * generated from [AlbumPage](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L229)\n */\nexport interface AlbumPage {\n meta: Pagination;\n data: Album[];\n}\n\nexport interface AlbumPageInput {\n meta: PaginationInput;\n data: AlbumInput[];\n}\n\n/**\n * Everything one record has accumulated, in one read.\n *\n * The enrichment is deliberately NOT here. It has its own operation already, answering\n * `TrackEnrichmentDetail` with every provider's payload and the station's own sourced claims, and\n * the console draws it through the same panel the list uses. One enrichment shape rather than two.\n * generated from [TrackDetail](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L120)\n */\nexport interface TrackDetail extends Track {\n bindings: TrackBinding[];\n /** Absent for a record the walk has not reached */\n analysis?: TrackAnalysis;\n /** The most recent airings, newest first */\n plays: TrackPlay[];\n /** How many times in all, which the list above is only the head of */\n playCount: number;\n}\n\nexport interface TrackDetailInput extends TrackInput {\n bindings: TrackBindingInput[];\n /** Absent for a record the walk has not reached */\n analysis?: TrackAnalysisInput;\n /** The most recent airings, newest first */\n plays: TrackPlayInput[];\n}\n\n/** Rehydrates every wire-encoded scalar in a TrackDetail into its runtime type. Mutates and returns `raw`. */\nexport function reviveTrackDetail(raw: TrackDetail): TrackDetail {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['bindings'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveTrackBinding(__a1[__i2] as never);\n }\n }\n if (__o0['analysis'] != null) {\n reviveTrackAnalysis(__o0['analysis'] as never);\n }\n {\n const __a3 = __o0['plays'] as unknown[];\n for (let __i4 = 0; __i4 < __a3.length; __i4++) {\n reviveTrackPlay(__a3[__i4] as never);\n }\n }\n return raw;\n}\n\n/**\n * A track as a LIST shows it: the record, plus three facts about what the station has of it.\n *\n * Three booleans and no more, deliberately. They are what a row can afford — one `exists` each, off\n * the query that was already running — and everything wider (which providers, how many bytes, why the\n * last fetch failed) is `TrackDetail`'s, one click away. A fourth would be the beginning of putting\n * the detail page in a table cell.\n * generated from [TrackRow](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L211)\n */\nexport interface TrackRow extends Track {\n /** The bytes are on this machine */\n hasAudio: boolean;\n /** Measured, COMPLETE, and at a schema version the station still trusts */\n measured: boolean;\n /** At least one provider has answered about it */\n enriched: boolean;\n}\n\nexport interface TrackRowInput extends TrackInput {}\n\n/**\n * A track list, narrowed by what the station has of each record as well as by name.\n *\n * Its own contract rather than a field on `CatalogQuery`, because that one is shared with the artist\n * and album lists where none of these states means anything.\n * generated from [TrackQuery](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L185)\n */\nexport interface TrackQuery extends Omit<CatalogQuery, 'sortBy'> {\n state?: TrackState;\n sortBy?: TrackSort;\n}\n\nexport interface TrackQueryInput extends Omit<CatalogQueryInput, 'sortBy'> {\n state?: TrackState;\n sortBy?: TrackSort;\n}\n\n/**\n * One provider's stored answer. `found: false` is a recorded miss, which is a fact rather than a\n * failure: the provider was asked, had nothing, and is not asked again until `expiresAt`. A provider\n * that could not be asked at all is `failed` instead, and the two never both hold.\n * generated from [TrackEnrichmentSource](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L308)\n */\nexport interface TrackEnrichmentSource {\n provider: string;\n /** The id it was fetched under. Provenance, not identity */\n providerRef?: string;\n fetchedAt: DateTime;\n expiresAt?: DateTime;\n /** Past its TTL, so the next pass will ask again */\n stale: boolean;\n found: boolean;\n /** The last attempt errored, so `expiresAt` is a backoff rather than a TTL */\n failed: boolean;\n data: TrackEnrichmentData;\n}\n\nexport interface TrackEnrichmentSourceInput {\n data: TrackEnrichmentData;\n}\n\n/** Rehydrates every wire-encoded scalar in a TrackEnrichmentSource into its runtime type. Mutates and returns `raw`. */\nexport function reviveTrackEnrichmentSource(raw: TrackEnrichmentSource): TrackEnrichmentSource {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['fetchedAt'] = __dt(__o0['fetchedAt'], 'TrackEnrichmentSource.fetchedAt');\n if (__o0['expiresAt'] != null) {\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'TrackEnrichmentSource.expiresAt');\n }\n return raw;\n}\n\n/**\n * generated from [ArtistEnrichmentSource](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L319)\n */\nexport interface ArtistEnrichmentSource {\n provider: string;\n providerRef?: string;\n fetchedAt: DateTime;\n expiresAt?: DateTime;\n stale: boolean;\n found: boolean;\n /** The last attempt errored, so `expiresAt` is a backoff rather than a TTL */\n failed: boolean;\n data: ArtistEnrichmentData;\n}\n\nexport interface ArtistEnrichmentSourceInput {\n data: ArtistEnrichmentData;\n}\n\n/** Rehydrates every wire-encoded scalar in a ArtistEnrichmentSource into its runtime type. Mutates and returns `raw`. */\nexport function reviveArtistEnrichmentSource(raw: ArtistEnrichmentSource): ArtistEnrichmentSource {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['fetchedAt'] = __dt(__o0['fetchedAt'], 'ArtistEnrichmentSource.fetchedAt');\n if (__o0['expiresAt'] != null) {\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'ArtistEnrichmentSource.expiresAt');\n }\n return raw;\n}\n\n/**\n * generated from [AlbumEnrichmentSource](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L330)\n */\nexport interface AlbumEnrichmentSource {\n provider: string;\n providerRef?: string;\n fetchedAt: DateTime;\n expiresAt?: DateTime;\n stale: boolean;\n found: boolean;\n /** The last attempt errored, so `expiresAt` is a backoff rather than a TTL */\n failed: boolean;\n data: AlbumEnrichmentData;\n}\n\nexport interface AlbumEnrichmentSourceInput {\n data: AlbumEnrichmentData;\n}\n\n/** Rehydrates every wire-encoded scalar in a AlbumEnrichmentSource into its runtime type. Mutates and returns `raw`. */\nexport function reviveAlbumEnrichmentSource(raw: AlbumEnrichmentSource): AlbumEnrichmentSource {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['fetchedAt'] = __dt(__o0['fetchedAt'], 'AlbumEnrichmentSource.fetchedAt');\n if (__o0['expiresAt'] != null) {\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'AlbumEnrichmentSource.expiresAt');\n }\n return raw;\n}\n\n/**\n * One page of tracks, with what the station has of each and of the whole set\n * generated from [TrackPage](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L234)\n */\nexport interface TrackPage {\n meta: Pagination;\n data: TrackRow[];\n states: TrackStateCounts;\n}\n\nexport interface TrackPageInput {\n meta: PaginationInput;\n data: TrackRowInput[];\n states: TrackStateCountsInput;\n}\n\n/**\n * Every provider's answer, plus the same merge the promotion step used, so the console and the\n * canonical columns cannot tell different stories. `sources` is empty on a row the walk has not\n * reached yet.\n *\n * `claims` sits beside them rather than inside `merged`, because a claim is the host's own and not\n * any provider's. The articles they were read out of are deliberately NOT here: raw source prose is\n * stored and never sent.\n * generated from [TrackEnrichmentDetail](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L364)\n */\nexport interface TrackEnrichmentDetail {\n trackId: string;\n merged: TrackEnrichmentData;\n sources: TrackEnrichmentSource[];\n claims: FactClaim[];\n}\n\nexport interface TrackEnrichmentDetailInput {\n merged: TrackEnrichmentData;\n sources: TrackEnrichmentSourceInput[];\n claims: FactClaimInput[];\n}\n\n/** Rehydrates every wire-encoded scalar in a TrackEnrichmentDetail into its runtime type. Mutates and returns `raw`. */\nexport function reviveTrackEnrichmentDetail(raw: TrackEnrichmentDetail): TrackEnrichmentDetail {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['sources'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveTrackEnrichmentSource(__a1[__i2] as never);\n }\n }\n {\n const __a3 = __o0['claims'] as unknown[];\n for (let __i4 = 0; __i4 < __a3.length; __i4++) {\n reviveFactClaim(__a3[__i4] as never);\n }\n }\n return raw;\n}\n\n/**\n * generated from [ArtistEnrichmentDetail](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L371)\n */\nexport interface ArtistEnrichmentDetail {\n artistId: string;\n merged: ArtistEnrichmentData;\n sources: ArtistEnrichmentSource[];\n claims: FactClaim[];\n}\n\nexport interface ArtistEnrichmentDetailInput {\n merged: ArtistEnrichmentData;\n sources: ArtistEnrichmentSourceInput[];\n claims: FactClaimInput[];\n}\n\n/** Rehydrates every wire-encoded scalar in a ArtistEnrichmentDetail into its runtime type. Mutates and returns `raw`. */\nexport function reviveArtistEnrichmentDetail(raw: ArtistEnrichmentDetail): ArtistEnrichmentDetail {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['sources'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveArtistEnrichmentSource(__a1[__i2] as never);\n }\n }\n {\n const __a3 = __o0['claims'] as unknown[];\n for (let __i4 = 0; __i4 < __a3.length; __i4++) {\n reviveFactClaim(__a3[__i4] as never);\n }\n }\n return raw;\n}\n\n/**\n * generated from [AlbumEnrichmentDetail](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L378)\n */\nexport interface AlbumEnrichmentDetail {\n albumId: string;\n merged: AlbumEnrichmentData;\n sources: AlbumEnrichmentSource[];\n claims: FactClaim[];\n}\n\nexport interface AlbumEnrichmentDetailInput {\n merged: AlbumEnrichmentData;\n sources: AlbumEnrichmentSourceInput[];\n claims: FactClaimInput[];\n}\n\n/** Rehydrates every wire-encoded scalar in a AlbumEnrichmentDetail into its runtime type. Mutates and returns `raw`. */\nexport function reviveAlbumEnrichmentDetail(raw: AlbumEnrichmentDetail): AlbumEnrichmentDetail {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['sources'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveAlbumEnrichmentSource(__a1[__i2] as never);\n }\n }\n {\n const __a3 = __o0['claims'] as unknown[];\n for (let __i4 = 0; __i4 < __a3.length; __i4++) {\n reviveFactClaim(__a3[__i4] as never);\n }\n }\n return raw;\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson, buildQueryString } from '../sdk-options.js';\nimport type {\n Album,\n AlbumEnrichmentDetail,\n AlbumPage,\n Artist,\n ArtistEnrichmentDetail,\n ArtistPage,\n CatalogQueryInput,\n ClearEnrichmentQuery,\n RateInput,\n Track,\n TrackClearResult,\n TrackDetail,\n TrackEnrichmentDetail,\n TrackPage,\n TrackQueryInput,\n} from './types/catalog.types.js';\nimport { reviveAlbumEnrichmentDetail, reviveArtistEnrichmentDetail, reviveTrackDetail, reviveTrackEnrichmentDetail } from './types/catalog.types.js';\n\nexport class CatalogClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List artists\n * @description Every artist the station has ingested, ordered by name\n */\n async listArtists(query?: CatalogQueryInput): Promise<ArtistPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/catalog/artists${qs}`, {\n method: 'GET',\n });\n return await parseJson<ArtistPage>(result);\n }\n\n /**\n * @name Get artist\n * @description One artist. 404s on an id that was merged away, since reads never return merged rows\n */\n async getArtist(id: string): Promise<Artist> {\n const result = await this.fetch(`/catalog/artists/${encodeURIComponent(id)}`, { method: 'GET' });\n return await parseJson<Artist>(result);\n }\n\n /**\n * @name Get artist enrichment\n * @description What every enrichment provider said about this artist, and when each of them said it\n */\n async getArtistEnrichment(id: string): Promise<ArtistEnrichmentDetail> {\n const result = await this.fetch(`/catalog/artists/${encodeURIComponent(id)}/enrichment`, { method: 'GET' });\n return reviveArtistEnrichmentDetail(await parseJson<ArtistEnrichmentDetail>(result));\n }\n\n /**\n * @name List artist albums\n * @description The albums credited to one artist\n */\n async listArtistAlbums(id: string, query?: CatalogQueryInput): Promise<AlbumPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/catalog/artists/${encodeURIComponent(id)}/albums${qs}`, {\n method: 'GET',\n });\n return await parseJson<AlbumPage>(result);\n }\n\n /**\n * @name Rate artist\n * @description What the station thinks of this artist. A dislike here excludes every record they are credited on\n */\n async rateArtist(id: string, body: RateInput): Promise<Artist> {\n const result = await this.fetch(`/catalog/artists/${encodeURIComponent(id)}/rating`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<Artist>(result);\n }\n\n /** @name List albums */\n async listAlbums(query?: CatalogQueryInput): Promise<AlbumPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/catalog/albums${qs}`, {\n method: 'GET',\n });\n return await parseJson<AlbumPage>(result);\n }\n\n /** @name Get album */\n async getAlbum(id: string): Promise<Album> {\n const result = await this.fetch(`/catalog/albums/${encodeURIComponent(id)}`, { method: 'GET' });\n return await parseJson<Album>(result);\n }\n\n /**\n * @name Get album enrichment\n * @description The record's own enrichment: the label, pressing and cover belong to the release, not to a track on it\n */\n async getAlbumEnrichment(id: string): Promise<AlbumEnrichmentDetail> {\n const result = await this.fetch(`/catalog/albums/${encodeURIComponent(id)}/enrichment`, { method: 'GET' });\n return reviveAlbumEnrichmentDetail(await parseJson<AlbumEnrichmentDetail>(result));\n }\n\n /**\n * @name List album tracks\n * @description One album's tracks\n */\n async listAlbumTracks(id: string, query?: TrackQueryInput): Promise<TrackPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/catalog/albums/${encodeURIComponent(id)}/tracks${qs}`, {\n method: 'GET',\n });\n return await parseJson<TrackPage>(result);\n }\n\n /**\n * @name Rate album\n * @description What the station thinks of this record. A dislike here excludes every track on it\n */\n async rateAlbum(id: string, body: RateInput): Promise<Album> {\n const result = await this.fetch(`/catalog/albums/${encodeURIComponent(id)}/rating`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<Album>(result);\n }\n\n /**\n * @name Get track\n * @description One record and everything it has accumulated: its copies, its bytes, its measurement, what it has aired\n */\n async getTrack(id: string): Promise<TrackDetail> {\n const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}`, { method: 'GET' });\n return reviveTrackDetail(await parseJson<TrackDetail>(result));\n }\n\n /**\n * @name Clear track audio\n * @description Drop the station's own copies of this record. The next play fetches them again\n */\n async clearTrackAudio(id: string): Promise<TrackClearResult> {\n const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/audio`, { method: 'DELETE' });\n return await parseJson<TrackClearResult>(result);\n }\n\n /**\n * @name Clear track analysis\n * @description Forget the measurement, so the walk takes it again\n */\n async clearTrackAnalysis(id: string): Promise<TrackClearResult> {\n const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/analysis`, { method: 'DELETE' });\n return await parseJson<TrackClearResult>(result);\n }\n\n /**\n * @name Retry track audio\n * @description Try this record's copies again now, rather than when the backoff says\n */\n async retryTrackAudio(id: string): Promise<TrackClearResult> {\n const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/retry`, { method: 'POST' });\n return await parseJson<TrackClearResult>(result);\n }\n\n /**\n * @name Offer track copies again\n * @description Put copies a provider refused back on offer, and clear their backoff so they are tried now\n */\n async offerTrackCopiesAgain(id: string): Promise<TrackClearResult> {\n const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/offer`, { method: 'POST' });\n return await parseJson<TrackClearResult>(result);\n }\n\n /**\n * @name Get track enrichment\n * @description What the providers said about one recording, including everything no canonical column holds\n */\n async getTrackEnrichment(id: string): Promise<TrackEnrichmentDetail> {\n const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/enrichment`, { method: 'GET' });\n return reviveTrackEnrichmentDetail(await parseJson<TrackEnrichmentDetail>(result));\n }\n\n /**\n * @name Clear track enrichment\n * @description Forget what the providers said, so the enrichment pass asks again\n */\n async clearTrackEnrichment(id: string, query?: ClearEnrichmentQuery): Promise<TrackClearResult> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/enrichment${qs}`, {\n method: 'DELETE',\n });\n return await parseJson<TrackClearResult>(result);\n }\n\n /**\n * @name List tracks\n * @description Every track, flat. The only way to answer \"do we have this song?\" without knowing its artist\n */\n async listTracks(query?: TrackQueryInput): Promise<TrackPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/catalog/tracks${qs}`, {\n method: 'GET',\n });\n return await parseJson<TrackPage>(result);\n }\n\n /**\n * @name Rate track\n * @description What the station thinks of this song, which is the narrowest thing an opinion can be about\n */\n async rateTrack(id: string, body: RateInput): Promise<Track> {\n const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/rating`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<Track>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson, buildQueryString } from '../sdk-options.js';\nimport type { ChartPage, ChartQuery, StationChartList } from './types/charts.types.js';\n\nexport class ChartsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List charts\n * @description Every chart every installed chart plugin currently offers\n */\n async listCharts(): Promise<StationChartList> {\n const result = await this.fetch(`/charts`, { method: 'GET' });\n return await parseJson<StationChartList>(result);\n }\n\n /**\n * @name Read chart\n * @description One chart's records, ranked\n */\n async readChart(id: string, query?: ChartQuery): Promise<ChartPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/charts/${encodeURIComponent(id)}${qs}`, {\n method: 'GET',\n });\n return await parseJson<ChartPage>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\nimport type { ClockBandInput, ClockBandList } from './types/clock.types.js';\nimport type {\n AddStationSegmentInput,\n AddStationTrackInput,\n ExtendStationInput,\n HoldStationInput,\n MoveStationItemInput,\n PutOnAirInput,\n ReplanStationInput,\n SetStationAirInput,\n SetStationHostInput,\n StationAir,\n StationOrder,\n} from './types/director.types.js';\n\nexport class DirectorClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List clock bands\n * @description Every band on this station's clock, including the ones switched off, in the operator's own order\n */\n async listClockBands(): Promise<ClockBandList> {\n const result = await this.fetch(`/clock/bands`, { method: 'GET' });\n return await parseJson<ClockBandList>(result);\n }\n\n /**\n * @name Create clock band\n * @description Adds a band. It claims its first boundary on the next commit pass\n */\n async createClockBand(body: ClockBandInput): Promise<ClockBandList> {\n const result = await this.fetch(`/clock/bands`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<ClockBandList>(result);\n }\n\n /**\n * @name Update clock band\n * @description Rewrites one band. Breaks it has already planted stay where they are: the running order is the memory\n */\n async updateClockBand(id: string, body: ClockBandInput): Promise<ClockBandList> {\n const result = await this.fetch(`/clock/bands/${encodeURIComponent(id)}`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<ClockBandList>(result);\n }\n\n /**\n * @name Delete clock band\n * @description Removes a band, which costs it the boundaries it had not claimed yet and nothing else\n */\n async deleteClockBand(id: string): Promise<ClockBandList> {\n const result = await this.fetch(`/clock/bands/${encodeURIComponent(id)}`, { method: 'DELETE' });\n return await parseJson<ClockBandList>(result);\n }\n\n /**\n * @name Get station air\n * @description What the station is airing, and whether it is driving at all\n */\n async getStationAir(): Promise<StationAir> {\n const result = await this.fetch(`/director/air`, { method: 'GET' });\n return await parseJson<StationAir>(result);\n }\n\n /**\n * @name Put the station on air\n * @description Puts the station on air, building the running order from a playlist read at this moment. What is playing finishes: changing the programming is not a reason to cut a listener off mid-track\n */\n async putTheStationOnAir(body: PutOnAirInput): Promise<StationAir> {\n const result = await this.fetch(`/director/air`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<StationAir>(result);\n }\n\n /**\n * @name Set the air mode\n * @description Changes what puts the station on air: only while somebody is listening, or whenever there is a programme. Takes effect at once rather than at the next boundary\n */\n async setTheAirMode(body: SetStationAirInput): Promise<StationAir> {\n const result = await this.fetch(`/director/air`, {\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<StationAir>(result);\n }\n\n /**\n * @name Get the running order\n * @description The live running order, item by item, each saying where it has got to\n */\n async getTheRunningOrder(): Promise<StationOrder> {\n const result = await this.fetch(`/director/air/order`, { method: 'GET' });\n return await parseJson<StationOrder>(result);\n }\n\n /**\n * @name Recast the broadcast\n * @description Changes who is presenting this broadcast. Breaks already written for it in the outgoing character are written again in the new one\n */\n async recastTheBroadcast(body: SetStationHostInput): Promise<StationOrder> {\n const result = await this.fetch(`/director/air/persona`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<StationOrder>(result);\n }\n\n /**\n * @name Extend the running order\n * @description Queues a refill and returns at once. Generating a set walks the catalog, and an operator pressing a button should not be held open through it\n */\n async extendTheRunningOrder(body: ExtendStationInput): Promise<void> {\n await this.fetch(`/director/air/extend`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n }\n\n /**\n * @name Replan the running order\n * @description Queues a fresh set for everything the player is not already holding, and swaps it in once it exists. The old tail keeps playing until then, because emptying the running order first would take the station off air while the model was still choosing\n */\n async replanTheRunningOrder(body: ReplanStationInput): Promise<void> {\n await this.fetch(`/director/air/replan`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n }\n\n /**\n * @name Hold the station against the schedule\n * @description Holds the running order against the schedule, so a block boundary does not take back what an operator put on. A takeover is otherwise stamped with whichever slot was in force and is replaced when that block ends, which is correct and gives nobody any warning\n */\n async holdTheStationAgainstTheSchedule(body: HoldStationInput): Promise<StationAir> {\n const result = await this.fetch(`/director/air/hold`, {\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<StationAir>(result);\n }\n\n /**\n * @name Release the station to the schedule\n * @description Releases a hold, so the next block boundary changes the station over as it ordinarily would. A station with no hold is unchanged rather than refused\n */\n async releaseTheStationToTheSchedule(): Promise<StationAir> {\n const result = await this.fetch(`/director/air/hold`, { method: 'DELETE' });\n return await parseJson<StationAir>(result);\n }\n\n /**\n * @name Shuffle the running order\n * @description Shuffles the records not yet handed to the player, and plants the breaks again around the new sequence. The head is already in the player's hands and is left alone\n */\n async shuffleTheRunningOrder(): Promise<StationOrder> {\n const result = await this.fetch(`/director/air/shuffle`, { method: 'POST' });\n return await parseJson<StationOrder>(result);\n }\n\n /**\n * @name Add a segment to the running order\n * @description Puts something the station says into the running order. A segment with no audio yet is refused here rather than accepted and skipped when it comes round, so an operator is told why it cannot play\n */\n async addASegmentToTheRunningOrder(body: AddStationSegmentInput): Promise<StationOrder> {\n const result = await this.fetch(`/director/air/segments`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<StationOrder>(result);\n }\n\n /**\n * @name Add a record to the running order\n * @description Puts a catalog record into the running order. A record whose audio is not local yet is refused here rather than accepted and held or skipped when its slot comes round, so an operator asking for a specific one is told why it cannot play. What makes this worth having on its own is undo: dropping an item only ever marks a segment, but a track is spliced out of the order entirely, so nothing could put one back until this existed\n */\n async addARecordToTheRunningOrder(body: AddStationTrackInput): Promise<StationOrder> {\n const result = await this.fetch(`/director/air/tracks`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<StationOrder>(result);\n }\n\n /**\n * @name Move a running order item\n * @description Moves an item. A position already handed to the player is refused rather than clamped\n */\n async moveARunningOrderItem(itemId: string, body: MoveStationItemInput): Promise<StationOrder> {\n const result = await this.fetch(`/director/air/items/${encodeURIComponent(itemId)}`, {\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<StationOrder>(result);\n }\n\n /**\n * @name Remove a running order item\n * @description Drops an item that has not been handed to the player yet\n */\n async removeARunningOrderItem(itemId: string): Promise<StationOrder> {\n const result = await this.fetch(`/director/air/items/${encodeURIComponent(itemId)}`, { method: 'DELETE' });\n return await parseJson<StationOrder>(result);\n }\n\n /**\n * @name Skip to a running order item\n * @description Makes a record further down the running order the next thing heard. Everything still to come in front of it is marked skipped, anything the player was already holding from in front of it is taken back, and the item on air is cut. Only a record can be skipped to, and only one still to come\n */\n async skipToARunningOrderItem(itemId: string): Promise<StationOrder> {\n const result = await this.fetch(`/director/air/items/${encodeURIComponent(itemId)}/skip-to`, { method: 'POST' });\n return await parseJson<StationOrder>(result);\n }\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * One record the station actually played\n * generated from [HistoryEntry](../../../../../apps/api/data/contracts/history/history.types.ck#L7)\n */\nexport interface HistoryEntry {\n /** Unique across the history, and half of the cursor below */\n id: string;\n /** When it started, written when it began rather than when it was handed to the player */\n airedAt: DateTime;\n title: string;\n /** The credit as written, whole: one line rather than a list, because that is the shape a release credits itself in and splitting it renames acts with a comma in their name */\n artists: string;\n /** Absent for anything aired straight from a provider, which the catalog holds no record for */\n album?: string;\n /** The station's own copy where it has one, as a path under the API root, and the upstream URL until then. Resolve it against the base the station is reached at */\n artworkUrl?: string;\n /** How long the recording runs, from the catalog rather than from the copy that played */\n durationMs?: number;\n /** The catalog track this was, for a client that wants to ask more about it. Absent for a record the catalog does not hold, and for one it has since forgotten */\n trackId?: string;\n}\n\n/** Rehydrates every wire-encoded scalar in a HistoryEntry into its runtime type. Mutates and returns `raw`. */\nexport function reviveHistoryEntry(raw: HistoryEntry): HistoryEntry {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['airedAt'] = __dt(__o0['airedAt'], 'HistoryEntry.airedAt');\n return raw;\n}\n\n/**\n * One page of the history, newest first\n * generated from [HistoryQuery](../../../../../apps/api/data/contracts/history/history.types.ck#L18)\n */\nexport interface HistoryQuery {\n limit?: number;\n /** Where the previous page ended. Opaque, and a keyset rather than an offset because rows arrive at the head continuously: an offset would re-show a row on every page as the station kept playing under it. Pass back whatever `nextBefore` said and nothing else */\n before?: string;\n}\n\n/**\n * generated from [HistoryPage](../../../../../apps/api/data/contracts/history/history.types.ck#L23)\n */\nexport interface HistoryPage {\n entries: HistoryEntry[];\n /** The cursor for the page after this one, absent once the history has been read to its end */\n nextBefore?: string;\n}\n\n/** Rehydrates every wire-encoded scalar in a HistoryPage into its runtime type. Mutates and returns `raw`. */\nexport function reviveHistoryPage(raw: HistoryPage): HistoryPage {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['entries'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveHistoryEntry(__a1[__i2] as never);\n }\n }\n return raw;\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson, buildQueryString } from '../sdk-options.js';\nimport type { HistoryPage, HistoryQuery } from './types/history.types.js';\nimport { reviveHistoryPage } from './types/history.types.js';\n\nexport class HistoryClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name Read history\n * @description What the station played, newest first, one page at a time\n */\n async readHistory(query?: HistoryQuery): Promise<HistoryPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/history${qs}`, {\n method: 'GET',\n });\n return reviveHistoryPage(await parseJson<HistoryPage>(result));\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson, buildQueryString } from '../sdk-options.js';\nimport type { NewsPage, NewsQuery, StationFeedList } from './types/news.types.js';\n\nexport class NewsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List feeds\n * @description Every feed every installed news plugin currently offers\n */\n async listFeeds(): Promise<StationFeedList> {\n const result = await this.fetch(`/news/feeds`, { method: 'GET' });\n return await parseJson<StationFeedList>(result);\n }\n\n /**\n * @name Read news\n * @description Published entries, newest first\n */\n async readNews(query?: NewsQuery): Promise<NewsPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/news${qs}`, {\n method: 'GET',\n });\n return await parseJson<NewsPage>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson } from '../sdk-options.js';\nimport type { NowPlaying } from './types/nowplaying.types.js';\n\nexport class NowplayingClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name Get now playing\n * @description What is on air right now. Answers 200 with `onAir: false` when the station is quiet, so a device polling this treats silence as an answer rather than an error\n */\n async getNowPlaying(): Promise<NowPlaying> {\n const result = await this.fetch(`/nowplaying`, { method: 'GET' });\n return await parseJson<NowPlaying>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\nimport type { OnboardingRequirement, OnboardingRequirementInput } from './types/onboarding.types.js';\n\nexport class OnboardingClient {\n constructor(private fetch: SdkFetch) {}\n\n /** @name Get Onboarding Requirements */\n async getOnboardingRequirements(): Promise<OnboardingRequirement[]> {\n const result = await this.fetch(`/onboarding`, { method: 'GET' });\n return await parseJson<OnboardingRequirement[]>(result);\n }\n\n /** @name Submit Onboarding Requirement */\n async submitOnboardingRequirement(body: OnboardingRequirementInput): Promise<OnboardingRequirement[]> {\n const result = await this.fetch(`/onboarding`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<OnboardingRequirement[]>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\nimport type {\n GeneratedPersona,\n PersonaAudition,\n PersonaAuditionList,\n PersonaAuditionRequest,\n PersonaAuditionSummary,\n PersonaFile,\n PersonaImportPlan,\n PersonaImportResult,\n PersonaInput,\n PersonaList,\n PersonaNoteList,\n PersonaNoteState,\n PersonaNoteWrite,\n PersonaRehearsal,\n PersonaRequest,\n PersonaStoryDetailWrite,\n PersonaStoryList,\n PersonaStoryState,\n PersonaStoryWrite,\n} from './types/personas.types.js';\n\nexport class PersonasClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List persona auditions\n * @description Every audition of this character, newest first, without their breaks\n */\n async listPersonaAuditions(id: string): Promise<PersonaAuditionList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/auditions`, { method: 'GET' });\n return await parseJson<PersonaAuditionList>(result);\n }\n\n /**\n * @name Start persona audition\n * @description Asks the station to put this character through a playlist. It is queued, not written\n */\n async startPersonaAudition(id: string, body: PersonaAuditionRequest): Promise<PersonaAudition> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/auditions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaAudition>(result);\n }\n\n /**\n * @name Get persona audition\n * @description One audition with every break it has written so far, in order\n */\n async getPersonaAudition(id: string, auditionId: string): Promise<PersonaAudition> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/auditions/${encodeURIComponent(auditionId)}`, { method: 'GET' });\n return await parseJson<PersonaAudition>(result);\n }\n\n /**\n * @name Cancel persona audition\n * @description Stops an audition where it stands, keeping the breaks it has already written\n */\n async cancelPersonaAudition(id: string, auditionId: string): Promise<PersonaAuditionSummary> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/auditions/${encodeURIComponent(auditionId)}/cancel`, { method: 'POST' });\n return await parseJson<PersonaAuditionSummary>(result);\n }\n\n /**\n * @name List personas\n * @description Every persona this station has, oldest first\n */\n async listPersonas(): Promise<PersonaList> {\n const result = await this.fetch(`/personas`, { method: 'GET' });\n return await parseJson<PersonaList>(result);\n }\n\n /**\n * @name Create persona\n * @description Writes a new persona. It is not put on air by creating it\n */\n async createPersona(body: PersonaInput): Promise<PersonaList> {\n const result = await this.fetch(`/personas`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaList>(result);\n }\n\n /**\n * @name Generate persona\n * @description Turns a description of a character into a whole persona, checked against its own sample lines and handed back unsaved\n */\n async generatePersona(body: PersonaRequest): Promise<GeneratedPersona> {\n const result = await this.fetch(`/personas/generate`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<GeneratedPersona>(result);\n }\n\n /**\n * @name Restore station personas\n * @description Writes back whichever of the station's own personas this station is missing, touching nothing it already has and putting nothing on air\n */\n async restoreStationPersonas(): Promise<PersonaList> {\n const result = await this.fetch(`/personas/restore`, { method: 'POST' });\n return await parseJson<PersonaList>(result);\n }\n\n /**\n * @name Export personas\n * @description Every character this station holds, as one file\n */\n async exportPersonas(): Promise<{ data: PersonaFile; headers: { contentDisposition?: string } }> {\n const result = await this.fetch(`/personas/export`, { method: 'GET' });\n const data = await parseJson<PersonaFile>(result);\n return { data, headers: { contentDisposition: result.headers.get('Content-Disposition') ?? undefined } };\n }\n\n /**\n * @name Export persona\n * @description One character, its sheet and its stories, as a file\n */\n async exportPersona(id: string): Promise<{ data: PersonaFile; headers: { contentDisposition?: string } }> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/export`, { method: 'GET' });\n const data = await parseJson<PersonaFile>(result);\n return { data, headers: { contentDisposition: result.headers.get('Content-Disposition') ?? undefined } };\n }\n\n /**\n * @name Preview persona import\n * @description Reads a file and reports what importing it would create, rewrite and skip. Writes nothing\n */\n async previewPersonaImport(body: PersonaFile): Promise<PersonaImportPlan> {\n const result = await this.fetch(`/personas/import/preview`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaImportPlan>(result);\n }\n\n /**\n * @name Import personas\n * @description Writes a file into this station, merging by key, and answers with what it did\n */\n async importPersonas(body: PersonaFile): Promise<PersonaImportResult> {\n const result = await this.fetch(`/personas/import`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaImportResult>(result);\n }\n\n /**\n * @name Update persona\n * @description Rewrites one persona. An edit to the one on air is heard on the next break\n */\n async updatePersona(id: string, body: PersonaInput): Promise<PersonaList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaList>(result);\n }\n\n /**\n * @name Delete persona\n * @description Removes a persona, including the one on air, which leaves the station with none\n */\n async deletePersona(id: string): Promise<PersonaList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}`, { method: 'DELETE' });\n return await parseJson<PersonaList>(result);\n }\n\n /**\n * @name Set the station host\n * @description Makes this persona the station's own host, and the previous one no longer is\n */\n async setTheStationHost(id: string): Promise<PersonaList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/default-host`, { method: 'PUT' });\n return await parseJson<PersonaList>(result);\n }\n\n /**\n * @name List persona notes\n * @description Everything this character has accumulated, oldest first, in every state\n */\n async listPersonaNotes(id: string): Promise<PersonaNoteList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/notes`, { method: 'GET' });\n return await parseJson<PersonaNoteList>(result);\n }\n\n /**\n * @name Write persona note\n * @description Writes a note by hand. An operator's own note is active from the moment it exists; only the distil pass proposes\n */\n async writePersonaNote(id: string, body: PersonaNoteWrite): Promise<PersonaNoteList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/notes`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaNoteList>(result);\n }\n\n /**\n * @name Update persona note\n * @description Rewrites one note's words, whoever wrote it. Editing what the station proposed is most of the point of the panel\n */\n async updatePersonaNote(id: string, noteId: string, body: PersonaNoteWrite): Promise<PersonaNoteList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/notes/${encodeURIComponent(noteId)}`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaNoteList>(result);\n }\n\n /**\n * @name Delete persona note\n * @description Removes a note outright. Turning down a PROPOSAL is a state rather than this, or the next pass writes it again\n */\n async deletePersonaNote(id: string, noteId: string): Promise<PersonaNoteList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/notes/${encodeURIComponent(noteId)}`, { method: 'DELETE' });\n return await parseJson<PersonaNoteList>(result);\n }\n\n /**\n * @name Set persona note state\n * @description Accepts a proposal, turns one down, or rests an active note. Mirrors the lexicon's own state route\n */\n async setPersonaNoteState(id: string, noteId: string, body: PersonaNoteState): Promise<PersonaNoteList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/notes/${encodeURIComponent(noteId)}/state`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaNoteList>(result);\n }\n\n /**\n * @name List persona stories\n * @description Every story this character holds, oldest first, in every state\n */\n async listPersonaStories(id: string): Promise<PersonaStoryList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories`, { method: 'GET' });\n return await parseJson<PersonaStoryList>(result);\n }\n\n /**\n * @name Write persona story\n * @description Writes a story by hand. An operator's own is tellable from the moment it exists; only the enrichment pass proposes\n */\n async writePersonaStory(id: string, body: PersonaStoryWrite): Promise<PersonaStoryList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaStoryList>(result);\n }\n\n /**\n * @name Update persona story\n * @description Rewrites one story's handle and telling, whoever wrote it\n */\n async updatePersonaStory(id: string, storyId: string, body: PersonaStoryWrite): Promise<PersonaStoryList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaStoryList>(result);\n }\n\n /**\n * @name Delete persona story\n * @description Removes a story outright, details and all. Turning down a PROPOSAL is a state rather than this, or the next pass writes it again\n */\n async deletePersonaStory(id: string, storyId: string): Promise<PersonaStoryList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}`, { method: 'DELETE' });\n return await parseJson<PersonaStoryList>(result);\n }\n\n /**\n * @name Set persona story state\n * @description Accepts a proposal, turns one down, or takes a story out of the rotation without losing it\n */\n async setPersonaStoryState(id: string, storyId: string, body: PersonaStoryState): Promise<PersonaStoryList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}/state`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaStoryList>(result);\n }\n\n /**\n * @name Add persona story detail\n * @description Adds one thing to a story that already exists\n */\n async addPersonaStoryDetail(id: string, storyId: string, body: PersonaStoryDetailWrite): Promise<PersonaStoryList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}/details`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaStoryList>(result);\n }\n\n /**\n * @name Update persona story detail\n * @description Rewrites one detail's words\n */\n async updatePersonaStoryDetail(id: string, storyId: string, detailId: string, body: PersonaStoryDetailWrite): Promise<PersonaStoryList> {\n const result = await this.fetch(\n `/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}/details/${encodeURIComponent(detailId)}`,\n {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n },\n );\n return await parseJson<PersonaStoryList>(result);\n }\n\n /**\n * @name Delete persona story detail\n * @description Removes one detail, leaving the story it was hung on alone\n */\n async deletePersonaStoryDetail(id: string, storyId: string, detailId: string): Promise<PersonaStoryList> {\n const result = await this.fetch(\n `/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}/details/${encodeURIComponent(detailId)}`,\n { method: 'DELETE' },\n );\n return await parseJson<PersonaStoryList>(result);\n }\n\n /**\n * @name Set persona story detail state\n * @description Accepts a proposed detail or turns it down, which has to outlive the pass that proposed it\n */\n async setPersonaStoryDetailState(id: string, storyId: string, detailId: string, body: PersonaStoryState): Promise<PersonaStoryList> {\n const result = await this.fetch(\n `/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}/details/${encodeURIComponent(detailId)}/state`,\n {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n },\n );\n return await parseJson<PersonaStoryList>(result);\n }\n\n /**\n * @name Rehearse persona\n * @description Writes a talk break under this persona against two fixed invented records, and answers with every writer that was asked\n */\n async rehearsePersona(id: string): Promise<PersonaRehearsal> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/rehearse`, { method: 'POST' });\n return await parseJson<PersonaRehearsal>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson } from '../sdk-options.js';\nimport type { CatalogPlaylistPage, CatalogPlaylistTracks } from './types/playlists.types.js';\n\nexport class PlaylistsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List importable playlists\n * @description Fans out across every installed plugin that declares AND implements the `catalog` capability\n */\n async listImportablePlaylists(): Promise<CatalogPlaylistPage> {\n const result = await this.fetch(`/playlists`, { method: 'GET' });\n return await parseJson<CatalogPlaylistPage>(result);\n }\n\n /**\n * @name Get playlist tracks\n * @description One playlist's tracks from one plugin\n */\n async getPlaylistTracks(pluginId: string, playlistId: string): Promise<CatalogPlaylistTracks> {\n const result = await this.fetch(`/playlists/${encodeURIComponent(pluginId)}/${encodeURIComponent(playlistId)}/tracks`, { method: 'GET' });\n return await parseJson<CatalogPlaylistTracks>(result);\n }\n\n /**\n * @name Hide playlist\n * @description Hides one playlist from this station: the listing marks it hidden, the pickers stop offering it and the library sync stops reading it. Hiding one already hidden changes nothing\n */\n async hidePlaylist(pluginId: string, playlistId: string): Promise<void> {\n await this.fetch(`/playlists/${encodeURIComponent(pluginId)}/${encodeURIComponent(playlistId)}/hidden`, { method: 'PUT' });\n }\n\n /**\n * @name Show playlist\n * @description Shows a hidden playlist again. Showing one that is not hidden changes nothing\n */\n async showPlaylist(pluginId: string, playlistId: string): Promise<void> {\n await this.fetch(`/playlists/${encodeURIComponent(pluginId)}/${encodeURIComponent(playlistId)}/hidden`, { method: 'DELETE' });\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\nimport type { PlayoutChartInput, PlayoutPlaylistInput, PlayoutStatus } from './types/playout.types.js';\n\nexport class PlayoutClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name Get playout status\n * @description What the station is playing and what is queued behind it. The console polls this\n */\n async getPlayoutStatus(): Promise<PlayoutStatus> {\n const result = await this.fetch(`/playout/status`, { method: 'GET' });\n return await parseJson<PlayoutStatus>(result);\n }\n\n /**\n * @name Play a playlist\n * @description Loads a plugin playlist into the running order and starts handing it to the player. Replaces whatever was queued; what is on air finishes rather than being cut off\n */\n async playAPlaylist(body: PlayoutPlaylistInput): Promise<PlayoutStatus> {\n const result = await this.fetch(`/playout/playlist`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PlayoutStatus>(result);\n }\n\n /**\n * @name Play a chart\n * @description Builds the running order from a published chart and starts handing it to the player. The same replacement a playlist makes, from a document somebody else ranked\n */\n async playAChart(body: PlayoutChartInput): Promise<PlayoutStatus> {\n const result = await this.fetch(`/playout/chart`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PlayoutStatus>(result);\n }\n\n /**\n * @name Skip the current item\n * @description Ends the item on air so the next one starts immediately. The station owns the decoder, so this lands at once rather than waiting out audio already committed to a player\n */\n async skipTheCurrentItem(): Promise<PlayoutStatus> {\n const result = await this.fetch(`/playout/skip`, { method: 'POST' });\n return await parseJson<PlayoutStatus>(result);\n }\n\n /**\n * @name Start playout\n * @description Puts the station back on air with the running order it already has, picking it up where Stop left it. Distinct from putting a playlist on air, which builds a new broadcast and throws away what was there. Refused when there is nothing left to resume\n */\n async startPlayout(): Promise<PlayoutStatus> {\n const result = await this.fetch(`/playout/start`, { method: 'POST' });\n return await parseJson<PlayoutStatus>(result);\n }\n\n /**\n * @name Stop playout\n * @description Stands the station down: stops what is on air at once and hands the mount back. The running order is LEFT as it is, so `/playout/start` can pick it up where this stopped it. deadair holds the mount on a lease it renews while it has something to play, so stopping goes quiet rather than falling through to a bed nobody programmed\n */\n async stopPlayout(): Promise<PlayoutStatus> {\n const result = await this.fetch(`/playout/stop`, { method: 'POST' });\n return await parseJson<PlayoutStatus>(result);\n }\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * Lifecycle state of a plugin the host knows about\n * generated from [PluginStatus](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L7)\n */\nexport type PluginStatus = 'discovered' | 'disabled' | 'misconfigured' | 'active' | 'failed';\n\n/**\n * Where the station found a plugin: shipped inside the image, or installed by the operator into the plugins\n * directory on the data volume. Says nothing about trust; both kinds run inside the station with its privileges\n * generated from [PluginOrigin](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L11)\n */\nexport type PluginOrigin = 'bundled' | 'installed';\n\n/**\n * generated from [ConfigFieldType](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L13)\n */\nexport type ConfigFieldType = 'string' | 'text' | 'url' | 'secret' | 'number' | 'boolean' | 'select' | 'multiselect' | 'list' | 'note';\n\n/**\n * What a `number` field's value is measured in. The stored value is always in this unit; only the\n * control the operator touches changes, so a byte count stays a byte count everywhere it is read and\n * a `fraction` stays the share between 0 and 1 that the code multiplying by it wants\n * generated from [ConfigFieldUnit](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L18)\n */\nexport type ConfigFieldUnit = 'bytes' | 'fraction';\n\n/**\n * The control a field asks to be drawn with, where the ordinary one for its type reads badly. Opt-in\n * per field rather than inferred, because a slider is right for a value you feel for and wrong for\n * one you have to hit exactly, and `tags` is right for a comma-separated line that is really a SET\n * and wrong for one that is prose. Nothing about the stored value changes either way\n * generated from [ConfigFieldControl](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L24)\n */\nexport type ConfigFieldControl = 'slider' | 'tags';\n\n/**\n * One choice of a `select` config field\n * generated from [ConfigFieldOption](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L27)\n */\nexport interface ConfigFieldOption {\n value: string;\n label: string;\n}\n\n/**\n * Where a field's or a column's choices come from when only the console can enumerate them: the\n * station's own tables, the platform's zone list, the enabled plugins that can do one of four jobs,\n * or the models the selected model plugin currently offers. Resolved by the console either way\n * generated from [ConfigFieldOptionSource](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L35)\n */\nexport type ConfigFieldOptionSource =\n | 'station.newsCategories'\n | 'station.newsFeeds'\n | 'station.podcastShows'\n | 'intl.timeZones'\n | 'plugins.speech'\n | 'plugins.llm'\n | 'plugins.mixer'\n | 'plugins.analysis'\n | 'llm.models';\n\n/**\n * A plugin handed over from the browser. The generated client types the body as `FormData`, so\n * nothing checks this shape. It says what to send\n * generated from [PluginImport](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L93)\n */\nexport interface PluginImport {\n /** The gzip tarball npm pack writes: every entry under package/, holding package.json and the built code, at most 64 MB */\n file: Blob;\n}\n\n/**\n * generated from [PluginLogLevel](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L104)\n */\nexport type PluginLogLevel = 'debug' | 'info' | 'warn' | 'error';\n\n/**\n * A submitted settings form. Secret values arrive in here and are never echoed back\n * generated from [PluginConfigInput](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L136)\n */\nexport interface PluginConfigInput {\n config: Record<string, unknown>;\n}\n\n/**\n * What a plugin may do with a capability it asked for. Denied is the default and needs no row: a\n * capability is refused until somebody allows it, so \"never answered\" and \"refused\" are one state\n * generated from [GrantDecision](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L142)\n */\nexport type GrantDecision = 'allowed' | 'denied';\n\n/**\n * Outcome of the plugin's own `testConnection()`\n * generated from [PluginTestResult](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L166)\n */\nexport interface PluginTestResult {\n ok: boolean;\n message?: string;\n}\n\n/**\n * Where the console should send the browser to obtain the operator's consent. Reported rather than\n * redirected to: the route is behind the Bearer floor, so a browser cannot follow a redirect from it\n * generated from [PluginOAuthStart](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L184)\n */\nexport interface PluginOAuthStart {\n url: string;\n}\n\n/**\n * Outcome of an OAuth callback\n * generated from [PluginOAuthResult](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L189)\n */\nexport interface PluginOAuthResult {\n pluginId: string;\n ok: boolean;\n message?: string;\n}\n\n/**\n * generated from [PluginOAuthCallbackQuery](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L195)\n */\nexport interface PluginOAuthCallbackQuery {\n code?: string;\n state?: string;\n error?: string;\n ubi?: string;\n /**\n * What a desktop-style flow returns instead of `code`: the provider mints a token before the\n * consent screen and hands the same one back, which the plugin exchanges for a session. Last.fm's\n * auth works this way. Listed here because the route parses this query strictly, so an\n * undeclared parameter is a 400 before any plugin code runs\n */\n token?: string;\n}\n\n/**\n * Live choices for a plugin's config fields, keyed by field key, out of the plugin's own\n * `suggestConfigOptions()`. What `ConfigFieldDescriptor.options` cannot be: fixed when the manifest\n * was written, where these are whatever the operator's own server currently says\n * generated from [PluginFieldSuggestions](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L174)\n */\nexport interface PluginFieldSuggestions {\n /** Keys the plugin had nothing to say about are simply absent, rather than present and empty */\n fields: Record<string, ConfigFieldOption[]>;\n /**\n * False when the plugin does not implement suggestions at all, so a console can tell \"nothing to\n * suggest\" from \"asked and got nothing\", and draw a refresh control only where one would do something\n */\n supported: boolean;\n}\n\n/**\n * One column of a `list` field. Every ordinary cell is stored as a string in the row, so this describes the\n * control rather than the value; a `secret` cell is encrypted on its own and is never in the row at all\n * generated from [ConfigFieldColumn](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L39)\n */\nexport interface ConfigFieldColumn {\n key: string;\n label: string;\n type: 'string' | 'url' | 'select' | 'secret';\n required?: boolean;\n placeholder?: string;\n options?: ConfigFieldOption[];\n optionsFrom?: ConfigFieldOptionSource;\n /** Key of another column in the same list. This cell applies only to a row whose cell there holds one of `dependsOnValues`. Stronger than a field's `dependsOn`, which only hides a control: a cell that does not apply is neither sent by the console nor read by the host, so a `url` column that does not apply to a row contributes no hostname to the plugin's allowlist. A target this list does not declare, or a target cell still empty, shows the cell */\n dependsOn?: string;\n /** The values of the `dependsOn` cell this one applies to. Omitted means any non-empty value; ignored without a target */\n dependsOnValues?: string[];\n}\n\n/**\n * generated from [PluginLogEntry](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L106)\n */\nexport interface PluginLogEntry {\n ts: string;\n level: PluginLogLevel;\n /** Must match MAX_LINE_BYTES_CEILING in apps/api/src/logging/rotating.log.store.ts. Change both together */\n text: string;\n}\n\n/**\n * generated from [PluginLogQuery](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L118)\n */\nexport interface PluginLogQuery {\n limit?: number;\n level?: PluginLogLevel;\n}\n\n/**\n * generated from [PluginLogLevelInput](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L123)\n */\nexport interface PluginLogLevelInput {\n level: PluginLogLevel;\n}\n\n/**\n * One capability a plugin asked for, with the station's answer. The ask is the plugin's manifest and\n * the answer is a row, so a plugin that stops asking stops appearing here whatever was stored\n * generated from [PluginGrant](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L146)\n */\nexport interface PluginGrant {\n pluginId: string;\n pluginName: string;\n /** The host's own id for it, e.g. `network.open` */\n capability: string;\n /** What the host calls the capability */\n label: string;\n /** What allowing it opens up, in the station's words */\n describes: string;\n /** Why this plugin says it needs it, in the plugin's words */\n reason: string;\n decision: GrantDecision;\n}\n\n/**\n * generated from [PluginGrantInput](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L160)\n */\nexport interface PluginGrantInput {\n capability: string;\n decision: GrantDecision;\n}\n\n/**\n * Mirrors the plugin SDK's `ConfigField`: enough for a console to render the settings form with no per-plugin code\n * generated from [ConfigFieldDescriptor](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L52)\n */\nexport interface ConfigFieldDescriptor {\n key: string;\n label: string;\n type: ConfigFieldType;\n required?: boolean;\n default?: string | number | boolean;\n /** `number` only, and ignored elsewhere */\n unit?: ConfigFieldUnit;\n /** `slider` for a `number` with both `min` and `max`, `tags` for a `string` holding a comma-separated set */\n control?: ConfigFieldControl;\n /** How coarsely a `control` moves, in the field's own unit. Ignored without one, and defaults to 1 */\n step?: number;\n /** `number` only: the smallest value that will be accepted, inclusive */\n min?: number;\n /** `number` only: the largest value that will be accepted, inclusive */\n max?: number;\n placeholder?: string;\n help?: string;\n options?: ConfigFieldOption[];\n /** Choices only the console can enumerate. Merged where a plugin's own suggestions are, and outranked by them */\n optionsFrom?: ConfigFieldOptionSource;\n /** `list` only, and ignored elsewhere */\n columns?: ConfigFieldColumn[];\n /** Key of the field this one is only relevant to */\n dependsOn?: string;\n /** Key of the `number` field that is the upper end of the range this one opens, declared on the lower end only. Still two settings, each validated by name; the console draws them as one control whose handles cannot cross */\n rangeWith?: string;\n}\n\n/**\n * generated from [PluginLogPage](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L112)\n */\nexport interface PluginLogPage {\n pluginId: string;\n level: PluginLogLevel;\n /** Newest first, as the activity feed and the script history send. The download is the file as written, oldest first */\n entries: PluginLogEntry[];\n}\n\n/**\n * generated from [PluginGrantList](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L156)\n */\nexport interface PluginGrantList {\n /** Every capability every installed plugin is asking for, refused ones included */\n grants: PluginGrant[];\n}\n\n/**\n * A plugin as the settings list sees it. Carries no configured VALUES, only which secrets are set\n * generated from [PluginSummary](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L73)\n */\nexport interface PluginSummary {\n id: string;\n name: string;\n version: string;\n capabilities: string[];\n /** Whether the manifest declares the `trackFetcher` permission, so its records reach air through the station's own track fetcher and that fetcher needs its own authorization. Not the same as the `stream` capability, which a plugin that mints its own stream URLs declares too. Absent means it does not */\n usesTrackFetcher?: boolean;\n status: PluginStatus;\n origin: PluginOrigin;\n enabled: boolean;\n description?: string;\n icon?: string;\n configFields: ConfigFieldDescriptor[];\n /** Whether a value is currently stored, per `secret` field under its own key and per `secret` cell under `field/rowId/column`. Never the value itself */\n secretsConfigured: Record<string, boolean>;\n /** When this plugin was first ever enabled. Absent means it never has been, so the console asks before it is */\n firstEnabledAt?: DateTime;\n /** The last recorded failure. Absent means it is not currently unhappy */\n lastError?: string;\n /** When the breaker will probe this plugin again on its own. Absent means no probe is pending */\n nextProbeAt?: DateTime;\n}\n\nexport interface PluginSummaryInput {\n id: string;\n name: string;\n version: string;\n capabilities: string[];\n /** Whether the manifest declares the `trackFetcher` permission, so its records reach air through the station's own track fetcher and that fetcher needs its own authorization. Not the same as the `stream` capability, which a plugin that mints its own stream URLs declares too. Absent means it does not */\n usesTrackFetcher?: boolean;\n status: PluginStatus;\n origin: PluginOrigin;\n enabled: boolean;\n description?: string;\n icon?: string;\n configFields: ConfigFieldDescriptor[];\n /** Whether a value is currently stored, per `secret` field under its own key and per `secret` cell under `field/rowId/column`. Never the value itself */\n secretsConfigured: Record<string, boolean>;\n /** The last recorded failure. Absent means it is not currently unhappy */\n lastError?: string;\n}\n\n/** Rehydrates every wire-encoded scalar in a PluginSummary into its runtime type. Mutates and returns `raw`. */\nexport function revivePluginSummary(raw: PluginSummary): PluginSummary {\n const __o0 = raw as unknown as Record<string, unknown>;\n if (__o0['firstEnabledAt'] != null) {\n __o0['firstEnabledAt'] = __dt(__o0['firstEnabledAt'], 'PluginSummary.firstEnabledAt');\n }\n if (__o0['nextProbeAt'] != null) {\n __o0['nextProbeAt'] = __dt(__o0['nextProbeAt'], 'PluginSummary.nextProbeAt');\n }\n return raw;\n}\n\n/**\n * What an import did\n * generated from [PluginImportResult](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L98)\n */\nexport interface PluginImportResult {\n /** The id the imported plugin claimed */\n pluginId: string;\n /** The same version was already loaded, so the station runs the build it had until it restarts. False for a new plugin and for a new version */\n restartRequired: boolean;\n /** Every plugin, as the catalogue now stands. An import can take an older version away as well as add one */\n plugins: PluginSummary[];\n}\n\nexport interface PluginImportResultInput {\n /** The id the imported plugin claimed */\n pluginId: string;\n /** The same version was already loaded, so the station runs the build it had until it restarts. False for a new plugin and for a new version */\n restartRequired: boolean;\n /** Every plugin, as the catalogue now stands. An import can take an older version away as well as add one */\n plugins: PluginSummaryInput[];\n}\n\n/** Rehydrates every wire-encoded scalar in a PluginImportResult into its runtime type. Mutates and returns `raw`. */\nexport function revivePluginImportResult(raw: PluginImportResult): PluginImportResult {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['plugins'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n revivePluginSummary(__a1[__i2] as never);\n }\n }\n return raw;\n}\n\n/**\n * A summary plus the stored NON-SECRET configuration\n * generated from [PluginDetail](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L128)\n */\nexport interface PluginDetail extends PluginSummary {\n /** Absolute path of the plugin's directory on the station */\n dir: string;\n config: Record<string, unknown>;\n oauthConnected?: boolean;\n logLevel: PluginLogLevel;\n}\n\nexport interface PluginDetailInput extends PluginSummaryInput {\n /** Absolute path of the plugin's directory on the station */\n dir: string;\n config: Record<string, unknown>;\n oauthConnected?: boolean;\n logLevel: PluginLogLevel;\n}\n\n/** Rehydrates every wire-encoded scalar in a PluginDetail into its runtime type. Mutates and returns `raw`. */\nexport function revivePluginDetail(raw: PluginDetail): PluginDetail {\n revivePluginSummary(raw as never);\n return raw;\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson, buildQueryString } from '../sdk-options.js';\nimport type {\n PluginConfigInput,\n PluginDetail,\n PluginFieldSuggestions,\n PluginGrantInput,\n PluginGrantList,\n PluginImportResult,\n PluginLogLevelInput,\n PluginLogPage,\n PluginLogQuery,\n PluginOAuthCallbackQuery,\n PluginOAuthResult,\n PluginOAuthStart,\n PluginSummary,\n PluginTestResult,\n} from './types/plugins.types.js';\nimport { revivePluginDetail, revivePluginImportResult, revivePluginSummary } from './types/plugins.types.js';\n\nexport class PluginsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List plugins\n * @description Lists every plugin the host knows about\n */\n async listPlugins(): Promise<PluginSummary[]> {\n const result = await this.fetch(`/plugins`, { method: 'GET' });\n return (await parseJson<PluginSummary[]>(result)).map(revivePluginSummary);\n }\n\n /**\n * @name List plugin grants\n * @description Every capability an installed plugin is asking the operator for, with the answer so far\n */\n async listPluginGrants(): Promise<PluginGrantList> {\n const result = await this.fetch(`/plugins/grants`, { method: 'GET' });\n return await parseJson<PluginGrantList>(result);\n }\n\n /**\n * @name Rescan plugins\n * @description Rescans the mounted plugin directory: registers new plugins, unloads removed ones\n */\n async rescanPlugins(): Promise<PluginSummary[]> {\n const result = await this.fetch(`/plugins/rescan`, { method: 'POST' });\n return (await parseJson<PluginSummary[]>(result)).map(revivePluginSummary);\n }\n\n /**\n * @name Import plugin\n * @description Takes a plugin in from the browser as the tarball npm pack writes and puts it in the plugins directory. It lands disabled, and a newer version of an installed plugin replaces the older one\n */\n async importPlugin(body: FormData): Promise<PluginImportResult> {\n const result = await this.fetch(`/plugins/import`, {\n method: 'POST',\n body: body,\n });\n return revivePluginImportResult(await parseJson<PluginImportResult>(result));\n }\n\n /**\n * @name Get plugin\n * @description One plugin, including its stored non-secret configuration and last error\n */\n async getPlugin(id: string): Promise<PluginDetail> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}`, { method: 'GET' });\n return revivePluginDetail(await parseJson<PluginDetail>(result));\n }\n\n /**\n * @name Remove plugin\n * @description Removes a plugin the operator installed: stops it and deletes its folder. Its settings are kept, so importing it again brings them back. A bundled plugin is refused\n */\n async removePlugin(id: string): Promise<PluginSummary[]> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}`, { method: 'DELETE' });\n return (await parseJson<PluginSummary[]>(result)).map(revivePluginSummary);\n }\n\n /**\n * @name Update plugin configuration\n * @description Validates against the plugin's own config schema, encrypts secrets, persists, and reinitializes\n */\n async updatePluginConfiguration(id: string, body: PluginConfigInput): Promise<PluginDetail> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/config`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return revivePluginDetail(await parseJson<PluginDetail>(result));\n }\n\n /**\n * @name Enable plugin\n * @description Enables a plugin without resubmitting its configuration\n */\n async enablePlugin(id: string): Promise<PluginDetail> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/enable`, { method: 'POST' });\n return revivePluginDetail(await parseJson<PluginDetail>(result));\n }\n\n /**\n * @name Disable plugin\n * @description Disables a plugin and tears its instance down, keeping its configuration\n */\n async disablePlugin(id: string): Promise<PluginDetail> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/disable`, { method: 'POST' });\n return revivePluginDetail(await parseJson<PluginDetail>(result));\n }\n\n /**\n * @name Decide plugin grant\n * @description Answers one capability this plugin asked for. Takes effect on the next fetch, with no reload\n */\n async decidePluginGrant(id: string, body: PluginGrantInput): Promise<PluginGrantList> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/grants`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PluginGrantList>(result);\n }\n\n /**\n * @name Reload plugin\n * @description Reapplies the plugin's stored configuration: disposes the running instance and initializes it again\n */\n async reloadPlugin(id: string): Promise<PluginDetail> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/reload`, { method: 'POST' });\n return revivePluginDetail(await parseJson<PluginDetail>(result));\n }\n\n /**\n * @name Test plugin connection\n * @description Runs the plugin's own `testConnection()` through the invoker\n */\n async testPluginConnection(id: string): Promise<PluginTestResult> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/test`, { method: 'POST' });\n return await parseJson<PluginTestResult>(result);\n }\n\n /**\n * @name Suggest plugin config options\n * @description Asks the plugin what to offer for its config fields right now, through the invoker\n */\n async suggestPluginConfigOptions(id: string): Promise<PluginFieldSuggestions> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/config/suggestions`, { method: 'POST' });\n return await parseJson<PluginFieldSuggestions>(result);\n }\n\n /**\n * @name Get plugin logs\n * @description Returns the plugin's buffered log lines at or above the current log level\n */\n async getPluginLogs(id: string, query?: PluginLogQuery): Promise<PluginLogPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/logs${qs}`, {\n method: 'GET',\n });\n return await parseJson<PluginLogPage>(result);\n }\n\n /**\n * @name Download plugin logs\n * @description Streams the plugin's full retained log as a plain-text attachment\n */\n async downloadPluginLogs(id: string): Promise<{ data: string; headers: { contentDisposition?: string } }> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/logs/download`, { method: 'GET' });\n const data = await result.text();\n return { data, headers: { contentDisposition: result.headers.get('Content-Disposition') ?? undefined } };\n }\n\n /**\n * @name Set plugin log level\n * @description Sets the minimum severity the plugin's log store retains going forward\n */\n async setPluginLogLevel(id: string, body: PluginLogLevelInput): Promise<PluginDetail> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/logs/level`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return revivePluginDetail(await parseJson<PluginDetail>(result));\n }\n\n /**\n * @name Start plugin OAuth authorization\n * @description Reports where to send the operator for the provider's consent screen\n */\n async startPluginOAuthAuthorization(id: string): Promise<PluginOAuthStart> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/oauth/authorize`, { method: 'GET' });\n return await parseJson<PluginOAuthStart>(result);\n }\n\n /**\n * @name Disconnect plugin OAuth\n * @description Forgets the plugin's stored OAuth tokens and reinitializes it\n */\n async disconnectPluginOAuth(id: string): Promise<PluginDetail> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/oauth`, { method: 'DELETE' });\n return revivePluginDetail(await parseJson<PluginDetail>(result));\n }\n\n /**\n * @name Complete plugin OAuth authorization\n * @description Completes the flow. Anonymous: the provider redirects the browser here with no session of ours\n */\n async completePluginOAuthAuthorization(id: string, query?: PluginOAuthCallbackQuery): Promise<PluginOAuthResult> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/oauth/callback${qs}`, {\n method: 'GET',\n });\n return await parseJson<PluginOAuthResult>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson, buildQueryString } from '../sdk-options.js';\nimport type {\n StationDirectoryPage,\n StationDirectoryQuery,\n StationEpisode,\n StationEpisodePage,\n StationEpisodeQuery,\n StationShowList,\n} from './types/podcasts.types.js';\n\nexport class PodcastsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List shows\n * @description Every programme every installed podcast plugin carries\n */\n async listShows(): Promise<StationShowList> {\n const result = await this.fetch(`/podcasts/shows`, { method: 'GET' });\n return await parseJson<StationShowList>(result);\n }\n\n /**\n * @name Search podcast directory\n * @description Looks a show up in the directories the installed podcast plugins can search\n */\n async searchPodcastDirectory(query?: StationDirectoryQuery): Promise<StationDirectoryPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/podcasts/search${qs}`, {\n method: 'GET',\n });\n return await parseJson<StationDirectoryPage>(result);\n }\n\n /**\n * @name List episodes\n * @description The episodes the station knows about, newest first, with what it has done with each\n */\n async listEpisodes(query?: StationEpisodeQuery): Promise<StationEpisodePage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/podcasts/episodes${qs}`, {\n method: 'GET',\n });\n return await parseJson<StationEpisodePage>(result);\n }\n\n /**\n * @name Fetch episode\n * @description Fetches one episode's audio into the station's store now, rather than waiting for its slot to come near\n */\n async fetchEpisode(id: string): Promise<StationEpisode> {\n const result = await this.fetch(`/podcasts/episodes/${encodeURIComponent(id)}/fetch`, { method: 'POST' });\n return await parseJson<StationEpisode>(result);\n }\n\n /**\n * @name Refresh podcasts\n * @description Reads every show's feed again, in the background, rather than waiting for the next scheduled refresh\n */\n async refreshPodcasts(): Promise<void> {\n await this.fetch(`/podcasts/refresh`, { method: 'POST' });\n }\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * One person in a production: the presenter, or somebody cast to phone in. A snapshot rather than a\n * reference, because the persona it names may be edited or deleted while the programme is still being\n * made and what the turns were written as has to be what an operator reads back\n * generated from [ProductionCastMember](../../../../../apps/api/data/contracts/productions/productions.types.ck#L10)\n */\nexport interface ProductionCastMember {\n role: 'host' | 'caller';\n /** What they are called on air */\n name?: string;\n /** The persona key, for a link back to the character */\n persona?: string;\n}\n\n/**\n * What an operator asks for. Everything else about a production is decided by the passes that make it\n * generated from [ProductionRequest](../../../../../apps/api/data/contracts/productions/productions.types.ck#L39)\n */\nexport interface ProductionRequest {\n kind?: string;\n /** Absent is named after its kind and the moment it was asked for, which is what somebody taking a call now wants rather than a box to fill in */\n title?: string;\n brief?: string;\n personaId?: string;\n /** Absent takes the station's `render.productionWritingMode` */\n writingMode?: 'quick' | 'outlined' | 'polished';\n targetMs?: number;\n scheduledFor?: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a ProductionRequest into its runtime type. Mutates and returns `raw`. */\nexport function reviveProductionRequest(raw: ProductionRequest): ProductionRequest {\n const __o0 = raw as unknown as Record<string, unknown>;\n if (__o0['scheduledFor'] != null) {\n __o0['scheduledFor'] = __dt(__o0['scheduledFor'], 'ProductionRequest.scheduledFor');\n }\n return raw;\n}\n\n/**\n * Something the station makes rather than something it says: several beats of speech, written in several passes, that airs as one block\n * generated from [Production](../../../../../apps/api/data/contracts/productions/productions.types.ck#L17)\n */\nexport interface Production {\n id: string;\n /** What sort of production: podcast, bulletin, feature. Free text, so a station that wants a documentary strand needs no migration */\n kind: string;\n title: string;\n /** What was asked for, in the operator's own words. Distinct from the title, which is only a label */\n brief?: string;\n /** Who presents it. Absent falls back to the station's active persona when a pass runs */\n personaId?: string;\n /** How many passes to spend on it */\n writingMode: 'quick' | 'outlined' | 'polished';\n /** How long it should run. What the beat count and the per-beat word budgets are computed from */\n targetMs: number;\n /** `stitching` is the beats being joined into one piece of audio, and it leads to `ready` whether that worked or not */\n state: 'planned' | 'outlining' | 'drafting' | 'checking' | 'rendering' | 'stitching' | 'ready' | 'aired' | 'failed' | 'cancelled';\n /** Why making it did not work */\n error?: string;\n /** When it should air. Absent means as soon as it is made */\n scheduledFor?: DateTime;\n cancelledAt?: DateTime;\n /** How many beats exist so far, which is how far along the drafting is */\n beats: number;\n /** Who is on it, decided by the first pass that ran. Empty for one nobody has started, and for a programme the presenter reads alone */\n cast: ProductionCastMember[];\n createdAt: DateTime;\n}\n\nexport interface ProductionInput {\n /** What sort of production: podcast, bulletin, feature. Free text, so a station that wants a documentary strand needs no migration */\n kind: string;\n title: string;\n /** What was asked for, in the operator's own words. Distinct from the title, which is only a label */\n brief?: string;\n /** Who presents it. Absent falls back to the station's active persona when a pass runs */\n personaId?: string;\n /** How many passes to spend on it */\n writingMode: 'quick' | 'outlined' | 'polished';\n /** How long it should run. What the beat count and the per-beat word budgets are computed from */\n targetMs: number;\n /** When it should air. Absent means as soon as it is made */\n scheduledFor?: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a Production into its runtime type. Mutates and returns `raw`. */\nexport function reviveProduction(raw: Production): Production {\n const __o0 = raw as unknown as Record<string, unknown>;\n if (__o0['scheduledFor'] != null) {\n __o0['scheduledFor'] = __dt(__o0['scheduledFor'], 'Production.scheduledFor');\n }\n if (__o0['cancelledAt'] != null) {\n __o0['cancelledAt'] = __dt(__o0['cancelledAt'], 'Production.cancelledAt');\n }\n __o0['createdAt'] = __dt(__o0['createdAt'], 'Production.createdAt');\n return raw;\n}\n\n/**\n * generated from [ProductionList](../../../../../apps/api/data/contracts/productions/productions.types.ck#L34)\n */\nexport interface ProductionList {\n productions: Production[];\n}\n\nexport interface ProductionListInput {\n productions: ProductionInput[];\n}\n\n/** Rehydrates every wire-encoded scalar in a ProductionList into its runtime type. Mutates and returns `raw`. */\nexport function reviveProductionList(raw: ProductionList): ProductionList {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['productions'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveProduction(__a1[__i2] as never);\n }\n }\n return raw;\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\nimport type { Production, ProductionList, ProductionRequest } from './types/productions.types.js';\nimport { reviveProduction, reviveProductionList } from './types/productions.types.js';\n\nexport class ProductionsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List productions\n * @description Everything the station has made or is making, newest first\n */\n async listProductions(): Promise<ProductionList> {\n const result = await this.fetch(`/productions`, { method: 'GET' });\n return reviveProductionList(await parseJson<ProductionList>(result));\n }\n\n /**\n * @name Request production\n * @description Asks the station to make one. It is queued, not started\n */\n async requestProduction(body: ProductionRequest): Promise<Production> {\n const result = await this.fetch(`/productions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return reviveProduction(await parseJson<Production>(result));\n }\n\n /**\n * @name Cancel production\n * @description Stops a production being made, for good\n */\n async cancelProduction(id: string): Promise<Production> {\n const result = await this.fetch(`/productions/${encodeURIComponent(id)}/cancel`, { method: 'POST' });\n return reviveProduction(await parseJson<Production>(result));\n }\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * One thing the station can play that is not a record\n * generated from [Segment](../../../../../apps/api/data/contracts/render/render.types.ck#L7)\n */\nexport interface Segment {\n id: string;\n /** What sort of element it is: `ident`, `stinger`, `talkbreak`, `news` */\n kind: string;\n /** One state per stage of making it. Only `ready` can go on air; the station skips anything else rather than waiting for it */\n state: 'planned' | 'writing' | 'written' | 'rendering' | 'ready' | 'failed';\n /** What the console calls it, and what the mount is labelled with while it airs */\n label: string;\n /** Who made it: `library` for a file dropped into the inbox */\n source: string;\n /** Whether there is audio behind it yet */\n playable: boolean;\n /** The words, for anything that speaks. Absent for an imported recording */\n script?: string;\n /** The words as the speech engine was handed them: symbols said, years read as a person reads them, the station's pronunciation list applied. Absent until something has spoken it */\n spokenScript?: string;\n /** The file in the inbox this came from. The bytes were copied, so emptying the inbox does not take it off the air */\n sourcePath?: string;\n /** How long it runs. A display value: the player measures the audio itself */\n durationMs?: number;\n /** Why it is `failed` */\n error?: string;\n /** The station's own name for the voice this is said in, e.g. `host`. Absent means the speech plugin's default */\n voice?: string;\n /** How the words are read: `hushed` or `frantic`. Absent is the voice's own ordinary reading, which is nearly every segment */\n delivery?: string;\n}\n\n/**\n * Something for the station to say, before anything has said it\n * generated from [SegmentCreate](../../../../../apps/api/data/contracts/render/render.types.ck#L23)\n */\nexport interface SegmentCreate {\n /** What the console calls it, and what the mount is labelled with while it airs */\n label: string;\n /** The words to say */\n script: string;\n /** What sort of element it is. Defaults to `talkbreak` */\n kind?: string;\n /** A station voice name the speech plugin knows how to map. Absent uses its default */\n voice?: string;\n /** How to read the words: `hushed` or `frantic`, and refused otherwise. Absent is the voice's own ordinary reading. Dropped at render time by an engine that cannot perform it */\n delivery?: string;\n}\n\n/**\n * A recording arriving from the browser, as multipart form parts.\n *\n * Documentation rather than validation: a multipart body reaches the service as the raw parser and\n * the generated client types the body as `FormData`, so nothing checks this shape. It says what to\n * send\n * generated from [SegmentUpload](../../../../../apps/api/data/contracts/render/render.types.ck#L36)\n */\nexport interface SegmentUpload {\n /** The audio itself. mp3, wav, ogg, flac or m4a, and at most 50 MB */\n file: Blob;\n /** What sort of element it is, which is also the directory it is filed under. A kind nothing else uses becomes a bookable band on the format clock */\n kind: string;\n /** What the console calls it, and what the mount is labelled with while it airs. Derived from the filename when absent */\n label?: string;\n}\n\n/**\n * A voice the station can be asked to speak in\n * generated from [Voice](../../../../../apps/api/data/contracts/render/render.types.ck#L46)\n */\nexport interface Voice {\n /** What to pass as a segment's `voice`. Empty means the plugin's own default */\n id: string;\n /** What the console calls it */\n label: string;\n /** What it sounds like, or what it maps to on the engine */\n description?: string;\n}\n\n/**\n * Whether there are words, and if not, which way it went wrong\n * generated from [ScriptOutcome](../../../../../apps/api/data/contracts/render/render.types.ck#L59)\n */\nexport type ScriptOutcome = 'written' | 'declined' | 'failed';\n\n/**\n * A record a writer was told about, kept as it was told\n * generated from [ScriptNeighbour](../../../../../apps/api/data/contracts/render/render.types.ck#L61)\n */\nexport interface ScriptNeighbour {\n title: string;\n artist: string;\n /** What it was shown about the record. A break that said nothing interesting and one that was TOLD nothing interesting read the same from the script alone */\n facts?: string[];\n}\n\n/**\n * What the provider said the attempt cost, when it said anything\n * generated from [ScriptUsage](../../../../../apps/api/data/contracts/render/render.types.ck#L67)\n */\nexport interface ScriptUsage {\n inputTokens?: number;\n outputTokens?: number;\n totalTokens?: number;\n}\n\n/**\n * One turn of the conversation a writer sent\n * generated from [ScriptPromptMessage](../../../../../apps/api/data/contracts/render/render.types.ck#L73)\n */\nexport interface ScriptPromptMessage {\n role: string;\n content: string;\n}\n\n/**\n * What an operator thought of something the station said.\n *\n * The catalog's three spellings exactly, and deliberately not a second vocabulary: an opinion is an\n * opinion whether it is about a record or about a sentence, and `catalog/rating.ts` is the one place\n * the words and the column's numbers meet.\n *\n * `neutral` is a real answer rather than an absence. Rating something back to nothing is a thing an\n * operator does, and it has to be distinguishable from never having listened, which is the field\n * being absent on the attempt.\n * generated from [ScriptRating](../../../../../apps/api/data/contracts/render/render.types.ck#L110)\n */\nexport type ScriptRating = 'liked' | 'neutral' | 'disliked';\n\n/**\n * Words to hear before anything has aired them\n * generated from [SpeechPreviewRequest](../../../../../apps/api/data/contracts/render/render.types.ck#L131)\n */\nexport interface SpeechPreviewRequest {\n /** What to say. Far under a segment's 20000 because this is one break heard once, and the cap is what bounds a cache keyed on the words themselves */\n text: string;\n /** A station voice name, as a segment's `voice`. Absent uses the plugin's own default */\n voice?: string;\n /** How to read it, as a segment's `delivery`: `hushed` or `frantic`, and refused otherwise. Absent is the voice's own ordinary reading */\n delivery?: string;\n}\n\n/**\n * The window the counts cover\n * generated from [ScriptHistorySummaryQuery](../../../../../apps/api/data/contracts/render/render.types.ck#L138)\n */\nexport interface ScriptHistorySummaryQuery {\n /** How far back to count. Defaults to 24, and a week at most, because past that the nightly sweep may already have taken the rows and the count would quietly be of what survived rather than of what happened */\n hours?: number;\n}\n\n/**\n * One presenter's attempts in the window\n * generated from [ScriptHistorySummaryRow](../../../../../apps/api/data/contracts/render/render.types.ck#L142)\n */\nexport interface ScriptHistorySummaryRow {\n /** Absent means nobody was presenting, which is an ordinary state rather than a gap in the data */\n personaKey?: string;\n written: number;\n /** A decline is the writer registry working: the model had nothing to say and the floor covered for it */\n declined: number;\n failed: number;\n}\n\n/**\n * What one pass over the inbox did\n * generated from [SegmentScanResult](../../../../../apps/api/data/contracts/render/render.types.ck#L154)\n */\nexport interface SegmentScanResult {\n /** Audio files seen, whether or not they were already known */\n scanned: number;\n /** Segments the station did not have before this pass */\n imported: number;\n /** Files passed over: not audio it can serve, or unreadable */\n skipped: number;\n}\n\n/**\n * One name the station says differently from how it is written\n * generated from [Pronunciation](../../../../../apps/api/data/contracts/render/render.types.ck#L160)\n */\nexport interface Pronunciation {\n id: string;\n /** What appears in a script. Matched case-insensitively, and whole words only */\n written: string;\n /** What the engine is handed instead, untouched. EMPTY is meaningful: it drops the words, which is the honest reading for a marker that got into a title and is not a word */\n spoken: string;\n /** `active` is said. `suggested` is proposed and says nothing yet. `rejected` outlives the pass that proposed it, or the same article proposes it again forever */\n state: 'active' | 'suggested' | 'rejected';\n /** Who says so. `gloss` is a pronunciation key an encyclopaedia article printed for itself */\n origin: 'operator' | 'gloss';\n /** The article. Present on anything an operator did not type */\n sourceUrl?: string;\n /** The sentence that says so, as it stands in the article, which is what the decision is actually made on */\n sourceQuote?: string;\n /** What the article was about */\n subjectKind?: 'track' | 'album' | 'artist';\n subjectId?: string;\n createdAt: string;\n}\n\n/**\n * A name and how to say it\n * generated from [PronunciationWrite](../../../../../apps/api/data/contracts/render/render.types.ck#L177)\n */\nexport interface PronunciationWrite {\n written: string;\n /** Empty drops the words rather than saying them */\n spoken: string;\n}\n\n/**\n * Accepting a proposal, turning one down, or taking an entry out of use without losing it\n * generated from [PronunciationStateWrite](../../../../../apps/api/data/contracts/render/render.types.ck#L182)\n */\nexport interface PronunciationStateWrite {\n state: 'active' | 'suggested' | 'rejected';\n}\n\n/**\n * Which part of the lexicon to read\n * generated from [PronunciationQuery](../../../../../apps/api/data/contracts/render/render.types.ck#L186)\n */\nexport interface PronunciationQuery {\n /** Absent is all of it */\n state?: 'active' | 'suggested' | 'rejected';\n}\n\n/**\n * One sound on a soundboard, as the console draws it.\n *\n * `name` is what a script writes to hit it and `label` is what a person reads: two columns rather\n * than one, because a token for a model and prose for an operator are different things and the\n * filename produces both\n * generated from [Pad](../../../../../apps/api/data/contracts/render/render.types.ck#L195)\n */\nexport interface Pad {\n id: string;\n /** Which directory it arrived in. Provenance: what reaches it is a set */\n board: string;\n /** The keys of the sets it is on. Empty means it is in the library and nothing can hit it */\n sets: string[];\n /** What a script writes: `[sfx:airhorn]` */\n name: string;\n label: string;\n durationMs?: number;\n /** How loud it came out, once something measured it. Absent on a station with no analyzer, which is ordinary */\n loudnessLufs?: number;\n /** Who put the file there: `library` for one the operator dropped in, `upload` or `url` for one the console wrote. It decides whether the console may delete it */\n source: string;\n /** The file in the library directory it was imported from, so the console can say where it came from */\n sourcePath?: string;\n /** When it was last hit. Absent for one nothing has reached for yet */\n lastUsedAt?: DateTime;\n state: 'active' | 'rejected';\n}\n\nexport interface PadInput {\n /** Which directory it arrived in. Provenance: what reaches it is a set */\n board: string;\n /** What a script writes: `[sfx:airhorn]` */\n name: string;\n label: string;\n durationMs?: number;\n /** How loud it came out, once something measured it. Absent on a station with no analyzer, which is ordinary */\n loudnessLufs?: number;\n /** The file in the library directory it was imported from, so the console can say where it came from */\n sourcePath?: string;\n /** When it was last hit. Absent for one nothing has reached for yet */\n lastUsedAt?: DateTime;\n state: 'active' | 'rejected';\n}\n\n/** Rehydrates every wire-encoded scalar in a Pad into its runtime type. Mutates and returns `raw`. */\nexport function revivePad(raw: Pad): Pad {\n const __o0 = raw as unknown as Record<string, unknown>;\n if (__o0['lastUsedAt'] != null) {\n __o0['lastUsedAt'] = __dt(__o0['lastUsedAt'], 'Pad.lastUsedAt');\n }\n return raw;\n}\n\n/**\n * A sound arriving from the browser, as multipart form parts.\n *\n * Documentation rather than validation: a multipart body reaches the service as the raw parser and\n * the generated client types the body as `FormData`, so nothing checks this shape. It says what to\n * send\n * generated from [PadUpload](../../../../../apps/api/data/contracts/render/render.types.ck#L214)\n */\nexport interface PadUpload {\n /** The audio itself. mp3, wav, ogg, flac or m4a, and at most 25 MB */\n file: Blob;\n /** The directory it is filed under, which is also the set it joins. A new name makes both */\n board: string;\n /** What a script will write. Derived from the filename when absent, and the FILE is named after this either way */\n name?: string;\n /** What the console calls it. Derived from the filename when absent */\n label?: string;\n}\n\n/**\n * A sound the station is being told to go and get.\n *\n * The operator names the address, so this is them choosing a file exactly as dropping one in the\n * library is. Nothing inspects what comes back and nothing records a claim about its licence -- see\n * `docs/internals/render.md` under \"Pads\", whose line is redistribution rather than use\n * generated from [PadFetch](../../../../../apps/api/data/contracts/render/render.types.ck#L226)\n */\nexport interface PadFetch {\n /** Where the audio is. Followed once, bounded, and refused unless what comes back is a format the station serves */\n url: string;\n /** The directory it is filed under, which is also the set it joins */\n board: string;\n /** What a script will write. Derived from the address when absent */\n name?: string;\n label?: string;\n}\n\n/**\n * A named collection of pads: what a presenter is actually handed.\n *\n * One library, cut as many ways as an operator likes. `personas.soundboard` holds the `key`, so\n * renaming a set unpoints every persona naming it — which is why `personas` says who those are\n * generated from [PadSet](../../../../../apps/api/data/contracts/render/render.types.ck#L242)\n */\nexport interface PadSet {\n id: string;\n /** The slug a persona names. A directory in the pad library makes one of these */\n key: string;\n label: string;\n position: number;\n /** How many sounds are on it. Zero is ordinary: it is what a set looks like before anybody drops a file */\n pads: number;\n /** Who is pointed at it, so a rename or a delete can say what it is about to unpoint */\n personas: string[];\n}\n\nexport interface PadSetInput {\n /** The slug a persona names. A directory in the pad library makes one of these */\n key: string;\n label: string;\n position: number;\n}\n\n/**\n * A set an operator is naming, or renaming\n * generated from [PadSetWrite](../../../../../apps/api/data/contracts/render/render.types.ck#L251)\n */\nexport interface PadSetWrite {\n key: string;\n label: string;\n position?: number;\n}\n\n/**\n * Which pad, and whether it is on the set\n * generated from [PadSetMembership](../../../../../apps/api/data/contracts/render/render.types.ck#L257)\n */\nexport interface PadSetMembership {\n padId: string;\n on: boolean;\n}\n\n/**\n * Turning a pad down, or putting one back\n * generated from [PadState](../../../../../apps/api/data/contracts/render/render.types.ck#L262)\n */\nexport interface PadState {\n state: 'active' | 'rejected';\n}\n\n/**\n * What one pass over the pad library did\n * generated from [PadScanResult](../../../../../apps/api/data/contracts/render/render.types.ck#L266)\n */\nexport interface PadScanResult {\n /** Audio files seen, whether or not anything changed */\n scanned: number;\n /** Sounds the station did not have before */\n imported: number;\n /** Slots whose file changed under them, which every script naming them now plays */\n replaced: number;\n /** Sounds that reached the library but not their set, because it already answered to their name. In the library and unreachable until somebody says where they go */\n contested: number;\n /** Files passed over: not audio, unreadable, or named something no script could write */\n skipped: number;\n}\n\n/**\n * Everything the station can play that is not a record\n * generated from [SegmentList](../../../../../apps/api/data/contracts/render/render.types.ck#L42)\n */\nexport interface SegmentList {\n segments: Segment[];\n}\n\n/**\n * The voices the station's current speech plugin offers\n * generated from [VoiceList](../../../../../apps/api/data/contracts/render/render.types.ck#L52)\n */\nexport interface VoiceList {\n voices: Voice[];\n /** Which plugin answered. Absent when nothing can speak */\n pluginId?: string;\n /** Why there are no voices, when there are none */\n reason?: string;\n /** Which readings that plugin can perform right now, out of `hushed` and `frantic`. Absent or empty means none, which is most engines and is not a fault */\n deliveries?: string[];\n}\n\n/**\n * One page of what the station has written, newest first\n * generated from [ScriptHistoryQuery](../../../../../apps/api/data/contracts/render/render.types.ck#L116)\n */\nexport interface ScriptHistoryQuery {\n limit?: number;\n /** Where the previous page ended. Opaque, and a keyset rather than an offset because rows arrive at the head continuously. Pass back whatever `nextBefore` said and nothing else */\n before?: string;\n kind?: string;\n writer?: string;\n outcome?: ScriptOutcome;\n /** Everything ONE character has said. Absent is every character and none */\n personaKey?: string;\n /** Every attempt made for ONE break, which is how a console reaches the words behind an item of the running order. Absent is the whole history */\n segmentId?: string;\n}\n\n/**\n * One attempt to write something the station would say, including the ones that came to nothing\n * generated from [ScriptAttempt](../../../../../apps/api/data/contracts/render/render.types.ck#L78)\n */\nexport interface ScriptAttempt {\n id: string;\n at: DateTime;\n /** What sort of break it was for: `talkbreak`, `welcome`, `news` */\n kind: string;\n /** The binding that produced or declined it */\n writer: string;\n outcome: ScriptOutcome;\n /** Who was presenting, as the persona's own key. Absent means nobody was, which is an ordinary state. Stamped on every attempt including the declined ones, so a character whose model breaks are all being refused is visible rather than hidden behind the floor */\n personaKey?: string;\n label?: string;\n /** The words. Absent for an attempt that produced none */\n script?: string;\n /** How the writer chose to have the words read, `hushed` or `frantic`. Absent for an ordinary reading */\n delivery?: string;\n /** The model that said it, for a writer that used one */\n model?: string;\n /** What the line was rendered from, for a writer working from something an operator can edit */\n source?: string;\n /** Why, for anything that is not `written` */\n reason?: string;\n /** The segment this was for, while it is still known. The row outlives it */\n segmentId?: string;\n previous?: ScriptNeighbour;\n next?: ScriptNeighbour;\n /** How long the attempt took */\n durationMs?: number;\n usage?: ScriptUsage;\n /** The answer before anything read it. Only while `llm.captureWrites` is on */\n raw?: string;\n /** What the writer sent. Only while `llm.captureWrites` is on */\n prompt?: ScriptPromptMessage[];\n /** What the operator thought of it. ABSENT means nobody has said, which `neutral` does not */\n rating?: ScriptRating;\n}\n\nexport interface ScriptAttemptInput {\n id: string;\n at: DateTime;\n /** What sort of break it was for: `talkbreak`, `welcome`, `news` */\n kind: string;\n /** The binding that produced or declined it */\n writer: string;\n outcome: ScriptOutcome;\n /** Who was presenting, as the persona's own key. Absent means nobody was, which is an ordinary state. Stamped on every attempt including the declined ones, so a character whose model breaks are all being refused is visible rather than hidden behind the floor */\n personaKey?: string;\n label?: string;\n /** The words. Absent for an attempt that produced none */\n script?: string;\n /** How the writer chose to have the words read, `hushed` or `frantic`. Absent for an ordinary reading */\n delivery?: string;\n /** The model that said it, for a writer that used one */\n model?: string;\n /** What the line was rendered from, for a writer working from something an operator can edit */\n source?: string;\n /** Why, for anything that is not `written` */\n reason?: string;\n /** The segment this was for, while it is still known. The row outlives it */\n segmentId?: string;\n previous?: ScriptNeighbour;\n next?: ScriptNeighbour;\n /** How long the attempt took */\n durationMs?: number;\n usage?: ScriptUsage;\n /** The answer before anything read it. Only while `llm.captureWrites` is on */\n raw?: string;\n /** What the writer sent. Only while `llm.captureWrites` is on */\n prompt?: ScriptPromptMessage[];\n}\n\n/** Rehydrates every wire-encoded scalar in a ScriptAttempt into its runtime type. Mutates and returns `raw`. */\nexport function reviveScriptAttempt(raw: ScriptAttempt): ScriptAttempt {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['at'] = __dt(__o0['at'], 'ScriptAttempt.at');\n return raw;\n}\n\n/**\n * generated from [ScriptRatingInput](../../../../../apps/api/data/contracts/render/render.types.ck#L112)\n */\nexport interface ScriptRatingInput {\n rating: ScriptRating;\n}\n\n/**\n * What each presenter has written lately, and over how long\n * generated from [ScriptHistorySummary](../../../../../apps/api/data/contracts/render/render.types.ck#L149)\n */\nexport interface ScriptHistorySummary {\n /** The window actually counted, echoed so a console can label the numbers it draws */\n hours: number;\n rows: ScriptHistorySummaryRow[];\n}\n\n/**\n * The station's lexicon, oldest first\n * generated from [PronunciationList](../../../../../apps/api/data/contracts/render/render.types.ck#L173)\n */\nexport interface PronunciationList {\n pronunciations: Pronunciation[];\n}\n\n/**\n * Every sound the station holds, and the sets over it\n * generated from [PadList](../../../../../apps/api/data/contracts/render/render.types.ck#L233)\n */\nexport interface PadList {\n pads: Pad[];\n sets: PadSet[];\n}\n\nexport interface PadListInput {\n pads: PadInput[];\n sets: PadSetInput[];\n}\n\n/** Rehydrates every wire-encoded scalar in a PadList into its runtime type. Mutates and returns `raw`. */\nexport function revivePadList(raw: PadList): PadList {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['pads'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n revivePad(__a1[__i2] as never);\n }\n }\n return raw;\n}\n\n/**\n * generated from [ScriptHistoryPage](../../../../../apps/api/data/contracts/render/render.types.ck#L126)\n */\nexport interface ScriptHistoryPage {\n attempts: ScriptAttempt[];\n /** The cursor for the page after this one, absent once the history has been read to its end */\n nextBefore?: string;\n}\n\nexport interface ScriptHistoryPageInput {\n attempts: ScriptAttemptInput[];\n /** The cursor for the page after this one, absent once the history has been read to its end */\n nextBefore?: string;\n}\n\n/** Rehydrates every wire-encoded scalar in a ScriptHistoryPage into its runtime type. Mutates and returns `raw`. */\nexport function reviveScriptHistoryPage(raw: ScriptHistoryPage): ScriptHistoryPage {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['attempts'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveScriptAttempt(__a1[__i2] as never);\n }\n }\n return raw;\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson, buildQueryString, readContentType } from '../sdk-options.js';\nimport type {\n PadFetch,\n PadList,\n PadScanResult,\n PadSetMembership,\n PadSetWrite,\n PadState,\n PronunciationList,\n PronunciationQuery,\n PronunciationStateWrite,\n PronunciationWrite,\n ScriptAttempt,\n ScriptHistoryPage,\n ScriptHistoryQuery,\n ScriptHistorySummary,\n ScriptHistorySummaryQuery,\n ScriptRatingInput,\n Segment,\n SegmentCreate,\n SegmentList,\n SegmentScanResult,\n SpeechPreviewRequest,\n VoiceList,\n} from './types/render.types.js';\nimport { revivePadList, reviveScriptAttempt, reviveScriptHistoryPage } from './types/render.types.js';\n\nexport class RenderClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List segments\n * @description Everything the station can play that is not a record\n */\n async listSegments(): Promise<SegmentList> {\n const result = await this.fetch(`/segments`, { method: 'GET' });\n return await parseJson<SegmentList>(result);\n }\n\n /**\n * @name Create segment\n * @description Plans something for the station to say, and starts rendering it\n */\n async createSegment(body: SegmentCreate): Promise<Segment> {\n const result = await this.fetch(`/segments`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<Segment>(result);\n }\n\n /**\n * @name Upload segment\n * @description Takes a recording in from the browser and puts it in the library, ready to air\n */\n async uploadSegment(body: FormData): Promise<Segment> {\n const result = await this.fetch(`/segments/upload`, {\n method: 'POST',\n body: body,\n });\n return await parseJson<Segment>(result);\n }\n\n /**\n * @name Scan the segment inbox\n * @description Takes whatever audio is sitting in the inbox directory into the library. Safe to repeat: a segment is identified by its audio, so the same recording arriving twice is one segment\n */\n async scanTheSegmentInbox(): Promise<SegmentScanResult> {\n const result = await this.fetch(`/segments/scan`, { method: 'POST' });\n return await parseJson<SegmentScanResult>(result);\n }\n\n /**\n * @name Read script history\n * @description What the station has written lately, newest first, one page at a time\n */\n async readScriptHistory(query?: ScriptHistoryQuery): Promise<ScriptHistoryPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/scripts${qs}`, {\n method: 'GET',\n });\n return reviveScriptHistoryPage(await parseJson<ScriptHistoryPage>(result));\n }\n\n /**\n * @name Rate script\n * @description What the operator thought of this attempt. Nothing acts on it automatically\n */\n async rateScript(id: string, body: ScriptRatingInput): Promise<ScriptAttempt> {\n const result = await this.fetch(`/scripts/${encodeURIComponent(id)}/rating`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return reviveScriptAttempt(await parseJson<ScriptAttempt>(result));\n }\n\n /**\n * @name Read script summary\n * @description Write attempts by outcome, per presenter, over a recent window\n */\n async readScriptSummary(query?: ScriptHistorySummaryQuery): Promise<ScriptHistorySummary> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/scripts/summary${qs}`, {\n method: 'GET',\n });\n return await parseJson<ScriptHistorySummary>(result);\n }\n\n /**\n * @name List voices\n * @description The voices the station can be asked to speak in\n */\n async listVoices(): Promise<VoiceList> {\n const result = await this.fetch(`/voices`, { method: 'GET' });\n return await parseJson<VoiceList>(result);\n }\n\n /**\n * @name Get default voice sample\n * @description A short line spoken in whichever voice the plugin falls back to\n */\n async getDefaultVoiceSample(): Promise<\n | {\n status: 200;\n contentType: 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4';\n data: Blob;\n headers: { cacheControl?: string; etag?: string };\n }\n | { status: 304 }\n > {\n const result = await this.fetch(`/voices/sample`, {\n method: 'GET',\n expectStatuses: [304],\n });\n switch (result.status) {\n case 304:\n return { status: 304 };\n default:\n return {\n status: 200,\n contentType: readContentType(result) as 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4',\n data: await result.blob(),\n headers: { cacheControl: result.headers.get('cache-control') ?? undefined, etag: result.headers.get('etag') ?? undefined },\n };\n }\n }\n\n /**\n * @name Get voice sample\n * @description A short line spoken in one voice, so an operator can hear it before choosing it\n */\n async getVoiceSample(voiceId: string): Promise<\n | {\n status: 200;\n contentType: 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4';\n data: Blob;\n headers: { cacheControl?: string; etag?: string };\n }\n | { status: 304 }\n > {\n const result = await this.fetch(`/voices/${encodeURIComponent(voiceId)}/sample`, {\n method: 'GET',\n expectStatuses: [304],\n });\n switch (result.status) {\n case 304:\n return { status: 304 };\n default:\n return {\n status: 200,\n contentType: readContentType(result) as 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4',\n data: await result.blob(),\n headers: { cacheControl: result.headers.get('cache-control') ?? undefined, etag: result.headers.get('etag') ?? undefined },\n };\n }\n }\n\n /**\n * @name Preview speech\n * @description Speaks the caller's words in one voice, so a break can be heard before it is written for air\n */\n async previewSpeech(\n body: SpeechPreviewRequest,\n ): Promise<{ contentType: 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4'; data: Blob }> {\n const result = await this.fetch(`/voices/preview`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return {\n contentType: readContentType(result) as 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4',\n data: await result.blob(),\n };\n }\n\n /**\n * @name Delete segment\n * @description Removes a recording and the inbox file behind it, so the next scan does not read it back in\n */\n async deleteSegment(id: string): Promise<SegmentList> {\n const result = await this.fetch(`/segments/${encodeURIComponent(id)}`, { method: 'DELETE' });\n return await parseJson<SegmentList>(result);\n }\n\n /**\n * @name Get segment audio\n * @description The audio of one segment\n */\n async getSegmentAudio(id: string): Promise<\n | {\n status: 200;\n contentType: 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4';\n data: Blob;\n headers: { cacheControl?: string; etag?: string };\n }\n | { status: 304 }\n > {\n const result = await this.fetch(`/segments/${encodeURIComponent(id)}/audio`, {\n method: 'GET',\n expectStatuses: [304],\n });\n switch (result.status) {\n case 304:\n return { status: 304 };\n default:\n return {\n status: 200,\n contentType: readContentType(result) as 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4',\n data: await result.blob(),\n headers: { cacheControl: result.headers.get('cache-control') ?? undefined, etag: result.headers.get('etag') ?? undefined },\n };\n }\n }\n\n /**\n * @name Get stored audio\n * @description Audio out of the segment store, addressed by content rather than by row\n */\n async getStoredAudio(\n checksum: string,\n ext: string,\n ): Promise<\n | {\n status: 200;\n contentType: 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4';\n data: Blob;\n headers: { cacheControl?: string; etag?: string };\n }\n | { status: 304 }\n > {\n const result = await this.fetch(`/audio/${encodeURIComponent(checksum)}/${encodeURIComponent(ext)}`, {\n method: 'GET',\n expectStatuses: [304],\n });\n switch (result.status) {\n case 304:\n return { status: 304 };\n default:\n return {\n status: 200,\n contentType: readContentType(result) as 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4',\n data: await result.blob(),\n headers: { cacheControl: result.headers.get('cache-control') ?? undefined, etag: result.headers.get('etag') ?? undefined },\n };\n }\n }\n\n /**\n * @name List pronunciations\n * @description The station's lexicon: what it says, what has been proposed to it, and what it has turned down\n */\n async listPronunciations(query?: PronunciationQuery): Promise<PronunciationList> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/pronunciations${qs}`, {\n method: 'GET',\n });\n return await parseJson<PronunciationList>(result);\n }\n\n /**\n * @name Create pronunciation\n * @description Adds one the operator typed. It is said from the next render on\n */\n async createPronunciation(body: PronunciationWrite): Promise<PronunciationList> {\n const result = await this.fetch(`/pronunciations`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PronunciationList>(result);\n }\n\n /**\n * @name Update pronunciation\n * @description Rewrites one entry's words, whoever proposed it\n */\n async updatePronunciation(id: string, body: PronunciationWrite): Promise<PronunciationList> {\n const result = await this.fetch(`/pronunciations/${encodeURIComponent(id)}`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PronunciationList>(result);\n }\n\n /**\n * @name Delete pronunciation\n * @description Removes an entry outright. Turning a PROPOSAL down is a state rather than a deletion, because a deleted one comes back on the next pass\n */\n async deletePronunciation(id: string): Promise<PronunciationList> {\n const result = await this.fetch(`/pronunciations/${encodeURIComponent(id)}`, { method: 'DELETE' });\n return await parseJson<PronunciationList>(result);\n }\n\n /**\n * @name Set pronunciation state\n * @description Accepts a proposal, turns one down, or takes an entry out of use without losing what it said\n */\n async setPronunciationState(id: string, body: PronunciationStateWrite): Promise<PronunciationList> {\n const result = await this.fetch(`/pronunciations/${encodeURIComponent(id)}/state`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PronunciationList>(result);\n }\n\n /**\n * @name List pads\n * @description Every sound the station holds, board by board\n */\n async listPads(): Promise<PadList> {\n const result = await this.fetch(`/pads`, { method: 'GET' });\n return revivePadList(await parseJson<PadList>(result));\n }\n\n /**\n * @name Upload pad\n * @description Takes a sound in from the browser and puts it on a board. The file lands in the pad library on disk, so it survives a rebuild and an archive carries it\n */\n async uploadPad(body: FormData): Promise<PadList> {\n const result = await this.fetch(`/pads`, {\n method: 'POST',\n body: body,\n });\n return revivePadList(await parseJson<PadList>(result));\n }\n\n /**\n * @name Scan the pad library\n * @description Takes whatever audio is sitting in the pad library directory onto its board. Safe to repeat: a file nobody has touched is seen and left alone\n */\n async scanThePadLibrary(): Promise<PadScanResult> {\n const result = await this.fetch(`/pads/scan`, { method: 'POST' });\n return await parseJson<PadScanResult>(result);\n }\n\n /**\n * @name Fetch pad\n * @description Fetches a sound from an address and puts it on a board. The operator names the address, so this is them choosing a file exactly as dropping one in the library is\n */\n async fetchPad(body: PadFetch): Promise<PadList> {\n const result = await this.fetch(`/pads/fetch`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return revivePadList(await parseJson<PadList>(result));\n }\n\n /**\n * @name Delete pad\n * @description Removes a sound the console put there, and the file it wrote for it\n */\n async deletePad(id: string): Promise<PadList> {\n const result = await this.fetch(`/pads/${encodeURIComponent(id)}`, { method: 'DELETE' });\n return revivePadList(await parseJson<PadList>(result));\n }\n\n /**\n * @name Set pad state\n * @description Turns a sound down, or puts one back. Answers the whole rack, since one pad changing state is one row moving between two sections of the same page\n */\n async setPadState(id: string, body: PadState): Promise<PadList> {\n const result = await this.fetch(`/pads/${encodeURIComponent(id)}/state`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return revivePadList(await parseJson<PadList>(result));\n }\n\n /**\n * @name Get pad audio\n * @description The sound itself, so an operator can hear what they dropped in\n */\n async getPadAudio(id: string): Promise<\n | {\n status: 200;\n contentType: 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4';\n data: Blob;\n headers: { cacheControl?: string; etag?: string };\n }\n | { status: 304 }\n > {\n const result = await this.fetch(`/pads/${encodeURIComponent(id)}/audio`, {\n method: 'GET',\n expectStatuses: [304],\n });\n switch (result.status) {\n case 304:\n return { status: 304 };\n default:\n return {\n status: 200,\n contentType: readContentType(result) as 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4',\n data: await result.blob(),\n headers: { cacheControl: result.headers.get('cache-control') ?? undefined, etag: result.headers.get('etag') ?? undefined },\n };\n }\n }\n\n /**\n * @name Create pad set\n * @description Names a new set, or answers the one already under that key\n */\n async createPadSet(body: PadSetWrite): Promise<PadList> {\n const result = await this.fetch(`/pads/sets`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return revivePadList(await parseJson<PadList>(result));\n }\n\n /**\n * @name Update pad set\n * @description Renames a set. The KEY moves with it, so every persona naming the old one stops finding it\n */\n async updatePadSet(id: string, body: PadSetWrite): Promise<PadList> {\n const result = await this.fetch(`/pads/sets/${encodeURIComponent(id)}`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return revivePadList(await parseJson<PadList>(result));\n }\n\n /**\n * @name Delete pad set\n * @description Removes a set and its memberships, and no pads at all\n */\n async deletePadSet(id: string): Promise<PadList> {\n const result = await this.fetch(`/pads/sets/${encodeURIComponent(id)}`, { method: 'DELETE' });\n return revivePadList(await parseJson<PadList>(result));\n }\n\n /**\n * @name Set pad membership\n * @description Puts a pad on a set or takes it off. Refused where the set already answers to that name, because a script writes a name\n */\n async setPadMembership(id: string, body: PadSetMembership): Promise<PadList> {\n const result = await this.fetch(`/pads/sets/${encodeURIComponent(id)}/pads`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return revivePadList(await parseJson<PadList>(result));\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson, buildQueryString } from '../sdk-options.js';\nimport type { ScheduleNow, ScheduleSlotInput, ScheduleSlotList, ScheduleTimetable, ScheduleTimetableQuery } from './types/schedule.types.js';\n\nexport class ScheduleClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List schedule\n * @description Every slot in this station's schedule, earliest in the day first\n */\n async listSchedule(): Promise<ScheduleSlotList> {\n const result = await this.fetch(`/schedule`, { method: 'GET' });\n return await parseJson<ScheduleSlotList>(result);\n }\n\n /**\n * @name Create schedule slot\n * @description Adds a slot. The station does not change over until its start time comes round\n */\n async createScheduleSlot(body: ScheduleSlotInput): Promise<ScheduleSlotList> {\n const result = await this.fetch(`/schedule`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<ScheduleSlotList>(result);\n }\n\n /**\n * @name Read current slot\n * @description Which slot the clock says should be on, and which one the station is actually airing\n */\n async readCurrentSlot(): Promise<ScheduleNow> {\n const result = await this.fetch(`/schedule/current`, { method: 'GET' });\n return await parseJson<ScheduleNow>(result);\n }\n\n /**\n * @name Read timetable\n * @description The station's day as blocks, contiguous and gapless, for drawing\n */\n async readTimetable(query?: ScheduleTimetableQuery): Promise<ScheduleTimetable> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/schedule/timetable${qs}`, {\n method: 'GET',\n });\n return await parseJson<ScheduleTimetable>(result);\n }\n\n /**\n * @name Update schedule slot\n * @description Rewrites a slot. Takes effect at its next boundary rather than immediately\n */\n async updateScheduleSlot(id: string, body: ScheduleSlotInput): Promise<ScheduleSlotList> {\n const result = await this.fetch(`/schedule/${encodeURIComponent(id)}`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<ScheduleSlotList>(result);\n }\n\n /**\n * @name Delete schedule slot\n * @description Removes a slot. Whatever is on air stays on until the next slot begins\n */\n async deleteScheduleSlot(id: string): Promise<ScheduleSlotList> {\n const result = await this.fetch(`/schedule/${encodeURIComponent(id)}`, { method: 'DELETE' });\n return await parseJson<ScheduleSlotList>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\nimport type { StationSettings, StationSettingsInput } from './types/settings.types.js';\n\nexport class SettingsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name Get settings\n * @description Every station setting, its descriptor and its current value\n */\n async getSettings(): Promise<StationSettings> {\n const result = await this.fetch(`/settings`, { method: 'GET' });\n return await parseJson<StationSettings>(result);\n }\n\n /**\n * @name Update settings\n * @description Applies a submitted settings form and answers with the settings as they now stand\n */\n async updateSettings(body: StationSettingsInput): Promise<StationSettings> {\n const result = await this.fetch(`/settings`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<StationSettings>(result);\n }\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * Five values, where `PluginLogLevel` next door has four. The plugin enum is the narrower one on\n * purpose — that is the vocabulary a plugin's own `PluginLogger` offers — while `api.log` is written\n * by `DeadairLogger`, which tees every level the app-wide `Logger` has, `trace` included. Narrowing\n * here would make a `trace` line unrepresentable in the type of the surface that reads the file it\n * is in.\n * generated from [LogLevel](../../../../../apps/api/data/contracts/station/logs.types.ck#L12)\n */\nexport type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error';\n\n/**\n * One log file this install has, whether or not anything has been written to it\n * generated from [LogSource](../../../../../apps/api/data/contracts/station/logs.types.ck#L14)\n */\nexport interface LogSource {\n /** A closed set the API owns: `api`, `liquidsoap`, `shim`. Never a path */\n id: string;\n label: string;\n /** What writes it, in a sentence, because \"shim\" means nothing to somebody who has not read the tree */\n description: string;\n /** Whether the file is there at all. A station that never ran the stream has no stream logs, which is a state rather than a fault */\n present: boolean;\n /** Whether its lines carry a level, so the console knows whether to offer the filter */\n levels: boolean;\n /** Retained size across every segment. Zero when absent */\n bytes: number;\n /** Absent when nothing has ever been written */\n lastWriteAt?: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a LogSource into its runtime type. Mutates and returns `raw`. */\nexport function reviveLogSource(raw: LogSource): LogSource {\n const __o0 = raw as unknown as Record<string, unknown>;\n if (__o0['lastWriteAt'] != null) {\n __o0['lastWriteAt'] = __dt(__o0['lastWriteAt'], 'LogSource.lastWriteAt');\n }\n return raw;\n}\n\n/**\n * One line, as far as it could be read back\n * generated from [LogLine](../../../../../apps/api/data/contracts/station/logs.types.ck#L28)\n */\nexport interface LogLine {\n /** Absent on a line this API did not write, and on one of its own that did not parse */\n ts?: string;\n /** Absent for the same two reasons */\n level?: LogLevel;\n /** Must match MAX_LINE_BYTES_CEILING in apps/api/src/logging/rotating.log.store.ts. Change both together */\n text: string;\n}\n\n/**\n * generated from [LogQuery](../../../../../apps/api/data/contracts/station/logs.types.ck#L41)\n */\nexport interface LogQuery {\n limit?: number;\n /** Ignored by a source whose lines carry no level */\n level?: LogLevel;\n}\n\n/**\n * generated from [LogSourceList](../../../../../apps/api/data/contracts/station/logs.types.ck#L24)\n */\nexport interface LogSourceList {\n /** Every source, in a fixed order, including the ones that are not present */\n sources: LogSource[];\n}\n\n/** Rehydrates every wire-encoded scalar in a LogSourceList into its runtime type. Mutates and returns `raw`. */\nexport function reviveLogSourceList(raw: LogSourceList): LogSourceList {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['sources'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveLogSource(__a1[__i2] as never);\n }\n }\n return raw;\n}\n\n/**\n * generated from [LogPage](../../../../../apps/api/data/contracts/station/logs.types.ck#L34)\n */\nexport interface LogPage {\n sourceId: string;\n /** The minimum severity that was applied. Absent when the source carries no levels, so a filter that did nothing cannot look as though it worked */\n level?: LogLevel;\n /** Whether the read hit its byte budget, so the oldest line here is not the file's first */\n truncated: boolean;\n /** Newest first, as the plugin log page, the activity feed and the script history all send */\n lines: LogLine[];\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * One concrete thing an attention row is about, so the reason does not live a page away.\n *\n * The row above it counts and categorises; this names. \"4 records have no copy left that will play\"\n * is a category an operator can do nothing with until they know WHICH four and WHY each one, and\n * every one of those facts was already stored — the fetch error on `track_audio.last_error`, the\n * provider's refusal on `track_sources.playable` — and reachable only by finding the record and\n * hovering a cell on its page. This is that fact travelling with the row that counted it.\n * generated from [AttentionEvidence](../../../../../apps/api/data/contracts/station/station.types.ck#L14)\n */\nexport interface AttentionEvidence {\n /** The thing itself, as an operator would name it: a record's title and who made it */\n label: string;\n /** Why THIS one, in the station's own sentence. The row's `detail` says what the category means; this says what happened here */\n reason: string;\n /** The page holding the whole of it. Absent where there is no page for it, which the running order can hold: a record the catalog never ingested has none */\n route?: string;\n}\n\n/**\n * One loop the station runs, and when it last came round.\n *\n * Two timestamps and no verdict, because the loop cannot supply one: a five-second reconcile and a\n * nightly sweep are both healthy and no single threshold describes both. `Heartbeat` itself takes\n * this position — it answers how long it has been and lets the reader decide — and a `stalled`\n * boolean here would be this module inventing the threshold that file deliberately refuses to.\n *\n * `lastBeat` is absent until a loop finishes its first pass, which is why `startedAt` is there: from\n * the two of them a reader can tell a loop that has never completed anything from one that stopped.\n * generated from [StationHeartbeat](../../../../../apps/api/data/contracts/station/station.types.ck#L45)\n */\nexport interface StationHeartbeat {\n name: string;\n /** When the loop registered, which is when it was last (re)started */\n startedAt: DateTime;\n /** When it last completed a pass. Absent until it completes its first */\n lastBeat?: DateTime;\n}\n\nexport interface StationHeartbeatInput {}\n\n/** Rehydrates every wire-encoded scalar in a StationHeartbeat into its runtime type. Mutates and returns `raw`. */\nexport function reviveStationHeartbeat(raw: StationHeartbeat): StationHeartbeat {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['startedAt'] = __dt(__o0['startedAt'], 'StationHeartbeat.startedAt');\n if (__o0['lastBeat'] != null) {\n __o0['lastBeat'] = __dt(__o0['lastBeat'], 'StationHeartbeat.lastBeat');\n }\n return raw;\n}\n\n/**\n * How much of the library the station has actually looked at.\n *\n * The counts `/catalog/tracks` already answers with, lifted out of a page of rows: a check-up wants\n * the sentence \"13 of 581 measured\" without asking for thirteen tracks to get it.\n * generated from [StationBacklog](../../../../../apps/api/data/contracts/station/station.types.ck#L55)\n */\nexport interface StationBacklog {\n total: number;\n cached: number;\n measured: number;\n}\n\nexport interface StationBacklogInput {}\n\n/**\n * One thing that wants the operator's attention, or the fact that nothing does\n * generated from [AttentionItem](../../../../../apps/api/data/contracts/station/station.types.ck#L21)\n */\nexport interface AttentionItem {\n /** What this is, as a stable key: `silence`, `benchedCopies`, `noPersona`. The console groups and counts on it rather than on the sentence */\n code: string;\n /** `failure` is the station not doing its job, `warning` is something failing beside a station that is working, and `notice` is a thing nobody has set up yet. A notice is not a fault and must not be drawn as one */\n severity: 'failure' | 'warning' | 'notice';\n /** The line an operator reads first */\n title: string;\n /** The whole of it, in a sentence. Where the station already has words for a fact, these are those words rather than a second phrasing of them */\n detail: string;\n /** The console page that can do something about it */\n route: string;\n /** How many things this is about, where that is a number rather than a state */\n count?: number;\n /** A HANDFUL of the things this row is about, never all of them: this answer is polled and a row about four hundred records must not be four hundred sentences. `count` stays the true figure, and a console showing fewer than it says so */\n evidence?: AttentionEvidence[];\n}\n\n/**\n * One reading of the machinery, for a page that assembles the station's health.\n *\n * It carries ONLY the two signals nothing else exposes. Everything else a check-up shows — the\n * silence verdict, the listener count, what needs somebody, the plugin statuses, the disk — is\n * already on a contract the console reads, and composing them again here would be a second answer\n * that can disagree with the first. `/playout/status` in particular is polled every two seconds for\n * the transport strip, so asking for it a second way would be a second reading of the same fact.\n *\n * Each section is OPTIONAL and absent means that reader failed. A page saying what is wrong is the\n * worst place for one broken reader to take the whole answer down, which is the rule\n * `StationAttentionService` already works to. `revision` is the one exception and says so on its\n * own line: it cannot fail, so absent there means something else.\n *\n * The revision is on THIS contract rather than composed from `/health`, which also reports it, and\n * that is not the second-answer problem the paragraph above describes. Both read one string from one\n * place at boot, so they cannot disagree. What they differ in is who can reach them: `/health` is\n * `operation(internal)`, deliberately, so it generates no SDK method and the console cannot call it\n * — which would leave \"which build is this\" answerable only from a shell, the one thing carrying it\n * here exists to fix.\n * generated from [StationCheckup](../../../../../apps/api/data/contracts/station/station.types.ck#L80)\n */\nexport interface StationCheckup {\n /** When this reading was taken, so a stale page cannot pass itself off as now */\n readAt: DateTime;\n /** The commit this station was built from, as the image's `org.opencontainers.image.revision` label says it. Unlike the sections below, absent is not a failed reader: it means nothing stamped this build, which is what a development tree and a hand-built image both are */\n revision?: string;\n /** The release this station is, as the image's `org.opencontainers.image.version` label says it. Absent on the same terms as `revision` and for a second reason: only a tagged build carries one, so a station following `latest` reports a commit and no version */\n version?: string;\n heartbeats?: StationHeartbeat[];\n backlog?: StationBacklog;\n}\n\nexport interface StationCheckupInput {}\n\n/** Rehydrates every wire-encoded scalar in a StationCheckup into its runtime type. Mutates and returns `raw`. */\nexport function reviveStationCheckup(raw: StationCheckup): StationCheckup {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['readAt'] = __dt(__o0['readAt'], 'StationCheckup.readAt');\n if (__o0['heartbeats'] != null) {\n {\n const __a1 = __o0['heartbeats'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveStationHeartbeat(__a1[__i2] as never);\n }\n }\n }\n return raw;\n}\n\n/**\n * Everything wrong or waiting, worst first\n * generated from [StationAttention](../../../../../apps/api/data/contracts/station/station.types.ck#L32)\n */\nexport interface StationAttention {\n items: AttentionItem[];\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * Whether a call produced what it was asked for. Two values on purpose: every finer distinction —\n * timed out, was preempted, came back empty — is a fact the caller knew and the recorder did not, so\n * it lives in `detail` where it can be named\n * generated from [TraceOutcome](../../../../../apps/api/data/contracts/station/traces.types.ck#L10)\n */\nexport type TraceOutcome = 'ok' | 'failed';\n\n/**\n * One decision, folded: a job execution or a request\n * generated from [TraceDecision](../../../../../apps/api/data/contracts/station/traces.types.ck#L22)\n */\nexport interface TraceDecision {\n /** The job id or the request id. Already the station's correlation id, never generated for this */\n id: string;\n /** A queue name, or a method and path */\n kind: string;\n /** The decision that enqueued this one. Absent on a request, a cron job and anything at boot */\n parent?: string;\n /** When its first recorded call ended */\n at: DateTime;\n /** Wall clock, off the `job.run` span. Zero for a decision recorded before that span existed */\n ms: number;\n /** Everything it did, not counting the `job.run` that contains them */\n calls: number;\n /** How many of those did not produce what they were asked for */\n failed: number;\n}\n\n/** Rehydrates every wire-encoded scalar in a TraceDecision into its runtime type. Mutates and returns `raw`. */\nexport function reviveTraceDecision(raw: TraceDecision): TraceDecision {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['at'] = __dt(__o0['at'], 'TraceDecision.at');\n return raw;\n}\n\n/**\n * Which slice of the kept window to read\n * generated from [TracesQuery](../../../../../apps/api/data/contracts/station/traces.types.ck#L32)\n */\nexport interface TracesQuery {\n limit?: number;\n /** An exact queue name or route, for reading one kind of decision on its own */\n kind?: string;\n /** Only decisions carrying at least one failed call */\n failedOnly?: boolean;\n}\n\n/**\n * One call inside a decision, and what it cost\n * generated from [TraceSpan](../../../../../apps/api/data/contracts/station/traces.types.ck#L12)\n */\nexport interface TraceSpan {\n /** When the call ended, which is when its cost was known */\n at: DateTime;\n /** Dotted and stable: `job.run`, `plugin.invoke`, `llm.generate` */\n op: string;\n /** Which one: a plugin and its method, or a model */\n target?: string;\n /** How long it held, measured around the call rather than reported by it */\n ms: number;\n outcome: TraceOutcome;\n /** The failure, summarized to a shape rather than a stack */\n error?: string;\n /** Whatever this `op` is worth reading back: tokens, a finish reason, the bound it was given */\n detail?: Record<string, unknown>;\n}\n\n/** Rehydrates every wire-encoded scalar in a TraceSpan into its runtime type. Mutates and returns `raw`. */\nexport function reviveTraceSpan(raw: TraceSpan): TraceSpan {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['at'] = __dt(__o0['at'], 'TraceSpan.at');\n return raw;\n}\n\n/**\n * generated from [TracesPage](../../../../../apps/api/data/contracts/station/traces.types.ck#L38)\n */\nexport interface TracesPage {\n /** Newest first */\n decisions: TraceDecision[];\n /** How many the window holds before `limit`, so a page can say it is showing a slice */\n total: number;\n /** How many calls were read to answer, which is the honest cost of this page */\n spans: number;\n}\n\n/** Rehydrates every wire-encoded scalar in a TracesPage into its runtime type. Mutates and returns `raw`. */\nexport function reviveTracesPage(raw: TracesPage): TracesPage {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['decisions'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveTraceDecision(__a1[__i2] as never);\n }\n }\n return raw;\n}\n\n/**\n * One decision, its calls, and the decisions on either side of it\n * generated from [TraceDetail](../../../../../apps/api/data/contracts/station/traces.types.ck#L44)\n */\nexport interface TraceDetail {\n decision: TraceDecision;\n /** In the order they happened */\n spans: TraceSpan[];\n /** What enqueued this, when that decision is still inside the kept window */\n parent?: TraceDecision;\n /** What this one went on to enqueue */\n caused: TraceDecision[];\n}\n\n/** Rehydrates every wire-encoded scalar in a TraceDetail into its runtime type. Mutates and returns `raw`. */\nexport function reviveTraceDetail(raw: TraceDetail): TraceDetail {\n const __o0 = raw as unknown as Record<string, unknown>;\n reviveTraceDecision(__o0['decision'] as never);\n {\n const __a1 = __o0['spans'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveTraceSpan(__a1[__i2] as never);\n }\n }\n if (__o0['parent'] != null) {\n reviveTraceDecision(__o0['parent'] as never);\n }\n {\n const __a3 = __o0['caused'] as unknown[];\n for (let __i4 = 0; __i4 < __a3.length; __i4++) {\n reviveTraceDecision(__a3[__i4] as never);\n }\n }\n return raw;\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson, buildQueryString } from '../sdk-options.js';\nimport type { LogPage, LogQuery, LogSourceList } from './types/logs.types.js';\nimport { reviveLogSourceList } from './types/logs.types.js';\nimport type { StationAttention, StationCheckup } from './types/station.types.js';\nimport { reviveStationCheckup } from './types/station.types.js';\nimport type { TraceDetail, TracesPage, TracesQuery } from './types/traces.types.js';\nimport { reviveTraceDetail, reviveTracesPage } from './types/traces.types.js';\n\nexport class StationClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List logs\n * @description Every log this install has, present or not, with its size and when it was last written\n */\n async listLogs(): Promise<LogSourceList> {\n const result = await this.fetch(`/logs`, { method: 'GET' });\n return reviveLogSourceList(await parseJson<LogSourceList>(result));\n }\n\n /**\n * @name Read log\n * @description A tail of one log, newest first\n */\n async readLog(id: string, query?: LogQuery): Promise<LogPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/logs/${encodeURIComponent(id)}${qs}`, {\n method: 'GET',\n });\n return await parseJson<LogPage>(result);\n }\n\n /**\n * @name Download log\n * @description The retained log as a plain-text attachment, oldest first, as the file is written\n */\n async downloadLog(id: string): Promise<{ data: string; headers: { contentDisposition?: string } }> {\n const result = await this.fetch(`/logs/${encodeURIComponent(id)}/download`, { method: 'GET' });\n const data = await result.text();\n return { data, headers: { contentDisposition: result.headers.get('Content-Disposition') ?? undefined } };\n }\n\n /**\n * @name Read station attention\n * @description Everything wrong or waiting, worst first, each with the console page that can act on it\n */\n async readStationAttention(): Promise<StationAttention> {\n const result = await this.fetch(`/station/attention`, { method: 'GET' });\n return await parseJson<StationAttention>(result);\n }\n\n /**\n * @name Read station checkup\n * @description The loops the station runs and how much of the library it has looked at\n */\n async readStationCheckup(): Promise<StationCheckup> {\n const result = await this.fetch(`/station/checkup`, { method: 'GET' });\n return reviveStationCheckup(await parseJson<StationCheckup>(result));\n }\n\n /**\n * @name Read traces\n * @description Recent decisions, newest first, folded to one row each\n */\n async readTraces(query?: TracesQuery): Promise<TracesPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/traces${qs}`, {\n method: 'GET',\n });\n return reviveTracesPage(await parseJson<TracesPage>(result));\n }\n\n /**\n * @name Read trace\n * @description One decision: every call it made, and the decisions on either side of it\n */\n async readTrace(id: string): Promise<TraceDetail> {\n const result = await this.fetch(`/traces/${encodeURIComponent(id)}`, { method: 'GET' });\n return reviveTraceDetail(await parseJson<TraceDetail>(result));\n }\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * Which store, as a stable id the console can key off rather than a name it renders.\n * generated from [StorageStoreId](../../../../../apps/api/data/contracts/storage/storage.types.ck#L8)\n */\nexport type StorageStoreId = 'tracks' | 'art' | 'segments' | 'voices';\n\n/**\n * One content store: what is on disk, and what the database says should be.\n *\n * The two halves are deliberately separate numbers rather than one reconciled figure. They disagree\n * in two directions and each direction means something different — a file nothing claims is what a\n * crash between writing bytes and writing a row leaves behind, and a row whose file is gone is what\n * an operator emptying a directory leaves. Reporting one number would hide both.\n * generated from [StorageStore](../../../../../apps/api/data/contracts/storage/storage.types.ck#L16)\n */\nexport interface StorageStore {\n id: StorageStoreId;\n /** What to call it on a page */\n label: string;\n /** Where it is, so `du` and this can be compared */\n path: string;\n /** Files actually there */\n files: number;\n /** What they weigh */\n bytes: number;\n /** Rows pointing at a file. Absent when no table backs this store */\n rows?: number;\n /** What those rows say those files weigh. Absent where the table does not record a size */\n accountedBytes?: number;\n /** The limit an operator set, where the store has one. Absent means no limit */\n capBytes?: number;\n /** Files no row claims. Reported and never cleaned up automatically */\n orphanFiles: number;\n orphanBytes: number;\n /** Claims whose file is not there. The station re-fetches or re-renders these */\n rowsWithNoFile: number;\n}\n\nexport interface StorageStoreInput {}\n\n/**\n * Every store, plus the number an operator actually wants first.\n *\n * `readAt` is not decoration: the figures come from walking directories, which is real I/O on a\n * station holding tens of thousands of files, so the answer is cached for a short while and this is\n * what stops a page mistaking it for live.\n * generated from [StorageReport](../../../../../apps/api/data/contracts/storage/storage.types.ck#L35)\n */\nexport interface StorageReport {\n readAt: DateTime;\n totalFiles: number;\n totalBytes: number;\n stores: StorageStore[];\n}\n\nexport interface StorageReportInput {\n stores: StorageStoreInput[];\n}\n\n/** Rehydrates every wire-encoded scalar in a StorageReport into its runtime type. Mutates and returns `raw`. */\nexport function reviveStorageReport(raw: StorageReport): StorageReport {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['readAt'] = __dt(__o0['readAt'], 'StorageReport.readAt');\n return raw;\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson } from '../sdk-options.js';\nimport type { StorageReport } from './types/storage.types.js';\nimport { reviveStorageReport } from './types/storage.types.js';\n\nexport class StorageClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name Read storage\n * @description What is on disk, per store, against what the database says should be\n */\n async readStorage(): Promise<StorageReport> {\n const result = await this.fetch(`/storage`, { method: 'GET' });\n return reviveStorageReport(await parseJson<StorageReport>(result));\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\nimport type {\n FetcherAuthorization,\n FetcherAuthorizationFinished,\n FetcherAuthorizationInput,\n FetcherAuthorizationStart,\n} from './types/stream.types.js';\n\nexport class StreamClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name Get HLS playlist\n * @description One HLS playlist, and the tick that says somebody is still listening to it\n */\n async getHLSPlaylist(name: string): Promise<{ data: Blob; headers: { cacheControl?: string } }> {\n const result = await this.fetch(`/hls/${encodeURIComponent(name)}`, { method: 'GET' });\n const data = await result.blob();\n return { data, headers: { cacheControl: result.headers.get('cache-control') ?? undefined } };\n }\n\n /**\n * @name Read fetcher authorization\n * @description What the track fetcher holds by way of a Spotify login, and whether an authorization is already waiting to be finished\n */\n async readFetcherAuthorization(): Promise<FetcherAuthorization> {\n const result = await this.fetch(`/stream/authorization`, { method: 'GET' });\n return await parseJson<FetcherAuthorization>(result);\n }\n\n /**\n * @name Start fetcher authorization\n * @description Starts the fetcher's one-time authorization and answers with the URL to open. Starting another replaces whichever was pending\n */\n async startFetcherAuthorization(): Promise<FetcherAuthorizationStart> {\n const result = await this.fetch(`/stream/authorization`, { method: 'POST' });\n return await parseJson<FetcherAuthorizationStart>(result);\n }\n\n /**\n * @name Finish fetcher authorization\n * @description Finishes an authorization from the address the operator's browser ended up at\n */\n async finishFetcherAuthorization(body: FetcherAuthorizationInput): Promise<FetcherAuthorizationFinished> {\n const result = await this.fetch(`/stream/authorization/complete`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<FetcherAuthorizationFinished>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson, buildQueryString } from '../sdk-options.js';\nimport type { TopicInput, TopicKindList, TopicList, TopicQuery } from './types/topics.types.js';\n\nexport class TopicsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List topics\n * @description Every subject this station has named, for one sort of break or for all of them\n */\n async listTopics(query?: TopicQuery): Promise<TopicList> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/topics${qs}`, {\n method: 'GET',\n });\n return await parseJson<TopicList>(result);\n }\n\n /**\n * @name Create topic\n * @description Names a new subject. Nothing uses it until something points at it\n */\n async createTopic(body: TopicInput): Promise<TopicList> {\n const result = await this.fetch(`/topics`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<TopicList>(result);\n }\n\n /**\n * @name List topic kinds\n * @description Which sorts of break have subjects, and the form each one's settings are edited with\n */\n async listTopicKinds(): Promise<TopicKindList> {\n const result = await this.fetch(`/topics/kinds`, { method: 'GET' });\n return await parseJson<TopicKindList>(result);\n }\n\n /**\n * @name Update topic\n * @description Rewrites one subject. A break already written keeps the words it was given\n */\n async updateTopic(id: string, body: TopicInput): Promise<TopicList> {\n const result = await this.fetch(`/topics/${encodeURIComponent(id)}`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<TopicList>(result);\n }\n\n /**\n * @name Delete topic\n * @description Removes a subject, and any band on the format clock that asked for it\n */\n async deleteTopic(id: string): Promise<TopicList> {\n const result = await this.fetch(`/topics/${encodeURIComponent(id)}`, { method: 'DELETE' });\n return await parseJson<TopicList>(result);\n }\n}\n","import type { SdkOptions } from './sdk-options.js';\nimport { createSdkFetch } from './sdk-options.js';\nimport { ActivityClient } from './activity/activity.client.js';\nimport { ArtClient } from './art/art.client.js';\nimport { AuthenticationClient } from './authentication/authentication.client.js';\nimport { CatalogClient } from './catalog/catalog.client.js';\nimport { ChartsClient } from './charts/charts.client.js';\nimport { DirectorClient } from './director/director.client.js';\nimport { HistoryClient } from './history/history.client.js';\nimport { NewsClient } from './news/news.client.js';\nimport { NowplayingClient } from './nowplaying/nowplaying.client.js';\nimport { OnboardingClient } from './onboarding/onboarding.client.js';\nimport { PersonasClient } from './personas/personas.client.js';\nimport { PlaylistsClient } from './playlists/playlists.client.js';\nimport { PlayoutClient } from './playout/playout.client.js';\nimport { PluginsClient } from './plugins/plugins.client.js';\nimport { PodcastsClient } from './podcasts/podcasts.client.js';\nimport { ProductionsClient } from './productions/productions.client.js';\nimport { RenderClient } from './render/render.client.js';\nimport { ScheduleClient } from './schedule/schedule.client.js';\nimport { SettingsClient } from './settings/settings.client.js';\nimport { StationClient } from './station/station.client.js';\nimport { StorageClient } from './storage/storage.client.js';\nimport { StreamClient } from './stream/stream.client.js';\nimport { TopicsClient } from './topics/topics.client.js';\n\nexport class DeadairSdk {\n readonly activity: ActivityClient;\n readonly art: ArtClient;\n readonly authentication: AuthenticationClient;\n readonly catalog: CatalogClient;\n readonly charts: ChartsClient;\n readonly director: DirectorClient;\n readonly history: HistoryClient;\n readonly news: NewsClient;\n readonly nowplaying: NowplayingClient;\n readonly onboarding: OnboardingClient;\n readonly personas: PersonasClient;\n readonly playlists: PlaylistsClient;\n readonly playout: PlayoutClient;\n readonly plugins: PluginsClient;\n readonly podcasts: PodcastsClient;\n readonly productions: ProductionsClient;\n readonly render: RenderClient;\n readonly schedule: ScheduleClient;\n readonly settings: SettingsClient;\n readonly station: StationClient;\n readonly storage: StorageClient;\n readonly stream: StreamClient;\n readonly topics: TopicsClient;\n\n constructor(options: SdkOptions) {\n const sdkFetch = options.fetch ?? createSdkFetch(options);\n this.activity = new ActivityClient(sdkFetch);\n this.art = new ArtClient(sdkFetch);\n this.authentication = new AuthenticationClient(sdkFetch);\n this.catalog = new CatalogClient(sdkFetch);\n this.charts = new ChartsClient(sdkFetch);\n this.director = new DirectorClient(sdkFetch);\n this.history = new HistoryClient(sdkFetch);\n this.news = new NewsClient(sdkFetch);\n this.nowplaying = new NowplayingClient(sdkFetch);\n this.onboarding = new OnboardingClient(sdkFetch);\n this.personas = new PersonasClient(sdkFetch);\n this.playlists = new PlaylistsClient(sdkFetch);\n this.playout = new PlayoutClient(sdkFetch);\n this.plugins = new PluginsClient(sdkFetch);\n this.podcasts = new PodcastsClient(sdkFetch);\n this.productions = new ProductionsClient(sdkFetch);\n this.render = new RenderClient(sdkFetch);\n this.schedule = new ScheduleClient(sdkFetch);\n this.settings = new SettingsClient(sdkFetch);\n this.station = new StationClient(sdkFetch);\n this.storage = new StorageClient(sdkFetch);\n this.stream = new StreamClient(sdkFetch);\n this.topics = new TopicsClient(sdkFetch);\n }\n}\n"],"mappings":";;;;AAAO,IAAMA,WAAN,cAAwCC,MAAAA;EAA/C,OAA+CA;;;;;;;EAC3C,YACoBC,QACAC,YACAC,MACAC,SAClB;AACE,UAAM,GAAGH,MAAAA,IAAUC,UAAAA,EAAY,GAAA,KALfD,SAAAA,QAAAA,KACAC,aAAAA,YAAAA,KACAC,OAAAA,MAAAA,KACAC,UAAAA;AAGhB,SAAKC,OAAO;EAChB;AACJ;AAqBO,IAAMC,iBAAiB,wBAACC,GAAWC,UAAAA;AACtC,MAAI,OAAOA,UAAU,UAAU;AAC3B,WAAOA,MAAMC,SAAQ,IAAK;EAC9B;AACA,SAAOD;AACX,GAL8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2B,cAAchB,QAAAA;AACjC,SAAKV,WAAW,IAAI2B,eAAejB,QAAAA;AACnC,SAAKT,cAAc,IAAI2B,kBAAkBlB,QAAAA;AACzC,SAAKR,SAAS,IAAI2B,aAAanB,QAAAA;AAC/B,SAAKP,WAAW,IAAI2B,eAAepB,QAAAA;AACnC,SAAKN,WAAW,IAAI2B,eAAerB,QAAAA;AACnC,SAAKL,UAAU,IAAI2B,cAActB,QAAAA;AACjC,SAAKJ,UAAU,IAAI2B,cAAcvB,QAAAA;AACjC,SAAKH,SAAS,IAAI2B,aAAaxB,QAAAA;AAC/B,SAAKF,SAAS,IAAI2B,aAAazB,QAAAA;EACnC;AACJ;","names":["SdkError","Error","status","statusText","body","headers","name","bigIntReplacer","_","value","toString","bigIntReviver","test","BigInt","slice","readContentType","res","get","split","trim","randomRequestId","crypto","randomUUID","bytes","getRandomValues","Uint8Array","hex","Array","from","b","padStart","join","createSdkFetch","options","getRequestId","requestIdFactory","url","init","baseHeaders","fetch","baseUrl","ok","expectStatuses","includes","text","JSON","parse","buildQueryString","query","searchParams","URLSearchParams","k","v","Object","entries","undefined","isArray","item","append","String","set","qs","buildHeaders","out","map","parseBigIntHeader","replace","stringify","parseJson","parseJsonWithBigInt","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","reviveActivityEntry","raw","__o0","reviveActivityPage","__a1","__i2","length","ActivityClient","fetch","readActivity","query","qs","buildQueryString","result","method","reviveActivityPage","parseJson","ArtClient","fetch","getArt","id","result","encodeURIComponent","method","expectStatuses","status","contentType","readContentType","data","blob","headers","cacheControl","get","undefined","etag","getArtFile","filename","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","reviveAuthenticationRegistration","raw","__o0","reviveOidcLoginStartResponse","reviveFactorChallengePhoneStartResponse","reviveFactorChallengePhoneStartResponseOutput","reviveFactorChallengeEmailStartResponse","reviveFactorChallengeEmailStartResponseOutput","reviveSessionFactor","reviveLogin","reviveBaseAuthenticationLoginStartResponse","reviveSession","__a1","__i2","length","reviveApiKey","reviveApiKeyCreate","reviveCodeAuthenticationLoginStartResponse","reviveLinkAuthenticationLoginStartResponse","reviveOidcAuthenticationLoginStartResponse","reviveMfaRequiredResponse","reviveMfaRequiredResponseOutput","reviveFidoAuthenticationLoginStartResponse","reviveFactorChallengeFidoStartResponse","reviveFactorChallengeFidoStartResponseOutput","reviveApiKeyList","reviveApiKeyIssued","reviveStepUpStartResponse","__v","__d0","reviveStepUpStartResponseOutput","reviveAuthenticationTokenResponse","reviveAuthenticationTokenResponseOutput","reviveAuthenticationLoginStartResponse","reviveFactorChallengeStartResponse","reviveFactorChallengeStartResponseOutput","AuthenticationApikeysClient","fetch","listAPIKeys","result","method","reviveApiKeyList","parseJson","createAPIKey","body","headers","JSON","stringify","bigIntReplacer","reviveApiKeyIssued","rotateAPIKey","id","encodeURIComponent","revokeAPIKey","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","revivePhoneFactorRegistrationResponse","raw","__o0","reviveEmailFactorRegistrationResponse","reviveAuthenticatorFactorRegistrationResponse","reviveMfaEnrollPhoneStartResponse","reviveFidoFactorRegistrationResponse","reviveMfaEnrollFidoStartResponse","reviveAuthenticationFactorRegistrationResponse","__v","__d0","AuthenticationFactorsClient","fetch","listFactors","result","method","parseJson","registerFactor","body","headers","JSON","stringify","bigIntReplacer","reviveAuthenticationFactorRegistrationResponse","verifyFactorRegistration","startFactorChallenge","reviveFactorChallengeStartResponseOutput","startMFAChallenge","reviveStepUpStartResponseOutput","removeFactor","methodId","encodeURIComponent","AuthenticationSessionsClient","fetch","logout","method","readSession","result","parseJson","AuthenticationClient","apikeys","factors","sessions","fetch","AuthenticationApikeysClient","AuthenticationFactorsClient","AuthenticationSessionsClient","requestToken","body","options","__contentType","contentType","__serialized","URLSearchParams","toString","JSON","stringify","bigIntReplacer","result","method","headers","reviveAuthenticationTokenResponseOutput","parseJson","registerLogin","reviveAuthenticationRegistration","verifyLoginRegistration","startLogin","reviveAuthenticationLoginStartResponse","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","reviveTrackBinding","raw","__o0","reviveTrackAnalysis","reviveTrackPlay","reviveFactClaim","reviveTrackDetail","__a1","__i2","length","__a3","__i4","reviveTrackEnrichmentSource","reviveArtistEnrichmentSource","reviveAlbumEnrichmentSource","reviveTrackEnrichmentDetail","reviveArtistEnrichmentDetail","reviveAlbumEnrichmentDetail","CatalogClient","fetch","listArtists","query","qs","buildQueryString","result","method","parseJson","getArtist","id","encodeURIComponent","getArtistEnrichment","reviveArtistEnrichmentDetail","listArtistAlbums","rateArtist","body","headers","JSON","stringify","bigIntReplacer","listAlbums","getAlbum","getAlbumEnrichment","reviveAlbumEnrichmentDetail","listAlbumTracks","rateAlbum","getTrack","reviveTrackDetail","clearTrackAudio","clearTrackAnalysis","retryTrackAudio","offerTrackCopiesAgain","getTrackEnrichment","reviveTrackEnrichmentDetail","clearTrackEnrichment","listTracks","rateTrack","ChartsClient","fetch","listCharts","result","method","parseJson","readChart","id","query","qs","buildQueryString","encodeURIComponent","DirectorClient","fetch","listClockBands","result","method","parseJson","createClockBand","body","headers","JSON","stringify","bigIntReplacer","updateClockBand","id","encodeURIComponent","deleteClockBand","getStationAir","putTheStationOnAir","setTheAirMode","getTheRunningOrder","recastTheBroadcast","extendTheRunningOrder","replanTheRunningOrder","holdTheStationAgainstTheSchedule","releaseTheStationToTheSchedule","shuffleTheRunningOrder","addASegmentToTheRunningOrder","addARecordToTheRunningOrder","moveARunningOrderItem","itemId","removeARunningOrderItem","skipToARunningOrderItem","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","reviveHistoryEntry","raw","__o0","reviveHistoryPage","__a1","__i2","length","HistoryClient","fetch","readHistory","query","qs","buildQueryString","result","method","reviveHistoryPage","parseJson","NewsClient","fetch","listFeeds","result","method","parseJson","readNews","query","qs","buildQueryString","NowplayingClient","fetch","getNowPlaying","result","method","parseJson","OnboardingClient","fetch","getOnboardingRequirements","result","method","parseJson","submitOnboardingRequirement","body","headers","JSON","stringify","bigIntReplacer","PersonasClient","fetch","listPersonaAuditions","id","result","encodeURIComponent","method","parseJson","startPersonaAudition","body","headers","JSON","stringify","bigIntReplacer","getPersonaAudition","auditionId","cancelPersonaAudition","listPersonas","createPersona","generatePersona","restoreStationPersonas","exportPersonas","data","contentDisposition","get","undefined","exportPersona","previewPersonaImport","importPersonas","updatePersona","deletePersona","setTheStationHost","listPersonaNotes","writePersonaNote","updatePersonaNote","noteId","deletePersonaNote","setPersonaNoteState","listPersonaStories","writePersonaStory","updatePersonaStory","storyId","deletePersonaStory","setPersonaStoryState","addPersonaStoryDetail","updatePersonaStoryDetail","detailId","deletePersonaStoryDetail","setPersonaStoryDetailState","rehearsePersona","PlaylistsClient","fetch","listImportablePlaylists","result","method","parseJson","getPlaylistTracks","pluginId","playlistId","encodeURIComponent","hidePlaylist","showPlaylist","PlayoutClient","fetch","getPlayoutStatus","result","method","parseJson","playAPlaylist","body","headers","JSON","stringify","bigIntReplacer","playAChart","skipTheCurrentItem","startPlayout","stopPlayout","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","revivePluginSummary","raw","__o0","revivePluginImportResult","__a1","__i2","length","revivePluginDetail","PluginsClient","fetch","listPlugins","result","method","parseJson","map","revivePluginSummary","listPluginGrants","rescanPlugins","importPlugin","body","revivePluginImportResult","getPlugin","id","encodeURIComponent","revivePluginDetail","removePlugin","updatePluginConfiguration","headers","JSON","stringify","bigIntReplacer","enablePlugin","disablePlugin","decidePluginGrant","reloadPlugin","testPluginConnection","suggestPluginConfigOptions","getPluginLogs","query","qs","buildQueryString","downloadPluginLogs","data","text","contentDisposition","get","undefined","setPluginLogLevel","startPluginOAuthAuthorization","disconnectPluginOAuth","completePluginOAuthAuthorization","PodcastsClient","fetch","listShows","result","method","parseJson","searchPodcastDirectory","query","qs","buildQueryString","listEpisodes","fetchEpisode","id","encodeURIComponent","refreshPodcasts","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","reviveProductionRequest","raw","__o0","reviveProduction","reviveProductionList","__a1","__i2","length","ProductionsClient","fetch","listProductions","result","method","reviveProductionList","parseJson","requestProduction","body","headers","JSON","stringify","bigIntReplacer","reviveProduction","cancelProduction","id","encodeURIComponent","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","revivePad","raw","__o0","reviveScriptAttempt","revivePadList","__a1","__i2","length","reviveScriptHistoryPage","RenderClient","fetch","listSegments","result","method","parseJson","createSegment","body","headers","JSON","stringify","bigIntReplacer","uploadSegment","scanTheSegmentInbox","readScriptHistory","query","qs","buildQueryString","reviveScriptHistoryPage","rateScript","id","encodeURIComponent","reviveScriptAttempt","readScriptSummary","listVoices","getDefaultVoiceSample","expectStatuses","status","contentType","readContentType","data","blob","cacheControl","get","undefined","etag","getVoiceSample","voiceId","previewSpeech","deleteSegment","getSegmentAudio","getStoredAudio","checksum","ext","listPronunciations","createPronunciation","updatePronunciation","deletePronunciation","setPronunciationState","listPads","revivePadList","uploadPad","scanThePadLibrary","fetchPad","deletePad","setPadState","getPadAudio","createPadSet","updatePadSet","deletePadSet","setPadMembership","ScheduleClient","fetch","listSchedule","result","method","parseJson","createScheduleSlot","body","headers","JSON","stringify","bigIntReplacer","readCurrentSlot","readTimetable","query","qs","buildQueryString","updateScheduleSlot","id","encodeURIComponent","deleteScheduleSlot","SettingsClient","fetch","getSettings","result","method","parseJson","updateSettings","body","headers","JSON","stringify","bigIntReplacer","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","reviveLogSource","raw","__o0","reviveLogSourceList","__a1","__i2","length","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","reviveStationHeartbeat","raw","__o0","reviveStationCheckup","__a1","__i2","length","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","reviveTraceDecision","raw","__o0","reviveTraceSpan","reviveTracesPage","__a1","__i2","length","reviveTraceDetail","__a3","__i4","StationClient","fetch","listLogs","result","method","reviveLogSourceList","parseJson","readLog","id","query","qs","buildQueryString","encodeURIComponent","downloadLog","data","text","headers","contentDisposition","get","undefined","readStationAttention","readStationCheckup","reviveStationCheckup","readTraces","reviveTracesPage","readTrace","reviveTraceDetail","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","reviveStorageReport","raw","__o0","StorageClient","fetch","readStorage","result","method","reviveStorageReport","parseJson","StreamClient","fetch","getHLSPlaylist","name","result","encodeURIComponent","method","data","blob","headers","cacheControl","get","undefined","readFetcherAuthorization","parseJson","startFetcherAuthorization","finishFetcherAuthorization","body","JSON","stringify","bigIntReplacer","TopicsClient","fetch","listTopics","query","qs","buildQueryString","result","method","parseJson","createTopic","body","headers","JSON","stringify","bigIntReplacer","listTopicKinds","updateTopic","id","encodeURIComponent","deleteTopic","DeadairSdk","activity","art","authentication","catalog","charts","director","history","news","nowplaying","onboarding","personas","playlists","playout","plugins","podcasts","productions","render","schedule","settings","station","storage","stream","topics","options","sdkFetch","fetch","createSdkFetch","ActivityClient","ArtClient","AuthenticationClient","CatalogClient","ChartsClient","DirectorClient","HistoryClient","NewsClient","NowplayingClient","OnboardingClient","PersonasClient","PlaylistsClient","PlayoutClient","PluginsClient","PodcastsClient","ProductionsClient","RenderClient","ScheduleClient","SettingsClient","StationClient","StorageClient","StreamClient","TopicsClient"]}
1
+ {"version":3,"sources":["../src/sdk-options.ts","../src/activity/types/activity.types.ts","../src/activity/activity.client.ts","../src/art/art.client.ts","../src/authentication/types/authentication.types.ts","../src/authentication/authentication.apikeys.client.ts","../src/authentication/types/registration.types.ts","../src/authentication/authentication.factor.client.ts","../src/authentication/authentication.sessions.client.ts","../src/authentication/authentication.client.ts","../src/catalog/types/catalog.types.ts","../src/catalog/catalog.client.ts","../src/charts/charts.client.ts","../src/director/director.client.ts","../src/history/types/history.types.ts","../src/history/history.client.ts","../src/narrations/narrations.client.ts","../src/news/news.client.ts","../src/nowplaying/nowplaying.client.ts","../src/onboarding/onboarding.client.ts","../src/personas/personas.client.ts","../src/playlists/playlists.client.ts","../src/playout/playout.client.ts","../src/plugins/types/plugins.types.ts","../src/plugins/plugins.client.ts","../src/podcasts/podcasts.client.ts","../src/productions/types/productions.types.ts","../src/productions/productions.client.ts","../src/render/types/render.types.ts","../src/render/render.client.ts","../src/schedule/schedule.client.ts","../src/settings/settings.client.ts","../src/station/types/logs.types.ts","../src/station/types/station.types.ts","../src/station/types/traces.types.ts","../src/station/station.client.ts","../src/storage/types/storage.types.ts","../src/storage/storage.client.ts","../src/stream/stream.client.ts","../src/topics/topics.client.ts","../src/deadair.sdk.ts"],"sourcesContent":["export class SdkError<TBody = unknown> extends Error {\n constructor(\n public readonly status: number,\n public readonly statusText: string,\n public readonly body: TBody,\n public readonly headers: Headers,\n ) {\n super(`${status} ${statusText}`);\n this.name = 'SdkError';\n }\n}\n\nexport interface SdkRequestInit extends RequestInit {\n /**\n * Statuses this operation declares as values rather than errors — a 304 from\n * conditional-GET middleware, or an error status the service returns deliberately.\n * Anything else at or above 400 still throws SdkError.\n */\n expectStatuses?: number[];\n}\n\nexport type SdkFetch = (url: string, init: SdkRequestInit) => Promise<Response>;\n\nexport interface SdkOptions {\n baseUrl: string;\n headers?: Record<string, string> | (() => Record<string, string> | Promise<Record<string, string>>);\n fetch?: SdkFetch;\n /** Called once per request to produce a unique X-Request-ID header value */\n requestIdFactory?: () => string;\n}\n\nexport const bigIntReplacer = (_: string, value: any): any => {\n if (typeof value === 'bigint') {\n return value.toString() + 'n';\n }\n return value;\n};\n\nexport const bigIntReviver = (_: string, value: any): any => {\n if (typeof value === 'string' && /^-?\\d+n$/.test(value)) {\n return BigInt(value.slice(0, -1));\n }\n return value;\n};\n\nexport type JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue };\n\nexport function readContentType(res: Response): string {\n return res.headers.get('content-type')?.split(';')[0]?.trim() ?? '';\n}\n\n/** A v4 UUID. `crypto.randomUUID` exists only in a secure context, so plain HTTP builds one by hand. */\nfunction randomRequestId(): string {\n if (typeof crypto.randomUUID === 'function') return crypto.randomUUID();\n const bytes = crypto.getRandomValues(new Uint8Array(16));\n bytes[6] = (bytes[6]! & 0x0f) | 0x40;\n bytes[8] = (bytes[8]! & 0x3f) | 0x80;\n const hex = Array.from(bytes, b => b.toString(16).padStart(2, '0')).join('');\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;\n}\n\nexport function createSdkFetch(options: SdkOptions): SdkFetch {\n const getRequestId = options.requestIdFactory ?? randomRequestId;\n return async (url: string, init: SdkRequestInit): Promise<Response> => {\n const baseHeaders = typeof options.headers === 'function' ? await options.headers() : (options.headers ?? {});\n const res = await fetch(`${options.baseUrl}${url}`, {\n ...init,\n headers: { ...baseHeaders, 'X-Request-ID': getRequestId(), ...(init.headers as Record<string, string>) },\n });\n if (!res.ok && !(init.expectStatuses ?? []).includes(res.status)) {\n const text = await res.text();\n let body: unknown;\n try {\n body = JSON.parse(text);\n } catch {\n body = text;\n }\n throw new SdkError(res.status, res.statusText, body, res.headers);\n }\n return res;\n };\n}\n\nexport function buildQueryString(query: object | undefined): string {\n const searchParams = new URLSearchParams();\n if (query) {\n for (const [k, v] of Object.entries(query)) {\n if (v === undefined || v === null) continue;\n if (Array.isArray(v)) {\n for (const item of v) searchParams.append(k, String(item));\n } else searchParams.set(k, String(v));\n }\n }\n const qs = searchParams.toString();\n return qs ? `?${qs}` : '';\n}\n\nexport function buildHeaders(headers: object | undefined): Record<string, string> {\n const out: Record<string, string> = {};\n if (headers) {\n for (const [k, v] of Object.entries(headers)) {\n if (v === undefined || v === null) continue;\n out[k] = Array.isArray(v) ? v.map(String).join(', ') : String(v);\n }\n }\n return out;\n}\n\nexport function parseBigIntHeader(name: string, value: string): bigint {\n if (/^-?\\d+n?$/.test(value)) return BigInt(value.replace(/n$/, ''));\n throw new Error(`Response header '${name}' is not a bigint: ${JSON.stringify(value)}`);\n}\n\n/**\n * Read a JSON response body.\n *\n * No reviver: `bigIntReviver` matches any string of the form `123n` anywhere in the\n * document, so a contract with no bigint field would still have a legitimate string like\n * \"123n\" silently turned into a BigInt. Clients whose contracts do use bigint import\n * `parseJsonWithBigInt` under this name instead.\n */\nexport async function parseJson<T>(res: Response): Promise<T> {\n return JSON.parse(await res.text()) as T;\n}\n\n/** `parseJson` for contracts that declare a bigint, applying the `123n` reviver. */\nexport async function parseJsonWithBigInt<T>(res: Response): Promise<T> {\n return JSON.parse(await res.text(), bigIntReviver) as T;\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * Which part of the station an entry came from, and the console's one filter axis\n * generated from [ActivityModule](../../../../../apps/api/data/contracts/activity/activity.types.ck#L8)\n */\nexport type ActivityModule = 'playout' | 'director' | 'render' | 'catalog' | 'plugins';\n\n/**\n * How an entry reads, not how bad it is. There is deliberately no `waiting`: a station idling for\n * want of a listener says so in its own words and stays `info`, for the same reason the transport\n * reports it as `ready` rather than as a mild fault\n * generated from [ActivitySeverity](../../../../../apps/api/data/contracts/activity/activity.types.ck#L13)\n */\nexport type ActivitySeverity = 'info' | 'warn' | 'fault';\n\n/**\n * One thing that happened, from whichever of the feed's sources holds it\n * generated from [ActivityEntry](../../../../../apps/api/data/contracts/activity/activity.types.ck#L15)\n */\nexport interface ActivityEntry {\n /** Unique across the whole feed, and half of the cursor below */\n id: string;\n /** When it happened, as the database recorded it */\n at: DateTime;\n module: ActivityModule;\n /** Dotted and stable: `silence.cause`, `air.on`, `segment.ready`, `track.aired`. What a console draws a line with, never something a decision is made on */\n kind: string;\n severity: ActivitySeverity;\n /** The sentence a person reads, phrased by whatever produced it */\n detail: string;\n /** The structured half, for a reader that wants to filter or chart rather than read */\n data?: Record<string, unknown>;\n /** The segment this is about, for an entry that came from one */\n segmentId?: string;\n /** The catalog track this is about, for an entry that came from one */\n trackId?: string;\n}\n\n/** Rehydrates every wire-encoded scalar in a ActivityEntry into its runtime type. Mutates and returns `raw`. */\nexport function reviveActivityEntry(raw: ActivityEntry): ActivityEntry {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['at'] = __dt(__o0['at'], 'ActivityEntry.at');\n return raw;\n}\n\n/**\n * One page of the feed, newest first\n * generated from [ActivityQuery](../../../../../apps/api/data/contracts/activity/activity.types.ck#L27)\n */\nexport interface ActivityQuery {\n limit?: number;\n /** Where the previous page ended. Opaque, and a keyset rather than an offset because rows arrive at the head continuously: an offset would re-show a row on every page as the feed grew under it. Pass back whatever `nextBefore` said and nothing else */\n before?: string;\n module?: ActivityModule;\n /** The floor, not the exact match: `warn` answers with warnings and faults. Absent is everything */\n minSeverity?: ActivitySeverity;\n}\n\n/**\n * generated from [ActivityPage](../../../../../apps/api/data/contracts/activity/activity.types.ck#L34)\n */\nexport interface ActivityPage {\n entries: ActivityEntry[];\n /** The cursor for the page after this one, absent once the feed has been read to its end */\n nextBefore?: string;\n}\n\n/** Rehydrates every wire-encoded scalar in a ActivityPage into its runtime type. Mutates and returns `raw`. */\nexport function reviveActivityPage(raw: ActivityPage): ActivityPage {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['entries'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveActivityEntry(__a1[__i2] as never);\n }\n }\n return raw;\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson, buildQueryString } from '../sdk-options.js';\nimport type { ActivityPage, ActivityQuery } from './types/activity.types.js';\nimport { reviveActivityPage } from './types/activity.types.js';\n\nexport class ActivityClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name Read activity\n * @description The feed, newest first, one page at a time\n */\n async readActivity(query?: ActivityQuery): Promise<ActivityPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/activity${qs}`, {\n method: 'GET',\n });\n return reviveActivityPage(await parseJson<ActivityPage>(result));\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson, readContentType } from '../sdk-options.js';\nimport type { BreakArtworkList } from './types/art.types.js';\n\nexport class ArtClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List break artwork\n * @description Every kind the station holds a picture for\n */\n async listBreakArtwork(): Promise<BreakArtworkList> {\n const result = await this.fetch(`/art/breaks`, { method: 'GET' });\n return await parseJson<BreakArtworkList>(result);\n }\n\n /**\n * @name Replace break artwork\n * @description Puts an operator's own picture behind a kind of break. The id does not change, so a URL already on the wire keeps working and the ETag is what says the picture moved\n */\n async replaceBreakArtwork(kind: string, body: FormData): Promise<BreakArtworkList> {\n const result = await this.fetch(`/art/breaks/${encodeURIComponent(kind)}`, {\n method: 'POST',\n body: body,\n });\n return await parseJson<BreakArtworkList>(result);\n }\n\n /**\n * @name Revert break artwork\n * @description Puts the picture this repository ships back. The shipped file is read at this moment rather than copied at install, so an upgrade that improved it is what comes back\n */\n async revertBreakArtwork(kind: string): Promise<BreakArtworkList> {\n const result = await this.fetch(`/art/breaks/${encodeURIComponent(kind)}`, { method: 'DELETE' });\n return await parseJson<BreakArtworkList>(result);\n }\n\n /**\n * @name Get art\n * @description The bytes of one cached image, addressed by its id alone\n */\n async getArt(id: string): Promise<\n | {\n status: 200;\n contentType: 'image/jpeg' | 'image/png' | 'image/webp' | 'image/gif';\n data: Blob;\n headers: { cacheControl?: string; etag?: string };\n }\n | { status: 304 }\n > {\n const result = await this.fetch(`/art/${encodeURIComponent(id)}`, {\n method: 'GET',\n expectStatuses: [304],\n });\n switch (result.status) {\n case 304:\n return { status: 304 };\n default:\n return {\n status: 200,\n contentType: readContentType(result) as 'image/jpeg' | 'image/png' | 'image/webp' | 'image/gif',\n data: await result.blob(),\n headers: { cacheControl: result.headers.get('cache-control') ?? undefined, etag: result.headers.get('etag') ?? undefined },\n };\n }\n }\n\n /**\n * @name Get art file\n * @description The bytes of one cached image, under any filename\n */\n async getArtFile(\n id: string,\n filename: string,\n ): Promise<\n | {\n status: 200;\n contentType: 'image/jpeg' | 'image/png' | 'image/webp' | 'image/gif';\n data: Blob;\n headers: { cacheControl?: string; etag?: string };\n }\n | { status: 304 }\n > {\n const result = await this.fetch(`/art/${encodeURIComponent(id)}/${encodeURIComponent(filename)}`, {\n method: 'GET',\n expectStatuses: [304],\n });\n switch (result.status) {\n case 304:\n return { status: 304 };\n default:\n return {\n status: 200,\n contentType: readContentType(result) as 'image/jpeg' | 'image/png' | 'image/webp' | 'image/gif',\n data: await result.blob(),\n headers: { cacheControl: result.headers.get('cache-control') ?? undefined, etag: result.headers.get('etag') ?? undefined },\n };\n }\n }\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * Denotes the authorization flow to use\n * generated from [AuthenticationGrantType](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L7)\n */\nexport type AuthenticationGrantType = 'client_credentials' | 'password' | 'refresh_token' | 'link' | 'code' | 'fido' | 'authenticator' | 'oidc';\n\n/**\n * Denotes the authorization flow to use\n * generated from [PasswordlessAuthenticationGrantType](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L18)\n */\nexport type PasswordlessAuthenticationGrantType = 'link' | 'code' | 'fido' | 'oidc';\n\n/**\n * The type of the factor\n * generated from [AuthenticationFactorMethod](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L20)\n */\nexport type AuthenticationFactorMethod = 'phone' | 'password' | 'email' | 'authenticator' | 'fido' | 'oidc';\n\n/**\n * The kind of the factor\n * generated from [AuthenticationFactorKind](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L22)\n */\nexport type AuthenticationFactorKind = 'knowledge' | 'possession' | 'biometric';\n\n/**\n * The OIDC identity provider\n * generated from [OidcProvider](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L24)\n */\nexport type OidcProvider = 'google';\n\n/**\n * Represents an authentication token\n * generated from [AuthenticationToken](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L84)\n */\nexport interface AuthenticationToken {\n /** The access token string as issued by the authorization server */\n accessToken: string;\n /** A refresh token which applications can use to obtain another access token */\n refreshToken?: string;\n /** Unix timestamp (seconds) when the access token expires */\n expiresIn: number;\n /** The type of token this is, typically just the string *Bearer* */\n tokenType: string;\n /** Space-separated list of scopes granted to this token */\n scope: string;\n}\n\nexport interface AuthenticationTokenOutput {\n /** The access token string as issued by the authorization server */\n access_token: string;\n /** A refresh token which applications can use to obtain another access token */\n refresh_token?: string;\n /** Unix timestamp (seconds) when the access token expires */\n expires_in: number;\n /** The type of token this is, typically just the string *Bearer* */\n token_type: string;\n /** Space-separated list of scopes granted to this token */\n scope: string;\n}\n\n/**\n * Issued-token arm of /auth/token response\n * generated from [AuthenticationTokenIssued](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L92)\n */\nexport interface AuthenticationTokenIssued {\n /** Discriminator */\n result: 'token';\n /** The access token string as issued by the authorization server */\n accessToken: string;\n /** A refresh token which applications can use to obtain another access token */\n refreshToken?: string;\n /** Unix timestamp (seconds) when the access token expires */\n expiresIn: number;\n /** The type of token this is, typically just the string *Bearer* */\n tokenType: string;\n /** Space-separated list of scopes granted to this token */\n scope: string;\n}\n\nexport interface AuthenticationTokenIssuedOutput {\n /** Discriminator */\n result: 'token';\n /** The access token string as issued by the authorization server */\n access_token: string;\n /** A refresh token which applications can use to obtain another access token */\n refresh_token?: string;\n /** Unix timestamp (seconds) when the access token expires */\n expires_in: number;\n /** The type of token this is, typically just the string *Bearer* */\n token_type: string;\n /** Space-separated list of scopes granted to this token */\n scope: string;\n}\n\n/**\n * Returned by /auth/step-up/start when no enrolled factor satisfies the requirement. The SPA should drive the user through enrollment and retry the gated action afterwards.\n * generated from [EnrollmentRequiredResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L115)\n */\nexport interface EnrollmentRequiredResponse {\n /** Discriminator */\n result: 'enrollment_required';\n}\n\nexport interface EnrollmentRequiredResponseOutput {\n /** Discriminator */\n result: 'enrollment_required';\n}\n\n/**\n * Represents a common shape of a `PublicKeyCredential` after the client serializes the `id` and `rawId` fields to base64 strings for transport\n * generated from [PublicKeyCredential](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L123)\n */\nexport interface PublicKeyCredential {\n /** The base64url encoding of `rawId` */\n id: string;\n /** This enumeration defines the valid credential types. It is an extension point; values can be added to it in the future, as more credential types are defined. The values of this enumeration are used for versioning the Authentication Assertion and attestation structures according to the type of the authenticator. Currently one credential type is defined, namely `public-key`. */\n type: 'public-key';\n /** The credential identifier */\n rawId: string;\n /** The authenticator attachment */\n authenticatorAttachment?: 'cross-platform' | 'platform';\n}\n\n/**\n * Subset of the WebAuthn client extension results the service round-trips\n * generated from [SimpleClientExtensionResults](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L130)\n */\nexport interface SimpleClientExtensionResults {\n /** Whether the client is an application */\n appid?: boolean;\n /** Whether the client is excluded from appid verification */\n appidExclude?: boolean;\n credProps?: { rk: boolean };\n}\n\n/**\n * generated from [FidoAuthenticatorAssertionResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L138)\n */\nexport interface FidoAuthenticatorAssertionResponse {\n /** The client data JSON */\n clientDataJSON: string;\n /** The authenticator data */\n authenticatorData: string;\n /** The signature */\n signature: string;\n /** The user handle */\n userHandle?: string;\n}\n\n/**\n * generated from [AuthenticationRegistration](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L150)\n */\nexport interface AuthenticationRegistration {\n /** The registration identifier */\n registrationId: string;\n /** The registration expiration timestamp */\n expiresAt: DateTime;\n}\n\nexport interface AuthenticationRegistrationInput {\n /** User's email address */\n email: string;\n /** optionally set a password for the user */\n password?: string;\n}\n\n/** Rehydrates every wire-encoded scalar in a AuthenticationRegistration into its runtime type. Mutates and returns `raw`. */\nexport function reviveAuthenticationRegistration(raw: AuthenticationRegistration): AuthenticationRegistration {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'AuthenticationRegistration.expiresAt');\n return raw;\n}\n\n/**\n * generated from [AuthenticationRegistrationVerification](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L157)\n */\nexport interface AuthenticationRegistrationVerification {\n /** The registration identifier */\n registrationId: string;\n /** The verification code */\n code: string;\n}\n\n/**\n * A credential the relying party expects the user to be able to present\n * generated from [PublicKeyCredentialDescriptor](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L191)\n */\nexport interface PublicKeyCredentialDescriptor {\n /** The credential type — currently always `public-key` */\n type: 'public-key';\n /** The base64url-encoded credential identifier */\n id: string;\n /** Transports the authenticator advertises */\n transports?: ('usb' | 'nfc' | 'ble' | 'internal' | 'hybrid')[];\n}\n\n/**\n * The transport used by the authenticator\n * generated from [FidoAuthenticatorTransport](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L235)\n */\nexport type FidoAuthenticatorTransport = 'hybrid' | 'ble' | 'internal' | 'nfc' | 'usb';\n\n/**\n * Response from `/auth/login/oidc/start` instructing the client to navigate to `authorize_url`\n * generated from [OidcLoginStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L260)\n */\nexport interface OidcLoginStartResponse {\n /** Fully-formed authorize URL the user-agent should be redirected to */\n authorize_url: string;\n /** Opaque state token bound to this authorization round-trip */\n state: string;\n /** When the cached state record expires */\n expires_at: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a OidcLoginStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveOidcLoginStartResponse(raw: OidcLoginStartResponse): OidcLoginStartResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expires_at'] = __dt(__o0['expires_at'], 'OidcLoginStartResponse.expires_at');\n return raw;\n}\n\n/**\n * Request to complete an OIDC sign-in flow\n * generated from [OidcLoginCallback](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L266)\n */\nexport interface OidcLoginCallback {\n /** The issuer of the token */\n iss?: string;\n /** The scope of the token */\n scope?: string;\n /** The user ID */\n authuser?: string;\n /** The host domain */\n hd?: string;\n /** The prompt of the token */\n prompt?: string;\n /** The authorization code returned by the IdP (absent when the IdP rejected the request) */\n code?: string;\n /** The opaque state token bound to the original authorize request */\n state?: string;\n /** OAuth 2.0 error code per RFC 6749 §4.1.2.1 (e.g. access_denied) */\n error?: string;\n /** Human-readable explanation of `error` */\n error_description?: string;\n /** URL to a page describing `error` */\n error_uri?: string;\n}\n\n/**\n * Issue a phone SMS challenge during a pending MFA round\n * generated from [FactorChallengePhoneStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L279)\n */\nexport interface FactorChallengePhoneStart {\n /** Discriminator */\n method: 'phone';\n /** Delivery channel — only `sms` is supported in this phase */\n transport: 'sms';\n /** The MFA challenge to which this factor challenge is bound */\n mfa_challenge_id: string;\n}\n\n/**\n * Issue a WebAuthn assertion challenge during a pending MFA round\n * generated from [FactorChallengeFidoStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L285)\n */\nexport interface FactorChallengeFidoStart {\n /** Discriminator */\n method: 'fido';\n /** The MFA challenge to which this factor challenge is bound */\n mfa_challenge_id: string;\n}\n\n/**\n * Issue an email one-time-code challenge during a pending MFA round. Always a code: a magic link cannot complete an MFA round, since the `code` grant that redeems one takes `code(min=6, max=10)` and a link token is 43 characters\n * generated from [FactorChallengeEmailStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L290)\n */\nexport interface FactorChallengeEmailStart {\n /** Discriminator */\n method: 'email';\n /** The MFA challenge to which this factor challenge is bound */\n mfa_challenge_id: string;\n}\n\n/**\n * Response for a phone SMS challenge\n * generated from [FactorChallengePhoneStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L297)\n */\nexport interface FactorChallengePhoneStartResponse {\n /** Discriminator */\n method: 'phone';\n /** Echo of the chosen delivery channel */\n transport: 'sms';\n /** The phone-factor challenge id — echo back on the `code` grant as `challenge_id` */\n phoneChallengeId: string;\n /** When the phone challenge expires */\n expiresAt: DateTime;\n}\n\nexport interface FactorChallengePhoneStartResponseOutput {\n /** Discriminator */\n method: 'phone';\n /** Echo of the chosen delivery channel */\n transport: 'sms';\n /** The phone-factor challenge id — echo back on the `code` grant as `challenge_id` */\n phone_challenge_id: string;\n /** When the phone challenge expires */\n expires_at: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a FactorChallengePhoneStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveFactorChallengePhoneStartResponse(raw: FactorChallengePhoneStartResponse): FactorChallengePhoneStartResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'FactorChallengePhoneStartResponse.expiresAt');\n return raw;\n}\n\n/** Rehydrates every wire-encoded scalar in a FactorChallengePhoneStartResponseOutput into its runtime type. Mutates and returns `raw`. */\nexport function reviveFactorChallengePhoneStartResponseOutput(raw: FactorChallengePhoneStartResponseOutput): FactorChallengePhoneStartResponseOutput {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expires_at'] = __dt(__o0['expires_at'], 'FactorChallengePhoneStartResponse.expires_at');\n return raw;\n}\n\n/**\n * Response for an email one-time-code challenge\n * generated from [FactorChallengeEmailStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L311)\n */\nexport interface FactorChallengeEmailStartResponse {\n /** Discriminator */\n method: 'email';\n /** The email-factor challenge id — echo back on the `code` grant as `challenge_id` */\n emailChallengeId: string;\n /** When the email challenge expires */\n expiresAt: DateTime;\n}\n\nexport interface FactorChallengeEmailStartResponseOutput {\n /** Discriminator */\n method: 'email';\n /** The email-factor challenge id — echo back on the `code` grant as `challenge_id` */\n email_challenge_id: string;\n /** When the email challenge expires */\n expires_at: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a FactorChallengeEmailStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveFactorChallengeEmailStartResponse(raw: FactorChallengeEmailStartResponse): FactorChallengeEmailStartResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'FactorChallengeEmailStartResponse.expiresAt');\n return raw;\n}\n\n/** Rehydrates every wire-encoded scalar in a FactorChallengeEmailStartResponseOutput into its runtime type. Mutates and returns `raw`. */\nexport function reviveFactorChallengeEmailStartResponseOutput(raw: FactorChallengeEmailStartResponseOutput): FactorChallengeEmailStartResponseOutput {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expires_at'] = __dt(__o0['expires_at'], 'FactorChallengeEmailStartResponse.expires_at');\n return raw;\n}\n\n/**\n * A factor satisfied by the session\n * generated from [SessionFactor](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L325)\n */\nexport interface SessionFactor {\n /** The verification method */\n method: 'phone' | 'password' | 'authenticator' | 'email' | 'fido' | 'oidc';\n /** Stable identifier for the specific factor record */\n methodId: string;\n /** MFA category for the factor */\n kind: 'knowledge' | 'possession' | 'biometric';\n /** When this factor entry was first added to the session */\n issuedAt: DateTime;\n /** When the factor was most recently re-verified */\n authenticatedAt: DateTime;\n}\n\nexport interface SessionFactorInput {\n /** The verification method */\n method: 'phone' | 'password' | 'authenticator' | 'email' | 'fido' | 'oidc';\n /** Stable identifier for the specific factor record */\n methodId: string;\n /** MFA category for the factor */\n kind: 'knowledge' | 'possession' | 'biometric';\n}\n\n/** Rehydrates every wire-encoded scalar in a SessionFactor into its runtime type. Mutates and returns `raw`. */\nexport function reviveSessionFactor(raw: SessionFactor): SessionFactor {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['issuedAt'] = __dt(__o0['issuedAt'], 'SessionFactor.issuedAt');\n __o0['authenticatedAt'] = __dt(__o0['authenticatedAt'], 'SessionFactor.authenticatedAt');\n return raw;\n}\n\n/**\n * Optional metadata supplied to a revoke action\n * generated from [SessionRevoke](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L345)\n */\nexport interface SessionRevoke {\n /** Free-form reason recorded with the revoke */\n reason?: string | null;\n}\n\n/**\n * A platform-wide role held on `platform:main`. `admin` grants every operation; `listener` grants the reads\n * generated from [PlatformRole](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L350)\n */\nexport type PlatformRole = 'admin' | 'listener';\n\n/**\n * A successful authentication record\n * generated from [Login](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L357)\n */\nexport interface Login {\n /** The login event identifier */\n id: bigint;\n /** The actor that authenticated */\n actorId: string;\n /** The factor that satisfied the primary authentication, or `apikey` for a request made with one of the account's API keys */\n factorType: 'phone' | 'password' | 'authenticator' | 'email' | 'fido' | 'oidc' | 'apikey';\n /** The specific factor record id, when available */\n factorId?: string | null;\n /** The session minted at this login, when available */\n sessionToken?: string | null;\n /** Whether MFA was required and satisfied at login */\n mfaSatisfied: boolean;\n /** IP address recorded at login */\n ip?: string | null;\n /** User agent recorded at login */\n userAgent?: string | null;\n /** When the login occurred */\n occurredAt: DateTime;\n}\n\nexport interface LoginInput {}\n\n/** Rehydrates every wire-encoded scalar in a Login into its runtime type. Mutates and returns `raw`. */\nexport function reviveLogin(raw: Login): Login {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['occurredAt'] = __dt(__o0['occurredAt'], 'Login.occurredAt');\n return raw;\n}\n\n/**\n * The current user's display preferences, auto-detected by the SPA from the browser (Intl timezone + navigator.language). Omitted fields are left unchanged (absent = never set).\n * generated from [ActorPreferences](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L377)\n */\nexport interface ActorPreferences {\n /** RFC 5646 locale, e.g. \"en-US\" */\n locale?: string;\n /** Olson timezone, e.g. \"America/New_York\" */\n timezone?: string;\n}\n\n/**\n * What an API key may be granted. `view` covers every route a listener may read; `manage` covers the rest, and includes `view`\n * generated from [ApiKeyScope](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L383)\n */\nexport type ApiKeyScope = 'view' | 'manage';\n\n/**\n * generated from [BaseAuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L26)\n */\nexport interface BaseAuthenticationRequest {\n /** The grant type for the request */\n grant_type: AuthenticationGrantType;\n /** The scope of the request */\n scope?: string;\n /** The application's client identifier, if available */\n client_id?: string;\n}\n\n/**\n * generated from [BaseAuthenticationLoginStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L162)\n */\nexport interface BaseAuthenticationLoginStart {\n /** The grant type for the request */\n grant_type: PasswordlessAuthenticationGrantType;\n /** The application's client identifier, if available */\n client_id?: string;\n}\n\n/**\n * generated from [BaseAuthenticationLoginStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L197)\n */\nexport interface BaseAuthenticationLoginStartResponse {\n /** The grant type for the response */\n grant_type: PasswordlessAuthenticationGrantType;\n /** The challenge identifier */\n challengeId: string;\n /** The challenge expiration timestamp */\n expiresAt: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a BaseAuthenticationLoginStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveBaseAuthenticationLoginStartResponse(raw: BaseAuthenticationLoginStartResponse): BaseAuthenticationLoginStartResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'BaseAuthenticationLoginStartResponse.expiresAt');\n return raw;\n}\n\n/**\n * A factor the SPA may use to satisfy the MFA challenge\n * generated from [MfaChallengeFactor](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L101)\n */\nexport interface MfaChallengeFactor {\n /** The factor method */\n method: AuthenticationFactorMethod;\n /** The id of the enrolled factor (opaque to the SPA, must be echoed back in the proof for methods that don't bind another way) */\n methodId: string;\n /** The factor kind (knowledge, possession, biometric) — the SPA filters against step-up `acceptableKinds`/`excludeKinds` hints */\n kind: AuthenticationFactorKind;\n /** Optional human-readable label (e.g. provider name for OIDC, friendly name for FIDO) */\n label?: string;\n}\n\nexport interface MfaChallengeFactorOutput {\n /** The factor method */\n method: AuthenticationFactorMethod;\n /** The id of the enrolled factor (opaque to the SPA, must be echoed back in the proof for methods that don't bind another way) */\n method_id: string;\n /** The factor kind (knowledge, possession, biometric) — the SPA filters against step-up `acceptableKinds`/`excludeKinds` hints */\n kind: AuthenticationFactorKind;\n /** Optional human-readable label (e.g. provider name for OIDC, friendly name for FIDO) */\n label?: string;\n}\n\n/**\n * generated from [AuthenticationFactor](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L248)\n */\nexport interface AuthenticationFactor {\n /** The method of the factor */\n method: AuthenticationFactorMethod;\n /** The kind of the factor */\n kind: AuthenticationFactorKind;\n /** The method identifier */\n methodId: string;\n /** The label for the factor */\n label?: string;\n}\n\n/**\n * Mint a fresh MFA challenge for the current session so the SPA can satisfy a `step_up_required` denial. Filters mirror `StepUpRequirement` from `@maroonedsoftware/policies`.\n * generated from [StepUpStartRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L319)\n */\nexport interface StepUpStartRequest {\n /** If set, only these factor methods are listed as eligible */\n acceptableMethods?: AuthenticationFactorMethod[];\n /** If set, only these factor kinds are listed as eligible */\n acceptableKinds?: AuthenticationFactorKind[];\n /** If set, factors with these methods are never listed */\n excludeMethods?: AuthenticationFactorMethod[];\n}\n\n/**\n * Request to begin an OIDC sign-in flow\n * generated from [OidcLoginStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L255)\n */\nexport interface OidcLoginStart {\n /** The IdP to authorize against */\n provider: OidcProvider;\n /** Optional URL the SPA wants the callback to land on after token issuance */\n redirect_after?: string;\n}\n\n/**\n * generated from [PublicKeyCredentialWithAssertion](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L145)\n */\nexport interface PublicKeyCredentialWithAssertion extends PublicKeyCredential {\n /** The client extension results */\n clientExtensionResults: SimpleClientExtensionResults;\n /** The authenticator assertion response */\n response: FidoAuthenticatorAssertionResponse;\n}\n\n/**\n * generated from [FidoPublicKeyCredentialRequestOptions](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L211)\n */\nexport interface FidoPublicKeyCredentialRequestOptions {\n challenge: string;\n /** WebAuthn timeout hint in milliseconds */\n timeout?: number;\n rpId?: string;\n /** The attestation */\n attestation?: 'direct' | 'indirect' | 'none';\n /** Whether the authenticator must verify the user */\n userVerification?: 'required' | 'preferred' | 'discouraged';\n /** The raw challenge */\n rawChallenge?: Blob;\n extensions?: Record<string, unknown>;\n allowCredentials?: PublicKeyCredentialDescriptor[];\n}\n\n/**\n * Serialized form of `AuthenticatorAttestationResponse` — produced by the browser at registration; all binary fields are base64-encoded for transport\n * generated from [FidoAuthenticatorAttestationResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L237)\n */\nexport interface FidoAuthenticatorAttestationResponse {\n /** The client data JSON */\n clientDataJSON: string;\n /** The attestation object */\n attestationObject: string;\n /** The transports used by the authenticator */\n transports?: FidoAuthenticatorTransport[];\n}\n\n/**\n * generated from [FactorChallengeStartRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L295)\n */\nexport type FactorChallengeStartRequest = FactorChallengePhoneStart | FactorChallengeFidoStart | FactorChallengeEmailStart;\n\n/**\n * An active authentication session\n * generated from [Session](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L333)\n */\nexport interface Session {\n /** Opaque session token used as the cache key and embedded in JWTs */\n sessionToken: string;\n /** The actor that owns this session */\n actorId: string;\n /** When the session was originally issued */\n issuedAt: DateTime;\n /** When the session expires */\n expiresAt: DateTime;\n /** When the session was last accessed */\n lastAccessedAt: DateTime;\n /** Factors that have been satisfied in this session */\n factors: SessionFactor[];\n /** IP address recorded when the session was created */\n ip?: string | null;\n /** User agent recorded when the session was created */\n userAgent?: string | null;\n /** True when this session matches the requesting session */\n isCurrent: boolean;\n}\n\nexport interface SessionInput {}\n\n/** Rehydrates every wire-encoded scalar in a Session into its runtime type. Mutates and returns `raw`. */\nexport function reviveSession(raw: Session): Session {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['issuedAt'] = __dt(__o0['issuedAt'], 'Session.issuedAt');\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'Session.expiresAt');\n __o0['lastAccessedAt'] = __dt(__o0['lastAccessedAt'], 'Session.lastAccessedAt');\n {\n const __a1 = __o0['factors'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveSessionFactor(__a1[__i2] as never);\n }\n }\n return raw;\n}\n\n/**\n * Who the caller is, as the station sees them\n * generated from [AuthSession](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L352)\n */\nexport interface AuthSession {\n /** The actor the session belongs to */\n actorId: string;\n /** Every platform role the caller holds, sorted. Empty for an account nobody has granted one, which today is any account that did not come in through onboarding */\n roles: PlatformRole[];\n}\n\n/**\n * A personal API key, as its owner sees it in a list. The token itself is never returned after it is issued\n * generated from [ApiKey](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L385)\n */\nexport interface ApiKey {\n /** The key's identifier, for rotating or revoking it */\n id: string;\n /** What the account called the key */\n name: string;\n /** The token's first characters, enough to recognise the key in a config file and far too few to use */\n hint: string;\n /** What the key was granted. A key never does more than the account that owns it */\n scopes: ApiKeyScope[];\n /** When the key was issued */\n createdAt: DateTime;\n /** When the key stops working. Absent means it never expires */\n expiresAt?: DateTime;\n /** When the key was last used, to within five minutes. Absent means it has not been used */\n lastUsedAt?: DateTime;\n /** When the key was revoked. Present means every request made with it is refused */\n revokedAt?: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a ApiKey into its runtime type. Mutates and returns `raw`. */\nexport function reviveApiKey(raw: ApiKey): ApiKey {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['createdAt'] = __dt(__o0['createdAt'], 'ApiKey.createdAt');\n if (__o0['expiresAt'] != null) {\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'ApiKey.expiresAt');\n }\n if (__o0['lastUsedAt'] != null) {\n __o0['lastUsedAt'] = __dt(__o0['lastUsedAt'], 'ApiKey.lastUsedAt');\n }\n if (__o0['revokedAt'] != null) {\n __o0['revokedAt'] = __dt(__o0['revokedAt'], 'ApiKey.revokedAt');\n }\n return raw;\n}\n\n/**\n * A new API key\n * generated from [ApiKeyCreate](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L400)\n */\nexport interface ApiKeyCreate {\n /** What to call the key, so a list of several says which is which */\n name: string;\n /** What the key may do. At least one; `manage` includes `view` */\n scopes: ApiKeyScope[];\n /** When the key should stop working. Omit for a key that never expires */\n expiresAt?: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a ApiKeyCreate into its runtime type. Mutates and returns `raw`. */\nexport function reviveApiKeyCreate(raw: ApiKeyCreate): ApiKeyCreate {\n const __o0 = raw as unknown as Record<string, unknown>;\n if (__o0['expiresAt'] != null) {\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'ApiKeyCreate.expiresAt');\n }\n return raw;\n}\n\n/**\n * Represents an application authentication request\n * generated from [ClientCredentialsAuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L32)\n */\nexport interface ClientCredentialsAuthenticationRequest extends Omit<BaseAuthenticationRequest, 'grant_type' | 'client_id'> {\n /** The grant type for the request */\n grant_type: 'client_credentials';\n /** The client identifier */\n client_id: string;\n /** The client secret */\n client_secret: string;\n}\n\n/**\n * Represents an authentication password request\n * generated from [PasswordAuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L38)\n */\nexport interface PasswordAuthenticationRequest extends Omit<BaseAuthenticationRequest, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'password';\n /** User's identifier, usually an email address */\n username: string;\n /** User's password */\n password: string;\n}\n\n/**\n * Represents an authentication refresh request\n * generated from [RefreshTokenAuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L44)\n */\nexport interface RefreshTokenAuthenticationRequest extends Omit<BaseAuthenticationRequest, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'refresh_token';\n /** The refresh token issued by the authorization server. Optional: browser clients omit it and present the httpOnly refresh cookie instead */\n refresh_token?: string;\n}\n\n/**\n * Represents an authentication magic link request\n * generated from [LinkAuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L49)\n */\nexport interface LinkAuthenticationRequest extends Omit<BaseAuthenticationRequest, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'link';\n /** The email challenge id returned by `POST /auth/login/start` — binds the link to the issued challenge so cross-device clicks work */\n challenge_id: string;\n /** The magic link token */\n link: string;\n}\n\n/**\n * Represents an authentication one-time-code request\n * generated from [CodeAuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L55)\n */\nexport interface CodeAuthenticationRequest extends Omit<BaseAuthenticationRequest, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'code';\n /** The one-time code */\n code: string;\n /** PKCE verifier — required for a primary code login; absent when mfa_challenge_id is set */\n code_verifier?: string;\n /** When set, completes a pending MFA challenge; replaces code_verifier as proof-of-origin */\n mfa_challenge_id?: string;\n /** The phone/email challenge id (returned by POST /auth/factors/start for phone-MFA). Required when mfa_challenge_id is set; ignored otherwise (resolved via PKCE) */\n challenge_id?: string;\n}\n\n/**\n * Submit a TOTP code as a second factor against a pending MFA challenge\n * generated from [AuthenticatorAuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L70)\n */\nexport interface AuthenticatorAuthenticationRequest extends Omit<BaseAuthenticationRequest, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'authenticator';\n /** The TOTP code */\n code: string;\n /** The pending MFA challenge — required, TOTP has no other actor binding at initial login */\n mfa_challenge_id: string;\n /** The id of the enrolled authenticator factor to verify against (must be present in the MFA challenge's eligible list) */\n method_id: string;\n}\n\n/**\n * Redeem a completed OIDC authorization that the callback stashed under a one-time id\n * generated from [OidcAuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L77)\n */\nexport interface OidcAuthenticationRequest extends Omit<BaseAuthenticationRequest, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'oidc';\n /** The one-time stash id from the OIDC callback redirect (the value after `?token=oidc:` on `/auth/callback`). Single-use — the API consumes it via `OidcFactorService.redeemAuthenticatedExchange`. */\n challenge_id: string;\n}\n\n/**\n * generated from [BaseAuthenticationLoginStartWithEmail](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L167)\n */\nexport interface BaseAuthenticationLoginStartWithEmail extends BaseAuthenticationLoginStart {\n /** User's email address */\n email: string;\n}\n\n/**\n * Request to begin an OIDC sign-in flow\n * generated from [OidcAuthenticationLoginStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L184)\n */\nexport interface OidcAuthenticationLoginStart extends Omit<BaseAuthenticationLoginStart, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'oidc';\n /** The IdP to authorize against */\n provider: OidcProvider;\n}\n\n/**\n * generated from [CodeAuthenticationLoginStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L203)\n */\nexport interface CodeAuthenticationLoginStartResponse extends Omit<BaseAuthenticationLoginStartResponse, 'grant_type'> {\n /** The grant type for the response */\n grant_type: 'code';\n}\n\n/** Rehydrates every wire-encoded scalar in a CodeAuthenticationLoginStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveCodeAuthenticationLoginStartResponse(raw: CodeAuthenticationLoginStartResponse): CodeAuthenticationLoginStartResponse {\n reviveBaseAuthenticationLoginStartResponse(raw as never);\n return raw;\n}\n\n/**\n * generated from [LinkAuthenticationLoginStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L207)\n */\nexport interface LinkAuthenticationLoginStartResponse extends Omit<BaseAuthenticationLoginStartResponse, 'grant_type'> {\n /** The grant type for the response */\n grant_type: 'link';\n}\n\n/** Rehydrates every wire-encoded scalar in a LinkAuthenticationLoginStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveLinkAuthenticationLoginStartResponse(raw: LinkAuthenticationLoginStartResponse): LinkAuthenticationLoginStartResponse {\n reviveBaseAuthenticationLoginStartResponse(raw as never);\n return raw;\n}\n\n/**\n * Response from `/auth/login/oidc/start` instructing the client to navigate to `authorize_url`\n * generated from [OidcAuthenticationLoginStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L227)\n */\nexport interface OidcAuthenticationLoginStartResponse extends Omit<BaseAuthenticationLoginStartResponse, 'grant_type'> {\n /** The grant type for the response */\n grant_type: 'oidc';\n /** Fully-formed authorize URL the user-agent should be redirected to */\n authorize_url: string;\n /** Opaque state token bound to this authorization round-trip */\n state: string;\n}\n\n/** Rehydrates every wire-encoded scalar in a OidcAuthenticationLoginStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveOidcAuthenticationLoginStartResponse(raw: OidcAuthenticationLoginStartResponse): OidcAuthenticationLoginStartResponse {\n reviveBaseAuthenticationLoginStartResponse(raw as never);\n return raw;\n}\n\n/**\n * MFA-required arm of /auth/token response\n * generated from [MfaRequiredResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L108)\n */\nexport interface MfaRequiredResponse {\n /** Discriminator */\n result: 'mfa_required';\n /** The MFA challenge identifier — pass back as `mfa_challenge_id` on the proof grant */\n challengeId: string;\n /** When the MFA challenge expires */\n expiresAt: DateTime;\n /** Eligible factors the SPA may use to complete the challenge */\n factors: MfaChallengeFactor[];\n}\n\nexport interface MfaRequiredResponseOutput {\n /** Discriminator */\n result: 'mfa_required';\n /** The MFA challenge identifier — pass back as `mfa_challenge_id` on the proof grant */\n challenge_id: string;\n /** When the MFA challenge expires */\n expires_at: DateTime;\n /** Eligible factors the SPA may use to complete the challenge */\n factors: MfaChallengeFactorOutput[];\n}\n\n/** Rehydrates every wire-encoded scalar in a MfaRequiredResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveMfaRequiredResponse(raw: MfaRequiredResponse): MfaRequiredResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'MfaRequiredResponse.expiresAt');\n return raw;\n}\n\n/** Rehydrates every wire-encoded scalar in a MfaRequiredResponseOutput into its runtime type. Mutates and returns `raw`. */\nexport function reviveMfaRequiredResponseOutput(raw: MfaRequiredResponseOutput): MfaRequiredResponseOutput {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expires_at'] = __dt(__o0['expires_at'], 'MfaRequiredResponse.expires_at');\n return raw;\n}\n\n/**\n * Represents an authentication passkey request\n * generated from [FidoAuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L63)\n */\nexport interface FidoAuthenticationRequest extends Omit<BaseAuthenticationRequest, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'fido';\n /** A passkey credential object */\n credential: PublicKeyCredentialWithAssertion;\n /** The FIDO assertion challenge id returned by `POST /auth/login/start` (primary) or `POST /auth/factors/start` (MFA second factor). Must be the per-challenge id, not the actor id. */\n challenge_id: string;\n /** When set, completes a pending MFA challenge instead of issuing a single-factor session */\n mfa_challenge_id?: string;\n}\n\n/**\n * WebAuthn assertion options for `navigator.credentials.get`\n * generated from [FidoAuthenticationLoginStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L222)\n */\nexport interface FidoAuthenticationLoginStartResponse extends Omit<BaseAuthenticationLoginStartResponse, 'grant_type'> {\n /** The grant type for the response */\n grant_type: 'fido';\n /** The WebAuthn assertion options */\n assertion: FidoPublicKeyCredentialRequestOptions;\n}\n\n/** Rehydrates every wire-encoded scalar in a FidoAuthenticationLoginStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveFidoAuthenticationLoginStartResponse(raw: FidoAuthenticationLoginStartResponse): FidoAuthenticationLoginStartResponse {\n reviveBaseAuthenticationLoginStartResponse(raw as never);\n return raw;\n}\n\n/**\n * Response for a FIDO assertion challenge\n * generated from [FactorChallengeFidoStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L304)\n */\nexport interface FactorChallengeFidoStartResponse {\n /** Discriminator */\n method: 'fido';\n /** The FIDO-factor challenge id — echo back on the `fido` grant as `challenge_id` */\n fidoChallengeId: string;\n /** WebAuthn assertion options for navigator.credentials.get */\n assertion: FidoPublicKeyCredentialRequestOptions;\n /** When the FIDO challenge expires */\n expiresAt: DateTime;\n}\n\nexport interface FactorChallengeFidoStartResponseOutput {\n /** Discriminator */\n method: 'fido';\n /** The FIDO-factor challenge id — echo back on the `fido` grant as `challenge_id` */\n fido_challenge_id: string;\n /** WebAuthn assertion options for navigator.credentials.get */\n assertion: FidoPublicKeyCredentialRequestOptions;\n /** When the FIDO challenge expires */\n expires_at: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a FactorChallengeFidoStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveFactorChallengeFidoStartResponse(raw: FactorChallengeFidoStartResponse): FactorChallengeFidoStartResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'FactorChallengeFidoStartResponse.expiresAt');\n return raw;\n}\n\n/** Rehydrates every wire-encoded scalar in a FactorChallengeFidoStartResponseOutput into its runtime type. Mutates and returns `raw`. */\nexport function reviveFactorChallengeFidoStartResponseOutput(raw: FactorChallengeFidoStartResponseOutput): FactorChallengeFidoStartResponseOutput {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expires_at'] = __dt(__o0['expires_at'], 'FactorChallengeFidoStartResponse.expires_at');\n return raw;\n}\n\n/**\n * The credential the client posts back to complete registration\n * generated from [PublicKeyCredentialWithAttestation](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L243)\n */\nexport interface PublicKeyCredentialWithAttestation extends PublicKeyCredential {\n /** The client extension results */\n clientExtensionResults: SimpleClientExtensionResults;\n /** The authenticator attestation response */\n response: FidoAuthenticatorAttestationResponse;\n}\n\n/**\n * Every API key the account holds, newest first, revoked and expired keys included\n * generated from [ApiKeyList](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L396)\n */\nexport interface ApiKeyList {\n keys: ApiKey[];\n}\n\n/** Rehydrates every wire-encoded scalar in a ApiKeyList into its runtime type. Mutates and returns `raw`. */\nexport function reviveApiKeyList(raw: ApiKeyList): ApiKeyList {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['keys'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveApiKey(__a1[__i2] as never);\n }\n }\n return raw;\n}\n\n/**\n * A key and its token. The only time the token is ever returned: store it now, because nothing can show it again\n * generated from [ApiKeyIssued](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L406)\n */\nexport interface ApiKeyIssued {\n /** The key as it will appear in the list */\n key: ApiKey;\n /** The bearer token, sent as `Authorization: Bearer <token>` */\n token: string;\n}\n\n/** Rehydrates every wire-encoded scalar in a ApiKeyIssued into its runtime type. Mutates and returns `raw`. */\nexport function reviveApiKeyIssued(raw: ApiKeyIssued): ApiKeyIssued {\n const __o0 = raw as unknown as Record<string, unknown>;\n reviveApiKey(__o0['key'] as never);\n return raw;\n}\n\n/**\n * generated from [LinkAuthenticationLoginStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L171)\n */\nexport interface LinkAuthenticationLoginStart extends Omit<BaseAuthenticationLoginStartWithEmail, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'link';\n}\n\n/**\n * generated from [CodeAuthenticationLoginStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L175)\n */\nexport interface CodeAuthenticationLoginStart extends Omit<BaseAuthenticationLoginStartWithEmail, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'code';\n /** A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device */\n code_challenge: string;\n}\n\n/**\n * generated from [FidoAuthenticationLoginStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L180)\n */\nexport interface FidoAuthenticationLoginStart extends Omit<BaseAuthenticationLoginStartWithEmail, 'grant_type'> {\n /** The grant type for the request */\n grant_type: 'fido';\n}\n\n/**\n * generated from [StepUpStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L119)\n */\nexport type StepUpStartResponse = MfaRequiredResponse | EnrollmentRequiredResponse;\nexport type StepUpStartResponseOutput = MfaRequiredResponseOutput | EnrollmentRequiredResponseOutput;\n\n/** Rehydrates every wire-encoded scalar in a StepUpStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveStepUpStartResponse(raw: StepUpStartResponse): StepUpStartResponse {\n const __v = [raw] as unknown[];\n {\n const __d0 = (__v[0] as Record<string, unknown>)['result'];\n if (__d0 === 'mfa_required') {\n reviveMfaRequiredResponse(__v[0] as never);\n }\n }\n return __v[0] as StepUpStartResponse;\n}\n\n/** Rehydrates every wire-encoded scalar in a StepUpStartResponseOutput into its runtime type. Mutates and returns `raw`. */\nexport function reviveStepUpStartResponseOutput(raw: StepUpStartResponseOutput): StepUpStartResponseOutput {\n const __v = [raw] as unknown[];\n {\n const __d0 = (__v[0] as Record<string, unknown>)['result'];\n if (__d0 === 'mfa_required') {\n reviveMfaRequiredResponseOutput(__v[0] as never);\n }\n }\n return __v[0] as StepUpStartResponseOutput;\n}\n\n/**\n * generated from [AuthenticationTokenResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L121)\n */\nexport type AuthenticationTokenResponse = AuthenticationTokenIssued | MfaRequiredResponse;\nexport type AuthenticationTokenResponseOutput = AuthenticationTokenIssuedOutput | MfaRequiredResponseOutput;\n\n/** Rehydrates every wire-encoded scalar in a AuthenticationTokenResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveAuthenticationTokenResponse(raw: AuthenticationTokenResponse): AuthenticationTokenResponse {\n const __v = [raw] as unknown[];\n {\n const __d0 = (__v[0] as Record<string, unknown>)['result'];\n if (__d0 === 'mfa_required') {\n reviveMfaRequiredResponse(__v[0] as never);\n }\n }\n return __v[0] as AuthenticationTokenResponse;\n}\n\n/** Rehydrates every wire-encoded scalar in a AuthenticationTokenResponseOutput into its runtime type. Mutates and returns `raw`. */\nexport function reviveAuthenticationTokenResponseOutput(raw: AuthenticationTokenResponseOutput): AuthenticationTokenResponseOutput {\n const __v = [raw] as unknown[];\n {\n const __d0 = (__v[0] as Record<string, unknown>)['result'];\n if (__d0 === 'mfa_required') {\n reviveMfaRequiredResponseOutput(__v[0] as never);\n }\n }\n return __v[0] as AuthenticationTokenResponseOutput;\n}\n\n/**\n * generated from [AuthenticationRequest](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L82)\n */\nexport type AuthenticationRequest =\n | PasswordAuthenticationRequest\n | ClientCredentialsAuthenticationRequest\n | RefreshTokenAuthenticationRequest\n | LinkAuthenticationRequest\n | CodeAuthenticationRequest\n | FidoAuthenticationRequest\n | AuthenticatorAuthenticationRequest\n | OidcAuthenticationRequest;\n\n/**\n * generated from [AuthenticationLoginStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L233)\n */\nexport type AuthenticationLoginStartResponse =\n | CodeAuthenticationLoginStartResponse\n | LinkAuthenticationLoginStartResponse\n | FidoAuthenticationLoginStartResponse\n | OidcAuthenticationLoginStartResponse;\n\n/** Rehydrates every wire-encoded scalar in a AuthenticationLoginStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveAuthenticationLoginStartResponse(raw: AuthenticationLoginStartResponse): AuthenticationLoginStartResponse {\n const __v = [raw] as unknown[];\n {\n const __d0 = (__v[0] as Record<string, unknown>)['grant_type'];\n if (__d0 === 'code') {\n reviveCodeAuthenticationLoginStartResponse(__v[0] as never);\n }\n if (__d0 === 'link') {\n reviveLinkAuthenticationLoginStartResponse(__v[0] as never);\n }\n if (__d0 === 'fido') {\n reviveFidoAuthenticationLoginStartResponse(__v[0] as never);\n }\n if (__d0 === 'oidc') {\n reviveOidcAuthenticationLoginStartResponse(__v[0] as never);\n }\n }\n return __v[0] as AuthenticationLoginStartResponse;\n}\n\n/**\n * generated from [FactorChallengeStartResponse](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L317)\n */\nexport type FactorChallengeStartResponse = FactorChallengePhoneStartResponse | FactorChallengeFidoStartResponse | FactorChallengeEmailStartResponse;\nexport type FactorChallengeStartResponseOutput =\n FactorChallengePhoneStartResponseOutput | FactorChallengeFidoStartResponseOutput | FactorChallengeEmailStartResponseOutput;\n\n/** Rehydrates every wire-encoded scalar in a FactorChallengeStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveFactorChallengeStartResponse(raw: FactorChallengeStartResponse): FactorChallengeStartResponse {\n const __v = [raw] as unknown[];\n {\n const __d0 = (__v[0] as Record<string, unknown>)['method'];\n if (__d0 === 'phone') {\n reviveFactorChallengePhoneStartResponse(__v[0] as never);\n }\n if (__d0 === 'fido') {\n reviveFactorChallengeFidoStartResponse(__v[0] as never);\n }\n if (__d0 === 'email') {\n reviveFactorChallengeEmailStartResponse(__v[0] as never);\n }\n }\n return __v[0] as FactorChallengeStartResponse;\n}\n\n/** Rehydrates every wire-encoded scalar in a FactorChallengeStartResponseOutput into its runtime type. Mutates and returns `raw`. */\nexport function reviveFactorChallengeStartResponseOutput(raw: FactorChallengeStartResponseOutput): FactorChallengeStartResponseOutput {\n const __v = [raw] as unknown[];\n {\n const __d0 = (__v[0] as Record<string, unknown>)['method'];\n if (__d0 === 'phone') {\n reviveFactorChallengePhoneStartResponseOutput(__v[0] as never);\n }\n if (__d0 === 'fido') {\n reviveFactorChallengeFidoStartResponseOutput(__v[0] as never);\n }\n if (__d0 === 'email') {\n reviveFactorChallengeEmailStartResponseOutput(__v[0] as never);\n }\n }\n return __v[0] as FactorChallengeStartResponseOutput;\n}\n\n/**\n * generated from [AuthenticationLoginStart](../../../../../apps/api/data/contracts/authentication/authentication.types.ck#L189)\n */\nexport type AuthenticationLoginStart =\n LinkAuthenticationLoginStart | CodeAuthenticationLoginStart | FidoAuthenticationLoginStart | OidcAuthenticationLoginStart;\n","import type { ApiKeyCreate, ApiKeyIssued, ApiKeyList } from './types/authentication.types.js';\nimport { reviveApiKeyIssued, reviveApiKeyList } from './types/authentication.types.js';\nimport type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\n\n/**\n * generated from [authentication.apikeys.ck](../../../../apps/api/data/contracts/authentication/authentication.apikeys.ck)\n */\nexport class AuthenticationApikeysClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List API keys\n * @description The signed-in account's API keys, newest first, including revoked and expired ones so the list says what was withdrawn and when\n */\n async listAPIKeys(): Promise<ApiKeyList> {\n const result = await this.fetch(`/auth/apikeys`, { method: 'GET' });\n return reviveApiKeyList(await parseJson<ApiKeyList>(result));\n }\n\n /**\n * @name Create API key\n * @description Issue a new API key for the signed-in account. The token is in this response and nowhere else, ever. Once the account has a strong second factor, this needs one verified in the last five minutes\n */\n async createAPIKey(body: ApiKeyCreate): Promise<ApiKeyIssued> {\n const result = await this.fetch(`/auth/apikeys`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return reviveApiKeyIssued(await parseJson<ApiKeyIssued>(result));\n }\n\n /**\n * @name Rotate API key\n * @description Give a key a new token, so the old one stops working at once. The key keeps its name, scopes and expiry. Needs the same recent second factor as creating one\n */\n async rotateAPIKey(id: string): Promise<ApiKeyIssued> {\n const result = await this.fetch(`/auth/apikeys/${encodeURIComponent(id)}/rotate`, { method: 'POST' });\n return reviveApiKeyIssued(await parseJson<ApiKeyIssued>(result));\n }\n\n /**\n * @name Revoke API key\n * @description Revoke a key. Every request made with it is refused from the next one on. The key stays in the list, marked revoked\n */\n async revokeAPIKey(id: string): Promise<void> {\n await this.fetch(`/auth/apikeys/${encodeURIComponent(id)}`, { method: 'DELETE' });\n }\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\nimport type { PublicKeyCredentialWithAttestation } from './authentication.types.js';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * generated from [PhoneFactorRegistration](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L7)\n */\nexport interface PhoneFactorRegistration {\n /** The method of the factor */\n method: 'phone';\n /** The phone number in E.164 format (e.g. `+12025550123`) */\n value: string;\n /** A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device */\n codeChallenge: string;\n}\n\n/**\n * generated from [PasswordFactorRegistration](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L13)\n */\nexport interface PasswordFactorRegistration {\n /** The method of the factor */\n method: 'password';\n /** The password */\n value: string;\n}\n\n/**\n * generated from [EmailFactorRegistration](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L18)\n */\nexport interface EmailFactorRegistration {\n /** The method of the factor */\n method: 'email';\n /** The email address */\n value: string;\n /** A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device */\n codeChallenge: string;\n}\n\n/**\n * generated from [AuthenticatorFactorRegistration](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L24)\n */\nexport interface AuthenticatorFactorRegistration {\n /** The method of the factor */\n method: 'authenticator';\n /** A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device */\n codeChallenge: string;\n /** The label for the authenticator factor */\n label?: string;\n}\n\n/**\n * generated from [FidoFactorRegistration](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L30)\n */\nexport interface FidoFactorRegistration {\n /** The method of the factor */\n method: 'fido';\n /** The label for the FIDO factor */\n label?: string;\n}\n\n/**\n * generated from [PhoneFactorRegistrationResponse](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L37)\n */\nexport interface PhoneFactorRegistrationResponse {\n /** The method of the factor */\n method: 'phone';\n /** The registration identifier */\n registrationId: string;\n /** The expiration timestamp */\n expiresAt: DateTime;\n /** The issuance timestamp */\n issuedAt: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a PhoneFactorRegistrationResponse into its runtime type. Mutates and returns `raw`. */\nexport function revivePhoneFactorRegistrationResponse(raw: PhoneFactorRegistrationResponse): PhoneFactorRegistrationResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'PhoneFactorRegistrationResponse.expiresAt');\n __o0['issuedAt'] = __dt(__o0['issuedAt'], 'PhoneFactorRegistrationResponse.issuedAt');\n return raw;\n}\n\n/**\n * generated from [PasswordFactorRegistrationResponse](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L44)\n */\nexport interface PasswordFactorRegistrationResponse {\n /** The method of the factor */\n method: 'password';\n /** Whether the password needs to be reset */\n needsReset: boolean;\n}\n\n/**\n * generated from [EmailFactorRegistrationResponse](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L49)\n */\nexport interface EmailFactorRegistrationResponse {\n /** The method of the factor */\n method: 'email';\n /** The registration identifier */\n registrationId: string;\n /** The expiration timestamp */\n expiresAt: DateTime;\n /** The issuance timestamp */\n issuedAt: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a EmailFactorRegistrationResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveEmailFactorRegistrationResponse(raw: EmailFactorRegistrationResponse): EmailFactorRegistrationResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'EmailFactorRegistrationResponse.expiresAt');\n __o0['issuedAt'] = __dt(__o0['issuedAt'], 'EmailFactorRegistrationResponse.issuedAt');\n return raw;\n}\n\n/**\n * generated from [AuthenticatorFactorRegistrationResponse](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L56)\n */\nexport interface AuthenticatorFactorRegistrationResponse {\n /** The method of the factor */\n method: 'authenticator';\n /** The registration identifier */\n registrationId: string;\n /** The secret for the authenticator */\n secret: string;\n /** The URI for the authenticator */\n uri: string;\n /** The QR code for the authenticator */\n qrCode: string;\n /** The expiration timestamp */\n expiresAt: DateTime;\n /** The issuance timestamp */\n issuedAt: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a AuthenticatorFactorRegistrationResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveAuthenticatorFactorRegistrationResponse(raw: AuthenticatorFactorRegistrationResponse): AuthenticatorFactorRegistrationResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'AuthenticatorFactorRegistrationResponse.expiresAt');\n __o0['issuedAt'] = __dt(__o0['issuedAt'], 'AuthenticatorFactorRegistrationResponse.issuedAt');\n return raw;\n}\n\n/**\n * The FIDO factor attestation information\n * generated from [FidoFactorAttestation](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L66)\n */\nexport interface FidoFactorAttestation {\n /** The relying party */\n rp: { name: string; id: string; icon?: string };\n user: { id: string; name: string; displayName: string };\n /** The challenge */\n challenge: string;\n /** The public key credential parameters */\n pubKeyCredParams: { type: 'public-key'; alg: number }[];\n /** The timeout */\n timeout?: number;\n /** The attestation */\n attestation: 'direct' | 'indirect' | 'none';\n}\n\n/**\n * generated from [PhoneFactorRegistrationVerification](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L93)\n */\nexport interface PhoneFactorRegistrationVerification {\n /** The method of the factor */\n method: 'phone';\n /** The registration identifier */\n registrationId: string;\n /** The verification code */\n code: string;\n /** A base64url encoded one time secret used to validate that the request starts and ends on the same device */\n codeVerifier: string;\n}\n\n/**\n * generated from [EmailFactorRegistrationVerification](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L100)\n */\nexport interface EmailFactorRegistrationVerification {\n /** The method of the factor */\n method: 'email';\n /** The registration identifier */\n registrationId: string;\n /** The verification code */\n code: string;\n /** A base64url encoded one time secret used to validate that the request starts and ends on the same device */\n codeVerifier: string;\n}\n\n/**\n * generated from [AuthenticatorFactorRegistrationVerification](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L107)\n */\nexport interface AuthenticatorFactorRegistrationVerification {\n /** The method of the factor */\n method: 'authenticator';\n /** The registration identifier */\n registrationId: string;\n /** The verification code */\n code: string;\n /** A base64url encoded one time secret used to validate that the request starts and ends on the same device */\n codeVerifier: string;\n}\n\n/**\n * generated from [FidoFactorRegistrationVerification](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L114)\n */\nexport interface FidoFactorRegistrationVerification {\n /** The method of the factor */\n method: 'fido';\n /** The registration identifier */\n registrationId: string;\n /** The credential the client posts back to complete registration */\n credential: PublicKeyCredentialWithAttestation;\n}\n\n/**\n * Begin enrolling a TOTP authenticator during a pending login MFA challenge (no session — authorized by the challenge)\n * generated from [MfaEnrollAuthenticatorStart](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L122)\n */\nexport interface MfaEnrollAuthenticatorStart {\n /** The pending MFA challenge from the `mfa_required` login response */\n mfa_challenge_id: string;\n /** Optional label for the new authenticator factor */\n label?: string;\n}\n\n/**\n * Verify the first TOTP code, persist the authenticator, and complete login\n * generated from [MfaEnrollAuthenticatorVerify](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L127)\n */\nexport interface MfaEnrollAuthenticatorVerify {\n /** The same pending MFA challenge */\n mfa_challenge_id: string;\n /** The registration id returned by the enroll-start response */\n registrationId: string;\n /** The first TOTP code from the user's authenticator app */\n code: string;\n}\n\n/**\n * A second-factor method a user may enroll\n * generated from [EnrollmentMethod](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L133)\n */\nexport type EnrollmentMethod = 'authenticator' | 'phone' | 'fido';\n\n/**\n * Begin enrolling an SMS phone factor during a pending login MFA challenge (no session — authorized by the challenge)\n * generated from [MfaEnrollPhoneStart](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L139)\n */\nexport interface MfaEnrollPhoneStart {\n /** The pending MFA challenge from the `mfa_required` login response */\n mfa_challenge_id: string;\n /** The phone number in E.164 format (e.g. `+12025550123`) */\n value: string;\n}\n\n/**\n * Acknowledges the phone registration and that an OTP was texted\n * generated from [MfaEnrollPhoneStartResponse](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L144)\n */\nexport interface MfaEnrollPhoneStartResponse {\n /** The method of the factor */\n method: 'phone';\n /** The registration id — echo back on the verify call */\n registrationId: string;\n /** When the registration expires */\n expiresAt: DateTime;\n /** When the registration was issued */\n issuedAt: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a MfaEnrollPhoneStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveMfaEnrollPhoneStartResponse(raw: MfaEnrollPhoneStartResponse): MfaEnrollPhoneStartResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'MfaEnrollPhoneStartResponse.expiresAt');\n __o0['issuedAt'] = __dt(__o0['issuedAt'], 'MfaEnrollPhoneStartResponse.issuedAt');\n return raw;\n}\n\n/**\n * Verify the texted OTP, persist the phone factor, and complete login\n * generated from [MfaEnrollPhoneVerify](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L151)\n */\nexport interface MfaEnrollPhoneVerify {\n /** The same pending MFA challenge */\n mfa_challenge_id: string;\n /** The registration id returned by the enroll-start response */\n registrationId: string;\n /** The one-time code texted to the phone */\n code: string;\n}\n\n/**\n * Begin enrolling a passkey during a pending login MFA challenge (no session — authorized by the challenge)\n * generated from [MfaEnrollFidoStart](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L157)\n */\nexport interface MfaEnrollFidoStart {\n /** The pending MFA challenge from the `mfa_required` login response */\n mfa_challenge_id: string;\n /** Optional label for the new passkey factor */\n label?: string;\n}\n\n/**\n * Post the new credential back, persist the passkey factor, and complete login\n * generated from [MfaEnrollFidoVerify](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L170)\n */\nexport interface MfaEnrollFidoVerify {\n /** The same pending MFA challenge */\n mfa_challenge_id: string;\n /** The registration id returned by the enroll-start response */\n registrationId: string;\n /** The credential produced by `navigator.credentials.create` */\n credential: PublicKeyCredentialWithAttestation;\n}\n\n/**\n * generated from [AuthenticationFactorRegistration](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L35)\n */\nexport type AuthenticationFactorRegistration =\n PhoneFactorRegistration | PasswordFactorRegistration | EmailFactorRegistration | AuthenticatorFactorRegistration | FidoFactorRegistration;\n\n/**\n * generated from [FidoFactorRegistrationResponse](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L83)\n */\nexport interface FidoFactorRegistrationResponse {\n /** The method of the factor */\n method: 'fido';\n /** The registration identifier */\n registrationId: string;\n /** The expiration timestamp */\n expiresAt: DateTime;\n /** The issuance timestamp */\n issuedAt: DateTime;\n /** The FIDO factor attestation information */\n attestation: FidoFactorAttestation;\n}\n\n/** Rehydrates every wire-encoded scalar in a FidoFactorRegistrationResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveFidoFactorRegistrationResponse(raw: FidoFactorRegistrationResponse): FidoFactorRegistrationResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'FidoFactorRegistrationResponse.expiresAt');\n __o0['issuedAt'] = __dt(__o0['issuedAt'], 'FidoFactorRegistrationResponse.issuedAt');\n return raw;\n}\n\n/**\n * WebAuthn attestation options for `navigator.credentials.create`\n * generated from [MfaEnrollFidoStartResponse](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L162)\n */\nexport interface MfaEnrollFidoStartResponse {\n /** The method of the factor */\n method: 'fido';\n /** The registration id — echo back on the verify call */\n registrationId: string;\n /** When the registration expires */\n expiresAt: DateTime;\n /** When the registration was issued */\n issuedAt: DateTime;\n /** The WebAuthn attestation (credential-creation) options */\n attestation: FidoFactorAttestation;\n}\n\n/** Rehydrates every wire-encoded scalar in a MfaEnrollFidoStartResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveMfaEnrollFidoStartResponse(raw: MfaEnrollFidoStartResponse): MfaEnrollFidoStartResponse {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'MfaEnrollFidoStartResponse.expiresAt');\n __o0['issuedAt'] = __dt(__o0['issuedAt'], 'MfaEnrollFidoStartResponse.issuedAt');\n return raw;\n}\n\n/**\n * generated from [AuthenticationFactorRegistrationVerification](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L120)\n */\nexport type AuthenticationFactorRegistrationVerification =\n | PhoneFactorRegistrationVerification\n | EmailFactorRegistrationVerification\n | AuthenticatorFactorRegistrationVerification\n | FidoFactorRegistrationVerification;\n\n/**\n * Which second factors this instance permits enrolling. `phone` is present only when an SMS provider is configured (SMS_DELIVERY != noop); `authenticator` and `fido` are always available.\n * generated from [EnrollmentMethods](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L135)\n */\nexport interface EnrollmentMethods {\n /** The enrollable factor methods, in suggested display order */\n methods: EnrollmentMethod[];\n}\n\n/**\n * generated from [AuthenticationFactorRegistrationResponse](../../../../../apps/api/data/contracts/authentication/registration.types.ck#L91)\n */\nexport type AuthenticationFactorRegistrationResponse =\n | PhoneFactorRegistrationResponse\n | PasswordFactorRegistrationResponse\n | EmailFactorRegistrationResponse\n | AuthenticatorFactorRegistrationResponse\n | FidoFactorRegistrationResponse;\n\n/** Rehydrates every wire-encoded scalar in a AuthenticationFactorRegistrationResponse into its runtime type. Mutates and returns `raw`. */\nexport function reviveAuthenticationFactorRegistrationResponse(\n raw: AuthenticationFactorRegistrationResponse,\n): AuthenticationFactorRegistrationResponse {\n const __v = [raw] as unknown[];\n {\n const __d0 = (__v[0] as Record<string, unknown>)['method'];\n if (__d0 === 'phone') {\n revivePhoneFactorRegistrationResponse(__v[0] as never);\n }\n if (__d0 === 'email') {\n reviveEmailFactorRegistrationResponse(__v[0] as never);\n }\n if (__d0 === 'authenticator') {\n reviveAuthenticatorFactorRegistrationResponse(__v[0] as never);\n }\n if (__d0 === 'fido') {\n reviveFidoFactorRegistrationResponse(__v[0] as never);\n }\n }\n return __v[0] as AuthenticationFactorRegistrationResponse;\n}\n","import type {\n AuthenticationFactor,\n AuthenticationFactorMethod,\n AuthenticationTokenOutput,\n FactorChallengeStartRequest,\n FactorChallengeStartResponseOutput,\n StepUpStartRequest,\n StepUpStartResponseOutput,\n} from './types/authentication.types.js';\nimport { reviveFactorChallengeStartResponseOutput, reviveStepUpStartResponseOutput } from './types/authentication.types.js';\nimport type {\n AuthenticationFactorRegistration,\n AuthenticationFactorRegistrationResponse,\n AuthenticationFactorRegistrationVerification,\n} from './types/registration.types.js';\nimport { reviveAuthenticationFactorRegistrationResponse } from './types/registration.types.js';\nimport type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\n\n/**\n * generated from [authentication.factor.ck](../../../../apps/api/data/contracts/authentication/authentication.factor.ck)\n */\nexport class AuthenticationFactorsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List factors\n * @description List authentication factors\n */\n async listFactors(): Promise<AuthenticationFactor[]> {\n const result = await this.fetch(`/auth/factors`, { method: 'GET' });\n return await parseJson<AuthenticationFactor[]>(result);\n }\n\n /**\n * @name Register factor\n * @description Register an authentication factor\n */\n async registerFactor(body: AuthenticationFactorRegistration): Promise<AuthenticationFactorRegistrationResponse> {\n const result = await this.fetch(`/auth/factors/register`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return reviveAuthenticationFactorRegistrationResponse(await parseJson<AuthenticationFactorRegistrationResponse>(result));\n }\n\n /**\n * @name Verify factor registration\n * @description Verify an authentication factor registration\n */\n async verifyFactorRegistration(body: AuthenticationFactorRegistrationVerification): Promise<AuthenticationTokenOutput> {\n const result = await this.fetch(`/auth/factors/verify`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<AuthenticationTokenOutput>(result);\n }\n\n /**\n * @name Start factor challenge\n * @description Issue a factor verification challenge for a pending MFA round. Authenticated via the short-lived `mfa_challenge_id` in the body, not by session — this is the only /auth/factors/* route that does not require an authenticated session.\n */\n async startFactorChallenge(body: FactorChallengeStartRequest): Promise<FactorChallengeStartResponseOutput> {\n const result = await this.fetch(`/auth/factors/start`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return reviveFactorChallengeStartResponseOutput(await parseJson<FactorChallengeStartResponseOutput>(result));\n }\n\n /**\n * @name Start MFA challenge\n * @description Mint a fresh MFA challenge for the *current* authenticated session so the SPA can satisfy a `step_up_required` denial. Optionally filters eligible factors against an inbound `StepUpRequirement` hint. Returns `enrollment_required` when no enrolled factor matches the requirement so the SPA can route the user into enrollment instead of getting stuck.\n */\n async startMFAChallenge(body: StepUpStartRequest): Promise<StepUpStartResponseOutput> {\n const result = await this.fetch(`/auth/mfa/start`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return reviveStepUpStartResponseOutput(await parseJson<StepUpStartResponseOutput>(result));\n }\n\n /**\n * @name Remove factor\n * @description Remove one of the caller's own factors. Answered only for `authenticator` today, and only after a recent strong-factor verification: the same gate enrolment sits behind once a strong factor exists, so a stolen session cannot quietly switch the second factor off. Removing the last authenticator turns the sign-in challenge off for that account.\n */\n async removeFactor(method: AuthenticationFactorMethod, methodId: string): Promise<void> {\n await this.fetch(`/auth/factors/${encodeURIComponent(method)}/${encodeURIComponent(methodId)}`, { method: 'DELETE' });\n }\n}\n","import type { AuthSession } from './types/authentication.types.js';\nimport type { SdkFetch } from '../sdk-options.js';\nimport { parseJson } from '../sdk-options.js';\n\n/**\n * generated from [authentication.sessions.ck](../../../../apps/api/data/contracts/authentication/authentication.sessions.ck)\n */\nexport class AuthenticationSessionsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name Logout\n * @description revoke the caller's current session (self sign-out). Deliberately carries no policy gate: signing out must always clear the browser's httpOnly refresh cookie, including for a caller whose access token has already expired. A 401 here would leave a 30-day refresh cookie behind that silently signs the user back in on the next page load. SessionsService revokes the session only when the caller is actually authenticated; an anonymous caller still gets 204 and a cleared cookie.\n */\n async logout(): Promise<void> {\n await this.fetch(`/auth/logout`, { method: 'POST' });\n }\n\n /**\n * @name Read session\n * @description Who the caller is and which platform roles they hold\n */\n async readSession(): Promise<AuthSession> {\n const result = await this.fetch(`/auth/session`, { method: 'GET' });\n return await parseJson<AuthSession>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\nimport type {\n AuthenticationLoginStart,\n AuthenticationLoginStartResponse,\n AuthenticationRegistration,\n AuthenticationRegistrationInput,\n AuthenticationRegistrationVerification,\n AuthenticationRequest,\n AuthenticationTokenOutput,\n AuthenticationTokenResponseOutput,\n} from './types/authentication.types.js';\nimport {\n reviveAuthenticationLoginStartResponse,\n reviveAuthenticationRegistration,\n reviveAuthenticationTokenResponseOutput,\n} from './types/authentication.types.js';\nimport { AuthenticationApikeysClient } from './authentication.apikeys.client.js';\nimport { AuthenticationFactorsClient } from './authentication.factor.client.js';\nimport { AuthenticationSessionsClient } from './authentication.sessions.client.js';\n\nexport class AuthenticationClient {\n readonly apikeys: AuthenticationApikeysClient;\n readonly factors: AuthenticationFactorsClient;\n readonly sessions: AuthenticationSessionsClient;\n\n constructor(private fetch: SdkFetch) {\n this.apikeys = new AuthenticationApikeysClient(fetch);\n this.factors = new AuthenticationFactorsClient(fetch);\n this.sessions = new AuthenticationSessionsClient(fetch);\n }\n\n /**\n * @name Request token\n * @description Request authenticated token\n */\n async requestToken(\n body: AuthenticationRequest,\n options?: { contentType?: 'application/x-www-form-urlencoded' | 'application/json' },\n ): Promise<AuthenticationTokenResponseOutput> {\n const __contentType = options?.contentType ?? 'application/x-www-form-urlencoded';\n const __serialized =\n __contentType === 'application/x-www-form-urlencoded'\n ? new URLSearchParams(body as unknown as Record<string, string>).toString()\n : JSON.stringify(body, bigIntReplacer);\n const result = await this.fetch(`/auth/token`, {\n method: 'POST',\n headers: { 'Content-Type': __contentType },\n body: __serialized,\n });\n return reviveAuthenticationTokenResponseOutput(await parseJson<AuthenticationTokenResponseOutput>(result));\n }\n\n /**\n * @name Register login\n * @description Register a new login\n */\n async registerLogin(body: AuthenticationRegistrationInput): Promise<AuthenticationRegistration> {\n const result = await this.fetch(`/auth/login/register`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return reviveAuthenticationRegistration(await parseJson<AuthenticationRegistration>(result));\n }\n\n /**\n * @name Verify login registration\n * @description Verify a login registration\n */\n async verifyLoginRegistration(body: AuthenticationRegistrationVerification): Promise<AuthenticationTokenOutput> {\n const result = await this.fetch(`/auth/login/verify`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<AuthenticationTokenOutput>(result);\n }\n\n /**\n * @name Start login\n * @description Start a password-less login process\n */\n async startLogin(body: AuthenticationLoginStart): Promise<AuthenticationLoginStartResponse> {\n const result = await this.fetch(`/auth/login/start`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return reviveAuthenticationLoginStartResponse(await parseJson<AuthenticationLoginStartResponse>(result));\n }\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\nimport type { Pagination } from '../../shared/types/pagination.js';\nimport type { PaginationInput } from '../../shared/types/pagination.js';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * What the station has been told about a record. `neutral` is the absence of an opinion rather than\n * a middling one, and it is what rating something back to nothing means.\n * generated from [Rating](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L9)\n */\nexport type Rating = 'liked' | 'neutral' | 'disliked';\n\n/**\n * One provider's copy of a record, with whatever the station holds of it.\n *\n * PER BINDING and never per track, which is the rule the whole page is built on: one canonical\n * record may bind to several copies inside one provider, those copies are different files with\n * different loudness and different cue points, and the one that airs is the one that was resolved.\n * Collapsing them would make \"clear the audio\" ambiguous about which file it took.\n *\n * The failure columns are here rather than hidden because that is the question this page exists to\n * answer. A row with `attempts` and no `fetchedAt` is a remembered failure, and `lastError` with\n * `nextAttemptAt` is the whole of why a perfectly good-looking record will not play.\n * generated from [TrackBinding](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L73)\n */\nexport interface TrackBinding {\n /** `track_sources.id`, which is also what the audio URL carries */\n sourceId: string;\n pluginId: string;\n externalId: string;\n /** False when the provider still knows the record but will not serve it here */\n playable: boolean;\n /** When the station gave up on this copy. Cleared by the next sync that sees it again */\n missingAt?: DateTime;\n /** `sync` if a playlist walk saw it, `discovered` if something looked it up */\n origin: string;\n bitrate?: number;\n format?: string;\n lastSeenAt?: DateTime;\n /** What the station holds of this copy, absent when nothing has ever fetched it. */\n byteSize?: number;\n fetchedAt?: DateTime;\n lastServedAt?: DateTime;\n /** CONSECUTIVE failures. Reset by a fetch that works */\n attempts: number;\n lastError?: string;\n nextAttemptAt?: DateTime;\n}\n\nexport interface TrackBindingInput {}\n\n/** Rehydrates every wire-encoded scalar in a TrackBinding into its runtime type. Mutates and returns `raw`. */\nexport function reviveTrackBinding(raw: TrackBinding): TrackBinding {\n const __o0 = raw as unknown as Record<string, unknown>;\n if (__o0['missingAt'] != null) {\n __o0['missingAt'] = __dt(__o0['missingAt'], 'TrackBinding.missingAt');\n }\n if (__o0['lastSeenAt'] != null) {\n __o0['lastSeenAt'] = __dt(__o0['lastSeenAt'], 'TrackBinding.lastSeenAt');\n }\n if (__o0['fetchedAt'] != null) {\n __o0['fetchedAt'] = __dt(__o0['fetchedAt'], 'TrackBinding.fetchedAt');\n }\n if (__o0['lastServedAt'] != null) {\n __o0['lastServedAt'] = __dt(__o0['lastServedAt'], 'TrackBinding.lastServedAt');\n }\n if (__o0['nextAttemptAt'] != null) {\n __o0['nextAttemptAt'] = __dt(__o0['nextAttemptAt'], 'TrackBinding.nextAttemptAt');\n }\n return raw;\n}\n\n/**\n * What the measurement sidecar made of a record.\n *\n * `complete` is NOT `analyzedAt`, and the two are separate fields for a reason `0005_music.sql`\n * argues at length: a measurement of a truncated download is confident and wrong, so every reader in\n * the app filters on `complete` and a page that showed only a date would be reporting a record as\n * measured that nothing will use the measurement of.\n * generated from [TrackAnalysis](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L98)\n */\nexport interface TrackAnalysis {\n schemaVersion: number;\n complete: boolean;\n /** The measuring thing itself, which is not the plugin adapting it */\n analyzer?: string;\n analyzerPluginId?: string;\n analyzedAt?: DateTime;\n failedAt?: DateTime;\n failureReason?: string;\n}\n\nexport interface TrackAnalysisInput {}\n\n/** Rehydrates every wire-encoded scalar in a TrackAnalysis into its runtime type. Mutates and returns `raw`. */\nexport function reviveTrackAnalysis(raw: TrackAnalysis): TrackAnalysis {\n const __o0 = raw as unknown as Record<string, unknown>;\n if (__o0['analyzedAt'] != null) {\n __o0['analyzedAt'] = __dt(__o0['analyzedAt'], 'TrackAnalysis.analyzedAt');\n }\n if (__o0['failedAt'] != null) {\n __o0['failedAt'] = __dt(__o0['failedAt'], 'TrackAnalysis.failedAt');\n }\n return raw;\n}\n\n/**\n * One airing of a record, as this page needs it: when, and under which broadcast.\n * generated from [TrackPlay](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L109)\n */\nexport interface TrackPlay {\n airedAt: DateTime;\n broadcastId?: string;\n /** What put it in the running order */\n source: string;\n}\n\nexport interface TrackPlayInput {}\n\n/** Rehydrates every wire-encoded scalar in a TrackPlay into its runtime type. Mutates and returns `raw`. */\nexport function reviveTrackPlay(raw: TrackPlay): TrackPlay {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['airedAt'] = __dt(__o0['airedAt'], 'TrackPlay.airedAt');\n return raw;\n}\n\n/**\n * What a clear actually did.\n *\n * A count rather than a bare 204, because the interesting answers are the small ones: clearing the\n * audio of a record with three copies and being told `1` is the station saying two of them were\n * never here — which is a fact about the record and not about the button.\n * generated from [TrackClearResult](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L132)\n */\nexport interface TrackClearResult {\n trackId: string;\n /** Rows this affected. Zero is an ordinary answer, not a failure */\n cleared: number;\n /** What happened, in the words the console shows */\n detail: string;\n}\n\nexport interface TrackClearResultInput {}\n\n/**\n * Narrow a clear to one provider's answer, for the case where one source is wrong and the rest are\n * not. Absent clears every provider's.\n * generated from [ClearEnrichmentQuery](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L140)\n */\nexport interface ClearEnrichmentQuery {\n provider?: string;\n}\n\n/**\n * What an artist or album list is ordered BY, where `Pagination.sort` says only which direction.\n *\n * name the default, and the only key every row here has\n * albums how many records the station holds of them. Artists only\n * tracks how many songs. Artists only\n * year when the record came out. Albums only\n * rating the operator's own opinion\n *\n * One enum for both lists rather than two, because the alternative is a second near-identical\n * contract whose only content is which two keys it drops. A key the row cannot answer falls back to\n * name order rather than failing: an ordering nobody can serve is a page an operator cannot open.\n * generated from [CatalogSort](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L155)\n */\nexport type CatalogSort = 'name' | 'albums' | 'tracks' | 'year' | 'rating';\n\n/**\n * Which records to show, by what the station has of them rather than by what they are.\n *\n * cached the audio is on this machine, so it can be committed to the running order now\n * uncached it is not, which for most of a library is ordinary rather than wrong\n * unmeasured no trustworthy measurement, so no cue points and no level decided before air\n * benched every copy written off, which is the one state that means it CANNOT air\n * failing a fetch has failed and is backing off. Not benched yet, and often the state before it\n * generated from [TrackState](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L171)\n */\nexport type TrackState = 'cached' | 'uncached' | 'unmeasured' | 'benched' | 'failing';\n\n/**\n * What a track list is ordered BY. Its own enum for `TrackQuery`'s own reason: none of these keys\n * means anything about an artist, and `name` is spelled `title` on a song.\n *\n * `state` is deliberately absent. It is three independent booleans rather than one column, so there\n * is no ordering of it an operator would agree with: a benched record and an unmeasured one are not\n * more or less than each other.\n * generated from [TrackSort](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L179)\n */\nexport type TrackSort = 'title' | 'artist' | 'album' | 'year' | 'duration' | 'rating';\n\n/**\n * How much of the library is in each state, over the whole filtered set rather than this page.\n *\n * The aggregate is what an operator reads first — \"13 of 581 measured\" is the sentence that made\n * [analysis-queue-ordering](https://github.com/robert-dean/deadair/discussions/5) necessary, and it was a psql query then. `total` is the\n * same number as `meta.total` when nothing is filtered, and is repeated here so the counts can be\n * read as N of M without reaching into the pager.\n * generated from [TrackStateCounts](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L196)\n */\nexport interface TrackStateCounts {\n total: number;\n cached: number;\n measured: number;\n enriched: number;\n benched: number;\n failing: number;\n}\n\nexport interface TrackStateCountsInput {}\n\n/**\n * generated from [EnrichmentExternalId](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L244)\n */\nexport interface EnrichmentExternalId {\n /** e.g. `musicbrainz`, `wikidata` */\n source: string;\n id: string;\n}\n\n/**\n * Narrowed to http(s) by the host before it is stored, since the console renders these as\n * something a human clicks.\n * generated from [EnrichmentLink](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L251)\n */\nexport interface EnrichmentLink {\n label: string;\n url: string;\n}\n\n/**\n * One thing the station believes, and the words it read that say so. Extracted by the host out of\n * an article a plugin handed over, rather than said by any plugin: `sourceUrl` is where a person\n * checks it and `sourceQuote` is the span that supports it, and neither is ever absent.\n * generated from [FactClaim](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L344)\n */\nexport interface FactClaim {\n id: string;\n /** One sentence, as the DJ would say it */\n claim: string;\n category: string;\n /** `lead` for the article's own opening, `model` for what a model found */\n source: string;\n sourceProvider: string;\n sourceUrl: string;\n sourceQuote: string;\n confidence?: number;\n model?: string;\n /** Absent means never said on air */\n lastUsedAt?: DateTime;\n}\n\nexport interface FactClaimInput {}\n\n/** Rehydrates every wire-encoded scalar in a FactClaim into its runtime type. Mutates and returns `raw`. */\nexport function reviveFactClaim(raw: FactClaim): FactClaim {\n const __o0 = raw as unknown as Record<string, unknown>;\n if (__o0['lastUsedAt'] != null) {\n __o0['lastUsedAt'] = __dt(__o0['lastUsedAt'], 'FactClaim.lastUsedAt');\n }\n return raw;\n}\n\n/**\n * Rate an artist, a record or a song. Ratings are absolute: a dislike anywhere above a track\n * excludes it, and nothing the station programmes may turn that off.\n * generated from [RateInput](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L13)\n */\nexport interface RateInput {\n rating: Rating;\n}\n\n/**\n * The canonical work, not a binding to a provider. `deadair.artists` minus the columns that\n * only ingest cares about: `artist_key` is a match key, and a row with `merged_into_id` set is\n * never read out at all.\n *\n * `imageUrl` on both contracts below is one field with two spellings. An absolute URL is the\n * provider's own, still hotlinked because nothing has cached it yet; a relative `art/<uuid>` is\n * the station's copy, to be resolved against the API base the client already configures (the API\n * mounts at the root and does not know the `/api` prefix the edge adds). Prefer the local one by\n * doing nothing: the switch happens server-side as soon as the art cache pass has the bytes.\n * generated from [Artist](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L26)\n */\nexport interface Artist {\n id: string;\n name: string;\n /** MusicBrainz artist id, absent until enrichment resolves one */\n mbid?: string;\n /** Absolute upstream URL, or an API-relative path to the local copy */\n imageUrl?: string;\n rating?: Rating;\n /** Unmerged albums credited to this artist */\n albumCount: number;\n /** Unmerged tracks credited to this artist */\n trackCount: number;\n}\n\nexport interface ArtistInput {\n name: string;\n /** MusicBrainz artist id, absent until enrichment resolves one */\n mbid?: string;\n /** Absolute upstream URL, or an API-relative path to the local copy */\n imageUrl?: string;\n rating?: Rating;\n}\n\n/**\n * generated from [Album](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L36)\n */\nexport interface Album {\n id: string;\n name: string;\n artistId: string;\n /** Joined, so a list renders without a second request per row */\n artistName: string;\n /** MusicBrainz release-group id, absent until enrichment resolves one */\n mbid?: string;\n year?: number;\n /** Absolute upstream URL, or an API-relative path to the local copy */\n imageUrl?: string;\n rating?: Rating;\n trackCount: number;\n}\n\nexport interface AlbumInput {\n name: string;\n /** MusicBrainz release-group id, absent until enrichment resolves one */\n mbid?: string;\n year?: number;\n /** Absolute upstream URL, or an API-relative path to the local copy */\n imageUrl?: string;\n rating?: Rating;\n}\n\n/**\n * generated from [Track](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L48)\n */\nexport interface Track {\n id: string;\n title: string;\n artistId: string;\n artistName: string;\n /** Absent on a single ingested outside any release: `tracks.album_id` is nullable */\n albumId?: string;\n albumName?: string;\n /** The record's cover, in the two spellings `Album.imageUrl` has. Nothing hangs art off a recording */\n albumImageUrl?: string;\n /** Display credit as written on the release (\"X feat. Y\"), not a join key */\n artists: string;\n genre?: string;\n year?: number;\n durationMs?: number;\n rating?: Rating;\n}\n\nexport interface TrackInput {\n title: string;\n /** Display credit as written on the release (\"X feat. Y\"), not a join key */\n artists: string;\n genre?: string;\n year?: number;\n durationMs?: number;\n rating?: Rating;\n}\n\n/**\n * Pagination plus a name filter. Every list operation here takes it, so the console's search box\n * narrows server-side rather than filtering one page client-side and lying about the total.\n * generated from [CatalogQuery](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L159)\n */\nexport interface CatalogQuery extends Pagination {\n search?: string;\n sortBy?: CatalogSort;\n}\n\nexport interface CatalogQueryInput extends PaginationInput {\n search?: string;\n sortBy?: CatalogSort;\n}\n\n/**\n * `releaseDate` is a string and not `datetime` because it is a partial date: MusicBrainz answers\n * `1997`, `1997-06` or `1997-06-24` depending on what is actually known about the release, and the\n * SDK types it the same way. A `datetime` would reject the first two or invent a day and a time\n * for them, which is a precision the source never claimed.\n * generated from [TrackEnrichmentData](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L260)\n */\nexport interface TrackEnrichmentData {\n artist?: string;\n title?: string;\n album?: string;\n year?: number;\n releaseDate?: string;\n genres?: string[];\n moods?: string[];\n biography?: string;\n /** Short lines, each independently speakable */\n facts?: string[];\n /** Not an integer: a tempo a source measured rather than declared is fractional */\n bpm?: number;\n musicalKey?: string;\n label?: string;\n isrc?: string;\n artworkUrl?: string;\n externalIds?: EnrichmentExternalId[];\n links?: EnrichmentLink[];\n /** What the plugin said that the SDK has no field for. Per provider only: the merged view drops it */\n extra?: Record<string, unknown>;\n}\n\n/**\n * generated from [ArtistEnrichmentData](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L280)\n */\nexport interface ArtistEnrichmentData {\n name?: string;\n biography?: string;\n imageUrl?: string;\n genres?: string[];\n facts?: string[];\n externalIds?: EnrichmentExternalId[];\n links?: EnrichmentLink[];\n extra?: Record<string, unknown>;\n}\n\n/**\n * generated from [AlbumEnrichmentData](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L291)\n */\nexport interface AlbumEnrichmentData {\n name?: string;\n /** The record's own credit, which is not always the track's */\n artist?: string;\n year?: number;\n /** Partial, exactly as on TrackEnrichmentData */\n releaseDate?: string;\n label?: string;\n genres?: string[];\n facts?: string[];\n artworkUrl?: string;\n externalIds?: EnrichmentExternalId[];\n links?: EnrichmentLink[];\n extra?: Record<string, unknown>;\n}\n\n/**\n * One page of artists, with the totals the request was counted against\n * generated from [ArtistPage](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L224)\n */\nexport interface ArtistPage {\n meta: Pagination;\n data: Artist[];\n}\n\nexport interface ArtistPageInput {\n meta: PaginationInput;\n data: ArtistInput[];\n}\n\n/**\n * One page of albums\n * generated from [AlbumPage](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L229)\n */\nexport interface AlbumPage {\n meta: Pagination;\n data: Album[];\n}\n\nexport interface AlbumPageInput {\n meta: PaginationInput;\n data: AlbumInput[];\n}\n\n/**\n * Everything one record has accumulated, in one read.\n *\n * The enrichment is deliberately NOT here. It has its own operation already, answering\n * `TrackEnrichmentDetail` with every provider's payload and the station's own sourced claims, and\n * the console draws it through the same panel the list uses. One enrichment shape rather than two.\n * generated from [TrackDetail](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L120)\n */\nexport interface TrackDetail extends Track {\n bindings: TrackBinding[];\n /** Absent for a record the walk has not reached */\n analysis?: TrackAnalysis;\n /** The most recent airings, newest first */\n plays: TrackPlay[];\n /** How many times in all, which the list above is only the head of */\n playCount: number;\n}\n\nexport interface TrackDetailInput extends TrackInput {\n bindings: TrackBindingInput[];\n /** Absent for a record the walk has not reached */\n analysis?: TrackAnalysisInput;\n /** The most recent airings, newest first */\n plays: TrackPlayInput[];\n}\n\n/** Rehydrates every wire-encoded scalar in a TrackDetail into its runtime type. Mutates and returns `raw`. */\nexport function reviveTrackDetail(raw: TrackDetail): TrackDetail {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['bindings'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveTrackBinding(__a1[__i2] as never);\n }\n }\n if (__o0['analysis'] != null) {\n reviveTrackAnalysis(__o0['analysis'] as never);\n }\n {\n const __a3 = __o0['plays'] as unknown[];\n for (let __i4 = 0; __i4 < __a3.length; __i4++) {\n reviveTrackPlay(__a3[__i4] as never);\n }\n }\n return raw;\n}\n\n/**\n * A track as a LIST shows it: the record, plus three facts about what the station has of it.\n *\n * Three booleans and no more, deliberately. They are what a row can afford — one `exists` each, off\n * the query that was already running — and everything wider (which providers, how many bytes, why the\n * last fetch failed) is `TrackDetail`'s, one click away. A fourth would be the beginning of putting\n * the detail page in a table cell.\n * generated from [TrackRow](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L211)\n */\nexport interface TrackRow extends Track {\n /** The bytes are on this machine */\n hasAudio: boolean;\n /** Measured, COMPLETE, and at a schema version the station still trusts */\n measured: boolean;\n /** At least one provider has answered about it */\n enriched: boolean;\n}\n\nexport interface TrackRowInput extends TrackInput {}\n\n/**\n * A track list, narrowed by what the station has of each record as well as by name.\n *\n * Its own contract rather than a field on `CatalogQuery`, because that one is shared with the artist\n * and album lists where none of these states means anything.\n * generated from [TrackQuery](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L185)\n */\nexport interface TrackQuery extends Omit<CatalogQuery, 'sortBy'> {\n state?: TrackState;\n sortBy?: TrackSort;\n}\n\nexport interface TrackQueryInput extends Omit<CatalogQueryInput, 'sortBy'> {\n state?: TrackState;\n sortBy?: TrackSort;\n}\n\n/**\n * One provider's stored answer. `found: false` is a recorded miss, which is a fact rather than a\n * failure: the provider was asked, had nothing, and is not asked again until `expiresAt`. A provider\n * that could not be asked at all is `failed` instead, and the two never both hold.\n * generated from [TrackEnrichmentSource](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L308)\n */\nexport interface TrackEnrichmentSource {\n provider: string;\n /** The id it was fetched under. Provenance, not identity */\n providerRef?: string;\n fetchedAt: DateTime;\n expiresAt?: DateTime;\n /** Past its TTL, so the next pass will ask again */\n stale: boolean;\n found: boolean;\n /** The last attempt errored, so `expiresAt` is a backoff rather than a TTL */\n failed: boolean;\n data: TrackEnrichmentData;\n}\n\nexport interface TrackEnrichmentSourceInput {\n data: TrackEnrichmentData;\n}\n\n/** Rehydrates every wire-encoded scalar in a TrackEnrichmentSource into its runtime type. Mutates and returns `raw`. */\nexport function reviveTrackEnrichmentSource(raw: TrackEnrichmentSource): TrackEnrichmentSource {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['fetchedAt'] = __dt(__o0['fetchedAt'], 'TrackEnrichmentSource.fetchedAt');\n if (__o0['expiresAt'] != null) {\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'TrackEnrichmentSource.expiresAt');\n }\n return raw;\n}\n\n/**\n * generated from [ArtistEnrichmentSource](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L319)\n */\nexport interface ArtistEnrichmentSource {\n provider: string;\n providerRef?: string;\n fetchedAt: DateTime;\n expiresAt?: DateTime;\n stale: boolean;\n found: boolean;\n /** The last attempt errored, so `expiresAt` is a backoff rather than a TTL */\n failed: boolean;\n data: ArtistEnrichmentData;\n}\n\nexport interface ArtistEnrichmentSourceInput {\n data: ArtistEnrichmentData;\n}\n\n/** Rehydrates every wire-encoded scalar in a ArtistEnrichmentSource into its runtime type. Mutates and returns `raw`. */\nexport function reviveArtistEnrichmentSource(raw: ArtistEnrichmentSource): ArtistEnrichmentSource {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['fetchedAt'] = __dt(__o0['fetchedAt'], 'ArtistEnrichmentSource.fetchedAt');\n if (__o0['expiresAt'] != null) {\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'ArtistEnrichmentSource.expiresAt');\n }\n return raw;\n}\n\n/**\n * generated from [AlbumEnrichmentSource](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L330)\n */\nexport interface AlbumEnrichmentSource {\n provider: string;\n providerRef?: string;\n fetchedAt: DateTime;\n expiresAt?: DateTime;\n stale: boolean;\n found: boolean;\n /** The last attempt errored, so `expiresAt` is a backoff rather than a TTL */\n failed: boolean;\n data: AlbumEnrichmentData;\n}\n\nexport interface AlbumEnrichmentSourceInput {\n data: AlbumEnrichmentData;\n}\n\n/** Rehydrates every wire-encoded scalar in a AlbumEnrichmentSource into its runtime type. Mutates and returns `raw`. */\nexport function reviveAlbumEnrichmentSource(raw: AlbumEnrichmentSource): AlbumEnrichmentSource {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['fetchedAt'] = __dt(__o0['fetchedAt'], 'AlbumEnrichmentSource.fetchedAt');\n if (__o0['expiresAt'] != null) {\n __o0['expiresAt'] = __dt(__o0['expiresAt'], 'AlbumEnrichmentSource.expiresAt');\n }\n return raw;\n}\n\n/**\n * One page of tracks, with what the station has of each and of the whole set\n * generated from [TrackPage](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L234)\n */\nexport interface TrackPage {\n meta: Pagination;\n data: TrackRow[];\n states: TrackStateCounts;\n}\n\nexport interface TrackPageInput {\n meta: PaginationInput;\n data: TrackRowInput[];\n states: TrackStateCountsInput;\n}\n\n/**\n * Every provider's answer, plus the same merge the promotion step used, so the console and the\n * canonical columns cannot tell different stories. `sources` is empty on a row the walk has not\n * reached yet.\n *\n * `claims` sits beside them rather than inside `merged`, because a claim is the host's own and not\n * any provider's. The articles they were read out of are deliberately NOT here: raw source prose is\n * stored and never sent.\n * generated from [TrackEnrichmentDetail](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L364)\n */\nexport interface TrackEnrichmentDetail {\n trackId: string;\n merged: TrackEnrichmentData;\n sources: TrackEnrichmentSource[];\n claims: FactClaim[];\n}\n\nexport interface TrackEnrichmentDetailInput {\n merged: TrackEnrichmentData;\n sources: TrackEnrichmentSourceInput[];\n claims: FactClaimInput[];\n}\n\n/** Rehydrates every wire-encoded scalar in a TrackEnrichmentDetail into its runtime type. Mutates and returns `raw`. */\nexport function reviveTrackEnrichmentDetail(raw: TrackEnrichmentDetail): TrackEnrichmentDetail {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['sources'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveTrackEnrichmentSource(__a1[__i2] as never);\n }\n }\n {\n const __a3 = __o0['claims'] as unknown[];\n for (let __i4 = 0; __i4 < __a3.length; __i4++) {\n reviveFactClaim(__a3[__i4] as never);\n }\n }\n return raw;\n}\n\n/**\n * generated from [ArtistEnrichmentDetail](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L371)\n */\nexport interface ArtistEnrichmentDetail {\n artistId: string;\n merged: ArtistEnrichmentData;\n sources: ArtistEnrichmentSource[];\n claims: FactClaim[];\n}\n\nexport interface ArtistEnrichmentDetailInput {\n merged: ArtistEnrichmentData;\n sources: ArtistEnrichmentSourceInput[];\n claims: FactClaimInput[];\n}\n\n/** Rehydrates every wire-encoded scalar in a ArtistEnrichmentDetail into its runtime type. Mutates and returns `raw`. */\nexport function reviveArtistEnrichmentDetail(raw: ArtistEnrichmentDetail): ArtistEnrichmentDetail {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['sources'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveArtistEnrichmentSource(__a1[__i2] as never);\n }\n }\n {\n const __a3 = __o0['claims'] as unknown[];\n for (let __i4 = 0; __i4 < __a3.length; __i4++) {\n reviveFactClaim(__a3[__i4] as never);\n }\n }\n return raw;\n}\n\n/**\n * generated from [AlbumEnrichmentDetail](../../../../../apps/api/data/contracts/catalog/catalog.types.ck#L378)\n */\nexport interface AlbumEnrichmentDetail {\n albumId: string;\n merged: AlbumEnrichmentData;\n sources: AlbumEnrichmentSource[];\n claims: FactClaim[];\n}\n\nexport interface AlbumEnrichmentDetailInput {\n merged: AlbumEnrichmentData;\n sources: AlbumEnrichmentSourceInput[];\n claims: FactClaimInput[];\n}\n\n/** Rehydrates every wire-encoded scalar in a AlbumEnrichmentDetail into its runtime type. Mutates and returns `raw`. */\nexport function reviveAlbumEnrichmentDetail(raw: AlbumEnrichmentDetail): AlbumEnrichmentDetail {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['sources'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveAlbumEnrichmentSource(__a1[__i2] as never);\n }\n }\n {\n const __a3 = __o0['claims'] as unknown[];\n for (let __i4 = 0; __i4 < __a3.length; __i4++) {\n reviveFactClaim(__a3[__i4] as never);\n }\n }\n return raw;\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson, buildQueryString } from '../sdk-options.js';\nimport type {\n Album,\n AlbumEnrichmentDetail,\n AlbumPage,\n Artist,\n ArtistEnrichmentDetail,\n ArtistPage,\n CatalogQueryInput,\n ClearEnrichmentQuery,\n RateInput,\n Track,\n TrackClearResult,\n TrackDetail,\n TrackEnrichmentDetail,\n TrackPage,\n TrackQueryInput,\n} from './types/catalog.types.js';\nimport { reviveAlbumEnrichmentDetail, reviveArtistEnrichmentDetail, reviveTrackDetail, reviveTrackEnrichmentDetail } from './types/catalog.types.js';\n\nexport class CatalogClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List artists\n * @description Every artist the station has ingested, ordered by name\n */\n async listArtists(query?: CatalogQueryInput): Promise<ArtistPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/catalog/artists${qs}`, {\n method: 'GET',\n });\n return await parseJson<ArtistPage>(result);\n }\n\n /**\n * @name Get artist\n * @description One artist. 404s on an id that was merged away, since reads never return merged rows\n */\n async getArtist(id: string): Promise<Artist> {\n const result = await this.fetch(`/catalog/artists/${encodeURIComponent(id)}`, { method: 'GET' });\n return await parseJson<Artist>(result);\n }\n\n /**\n * @name Get artist enrichment\n * @description What every enrichment provider said about this artist, and when each of them said it\n */\n async getArtistEnrichment(id: string): Promise<ArtistEnrichmentDetail> {\n const result = await this.fetch(`/catalog/artists/${encodeURIComponent(id)}/enrichment`, { method: 'GET' });\n return reviveArtistEnrichmentDetail(await parseJson<ArtistEnrichmentDetail>(result));\n }\n\n /**\n * @name List artist albums\n * @description The albums credited to one artist\n */\n async listArtistAlbums(id: string, query?: CatalogQueryInput): Promise<AlbumPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/catalog/artists/${encodeURIComponent(id)}/albums${qs}`, {\n method: 'GET',\n });\n return await parseJson<AlbumPage>(result);\n }\n\n /**\n * @name Rate artist\n * @description What the station thinks of this artist. A dislike here excludes every record they are credited on\n */\n async rateArtist(id: string, body: RateInput): Promise<Artist> {\n const result = await this.fetch(`/catalog/artists/${encodeURIComponent(id)}/rating`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<Artist>(result);\n }\n\n /** @name List albums */\n async listAlbums(query?: CatalogQueryInput): Promise<AlbumPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/catalog/albums${qs}`, {\n method: 'GET',\n });\n return await parseJson<AlbumPage>(result);\n }\n\n /** @name Get album */\n async getAlbum(id: string): Promise<Album> {\n const result = await this.fetch(`/catalog/albums/${encodeURIComponent(id)}`, { method: 'GET' });\n return await parseJson<Album>(result);\n }\n\n /**\n * @name Get album enrichment\n * @description The record's own enrichment: the label, pressing and cover belong to the release, not to a track on it\n */\n async getAlbumEnrichment(id: string): Promise<AlbumEnrichmentDetail> {\n const result = await this.fetch(`/catalog/albums/${encodeURIComponent(id)}/enrichment`, { method: 'GET' });\n return reviveAlbumEnrichmentDetail(await parseJson<AlbumEnrichmentDetail>(result));\n }\n\n /**\n * @name List album tracks\n * @description One album's tracks\n */\n async listAlbumTracks(id: string, query?: TrackQueryInput): Promise<TrackPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/catalog/albums/${encodeURIComponent(id)}/tracks${qs}`, {\n method: 'GET',\n });\n return await parseJson<TrackPage>(result);\n }\n\n /**\n * @name Rate album\n * @description What the station thinks of this record. A dislike here excludes every track on it\n */\n async rateAlbum(id: string, body: RateInput): Promise<Album> {\n const result = await this.fetch(`/catalog/albums/${encodeURIComponent(id)}/rating`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<Album>(result);\n }\n\n /**\n * @name Get track\n * @description One record and everything it has accumulated: its copies, its bytes, its measurement, what it has aired\n */\n async getTrack(id: string): Promise<TrackDetail> {\n const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}`, { method: 'GET' });\n return reviveTrackDetail(await parseJson<TrackDetail>(result));\n }\n\n /**\n * @name Clear track audio\n * @description Drop the station's own copies of this record. The next play fetches them again\n */\n async clearTrackAudio(id: string): Promise<TrackClearResult> {\n const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/audio`, { method: 'DELETE' });\n return await parseJson<TrackClearResult>(result);\n }\n\n /**\n * @name Clear track analysis\n * @description Forget the measurement, so the walk takes it again\n */\n async clearTrackAnalysis(id: string): Promise<TrackClearResult> {\n const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/analysis`, { method: 'DELETE' });\n return await parseJson<TrackClearResult>(result);\n }\n\n /**\n * @name Retry track audio\n * @description Try this record's copies again now, rather than when the backoff says\n */\n async retryTrackAudio(id: string): Promise<TrackClearResult> {\n const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/retry`, { method: 'POST' });\n return await parseJson<TrackClearResult>(result);\n }\n\n /**\n * @name Offer track copies again\n * @description Put copies a provider refused back on offer, and clear their backoff so they are tried now\n */\n async offerTrackCopiesAgain(id: string): Promise<TrackClearResult> {\n const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/offer`, { method: 'POST' });\n return await parseJson<TrackClearResult>(result);\n }\n\n /**\n * @name Get track enrichment\n * @description What the providers said about one recording, including everything no canonical column holds\n */\n async getTrackEnrichment(id: string): Promise<TrackEnrichmentDetail> {\n const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/enrichment`, { method: 'GET' });\n return reviveTrackEnrichmentDetail(await parseJson<TrackEnrichmentDetail>(result));\n }\n\n /**\n * @name Clear track enrichment\n * @description Forget what the providers said, so the enrichment pass asks again\n */\n async clearTrackEnrichment(id: string, query?: ClearEnrichmentQuery): Promise<TrackClearResult> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/enrichment${qs}`, {\n method: 'DELETE',\n });\n return await parseJson<TrackClearResult>(result);\n }\n\n /**\n * @name List tracks\n * @description Every track, flat. The only way to answer \"do we have this song?\" without knowing its artist\n */\n async listTracks(query?: TrackQueryInput): Promise<TrackPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/catalog/tracks${qs}`, {\n method: 'GET',\n });\n return await parseJson<TrackPage>(result);\n }\n\n /**\n * @name Rate track\n * @description What the station thinks of this song, which is the narrowest thing an opinion can be about\n */\n async rateTrack(id: string, body: RateInput): Promise<Track> {\n const result = await this.fetch(`/catalog/tracks/${encodeURIComponent(id)}/rating`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<Track>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson, buildQueryString } from '../sdk-options.js';\nimport type { ChartPage, ChartQuery, StationChartList } from './types/charts.types.js';\n\nexport class ChartsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List charts\n * @description Every chart every installed chart plugin currently offers\n */\n async listCharts(): Promise<StationChartList> {\n const result = await this.fetch(`/charts`, { method: 'GET' });\n return await parseJson<StationChartList>(result);\n }\n\n /**\n * @name Read chart\n * @description One chart's records, ranked\n */\n async readChart(id: string, query?: ChartQuery): Promise<ChartPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/charts/${encodeURIComponent(id)}${qs}`, {\n method: 'GET',\n });\n return await parseJson<ChartPage>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\nimport type { ClockBandInput, ClockBandList } from './types/clock.types.js';\nimport type {\n AddStationSegmentInput,\n AddStationTrackInput,\n ExtendStationInput,\n HoldStationInput,\n MoveStationItemInput,\n PutOnAirInput,\n ReplanStationInput,\n SetStationAirInput,\n SetStationHostInput,\n StationAir,\n StationOrder,\n} from './types/director.types.js';\n\nexport class DirectorClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List clock bands\n * @description Every band on this station's clock, including the ones switched off, in the operator's own order\n */\n async listClockBands(): Promise<ClockBandList> {\n const result = await this.fetch(`/clock/bands`, { method: 'GET' });\n return await parseJson<ClockBandList>(result);\n }\n\n /**\n * @name Create clock band\n * @description Adds a band. It claims its first boundary on the next commit pass\n */\n async createClockBand(body: ClockBandInput): Promise<ClockBandList> {\n const result = await this.fetch(`/clock/bands`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<ClockBandList>(result);\n }\n\n /**\n * @name Update clock band\n * @description Rewrites one band. Breaks it has already planted stay where they are: the running order is the memory\n */\n async updateClockBand(id: string, body: ClockBandInput): Promise<ClockBandList> {\n const result = await this.fetch(`/clock/bands/${encodeURIComponent(id)}`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<ClockBandList>(result);\n }\n\n /**\n * @name Delete clock band\n * @description Removes a band, which costs it the boundaries it had not claimed yet and nothing else\n */\n async deleteClockBand(id: string): Promise<ClockBandList> {\n const result = await this.fetch(`/clock/bands/${encodeURIComponent(id)}`, { method: 'DELETE' });\n return await parseJson<ClockBandList>(result);\n }\n\n /**\n * @name Get station air\n * @description What the station is airing, and whether it is driving at all\n */\n async getStationAir(): Promise<StationAir> {\n const result = await this.fetch(`/director/air`, { method: 'GET' });\n return await parseJson<StationAir>(result);\n }\n\n /**\n * @name Put the station on air\n * @description Puts the station on air, building the running order from a playlist read at this moment. What is playing finishes: changing the programming is not a reason to cut a listener off mid-track\n */\n async putTheStationOnAir(body: PutOnAirInput): Promise<StationAir> {\n const result = await this.fetch(`/director/air`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<StationAir>(result);\n }\n\n /**\n * @name Set the air mode\n * @description Changes what puts the station on air: only while somebody is listening, or whenever there is a programme. Takes effect at once rather than at the next boundary\n */\n async setTheAirMode(body: SetStationAirInput): Promise<StationAir> {\n const result = await this.fetch(`/director/air`, {\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<StationAir>(result);\n }\n\n /**\n * @name Get the running order\n * @description The live running order, item by item, each saying where it has got to\n */\n async getTheRunningOrder(): Promise<StationOrder> {\n const result = await this.fetch(`/director/air/order`, { method: 'GET' });\n return await parseJson<StationOrder>(result);\n }\n\n /**\n * @name Recast the broadcast\n * @description Changes who is presenting this broadcast. Breaks already written for it in the outgoing character are written again in the new one\n */\n async recastTheBroadcast(body: SetStationHostInput): Promise<StationOrder> {\n const result = await this.fetch(`/director/air/persona`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<StationOrder>(result);\n }\n\n /**\n * @name Extend the running order\n * @description Queues a refill and returns at once. Generating a set walks the catalog, and an operator pressing a button should not be held open through it\n */\n async extendTheRunningOrder(body: ExtendStationInput): Promise<void> {\n await this.fetch(`/director/air/extend`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n }\n\n /**\n * @name Replan the running order\n * @description Queues a fresh set for everything the player is not already holding, and swaps it in once it exists. The old tail keeps playing until then, because emptying the running order first would take the station off air while the model was still choosing\n */\n async replanTheRunningOrder(body: ReplanStationInput): Promise<void> {\n await this.fetch(`/director/air/replan`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n }\n\n /**\n * @name Hold the station against the schedule\n * @description Holds the running order against the schedule, so a block boundary does not take back what an operator put on. A takeover is otherwise stamped with whichever slot was in force and is replaced when that block ends, which is correct and gives nobody any warning\n */\n async holdTheStationAgainstTheSchedule(body: HoldStationInput): Promise<StationAir> {\n const result = await this.fetch(`/director/air/hold`, {\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<StationAir>(result);\n }\n\n /**\n * @name Release the station to the schedule\n * @description Releases a hold, so the next block boundary changes the station over as it ordinarily would. A station with no hold is unchanged rather than refused\n */\n async releaseTheStationToTheSchedule(): Promise<StationAir> {\n const result = await this.fetch(`/director/air/hold`, { method: 'DELETE' });\n return await parseJson<StationAir>(result);\n }\n\n /**\n * @name Shuffle the running order\n * @description Shuffles the records not yet handed to the player, and plants the breaks again around the new sequence. The head is already in the player's hands and is left alone\n */\n async shuffleTheRunningOrder(): Promise<StationOrder> {\n const result = await this.fetch(`/director/air/shuffle`, { method: 'POST' });\n return await parseJson<StationOrder>(result);\n }\n\n /**\n * @name Add a segment to the running order\n * @description Puts something the station says into the running order. A segment with no audio yet is refused here rather than accepted and skipped when it comes round, so an operator is told why it cannot play\n */\n async addASegmentToTheRunningOrder(body: AddStationSegmentInput): Promise<StationOrder> {\n const result = await this.fetch(`/director/air/segments`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<StationOrder>(result);\n }\n\n /**\n * @name Add a record to the running order\n * @description Puts a catalog record into the running order. A record whose audio is not local yet is refused here rather than accepted and held or skipped when its slot comes round, so an operator asking for a specific one is told why it cannot play. What makes this worth having on its own is undo: dropping an item only ever marks a segment, but a track is spliced out of the order entirely, so nothing could put one back until this existed\n */\n async addARecordToTheRunningOrder(body: AddStationTrackInput): Promise<StationOrder> {\n const result = await this.fetch(`/director/air/tracks`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<StationOrder>(result);\n }\n\n /**\n * @name Move a running order item\n * @description Moves an item. A position already handed to the player is refused rather than clamped\n */\n async moveARunningOrderItem(itemId: string, body: MoveStationItemInput): Promise<StationOrder> {\n const result = await this.fetch(`/director/air/items/${encodeURIComponent(itemId)}`, {\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<StationOrder>(result);\n }\n\n /**\n * @name Remove a running order item\n * @description Drops an item that has not been handed to the player yet\n */\n async removeARunningOrderItem(itemId: string): Promise<StationOrder> {\n const result = await this.fetch(`/director/air/items/${encodeURIComponent(itemId)}`, { method: 'DELETE' });\n return await parseJson<StationOrder>(result);\n }\n\n /**\n * @name Skip to a running order item\n * @description Makes a record further down the running order the next thing heard. Everything still to come in front of it is marked skipped, anything the player was already holding from in front of it is taken back, and the item on air is cut. Only a record can be skipped to, and only one still to come\n */\n async skipToARunningOrderItem(itemId: string): Promise<StationOrder> {\n const result = await this.fetch(`/director/air/items/${encodeURIComponent(itemId)}/skip-to`, { method: 'POST' });\n return await parseJson<StationOrder>(result);\n }\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * One record the station actually played\n * generated from [HistoryEntry](../../../../../apps/api/data/contracts/history/history.types.ck#L7)\n */\nexport interface HistoryEntry {\n /** Unique across the history, and half of the cursor below */\n id: string;\n /** When it started, written when it began rather than when it was handed to the player */\n airedAt: DateTime;\n title: string;\n /** The credit as written, whole: one line rather than a list, because that is the shape a release credits itself in and splitting it renames acts with a comma in their name */\n artists: string;\n /** Absent for anything aired straight from a provider, which the catalog holds no record for */\n album?: string;\n /** The station's own copy where it has one, as a path under the API root, and the upstream URL until then. Resolve it against the base the station is reached at */\n artworkUrl?: string;\n /** How long the recording runs, from the catalog rather than from the copy that played */\n durationMs?: number;\n /** The catalog track this was, for a client that wants to ask more about it. Absent for a record the catalog does not hold, and for one it has since forgotten */\n trackId?: string;\n}\n\n/** Rehydrates every wire-encoded scalar in a HistoryEntry into its runtime type. Mutates and returns `raw`. */\nexport function reviveHistoryEntry(raw: HistoryEntry): HistoryEntry {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['airedAt'] = __dt(__o0['airedAt'], 'HistoryEntry.airedAt');\n return raw;\n}\n\n/**\n * One page of the history, newest first\n * generated from [HistoryQuery](../../../../../apps/api/data/contracts/history/history.types.ck#L18)\n */\nexport interface HistoryQuery {\n limit?: number;\n /** Where the previous page ended. Opaque, and a keyset rather than an offset because rows arrive at the head continuously: an offset would re-show a row on every page as the station kept playing under it. Pass back whatever `nextBefore` said and nothing else */\n before?: string;\n}\n\n/**\n * generated from [HistoryPage](../../../../../apps/api/data/contracts/history/history.types.ck#L23)\n */\nexport interface HistoryPage {\n entries: HistoryEntry[];\n /** The cursor for the page after this one, absent once the history has been read to its end */\n nextBefore?: string;\n}\n\n/** Rehydrates every wire-encoded scalar in a HistoryPage into its runtime type. Mutates and returns `raw`. */\nexport function reviveHistoryPage(raw: HistoryPage): HistoryPage {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['entries'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveHistoryEntry(__a1[__i2] as never);\n }\n }\n return raw;\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson, buildQueryString } from '../sdk-options.js';\nimport type { HistoryPage, HistoryQuery } from './types/history.types.js';\nimport { reviveHistoryPage } from './types/history.types.js';\n\nexport class HistoryClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name Read history\n * @description What the station played, newest first, one page at a time\n */\n async readHistory(query?: HistoryQuery): Promise<HistoryPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/history${qs}`, {\n method: 'GET',\n });\n return reviveHistoryPage(await parseJson<HistoryPage>(result));\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson, buildQueryString } from '../sdk-options.js';\nimport type { StationPiece, StationPiecePage, StationPieceQuery, StationSeriesList } from './types/narrations.types.js';\n\nexport class NarrationsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List series\n * @description Every series every installed narration plugin offers\n */\n async listSeries(): Promise<StationSeriesList> {\n const result = await this.fetch(`/narrations/series`, { method: 'GET' });\n return await parseJson<StationSeriesList>(result);\n }\n\n /**\n * @name List pieces\n * @description The pieces the station knows about, in their series' own order, with what it has done with each\n */\n async listPieces(query?: StationPieceQuery): Promise<StationPiecePage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/narrations/pieces${qs}`, {\n method: 'GET',\n });\n return await parseJson<StationPiecePage>(result);\n }\n\n /**\n * @name Render piece\n * @description Has one piece spoken now, rather than waiting for its slot to come near\n */\n async renderPiece(id: string): Promise<StationPiece> {\n const result = await this.fetch(`/narrations/pieces/${encodeURIComponent(id)}/render`, { method: 'POST' });\n return await parseJson<StationPiece>(result);\n }\n\n /**\n * @name Refresh narrations\n * @description Reads every series again, in the background, rather than waiting for the next scheduled refresh\n */\n async refreshNarrations(): Promise<void> {\n await this.fetch(`/narrations/refresh`, { method: 'POST' });\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson, buildQueryString } from '../sdk-options.js';\nimport type { NewsPage, NewsQuery, StationFeedList } from './types/news.types.js';\n\nexport class NewsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List feeds\n * @description Every feed every installed news plugin currently offers\n */\n async listFeeds(): Promise<StationFeedList> {\n const result = await this.fetch(`/news/feeds`, { method: 'GET' });\n return await parseJson<StationFeedList>(result);\n }\n\n /**\n * @name Read news\n * @description Published entries, newest first\n */\n async readNews(query?: NewsQuery): Promise<NewsPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/news${qs}`, {\n method: 'GET',\n });\n return await parseJson<NewsPage>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson } from '../sdk-options.js';\nimport type { NowPlaying } from './types/nowplaying.types.js';\n\nexport class NowplayingClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name Get now playing\n * @description What is on air right now. Answers 200 with `onAir: false` when the station is quiet, so a device polling this treats silence as an answer rather than an error\n */\n async getNowPlaying(): Promise<NowPlaying> {\n const result = await this.fetch(`/nowplaying`, { method: 'GET' });\n return await parseJson<NowPlaying>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\nimport type { OnboardingRequirement, OnboardingRequirementInput } from './types/onboarding.types.js';\n\nexport class OnboardingClient {\n constructor(private fetch: SdkFetch) {}\n\n /** @name Get Onboarding Requirements */\n async getOnboardingRequirements(): Promise<OnboardingRequirement[]> {\n const result = await this.fetch(`/onboarding`, { method: 'GET' });\n return await parseJson<OnboardingRequirement[]>(result);\n }\n\n /** @name Submit Onboarding Requirement */\n async submitOnboardingRequirement(body: OnboardingRequirementInput): Promise<OnboardingRequirement[]> {\n const result = await this.fetch(`/onboarding`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<OnboardingRequirement[]>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\nimport type {\n GeneratedPersona,\n PersonaAudition,\n PersonaAuditionList,\n PersonaAuditionRequest,\n PersonaAuditionSummary,\n PersonaFile,\n PersonaImportPlan,\n PersonaImportResult,\n PersonaInput,\n PersonaList,\n PersonaNoteList,\n PersonaNoteState,\n PersonaNoteWrite,\n PersonaRehearsal,\n PersonaRequest,\n PersonaStoryDetailWrite,\n PersonaStoryList,\n PersonaStoryState,\n PersonaStoryWrite,\n} from './types/personas.types.js';\n\nexport class PersonasClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List persona auditions\n * @description Every audition of this character, newest first, without their breaks\n */\n async listPersonaAuditions(id: string): Promise<PersonaAuditionList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/auditions`, { method: 'GET' });\n return await parseJson<PersonaAuditionList>(result);\n }\n\n /**\n * @name Start persona audition\n * @description Asks the station to put this character through a playlist. It is queued, not written\n */\n async startPersonaAudition(id: string, body: PersonaAuditionRequest): Promise<PersonaAudition> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/auditions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaAudition>(result);\n }\n\n /**\n * @name Get persona audition\n * @description One audition with every break it has written so far, in order\n */\n async getPersonaAudition(id: string, auditionId: string): Promise<PersonaAudition> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/auditions/${encodeURIComponent(auditionId)}`, { method: 'GET' });\n return await parseJson<PersonaAudition>(result);\n }\n\n /**\n * @name Cancel persona audition\n * @description Stops an audition where it stands, keeping the breaks it has already written\n */\n async cancelPersonaAudition(id: string, auditionId: string): Promise<PersonaAuditionSummary> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/auditions/${encodeURIComponent(auditionId)}/cancel`, { method: 'POST' });\n return await parseJson<PersonaAuditionSummary>(result);\n }\n\n /**\n * @name List personas\n * @description Every persona this station has, oldest first\n */\n async listPersonas(): Promise<PersonaList> {\n const result = await this.fetch(`/personas`, { method: 'GET' });\n return await parseJson<PersonaList>(result);\n }\n\n /**\n * @name Create persona\n * @description Writes a new persona. It is not put on air by creating it\n */\n async createPersona(body: PersonaInput): Promise<PersonaList> {\n const result = await this.fetch(`/personas`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaList>(result);\n }\n\n /**\n * @name Generate persona\n * @description Turns a description of a character into a whole persona, checked against its own sample lines and handed back unsaved\n */\n async generatePersona(body: PersonaRequest): Promise<GeneratedPersona> {\n const result = await this.fetch(`/personas/generate`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<GeneratedPersona>(result);\n }\n\n /**\n * @name Restore station personas\n * @description Writes back whichever of the station's own personas this station is missing, touching nothing it already has and putting nothing on air\n */\n async restoreStationPersonas(): Promise<PersonaList> {\n const result = await this.fetch(`/personas/restore`, { method: 'POST' });\n return await parseJson<PersonaList>(result);\n }\n\n /**\n * @name Export personas\n * @description Every character this station holds, as one file\n */\n async exportPersonas(): Promise<{ data: PersonaFile; headers: { contentDisposition?: string } }> {\n const result = await this.fetch(`/personas/export`, { method: 'GET' });\n const data = await parseJson<PersonaFile>(result);\n return { data, headers: { contentDisposition: result.headers.get('Content-Disposition') ?? undefined } };\n }\n\n /**\n * @name Export persona\n * @description One character, its sheet and its stories, as a file\n */\n async exportPersona(id: string): Promise<{ data: PersonaFile; headers: { contentDisposition?: string } }> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/export`, { method: 'GET' });\n const data = await parseJson<PersonaFile>(result);\n return { data, headers: { contentDisposition: result.headers.get('Content-Disposition') ?? undefined } };\n }\n\n /**\n * @name Preview persona import\n * @description Reads a file and reports what importing it would create, rewrite and skip. Writes nothing\n */\n async previewPersonaImport(body: PersonaFile): Promise<PersonaImportPlan> {\n const result = await this.fetch(`/personas/import/preview`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaImportPlan>(result);\n }\n\n /**\n * @name Import personas\n * @description Writes a file into this station, merging by key, and answers with what it did\n */\n async importPersonas(body: PersonaFile): Promise<PersonaImportResult> {\n const result = await this.fetch(`/personas/import`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaImportResult>(result);\n }\n\n /**\n * @name Update persona\n * @description Rewrites one persona. An edit to the one on air is heard on the next break\n */\n async updatePersona(id: string, body: PersonaInput): Promise<PersonaList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaList>(result);\n }\n\n /**\n * @name Delete persona\n * @description Removes a persona, including the one on air, which leaves the station with none\n */\n async deletePersona(id: string): Promise<PersonaList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}`, { method: 'DELETE' });\n return await parseJson<PersonaList>(result);\n }\n\n /**\n * @name Set the station host\n * @description Makes this persona the station's own host, and the previous one no longer is\n */\n async setTheStationHost(id: string): Promise<PersonaList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/default-host`, { method: 'PUT' });\n return await parseJson<PersonaList>(result);\n }\n\n /**\n * @name List persona notes\n * @description Everything this character has accumulated, oldest first, in every state\n */\n async listPersonaNotes(id: string): Promise<PersonaNoteList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/notes`, { method: 'GET' });\n return await parseJson<PersonaNoteList>(result);\n }\n\n /**\n * @name Write persona note\n * @description Writes a note by hand. An operator's own note is active from the moment it exists; only the distil pass proposes\n */\n async writePersonaNote(id: string, body: PersonaNoteWrite): Promise<PersonaNoteList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/notes`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaNoteList>(result);\n }\n\n /**\n * @name Update persona note\n * @description Rewrites one note's words, whoever wrote it. Editing what the station proposed is most of the point of the panel\n */\n async updatePersonaNote(id: string, noteId: string, body: PersonaNoteWrite): Promise<PersonaNoteList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/notes/${encodeURIComponent(noteId)}`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaNoteList>(result);\n }\n\n /**\n * @name Delete persona note\n * @description Removes a note outright. Turning down a PROPOSAL is a state rather than this, or the next pass writes it again\n */\n async deletePersonaNote(id: string, noteId: string): Promise<PersonaNoteList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/notes/${encodeURIComponent(noteId)}`, { method: 'DELETE' });\n return await parseJson<PersonaNoteList>(result);\n }\n\n /**\n * @name Set persona note state\n * @description Accepts a proposal, turns one down, or rests an active note. Mirrors the lexicon's own state route\n */\n async setPersonaNoteState(id: string, noteId: string, body: PersonaNoteState): Promise<PersonaNoteList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/notes/${encodeURIComponent(noteId)}/state`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaNoteList>(result);\n }\n\n /**\n * @name List persona stories\n * @description Every story this character holds, oldest first, in every state\n */\n async listPersonaStories(id: string): Promise<PersonaStoryList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories`, { method: 'GET' });\n return await parseJson<PersonaStoryList>(result);\n }\n\n /**\n * @name Write persona story\n * @description Writes a story by hand. An operator's own is tellable from the moment it exists; only the enrichment pass proposes\n */\n async writePersonaStory(id: string, body: PersonaStoryWrite): Promise<PersonaStoryList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaStoryList>(result);\n }\n\n /**\n * @name Update persona story\n * @description Rewrites one story's handle and telling, whoever wrote it\n */\n async updatePersonaStory(id: string, storyId: string, body: PersonaStoryWrite): Promise<PersonaStoryList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaStoryList>(result);\n }\n\n /**\n * @name Delete persona story\n * @description Removes a story outright, details and all. Turning down a PROPOSAL is a state rather than this, or the next pass writes it again\n */\n async deletePersonaStory(id: string, storyId: string): Promise<PersonaStoryList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}`, { method: 'DELETE' });\n return await parseJson<PersonaStoryList>(result);\n }\n\n /**\n * @name Set persona story state\n * @description Accepts a proposal, turns one down, or takes a story out of the rotation without losing it\n */\n async setPersonaStoryState(id: string, storyId: string, body: PersonaStoryState): Promise<PersonaStoryList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}/state`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaStoryList>(result);\n }\n\n /**\n * @name Add persona story detail\n * @description Adds one thing to a story that already exists\n */\n async addPersonaStoryDetail(id: string, storyId: string, body: PersonaStoryDetailWrite): Promise<PersonaStoryList> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}/details`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PersonaStoryList>(result);\n }\n\n /**\n * @name Update persona story detail\n * @description Rewrites one detail's words\n */\n async updatePersonaStoryDetail(id: string, storyId: string, detailId: string, body: PersonaStoryDetailWrite): Promise<PersonaStoryList> {\n const result = await this.fetch(\n `/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}/details/${encodeURIComponent(detailId)}`,\n {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n },\n );\n return await parseJson<PersonaStoryList>(result);\n }\n\n /**\n * @name Delete persona story detail\n * @description Removes one detail, leaving the story it was hung on alone\n */\n async deletePersonaStoryDetail(id: string, storyId: string, detailId: string): Promise<PersonaStoryList> {\n const result = await this.fetch(\n `/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}/details/${encodeURIComponent(detailId)}`,\n { method: 'DELETE' },\n );\n return await parseJson<PersonaStoryList>(result);\n }\n\n /**\n * @name Set persona story detail state\n * @description Accepts a proposed detail or turns it down, which has to outlive the pass that proposed it\n */\n async setPersonaStoryDetailState(id: string, storyId: string, detailId: string, body: PersonaStoryState): Promise<PersonaStoryList> {\n const result = await this.fetch(\n `/personas/${encodeURIComponent(id)}/stories/${encodeURIComponent(storyId)}/details/${encodeURIComponent(detailId)}/state`,\n {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n },\n );\n return await parseJson<PersonaStoryList>(result);\n }\n\n /**\n * @name Rehearse persona\n * @description Writes a talk break under this persona against two fixed invented records, and answers with every writer that was asked\n */\n async rehearsePersona(id: string): Promise<PersonaRehearsal> {\n const result = await this.fetch(`/personas/${encodeURIComponent(id)}/rehearse`, { method: 'POST' });\n return await parseJson<PersonaRehearsal>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson } from '../sdk-options.js';\nimport type { CatalogPlaylistPage, CatalogPlaylistTracks } from './types/playlists.types.js';\n\nexport class PlaylistsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List importable playlists\n * @description Fans out across every installed plugin that declares AND implements the `catalog` capability\n */\n async listImportablePlaylists(): Promise<CatalogPlaylistPage> {\n const result = await this.fetch(`/playlists`, { method: 'GET' });\n return await parseJson<CatalogPlaylistPage>(result);\n }\n\n /**\n * @name Get playlist tracks\n * @description One playlist's tracks from one plugin\n */\n async getPlaylistTracks(pluginId: string, playlistId: string): Promise<CatalogPlaylistTracks> {\n const result = await this.fetch(`/playlists/${encodeURIComponent(pluginId)}/${encodeURIComponent(playlistId)}/tracks`, { method: 'GET' });\n return await parseJson<CatalogPlaylistTracks>(result);\n }\n\n /**\n * @name Hide playlist\n * @description Hides one playlist from this station: the listing marks it hidden, the pickers stop offering it and the library sync stops reading it. Hiding one already hidden changes nothing\n */\n async hidePlaylist(pluginId: string, playlistId: string): Promise<void> {\n await this.fetch(`/playlists/${encodeURIComponent(pluginId)}/${encodeURIComponent(playlistId)}/hidden`, { method: 'PUT' });\n }\n\n /**\n * @name Show playlist\n * @description Shows a hidden playlist again. Showing one that is not hidden changes nothing\n */\n async showPlaylist(pluginId: string, playlistId: string): Promise<void> {\n await this.fetch(`/playlists/${encodeURIComponent(pluginId)}/${encodeURIComponent(playlistId)}/hidden`, { method: 'DELETE' });\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\nimport type { PlayoutChartInput, PlayoutPlaylistInput, PlayoutStatus } from './types/playout.types.js';\n\nexport class PlayoutClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name Get playout status\n * @description What the station is playing and what is queued behind it. The console polls this\n */\n async getPlayoutStatus(): Promise<PlayoutStatus> {\n const result = await this.fetch(`/playout/status`, { method: 'GET' });\n return await parseJson<PlayoutStatus>(result);\n }\n\n /**\n * @name Play a playlist\n * @description Loads a plugin playlist into the running order and starts handing it to the player. Replaces whatever was queued; what is on air finishes rather than being cut off\n */\n async playAPlaylist(body: PlayoutPlaylistInput): Promise<PlayoutStatus> {\n const result = await this.fetch(`/playout/playlist`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PlayoutStatus>(result);\n }\n\n /**\n * @name Play a chart\n * @description Builds the running order from a published chart and starts handing it to the player. The same replacement a playlist makes, from a document somebody else ranked\n */\n async playAChart(body: PlayoutChartInput): Promise<PlayoutStatus> {\n const result = await this.fetch(`/playout/chart`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PlayoutStatus>(result);\n }\n\n /**\n * @name Skip the current item\n * @description Ends the item on air so the next one starts immediately. The station owns the decoder, so this lands at once rather than waiting out audio already committed to a player\n */\n async skipTheCurrentItem(): Promise<PlayoutStatus> {\n const result = await this.fetch(`/playout/skip`, { method: 'POST' });\n return await parseJson<PlayoutStatus>(result);\n }\n\n /**\n * @name Start playout\n * @description Puts the station back on air with the running order it already has, picking it up where Stop left it. Distinct from putting a playlist on air, which builds a new broadcast and throws away what was there. Refused when there is nothing left to resume\n */\n async startPlayout(): Promise<PlayoutStatus> {\n const result = await this.fetch(`/playout/start`, { method: 'POST' });\n return await parseJson<PlayoutStatus>(result);\n }\n\n /**\n * @name Stop playout\n * @description Stands the station down: stops what is on air at once and hands the mount back. The running order is LEFT as it is, so `/playout/start` can pick it up where this stopped it. deadair holds the mount on a lease it renews while it has something to play, so stopping goes quiet rather than falling through to a bed nobody programmed\n */\n async stopPlayout(): Promise<PlayoutStatus> {\n const result = await this.fetch(`/playout/stop`, { method: 'POST' });\n return await parseJson<PlayoutStatus>(result);\n }\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * Lifecycle state of a plugin the host knows about\n * generated from [PluginStatus](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L7)\n */\nexport type PluginStatus = 'discovered' | 'disabled' | 'misconfigured' | 'active' | 'failed';\n\n/**\n * Where the station found a plugin: shipped inside the image, or installed by the operator into the plugins\n * directory on the data volume. Says nothing about trust; both kinds run inside the station with its privileges\n * generated from [PluginOrigin](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L11)\n */\nexport type PluginOrigin = 'bundled' | 'installed';\n\n/**\n * generated from [ConfigFieldType](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L13)\n */\nexport type ConfigFieldType = 'string' | 'text' | 'url' | 'secret' | 'number' | 'boolean' | 'select' | 'multiselect' | 'list' | 'note';\n\n/**\n * What a `number` field's value is measured in. The stored value is always in this unit; only the\n * control the operator touches changes, so a byte count stays a byte count everywhere it is read and\n * a `fraction` stays the share between 0 and 1 that the code multiplying by it wants\n * generated from [ConfigFieldUnit](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L18)\n */\nexport type ConfigFieldUnit = 'bytes' | 'fraction';\n\n/**\n * The control a field asks to be drawn with, where the ordinary one for its type reads badly. Opt-in\n * per field rather than inferred, because a slider is right for a value you feel for and wrong for\n * one you have to hit exactly, and `tags` is right for a comma-separated line that is really a SET\n * and wrong for one that is prose. Nothing about the stored value changes either way\n * generated from [ConfigFieldControl](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L24)\n */\nexport type ConfigFieldControl = 'slider' | 'tags';\n\n/**\n * One choice of a `select` config field\n * generated from [ConfigFieldOption](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L27)\n */\nexport interface ConfigFieldOption {\n value: string;\n label: string;\n}\n\n/**\n * Where a field's or a column's choices come from when only the console can enumerate them: the\n * station's own tables, the platform's zone list, the enabled plugins that can do one of four jobs,\n * or the models the selected model plugin currently offers. Resolved by the console either way\n * generated from [ConfigFieldOptionSource](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L35)\n */\nexport type ConfigFieldOptionSource =\n | 'station.newsCategories'\n | 'station.newsFeeds'\n | 'station.podcastShows'\n | 'station.narrationSeries'\n | 'intl.timeZones'\n | 'plugins.speech'\n | 'plugins.llm'\n | 'plugins.mixer'\n | 'plugins.analysis'\n | 'llm.models';\n\n/**\n * A plugin handed over from the browser. The generated client types the body as `FormData`, so\n * nothing checks this shape. It says what to send\n * generated from [PluginImport](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L93)\n */\nexport interface PluginImport {\n /** The gzip tarball npm pack writes: every entry under package/, holding package.json and the built code, at most 64 MB */\n file: Blob;\n}\n\n/**\n * generated from [PluginLogLevel](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L104)\n */\nexport type PluginLogLevel = 'debug' | 'info' | 'warn' | 'error';\n\n/**\n * A submitted settings form. Secret values arrive in here and are never echoed back\n * generated from [PluginConfigInput](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L136)\n */\nexport interface PluginConfigInput {\n config: Record<string, unknown>;\n}\n\n/**\n * What a plugin may do with a capability it asked for. Denied is the default and needs no row: a\n * capability is refused until somebody allows it, so \"never answered\" and \"refused\" are one state\n * generated from [GrantDecision](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L142)\n */\nexport type GrantDecision = 'allowed' | 'denied';\n\n/**\n * Outcome of the plugin's own `testConnection()`\n * generated from [PluginTestResult](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L166)\n */\nexport interface PluginTestResult {\n ok: boolean;\n message?: string;\n}\n\n/**\n * Where the console should send the browser to obtain the operator's consent. Reported rather than\n * redirected to: the route is behind the Bearer floor, so a browser cannot follow a redirect from it\n * generated from [PluginOAuthStart](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L184)\n */\nexport interface PluginOAuthStart {\n url: string;\n}\n\n/**\n * Outcome of an OAuth callback\n * generated from [PluginOAuthResult](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L189)\n */\nexport interface PluginOAuthResult {\n pluginId: string;\n ok: boolean;\n message?: string;\n}\n\n/**\n * generated from [PluginOAuthCallbackQuery](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L195)\n */\nexport interface PluginOAuthCallbackQuery {\n code?: string;\n state?: string;\n error?: string;\n ubi?: string;\n /**\n * What a desktop-style flow returns instead of `code`: the provider mints a token before the\n * consent screen and hands the same one back, which the plugin exchanges for a session. Last.fm's\n * auth works this way. Listed here because the route parses this query strictly, so an\n * undeclared parameter is a 400 before any plugin code runs\n */\n token?: string;\n}\n\n/**\n * Live choices for a plugin's config fields, keyed by field key, out of the plugin's own\n * `suggestConfigOptions()`. What `ConfigFieldDescriptor.options` cannot be: fixed when the manifest\n * was written, where these are whatever the operator's own server currently says\n * generated from [PluginFieldSuggestions](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L174)\n */\nexport interface PluginFieldSuggestions {\n /** Keys the plugin had nothing to say about are simply absent, rather than present and empty */\n fields: Record<string, ConfigFieldOption[]>;\n /**\n * False when the plugin does not implement suggestions at all, so a console can tell \"nothing to\n * suggest\" from \"asked and got nothing\", and draw a refresh control only where one would do something\n */\n supported: boolean;\n}\n\n/**\n * One column of a `list` field. Every ordinary cell is stored as a string in the row, so this describes the\n * control rather than the value; a `secret` cell is encrypted on its own and is never in the row at all\n * generated from [ConfigFieldColumn](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L39)\n */\nexport interface ConfigFieldColumn {\n key: string;\n label: string;\n type: 'string' | 'url' | 'select' | 'secret';\n required?: boolean;\n placeholder?: string;\n options?: ConfigFieldOption[];\n optionsFrom?: ConfigFieldOptionSource;\n /** Key of another column in the same list. This cell applies only to a row whose cell there holds one of `dependsOnValues`. Stronger than a field's `dependsOn`, which only hides a control: a cell that does not apply is neither sent by the console nor read by the host, so a `url` column that does not apply to a row contributes no hostname to the plugin's allowlist. A target this list does not declare, or a target cell still empty, shows the cell */\n dependsOn?: string;\n /** The values of the `dependsOn` cell this one applies to. Omitted means any non-empty value; ignored without a target */\n dependsOnValues?: string[];\n}\n\n/**\n * generated from [PluginLogEntry](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L106)\n */\nexport interface PluginLogEntry {\n ts: string;\n level: PluginLogLevel;\n /** Must match MAX_LINE_BYTES_CEILING in apps/api/src/logging/rotating.log.store.ts. Change both together */\n text: string;\n}\n\n/**\n * generated from [PluginLogQuery](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L118)\n */\nexport interface PluginLogQuery {\n limit?: number;\n level?: PluginLogLevel;\n}\n\n/**\n * generated from [PluginLogLevelInput](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L123)\n */\nexport interface PluginLogLevelInput {\n level: PluginLogLevel;\n}\n\n/**\n * One capability a plugin asked for, with the station's answer. The ask is the plugin's manifest and\n * the answer is a row, so a plugin that stops asking stops appearing here whatever was stored\n * generated from [PluginGrant](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L146)\n */\nexport interface PluginGrant {\n pluginId: string;\n pluginName: string;\n /** The host's own id for it, e.g. `network.open` */\n capability: string;\n /** What the host calls the capability */\n label: string;\n /** What allowing it opens up, in the station's words */\n describes: string;\n /** Why this plugin says it needs it, in the plugin's words */\n reason: string;\n decision: GrantDecision;\n}\n\n/**\n * generated from [PluginGrantInput](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L160)\n */\nexport interface PluginGrantInput {\n capability: string;\n decision: GrantDecision;\n}\n\n/**\n * Mirrors the plugin SDK's `ConfigField`: enough for a console to render the settings form with no per-plugin code\n * generated from [ConfigFieldDescriptor](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L52)\n */\nexport interface ConfigFieldDescriptor {\n key: string;\n label: string;\n type: ConfigFieldType;\n required?: boolean;\n default?: string | number | boolean;\n /** `number` only, and ignored elsewhere */\n unit?: ConfigFieldUnit;\n /** `slider` for a `number` with both `min` and `max`, `tags` for a `string` holding a comma-separated set */\n control?: ConfigFieldControl;\n /** How coarsely a `control` moves, in the field's own unit. Ignored without one, and defaults to 1 */\n step?: number;\n /** `number` only: the smallest value that will be accepted, inclusive */\n min?: number;\n /** `number` only: the largest value that will be accepted, inclusive */\n max?: number;\n placeholder?: string;\n help?: string;\n options?: ConfigFieldOption[];\n /** Choices only the console can enumerate. Merged where a plugin's own suggestions are, and outranked by them */\n optionsFrom?: ConfigFieldOptionSource;\n /** `list` only, and ignored elsewhere */\n columns?: ConfigFieldColumn[];\n /** Key of the field this one is only relevant to */\n dependsOn?: string;\n /** Key of the `number` field that is the upper end of the range this one opens, declared on the lower end only. Still two settings, each validated by name; the console draws them as one control whose handles cannot cross */\n rangeWith?: string;\n}\n\n/**\n * generated from [PluginLogPage](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L112)\n */\nexport interface PluginLogPage {\n pluginId: string;\n level: PluginLogLevel;\n /** Newest first, as the activity feed and the script history send. The download is the file as written, oldest first */\n entries: PluginLogEntry[];\n}\n\n/**\n * generated from [PluginGrantList](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L156)\n */\nexport interface PluginGrantList {\n /** Every capability every installed plugin is asking for, refused ones included */\n grants: PluginGrant[];\n}\n\n/**\n * A plugin as the settings list sees it. Carries no configured VALUES, only which secrets are set\n * generated from [PluginSummary](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L73)\n */\nexport interface PluginSummary {\n id: string;\n name: string;\n version: string;\n capabilities: string[];\n /** Whether the manifest declares the `trackFetcher` permission, so its records reach air through the station's own track fetcher and that fetcher needs its own authorization. Not the same as the `stream` capability, which a plugin that mints its own stream URLs declares too. Absent means it does not */\n usesTrackFetcher?: boolean;\n status: PluginStatus;\n origin: PluginOrigin;\n enabled: boolean;\n description?: string;\n icon?: string;\n configFields: ConfigFieldDescriptor[];\n /** Whether a value is currently stored, per `secret` field under its own key and per `secret` cell under `field/rowId/column`. Never the value itself */\n secretsConfigured: Record<string, boolean>;\n /** When this plugin was first ever enabled. Absent means it never has been, so the console asks before it is */\n firstEnabledAt?: DateTime;\n /** The last recorded failure. Absent means it is not currently unhappy */\n lastError?: string;\n /** When the breaker will probe this plugin again on its own. Absent means no probe is pending */\n nextProbeAt?: DateTime;\n}\n\nexport interface PluginSummaryInput {\n id: string;\n name: string;\n version: string;\n capabilities: string[];\n /** Whether the manifest declares the `trackFetcher` permission, so its records reach air through the station's own track fetcher and that fetcher needs its own authorization. Not the same as the `stream` capability, which a plugin that mints its own stream URLs declares too. Absent means it does not */\n usesTrackFetcher?: boolean;\n status: PluginStatus;\n origin: PluginOrigin;\n enabled: boolean;\n description?: string;\n icon?: string;\n configFields: ConfigFieldDescriptor[];\n /** Whether a value is currently stored, per `secret` field under its own key and per `secret` cell under `field/rowId/column`. Never the value itself */\n secretsConfigured: Record<string, boolean>;\n /** The last recorded failure. Absent means it is not currently unhappy */\n lastError?: string;\n}\n\n/** Rehydrates every wire-encoded scalar in a PluginSummary into its runtime type. Mutates and returns `raw`. */\nexport function revivePluginSummary(raw: PluginSummary): PluginSummary {\n const __o0 = raw as unknown as Record<string, unknown>;\n if (__o0['firstEnabledAt'] != null) {\n __o0['firstEnabledAt'] = __dt(__o0['firstEnabledAt'], 'PluginSummary.firstEnabledAt');\n }\n if (__o0['nextProbeAt'] != null) {\n __o0['nextProbeAt'] = __dt(__o0['nextProbeAt'], 'PluginSummary.nextProbeAt');\n }\n return raw;\n}\n\n/**\n * What an import did\n * generated from [PluginImportResult](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L98)\n */\nexport interface PluginImportResult {\n /** The id the imported plugin claimed */\n pluginId: string;\n /** The same version was already loaded, so the station runs the build it had until it restarts. False for a new plugin and for a new version */\n restartRequired: boolean;\n /** Every plugin, as the catalogue now stands. An import can take an older version away as well as add one */\n plugins: PluginSummary[];\n}\n\nexport interface PluginImportResultInput {\n /** The id the imported plugin claimed */\n pluginId: string;\n /** The same version was already loaded, so the station runs the build it had until it restarts. False for a new plugin and for a new version */\n restartRequired: boolean;\n /** Every plugin, as the catalogue now stands. An import can take an older version away as well as add one */\n plugins: PluginSummaryInput[];\n}\n\n/** Rehydrates every wire-encoded scalar in a PluginImportResult into its runtime type. Mutates and returns `raw`. */\nexport function revivePluginImportResult(raw: PluginImportResult): PluginImportResult {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['plugins'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n revivePluginSummary(__a1[__i2] as never);\n }\n }\n return raw;\n}\n\n/**\n * A summary plus the stored NON-SECRET configuration\n * generated from [PluginDetail](../../../../../apps/api/data/contracts/plugins/plugins.types.ck#L128)\n */\nexport interface PluginDetail extends PluginSummary {\n /** Absolute path of the plugin's directory on the station */\n dir: string;\n config: Record<string, unknown>;\n oauthConnected?: boolean;\n logLevel: PluginLogLevel;\n}\n\nexport interface PluginDetailInput extends PluginSummaryInput {\n /** Absolute path of the plugin's directory on the station */\n dir: string;\n config: Record<string, unknown>;\n oauthConnected?: boolean;\n logLevel: PluginLogLevel;\n}\n\n/** Rehydrates every wire-encoded scalar in a PluginDetail into its runtime type. Mutates and returns `raw`. */\nexport function revivePluginDetail(raw: PluginDetail): PluginDetail {\n revivePluginSummary(raw as never);\n return raw;\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson, buildQueryString } from '../sdk-options.js';\nimport type {\n PluginConfigInput,\n PluginDetail,\n PluginFieldSuggestions,\n PluginGrantInput,\n PluginGrantList,\n PluginImportResult,\n PluginLogLevelInput,\n PluginLogPage,\n PluginLogQuery,\n PluginOAuthCallbackQuery,\n PluginOAuthResult,\n PluginOAuthStart,\n PluginSummary,\n PluginTestResult,\n} from './types/plugins.types.js';\nimport { revivePluginDetail, revivePluginImportResult, revivePluginSummary } from './types/plugins.types.js';\n\nexport class PluginsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List plugins\n * @description Lists every plugin the host knows about\n */\n async listPlugins(): Promise<PluginSummary[]> {\n const result = await this.fetch(`/plugins`, { method: 'GET' });\n return (await parseJson<PluginSummary[]>(result)).map(revivePluginSummary);\n }\n\n /**\n * @name List plugin grants\n * @description Every capability an installed plugin is asking the operator for, with the answer so far\n */\n async listPluginGrants(): Promise<PluginGrantList> {\n const result = await this.fetch(`/plugins/grants`, { method: 'GET' });\n return await parseJson<PluginGrantList>(result);\n }\n\n /**\n * @name Rescan plugins\n * @description Rescans the mounted plugin directory: registers new plugins, unloads removed ones\n */\n async rescanPlugins(): Promise<PluginSummary[]> {\n const result = await this.fetch(`/plugins/rescan`, { method: 'POST' });\n return (await parseJson<PluginSummary[]>(result)).map(revivePluginSummary);\n }\n\n /**\n * @name Import plugin\n * @description Takes a plugin in from the browser as the tarball npm pack writes and puts it in the plugins directory. It lands disabled, and a newer version of an installed plugin replaces the older one\n */\n async importPlugin(body: FormData): Promise<PluginImportResult> {\n const result = await this.fetch(`/plugins/import`, {\n method: 'POST',\n body: body,\n });\n return revivePluginImportResult(await parseJson<PluginImportResult>(result));\n }\n\n /**\n * @name Get plugin\n * @description One plugin, including its stored non-secret configuration and last error\n */\n async getPlugin(id: string): Promise<PluginDetail> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}`, { method: 'GET' });\n return revivePluginDetail(await parseJson<PluginDetail>(result));\n }\n\n /**\n * @name Remove plugin\n * @description Removes a plugin the operator installed: stops it and deletes its folder. Its settings are kept, so importing it again brings them back. A bundled plugin is refused\n */\n async removePlugin(id: string): Promise<PluginSummary[]> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}`, { method: 'DELETE' });\n return (await parseJson<PluginSummary[]>(result)).map(revivePluginSummary);\n }\n\n /**\n * @name Update plugin configuration\n * @description Validates against the plugin's own config schema, encrypts secrets, persists, and reinitializes\n */\n async updatePluginConfiguration(id: string, body: PluginConfigInput): Promise<PluginDetail> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/config`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return revivePluginDetail(await parseJson<PluginDetail>(result));\n }\n\n /**\n * @name Enable plugin\n * @description Enables a plugin without resubmitting its configuration\n */\n async enablePlugin(id: string): Promise<PluginDetail> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/enable`, { method: 'POST' });\n return revivePluginDetail(await parseJson<PluginDetail>(result));\n }\n\n /**\n * @name Disable plugin\n * @description Disables a plugin and tears its instance down, keeping its configuration\n */\n async disablePlugin(id: string): Promise<PluginDetail> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/disable`, { method: 'POST' });\n return revivePluginDetail(await parseJson<PluginDetail>(result));\n }\n\n /**\n * @name Decide plugin grant\n * @description Answers one capability this plugin asked for. Takes effect on the next fetch, with no reload\n */\n async decidePluginGrant(id: string, body: PluginGrantInput): Promise<PluginGrantList> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/grants`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PluginGrantList>(result);\n }\n\n /**\n * @name Reload plugin\n * @description Reapplies the plugin's stored configuration: disposes the running instance and initializes it again\n */\n async reloadPlugin(id: string): Promise<PluginDetail> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/reload`, { method: 'POST' });\n return revivePluginDetail(await parseJson<PluginDetail>(result));\n }\n\n /**\n * @name Test plugin connection\n * @description Runs the plugin's own `testConnection()` through the invoker\n */\n async testPluginConnection(id: string): Promise<PluginTestResult> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/test`, { method: 'POST' });\n return await parseJson<PluginTestResult>(result);\n }\n\n /**\n * @name Suggest plugin config options\n * @description Asks the plugin what to offer for its config fields right now, through the invoker\n */\n async suggestPluginConfigOptions(id: string): Promise<PluginFieldSuggestions> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/config/suggestions`, { method: 'POST' });\n return await parseJson<PluginFieldSuggestions>(result);\n }\n\n /**\n * @name Get plugin logs\n * @description Returns the plugin's buffered log lines at or above the current log level\n */\n async getPluginLogs(id: string, query?: PluginLogQuery): Promise<PluginLogPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/logs${qs}`, {\n method: 'GET',\n });\n return await parseJson<PluginLogPage>(result);\n }\n\n /**\n * @name Download plugin logs\n * @description Streams the plugin's full retained log as a plain-text attachment\n */\n async downloadPluginLogs(id: string): Promise<{ data: string; headers: { contentDisposition?: string } }> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/logs/download`, { method: 'GET' });\n const data = await result.text();\n return { data, headers: { contentDisposition: result.headers.get('Content-Disposition') ?? undefined } };\n }\n\n /**\n * @name Set plugin log level\n * @description Sets the minimum severity the plugin's log store retains going forward\n */\n async setPluginLogLevel(id: string, body: PluginLogLevelInput): Promise<PluginDetail> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/logs/level`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return revivePluginDetail(await parseJson<PluginDetail>(result));\n }\n\n /**\n * @name Start plugin OAuth authorization\n * @description Reports where to send the operator for the provider's consent screen\n */\n async startPluginOAuthAuthorization(id: string): Promise<PluginOAuthStart> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/oauth/authorize`, { method: 'GET' });\n return await parseJson<PluginOAuthStart>(result);\n }\n\n /**\n * @name Disconnect plugin OAuth\n * @description Forgets the plugin's stored OAuth tokens and reinitializes it\n */\n async disconnectPluginOAuth(id: string): Promise<PluginDetail> {\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/oauth`, { method: 'DELETE' });\n return revivePluginDetail(await parseJson<PluginDetail>(result));\n }\n\n /**\n * @name Complete plugin OAuth authorization\n * @description Completes the flow. Anonymous: the provider redirects the browser here with no session of ours\n */\n async completePluginOAuthAuthorization(id: string, query?: PluginOAuthCallbackQuery): Promise<PluginOAuthResult> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/plugins/${encodeURIComponent(id)}/oauth/callback${qs}`, {\n method: 'GET',\n });\n return await parseJson<PluginOAuthResult>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson, buildQueryString } from '../sdk-options.js';\nimport type {\n StationDirectoryPage,\n StationDirectoryQuery,\n StationEpisode,\n StationEpisodePage,\n StationEpisodeQuery,\n StationShowList,\n} from './types/podcasts.types.js';\n\nexport class PodcastsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List shows\n * @description Every programme every installed podcast plugin carries\n */\n async listShows(): Promise<StationShowList> {\n const result = await this.fetch(`/podcasts/shows`, { method: 'GET' });\n return await parseJson<StationShowList>(result);\n }\n\n /**\n * @name Search podcast directory\n * @description Looks a show up in the directories the installed podcast plugins can search\n */\n async searchPodcastDirectory(query?: StationDirectoryQuery): Promise<StationDirectoryPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/podcasts/search${qs}`, {\n method: 'GET',\n });\n return await parseJson<StationDirectoryPage>(result);\n }\n\n /**\n * @name List episodes\n * @description The episodes the station knows about, newest first, with what it has done with each\n */\n async listEpisodes(query?: StationEpisodeQuery): Promise<StationEpisodePage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/podcasts/episodes${qs}`, {\n method: 'GET',\n });\n return await parseJson<StationEpisodePage>(result);\n }\n\n /**\n * @name Fetch episode\n * @description Fetches one episode's audio into the station's store now, rather than waiting for its slot to come near\n */\n async fetchEpisode(id: string): Promise<StationEpisode> {\n const result = await this.fetch(`/podcasts/episodes/${encodeURIComponent(id)}/fetch`, { method: 'POST' });\n return await parseJson<StationEpisode>(result);\n }\n\n /**\n * @name Refresh podcasts\n * @description Reads every show's feed again, in the background, rather than waiting for the next scheduled refresh\n */\n async refreshPodcasts(): Promise<void> {\n await this.fetch(`/podcasts/refresh`, { method: 'POST' });\n }\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * One person in a production: the presenter, or somebody cast to phone in. A snapshot rather than a\n * reference, because the persona it names may be edited or deleted while the programme is still being\n * made and what the turns were written as has to be what an operator reads back\n * generated from [ProductionCastMember](../../../../../apps/api/data/contracts/productions/productions.types.ck#L10)\n */\nexport interface ProductionCastMember {\n role: 'host' | 'caller';\n /** What they are called on air */\n name?: string;\n /** The persona key, for a link back to the character */\n persona?: string;\n}\n\n/**\n * What an operator asks for. Everything else about a production is decided by the passes that make it\n * generated from [ProductionRequest](../../../../../apps/api/data/contracts/productions/productions.types.ck#L39)\n */\nexport interface ProductionRequest {\n kind?: string;\n /** Absent is named after its kind and the moment it was asked for, which is what somebody taking a call now wants rather than a box to fill in */\n title?: string;\n brief?: string;\n personaId?: string;\n /** Absent takes the station's `render.productionWritingMode` */\n writingMode?: 'quick' | 'outlined' | 'polished';\n targetMs?: number;\n scheduledFor?: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a ProductionRequest into its runtime type. Mutates and returns `raw`. */\nexport function reviveProductionRequest(raw: ProductionRequest): ProductionRequest {\n const __o0 = raw as unknown as Record<string, unknown>;\n if (__o0['scheduledFor'] != null) {\n __o0['scheduledFor'] = __dt(__o0['scheduledFor'], 'ProductionRequest.scheduledFor');\n }\n return raw;\n}\n\n/**\n * Something the station makes rather than something it says: several beats of speech, written in several passes, that airs as one block\n * generated from [Production](../../../../../apps/api/data/contracts/productions/productions.types.ck#L17)\n */\nexport interface Production {\n id: string;\n /** What sort of production: podcast, bulletin, feature. Free text, so a station that wants a documentary strand needs no migration */\n kind: string;\n title: string;\n /** What was asked for, in the operator's own words. Distinct from the title, which is only a label */\n brief?: string;\n /** Who presents it. Absent falls back to the station's active persona when a pass runs */\n personaId?: string;\n /** How many passes to spend on it */\n writingMode: 'quick' | 'outlined' | 'polished';\n /** How long it should run. What the beat count and the per-beat word budgets are computed from */\n targetMs: number;\n /** `stitching` is the beats being joined into one piece of audio, and it leads to `ready` whether that worked or not */\n state: 'planned' | 'outlining' | 'drafting' | 'checking' | 'rendering' | 'stitching' | 'ready' | 'aired' | 'failed' | 'cancelled';\n /** Why making it did not work */\n error?: string;\n /** When it should air. Absent means as soon as it is made */\n scheduledFor?: DateTime;\n cancelledAt?: DateTime;\n /** How many beats exist so far, which is how far along the drafting is */\n beats: number;\n /** Who is on it, decided by the first pass that ran. Empty for one nobody has started, and for a programme the presenter reads alone */\n cast: ProductionCastMember[];\n createdAt: DateTime;\n}\n\nexport interface ProductionInput {\n /** What sort of production: podcast, bulletin, feature. Free text, so a station that wants a documentary strand needs no migration */\n kind: string;\n title: string;\n /** What was asked for, in the operator's own words. Distinct from the title, which is only a label */\n brief?: string;\n /** Who presents it. Absent falls back to the station's active persona when a pass runs */\n personaId?: string;\n /** How many passes to spend on it */\n writingMode: 'quick' | 'outlined' | 'polished';\n /** How long it should run. What the beat count and the per-beat word budgets are computed from */\n targetMs: number;\n /** When it should air. Absent means as soon as it is made */\n scheduledFor?: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a Production into its runtime type. Mutates and returns `raw`. */\nexport function reviveProduction(raw: Production): Production {\n const __o0 = raw as unknown as Record<string, unknown>;\n if (__o0['scheduledFor'] != null) {\n __o0['scheduledFor'] = __dt(__o0['scheduledFor'], 'Production.scheduledFor');\n }\n if (__o0['cancelledAt'] != null) {\n __o0['cancelledAt'] = __dt(__o0['cancelledAt'], 'Production.cancelledAt');\n }\n __o0['createdAt'] = __dt(__o0['createdAt'], 'Production.createdAt');\n return raw;\n}\n\n/**\n * generated from [ProductionList](../../../../../apps/api/data/contracts/productions/productions.types.ck#L34)\n */\nexport interface ProductionList {\n productions: Production[];\n}\n\nexport interface ProductionListInput {\n productions: ProductionInput[];\n}\n\n/** Rehydrates every wire-encoded scalar in a ProductionList into its runtime type. Mutates and returns `raw`. */\nexport function reviveProductionList(raw: ProductionList): ProductionList {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['productions'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveProduction(__a1[__i2] as never);\n }\n }\n return raw;\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\nimport type { Production, ProductionList, ProductionRequest } from './types/productions.types.js';\nimport { reviveProduction, reviveProductionList } from './types/productions.types.js';\n\nexport class ProductionsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List productions\n * @description Everything the station has made or is making, newest first\n */\n async listProductions(): Promise<ProductionList> {\n const result = await this.fetch(`/productions`, { method: 'GET' });\n return reviveProductionList(await parseJson<ProductionList>(result));\n }\n\n /**\n * @name Request production\n * @description Asks the station to make one. It is queued, not started\n */\n async requestProduction(body: ProductionRequest): Promise<Production> {\n const result = await this.fetch(`/productions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return reviveProduction(await parseJson<Production>(result));\n }\n\n /**\n * @name Cancel production\n * @description Stops a production being made, for good\n */\n async cancelProduction(id: string): Promise<Production> {\n const result = await this.fetch(`/productions/${encodeURIComponent(id)}/cancel`, { method: 'POST' });\n return reviveProduction(await parseJson<Production>(result));\n }\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * One thing the station can play that is not a record\n * generated from [Segment](../../../../../apps/api/data/contracts/render/render.types.ck#L7)\n */\nexport interface Segment {\n id: string;\n /** What sort of element it is: `ident`, `stinger`, `talkbreak`, `news` */\n kind: string;\n /** One state per stage of making it. Only `ready` can go on air; the station skips anything else rather than waiting for it */\n state: 'planned' | 'writing' | 'written' | 'rendering' | 'ready' | 'failed';\n /** What the console calls it, and what the mount is labelled with while it airs */\n label: string;\n /** Who made it: `library` for a file dropped into the inbox */\n source: string;\n /** Whether there is audio behind it yet */\n playable: boolean;\n /** The words, for anything that speaks. Absent for an imported recording */\n script?: string;\n /** The words as the speech engine was handed them: symbols said, years read as a person reads them, the station's pronunciation list applied. Absent until something has spoken it */\n spokenScript?: string;\n /** The file in the inbox this came from. The bytes were copied, so emptying the inbox does not take it off the air */\n sourcePath?: string;\n /** How long it runs. A display value: the player measures the audio itself */\n durationMs?: number;\n /** Why it is `failed` */\n error?: string;\n /** The station's own name for the voice this is said in, e.g. `host`. Absent means the speech plugin's default */\n voice?: string;\n /** How the words are read: `hushed` or `frantic`. Absent is the voice's own ordinary reading, which is nearly every segment */\n delivery?: string;\n}\n\n/**\n * Something for the station to say, before anything has said it\n * generated from [SegmentCreate](../../../../../apps/api/data/contracts/render/render.types.ck#L23)\n */\nexport interface SegmentCreate {\n /** What the console calls it, and what the mount is labelled with while it airs */\n label: string;\n /** The words to say */\n script: string;\n /** What sort of element it is. Defaults to `talkbreak` */\n kind?: string;\n /** A station voice name the speech plugin knows how to map. Absent uses its default */\n voice?: string;\n /** How to read the words: `hushed` or `frantic`, and refused otherwise. Absent is the voice's own ordinary reading. Dropped at render time by an engine that cannot perform it */\n delivery?: string;\n}\n\n/**\n * A recording arriving from the browser, as multipart form parts.\n *\n * Documentation rather than validation: a multipart body reaches the service as the raw parser and\n * the generated client types the body as `FormData`, so nothing checks this shape. It says what to\n * send\n * generated from [SegmentUpload](../../../../../apps/api/data/contracts/render/render.types.ck#L36)\n */\nexport interface SegmentUpload {\n /** The audio itself. mp3, wav, ogg, flac or m4a, and at most 50 MB */\n file: Blob;\n /** What sort of element it is, which is also the directory it is filed under. A kind nothing else uses becomes a bookable band on the format clock */\n kind: string;\n /** What the console calls it, and what the mount is labelled with while it airs. Derived from the filename when absent */\n label?: string;\n}\n\n/**\n * A voice the station can be asked to speak in\n * generated from [Voice](../../../../../apps/api/data/contracts/render/render.types.ck#L46)\n */\nexport interface Voice {\n /** What to pass as a segment's `voice`. Empty means the plugin's own default */\n id: string;\n /** What the console calls it */\n label: string;\n /** What it sounds like, or what it maps to on the engine */\n description?: string;\n}\n\n/**\n * Whether there are words, and if not, which way it went wrong\n * generated from [ScriptOutcome](../../../../../apps/api/data/contracts/render/render.types.ck#L59)\n */\nexport type ScriptOutcome = 'written' | 'declined' | 'failed';\n\n/**\n * A record a writer was told about, kept as it was told\n * generated from [ScriptNeighbour](../../../../../apps/api/data/contracts/render/render.types.ck#L61)\n */\nexport interface ScriptNeighbour {\n title: string;\n artist: string;\n /** What it was shown about the record. A break that said nothing interesting and one that was TOLD nothing interesting read the same from the script alone */\n facts?: string[];\n}\n\n/**\n * What the provider said the attempt cost, when it said anything\n * generated from [ScriptUsage](../../../../../apps/api/data/contracts/render/render.types.ck#L67)\n */\nexport interface ScriptUsage {\n inputTokens?: number;\n outputTokens?: number;\n totalTokens?: number;\n}\n\n/**\n * One turn of the conversation a writer sent\n * generated from [ScriptPromptMessage](../../../../../apps/api/data/contracts/render/render.types.ck#L73)\n */\nexport interface ScriptPromptMessage {\n role: string;\n content: string;\n}\n\n/**\n * What an operator thought of something the station said.\n *\n * The catalog's three spellings exactly, and deliberately not a second vocabulary: an opinion is an\n * opinion whether it is about a record or about a sentence, and `catalog/rating.ts` is the one place\n * the words and the column's numbers meet.\n *\n * `neutral` is a real answer rather than an absence. Rating something back to nothing is a thing an\n * operator does, and it has to be distinguishable from never having listened, which is the field\n * being absent on the attempt.\n * generated from [ScriptRating](../../../../../apps/api/data/contracts/render/render.types.ck#L110)\n */\nexport type ScriptRating = 'liked' | 'neutral' | 'disliked';\n\n/**\n * Words to hear before anything has aired them\n * generated from [SpeechPreviewRequest](../../../../../apps/api/data/contracts/render/render.types.ck#L131)\n */\nexport interface SpeechPreviewRequest {\n /** What to say. Far under a segment's 20000 because this is one break heard once, and the cap is what bounds a cache keyed on the words themselves */\n text: string;\n /** A station voice name, as a segment's `voice`. Absent uses the plugin's own default */\n voice?: string;\n /** How to read it, as a segment's `delivery`: `hushed` or `frantic`, and refused otherwise. Absent is the voice's own ordinary reading */\n delivery?: string;\n}\n\n/**\n * The window the counts cover\n * generated from [ScriptHistorySummaryQuery](../../../../../apps/api/data/contracts/render/render.types.ck#L138)\n */\nexport interface ScriptHistorySummaryQuery {\n /** How far back to count. Defaults to 24, and a week at most, because past that the nightly sweep may already have taken the rows and the count would quietly be of what survived rather than of what happened */\n hours?: number;\n}\n\n/**\n * One presenter's attempts in the window\n * generated from [ScriptHistorySummaryRow](../../../../../apps/api/data/contracts/render/render.types.ck#L142)\n */\nexport interface ScriptHistorySummaryRow {\n /** Absent means nobody was presenting, which is an ordinary state rather than a gap in the data */\n personaKey?: string;\n written: number;\n /** A decline is the writer registry working: the model had nothing to say and the floor covered for it */\n declined: number;\n failed: number;\n}\n\n/**\n * What one pass over the inbox did\n * generated from [SegmentScanResult](../../../../../apps/api/data/contracts/render/render.types.ck#L154)\n */\nexport interface SegmentScanResult {\n /** Audio files seen, whether or not they were already known */\n scanned: number;\n /** Segments the station did not have before this pass */\n imported: number;\n /** Files passed over: not audio it can serve, or unreadable */\n skipped: number;\n}\n\n/**\n * One name the station says differently from how it is written\n * generated from [Pronunciation](../../../../../apps/api/data/contracts/render/render.types.ck#L160)\n */\nexport interface Pronunciation {\n id: string;\n /** What appears in a script. Matched case-insensitively, and whole words only */\n written: string;\n /** What the engine is handed instead, untouched. EMPTY is meaningful: it drops the words, which is the honest reading for a marker that got into a title and is not a word */\n spoken: string;\n /** `active` is said. `suggested` is proposed and says nothing yet. `rejected` outlives the pass that proposed it, or the same article proposes it again forever */\n state: 'active' | 'suggested' | 'rejected';\n /** Who says so. `gloss` is a pronunciation key an encyclopaedia article printed for itself */\n origin: 'operator' | 'gloss';\n /** The article. Present on anything an operator did not type */\n sourceUrl?: string;\n /** The sentence that says so, as it stands in the article, which is what the decision is actually made on */\n sourceQuote?: string;\n /** What the article was about */\n subjectKind?: 'track' | 'album' | 'artist';\n subjectId?: string;\n createdAt: string;\n}\n\n/**\n * A name and how to say it\n * generated from [PronunciationWrite](../../../../../apps/api/data/contracts/render/render.types.ck#L177)\n */\nexport interface PronunciationWrite {\n written: string;\n /** Empty drops the words rather than saying them */\n spoken: string;\n}\n\n/**\n * Accepting a proposal, turning one down, or taking an entry out of use without losing it\n * generated from [PronunciationStateWrite](../../../../../apps/api/data/contracts/render/render.types.ck#L182)\n */\nexport interface PronunciationStateWrite {\n state: 'active' | 'suggested' | 'rejected';\n}\n\n/**\n * Which part of the lexicon to read\n * generated from [PronunciationQuery](../../../../../apps/api/data/contracts/render/render.types.ck#L186)\n */\nexport interface PronunciationQuery {\n /** Absent is all of it */\n state?: 'active' | 'suggested' | 'rejected';\n}\n\n/**\n * One sound on a soundboard, as the console draws it.\n *\n * `name` is what a script writes to hit it and `label` is what a person reads: two columns rather\n * than one, because a token for a model and prose for an operator are different things and the\n * filename produces both\n * generated from [Pad](../../../../../apps/api/data/contracts/render/render.types.ck#L195)\n */\nexport interface Pad {\n id: string;\n /** Which directory it arrived in. Provenance: what reaches it is a set */\n board: string;\n /** The keys of the sets it is on. Empty means it is in the library and nothing can hit it */\n sets: string[];\n /** What a script writes: `[sfx:airhorn]` */\n name: string;\n label: string;\n durationMs?: number;\n /** How loud it came out, once something measured it. Absent on a station with no analyzer, which is ordinary */\n loudnessLufs?: number;\n /** Who put the file there: `library` for one the operator dropped in, `upload` or `url` for one the console wrote. It decides whether the console may delete it */\n source: string;\n /** The file in the library directory it was imported from, so the console can say where it came from */\n sourcePath?: string;\n /** When it was last hit. Absent for one nothing has reached for yet */\n lastUsedAt?: DateTime;\n state: 'active' | 'rejected';\n}\n\nexport interface PadInput {\n /** Which directory it arrived in. Provenance: what reaches it is a set */\n board: string;\n /** What a script writes: `[sfx:airhorn]` */\n name: string;\n label: string;\n durationMs?: number;\n /** How loud it came out, once something measured it. Absent on a station with no analyzer, which is ordinary */\n loudnessLufs?: number;\n /** The file in the library directory it was imported from, so the console can say where it came from */\n sourcePath?: string;\n /** When it was last hit. Absent for one nothing has reached for yet */\n lastUsedAt?: DateTime;\n state: 'active' | 'rejected';\n}\n\n/** Rehydrates every wire-encoded scalar in a Pad into its runtime type. Mutates and returns `raw`. */\nexport function revivePad(raw: Pad): Pad {\n const __o0 = raw as unknown as Record<string, unknown>;\n if (__o0['lastUsedAt'] != null) {\n __o0['lastUsedAt'] = __dt(__o0['lastUsedAt'], 'Pad.lastUsedAt');\n }\n return raw;\n}\n\n/**\n * A sound arriving from the browser, as multipart form parts.\n *\n * Documentation rather than validation: a multipart body reaches the service as the raw parser and\n * the generated client types the body as `FormData`, so nothing checks this shape. It says what to\n * send\n * generated from [PadUpload](../../../../../apps/api/data/contracts/render/render.types.ck#L214)\n */\nexport interface PadUpload {\n /** The audio itself. mp3, wav, ogg, flac or m4a, and at most 25 MB */\n file: Blob;\n /** The directory it is filed under, which is also the set it joins. A new name makes both */\n board: string;\n /** What a script will write. Derived from the filename when absent, and the FILE is named after this either way */\n name?: string;\n /** What the console calls it. Derived from the filename when absent */\n label?: string;\n}\n\n/**\n * A sound the station is being told to go and get.\n *\n * The operator names the address, so this is them choosing a file exactly as dropping one in the\n * library is. Nothing inspects what comes back and nothing records a claim about its licence -- see\n * `docs/internals/render.md` under \"Pads\", whose line is redistribution rather than use\n * generated from [PadFetch](../../../../../apps/api/data/contracts/render/render.types.ck#L226)\n */\nexport interface PadFetch {\n /** Where the audio is. Followed once, bounded, and refused unless what comes back is a format the station serves */\n url: string;\n /** The directory it is filed under, which is also the set it joins */\n board: string;\n /** What a script will write. Derived from the address when absent */\n name?: string;\n label?: string;\n}\n\n/**\n * A named collection of pads: what a presenter is actually handed.\n *\n * One library, cut as many ways as an operator likes. `personas.soundboard` holds the `key`, so\n * renaming a set unpoints every persona naming it — which is why `personas` says who those are\n * generated from [PadSet](../../../../../apps/api/data/contracts/render/render.types.ck#L242)\n */\nexport interface PadSet {\n id: string;\n /** The slug a persona names. A directory in the pad library makes one of these */\n key: string;\n label: string;\n position: number;\n /** How many sounds are on it. Zero is ordinary: it is what a set looks like before anybody drops a file */\n pads: number;\n /** Who is pointed at it, so a rename or a delete can say what it is about to unpoint */\n personas: string[];\n}\n\nexport interface PadSetInput {\n /** The slug a persona names. A directory in the pad library makes one of these */\n key: string;\n label: string;\n position: number;\n}\n\n/**\n * A set an operator is naming, or renaming\n * generated from [PadSetWrite](../../../../../apps/api/data/contracts/render/render.types.ck#L251)\n */\nexport interface PadSetWrite {\n key: string;\n label: string;\n position?: number;\n}\n\n/**\n * Which pad, and whether it is on the set\n * generated from [PadSetMembership](../../../../../apps/api/data/contracts/render/render.types.ck#L257)\n */\nexport interface PadSetMembership {\n padId: string;\n on: boolean;\n}\n\n/**\n * Turning a pad down, or putting one back\n * generated from [PadState](../../../../../apps/api/data/contracts/render/render.types.ck#L262)\n */\nexport interface PadState {\n state: 'active' | 'rejected';\n}\n\n/**\n * What one pass over the pad library did\n * generated from [PadScanResult](../../../../../apps/api/data/contracts/render/render.types.ck#L266)\n */\nexport interface PadScanResult {\n /** Audio files seen, whether or not anything changed */\n scanned: number;\n /** Sounds the station did not have before */\n imported: number;\n /** Slots whose file changed under them, which every script naming them now plays */\n replaced: number;\n /** Sounds that reached the library but not their set, because it already answered to their name. In the library and unreachable until somebody says where they go */\n contested: number;\n /** Files passed over: not audio, unreadable, or named something no script could write */\n skipped: number;\n}\n\n/**\n * Everything the station can play that is not a record\n * generated from [SegmentList](../../../../../apps/api/data/contracts/render/render.types.ck#L42)\n */\nexport interface SegmentList {\n segments: Segment[];\n}\n\n/**\n * The voices the station's current speech plugin offers\n * generated from [VoiceList](../../../../../apps/api/data/contracts/render/render.types.ck#L52)\n */\nexport interface VoiceList {\n voices: Voice[];\n /** Which plugin answered. Absent when nothing can speak */\n pluginId?: string;\n /** Why there are no voices, when there are none */\n reason?: string;\n /** Which readings that plugin can perform right now, out of `hushed` and `frantic`. Absent or empty means none, which is most engines and is not a fault */\n deliveries?: string[];\n}\n\n/**\n * One page of what the station has written, newest first\n * generated from [ScriptHistoryQuery](../../../../../apps/api/data/contracts/render/render.types.ck#L116)\n */\nexport interface ScriptHistoryQuery {\n limit?: number;\n /** Where the previous page ended. Opaque, and a keyset rather than an offset because rows arrive at the head continuously. Pass back whatever `nextBefore` said and nothing else */\n before?: string;\n kind?: string;\n writer?: string;\n outcome?: ScriptOutcome;\n /** Everything ONE character has said. Absent is every character and none */\n personaKey?: string;\n /** Every attempt made for ONE break, which is how a console reaches the words behind an item of the running order. Absent is the whole history */\n segmentId?: string;\n}\n\n/**\n * One attempt to write something the station would say, including the ones that came to nothing\n * generated from [ScriptAttempt](../../../../../apps/api/data/contracts/render/render.types.ck#L78)\n */\nexport interface ScriptAttempt {\n id: string;\n at: DateTime;\n /** What sort of break it was for: `talkbreak`, `welcome`, `news` */\n kind: string;\n /** The binding that produced or declined it */\n writer: string;\n outcome: ScriptOutcome;\n /** Who was presenting, as the persona's own key. Absent means nobody was, which is an ordinary state. Stamped on every attempt including the declined ones, so a character whose model breaks are all being refused is visible rather than hidden behind the floor */\n personaKey?: string;\n label?: string;\n /** The words. Absent for an attempt that produced none */\n script?: string;\n /** How the writer chose to have the words read, `hushed` or `frantic`. Absent for an ordinary reading */\n delivery?: string;\n /** The model that said it, for a writer that used one */\n model?: string;\n /** What the line was rendered from, for a writer working from something an operator can edit */\n source?: string;\n /** Why, for anything that is not `written` */\n reason?: string;\n /** The segment this was for, while it is still known. The row outlives it */\n segmentId?: string;\n previous?: ScriptNeighbour;\n next?: ScriptNeighbour;\n /** How long the attempt took */\n durationMs?: number;\n usage?: ScriptUsage;\n /** The answer before anything read it. Only while `llm.captureWrites` is on */\n raw?: string;\n /** What the writer sent. Only while `llm.captureWrites` is on */\n prompt?: ScriptPromptMessage[];\n /** What the operator thought of it. ABSENT means nobody has said, which `neutral` does not */\n rating?: ScriptRating;\n}\n\nexport interface ScriptAttemptInput {\n id: string;\n at: DateTime;\n /** What sort of break it was for: `talkbreak`, `welcome`, `news` */\n kind: string;\n /** The binding that produced or declined it */\n writer: string;\n outcome: ScriptOutcome;\n /** Who was presenting, as the persona's own key. Absent means nobody was, which is an ordinary state. Stamped on every attempt including the declined ones, so a character whose model breaks are all being refused is visible rather than hidden behind the floor */\n personaKey?: string;\n label?: string;\n /** The words. Absent for an attempt that produced none */\n script?: string;\n /** How the writer chose to have the words read, `hushed` or `frantic`. Absent for an ordinary reading */\n delivery?: string;\n /** The model that said it, for a writer that used one */\n model?: string;\n /** What the line was rendered from, for a writer working from something an operator can edit */\n source?: string;\n /** Why, for anything that is not `written` */\n reason?: string;\n /** The segment this was for, while it is still known. The row outlives it */\n segmentId?: string;\n previous?: ScriptNeighbour;\n next?: ScriptNeighbour;\n /** How long the attempt took */\n durationMs?: number;\n usage?: ScriptUsage;\n /** The answer before anything read it. Only while `llm.captureWrites` is on */\n raw?: string;\n /** What the writer sent. Only while `llm.captureWrites` is on */\n prompt?: ScriptPromptMessage[];\n}\n\n/** Rehydrates every wire-encoded scalar in a ScriptAttempt into its runtime type. Mutates and returns `raw`. */\nexport function reviveScriptAttempt(raw: ScriptAttempt): ScriptAttempt {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['at'] = __dt(__o0['at'], 'ScriptAttempt.at');\n return raw;\n}\n\n/**\n * generated from [ScriptRatingInput](../../../../../apps/api/data/contracts/render/render.types.ck#L112)\n */\nexport interface ScriptRatingInput {\n rating: ScriptRating;\n}\n\n/**\n * What each presenter has written lately, and over how long\n * generated from [ScriptHistorySummary](../../../../../apps/api/data/contracts/render/render.types.ck#L149)\n */\nexport interface ScriptHistorySummary {\n /** The window actually counted, echoed so a console can label the numbers it draws */\n hours: number;\n rows: ScriptHistorySummaryRow[];\n}\n\n/**\n * The station's lexicon, oldest first\n * generated from [PronunciationList](../../../../../apps/api/data/contracts/render/render.types.ck#L173)\n */\nexport interface PronunciationList {\n pronunciations: Pronunciation[];\n}\n\n/**\n * Every sound the station holds, and the sets over it\n * generated from [PadList](../../../../../apps/api/data/contracts/render/render.types.ck#L233)\n */\nexport interface PadList {\n pads: Pad[];\n sets: PadSet[];\n}\n\nexport interface PadListInput {\n pads: PadInput[];\n sets: PadSetInput[];\n}\n\n/** Rehydrates every wire-encoded scalar in a PadList into its runtime type. Mutates and returns `raw`. */\nexport function revivePadList(raw: PadList): PadList {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['pads'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n revivePad(__a1[__i2] as never);\n }\n }\n return raw;\n}\n\n/**\n * generated from [ScriptHistoryPage](../../../../../apps/api/data/contracts/render/render.types.ck#L126)\n */\nexport interface ScriptHistoryPage {\n attempts: ScriptAttempt[];\n /** The cursor for the page after this one, absent once the history has been read to its end */\n nextBefore?: string;\n}\n\nexport interface ScriptHistoryPageInput {\n attempts: ScriptAttemptInput[];\n /** The cursor for the page after this one, absent once the history has been read to its end */\n nextBefore?: string;\n}\n\n/** Rehydrates every wire-encoded scalar in a ScriptHistoryPage into its runtime type. Mutates and returns `raw`. */\nexport function reviveScriptHistoryPage(raw: ScriptHistoryPage): ScriptHistoryPage {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['attempts'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveScriptAttempt(__a1[__i2] as never);\n }\n }\n return raw;\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson, buildQueryString, readContentType } from '../sdk-options.js';\nimport type {\n PadFetch,\n PadList,\n PadScanResult,\n PadSetMembership,\n PadSetWrite,\n PadState,\n PronunciationList,\n PronunciationQuery,\n PronunciationStateWrite,\n PronunciationWrite,\n ScriptAttempt,\n ScriptHistoryPage,\n ScriptHistoryQuery,\n ScriptHistorySummary,\n ScriptHistorySummaryQuery,\n ScriptRatingInput,\n Segment,\n SegmentCreate,\n SegmentList,\n SegmentScanResult,\n SpeechPreviewRequest,\n VoiceList,\n} from './types/render.types.js';\nimport { revivePadList, reviveScriptAttempt, reviveScriptHistoryPage } from './types/render.types.js';\n\nexport class RenderClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List segments\n * @description Everything the station can play that is not a record\n */\n async listSegments(): Promise<SegmentList> {\n const result = await this.fetch(`/segments`, { method: 'GET' });\n return await parseJson<SegmentList>(result);\n }\n\n /**\n * @name Create segment\n * @description Plans something for the station to say, and starts rendering it\n */\n async createSegment(body: SegmentCreate): Promise<Segment> {\n const result = await this.fetch(`/segments`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<Segment>(result);\n }\n\n /**\n * @name Upload segment\n * @description Takes a recording in from the browser and puts it in the library, ready to air\n */\n async uploadSegment(body: FormData): Promise<Segment> {\n const result = await this.fetch(`/segments/upload`, {\n method: 'POST',\n body: body,\n });\n return await parseJson<Segment>(result);\n }\n\n /**\n * @name Scan the segment inbox\n * @description Takes whatever audio is sitting in the inbox directory into the library. Safe to repeat: a segment is identified by its audio, so the same recording arriving twice is one segment\n */\n async scanTheSegmentInbox(): Promise<SegmentScanResult> {\n const result = await this.fetch(`/segments/scan`, { method: 'POST' });\n return await parseJson<SegmentScanResult>(result);\n }\n\n /**\n * @name Read script history\n * @description What the station has written lately, newest first, one page at a time\n */\n async readScriptHistory(query?: ScriptHistoryQuery): Promise<ScriptHistoryPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/scripts${qs}`, {\n method: 'GET',\n });\n return reviveScriptHistoryPage(await parseJson<ScriptHistoryPage>(result));\n }\n\n /**\n * @name Rate script\n * @description What the operator thought of this attempt. Nothing acts on it automatically\n */\n async rateScript(id: string, body: ScriptRatingInput): Promise<ScriptAttempt> {\n const result = await this.fetch(`/scripts/${encodeURIComponent(id)}/rating`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return reviveScriptAttempt(await parseJson<ScriptAttempt>(result));\n }\n\n /**\n * @name Read script summary\n * @description Write attempts by outcome, per presenter, over a recent window\n */\n async readScriptSummary(query?: ScriptHistorySummaryQuery): Promise<ScriptHistorySummary> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/scripts/summary${qs}`, {\n method: 'GET',\n });\n return await parseJson<ScriptHistorySummary>(result);\n }\n\n /**\n * @name List voices\n * @description The voices the station can be asked to speak in\n */\n async listVoices(): Promise<VoiceList> {\n const result = await this.fetch(`/voices`, { method: 'GET' });\n return await parseJson<VoiceList>(result);\n }\n\n /**\n * @name Get default voice sample\n * @description A short line spoken in whichever voice the plugin falls back to\n */\n async getDefaultVoiceSample(): Promise<\n | {\n status: 200;\n contentType: 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4';\n data: Blob;\n headers: { cacheControl?: string; etag?: string };\n }\n | { status: 304 }\n > {\n const result = await this.fetch(`/voices/sample`, {\n method: 'GET',\n expectStatuses: [304],\n });\n switch (result.status) {\n case 304:\n return { status: 304 };\n default:\n return {\n status: 200,\n contentType: readContentType(result) as 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4',\n data: await result.blob(),\n headers: { cacheControl: result.headers.get('cache-control') ?? undefined, etag: result.headers.get('etag') ?? undefined },\n };\n }\n }\n\n /**\n * @name Get voice sample\n * @description A short line spoken in one voice, so an operator can hear it before choosing it\n */\n async getVoiceSample(voiceId: string): Promise<\n | {\n status: 200;\n contentType: 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4';\n data: Blob;\n headers: { cacheControl?: string; etag?: string };\n }\n | { status: 304 }\n > {\n const result = await this.fetch(`/voices/${encodeURIComponent(voiceId)}/sample`, {\n method: 'GET',\n expectStatuses: [304],\n });\n switch (result.status) {\n case 304:\n return { status: 304 };\n default:\n return {\n status: 200,\n contentType: readContentType(result) as 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4',\n data: await result.blob(),\n headers: { cacheControl: result.headers.get('cache-control') ?? undefined, etag: result.headers.get('etag') ?? undefined },\n };\n }\n }\n\n /**\n * @name Preview speech\n * @description Speaks the caller's words in one voice, so a break can be heard before it is written for air\n */\n async previewSpeech(\n body: SpeechPreviewRequest,\n ): Promise<{ contentType: 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4'; data: Blob }> {\n const result = await this.fetch(`/voices/preview`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return {\n contentType: readContentType(result) as 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4',\n data: await result.blob(),\n };\n }\n\n /**\n * @name Delete segment\n * @description Removes a recording and the inbox file behind it, so the next scan does not read it back in\n */\n async deleteSegment(id: string): Promise<SegmentList> {\n const result = await this.fetch(`/segments/${encodeURIComponent(id)}`, { method: 'DELETE' });\n return await parseJson<SegmentList>(result);\n }\n\n /**\n * @name Get segment audio\n * @description The audio of one segment\n */\n async getSegmentAudio(id: string): Promise<\n | {\n status: 200;\n contentType: 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4';\n data: Blob;\n headers: { cacheControl?: string; etag?: string };\n }\n | { status: 304 }\n > {\n const result = await this.fetch(`/segments/${encodeURIComponent(id)}/audio`, {\n method: 'GET',\n expectStatuses: [304],\n });\n switch (result.status) {\n case 304:\n return { status: 304 };\n default:\n return {\n status: 200,\n contentType: readContentType(result) as 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4',\n data: await result.blob(),\n headers: { cacheControl: result.headers.get('cache-control') ?? undefined, etag: result.headers.get('etag') ?? undefined },\n };\n }\n }\n\n /**\n * @name Get stored audio\n * @description Audio out of the segment store, addressed by content rather than by row\n */\n async getStoredAudio(\n checksum: string,\n ext: string,\n ): Promise<\n | {\n status: 200;\n contentType: 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4';\n data: Blob;\n headers: { cacheControl?: string; etag?: string };\n }\n | { status: 304 }\n > {\n const result = await this.fetch(`/audio/${encodeURIComponent(checksum)}/${encodeURIComponent(ext)}`, {\n method: 'GET',\n expectStatuses: [304],\n });\n switch (result.status) {\n case 304:\n return { status: 304 };\n default:\n return {\n status: 200,\n contentType: readContentType(result) as 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4',\n data: await result.blob(),\n headers: { cacheControl: result.headers.get('cache-control') ?? undefined, etag: result.headers.get('etag') ?? undefined },\n };\n }\n }\n\n /**\n * @name List pronunciations\n * @description The station's lexicon: what it says, what has been proposed to it, and what it has turned down\n */\n async listPronunciations(query?: PronunciationQuery): Promise<PronunciationList> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/pronunciations${qs}`, {\n method: 'GET',\n });\n return await parseJson<PronunciationList>(result);\n }\n\n /**\n * @name Create pronunciation\n * @description Adds one the operator typed. It is said from the next render on\n */\n async createPronunciation(body: PronunciationWrite): Promise<PronunciationList> {\n const result = await this.fetch(`/pronunciations`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PronunciationList>(result);\n }\n\n /**\n * @name Update pronunciation\n * @description Rewrites one entry's words, whoever proposed it\n */\n async updatePronunciation(id: string, body: PronunciationWrite): Promise<PronunciationList> {\n const result = await this.fetch(`/pronunciations/${encodeURIComponent(id)}`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PronunciationList>(result);\n }\n\n /**\n * @name Delete pronunciation\n * @description Removes an entry outright. Turning a PROPOSAL down is a state rather than a deletion, because a deleted one comes back on the next pass\n */\n async deletePronunciation(id: string): Promise<PronunciationList> {\n const result = await this.fetch(`/pronunciations/${encodeURIComponent(id)}`, { method: 'DELETE' });\n return await parseJson<PronunciationList>(result);\n }\n\n /**\n * @name Set pronunciation state\n * @description Accepts a proposal, turns one down, or takes an entry out of use without losing what it said\n */\n async setPronunciationState(id: string, body: PronunciationStateWrite): Promise<PronunciationList> {\n const result = await this.fetch(`/pronunciations/${encodeURIComponent(id)}/state`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<PronunciationList>(result);\n }\n\n /**\n * @name List pads\n * @description Every sound the station holds, board by board\n */\n async listPads(): Promise<PadList> {\n const result = await this.fetch(`/pads`, { method: 'GET' });\n return revivePadList(await parseJson<PadList>(result));\n }\n\n /**\n * @name Upload pad\n * @description Takes a sound in from the browser and puts it on a board. The file lands in the pad library on disk, so it survives a rebuild and an archive carries it\n */\n async uploadPad(body: FormData): Promise<PadList> {\n const result = await this.fetch(`/pads`, {\n method: 'POST',\n body: body,\n });\n return revivePadList(await parseJson<PadList>(result));\n }\n\n /**\n * @name Scan the pad library\n * @description Takes whatever audio is sitting in the pad library directory onto its board. Safe to repeat: a file nobody has touched is seen and left alone\n */\n async scanThePadLibrary(): Promise<PadScanResult> {\n const result = await this.fetch(`/pads/scan`, { method: 'POST' });\n return await parseJson<PadScanResult>(result);\n }\n\n /**\n * @name Fetch pad\n * @description Fetches a sound from an address and puts it on a board. The operator names the address, so this is them choosing a file exactly as dropping one in the library is\n */\n async fetchPad(body: PadFetch): Promise<PadList> {\n const result = await this.fetch(`/pads/fetch`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return revivePadList(await parseJson<PadList>(result));\n }\n\n /**\n * @name Delete pad\n * @description Removes a sound the console put there, and the file it wrote for it\n */\n async deletePad(id: string): Promise<PadList> {\n const result = await this.fetch(`/pads/${encodeURIComponent(id)}`, { method: 'DELETE' });\n return revivePadList(await parseJson<PadList>(result));\n }\n\n /**\n * @name Set pad state\n * @description Turns a sound down, or puts one back. Answers the whole rack, since one pad changing state is one row moving between two sections of the same page\n */\n async setPadState(id: string, body: PadState): Promise<PadList> {\n const result = await this.fetch(`/pads/${encodeURIComponent(id)}/state`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return revivePadList(await parseJson<PadList>(result));\n }\n\n /**\n * @name Get pad audio\n * @description The sound itself, so an operator can hear what they dropped in\n */\n async getPadAudio(id: string): Promise<\n | {\n status: 200;\n contentType: 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4';\n data: Blob;\n headers: { cacheControl?: string; etag?: string };\n }\n | { status: 304 }\n > {\n const result = await this.fetch(`/pads/${encodeURIComponent(id)}/audio`, {\n method: 'GET',\n expectStatuses: [304],\n });\n switch (result.status) {\n case 304:\n return { status: 304 };\n default:\n return {\n status: 200,\n contentType: readContentType(result) as 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4',\n data: await result.blob(),\n headers: { cacheControl: result.headers.get('cache-control') ?? undefined, etag: result.headers.get('etag') ?? undefined },\n };\n }\n }\n\n /**\n * @name Create pad set\n * @description Names a new set, or answers the one already under that key\n */\n async createPadSet(body: PadSetWrite): Promise<PadList> {\n const result = await this.fetch(`/pads/sets`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return revivePadList(await parseJson<PadList>(result));\n }\n\n /**\n * @name Update pad set\n * @description Renames a set. The KEY moves with it, so every persona naming the old one stops finding it\n */\n async updatePadSet(id: string, body: PadSetWrite): Promise<PadList> {\n const result = await this.fetch(`/pads/sets/${encodeURIComponent(id)}`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return revivePadList(await parseJson<PadList>(result));\n }\n\n /**\n * @name Delete pad set\n * @description Removes a set and its memberships, and no pads at all\n */\n async deletePadSet(id: string): Promise<PadList> {\n const result = await this.fetch(`/pads/sets/${encodeURIComponent(id)}`, { method: 'DELETE' });\n return revivePadList(await parseJson<PadList>(result));\n }\n\n /**\n * @name Set pad membership\n * @description Puts a pad on a set or takes it off. Refused where the set already answers to that name, because a script writes a name\n */\n async setPadMembership(id: string, body: PadSetMembership): Promise<PadList> {\n const result = await this.fetch(`/pads/sets/${encodeURIComponent(id)}/pads`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return revivePadList(await parseJson<PadList>(result));\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson, buildQueryString } from '../sdk-options.js';\nimport type { ScheduleNow, ScheduleSlotInput, ScheduleSlotList, ScheduleTimetable, ScheduleTimetableQuery } from './types/schedule.types.js';\n\nexport class ScheduleClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List schedule\n * @description Every slot in this station's schedule, earliest in the day first\n */\n async listSchedule(): Promise<ScheduleSlotList> {\n const result = await this.fetch(`/schedule`, { method: 'GET' });\n return await parseJson<ScheduleSlotList>(result);\n }\n\n /**\n * @name Create schedule slot\n * @description Adds a slot. The station does not change over until its start time comes round\n */\n async createScheduleSlot(body: ScheduleSlotInput): Promise<ScheduleSlotList> {\n const result = await this.fetch(`/schedule`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<ScheduleSlotList>(result);\n }\n\n /**\n * @name Read current slot\n * @description Which slot the clock says should be on, and which one the station is actually airing\n */\n async readCurrentSlot(): Promise<ScheduleNow> {\n const result = await this.fetch(`/schedule/current`, { method: 'GET' });\n return await parseJson<ScheduleNow>(result);\n }\n\n /**\n * @name Read timetable\n * @description The station's day as blocks, contiguous and gapless, for drawing\n */\n async readTimetable(query?: ScheduleTimetableQuery): Promise<ScheduleTimetable> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/schedule/timetable${qs}`, {\n method: 'GET',\n });\n return await parseJson<ScheduleTimetable>(result);\n }\n\n /**\n * @name Update schedule slot\n * @description Rewrites a slot. Takes effect at its next boundary rather than immediately\n */\n async updateScheduleSlot(id: string, body: ScheduleSlotInput): Promise<ScheduleSlotList> {\n const result = await this.fetch(`/schedule/${encodeURIComponent(id)}`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<ScheduleSlotList>(result);\n }\n\n /**\n * @name Delete schedule slot\n * @description Removes a slot. Whatever is on air stays on until the next slot begins\n */\n async deleteScheduleSlot(id: string): Promise<ScheduleSlotList> {\n const result = await this.fetch(`/schedule/${encodeURIComponent(id)}`, { method: 'DELETE' });\n return await parseJson<ScheduleSlotList>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\nimport type { StationSettings, StationSettingsInput } from './types/settings.types.js';\n\nexport class SettingsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name Get settings\n * @description Every station setting, its descriptor and its current value\n */\n async getSettings(): Promise<StationSettings> {\n const result = await this.fetch(`/settings`, { method: 'GET' });\n return await parseJson<StationSettings>(result);\n }\n\n /**\n * @name Update settings\n * @description Applies a submitted settings form and answers with the settings as they now stand\n */\n async updateSettings(body: StationSettingsInput): Promise<StationSettings> {\n const result = await this.fetch(`/settings`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<StationSettings>(result);\n }\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * Five values, where `PluginLogLevel` next door has four. The plugin enum is the narrower one on\n * purpose — that is the vocabulary a plugin's own `PluginLogger` offers — while `api.log` is written\n * by `DeadairLogger`, which tees every level the app-wide `Logger` has, `trace` included. Narrowing\n * here would make a `trace` line unrepresentable in the type of the surface that reads the file it\n * is in.\n * generated from [LogLevel](../../../../../apps/api/data/contracts/station/logs.types.ck#L12)\n */\nexport type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error';\n\n/**\n * One log file this install has, whether or not anything has been written to it\n * generated from [LogSource](../../../../../apps/api/data/contracts/station/logs.types.ck#L14)\n */\nexport interface LogSource {\n /** A closed set the API owns: `api`, `liquidsoap`, `shim`. Never a path */\n id: string;\n label: string;\n /** What writes it, in a sentence, because \"shim\" means nothing to somebody who has not read the tree */\n description: string;\n /** Whether the file is there at all. A station that never ran the stream has no stream logs, which is a state rather than a fault */\n present: boolean;\n /** Whether its lines carry a level, so the console knows whether to offer the filter */\n levels: boolean;\n /** Retained size across every segment. Zero when absent */\n bytes: number;\n /** Absent when nothing has ever been written */\n lastWriteAt?: DateTime;\n}\n\n/** Rehydrates every wire-encoded scalar in a LogSource into its runtime type. Mutates and returns `raw`. */\nexport function reviveLogSource(raw: LogSource): LogSource {\n const __o0 = raw as unknown as Record<string, unknown>;\n if (__o0['lastWriteAt'] != null) {\n __o0['lastWriteAt'] = __dt(__o0['lastWriteAt'], 'LogSource.lastWriteAt');\n }\n return raw;\n}\n\n/**\n * One line, as far as it could be read back\n * generated from [LogLine](../../../../../apps/api/data/contracts/station/logs.types.ck#L28)\n */\nexport interface LogLine {\n /** Absent on a line this API did not write, and on one of its own that did not parse */\n ts?: string;\n /** Absent for the same two reasons */\n level?: LogLevel;\n /** Must match MAX_LINE_BYTES_CEILING in apps/api/src/logging/rotating.log.store.ts. Change both together */\n text: string;\n}\n\n/**\n * generated from [LogQuery](../../../../../apps/api/data/contracts/station/logs.types.ck#L41)\n */\nexport interface LogQuery {\n limit?: number;\n /** Ignored by a source whose lines carry no level */\n level?: LogLevel;\n}\n\n/**\n * generated from [LogSourceList](../../../../../apps/api/data/contracts/station/logs.types.ck#L24)\n */\nexport interface LogSourceList {\n /** Every source, in a fixed order, including the ones that are not present */\n sources: LogSource[];\n}\n\n/** Rehydrates every wire-encoded scalar in a LogSourceList into its runtime type. Mutates and returns `raw`. */\nexport function reviveLogSourceList(raw: LogSourceList): LogSourceList {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['sources'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveLogSource(__a1[__i2] as never);\n }\n }\n return raw;\n}\n\n/**\n * generated from [LogPage](../../../../../apps/api/data/contracts/station/logs.types.ck#L34)\n */\nexport interface LogPage {\n sourceId: string;\n /** The minimum severity that was applied. Absent when the source carries no levels, so a filter that did nothing cannot look as though it worked */\n level?: LogLevel;\n /** Whether the read hit its byte budget, so the oldest line here is not the file's first */\n truncated: boolean;\n /** Newest first, as the plugin log page, the activity feed and the script history all send */\n lines: LogLine[];\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * One concrete thing an attention row is about, so the reason does not live a page away.\n *\n * The row above it counts and categorises; this names. \"4 records have no copy left that will play\"\n * is a category an operator can do nothing with until they know WHICH four and WHY each one, and\n * every one of those facts was already stored — the fetch error on `track_audio.last_error`, the\n * provider's refusal on `track_sources.playable` — and reachable only by finding the record and\n * hovering a cell on its page. This is that fact travelling with the row that counted it.\n * generated from [AttentionEvidence](../../../../../apps/api/data/contracts/station/station.types.ck#L14)\n */\nexport interface AttentionEvidence {\n /** The thing itself, as an operator would name it: a record's title and who made it */\n label: string;\n /** Why THIS one, in the station's own sentence. The row's `detail` says what the category means; this says what happened here */\n reason: string;\n /** The page holding the whole of it. Absent where there is no page for it, which the running order can hold: a record the catalog never ingested has none */\n route?: string;\n}\n\n/**\n * One loop the station runs, and when it last came round.\n *\n * Two timestamps and no verdict, because the loop cannot supply one: a five-second reconcile and a\n * nightly sweep are both healthy and no single threshold describes both. `Heartbeat` itself takes\n * this position — it answers how long it has been and lets the reader decide — and a `stalled`\n * boolean here would be this module inventing the threshold that file deliberately refuses to.\n *\n * `lastBeat` is absent until a loop finishes its first pass, which is why `startedAt` is there: from\n * the two of them a reader can tell a loop that has never completed anything from one that stopped.\n * generated from [StationHeartbeat](../../../../../apps/api/data/contracts/station/station.types.ck#L45)\n */\nexport interface StationHeartbeat {\n name: string;\n /** When the loop registered, which is when it was last (re)started */\n startedAt: DateTime;\n /** When it last completed a pass. Absent until it completes its first */\n lastBeat?: DateTime;\n}\n\nexport interface StationHeartbeatInput {}\n\n/** Rehydrates every wire-encoded scalar in a StationHeartbeat into its runtime type. Mutates and returns `raw`. */\nexport function reviveStationHeartbeat(raw: StationHeartbeat): StationHeartbeat {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['startedAt'] = __dt(__o0['startedAt'], 'StationHeartbeat.startedAt');\n if (__o0['lastBeat'] != null) {\n __o0['lastBeat'] = __dt(__o0['lastBeat'], 'StationHeartbeat.lastBeat');\n }\n return raw;\n}\n\n/**\n * How much of the library the station has actually looked at.\n *\n * The counts `/catalog/tracks` already answers with, lifted out of a page of rows: a check-up wants\n * the sentence \"13 of 581 measured\" without asking for thirteen tracks to get it.\n * generated from [StationBacklog](../../../../../apps/api/data/contracts/station/station.types.ck#L55)\n */\nexport interface StationBacklog {\n total: number;\n cached: number;\n measured: number;\n}\n\nexport interface StationBacklogInput {}\n\n/**\n * One thing that wants the operator's attention, or the fact that nothing does\n * generated from [AttentionItem](../../../../../apps/api/data/contracts/station/station.types.ck#L21)\n */\nexport interface AttentionItem {\n /** What this is, as a stable key: `silence`, `benchedCopies`, `noPersona`. The console groups and counts on it rather than on the sentence */\n code: string;\n /** `failure` is the station not doing its job, `warning` is something failing beside a station that is working, and `notice` is a thing nobody has set up yet. A notice is not a fault and must not be drawn as one */\n severity: 'failure' | 'warning' | 'notice';\n /** The line an operator reads first */\n title: string;\n /** The whole of it, in a sentence. Where the station already has words for a fact, these are those words rather than a second phrasing of them */\n detail: string;\n /** The console page that can do something about it */\n route: string;\n /** How many things this is about, where that is a number rather than a state */\n count?: number;\n /** A HANDFUL of the things this row is about, never all of them: this answer is polled and a row about four hundred records must not be four hundred sentences. `count` stays the true figure, and a console showing fewer than it says so */\n evidence?: AttentionEvidence[];\n}\n\n/**\n * One reading of the machinery, for a page that assembles the station's health.\n *\n * It carries ONLY the two signals nothing else exposes. Everything else a check-up shows — the\n * silence verdict, the listener count, what needs somebody, the plugin statuses, the disk — is\n * already on a contract the console reads, and composing them again here would be a second answer\n * that can disagree with the first. `/playout/status` in particular is polled every two seconds for\n * the transport strip, so asking for it a second way would be a second reading of the same fact.\n *\n * Each section is OPTIONAL and absent means that reader failed. A page saying what is wrong is the\n * worst place for one broken reader to take the whole answer down, which is the rule\n * `StationAttentionService` already works to. `revision` is the one exception and says so on its\n * own line: it cannot fail, so absent there means something else.\n *\n * The revision is on THIS contract rather than composed from `/health`, which also reports it, and\n * that is not the second-answer problem the paragraph above describes. Both read one string from one\n * place at boot, so they cannot disagree. What they differ in is who can reach them: `/health` is\n * `operation(internal)`, deliberately, so it generates no SDK method and the console cannot call it\n * — which would leave \"which build is this\" answerable only from a shell, the one thing carrying it\n * here exists to fix.\n * generated from [StationCheckup](../../../../../apps/api/data/contracts/station/station.types.ck#L80)\n */\nexport interface StationCheckup {\n /** When this reading was taken, so a stale page cannot pass itself off as now */\n readAt: DateTime;\n /** The commit this station was built from, as the image's `org.opencontainers.image.revision` label says it. Unlike the sections below, absent is not a failed reader: it means nothing stamped this build, which is what a development tree and a hand-built image both are */\n revision?: string;\n /** The release this station is, as the image's `org.opencontainers.image.version` label says it. Absent on the same terms as `revision` and for a second reason: only a tagged build carries one, so a station following `latest` reports a commit and no version */\n version?: string;\n heartbeats?: StationHeartbeat[];\n backlog?: StationBacklog;\n}\n\nexport interface StationCheckupInput {}\n\n/** Rehydrates every wire-encoded scalar in a StationCheckup into its runtime type. Mutates and returns `raw`. */\nexport function reviveStationCheckup(raw: StationCheckup): StationCheckup {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['readAt'] = __dt(__o0['readAt'], 'StationCheckup.readAt');\n if (__o0['heartbeats'] != null) {\n {\n const __a1 = __o0['heartbeats'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveStationHeartbeat(__a1[__i2] as never);\n }\n }\n }\n return raw;\n}\n\n/**\n * Everything wrong or waiting, worst first\n * generated from [StationAttention](../../../../../apps/api/data/contracts/station/station.types.ck#L32)\n */\nexport interface StationAttention {\n items: AttentionItem[];\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * Whether a call produced what it was asked for. Two values on purpose: every finer distinction —\n * timed out, was preempted, came back empty — is a fact the caller knew and the recorder did not, so\n * it lives in `detail` where it can be named\n * generated from [TraceOutcome](../../../../../apps/api/data/contracts/station/traces.types.ck#L10)\n */\nexport type TraceOutcome = 'ok' | 'failed';\n\n/**\n * One decision, folded: a job execution or a request\n * generated from [TraceDecision](../../../../../apps/api/data/contracts/station/traces.types.ck#L22)\n */\nexport interface TraceDecision {\n /** The job id or the request id. Already the station's correlation id, never generated for this */\n id: string;\n /** A queue name, or a method and path */\n kind: string;\n /** The decision that enqueued this one. Absent on a request, a cron job and anything at boot */\n parent?: string;\n /** When its first recorded call ended */\n at: DateTime;\n /** Wall clock, off the `job.run` span. Zero for a decision recorded before that span existed */\n ms: number;\n /** Everything it did, not counting the `job.run` that contains them */\n calls: number;\n /** How many of those did not produce what they were asked for */\n failed: number;\n}\n\n/** Rehydrates every wire-encoded scalar in a TraceDecision into its runtime type. Mutates and returns `raw`. */\nexport function reviveTraceDecision(raw: TraceDecision): TraceDecision {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['at'] = __dt(__o0['at'], 'TraceDecision.at');\n return raw;\n}\n\n/**\n * Which slice of the kept window to read\n * generated from [TracesQuery](../../../../../apps/api/data/contracts/station/traces.types.ck#L32)\n */\nexport interface TracesQuery {\n limit?: number;\n /** An exact queue name or route, for reading one kind of decision on its own */\n kind?: string;\n /** Only decisions carrying at least one failed call */\n failedOnly?: boolean;\n}\n\n/**\n * One call inside a decision, and what it cost\n * generated from [TraceSpan](../../../../../apps/api/data/contracts/station/traces.types.ck#L12)\n */\nexport interface TraceSpan {\n /** When the call ended, which is when its cost was known */\n at: DateTime;\n /** Dotted and stable: `job.run`, `plugin.invoke`, `llm.generate` */\n op: string;\n /** Which one: a plugin and its method, or a model */\n target?: string;\n /** How long it held, measured around the call rather than reported by it */\n ms: number;\n outcome: TraceOutcome;\n /** The failure, summarized to a shape rather than a stack */\n error?: string;\n /** Whatever this `op` is worth reading back: tokens, a finish reason, the bound it was given */\n detail?: Record<string, unknown>;\n}\n\n/** Rehydrates every wire-encoded scalar in a TraceSpan into its runtime type. Mutates and returns `raw`. */\nexport function reviveTraceSpan(raw: TraceSpan): TraceSpan {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['at'] = __dt(__o0['at'], 'TraceSpan.at');\n return raw;\n}\n\n/**\n * generated from [TracesPage](../../../../../apps/api/data/contracts/station/traces.types.ck#L38)\n */\nexport interface TracesPage {\n /** Newest first */\n decisions: TraceDecision[];\n /** How many the window holds before `limit`, so a page can say it is showing a slice */\n total: number;\n /** How many calls were read to answer, which is the honest cost of this page */\n spans: number;\n}\n\n/** Rehydrates every wire-encoded scalar in a TracesPage into its runtime type. Mutates and returns `raw`. */\nexport function reviveTracesPage(raw: TracesPage): TracesPage {\n const __o0 = raw as unknown as Record<string, unknown>;\n {\n const __a1 = __o0['decisions'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveTraceDecision(__a1[__i2] as never);\n }\n }\n return raw;\n}\n\n/**\n * One decision, its calls, and the decisions on either side of it\n * generated from [TraceDetail](../../../../../apps/api/data/contracts/station/traces.types.ck#L44)\n */\nexport interface TraceDetail {\n decision: TraceDecision;\n /** In the order they happened */\n spans: TraceSpan[];\n /** What enqueued this, when that decision is still inside the kept window */\n parent?: TraceDecision;\n /** What this one went on to enqueue */\n caused: TraceDecision[];\n}\n\n/** Rehydrates every wire-encoded scalar in a TraceDetail into its runtime type. Mutates and returns `raw`. */\nexport function reviveTraceDetail(raw: TraceDetail): TraceDetail {\n const __o0 = raw as unknown as Record<string, unknown>;\n reviveTraceDecision(__o0['decision'] as never);\n {\n const __a1 = __o0['spans'] as unknown[];\n for (let __i2 = 0; __i2 < __a1.length; __i2++) {\n reviveTraceSpan(__a1[__i2] as never);\n }\n }\n if (__o0['parent'] != null) {\n reviveTraceDecision(__o0['parent'] as never);\n }\n {\n const __a3 = __o0['caused'] as unknown[];\n for (let __i4 = 0; __i4 < __a3.length; __i4++) {\n reviveTraceDecision(__a3[__i4] as never);\n }\n }\n return raw;\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson, buildQueryString } from '../sdk-options.js';\nimport type { LogPage, LogQuery, LogSourceList } from './types/logs.types.js';\nimport { reviveLogSourceList } from './types/logs.types.js';\nimport type { StationAttention, StationCheckup } from './types/station.types.js';\nimport { reviveStationCheckup } from './types/station.types.js';\nimport type { TraceDetail, TracesPage, TracesQuery } from './types/traces.types.js';\nimport { reviveTraceDetail, reviveTracesPage } from './types/traces.types.js';\n\nexport class StationClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List logs\n * @description Every log this install has, present or not, with its size and when it was last written\n */\n async listLogs(): Promise<LogSourceList> {\n const result = await this.fetch(`/logs`, { method: 'GET' });\n return reviveLogSourceList(await parseJson<LogSourceList>(result));\n }\n\n /**\n * @name Read log\n * @description A tail of one log, newest first\n */\n async readLog(id: string, query?: LogQuery): Promise<LogPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/logs/${encodeURIComponent(id)}${qs}`, {\n method: 'GET',\n });\n return await parseJson<LogPage>(result);\n }\n\n /**\n * @name Download log\n * @description The retained log as a plain-text attachment, oldest first, as the file is written\n */\n async downloadLog(id: string): Promise<{ data: string; headers: { contentDisposition?: string } }> {\n const result = await this.fetch(`/logs/${encodeURIComponent(id)}/download`, { method: 'GET' });\n const data = await result.text();\n return { data, headers: { contentDisposition: result.headers.get('Content-Disposition') ?? undefined } };\n }\n\n /**\n * @name Read station attention\n * @description Everything wrong or waiting, worst first, each with the console page that can act on it\n */\n async readStationAttention(): Promise<StationAttention> {\n const result = await this.fetch(`/station/attention`, { method: 'GET' });\n return await parseJson<StationAttention>(result);\n }\n\n /**\n * @name Read station checkup\n * @description The loops the station runs and how much of the library it has looked at\n */\n async readStationCheckup(): Promise<StationCheckup> {\n const result = await this.fetch(`/station/checkup`, { method: 'GET' });\n return reviveStationCheckup(await parseJson<StationCheckup>(result));\n }\n\n /**\n * @name Read traces\n * @description Recent decisions, newest first, folded to one row each\n */\n async readTraces(query?: TracesQuery): Promise<TracesPage> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/traces${qs}`, {\n method: 'GET',\n });\n return reviveTracesPage(await parseJson<TracesPage>(result));\n }\n\n /**\n * @name Read trace\n * @description One decision: every call it made, and the decisions on either side of it\n */\n async readTrace(id: string): Promise<TraceDetail> {\n const result = await this.fetch(`/traces/${encodeURIComponent(id)}`, { method: 'GET' });\n return reviveTraceDetail(await parseJson<TraceDetail>(result));\n }\n}\n","import { Decimal } from 'decimal.js';\nimport { DateTime } from 'luxon';\n\nDecimal.set({ toExpNeg: -9e15, toExpPos: 9e15 });\nconst __dt = (v: unknown, path: string): DateTime => {\n if (typeof v !== 'string') {\n throw new TypeError(`ContractKit: expected an ISO 8601 string at '${path}', received ${typeof v}.`);\n }\n const d = DateTime.fromISO(v);\n if (!d.isValid) throw new TypeError(`ContractKit: '${v}' at '${path}' is not a valid ISO 8601 datetime.`);\n return d;\n};\n\n/**\n * Which store, as a stable id the console can key off rather than a name it renders.\n * generated from [StorageStoreId](../../../../../apps/api/data/contracts/storage/storage.types.ck#L8)\n */\nexport type StorageStoreId = 'tracks' | 'art' | 'segments' | 'voices';\n\n/**\n * One content store: what is on disk, and what the database says should be.\n *\n * The two halves are deliberately separate numbers rather than one reconciled figure. They disagree\n * in two directions and each direction means something different — a file nothing claims is what a\n * crash between writing bytes and writing a row leaves behind, and a row whose file is gone is what\n * an operator emptying a directory leaves. Reporting one number would hide both.\n * generated from [StorageStore](../../../../../apps/api/data/contracts/storage/storage.types.ck#L16)\n */\nexport interface StorageStore {\n id: StorageStoreId;\n /** What to call it on a page */\n label: string;\n /** Where it is, so `du` and this can be compared */\n path: string;\n /** Files actually there */\n files: number;\n /** What they weigh */\n bytes: number;\n /** Rows pointing at a file. Absent when no table backs this store */\n rows?: number;\n /** What those rows say those files weigh. Absent where the table does not record a size */\n accountedBytes?: number;\n /** The limit an operator set, where the store has one. Absent means no limit */\n capBytes?: number;\n /** Files no row claims. Reported and never cleaned up automatically */\n orphanFiles: number;\n orphanBytes: number;\n /** Claims whose file is not there. The station re-fetches or re-renders these */\n rowsWithNoFile: number;\n}\n\nexport interface StorageStoreInput {}\n\n/**\n * Every store, plus the number an operator actually wants first.\n *\n * `readAt` is not decoration: the figures come from walking directories, which is real I/O on a\n * station holding tens of thousands of files, so the answer is cached for a short while and this is\n * what stops a page mistaking it for live.\n * generated from [StorageReport](../../../../../apps/api/data/contracts/storage/storage.types.ck#L35)\n */\nexport interface StorageReport {\n readAt: DateTime;\n totalFiles: number;\n totalBytes: number;\n stores: StorageStore[];\n}\n\nexport interface StorageReportInput {\n stores: StorageStoreInput[];\n}\n\n/** Rehydrates every wire-encoded scalar in a StorageReport into its runtime type. Mutates and returns `raw`. */\nexport function reviveStorageReport(raw: StorageReport): StorageReport {\n const __o0 = raw as unknown as Record<string, unknown>;\n __o0['readAt'] = __dt(__o0['readAt'], 'StorageReport.readAt');\n return raw;\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { parseJson } from '../sdk-options.js';\nimport type { StorageReport } from './types/storage.types.js';\nimport { reviveStorageReport } from './types/storage.types.js';\n\nexport class StorageClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name Read storage\n * @description What is on disk, per store, against what the database says should be\n */\n async readStorage(): Promise<StorageReport> {\n const result = await this.fetch(`/storage`, { method: 'GET' });\n return reviveStorageReport(await parseJson<StorageReport>(result));\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson } from '../sdk-options.js';\nimport type {\n FetcherAuthorization,\n FetcherAuthorizationFinished,\n FetcherAuthorizationInput,\n FetcherAuthorizationStart,\n} from './types/stream.types.js';\n\nexport class StreamClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name Get HLS playlist\n * @description One HLS playlist, and the tick that says somebody is still listening to it\n */\n async getHLSPlaylist(name: string): Promise<{ data: Blob; headers: { cacheControl?: string } }> {\n const result = await this.fetch(`/hls/${encodeURIComponent(name)}`, { method: 'GET' });\n const data = await result.blob();\n return { data, headers: { cacheControl: result.headers.get('cache-control') ?? undefined } };\n }\n\n /**\n * @name Read fetcher authorization\n * @description What the track fetcher holds by way of a Spotify login, and whether an authorization is already waiting to be finished\n */\n async readFetcherAuthorization(): Promise<FetcherAuthorization> {\n const result = await this.fetch(`/stream/authorization`, { method: 'GET' });\n return await parseJson<FetcherAuthorization>(result);\n }\n\n /**\n * @name Start fetcher authorization\n * @description Starts the fetcher's one-time authorization and answers with the URL to open. Starting another replaces whichever was pending\n */\n async startFetcherAuthorization(): Promise<FetcherAuthorizationStart> {\n const result = await this.fetch(`/stream/authorization`, { method: 'POST' });\n return await parseJson<FetcherAuthorizationStart>(result);\n }\n\n /**\n * @name Finish fetcher authorization\n * @description Finishes an authorization from the address the operator's browser ended up at\n */\n async finishFetcherAuthorization(body: FetcherAuthorizationInput): Promise<FetcherAuthorizationFinished> {\n const result = await this.fetch(`/stream/authorization/complete`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<FetcherAuthorizationFinished>(result);\n }\n}\n","import type { SdkFetch } from '../sdk-options.js';\nimport { bigIntReplacer, parseJson, buildQueryString } from '../sdk-options.js';\nimport type { TopicInput, TopicKindList, TopicList, TopicQuery } from './types/topics.types.js';\n\nexport class TopicsClient {\n constructor(private fetch: SdkFetch) {}\n\n /**\n * @name List topics\n * @description Every subject this station has named, for one sort of break or for all of them\n */\n async listTopics(query?: TopicQuery): Promise<TopicList> {\n const qs = buildQueryString(query);\n const result = await this.fetch(`/topics${qs}`, {\n method: 'GET',\n });\n return await parseJson<TopicList>(result);\n }\n\n /**\n * @name Create topic\n * @description Names a new subject. Nothing uses it until something points at it\n */\n async createTopic(body: TopicInput): Promise<TopicList> {\n const result = await this.fetch(`/topics`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<TopicList>(result);\n }\n\n /**\n * @name List topic kinds\n * @description Which sorts of break have subjects, and the form each one's settings are edited with\n */\n async listTopicKinds(): Promise<TopicKindList> {\n const result = await this.fetch(`/topics/kinds`, { method: 'GET' });\n return await parseJson<TopicKindList>(result);\n }\n\n /**\n * @name Update topic\n * @description Rewrites one subject. A break already written keeps the words it was given\n */\n async updateTopic(id: string, body: TopicInput): Promise<TopicList> {\n const result = await this.fetch(`/topics/${encodeURIComponent(id)}`, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body, bigIntReplacer),\n });\n return await parseJson<TopicList>(result);\n }\n\n /**\n * @name Delete topic\n * @description Removes a subject, and any band on the format clock that asked for it\n */\n async deleteTopic(id: string): Promise<TopicList> {\n const result = await this.fetch(`/topics/${encodeURIComponent(id)}`, { method: 'DELETE' });\n return await parseJson<TopicList>(result);\n }\n}\n","import type { SdkOptions } from './sdk-options.js';\nimport { createSdkFetch } from './sdk-options.js';\nimport { ActivityClient } from './activity/activity.client.js';\nimport { ArtClient } from './art/art.client.js';\nimport { AuthenticationClient } from './authentication/authentication.client.js';\nimport { CatalogClient } from './catalog/catalog.client.js';\nimport { ChartsClient } from './charts/charts.client.js';\nimport { DirectorClient } from './director/director.client.js';\nimport { HistoryClient } from './history/history.client.js';\nimport { NarrationsClient } from './narrations/narrations.client.js';\nimport { NewsClient } from './news/news.client.js';\nimport { NowplayingClient } from './nowplaying/nowplaying.client.js';\nimport { OnboardingClient } from './onboarding/onboarding.client.js';\nimport { PersonasClient } from './personas/personas.client.js';\nimport { PlaylistsClient } from './playlists/playlists.client.js';\nimport { PlayoutClient } from './playout/playout.client.js';\nimport { PluginsClient } from './plugins/plugins.client.js';\nimport { PodcastsClient } from './podcasts/podcasts.client.js';\nimport { ProductionsClient } from './productions/productions.client.js';\nimport { RenderClient } from './render/render.client.js';\nimport { ScheduleClient } from './schedule/schedule.client.js';\nimport { SettingsClient } from './settings/settings.client.js';\nimport { StationClient } from './station/station.client.js';\nimport { StorageClient } from './storage/storage.client.js';\nimport { StreamClient } from './stream/stream.client.js';\nimport { TopicsClient } from './topics/topics.client.js';\n\nexport class DeadairSdk {\n readonly activity: ActivityClient;\n readonly art: ArtClient;\n readonly authentication: AuthenticationClient;\n readonly catalog: CatalogClient;\n readonly charts: ChartsClient;\n readonly director: DirectorClient;\n readonly history: HistoryClient;\n readonly narrations: NarrationsClient;\n readonly news: NewsClient;\n readonly nowplaying: NowplayingClient;\n readonly onboarding: OnboardingClient;\n readonly personas: PersonasClient;\n readonly playlists: PlaylistsClient;\n readonly playout: PlayoutClient;\n readonly plugins: PluginsClient;\n readonly podcasts: PodcastsClient;\n readonly productions: ProductionsClient;\n readonly render: RenderClient;\n readonly schedule: ScheduleClient;\n readonly settings: SettingsClient;\n readonly station: StationClient;\n readonly storage: StorageClient;\n readonly stream: StreamClient;\n readonly topics: TopicsClient;\n\n constructor(options: SdkOptions) {\n const sdkFetch = options.fetch ?? createSdkFetch(options);\n this.activity = new ActivityClient(sdkFetch);\n this.art = new ArtClient(sdkFetch);\n this.authentication = new AuthenticationClient(sdkFetch);\n this.catalog = new CatalogClient(sdkFetch);\n this.charts = new ChartsClient(sdkFetch);\n this.director = new DirectorClient(sdkFetch);\n this.history = new HistoryClient(sdkFetch);\n this.narrations = new NarrationsClient(sdkFetch);\n this.news = new NewsClient(sdkFetch);\n this.nowplaying = new NowplayingClient(sdkFetch);\n this.onboarding = new OnboardingClient(sdkFetch);\n this.personas = new PersonasClient(sdkFetch);\n this.playlists = new PlaylistsClient(sdkFetch);\n this.playout = new PlayoutClient(sdkFetch);\n this.plugins = new PluginsClient(sdkFetch);\n this.podcasts = new PodcastsClient(sdkFetch);\n this.productions = new ProductionsClient(sdkFetch);\n this.render = new RenderClient(sdkFetch);\n this.schedule = new ScheduleClient(sdkFetch);\n this.settings = new SettingsClient(sdkFetch);\n this.station = new StationClient(sdkFetch);\n this.storage = new StorageClient(sdkFetch);\n this.stream = new StreamClient(sdkFetch);\n this.topics = new TopicsClient(sdkFetch);\n }\n}\n"],"mappings":";;;;AAAO,IAAMA,WAAN,cAAwCC,MAAAA;EAA/C,OAA+CA;;;;;;;EAC3C,YACoBC,QACAC,YACAC,MACAC,SAClB;AACE,UAAM,GAAGH,MAAAA,IAAUC,UAAAA,EAAY,GAAA,KALfD,SAAAA,QAAAA,KACAC,aAAAA,YAAAA,KACAC,OAAAA,MAAAA,KACAC,UAAAA;AAGhB,SAAKC,OAAO;EAChB;AACJ;AAqBO,IAAMC,iBAAiB,wBAACC,GAAWC,UAAAA;AACtC,MAAI,OAAOA,UAAU,UAAU;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AAI4B,eAAed,QAAAA;AACnC,SAAKb,YAAY,IAAI4B,gBAAgBf,QAAAA;AACrC,SAAKZ,UAAU,IAAI4B,cAAchB,QAAAA;AACjC,SAAKX,UAAU,IAAI4B,cAAcjB,QAAAA;AACjC,SAAKV,WAAW,IAAI4B,eAAelB,QAAAA;AACnC,SAAKT,cAAc,IAAI4B,kBAAkBnB,QAAAA;AACzC,SAAKR,SAAS,IAAI4B,aAAapB,QAAAA;AAC/B,SAAKP,WAAW,IAAI4B,eAAerB,QAAAA;AACnC,SAAKN,WAAW,IAAI4B,eAAetB,QAAAA;AACnC,SAAKL,UAAU,IAAI4B,cAAcvB,QAAAA;AACjC,SAAKJ,UAAU,IAAI4B,cAAcxB,QAAAA;AACjC,SAAKH,SAAS,IAAI4B,aAAazB,QAAAA;AAC/B,SAAKF,SAAS,IAAI4B,aAAa1B,QAAAA;EACnC;AACJ;","names":["SdkError","Error","status","statusText","body","headers","name","bigIntReplacer","_","value","toString","bigIntReviver","test","BigInt","slice","readContentType","res","get","split","trim","randomRequestId","crypto","randomUUID","bytes","getRandomValues","Uint8Array","hex","Array","from","b","padStart","join","createSdkFetch","options","getRequestId","requestIdFactory","url","init","baseHeaders","fetch","baseUrl","ok","expectStatuses","includes","text","JSON","parse","buildQueryString","query","searchParams","URLSearchParams","k","v","Object","entries","undefined","isArray","item","append","String","set","qs","buildHeaders","out","map","parseBigIntHeader","replace","stringify","parseJson","parseJsonWithBigInt","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","reviveActivityEntry","raw","__o0","reviveActivityPage","__a1","__i2","length","ActivityClient","fetch","readActivity","query","qs","buildQueryString","result","method","reviveActivityPage","parseJson","ArtClient","fetch","listBreakArtwork","result","method","parseJson","replaceBreakArtwork","kind","body","encodeURIComponent","revertBreakArtwork","getArt","id","expectStatuses","status","contentType","readContentType","data","blob","headers","cacheControl","get","undefined","etag","getArtFile","filename","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","reviveAuthenticationRegistration","raw","__o0","reviveOidcLoginStartResponse","reviveFactorChallengePhoneStartResponse","reviveFactorChallengePhoneStartResponseOutput","reviveFactorChallengeEmailStartResponse","reviveFactorChallengeEmailStartResponseOutput","reviveSessionFactor","reviveLogin","reviveBaseAuthenticationLoginStartResponse","reviveSession","__a1","__i2","length","reviveApiKey","reviveApiKeyCreate","reviveCodeAuthenticationLoginStartResponse","reviveLinkAuthenticationLoginStartResponse","reviveOidcAuthenticationLoginStartResponse","reviveMfaRequiredResponse","reviveMfaRequiredResponseOutput","reviveFidoAuthenticationLoginStartResponse","reviveFactorChallengeFidoStartResponse","reviveFactorChallengeFidoStartResponseOutput","reviveApiKeyList","reviveApiKeyIssued","reviveStepUpStartResponse","__v","__d0","reviveStepUpStartResponseOutput","reviveAuthenticationTokenResponse","reviveAuthenticationTokenResponseOutput","reviveAuthenticationLoginStartResponse","reviveFactorChallengeStartResponse","reviveFactorChallengeStartResponseOutput","AuthenticationApikeysClient","fetch","listAPIKeys","result","method","reviveApiKeyList","parseJson","createAPIKey","body","headers","JSON","stringify","bigIntReplacer","reviveApiKeyIssued","rotateAPIKey","id","encodeURIComponent","revokeAPIKey","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","revivePhoneFactorRegistrationResponse","raw","__o0","reviveEmailFactorRegistrationResponse","reviveAuthenticatorFactorRegistrationResponse","reviveMfaEnrollPhoneStartResponse","reviveFidoFactorRegistrationResponse","reviveMfaEnrollFidoStartResponse","reviveAuthenticationFactorRegistrationResponse","__v","__d0","AuthenticationFactorsClient","fetch","listFactors","result","method","parseJson","registerFactor","body","headers","JSON","stringify","bigIntReplacer","reviveAuthenticationFactorRegistrationResponse","verifyFactorRegistration","startFactorChallenge","reviveFactorChallengeStartResponseOutput","startMFAChallenge","reviveStepUpStartResponseOutput","removeFactor","methodId","encodeURIComponent","AuthenticationSessionsClient","fetch","logout","method","readSession","result","parseJson","AuthenticationClient","apikeys","factors","sessions","fetch","AuthenticationApikeysClient","AuthenticationFactorsClient","AuthenticationSessionsClient","requestToken","body","options","__contentType","contentType","__serialized","URLSearchParams","toString","JSON","stringify","bigIntReplacer","result","method","headers","reviveAuthenticationTokenResponseOutput","parseJson","registerLogin","reviveAuthenticationRegistration","verifyLoginRegistration","startLogin","reviveAuthenticationLoginStartResponse","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","reviveTrackBinding","raw","__o0","reviveTrackAnalysis","reviveTrackPlay","reviveFactClaim","reviveTrackDetail","__a1","__i2","length","__a3","__i4","reviveTrackEnrichmentSource","reviveArtistEnrichmentSource","reviveAlbumEnrichmentSource","reviveTrackEnrichmentDetail","reviveArtistEnrichmentDetail","reviveAlbumEnrichmentDetail","CatalogClient","fetch","listArtists","query","qs","buildQueryString","result","method","parseJson","getArtist","id","encodeURIComponent","getArtistEnrichment","reviveArtistEnrichmentDetail","listArtistAlbums","rateArtist","body","headers","JSON","stringify","bigIntReplacer","listAlbums","getAlbum","getAlbumEnrichment","reviveAlbumEnrichmentDetail","listAlbumTracks","rateAlbum","getTrack","reviveTrackDetail","clearTrackAudio","clearTrackAnalysis","retryTrackAudio","offerTrackCopiesAgain","getTrackEnrichment","reviveTrackEnrichmentDetail","clearTrackEnrichment","listTracks","rateTrack","ChartsClient","fetch","listCharts","result","method","parseJson","readChart","id","query","qs","buildQueryString","encodeURIComponent","DirectorClient","fetch","listClockBands","result","method","parseJson","createClockBand","body","headers","JSON","stringify","bigIntReplacer","updateClockBand","id","encodeURIComponent","deleteClockBand","getStationAir","putTheStationOnAir","setTheAirMode","getTheRunningOrder","recastTheBroadcast","extendTheRunningOrder","replanTheRunningOrder","holdTheStationAgainstTheSchedule","releaseTheStationToTheSchedule","shuffleTheRunningOrder","addASegmentToTheRunningOrder","addARecordToTheRunningOrder","moveARunningOrderItem","itemId","removeARunningOrderItem","skipToARunningOrderItem","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","reviveHistoryEntry","raw","__o0","reviveHistoryPage","__a1","__i2","length","HistoryClient","fetch","readHistory","query","qs","buildQueryString","result","method","reviveHistoryPage","parseJson","NarrationsClient","fetch","listSeries","result","method","parseJson","listPieces","query","qs","buildQueryString","renderPiece","id","encodeURIComponent","refreshNarrations","NewsClient","fetch","listFeeds","result","method","parseJson","readNews","query","qs","buildQueryString","NowplayingClient","fetch","getNowPlaying","result","method","parseJson","OnboardingClient","fetch","getOnboardingRequirements","result","method","parseJson","submitOnboardingRequirement","body","headers","JSON","stringify","bigIntReplacer","PersonasClient","fetch","listPersonaAuditions","id","result","encodeURIComponent","method","parseJson","startPersonaAudition","body","headers","JSON","stringify","bigIntReplacer","getPersonaAudition","auditionId","cancelPersonaAudition","listPersonas","createPersona","generatePersona","restoreStationPersonas","exportPersonas","data","contentDisposition","get","undefined","exportPersona","previewPersonaImport","importPersonas","updatePersona","deletePersona","setTheStationHost","listPersonaNotes","writePersonaNote","updatePersonaNote","noteId","deletePersonaNote","setPersonaNoteState","listPersonaStories","writePersonaStory","updatePersonaStory","storyId","deletePersonaStory","setPersonaStoryState","addPersonaStoryDetail","updatePersonaStoryDetail","detailId","deletePersonaStoryDetail","setPersonaStoryDetailState","rehearsePersona","PlaylistsClient","fetch","listImportablePlaylists","result","method","parseJson","getPlaylistTracks","pluginId","playlistId","encodeURIComponent","hidePlaylist","showPlaylist","PlayoutClient","fetch","getPlayoutStatus","result","method","parseJson","playAPlaylist","body","headers","JSON","stringify","bigIntReplacer","playAChart","skipTheCurrentItem","startPlayout","stopPlayout","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","revivePluginSummary","raw","__o0","revivePluginImportResult","__a1","__i2","length","revivePluginDetail","PluginsClient","fetch","listPlugins","result","method","parseJson","map","revivePluginSummary","listPluginGrants","rescanPlugins","importPlugin","body","revivePluginImportResult","getPlugin","id","encodeURIComponent","revivePluginDetail","removePlugin","updatePluginConfiguration","headers","JSON","stringify","bigIntReplacer","enablePlugin","disablePlugin","decidePluginGrant","reloadPlugin","testPluginConnection","suggestPluginConfigOptions","getPluginLogs","query","qs","buildQueryString","downloadPluginLogs","data","text","contentDisposition","get","undefined","setPluginLogLevel","startPluginOAuthAuthorization","disconnectPluginOAuth","completePluginOAuthAuthorization","PodcastsClient","fetch","listShows","result","method","parseJson","searchPodcastDirectory","query","qs","buildQueryString","listEpisodes","fetchEpisode","id","encodeURIComponent","refreshPodcasts","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","reviveProductionRequest","raw","__o0","reviveProduction","reviveProductionList","__a1","__i2","length","ProductionsClient","fetch","listProductions","result","method","reviveProductionList","parseJson","requestProduction","body","headers","JSON","stringify","bigIntReplacer","reviveProduction","cancelProduction","id","encodeURIComponent","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","revivePad","raw","__o0","reviveScriptAttempt","revivePadList","__a1","__i2","length","reviveScriptHistoryPage","RenderClient","fetch","listSegments","result","method","parseJson","createSegment","body","headers","JSON","stringify","bigIntReplacer","uploadSegment","scanTheSegmentInbox","readScriptHistory","query","qs","buildQueryString","reviveScriptHistoryPage","rateScript","id","encodeURIComponent","reviveScriptAttempt","readScriptSummary","listVoices","getDefaultVoiceSample","expectStatuses","status","contentType","readContentType","data","blob","cacheControl","get","undefined","etag","getVoiceSample","voiceId","previewSpeech","deleteSegment","getSegmentAudio","getStoredAudio","checksum","ext","listPronunciations","createPronunciation","updatePronunciation","deletePronunciation","setPronunciationState","listPads","revivePadList","uploadPad","scanThePadLibrary","fetchPad","deletePad","setPadState","getPadAudio","createPadSet","updatePadSet","deletePadSet","setPadMembership","ScheduleClient","fetch","listSchedule","result","method","parseJson","createScheduleSlot","body","headers","JSON","stringify","bigIntReplacer","readCurrentSlot","readTimetable","query","qs","buildQueryString","updateScheduleSlot","id","encodeURIComponent","deleteScheduleSlot","SettingsClient","fetch","getSettings","result","method","parseJson","updateSettings","body","headers","JSON","stringify","bigIntReplacer","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","reviveLogSource","raw","__o0","reviveLogSourceList","__a1","__i2","length","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","reviveStationHeartbeat","raw","__o0","reviveStationCheckup","__a1","__i2","length","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","reviveTraceDecision","raw","__o0","reviveTraceSpan","reviveTracesPage","__a1","__i2","length","reviveTraceDetail","__a3","__i4","StationClient","fetch","listLogs","result","method","reviveLogSourceList","parseJson","readLog","id","query","qs","buildQueryString","encodeURIComponent","downloadLog","data","text","headers","contentDisposition","get","undefined","readStationAttention","readStationCheckup","reviveStationCheckup","readTraces","reviveTracesPage","readTrace","reviveTraceDetail","Decimal","DateTime","Decimal","set","toExpNeg","toExpPos","__dt","v","path","TypeError","d","DateTime","fromISO","isValid","reviveStorageReport","raw","__o0","StorageClient","fetch","readStorage","result","method","reviveStorageReport","parseJson","StreamClient","fetch","getHLSPlaylist","name","result","encodeURIComponent","method","data","blob","headers","cacheControl","get","undefined","readFetcherAuthorization","parseJson","startFetcherAuthorization","finishFetcherAuthorization","body","JSON","stringify","bigIntReplacer","TopicsClient","fetch","listTopics","query","qs","buildQueryString","result","method","parseJson","createTopic","body","headers","JSON","stringify","bigIntReplacer","listTopicKinds","updateTopic","id","encodeURIComponent","deleteTopic","DeadairSdk","activity","art","authentication","catalog","charts","director","history","narrations","news","nowplaying","onboarding","personas","playlists","playout","plugins","podcasts","productions","render","schedule","settings","station","storage","stream","topics","options","sdkFetch","fetch","createSdkFetch","ActivityClient","ArtClient","AuthenticationClient","CatalogClient","ChartsClient","DirectorClient","HistoryClient","NarrationsClient","NewsClient","NowplayingClient","OnboardingClient","PersonasClient","PlaylistsClient","PlayoutClient","PluginsClient","PodcastsClient","ProductionsClient","RenderClient","ScheduleClient","SettingsClient","StationClient","StorageClient","StreamClient","TopicsClient"]}