import type { Brief, BriefStatus, PagedResult } from "./schema.js"; import type { BriefApiClientOptions } from "./types.js"; /** * Brief resource — CRUD on brief instances. * * Endpoint surface (reverse-engineered): * GET /api/brief/v1/briefs — list (paged) * GET /api/brief/v1/briefs/{id} — read one * POST /api/brief/v1/briefs — create (verified 2026-05-15) * PUT /api/brief/v1/briefs/{id} — update (untested) * DELETE /api/brief/v1/briefs/{id} — delete (verified 2026-05-15) * * `createBrief` + `deleteBrief` are verified against the Agents * tenant. `updateBrief` is wired the same way the Sites surface wires * its writes but has not been smoke-tested end-to-end. */ export type ListBriefsQuery = { /** Page size. */ limit?: number; /** Cursor from the previous response's `next` field. */ next?: string; /** Optional locale filter — e.g. `en-us`. */ locale?: string; }; /** List all briefs in the tenant (paged). */ export declare const listBriefs: (options: BriefApiClientOptions, query?: ListBriefsQuery) => Promise>; /** Read a single brief by id. 404 surfaces as `BRIEF_API_FAILED` with `"Brief not found"`. */ export declare const getBrief: (options: BriefApiClientOptions, briefId: string) => Promise; /** * Input for `createBrief`. * * Verified against the Agents tenant 2026-05-15: the POST body takes a * flat `briefTypeId` (NOT a nested `briefType: { id }` — that 400s with * `BriefTypeId: Brief type is required`). `name` + `briefTypeId` are * required; `locale`, `fields`, `isTemplate` are optional. `fields` * accepts the same per-field `{ type, value }` shape the read endpoint * returns, where RichText `value` is a ProseMirror doc node. */ export type CreateBriefInput = { name: string; briefTypeId: string; locale?: string; fields?: Record; isTemplate?: boolean; }; /** * Validate an unknown value as a `CreateBriefInput`. Throws a typed * `ScaiError` (`INPUT_INVALID`) on failure; returns the narrowed input * on success. `createBrief` calls this itself, so direct SDK consumers * are guarded without invoking it explicitly. Mirrors * `assertCreateBriefTypeInput` in `./brief-types.ts`. */ export declare const assertCreateBriefInput: (value: unknown) => CreateBriefInput; /** Create a brief. Returns the persisted record (201). */ export declare const createBrief: (options: BriefApiClientOptions, input: CreateBriefInput) => Promise; /** * One external-link reference attached to a brief — most commonly a * link to its parent Orchestrate project (campaign). Verified * writable 2026-06-03 via PUT on the brief with `references: [...]`. */ export type BriefExternalReference = { type: "ExternalLink"; relatedSystem: string; relatedType?: string | null; id: string; }; /** * Partial update of a brief (`PUT /api/brief/v1/briefs/{id}` — 204 No * Content). A status-only body is accepted; the `status` path is * verified (2026-05-15); the `references` path is verified * (2026-06-03); other partial fields are wired but unverified. */ export declare const updateBrief: (options: BriefApiClientOptions, briefId: string, patch: Partial & { status?: BriefStatus; references?: BriefExternalReference[]; }) => Promise; /** Delete a brief. Returns void (204). Verified against the Agents tenant 2026-05-15. */ export declare const deleteBrief: (options: BriefApiClientOptions, briefId: string) => Promise; /** * Link a brief to an Orchestrate campaign (project) — `PATCH * /api/brief/v1/briefs/{id}/links` → 204 No Content. * * This is the ONLY action that registers a brief→campaign relationship * with Orchestrate, and the one the campaign's `project.briefs[]` reverse * view is derived from. It writes the brief's **`links`** collection, * which is distinct from the `references` collection `updateBrief` writes: * a `references` ExternalLink with `relatedSystem: "co"` is stored on the * brief but is NEVER surfaced on the campaign — only this PATCH is. (That * mismatch is exactly why a brief could carry a "co" project reference yet * never appear under its campaign.) * * Body shape verified against the SitecoreAI "link to campaign" UI action * (2026-06-20): the campaign lives in the **AI** system * (`ai-workflows-*.sitecorecloud.io`), so `system` is `"AI"`, `type` is the * lowercase entity kind `"project"`, and `id` is the Orchestrate project * id. No other fields are sent. */ export declare const linkBriefToProject: (options: BriefApiClientOptions, briefId: string, projectId: string) => Promise;