trigger.dev
Version:
A Command-Line Interface for Trigger.dev projects
43 lines (42 loc) • 1.96 kB
TypeScript
import { PromoteTrustedDeploymentRequest, PrepareTrustedDeployResponse } from "@trigger.dev/core/v3";
import { type ApiResult } from "@trigger.dev/core/v3/zodfetch";
import { z } from "zod";
import { CliApiClient } from "../apiClient.js";
import type { DeployCommandOptions } from "../commands/deploy.js";
import { loadConfig } from "../config.js";
type GithubActionsEnvironment = {
GITHUB_ACTIONS?: string;
ACTIONS_ID_TOKEN_REQUEST_URL?: string;
ACTIONS_ID_TOKEN_REQUEST_TOKEN?: string;
};
export type NativeBuildClient = Pick<CliApiClient, "initializeDeployment"> & {
createArtifact(body: Parameters<CliApiClient["createArtifact"]>[0]): Promise<ApiResult<PrepareTrustedDeployResponse>>;
};
export declare function shouldUseGithubOidc(authMethod: "auto" | "oidc", accessToken: string | undefined, environment?: GithubActionsEnvironment): boolean;
export declare function validateTrustedDeployOptions(options: Pick<DeployCommandOptions, "localBuild" | "forceLocalBuild" | "depotBuild" | "localBundle" | "fromBundle" | "dryRun">): void;
export declare function runTrustedDeploy(projectPath: string, options: DeployCommandOptions, deploy: (args: {
apiClient: NativeBuildClient;
config: Awaited<ReturnType<typeof loadConfig>>;
dashboardUrl: string;
options: DeployCommandOptions;
branch?: string;
}) => Promise<void>): Promise<void>;
export declare function trustedDeployApiUrl(options: {
apiUrl?: string;
profile: string;
}): string;
export type PreviewArchiveAuth = {
type: "oidc";
apiUrl: string;
} | {
type: "token";
apiUrl: string;
accessToken: string;
};
export declare function archivePreviewBranch(auth: PreviewArchiveAuth, branch: string, projectRef: string): Promise<void>;
export declare function promoteTrustedDeployment(apiUrl: string, target: z.input<typeof PromoteTrustedDeploymentRequest>): Promise<ApiResult<{
id: string;
version: string;
shortCode: string;
}>>;
export {};