/** * @typedef {object} DeploymentTarget * @property {string} configPath - Backend-held Rampway config path. * @property {string} releaseBranch - Approved release branch. */ /** * @typedef {object} DeploymentMountOptions * @property {string[]} accessTokens - Accepted tokens. * @property {string} workerBootstrapPath - Backend-owned worker bootstrap module. * @property {string} workerPath - Immutable package worker entry path. * @property {string} mountIdentifier - Stable mount scope. * @property {Record} projects - Normalized allowlist. * @property {number} staleRunTimeoutMs - Lease timeout. */ /** * Looks up only explicit allowlist properties. * * @param {Record} projects - Normalized project allowlist. * @param {string} project - Project identifier. * @param {string} stage - Stage identifier. * @returns {DeploymentTarget|undefined} Target configuration. */ export function lookupTarget(projects: Record, project: string, stage: string): DeploymentTarget | undefined; /** * Framework-neutral deployment API behavior used by the Velocious controller. * * @template {import('./run-store.js').DeploymentRunStoreContract} TStore */ export class DeploymentControlPlane { /** * @param {object} args - Dependencies. * @param {(args: {onFailure: (error: unknown) => Promise, runId: string}) => Promise} args.detachedExecution - Starts the package-owned worker. * @param {(payload: {context: string, error: unknown}) => void} args.emitFrameworkError - Reports internal failures. * @param {import('./executor.js').RampwayDeploymentExecutor} args.executor - Rampway lifecycle executor. * @param {() => number} [args.now] - Clock. * @param {DeploymentMountOptions} args.options - Validated mount options. * @param {TStore} args.store - Durable run store. */ constructor({ detachedExecution, emitFrameworkError, executor, now, options, store }: { detachedExecution: (args: { onFailure: (error: unknown) => Promise; runId: string; }) => Promise; emitFrameworkError: (payload: { context: string; error: unknown; }) => void; executor: import("./executor.js").RampwayDeploymentExecutor; now?: (() => number) | undefined; options: DeploymentMountOptions; store: TStore; }); detachedExecution: (args: { onFailure: (error: unknown) => Promise; runId: string; }) => Promise; emitFrameworkError: (payload: { context: string; error: unknown; }) => void; executor: import("./executor.js").RampwayDeploymentExecutor; now: () => number; options: DeploymentMountOptions; store: TStore; /** * @param {unknown} authorization - Authorization header. * @returns {boolean} Whether request is authorized. */ _authorized(authorization: unknown): boolean; /** * @param {string} candidate - Value to compare with configured access tokens. * @returns {boolean} Whether the value is an accepted access token. */ _matchesAccessToken(candidate: string): boolean; /** * @param {string} candidate - Idempotency key candidate. * @returns {boolean} Whether the key contains a configured access token. */ _containsAccessToken(candidate: string): boolean; /** * Creates a deployment run. * * @param {{authorization: unknown, input: unknown}} args - Request data. * @returns {Promise<{body: Record, status: number}>} HTTP response. */ create({ authorization, input }: { authorization: unknown; input: unknown; }): Promise<{ body: Record; status: number; }>; /** * @param {{authorization: unknown, id: string}} args - Request data. * @returns {Promise<{body: Record, status: number}>} HTTP response. */ show({ authorization, id }: { authorization: unknown; id: string; }): Promise<{ body: Record; status: number; }>; /** * @param {{existing: import('./run-store.js').DeploymentRunRow, project: string, revision: string, expectedActiveRevision: string|null, stage: string}} args - Replay data. * @returns {{body: Record, status: number}} Response. */ _existingResponse({ existing, project, revision, expectedActiveRevision, stage }: { existing: import("./run-store.js").DeploymentRunRow; project: string; revision: string; expectedActiveRevision: string | null; stage: string; }): { body: Record; status: number; }; /** * @param {{claimed?: boolean, run: import('./run-store.js').DeploymentRunRow, target: DeploymentTarget}} args - Execution data. * @returns {Promise} Resolves after durable outcome. */ _executeRun({ claimed, run, target }: { claimed?: boolean; run: import("./run-store.js").DeploymentRunRow; target: DeploymentTarget; }): Promise; /** * @param {{event: string, payload: Record, runId: string|null}} args - Event. * @returns {Promise} Resolves after persistence or reporting. */ _audit({ event, payload, runId }: { event: string; payload: Record; runId: string | null; }): Promise; /** * @param {import('./run-store.js').DeploymentRunRow} run - Run. * @returns {Record} Public representation. */ _serializeRun(run: import("./run-store.js").DeploymentRunRow): Record; /** * @param {import('./run-store.js').DeploymentRunRow} run - Durable run. * @returns {Record} Stable request identity. */ _runIdentity(run: import("./run-store.js").DeploymentRunRow): Record; } export type DeploymentTarget = { /** * - Backend-held Rampway config path. */ configPath: string; /** * - Approved release branch. */ releaseBranch: string; }; export type DeploymentMountOptions = { /** * - Accepted tokens. */ accessTokens: string[]; /** * - Backend-owned worker bootstrap module. */ workerBootstrapPath: string; /** * - Immutable package worker entry path. */ workerPath: string; /** * - Stable mount scope. */ mountIdentifier: string; /** * - Normalized allowlist. */ projects: Record; /** * - Lease timeout. */ staleRunTimeoutMs: number; }; //# sourceMappingURL=control-plane.d.ts.map