import { type CreateProjectInput } from "../api/projects.js"; import { type CreateDeliverableInput } from "../api/deliverables.js"; import { type CreateTaskInput, type UpdateTaskInput } from "../api/tasks.js"; import type { CampaignUser, Deliverable, PagedResult, Project, Task } from "../api/schema.js"; /** * CLI runners for the `scai ops campaign …` command family. * * Each runner resolves the env, acquires an Orchestrate-scoped token, * calls the library helper, then prints human or JSON output. The * env+token+client orchestration lives in the exported * `resolveCampaignClient()` (see `../client.ts`); `prepareCampaignClient()` * only pairs it with a CLI `Logger`. * * Write runners (`create`, `update`, `delete`) honour an `options.whatIf` * flag — when set they skip the API call and emit a plan-only summary. * The CLI layer wires this via `withApplyGate`. * * The `delete` runners call SDK helpers whose DELETE endpoints are * UNVERIFIED (never captured during reverse-engineering) — see the SDK * doc comments and `scripts/_smoke-campaign-delete.ts`. */ export interface RunCampaignBaseOptions { config?: string; /** Explicit organization id (`--org-id`). The Orchestrate API is org-scoped. */ orgId?: string; /** Env profile name — used only to derive its `organizationId`. */ environmentName?: string; verbose?: boolean; trace?: boolean; quiet?: boolean; json?: boolean; logFile?: string; } /** * Identity + linkage fields of a project ("campaign") — everything a * tenant scan needs to match and route a project, without the heavy * `deliverables`, `members`, `attachments`, and `context` arrays that * dominate a full `Project`. Emitted by `runCampaignList({ lean })`. */ export type LeanProject = Pick; export declare const runCampaignList: (options: RunCampaignBaseOptions & { limit?: number; lean?: boolean; }) => Promise>; export declare const runCampaignGet: (options: RunCampaignBaseOptions & { campaignId: string; }) => Promise; export declare const runCampaignUsers: (options: RunCampaignBaseOptions) => Promise>; export declare const runCampaignCreate: (options: RunCampaignBaseOptions & { input: CreateProjectInput; whatIf?: boolean; }) => Promise; export declare const runDeliverableCreate: (options: RunCampaignBaseOptions & { campaignId: string; input: CreateDeliverableInput; whatIf?: boolean; }) => Promise; export declare const runTaskList: (options: RunCampaignBaseOptions & { campaignId: string; deliverableId: string; }) => Promise>; export declare const runTaskGet: (options: RunCampaignBaseOptions & { campaignId: string; deliverableId: string; taskId: string; }) => Promise; export declare const runTaskCreate: (options: RunCampaignBaseOptions & { campaignId: string; deliverableId: string; input: CreateTaskInput; whatIf?: boolean; }) => Promise; export declare const runTaskUpdate: (options: RunCampaignBaseOptions & { campaignId: string; deliverableId: string; taskId: string; input: UpdateTaskInput; whatIf?: boolean; }) => Promise; /** * Delete a campaign (Orchestrate project). Detaches any still-linked * briefs first (see {@link detachLinkedBriefs}) so the reverse-view * 403 doesn't block the delete. * * UNVERIFIED — the underlying `deleteProject` DELETE endpoint was never * captured; it is wired optimistically per REST conventions. */ export declare const runCampaignDelete: (options: RunCampaignBaseOptions & { campaignId: string; whatIf?: boolean; }) => Promise<{ id: string; deleted: boolean; }>; /** * Delete a deliverable under a campaign. * * UNVERIFIED — the underlying `deleteDeliverable` DELETE endpoint was * never captured; it is wired optimistically per REST conventions. */ export declare const runDeliverableDelete: (options: RunCampaignBaseOptions & { campaignId: string; deliverableId: string; whatIf?: boolean; }) => Promise<{ id: string; deleted: boolean; }>; /** * Delete a task under a deliverable. * * UNVERIFIED — the underlying `deleteTask` DELETE endpoint was never * captured; it is wired optimistically per REST conventions. */ export declare const runTaskDelete: (options: RunCampaignBaseOptions & { campaignId: string; deliverableId: string; taskId: string; whatIf?: boolean; }) => Promise<{ id: string; deleted: boolean; }>;