Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
107 lines
5.0 KiB
Plaintext
107 lines
5.0 KiB
Plaintext
import { DirectusDeployment, DirectusDeploymentProject, DirectusDeploymentRun } from "../../../schema/deployment.js";
|
|
import { ApplyQueryFields } from "../../../types/output.js";
|
|
import { Query } from "../../../types/query.js";
|
|
import { RestCommand } from "../../types.js";
|
|
|
|
//#region src/rest/commands/read/deployment.d.ts
|
|
type ReadDeploymentOutput<Schema, TQuery extends Query<Schema, Item>, Item extends object = DirectusDeployment<Schema>> = ApplyQueryFields<Schema, Item, TQuery['fields']>;
|
|
type ReadDeploymentProjectOutput<Schema, TQuery extends Query<Schema, Item>, Item extends object = DirectusDeploymentProject<Schema>> = ApplyQueryFields<Schema, Item, TQuery['fields']>;
|
|
type ReadDeploymentRunOutput<Schema, TQuery extends Query<Schema, Item>, Item extends object = DirectusDeploymentRun<Schema>> = ApplyQueryFields<Schema, Item, TQuery['fields']>;
|
|
interface DeploymentProjectListOutput {
|
|
id: string | null;
|
|
external_id: string;
|
|
name: string;
|
|
deployable: boolean;
|
|
framework?: string;
|
|
}
|
|
interface DeploymentDashboardOutput {
|
|
projects: Array<{
|
|
id: string;
|
|
external_id: string;
|
|
name: string;
|
|
url?: string;
|
|
framework?: string;
|
|
deployable: boolean;
|
|
latest_deployment?: {
|
|
status: 'building' | 'ready' | 'error' | 'canceled';
|
|
created_at: string;
|
|
finished_at?: string;
|
|
};
|
|
}>;
|
|
}
|
|
interface DeploymentRunsOutput {
|
|
id: string;
|
|
project: string;
|
|
external_id: string;
|
|
target: string;
|
|
status: 'building' | 'ready' | 'error' | 'canceled';
|
|
url?: string;
|
|
date_created: string;
|
|
finished_at?: string;
|
|
author?: string;
|
|
}
|
|
/**
|
|
* List all configured deployment providers.
|
|
* @param query The query parameters
|
|
* @returns An array of deployment objects.
|
|
*/
|
|
declare const readDeployments: <Schema, const TQuery extends Query<Schema, DirectusDeployment<Schema>>>(query?: TQuery) => RestCommand<ReadDeploymentOutput<Schema, TQuery>[], Schema>;
|
|
/**
|
|
* Get a deployment provider by type.
|
|
* @param provider The provider type (e.g. 'vercel')
|
|
* @param query The query parameters
|
|
* @returns The deployment object.
|
|
* @throws Will throw if provider is empty
|
|
*/
|
|
declare const readDeployment: <Schema, const TQuery extends Query<Schema, DirectusDeployment<Schema>>>(provider: string, query?: TQuery) => RestCommand<ReadDeploymentOutput<Schema, TQuery>, Schema>;
|
|
/**
|
|
* Get deployment dashboard for a provider.
|
|
* Returns selected projects with latest deployment status and stats.
|
|
* @param provider The provider type (e.g. 'vercel')
|
|
* @returns Dashboard data with projects and stats.
|
|
* @throws Will throw if provider is empty
|
|
*/
|
|
declare const readDeploymentDashboard: <Schema>(provider: string) => RestCommand<DeploymentDashboardOutput, Schema>;
|
|
/**
|
|
* List projects for a deployment provider.
|
|
* Returns merged DB + provider info (id is null if project not selected).
|
|
* @param provider The provider type (e.g. 'vercel')
|
|
* @returns An array of project objects with selection status.
|
|
* @throws Will throw if provider is empty
|
|
*/
|
|
declare const readDeploymentProjects: <Schema>(provider: string) => RestCommand<DeploymentProjectListOutput[], Schema>;
|
|
/**
|
|
* Get a specific project from a deployment provider.
|
|
* @param provider The provider type (e.g. 'vercel')
|
|
* @param projectId The project ID
|
|
* @param query The query parameters
|
|
* @returns The project object.
|
|
* @throws Will throw if provider or projectId is empty
|
|
*/
|
|
declare const readDeploymentProject: <Schema, const TQuery extends Query<Schema, DirectusDeploymentProject<Schema>>>(provider: string, projectId: string, query?: TQuery) => RestCommand<ReadDeploymentProjectOutput<Schema, TQuery>, Schema>;
|
|
/**
|
|
* List deployment runs for a project.
|
|
* @param provider The provider type (e.g. 'vercel')
|
|
* @param projectId The project ID
|
|
* @param query Optional query parameters (search, limit, offset, meta)
|
|
* @returns Deployment runs with optional meta for pagination.
|
|
* @throws Will throw if provider or projectId is empty
|
|
*/
|
|
declare const readDeploymentRuns: <Schema>(provider: string, projectId: string, query?: {
|
|
search?: string;
|
|
limit?: number;
|
|
offset?: number;
|
|
meta?: string;
|
|
}) => RestCommand<DeploymentRunsOutput[], Schema>;
|
|
/**
|
|
* Get a specific deployment run with logs.
|
|
* @param provider The provider type (e.g. 'vercel')
|
|
* @param runId The run ID
|
|
* @param query The query parameters (supports 'since' for incremental logs)
|
|
* @returns The deployment run object with details and logs.
|
|
* @throws Will throw if provider or runId is empty
|
|
*/
|
|
declare const readDeploymentRun: <Schema, const TQuery extends Query<Schema, DirectusDeploymentRun<Schema>>>(provider: string, runId: string, query?: TQuery) => RestCommand<ReadDeploymentRunOutput<Schema, TQuery>, Schema>;
|
|
//#endregion
|
|
export { DeploymentDashboardOutput, DeploymentProjectListOutput, DeploymentRunsOutput, ReadDeploymentOutput, ReadDeploymentProjectOutput, ReadDeploymentRunOutput, readDeployment, readDeploymentDashboard, readDeploymentProject, readDeploymentProjects, readDeploymentRun, readDeploymentRuns, readDeployments };
|
|
//# sourceMappingURL=deployment.d.ts.map |