UNPKG

trigger.dev

Version:

A Command-Line Interface for Trigger.dev projects

62 lines (61 loc) • 1.98 kB
import { ApiClient, type GitMeta } from "@trigger.dev/core/v3"; import { CliApiClient } from "../apiClient.js"; export type LoginResultOk = { ok: true; profile: string; userId: string; email: string; dashboardUrl: string; auth: { apiUrl: string; accessToken: string; tokenType: "personal" | "organization"; }; }; /** * The API's error code when a CLI login token stopped working after going unused; logging in * again fixes it. Must match `CLI_LOGIN_EXPIRED` in @trigger.dev/plugins, which the CLI doesn't * depend on. */ export declare const CLI_LOGIN_EXPIRED_CODE = "cli_login_expired"; export type LoginResult = LoginResultOk | { ok: false; error: string; errorCode?: string | null; auth?: { apiUrl: string; accessToken: string; tokenType: "personal" | "organization"; }; }; export declare function isLoggedIn(profile?: string): Promise<LoginResult>; export type GetEnvOptions = { accessToken: string; apiUrl: string; projectRef: string; env: string; branch?: string; profile: string; }; export declare function getProjectClient(options: GetEnvOptions): Promise<{ id: string; name: string; defaultRuntime: "bun" | "bun-1.4" | "bun-legacy" | "node" | "node-22" | "node-24" | "node-26" | null | undefined; client: CliApiClient; } | undefined>; /** A core `ApiClient` scoped to the project environment's secret key, for the environment-keyed APIs (runs, etc). */ export declare function getProjectEnvApiClient(options: GetEnvOptions): Promise<ApiClient | undefined>; export type UpsertBranchOptions = { accessToken: string; apiUrl: string; projectRef: string; branch: string; gitMeta: GitMeta | undefined; }; export declare function upsertBranch(options: UpsertBranchOptions): Promise<{ id: string; autoArchivedBranches?: { id: string; branchName: string; }[] | undefined; } | undefined>;