@usenadia/node 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/generated/core/bodySerializer.gen.ts","../src/generated/core/params.gen.ts","../src/generated/core/serverSentEvents.gen.ts","../src/generated/core/pathSerializer.gen.ts","../src/generated/core/utils.gen.ts","../src/generated/core/auth.gen.ts","../src/generated/client/utils.gen.ts","../src/generated/client/client.gen.ts","../src/generated/client.gen.ts","../src/generated/sdk.gen.ts"],"sourcesContent":["/**\n * UseNadia Node SDK.\n *\n * Two layers, on purpose (plan 19) — this file is the second one.\n *\n * `src/generated/` transport, regenerated from `openapi.public.json`,\n * covers every operation, never edited by hand.\n * `src/index.ts` this file: the small, hand-written surface that makes\n * the common calls pleasant, and that we take\n * responsibility for.\n *\n * The `Nadia` class keeps the shape of upstream's Node SDK so its\n * examples still read the same — but it wraps the generated client instead of\n * hand-rolling `fetch`, and it fixes the two bugs upstream ships with:\n * HTTP errors were swallowed (`.json()` was called without looking at the\n * status, so a 402 came back looking like a success), and `deletePost()`\n * returned an unawaited `fetch`.\n *\n * Everything the facade does not sugar is still reachable: the generated\n * client and its types are re-exported at the bottom of this file.\n */\nimport { createHmac, timingSafeEqual } from 'node:crypto';\nimport { client as generatedClient } from './generated/client.gen';\nimport * as api from './generated/sdk.gen';\nimport type {\n CreateContentDto,\n ListContentsData,\n MoveContentDto,\n PublicCreatePostDto,\n UpdateContentDto,\n UpsertContentDto,\n} from './generated/types.gen';\n\n/** Body of {@link Nadia.post}: the spec's own shape (`group`, `value[].id`\n * and `value[].delay` are optional there since 2026-10-21). */\nexport type CreatePostBody = PublicCreatePostDto;\n\n/** A column of the content board, in board order. */\nexport type ContentStage = MoveContentDto['stage'];\n\nexport const DEFAULT_BASE_URL = 'https://app.usenadia.com/api';\n\n/** Thrown for every response with a status >= 400. */\nexport class NadiaError extends Error {\n readonly status: number;\n readonly body: unknown;\n\n constructor(status: number, body: unknown, message?: string) {\n super(message ?? `UseNadia API responded ${status}`);\n this.name = 'NadiaError';\n this.status = status;\n this.body = body;\n Object.setPrototypeOf(this, NadiaError.prototype);\n }\n\n /**\n * True when retrying later could plausibly work: a rate limit, a server\n * hiccup, or a request that never completed at all (status 0).\n */\n get isTransient(): boolean {\n return this.status === 0 || this.status === 429 || this.status >= 500;\n }\n}\n\nexport interface NadiaOptions {\n /** Defaults to `https://app.usenadia.com/api`. */\n baseUrl?: string;\n /** Retries on 429 and 5xx. Default 2, set 0 to disable. */\n retries?: number;\n /** Swap in a custom fetch (tests, proxies, instrumentation). */\n fetch?: typeof fetch;\n /**\n * How {@link Nadia.uploadFromUrl} reads a long import again: every\n * `intervalMs` (default 3000), for `timeoutMs` at most (default 15 min:\n * the server gives a download 10 minutes).\n */\n importPoll?: { intervalMs?: number; timeoutMs?: number };\n}\n\n/** Shape every generated operation resolves to. */\ntype GeneratedResult<T> = {\n data?: T;\n error?: unknown;\n request?: Request;\n response?: Response;\n};\n\nconst sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));\n\n/* ------------------------------------------------------------------ *\n * Uploads (plan 83): in parts straight to the storage when the server\n * offers it, the whole file through the API otherwise\n * ------------------------------------------------------------------ */\n\n/** What {@link Nadia.upload} resolves to: `id` and `path` go in a post. */\nexport interface UploadedMedia {\n id: string;\n path: string;\n /** In parts or single PUT: the checked type, bytes, seconds (null for an image), size as displayed, codec. */\n contentType?: string;\n size?: number;\n duration?: number | null;\n width?: number;\n height?: number;\n codec?: string;\n /** Through `POST /public/v1/upload`: the library row's other fields. */\n name?: string;\n originalName?: string | null;\n thumbnail?: string | null;\n alt?: string | null;\n}\n\n/** The answer of `POST /public/v1/uploads` (`createUploadUrl` in the MCP). */\ninterface UploadSession {\n uploadId: string;\n uploadUrl: string;\n headers?: Record<string, string>;\n /** Absent: the server takes a single PUT of the whole file. */\n partSize?: number;\n parts?: number;\n}\n\n/**\n * The answer of `POST /public/v1/upload-from-url` past 25 s, and of\n * `GET /public/v1/upload-from-url/{importId}` (plan 65).\n */\ninterface UrlImport {\n id: string;\n status: 'running' | 'done' | 'failed';\n media: UploadedMedia | null;\n error: { statusCode: number; msg: string } | null;\n}\n\n/** An import answered 202, not yet a media (a media has a `path`). */\nconst isUrlImport = (v: unknown): v is UrlImport =>\n !!v &&\n typeof v === 'object' &&\n typeof (v as UrlImport).id === 'string' &&\n typeof (v as UrlImport).status === 'string' &&\n !('path' in (v as object));\n\n/** The types the upload in parts takes; anything else goes whole. */\nconst DIRECT_TYPES: Record<string, string> = {\n mp4: 'video/mp4',\n jpg: 'image/jpeg',\n jpeg: 'image/jpeg',\n png: 'image/png',\n webp: 'image/webp',\n gif: 'image/gif',\n};\n\n/** Parts sent at once (4: what was measured on 2026-11-29, plan 83). */\nconst PARALLEL_PARTS = 4;\n/** Tries of one part, on a network error, a 5xx or a 429. */\nconst PART_TRIES = 3;\n/** Confirms of one upload: the first, then after sending what was missing. */\nconst UPLOAD_ROUNDS = 4;\n\nfunction directType(name: string, blobType: string): string | undefined {\n const ext = /\\.([a-z0-9]+)$/i.exec(name)?.[1]?.toLowerCase();\n if (ext && DIRECT_TYPES[ext]) return DIRECT_TYPES[ext];\n return Object.values(DIRECT_TYPES).includes(blobType) ? blobType : undefined;\n}\n\n/**\n * The type a file of this name is sent in parts as (`video/mp4`,\n * `image/jpeg`…), or `undefined` when {@link Nadia.upload} sends it whole\n * through `POST /public/v1/upload` (HEIC, MOV, AVIF…).\n */\nexport const uploadContentType = (filename: string): string | undefined => directType(filename, '');\n\n/**\n * A path becomes a Blob of the file (`fs.openAsBlob`, read lazily, Node ≥ 20;\n * read whole before that), named after it.\n */\nasync function openSource(file: string | Blob, filename?: string) {\n if (typeof file !== 'string') {\n const own = (file as File).name;\n return { blob: file, name: filename ?? (own || 'upload') };\n }\n const fs = await import('node:fs');\n const { basename } = await import('node:path');\n const blob: Blob =\n typeof (fs as { openAsBlob?: unknown }).openAsBlob === 'function'\n ? await (fs as unknown as { openAsBlob: (p: string) => Promise<Blob> }).openAsBlob(file)\n : new Blob([await fs.promises.readFile(file)]);\n return { blob, name: filename ?? basename(file) };\n}\n\nconst range = (from: number, to: number) => Array.from({ length: to - from + 1 }, (_, i) => from + i);\n\n/** The parts a 409 UPLOAD_INCOMPLETE names. */\nfunction missingParts(body: unknown): number[] {\n const list = (body as { missingParts?: unknown } | undefined)?.missingParts;\n return Array.isArray(list) ? list.filter((n): n is number => Number.isInteger(n) && n > 0) : [];\n}\n\n/**\n * Reads the API's error message without assuming it is there: `{ msg }` is\n * the documented shape, but a request rejected by validation comes back in\n * the framework's own `{ message: string[] }`, and that list is the only\n * place saying which field is wrong.\n */\nconst messageOf = (body: unknown): string | undefined => {\n if (!body || typeof body !== 'object') return undefined;\n const { msg, message } = body as { msg?: unknown; message?: unknown };\n if (typeof msg === 'string') return msg;\n if (typeof message === 'string') return message;\n if (Array.isArray(message) && message.length && message.every((m) => typeof m === 'string')) {\n return message.join('; ');\n }\n return undefined;\n};\n\nexport class Nadia {\n private readonly client: typeof generatedClient;\n private readonly retries: number;\n /** For the bytes of an upload, which go to the upload host, not the API. */\n private readonly fetchImpl: typeof fetch;\n private readonly importPoll: { intervalMs: number; timeoutMs: number };\n\n constructor(apiKey: string, options: string | NadiaOptions = {}) {\n if (!apiKey) {\n throw new Error('An API key is required.');\n }\n\n // Upstream's second argument was a base URL string; keep that working.\n const opts: NadiaOptions =\n typeof options === 'string' ? { baseUrl: options } : options;\n\n this.retries = opts.retries ?? 2;\n this.fetchImpl = opts.fetch ?? ((input, init) => fetch(input, init));\n this.importPoll = {\n intervalMs: opts.importPoll?.intervalMs ?? 3000,\n timeoutMs: opts.importPoll?.timeoutMs ?? 15 * 60 * 1000,\n };\n\n this.client = generatedClient;\n this.client.setConfig({\n baseUrl: opts.baseUrl ?? DEFAULT_BASE_URL,\n headers: { Authorization: apiKey },\n ...(opts.fetch ? { fetch: opts.fetch } : {}),\n });\n }\n\n /**\n * Runs a generated operation, turns a non-2xx into a `NadiaError`, and\n * retries the transient ones. Every method below goes through here — that is\n * the whole point of the facade.\n */\n private async call<T>(\n operation: (options: { client: typeof generatedClient }) => Promise<\n GeneratedResult<T>\n >\n ): Promise<T> {\n let lastError: NadiaError | undefined;\n\n for (let attempt = 0; attempt <= this.retries; attempt++) {\n const { data, error, response } = await operation({ client: this.client });\n\n // No response at all means the request never completed (DNS, TLS,\n // connection reset). Surfaced as status 0 rather than a bare TypeError.\n if (!response) {\n lastError = new NadiaError(0, error, 'The request did not complete.');\n } else if (response.ok) {\n return data as T;\n } else {\n lastError = new NadiaError(response.status, error, messageOf(error));\n }\n\n if (!lastError.isTransient || attempt === this.retries) {\n throw lastError;\n }\n\n await sleep(2 ** attempt * 500);\n }\n\n throw lastError;\n }\n\n /* --------------------------------------------------------------- *\n * The five calls upstream had, same names, same shape\n * --------------------------------------------------------------- */\n\n /** Schedule, publish or draft a post on one or more channels. */\n post(body: CreatePostBody) {\n return this.call((o) =>\n api.createPost({ ...o, body: body as never })\n );\n }\n\n /** List posts in a date range. */\n postList(query?: Record<string, unknown>) {\n return this.call((o) =>\n api.listPosts({ ...o, query: query as never })\n );\n }\n\n /**\n * Upload a file and get a URL usable in a post: a path on disk, or a\n * `Blob` / `File` with its name.\n *\n * An MP4, JPEG, PNG, WebP or GIF goes in parts of 20 MB straight to the\n * storage (`POST /public/v1/uploads`, then its confirm): four parts at a\n * time, a part cut by the network sent again, and the parts the confirm\n * says are missing sent again before confirming once more. A server that\n * does not take parts answers a single PUT, which is done instead; a\n * server without that route (older, or self-hosted on an older release)\n * and any other type (HEIC… which the server converts to JPEG) go through\n * `POST /public/v1/upload`, the whole file in one request, as before. A\n * MOV or an M4V is refused there (`415`): convert it to MP4 first.\n *\n * Resolves to the media: `id` and `path` always (what a post takes),\n * plus `size`, `duration`, `width`, `height`, `codec` when it went in\n * parts or in a single PUT.\n */\n async upload(file: string | Blob | File, filename?: string): Promise<UploadedMedia> {\n const source = await openSource(file, filename);\n const type = directType(source.name, source.blob.type);\n if (!type) return this.uploadWhole(source);\n\n let opened: UploadSession;\n try {\n opened = (await this.call((o) =>\n api.createUpload({\n ...o,\n body: { filename: source.name, contentType: type as never, size: source.blob.size },\n })\n )) as UploadSession;\n } catch (err) {\n // No such route: a server from before the upload in parts.\n if (err instanceof NadiaError && (err.status === 404 || err.status === 405)) {\n return this.uploadWhole(source);\n }\n throw err;\n }\n\n if (opened.parts) {\n await this.sendParts(opened, source.blob, range(1, opened.parts));\n } else {\n await this.sendWhole(opened, source.blob);\n }\n\n for (let round = 1; ; round++) {\n try {\n return (await this.call((o) =>\n api.confirmUpload({ ...o, path: { uploadId: opened.uploadId } })\n )) as UploadedMedia;\n } catch (err) {\n if (!(err instanceof NadiaError) || err.status !== 409 || round >= UPLOAD_ROUNDS) throw err;\n const missing = missingParts(err.body);\n if (missing.length && opened.parts) {\n // What the storage did not get: only those, then confirm again.\n await this.sendParts(opened, source.blob, missing);\n } else if (/^CONFIRM_IN_PROGRESS/.test(err.message)) {\n await sleep(3000);\n } else {\n throw err;\n }\n }\n }\n }\n\n /**\n * Import a file from a public HTTPS URL into the media library\n * (`POST /public/v1/upload-from-url`): the path of the URL ends in `.png`,\n * `.jpg`, `.jpeg`, `.gif`, `.webp` or `.mp4`.\n *\n * A long import (not done within 25 s) is answered `202` by the server and\n * goes on there; it is read again here (`GET\n * /public/v1/upload-from-url/{importId}`) until it ends. Resolves to the\n * media either way; a failed import throws the `NadiaError` the server\n * would have answered at once (its status and `msg`).\n */\n async uploadFromUrl(url: string): Promise<UploadedMedia> {\n const first = await this.call((o) => api.uploadFromUrl({ ...o, body: { url } }));\n return this.importEnd(first);\n }\n\n /**\n * The end of an import from a URL: the media at once (`201`), or an import\n * (`202`) read again every few seconds until it is done or failed.\n */\n private async importEnd(answer: unknown): Promise<UploadedMedia> {\n if (!isUrlImport(answer)) return answer as UploadedMedia;\n const deadline = Date.now() + this.importPoll.timeoutMs;\n let current: UrlImport = answer;\n while (current.status === 'running') {\n if (Date.now() >= deadline) {\n throw new NadiaError(\n 504,\n current,\n `The import from a URL ${current.id} did not end within ${Math.round(this.importPoll.timeoutMs / 1000)} s: read it again with getUploadFromUrl.`\n );\n }\n await sleep(this.importPoll.intervalMs);\n const id = current.id;\n current = (await this.call((o) =>\n api.getUploadFromUrl({ ...o, path: { importId: id } })\n )) as UrlImport;\n }\n if (current.status === 'done' && current.media) return current.media;\n const error = current.error ?? { statusCode: 500, msg: 'The import from a URL failed.' };\n throw new NadiaError(error.statusCode, { msg: error.msg }, error.msg);\n }\n\n /** The whole file in one multipart request: `POST /public/v1/upload`. */\n private uploadWhole(source: { blob: Blob; name: string }): Promise<UploadedMedia> {\n const form = new FormData();\n form.append('file', source.blob, source.name);\n // The generated serializer rebuilds a FormData from a plain object's\n // entries: handed this one, it found none and sent an empty form. It also\n // cannot carry a filename. So the finished form goes out as it is.\n return this.call((o) =>\n api.uploadFile({\n ...o,\n body: form as never,\n bodySerializer: (body: unknown) => body as FormData,\n })\n ) as Promise<UploadedMedia>;\n }\n\n /** Each part to `<uploadUrl>/<n>`, a few at a time, each retried. */\n private async sendParts(opened: UploadSession, blob: Blob, numbers: number[]) {\n const queue = [...numbers];\n const size = opened.partSize!;\n const worker = async () => {\n for (let n = queue.shift(); n !== undefined; n = queue.shift()) {\n const from = (n - 1) * size;\n await this.put(`${opened.uploadUrl}/${n}`, blob.slice(from, Math.min(from + size, blob.size)), {\n 'Content-Type': 'application/octet-stream',\n }, 200);\n }\n };\n await Promise.all(Array.from({ length: Math.min(PARALLEL_PARTS, queue.length) }, worker));\n }\n\n /** The single PUT of a server that takes no parts. */\n private sendWhole(opened: UploadSession, blob: Blob) {\n // fetch counts the length of a Blob itself (and refuses to be told it).\n const headers = Object.fromEntries(\n Object.entries(opened.headers ?? {}).filter(([k]) => k.toLowerCase() !== 'content-length')\n );\n return this.put(opened.uploadUrl, blob, headers, 201);\n }\n\n /**\n * A PUT of raw bytes, without the API key (the URL is the credential):\n * three tries on a network error, a 5xx or a 429, none on anything else.\n */\n private async put(url: string, body: Blob, headers: Record<string, string>, ok: number) {\n let last: NadiaError | undefined;\n for (let attempt = 1; attempt <= PART_TRIES; attempt++) {\n let response: Response | undefined;\n try {\n response = await this.fetchImpl(url, { method: 'PUT', headers, body });\n } catch (err) {\n last = new NadiaError(0, err, `The upload of ${url.replace(/\\/v2\\/[^/]+/, '/v2/…')} did not complete.`);\n }\n if (response) {\n if (response.status === ok || response.ok) {\n await response.body?.cancel();\n return;\n }\n const text = await response.text();\n let parsed: unknown = text;\n try {\n parsed = JSON.parse(text);\n } catch {\n /* not JSON: the text */\n }\n last = new NadiaError(response.status, parsed, messageOf(parsed) ?? `The upload answered ${response.status}`);\n if (!last.isTransient) throw last;\n }\n if (attempt < PART_TRIES) await sleep(attempt * 1000);\n }\n throw last;\n }\n\n /** List your connected channels. */\n integrations() {\n return this.call((o) => api.listChannels(o));\n }\n\n /** Delete a post and everything published with it. */\n deletePost(id: string) {\n return this.call((o) =>\n api.deletePost({ ...o, path: { id } })\n );\n }\n\n /* --------------------------------------------------------------- *\n * The rest of our surface, which upstream never had\n * --------------------------------------------------------------- */\n\n /** Check that the API key is valid. Throws `NadiaError` with status 401 if not. */\n async isConnected(): Promise<boolean> {\n await this.call((o) => api.checkConnection(o));\n return true;\n }\n\n /** Next free slot in a channel's schedule. */\n findSlot(integrationId: string) {\n return this.call((o) =>\n api.findSlot({\n ...o,\n path: { id: integrationId },\n })\n );\n }\n\n /** List your groups (brands). */\n groups() {\n return this.call((o) => api.listGroups(o));\n }\n\n /** Direct message conversations of a channel. */\n inbox(integrationId: string, limit?: number) {\n return this.call((o) =>\n api.listConversations({\n ...o,\n path: { integrationId },\n query: (limit ? { limit: String(limit) } : undefined) as never,\n })\n );\n }\n\n /* --------------------------------------------------------------- *\n * The content board: one card per video, from the idea to the\n * numbers after publication\n * --------------------------------------------------------------- */\n\n /**\n * The cards of the board, with the posts scheduled from each. Filters\n * combine: `stage`, `tag`, `externalId`; `fields` (`'id,title,stage'`)\n * leaves the scripts out.\n */\n contents(query?: ListContentsData['query']) {\n return this.call((o) => api.listContents({ ...o, query }));\n }\n\n /** One card. */\n content(id: string) {\n return this.call((o) => api.getContent({ ...o, path: { id } }));\n }\n\n /** Create a card — in IDEA unless `stage` says otherwise. */\n createContent(body: CreateContentDto) {\n return this.call((o) => api.createContent({ ...o, body }));\n }\n\n /**\n * Create or update the card holding `externalId` (your own id: a script\n * file path, a build id). Re-running an import never duplicates; an\n * existing card keeps its column.\n */\n upsertContent(body: UpsertContentDto) {\n return this.call((o) => api.upsertContent({ ...o, body }));\n }\n\n /** Update a card: only the fields sent change, `null` clears one. */\n updateContent(id: string, body: UpdateContentDto) {\n return this.call((o) => api.updateContent({ ...o, path: { id }, body }));\n }\n\n /** Move a card to another column (to the bottom unless `position` is given). */\n moveContent(id: string, stage: ContentStage, position?: number) {\n return this.call((o) =>\n api.moveContent({\n ...o,\n path: { id },\n body: position === undefined ? { stage } : { stage, position },\n })\n );\n }\n\n /**\n * Tie a card to a post scheduled from it — the `group` passed on\n * {@link Nadia.post}. A card holds several posts (a TikTok draft, an\n * Instagram post): each call adds one. The card moves to PUBLISHED when\n * the first of them goes live.\n */\n linkContentPost(id: string, postGroup: string) {\n return this.call((o) =>\n api.linkContentPost({ ...o, path: { id }, body: { postGroup } })\n );\n }\n\n /** Delete a card. */\n deleteContent(id: string) {\n return this.call((o) => api.deleteContent({ ...o, path: { id } }));\n }\n\n /** The numbers of the published cards, keyed by card id. */\n contentsPerformance() {\n return this.call((o) => api.getContentsPerformance(o));\n }\n\n /**\n * Runs any generated operation with the facade's guarantees — a non-2xx\n * throws a `NadiaError`, the transient ones are retried. The way to reach\n * what the facade does not sugar without giving those up.\n *\n * import { getChannelAnalytics } from '@usenadia/node';\n * await nadia.request((o) =>\n * getChannelAnalytics({ ...o, path: { integration: id }, query: { date: '7' } })\n * );\n */\n request<T>(\n operation: (options: { client: typeof generatedClient }) => Promise<\n GeneratedResult<T>\n >\n ): Promise<T> {\n return this.call(operation);\n }\n\n /**\n * The generated client, configured with your key. Use it for any of the\n * operations the facade does not wrap — nothing here is a dead end.\n *\n * import { getChannelAnalytics } from '@usenadia/node';\n * await getChannelAnalytics({ client: nadia.raw, path: {...} });\n */\n get raw() {\n return this.client;\n }\n}\n\nexport default Nadia;\n\n/* ----------------------------------------------------------------- *\n * Webhooks: check that a delivery comes from UseNadia\n * ----------------------------------------------------------------- */\n\n/**\n * What every webhook delivery carries (the JSON body). `data` depends on\n * `event` — `nadia.request(listWebhookEvents)` lists the events.\n */\nexport interface WebhookDelivery<T = unknown> {\n id: string;\n event: string;\n occurredAt: string;\n organizationId: string;\n data: T;\n}\n\nexport interface VerifyWebhookOptions {\n /** The secret returned once, when the webhook was created. */\n secret: string;\n /** The `X-Nadia-Signature` header: `sha256=<hex>`. */\n signature: string | null | undefined;\n /** The `X-Nadia-Timestamp` header, epoch seconds. */\n timestamp: string | number | null | undefined;\n /** The body exactly as received — not a re-serialized `JSON.parse`. */\n body: string | Uint8Array;\n /**\n * Reject deliveries whose timestamp is further than this from now, in\n * seconds (a replayed capture). Not checked when left out.\n */\n tolerance?: number;\n /** Current time in epoch milliseconds — for tests. Defaults to `Date.now()`. */\n now?: number;\n}\n\n/** Why {@link parseWebhook} refused a delivery. */\nexport class NadiaWebhookError extends Error {\n readonly reason: 'missing_header' | 'bad_signature' | 'stale' | 'bad_body';\n\n constructor(reason: NadiaWebhookError['reason'], message: string) {\n super(message);\n this.name = 'NadiaWebhookError';\n this.reason = reason;\n Object.setPrototypeOf(this, NadiaWebhookError.prototype);\n }\n}\n\ntype Check =\n | { ok: true }\n | { ok: false; reason: NadiaWebhookError['reason']; message: string };\n\nfunction checkSignature(o: VerifyWebhookOptions): Check {\n const { secret, signature, timestamp, body } = o;\n if (!signature || timestamp === null || timestamp === undefined || timestamp === '') {\n return { ok: false, reason: 'missing_header', message: 'X-Nadia-Signature or X-Nadia-Timestamp is missing.' };\n }\n const ts = String(timestamp);\n\n if (o.tolerance !== undefined) {\n const seconds = Number(ts);\n const now = (o.now ?? Date.now()) / 1000;\n if (!Number.isFinite(seconds) || Math.abs(now - seconds) > o.tolerance) {\n return { ok: false, reason: 'stale', message: `Timestamp outside the ${o.tolerance}s tolerance.` };\n }\n }\n\n // Signed string: `<timestamp>.<raw body>`, HMAC-SHA256 hex, `sha256=` prefix.\n const expected = Buffer.from(\n 'sha256=' + createHmac('sha256', secret).update(`${ts}.`).update(body).digest('hex')\n );\n const received = Buffer.from(signature);\n // timingSafeEqual throws on different lengths; the length itself is public.\n if (received.length !== expected.length || !timingSafeEqual(received, expected)) {\n return { ok: false, reason: 'bad_signature', message: 'Signature does not match.' };\n }\n return { ok: true };\n}\n\n/**\n * True when the delivery was signed with `secret`. Compared in constant time.\n * Pass the **raw** body: a parsed and re-serialized one will not match.\n */\nexport function verifyWebhookSignature(options: VerifyWebhookOptions): boolean {\n return checkSignature(options).ok;\n}\n\n/**\n * Verifies a delivery and returns it parsed — or throws `NadiaWebhookError`.\n * Unlike {@link verifyWebhookSignature}, the timestamp is checked by\n * default (300 s, the margin a retry needs); `tolerance: Infinity` turns it off.\n *\n * `headers` takes a Node `req.headers` object or a `Headers` instance.\n */\nexport function parseWebhook<T = unknown>(options: {\n secret: string;\n headers: Headers | Record<string, string | string[] | undefined>;\n body: string | Uint8Array;\n tolerance?: number;\n now?: number;\n}): WebhookDelivery<T> {\n const header = (name: string): string | undefined => {\n const h = options.headers;\n if (typeof (h as Headers).get === 'function') return (h as Headers).get(name) ?? undefined;\n const record = h as Record<string, string | string[] | undefined>;\n const key = Object.keys(record).find((k) => k.toLowerCase() === name.toLowerCase());\n const value = key === undefined ? undefined : record[key];\n return Array.isArray(value) ? value[0] : value;\n };\n\n const check = checkSignature({\n secret: options.secret,\n signature: header('X-Nadia-Signature'),\n timestamp: header('X-Nadia-Timestamp'),\n body: options.body,\n tolerance: options.tolerance ?? 300,\n now: options.now,\n });\n if (!check.ok) throw new NadiaWebhookError(check.reason, check.message);\n\n try {\n const text = typeof options.body === 'string' ? options.body : new TextDecoder().decode(options.body);\n return JSON.parse(text) as WebhookDelivery<T>;\n } catch {\n throw new NadiaWebhookError('bad_body', 'The body is not JSON.');\n }\n}\n\n/** Every generated operation and type, so nothing is out of reach. */\nexport * from './generated/sdk.gen';\nexport * from './generated/types.gen';\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerializer.gen';\n\nexport type QuerySerializer = (query: Record<string, unknown>) => string;\n\nexport type BodySerializer = (body: unknown) => unknown;\n\ntype QuerySerializerOptionsObject = {\n allowReserved?: boolean;\n array?: Partial<SerializerOptions<ArrayStyle>>;\n object?: Partial<SerializerOptions<ObjectStyle>>;\n};\n\nexport type QuerySerializerOptions = QuerySerializerOptionsObject & {\n /**\n * Per-parameter serialization overrides. When provided, these settings\n * override the global array/object settings for specific parameter names.\n */\n parameters?: Record<string, QuerySerializerOptionsObject>;\n};\n\nconst serializeFormDataPair = (data: FormData, key: string, value: unknown): void => {\n if (typeof value === 'string' || value instanceof Blob) {\n data.append(key, value);\n } else if (value instanceof Date) {\n data.append(key, value.toISOString());\n } else {\n data.append(key, JSON.stringify(value));\n }\n};\n\nconst serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value: unknown): void => {\n if (typeof value === 'string') {\n data.append(key, value);\n } else {\n data.append(key, JSON.stringify(value));\n }\n};\n\nexport const formDataBodySerializer = {\n bodySerializer: (body: unknown): FormData => {\n const data = new FormData();\n\n Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {\n if (value === undefined || value === null) {\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((v) => serializeFormDataPair(data, key, v));\n } else {\n serializeFormDataPair(data, key, value);\n }\n });\n\n return data;\n },\n};\n\nexport const jsonBodySerializer = {\n bodySerializer: (body: unknown): string =>\n JSON.stringify(body, (_key, value) => (typeof value === 'bigint' ? value.toString() : value)),\n};\n\nexport const urlSearchParamsBodySerializer = {\n bodySerializer: (body: unknown): string => {\n const data = new URLSearchParams();\n\n Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {\n if (value === undefined || value === null) {\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((v) => serializeUrlSearchParamsPair(data, key, v));\n } else {\n serializeUrlSearchParamsPair(data, key, value);\n }\n });\n\n return data.toString();\n },\n};\n","// This file is auto-generated by @hey-api/openapi-ts\n\ntype Slot = 'body' | 'headers' | 'path' | 'query';\n\nexport type Field =\n | {\n in: Exclude<Slot, 'body'>;\n /**\n * Field name. This is the name we want the user to see and use.\n */\n key: string;\n /**\n * Field mapped name. This is the name we want to use in the request.\n * If omitted, we use the same value as `key`.\n */\n map?: string;\n }\n | {\n in: Extract<Slot, 'body'>;\n /**\n * Key isn't required for bodies.\n */\n key?: string;\n map?: string;\n }\n | {\n /**\n * Field name. This is the name we want the user to see and use.\n */\n key: string;\n /**\n * Field mapped name. This is the name we want to use in the request.\n * If `in` is omitted, `map` aliases `key` to the transport layer.\n */\n map: Slot;\n };\n\nexport interface Fields {\n allowExtra?: Partial<Record<Slot, boolean>>;\n args?: ReadonlyArray<Field>;\n}\n\nexport type FieldsConfig = ReadonlyArray<Field | Fields>;\n\nconst extraPrefixesMap: Record<string, Slot> = {\n $body_: 'body',\n $headers_: 'headers',\n $path_: 'path',\n $query_: 'query',\n};\nconst extraPrefixes = Object.entries(extraPrefixesMap);\n\ntype KeyMap = Map<\n string,\n | {\n in: Slot;\n map?: string;\n }\n | {\n in?: never;\n map: Slot;\n }\n>;\n\nfunction buildKeyMap(fields: FieldsConfig, map?: KeyMap): KeyMap {\n if (!map) {\n map = new Map();\n }\n\n for (const config of fields) {\n if ('in' in config) {\n if (config.key) {\n map.set(config.key, {\n in: config.in,\n map: config.map,\n });\n }\n } else if ('key' in config) {\n map.set(config.key, {\n map: config.map,\n });\n } else if (config.args) {\n buildKeyMap(config.args, map);\n }\n }\n\n return map;\n}\n\ninterface Params {\n body?: unknown;\n headers: Record<string, unknown>;\n path: Record<string, unknown>;\n query: Record<string, unknown>;\n}\n\nfunction stripEmptySlots(params: Params): void {\n for (const [slot, value] of Object.entries(params)) {\n if (slot === 'body') continue;\n if (value && typeof value === 'object' && !Array.isArray(value) && !Object.keys(value).length) {\n delete params[slot as Slot];\n }\n }\n}\n\nexport function buildClientParams(args: ReadonlyArray<unknown>, fields: FieldsConfig): Params {\n const params: Params = {\n headers: Object.create(null),\n path: Object.create(null),\n query: Object.create(null),\n };\n\n const map = buildKeyMap(fields);\n\n function writeSlot(slot: Slot, key: string, value: unknown): void {\n let record = params[slot] as Record<string, unknown> | undefined;\n if (record === undefined) {\n record = Object.create(null) as Record<string, unknown>;\n params[slot] = record;\n }\n record[key] = value;\n }\n\n let config: FieldsConfig[number] | undefined;\n\n for (const [index, arg] of args.entries()) {\n if (fields[index]) {\n config = fields[index];\n }\n\n if (!config) {\n continue;\n }\n\n if ('in' in config) {\n if (config.key) {\n const field = map.get(config.key)!;\n const name = field.map || config.key;\n if (field.in) {\n writeSlot(field.in, name, arg);\n }\n } else {\n params.body = arg;\n }\n } else {\n for (const [key, value] of Object.entries(arg ?? {})) {\n const field = map.get(key);\n\n if (field) {\n if (field.in) {\n const name = field.map || key;\n writeSlot(field.in, name, value);\n } else {\n params[field.map] = value;\n }\n } else {\n const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix));\n\n if (extra) {\n const [prefix, slot] = extra;\n writeSlot(slot, key.slice(prefix.length), value);\n } else if ('allowExtra' in config && config.allowExtra) {\n for (const [slot, allowed] of Object.entries(config.allowExtra)) {\n if (allowed) {\n writeSlot(slot as Slot, key, value);\n break;\n }\n }\n }\n }\n }\n }\n }\n\n stripEmptySlots(params);\n\n return params;\n}\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { Config } from './types.gen';\n\nexport type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> &\n Pick<Config, 'method' | 'responseTransformer' | 'responseValidator'> & {\n /**\n * Fetch API implementation. You can use this option to provide a custom\n * fetch instance.\n *\n * @default globalThis.fetch\n */\n fetch?: typeof fetch;\n /**\n * Implementing clients can call request interceptors inside this hook.\n */\n onRequest?: (url: string, init: RequestInit) => Promise<Request>;\n /**\n * Callback invoked when a network or parsing error occurs during streaming.\n *\n * This option applies only if the endpoint returns a stream of events.\n *\n * @param error The error that occurred.\n */\n onSseError?: (error: unknown) => void;\n /**\n * Callback invoked when an event is streamed from the server.\n *\n * This option applies only if the endpoint returns a stream of events.\n *\n * @param event Event streamed from the server.\n * @returns Nothing (void).\n */\n onSseEvent?: (event: StreamEvent<TData>) => void;\n serializedBody?: RequestInit['body'];\n /**\n * Default retry delay in milliseconds.\n *\n * This option applies only if the endpoint returns a stream of events.\n *\n * @default 3000\n */\n sseDefaultRetryDelay?: number;\n /**\n * Maximum number of retry attempts before giving up.\n */\n sseMaxRetryAttempts?: number;\n /**\n * Maximum retry delay in milliseconds.\n *\n * Applies only when exponential backoff is used.\n *\n * This option applies only if the endpoint returns a stream of events.\n *\n * @default 30000\n */\n sseMaxRetryDelay?: number;\n /**\n * Optional sleep function for retry backoff.\n *\n * Defaults to using `setTimeout`.\n */\n sseSleepFn?: (ms: number) => Promise<void>;\n url: string;\n };\n\nexport interface StreamEvent<TData = unknown> {\n data: TData;\n event?: string;\n id?: string;\n retry?: number;\n}\n\nexport type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {\n stream: AsyncGenerator<\n TData extends Record<string, unknown> ? TData[keyof TData] : TData,\n TReturn,\n TNext\n >;\n};\n\nexport function createSseClient<TData = unknown>({\n onRequest,\n onSseError,\n onSseEvent,\n responseTransformer,\n responseValidator,\n sseDefaultRetryDelay,\n sseMaxRetryAttempts,\n sseMaxRetryDelay,\n sseSleepFn,\n url,\n ...options\n}: ServerSentEventsOptions): ServerSentEventsResult<TData> {\n let lastEventId: string | undefined;\n\n const sleep = sseSleepFn ?? ((ms: number) => new Promise((resolve) => setTimeout(resolve, ms)));\n\n const createStream = async function* () {\n let retryDelay: number = sseDefaultRetryDelay ?? 3000;\n let attempt = 0;\n const signal = options.signal ?? new AbortController().signal;\n\n while (true) {\n if (signal.aborted) break;\n\n attempt++;\n\n const headers =\n options.headers instanceof Headers\n ? options.headers\n : new Headers(options.headers as Record<string, string> | undefined);\n\n if (lastEventId !== undefined) {\n headers.set('Last-Event-ID', lastEventId);\n }\n\n try {\n const requestInit: RequestInit = {\n redirect: 'follow',\n ...options,\n body: options.serializedBody,\n headers,\n signal,\n };\n let request = new Request(url, requestInit);\n if (onRequest) {\n request = await onRequest(url, requestInit);\n }\n // fetch must be assigned here, otherwise it would throw the error:\n // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation\n const _fetch = options.fetch ?? globalThis.fetch;\n const response = await _fetch(request);\n\n if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`);\n\n if (!response.body) throw new Error('No body in SSE response');\n\n const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();\n\n let buffer = '';\n\n const abortHandler = () => {\n try {\n reader.cancel();\n } catch {\n // noop\n }\n };\n\n signal.addEventListener('abort', abortHandler);\n\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n buffer += value;\n buffer = buffer.replace(/\\r\\n?/g, '\\n'); // normalize line endings\n\n const chunks = buffer.split('\\n\\n');\n buffer = chunks.pop() ?? '';\n\n for (const chunk of chunks) {\n const lines = chunk.split('\\n');\n const dataLines: Array<string> = [];\n let eventName: string | undefined;\n\n for (const line of lines) {\n if (line.startsWith('data:')) {\n dataLines.push(line.replace(/^data:\\s*/, ''));\n } else if (line.startsWith('event:')) {\n eventName = line.replace(/^event:\\s*/, '');\n } else if (line.startsWith('id:')) {\n lastEventId = line.replace(/^id:\\s*/, '');\n } else if (line.startsWith('retry:')) {\n const parsed = Number.parseInt(line.replace(/^retry:\\s*/, ''), 10);\n if (!Number.isNaN(parsed)) {\n retryDelay = parsed;\n }\n }\n }\n\n let data: unknown;\n let parsedJson = false;\n\n if (dataLines.length) {\n const rawData = dataLines.join('\\n');\n try {\n data = JSON.parse(rawData);\n parsedJson = true;\n } catch {\n data = rawData;\n }\n }\n\n if (parsedJson) {\n if (responseValidator) {\n await responseValidator(data);\n }\n\n if (responseTransformer) {\n data = await responseTransformer(data);\n }\n }\n\n onSseEvent?.({\n data,\n event: eventName,\n id: lastEventId,\n retry: retryDelay,\n });\n\n if (dataLines.length) {\n yield data as any;\n }\n }\n }\n } finally {\n signal.removeEventListener('abort', abortHandler);\n reader.releaseLock();\n }\n\n break; // exit loop on normal completion\n } catch (error) {\n // connection failed or aborted; retry after delay\n onSseError?.(error);\n\n if (sseMaxRetryAttempts !== undefined && attempt >= sseMaxRetryAttempts) {\n break; // stop after firing error\n }\n\n // exponential backoff: double retry each attempt, cap at 30s\n const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 30000);\n await sleep(backoff);\n }\n }\n };\n\n const stream = createStream();\n\n return { stream };\n}\n","// This file is auto-generated by @hey-api/openapi-ts\n\ninterface SerializeOptions<T> extends SerializePrimitiveOptions, SerializerOptions<T> {}\n\ninterface SerializePrimitiveOptions {\n allowReserved?: boolean;\n name: string;\n}\n\nexport interface SerializerOptions<T> {\n /**\n * @default true\n */\n explode: boolean;\n style: T;\n}\n\nexport type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';\nexport type ArraySeparatorStyle = ArrayStyle | MatrixStyle;\ntype MatrixStyle = 'label' | 'matrix' | 'simple';\nexport type ObjectStyle = 'form' | 'deepObject';\ntype ObjectSeparatorStyle = ObjectStyle | MatrixStyle;\n\ninterface SerializePrimitiveParam extends SerializePrimitiveOptions {\n value: string;\n}\n\nexport const separatorArrayExplode = (style: ArraySeparatorStyle): '.' | ';' | ',' | '&' => {\n switch (style) {\n case 'label':\n return '.';\n case 'matrix':\n return ';';\n case 'simple':\n return ',';\n default:\n return '&';\n }\n};\n\nexport const separatorArrayNoExplode = (style: ArraySeparatorStyle): ',' | '|' | '%20' => {\n switch (style) {\n case 'form':\n return ',';\n case 'pipeDelimited':\n return '|';\n case 'spaceDelimited':\n return '%20';\n default:\n return ',';\n }\n};\n\nexport const separatorObjectExplode = (style: ObjectSeparatorStyle): '.' | ';' | ',' | '&' => {\n switch (style) {\n case 'label':\n return '.';\n case 'matrix':\n return ';';\n case 'simple':\n return ',';\n default:\n return '&';\n }\n};\n\nexport const serializeArrayParam = ({\n allowReserved,\n explode,\n name,\n style,\n value,\n}: SerializeOptions<ArraySeparatorStyle> & {\n value: unknown[];\n}): string => {\n if (!explode) {\n const joinedValues = (\n allowReserved ? value : value.map((v) => encodeURIComponent(v as string))\n ).join(separatorArrayNoExplode(style));\n switch (style) {\n case 'label':\n return `.${joinedValues}`;\n case 'matrix':\n return `;${name}=${joinedValues}`;\n case 'simple':\n return joinedValues;\n default:\n return `${name}=${joinedValues}`;\n }\n }\n\n const separator = separatorArrayExplode(style);\n const joinedValues = value\n .map((v) => {\n if (style === 'label' || style === 'simple') {\n return allowReserved ? v : encodeURIComponent(v as string);\n }\n\n return serializePrimitiveParam({\n allowReserved,\n name,\n value: v as string,\n });\n })\n .join(separator);\n return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues;\n};\n\nexport const serializePrimitiveParam = ({\n allowReserved,\n name,\n value,\n}: SerializePrimitiveParam): string => {\n if (value === undefined || value === null) {\n return '';\n }\n\n if (typeof value === 'object') {\n throw new Error(\n 'Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.',\n );\n }\n\n return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;\n};\n\nexport const serializeObjectParam = ({\n allowReserved,\n explode,\n name,\n style,\n value,\n valueOnly,\n}: SerializeOptions<ObjectSeparatorStyle> & {\n value: Record<string, unknown> | Date;\n valueOnly?: boolean;\n}): string => {\n if (value instanceof Date) {\n return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;\n }\n\n if (style !== 'deepObject' && !explode) {\n let values: string[] = [];\n Object.entries(value).forEach(([key, v]) => {\n values = [...values, key, allowReserved ? (v as string) : encodeURIComponent(v as string)];\n });\n const joinedValues = values.join(',');\n switch (style) {\n case 'form':\n return `${name}=${joinedValues}`;\n case 'label':\n return `.${joinedValues}`;\n case 'matrix':\n return `;${name}=${joinedValues}`;\n default:\n return joinedValues;\n }\n }\n\n const separator = separatorObjectExplode(style);\n const joinedValues = Object.entries(value)\n .map(([key, v]) =>\n serializePrimitiveParam({\n allowReserved,\n name: style === 'deepObject' ? `${name}[${key}]` : key,\n value: v as string,\n }),\n )\n .join(separator);\n return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues;\n};\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { BodySerializer, QuerySerializer } from './bodySerializer.gen';\nimport {\n type ArraySeparatorStyle,\n serializeArrayParam,\n serializeObjectParam,\n serializePrimitiveParam,\n} from './pathSerializer.gen';\n\nexport interface PathSerializer {\n path: Record<string, unknown>;\n url: string;\n}\n\nexport const PATH_PARAM_RE: RegExp = /\\{[^{}]+\\}/g;\n\nexport const defaultPathSerializer = ({ path, url: _url }: PathSerializer): string => {\n let url = _url;\n const matches = _url.match(PATH_PARAM_RE);\n if (matches) {\n for (const match of matches) {\n let explode = false;\n let name = match.substring(1, match.length - 1);\n let style: ArraySeparatorStyle = 'simple';\n\n if (name.endsWith('*')) {\n explode = true;\n name = name.substring(0, name.length - 1);\n }\n\n if (name.startsWith('.')) {\n name = name.substring(1);\n style = 'label';\n } else if (name.startsWith(';')) {\n name = name.substring(1);\n style = 'matrix';\n }\n\n const value = path[name];\n\n if (value === undefined || value === null) {\n continue;\n }\n\n if (Array.isArray(value)) {\n url = url.replace(match, serializeArrayParam({ explode, name, style, value }));\n continue;\n }\n\n if (typeof value === 'object') {\n url = url.replace(\n match,\n serializeObjectParam({\n explode,\n name,\n style,\n value: value as Record<string, unknown>,\n valueOnly: true,\n }),\n );\n continue;\n }\n\n if (style === 'matrix') {\n url = url.replace(\n match,\n `;${serializePrimitiveParam({\n name,\n value: value as string,\n })}`,\n );\n continue;\n }\n\n const replaceValue = encodeURIComponent(\n style === 'label' ? `.${value as string}` : (value as string),\n );\n url = url.replace(match, replaceValue);\n }\n }\n return url;\n};\n\nexport const getUrl = ({\n baseUrl,\n path,\n query,\n querySerializer,\n url: _url,\n}: {\n baseUrl?: string;\n path?: Record<string, unknown>;\n query?: Record<string, unknown>;\n querySerializer: QuerySerializer;\n url: string;\n}): string => {\n const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;\n let url = (baseUrl ?? '') + pathUrl;\n if (path) {\n url = defaultPathSerializer({ path, url });\n }\n let search = query ? querySerializer(query) : '';\n if (search.startsWith('?')) {\n search = search.substring(1);\n }\n if (search) {\n url += `?${search}`;\n }\n return url;\n};\n\nexport function getValidRequestBody(options: {\n body?: unknown;\n bodySerializer?: BodySerializer | null;\n serializedBody?: unknown;\n}): unknown {\n const hasBody = options.body !== undefined;\n const isSerializedBody = hasBody && options.bodySerializer;\n\n if (isSerializedBody) {\n if ('serializedBody' in options) {\n const hasSerializedBody =\n options.serializedBody !== undefined && options.serializedBody !== '';\n\n return hasSerializedBody ? options.serializedBody : null;\n }\n\n // not all clients implement a serializedBody property (i.e., client-axios)\n return options.body !== '' ? options.body : null;\n }\n\n // plain/text body\n if (hasBody) {\n return options.body;\n }\n\n // no body was provided\n return undefined;\n}\n","// This file is auto-generated by @hey-api/openapi-ts\n\nexport type AuthToken = string | undefined;\n\nexport interface Auth {\n /**\n * Which part of the request do we use to send the auth?\n *\n * @default 'header'\n */\n in?: 'header' | 'query' | 'cookie';\n /**\n * A unique identifier for the security scheme.\n *\n * Defined only when there are multiple security schemes whose `Auth`\n * shape would otherwise be identical.\n */\n key?: string;\n /**\n * Header or query parameter name.\n *\n * @default 'Authorization'\n */\n name?: string;\n scheme?: 'basic' | 'bearer';\n type: 'apiKey' | 'http';\n}\n\nexport const getAuthToken = async (\n auth: Auth,\n callback: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken,\n): Promise<string | undefined> => {\n const token = typeof callback === 'function' ? await callback(auth) : callback;\n\n if (!token) {\n return;\n }\n\n if (auth.scheme === 'bearer') {\n return `Bearer ${token}`;\n }\n\n if (auth.scheme === 'basic') {\n return `Basic ${btoa(token)}`;\n }\n\n return token;\n};\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport { getAuthToken } from '../core/auth.gen';\nimport type { QuerySerializerOptions } from '../core/bodySerializer.gen';\nimport { jsonBodySerializer } from '../core/bodySerializer.gen';\nimport {\n serializeArrayParam,\n serializeObjectParam,\n serializePrimitiveParam,\n} from '../core/pathSerializer.gen';\nimport { getUrl } from '../core/utils.gen';\nimport type { Client, ClientOptions, Config, RequestOptions } from './types.gen';\n\nexport const createQuerySerializer = <T = unknown>({\n parameters = {},\n ...args\n}: QuerySerializerOptions = {}): ((queryParams: T) => string) => {\n const querySerializer = (queryParams: T): string => {\n const search: string[] = [];\n if (queryParams && typeof queryParams === 'object') {\n for (const name in queryParams) {\n const value = queryParams[name];\n\n if (value === undefined || value === null) {\n continue;\n }\n\n const options = parameters[name] || args;\n\n if (Array.isArray(value)) {\n const serializedArray = serializeArrayParam({\n allowReserved: options.allowReserved,\n explode: true,\n name,\n style: 'form',\n value,\n ...options.array,\n });\n if (serializedArray) search.push(serializedArray);\n } else if (typeof value === 'object') {\n const serializedObject = serializeObjectParam({\n allowReserved: options.allowReserved,\n explode: true,\n name,\n style: 'deepObject',\n value: value as Record<string, unknown>,\n ...options.object,\n });\n if (serializedObject) search.push(serializedObject);\n } else {\n const serializedPrimitive = serializePrimitiveParam({\n allowReserved: options.allowReserved,\n name,\n value: value as string,\n });\n if (serializedPrimitive) search.push(serializedPrimitive);\n }\n }\n }\n return search.join('&');\n };\n return querySerializer;\n};\n\n/**\n * Infers parseAs value from provided Content-Type header.\n */\nexport const getParseAs = (contentType: string | null): Exclude<Config['parseAs'], 'auto'> => {\n if (!contentType) {\n // If no Content-Type header is provided, the best we can do is return the raw response body,\n // which is effectively the same as the 'stream' option.\n return 'stream';\n }\n\n const cleanContent = contentType.split(';')[0]?.trim();\n\n if (!cleanContent) {\n return;\n }\n\n if (cleanContent.startsWith('application/json') || cleanContent.endsWith('+json')) {\n return 'json';\n }\n\n if (cleanContent === 'multipart/form-data') {\n return 'formData';\n }\n\n if (\n ['application/', 'audio/', 'image/', 'video/'].some((type) => cleanContent.startsWith(type))\n ) {\n return 'blob';\n }\n\n if (cleanContent.startsWith('text/')) {\n return 'text';\n }\n\n return;\n};\n\nconst checkForExistence = (\n options: Pick<RequestOptions, 'auth' | 'query'> & {\n headers: Headers;\n },\n name?: string,\n): boolean => {\n if (!name) {\n return false;\n }\n if (\n options.headers.has(name) ||\n options.query?.[name] ||\n options.headers.get('Cookie')?.includes(`${name}=`)\n ) {\n return true;\n }\n return false;\n};\n\nexport async function setAuthParams(\n options: Pick<RequestOptions, 'auth' | 'query' | 'security'> & {\n headers: Headers;\n },\n): Promise<void> {\n for (const auth of options.security ?? []) {\n if (checkForExistence(options, auth.name)) {\n continue;\n }\n\n const token = await getAuthToken(auth, options.auth);\n\n if (!token) {\n continue;\n }\n\n const name = auth.name ?? 'Authorization';\n\n switch (auth.in) {\n case 'query':\n if (!options.query) {\n options.query = {};\n }\n options.query[name] = token;\n break;\n case 'cookie':\n options.headers.append('Cookie', `${name}=${token}`);\n break;\n case 'header':\n default:\n options.headers.set(name, token);\n break;\n }\n }\n}\n\nexport const buildUrl: Client['buildUrl'] = (options) =>\n getUrl({\n baseUrl: options.baseUrl as string,\n path: options.path,\n query: options.query,\n querySerializer:\n typeof options.querySerializer === 'function'\n ? options.querySerializer\n : createQuerySerializer(options.querySerializer),\n url: options.url,\n });\n\nexport const mergeConfigs = (a: Config, b: Config): Config => {\n const config = { ...a, ...b };\n if (config.baseUrl?.endsWith('/')) {\n config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1);\n }\n config.headers = mergeHeaders(a.headers, b.headers);\n return config;\n};\n\nconst headersEntries = (headers: Headers): Array<[string, string]> => {\n const entries: Array<[string, string]> = [];\n headers.forEach((value, key) => {\n entries.push([key, value]);\n });\n return entries;\n};\n\nexport const mergeHeaders = (\n ...headers: Array<Required<Config>['headers'] | undefined>\n): Headers => {\n const mergedHeaders = new Headers();\n for (const header of headers) {\n if (!header) {\n continue;\n }\n\n const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);\n\n for (const [key, value] of iterator) {\n if (value === null) {\n mergedHeaders.delete(key);\n } else if (Array.isArray(value)) {\n for (const v of value) {\n mergedHeaders.append(key, v as string);\n }\n } else if (value !== undefined) {\n // assume object headers are meant to be JSON stringified, i.e., their\n // content value in OpenAPI specification is 'application/json'\n mergedHeaders.set(\n key,\n typeof value === 'object' ? JSON.stringify(value) : (value as string),\n );\n }\n }\n }\n return mergedHeaders;\n};\n\ntype ErrInterceptor<Err, Res, Req, Options> = (\n error: Err,\n /** response may be undefined due to a network error where no response object is produced */\n response: Res | undefined,\n /** request may be undefined, because error may be from building the request object itself */\n request: Req | undefined,\n options: Options,\n) => Err | Promise<Err>;\n\ntype ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;\n\ntype ResInterceptor<Res, Req, Options> = (\n response: Res,\n request: Req,\n options: Options,\n) => Res | Promise<Res>;\n\nclass Interceptors<Interceptor> {\n fns: Array<Interceptor | null> = [];\n\n clear(): void {\n this.fns = [];\n }\n\n eject(id: number | Interceptor): void {\n const index = this.getInterceptorIndex(id);\n if (this.fns[index]) {\n this.fns[index] = null;\n }\n }\n\n exists(id: number | Interceptor): boolean {\n const index = this.getInterceptorIndex(id);\n return Boolean(this.fns[index]);\n }\n\n getInterceptorIndex(id: number | Interceptor): number {\n if (typeof id === 'number') {\n return this.fns[id] ? id : -1;\n }\n return this.fns.indexOf(id);\n }\n\n update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false {\n const index = this.getInterceptorIndex(id);\n if (this.fns[index]) {\n this.fns[index] = fn;\n return id;\n }\n return false;\n }\n\n use(fn: Interceptor): number {\n this.fns.push(fn);\n return this.fns.length - 1;\n }\n}\n\nexport interface Middleware<Req, Res, Err, Options> {\n error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;\n request: Interceptors<ReqInterceptor<Req, Options>>;\n response: Interceptors<ResInterceptor<Res, Req, Options>>;\n}\n\nexport const createInterceptors = <Req, Res, Err, Options>(): Middleware<\n Req,\n Res,\n Err,\n Options\n> => ({\n error: new Interceptors<ErrInterceptor<Err, Res, Req, Options>>(),\n request: new Interceptors<ReqInterceptor<Req, Options>>(),\n response: new Interceptors<ResInterceptor<Res, Req, Options>>(),\n});\n\nconst defaultQuerySerializer = createQuerySerializer({\n allowReserved: false,\n array: {\n explode: true,\n style: 'form',\n },\n object: {\n explode: true,\n style: 'deepObject',\n },\n});\n\nconst defaultHeaders = {\n 'Content-Type': 'application/json',\n};\n\nexport const createConfig = <T extends ClientOptions = ClientOptions>(\n override: Config<Omit<ClientOptions, keyof T> & T> = {},\n): Config<Omit<ClientOptions, keyof T> & T> => ({\n ...jsonBodySerializer,\n headers: defaultHeaders,\n parseAs: 'auto',\n querySerializer: defaultQuerySerializer,\n ...override,\n});\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport { createSseClient } from '../core/serverSentEvents.gen';\nimport type { HttpMethod } from '../core/types.gen';\nimport { getValidRequestBody } from '../core/utils.gen';\nimport type { Client, Config, RequestOptions, ResolvedRequestOptions } from './types.gen';\nimport {\n buildUrl,\n createConfig,\n createInterceptors,\n getParseAs,\n mergeConfigs,\n mergeHeaders,\n setAuthParams,\n} from './utils.gen';\n\ntype ReqInit = Omit<RequestInit, 'body' | 'headers'> & {\n body?: any;\n headers: ReturnType<typeof mergeHeaders>;\n};\n\nexport const createClient = (config: Config = {}): Client => {\n let _config = mergeConfigs(createConfig(), config);\n\n const getConfig = (): Config => ({ ..._config });\n\n const setConfig = (config: Config): Config => {\n _config = mergeConfigs(_config, config);\n return getConfig();\n };\n\n const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>();\n\n const beforeRequest = async <\n TData = unknown,\n TResponseStyle extends 'data' | 'fields' = 'fields',\n ThrowOnError extends boolean = boolean,\n Url extends string = string,\n >(\n options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>,\n ) => {\n const opts = {\n ..._config,\n ...options,\n fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,\n headers: mergeHeaders(_config.headers, options.headers),\n serializedBody: undefined as string | undefined,\n };\n\n if (opts.security) {\n await setAuthParams(opts);\n }\n\n if (opts.requestValidator) {\n await opts.requestValidator(opts);\n }\n\n if (opts.body !== undefined && opts.bodySerializer) {\n opts.serializedBody = opts.bodySerializer(opts.body) as string | undefined;\n }\n\n // remove Content-Type header if body is empty to avoid sending invalid requests\n if (opts.body === undefined || opts.serializedBody === '') {\n opts.headers.delete('Content-Type');\n }\n\n const resolvedOpts = opts as typeof opts &\n ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>;\n const url = buildUrl(resolvedOpts);\n\n return { opts: resolvedOpts, url };\n };\n\n const request: Client['request'] = async (options) => {\n const throwOnError = options.throwOnError ?? _config.throwOnError;\n const responseStyle = options.responseStyle ?? _config.responseStyle;\n\n let request: Request | undefined;\n let response: Response | undefined;\n\n try {\n const { opts, url } = await beforeRequest(options);\n const requestInit: ReqInit = {\n redirect: 'follow',\n ...opts,\n body: getValidRequestBody(opts),\n };\n\n request = new Request(url, requestInit);\n\n for (const fn of interceptors.request.fns) {\n if (fn) {\n request = await fn(request, opts);\n }\n }\n\n // fetch must be assigned here, otherwise it would throw the error:\n // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation\n const _fetch = opts.fetch!;\n\n response = await _fetch(request);\n\n for (const fn of interceptors.response.fns) {\n if (fn) {\n response = await fn(response, request, opts);\n }\n }\n\n const result = {\n request,\n response,\n };\n\n if (response.ok) {\n const parseAs =\n (opts.parseAs === 'auto'\n ? getParseAs(response.headers.get('Content-Type'))\n : opts.parseAs) ?? 'json';\n\n if (response.status === 204 || response.headers.get('Content-Length') === '0') {\n let emptyData: any;\n switch (parseAs) {\n case 'arrayBuffer':\n case 'blob':\n case 'text':\n emptyData = await response[parseAs]();\n break;\n case 'formData':\n emptyData = new FormData();\n break;\n case 'stream':\n emptyData = response.body;\n break;\n case 'json':\n default:\n emptyData = {};\n break;\n }\n return opts.responseStyle === 'data'\n ? emptyData\n : {\n data: emptyData,\n ...result,\n };\n }\n\n let data: any;\n switch (parseAs) {\n case 'arrayBuffer':\n case 'blob':\n case 'formData':\n case 'text':\n data = await response[parseAs]();\n break;\n case 'json': {\n // Some servers return 200 with no Content-Length and empty body.\n // response.json() would throw; read as text and parse if non-empty.\n const text = await response.text();\n data = text ? JSON.parse(text) : {};\n break;\n }\n case 'stream':\n return opts.responseStyle === 'data'\n ? response.body\n : {\n data: response.body,\n ...result,\n };\n }\n\n if (parseAs === 'json') {\n if (opts.responseValidator) {\n await opts.responseValidator(data);\n }\n\n if (opts.responseTransformer) {\n data = await opts.responseTransformer(data);\n }\n }\n\n return opts.responseStyle === 'data'\n ? data\n : {\n data,\n ...result,\n };\n }\n\n const textError = await response.text();\n let jsonError: unknown;\n\n try {\n jsonError = JSON.parse(textError);\n } catch {\n // noop\n }\n\n throw jsonError ?? textError;\n } catch (error) {\n let finalError = error;\n\n for (const fn of interceptors.error.fns) {\n if (fn) {\n finalError = await fn(finalError, response, request, options as ResolvedRequestOptions);\n }\n }\n\n finalError = finalError || {};\n\n if (throwOnError) {\n throw finalError;\n }\n\n // TODO: we probably want to return error and improve types\n return responseStyle === 'data'\n ? undefined\n : {\n error: finalError,\n request,\n response,\n };\n }\n };\n\n const makeMethodFn = (method: Uppercase<HttpMethod>) => (options: RequestOptions) =>\n request({ ...options, method });\n\n const makeSseFn = (method: Uppercase<HttpMethod>) => async (options: RequestOptions) => {\n const { opts, url } = await beforeRequest(options);\n return createSseClient({\n ...opts,\n body: opts.body as BodyInit | null | undefined,\n method,\n onRequest: async (url, init) => {\n let request = new Request(url, init);\n for (const fn of interceptors.request.fns) {\n if (fn) {\n request = await fn(request, opts);\n }\n }\n return request;\n },\n serializedBody: getValidRequestBody(opts) as BodyInit | null | undefined,\n url,\n });\n };\n\n const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options });\n\n return {\n buildUrl: _buildUrl,\n connect: makeMethodFn('CONNECT'),\n delete: makeMethodFn('DELETE'),\n get: makeMethodFn('GET'),\n getConfig,\n head: makeMethodFn('HEAD'),\n interceptors,\n options: makeMethodFn('OPTIONS'),\n patch: makeMethodFn('PATCH'),\n post: makeMethodFn('POST'),\n put: makeMethodFn('PUT'),\n request,\n setConfig,\n sse: {\n connect: makeSseFn('CONNECT'),\n delete: makeSseFn('DELETE'),\n get: makeSseFn('GET'),\n head: makeSseFn('HEAD'),\n options: makeSseFn('OPTIONS'),\n patch: makeSseFn('PATCH'),\n post: makeSseFn('POST'),\n put: makeSseFn('PUT'),\n trace: makeSseFn('TRACE'),\n },\n trace: makeMethodFn('TRACE'),\n } as Client;\n};\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport { type Client, type ClientOptions, type Config, createClient, createConfig } from './client';\nimport type { ClientOptions as ClientOptions2 } from './types.gen';\n\n/**\n * The `createClientConfig()` function will be called on client initialization\n * and the returned object will become the client's initial configuration.\n *\n * You may want to initialize your client this way instead of calling\n * `setConfig()`. This is useful for example if you're using Next.js\n * to ensure your client always has the correct values.\n */\nexport type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;\n\nexport const client: Client = createClient(createConfig<ClientOptions2>({ baseUrl: 'https://app.usenadia.com/api' }));\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport { type Client, type ClientMeta, formDataBodySerializer, type Options as Options2, type RequestResult, type TDataShape } from './client';\nimport { client } from './client.gen';\nimport type { CatchUpAutomationPoseData, CatchUpAutomationPoseErrors, CatchUpAutomationPoseResponses, ChangePostStatusData, ChangePostStatusErrors, ChangePostStatusResponses, CheckConnectionData, CheckConnectionErrors, CheckConnectionResponses, ConfirmUploadData, ConfirmUploadErrors, ConfirmUploadResponses, CreateAutomationFlowData, CreateAutomationFlowErrors, CreateAutomationFlowResponses, CreateContentData, CreateContentErrors, CreateContentFromLinkData, CreateContentFromLinkErrors, CreateContentFromLinkResponses, CreateContentResponses, CreatePostData, CreatePostErrors, CreatePostResponses, CreateUploadData, CreateUploadErrors, CreateUploadResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, CreateWorkspaceData, CreateWorkspaceErrors, CreateWorkspaceResponses, DeleteAutomationFlowData, DeleteAutomationFlowErrors, DeleteAutomationFlowResponses, DeleteAutomationPoseData, DeleteAutomationPoseErrors, DeleteAutomationPoseResponses, DeleteChannelData, DeleteChannelErrors, DeleteChannelResponses, DeleteCommentData, DeleteCommentErrors, DeleteCommentResponses, DeleteContentData, DeleteContentErrors, DeleteContentResponses, DeletePostData, DeletePostErrors, DeletePostGroupData, DeletePostGroupErrors, DeletePostGroupResponses, DeletePostResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookResponses, DeleteWorkspaceData, DeleteWorkspaceErrors, DeleteWorkspaceResponses, FindSlotData, FindSlotErrors, FindSlotResponses, GetAccountHistoryData, GetAccountHistoryErrors, GetAccountHistoryResponses, GetAutomationFlowData, GetAutomationFlowErrors, GetAutomationFlowResponses, GetAutomationPoseData, GetAutomationPoseErrors, GetAutomationPoseResponses, GetChannelAnalyticsData, GetChannelAnalyticsErrors, GetChannelAnalyticsResponses, GetChannelSettingsData, GetChannelSettingsErrors, GetChannelSettingsResponses, GetContentData, GetContentErrors, GetContentResponses, GetContentsPerformanceData, GetContentsPerformanceErrors, GetContentsPerformanceResponses, GetConversationData, GetConversationErrors, GetConversationResponses, GetHookFormsData, GetHookFormsErrors, GetHookFormsResponses, GetMusicTrackData, GetMusicTrackErrors, GetMusicTrackResponses, GetPostAnalyticsData, GetPostAnalyticsErrors, GetPostAnalyticsResponses, GetPostAutomationData, GetPostAutomationErrors, GetPostAutomationResponses, GetPostData, GetPostErrors, GetPostingTimesData, GetPostingTimesErrors, GetPostingTimesResponses, GetPostResponses, GetSubscriptionData, GetSubscriptionErrors, GetSubscriptionResponses, GetUploadFromUrlData, GetUploadFromUrlErrors, GetUploadFromUrlResponses, GetVideoHistoryData, GetVideoHistoryErrors, GetVideoHistoryResponses, GetViewsPerDayData, GetViewsPerDayErrors, GetViewsPerDayResponses, GetWebhookData, GetWebhookErrors, GetWebhookResponses, HideCommentData, HideCommentErrors, HideCommentResponses, ImportMusicData, ImportMusicErrors, ImportMusicResponses, LinkContentPostData, LinkContentPostErrors, LinkContentPostResponses, ListAutomationFlowPosesData, ListAutomationFlowPosesErrors, ListAutomationFlowPosesResponses, ListAutomationFlowsData, ListAutomationFlowsErrors, ListAutomationFlowsResponses, ListAutomationPoseRunsData, ListAutomationPoseRunsErrors, ListAutomationPoseRunsResponses, ListChannelAutomationPosesData, ListChannelAutomationPosesErrors, ListChannelAutomationPosesResponses, ListChannelMediaData, ListChannelMediaErrors, ListChannelMediaResponses, ListChannelsData, ListChannelsErrors, ListChannelsResponses, ListChannelStoriesData, ListChannelStoriesErrors, ListChannelStoriesResponses, ListContentsData, ListContentsErrors, ListContentsResponses, ListConversationsData, ListConversationsErrors, ListConversationsResponses, ListGroupsData, ListGroupsErrors, ListGroupsResponses, ListHookFamiliesData, ListHookFamiliesErrors, ListHookFamiliesResponses, ListMediaCommentsData, ListMediaCommentsErrors, ListMediaCommentsResponses, ListMissingMediaData, ListMissingMediaErrors, ListMissingMediaResponses, ListMusicData, ListMusicErrors, ListMusicPillarsData, ListMusicPillarsErrors, ListMusicPillarsResponses, ListMusicResponses, ListNotificationsData, ListNotificationsErrors, ListNotificationsResponses, ListPostsData, ListPostsErrors, ListPostsResponses, ListVideoPerformanceData, ListVideoPerformanceErrors, ListVideoPerformanceResponses, ListWebhookEventsData, ListWebhookEventsErrors, ListWebhookEventsResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, ListWorkspacesData, ListWorkspacesErrors, ListWorkspacesResponses, MoveContentData, MoveContentErrors, MoveContentResponses, PollAutomationPoseData, PollAutomationPoseErrors, PollAutomationPoseResponses, PollInboxData, PollInboxErrors, PollInboxResponses, PoseAutomationFlowData, PoseAutomationFlowErrors, PoseAutomationFlowResponses, PreviewAutomationEmailData, PreviewAutomationEmailErrors, PreviewAutomationEmailResponses, PreviewAutomationPoseCatchUpData, PreviewAutomationPoseCatchUpErrors, PreviewAutomationPoseCatchUpResponses, RemovePostAutomationData, RemovePostAutomationErrors, RemovePostAutomationResponses, ReplayAutomationPoseData, ReplayAutomationPoseErrors, ReplayAutomationPoseResponses, ReplyToCommentData, ReplyToCommentErrors, ReplyToCommentResponses, RunChannelToolData, RunChannelToolErrors, RunChannelToolResponses, SearchHooksData, SearchHooksErrors, SearchHooksResponses, SendAutomationTestEmailData, SendAutomationTestEmailErrors, SendAutomationTestEmailResponses, SendDirectMessageData, SendDirectMessageErrors, SendDirectMessageResponses, SetAutomationFlowStatusData, SetAutomationFlowStatusErrors, SetAutomationFlowStatusResponses, SetContentWorkspacesData, SetContentWorkspacesErrors, SetContentWorkspacesResponses, SetMediaWorkspacesData, SetMediaWorkspacesErrors, SetMediaWorkspacesResponses, SetPostAutomationData, SetPostAutomationErrors, SetPostAutomationResponses, SetPostCoverData, SetPostCoverErrors, SetPostCoverResponses, SetPostingTimesData, SetPostingTimesErrors, SetPostingTimesResponses, SetPostPublicationData, SetPostPublicationErrors, SetPostPublicationResponses, SetPostReleaseIdData, SetPostReleaseIdErrors, SetPostReleaseIdResponses, StartChannelConnectionData, StartChannelConnectionErrors, StartChannelConnectionResponses, SubscribeInboxWebhookData, SubscribeInboxWebhookErrors, SubscribeInboxWebhookResponses, TestWebhookData, TestWebhookErrors, TestWebhookResponses, UpdateAutomationFlowData, UpdateAutomationFlowErrors, UpdateAutomationFlowResponses, UpdateAutomationPoseData, UpdateAutomationPoseErrors, UpdateAutomationPoseResponses, UpdateContentData, UpdateContentErrors, UpdateContentResponses, UpdateWorkspaceData, UpdateWorkspaceErrors, UpdateWorkspaceResponses, UploadFileData, UploadFileErrors, UploadFileResponses, UploadFromUrlData, UploadFromUrlErrors, UploadFromUrlResponses, UploadMusicFileData, UploadMusicFileErrors, UploadMusicFileResponses, UpsertContentData, UpsertContentErrors, UpsertContentResponses } from './types.gen';\n\nexport type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {\n /**\n * You can provide a client instance returned by `createClient()` instead of\n * individual options. This might be also useful if you want to implement a\n * custom client.\n */\n client?: Client;\n /**\n * You can pass arbitrary values through the `meta` object. This can be\n * used to access values that aren't defined as part of the SDK function.\n */\n meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;\n};\n\n/**\n * Upload a file and get a URL usable in a post\n *\n * The whole file in one request: an MP4 up to 25 MB, an image up to 10 MB (a HEIC or HEIF photo is converted to JPEG). A MOV or an M4V is refused (`415`): convert it to MP4 first. A larger MP4 goes in parts (`POST /public/v1/uploads`).\n */\nexport const uploadFile = <ThrowOnError extends boolean = false>(options: Options<UploadFileData, ThrowOnError>): RequestResult<UploadFileResponses, UploadFileErrors, ThrowOnError> => (options.client ?? client).post<UploadFileResponses, UploadFileErrors, ThrowOnError>({\n ...formDataBodySerializer,\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/upload',\n ...options,\n headers: {\n 'Content-Type': null,\n ...options.headers\n }\n});\n\n/**\n * Import a file from a URL into your media library\n *\n * Download a public HTTPS file into your media library. When the import is done within 25 seconds, the answer is `201` and the media, as always. A longer import (a big video, a slow host) answers `202` with the import (`id`, `status: \"running\"`): it goes on without the connection, and `GET /public/v1/upload-from-url/{importId}` reads it again until `status` is `done` (the `media`) or `failed` (the `error` the call would have answered). The same URL sent again while it runs, or within ten minutes after it succeeded, answers the same import: one download, one media. The MCP tool `uploadFromUrlTool` waits for the end itself.\n */\nexport const uploadFromUrl = <ThrowOnError extends boolean = false>(options: Options<UploadFromUrlData, ThrowOnError>): RequestResult<UploadFromUrlResponses, UploadFromUrlErrors, ThrowOnError> => (options.client ?? client).post<UploadFromUrlResponses, UploadFromUrlErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/upload-from-url',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Read an import from a URL\n *\n * Read again an import from a URL answered `202` by `POST /public/v1/upload-from-url`: `running` (read again in a few seconds), `done` with its `media`, or `failed` with its `error` (`statusCode` and `msg`, the answer the call would have given: send the URL again to retry). An import is kept a day.\n */\nexport const getUploadFromUrl = <ThrowOnError extends boolean = false>(options: Options<GetUploadFromUrlData, ThrowOnError>): RequestResult<GetUploadFromUrlResponses, GetUploadFromUrlErrors, ThrowOnError> => (options.client ?? client).get<GetUploadFromUrlResponses, GetUploadFromUrlErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/upload-from-url/{importId}',\n ...options\n});\n\n/**\n * Open an upload of a file from your disk\n *\n * Open an upload of a file from your disk, then send its bytes where the answer says and confirm it (`POST /public/v1/uploads/{uploadId}/confirm`). The bytes never go through the API: on UseNadia's cloud they go in parts of 20 MB straight to the storage (`partSize` and `parts` in the answer: each part a `PUT` of its raw bytes to `<uploadUrl>/<n>`, `n` from 1 to `parts`, with its exact `Content-Length`; a part cut by the network is sent again, a part sent twice changes nothing; the upload lives 24 hours). A server that does not take parts (self-hosted) answers a single `PUT` of the whole file to `uploadUrl`, with the `headers` given, within 15 minutes. `curl` is a shell command that does the sending (macOS or Linux). The same as the MCP tool `createUploadUrl`. Accepted types: MP4, JPEG, PNG, WebP, GIF; 500 MB at most by default.\n */\nexport const createUpload = <ThrowOnError extends boolean = false>(options: Options<CreateUploadData, ThrowOnError>): RequestResult<CreateUploadResponses, CreateUploadErrors, ThrowOnError> => (options.client ?? client).post<CreateUploadResponses, CreateUploadErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/uploads',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Finish an upload and add the file to the media library\n *\n * Finish an upload opened by `POST /public/v1/uploads`, once its bytes are sent: checks that the whole file arrived with the declared size, that the bytes are the declared type, and for a video that ffprobe can read it; then adds the file to the media library. When parts are missing, answers `409 UPLOAD_INCOMPLETE` with their numbers in `missingParts`: send those again, then confirm again. Safe to call again: a confirmed upload answers the same media. The same as the MCP tool `confirmUpload`.\n */\nexport const confirmUpload = <ThrowOnError extends boolean = false>(options: Options<ConfirmUploadData, ThrowOnError>): RequestResult<ConfirmUploadResponses, ConfirmUploadErrors, ThrowOnError> => (options.client ?? client).post<ConfirmUploadResponses, ConfirmUploadErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/uploads/{uploadId}/confirm',\n ...options\n});\n\n/**\n * Tag a media with workspaces\n *\n * The whole set of workspaces a media of your library is tagged with (its id comes back from an upload). A media is never copied: when it serves two workspaces, it carries both tags. An untagged media is the organization's alone: the organization's key and the app see it, a key limited to some workspaces does not. A limited key only adds or takes off its own workspaces; the media's other tags stay. Publishing a media on a channel of another workspace tags it on the way (`mediaTagged` in the answer of `POST /public/v1/posts`).\n */\nexport const setMediaWorkspaces = <ThrowOnError extends boolean = false>(options: Options<SetMediaWorkspacesData, ThrowOnError>): RequestResult<SetMediaWorkspacesResponses, SetMediaWorkspacesErrors, ThrowOnError> => (options.client ?? client).put<SetMediaWorkspacesResponses, SetMediaWorkspacesErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/media/{id}/workspaces',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Next free slot in the channel's schedule\n */\nexport const findSlot = <ThrowOnError extends boolean = false>(options: Options<FindSlotData, ThrowOnError>): RequestResult<FindSlotResponses, FindSlotErrors, ThrowOnError> => (options.client ?? client).get<FindSlotResponses, FindSlotErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/find-slot/{id}',\n ...options\n});\n\n/**\n * The posting slots of a channel (time and weekdays, UTC)\n */\nexport const getPostingTimes = <ThrowOnError extends boolean = false>(options: Options<GetPostingTimesData, ThrowOnError>): RequestResult<GetPostingTimesResponses, GetPostingTimesErrors, ThrowOnError> => (options.client ?? client).get<GetPostingTimesResponses, GetPostingTimesErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/integrations/{id}/posting-times',\n ...options\n});\n\n/**\n * Replace the posting slots of a channel. Posts already scheduled do not move\n */\nexport const setPostingTimes = <ThrowOnError extends boolean = false>(options: Options<SetPostingTimesData, ThrowOnError>): RequestResult<SetPostingTimesResponses, SetPostingTimesErrors, ThrowOnError> => (options.client ?? client).put<SetPostingTimesResponses, SetPostingTimesErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/integrations/{id}/posting-times',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * List posts in a date range\n */\nexport const listPosts = <ThrowOnError extends boolean = false>(options: Options<ListPostsData, ThrowOnError>): RequestResult<ListPostsResponses, ListPostsErrors, ThrowOnError> => (options.client ?? client).get<ListPostsResponses, ListPostsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts',\n ...options\n});\n\n/**\n * Schedule, publish or draft a post on one or more channels\n */\nexport const createPost = <ThrowOnError extends boolean = false>(options: Options<CreatePostData, ThrowOnError>): RequestResult<CreatePostResponses, CreatePostErrors, ThrowOnError> => (options.client ?? client).post<CreatePostResponses, CreatePostErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Delete a post and everything published with it\n */\nexport const deletePost = <ThrowOnError extends boolean = false>(options: Options<DeletePostData, ThrowOnError>): RequestResult<DeletePostResponses, DeletePostErrors, ThrowOnError> => (options.client ?? client).delete<DeletePostResponses, DeletePostErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}',\n ...options\n});\n\n/**\n * Read one post, with its media and the cover of its video\n *\n * The post as `listPosts` gives it, plus `media`: each media of the post, in order, with the cover of a video (`thumbnail`, the URL UseNadia serves it from; null without one). Change the cover with `setPostCover`.\n */\nexport const getPost = <ThrowOnError extends boolean = false>(options: Options<GetPostData, ThrowOnError>): RequestResult<GetPostResponses, GetPostErrors, ThrowOnError> => (options.client ?? client).get<GetPostResponses, GetPostErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}',\n ...options\n});\n\n/**\n * Delete a publication group\n */\nexport const deletePostGroup = <ThrowOnError extends boolean = false>(options: Options<DeletePostGroupData, ThrowOnError>): RequestResult<DeletePostGroupResponses, DeletePostGroupErrors, ThrowOnError> => (options.client ?? client).delete<DeletePostGroupResponses, DeletePostGroupErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/group/{group}',\n ...options\n});\n\n/**\n * Check that an API key is valid\n */\nexport const checkConnection = <ThrowOnError extends boolean = false>(options?: Options<CheckConnectionData, ThrowOnError>): RequestResult<CheckConnectionResponses, CheckConnectionErrors, ThrowOnError> => (options?.client ?? client).get<CheckConnectionResponses, CheckConnectionErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/is-connected',\n ...options\n});\n\n/**\n * List your workspaces\n */\nexport const listWorkspaces = <ThrowOnError extends boolean = false>(options?: Options<ListWorkspacesData, ThrowOnError>): RequestResult<ListWorkspacesResponses, ListWorkspacesErrors, ThrowOnError> => (options?.client ?? client).get<ListWorkspacesResponses, ListWorkspacesErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/workspaces',\n ...options\n});\n\n/**\n * Create a workspace — same fields and refusals as in the app\n */\nexport const createWorkspace = <ThrowOnError extends boolean = false>(options: Options<CreateWorkspaceData, ThrowOnError>): RequestResult<CreateWorkspaceResponses, CreateWorkspaceErrors, ThrowOnError> => (options.client ?? client).post<CreateWorkspaceResponses, CreateWorkspaceErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/workspaces',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Read your subscription\n *\n * The plan, its trial and dates, and what is used against what is included. Behind the paid gate like every route: an organization without an active subscription is refused. `billing` says what will be charged and when, read from Stripe (next invoice, last payment, Stripe's status), or that the amounts are unavailable.\n */\nexport const getSubscription = <ThrowOnError extends boolean = false>(options?: Options<GetSubscriptionData, ThrowOnError>): RequestResult<GetSubscriptionResponses, GetSubscriptionErrors, ThrowOnError> => (options?.client ?? client).get<GetSubscriptionResponses, GetSubscriptionErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/subscription',\n ...options\n});\n\n/**\n * Deprecated: use listWorkspaces\n *\n * Lists your workspaces as `{ id, name }`. Kept for the published SDKs; use `GET /public/v1/workspaces`.\n *\n * @deprecated\n */\nexport const listGroups = <ThrowOnError extends boolean = false>(options?: Options<ListGroupsData, ThrowOnError>): RequestResult<ListGroupsResponses, ListGroupsErrors, ThrowOnError> => (options?.client ?? client).get<ListGroupsResponses, ListGroupsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/groups',\n ...options\n});\n\n/**\n * List your connected channels\n */\nexport const listChannels = <ThrowOnError extends boolean = false>(options?: Options<ListChannelsData, ThrowOnError>): RequestResult<ListChannelsResponses, ListChannelsErrors, ThrowOnError> => (options?.client ?? client).get<ListChannelsResponses, ListChannelsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/integrations',\n ...options\n});\n\n/**\n * Start connecting a channel — returns the URL to open\n *\n * Returns the URL that opens the platform's consent screen for this channel. A channel your plan does not include answers `402` with `This channel is not included in your plan`, as in the app (today: X on the Starter ultime).\n */\nexport const startChannelConnection = <ThrowOnError extends boolean = false>(options: Options<StartChannelConnectionData, ThrowOnError>): RequestResult<StartChannelConnectionResponses, StartChannelConnectionErrors, ThrowOnError> => (options.client ?? client).get<StartChannelConnectionResponses, StartChannelConnectionErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/social/{integration}',\n ...options\n});\n\n/**\n * List your notifications, paginated\n */\nexport const listNotifications = <ThrowOnError extends boolean = false>(options?: Options<ListNotificationsData, ThrowOnError>): RequestResult<ListNotificationsResponses, ListNotificationsErrors, ThrowOnError> => (options?.client ?? client).get<ListNotificationsResponses, ListNotificationsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/notifications',\n ...options\n});\n\n/**\n * Disconnect a channel and delete its posts\n */\nexport const deleteChannel = <ThrowOnError extends boolean = false>(options: Options<DeleteChannelData, ThrowOnError>): RequestResult<DeleteChannelResponses, DeleteChannelErrors, ThrowOnError> => (options.client ?? client).delete<DeleteChannelResponses, DeleteChannelErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/integrations/{id}',\n ...options\n});\n\n/**\n * Posting rules, maximum length and tools of a channel\n */\nexport const getChannelSettings = <ThrowOnError extends boolean = false>(options: Options<GetChannelSettingsData, ThrowOnError>): RequestResult<GetChannelSettingsResponses, GetChannelSettingsErrors, ThrowOnError> => (options.client ?? client).get<GetChannelSettingsResponses, GetChannelSettingsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/integration-settings/{id}',\n ...options\n});\n\n/**\n * Recent provider items to match a post whose releaseId is `missing`\n *\n * When a post published but the provider returned no usable id (`releaseId` is `missing`), lists the account's recent items so the right one can be recorded with PUT /posts/{id}/release-id. Empty when the post is not in that state, or the provider cannot list (today only TikTok can).\n */\nexport const listMissingMedia = <ThrowOnError extends boolean = false>(options: Options<ListMissingMediaData, ThrowOnError>): RequestResult<ListMissingMediaResponses, ListMissingMediaErrors, ThrowOnError> => (options.client ?? client).get<ListMissingMediaResponses, ListMissingMediaErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}/missing',\n ...options\n});\n\n/**\n * Change a post's status\n */\nexport const changePostStatus = <ThrowOnError extends boolean = false>(options: Options<ChangePostStatusData, ThrowOnError>): RequestResult<ChangePostStatusResponses, ChangePostStatusErrors, ThrowOnError> => (options.client ?? client).put<ChangePostStatusResponses, ChangePostStatusErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}/status',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Take the automation off a post not yet published\n */\nexport const removePostAutomation = <ThrowOnError extends boolean = false>(options: Options<RemovePostAutomationData, ThrowOnError>): RequestResult<RemovePostAutomationResponses, RemovePostAutomationErrors, ThrowOnError> => (options.client ?? client).delete<RemovePostAutomationResponses, RemovePostAutomationErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}/automation',\n ...options\n});\n\n/**\n * Read the automation a post not yet published carries\n */\nexport const getPostAutomation = <ThrowOnError extends boolean = false>(options: Options<GetPostAutomationData, ThrowOnError>): RequestResult<GetPostAutomationResponses, GetPostAutomationErrors, ThrowOnError> => (options.client ?? client).get<GetPostAutomationResponses, GetPostAutomationErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}/automation',\n ...options\n});\n\n/**\n * Put an automation on a scheduled post\n *\n * Put an automation template on an Instagram post or story, or a Facebook Page post or reel (no story), that is scheduled but not published yet, or replace the one it carries. It is checked as at scheduling, and at publication it is posed exactly as if `settings.automationFlowId`, `automationKeywords` and `automationVariables` had been passed to POST /public/v1/posts. Once the post is live, pose the template on the publication instead (POST /public/v1/automation-flows/{id}/poses).\n */\nexport const setPostAutomation = <ThrowOnError extends boolean = false>(options: Options<SetPostAutomationData, ThrowOnError>): RequestResult<SetPostAutomationResponses, SetPostAutomationErrors, ThrowOnError> => (options.client ?? client).put<SetPostAutomationResponses, SetPostAutomationErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}/automation',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Record the provider post id against a post\n */\nexport const setPostReleaseId = <ThrowOnError extends boolean = false>(options: Options<SetPostReleaseIdData, ThrowOnError>): RequestResult<SetPostReleaseIdResponses, SetPostReleaseIdErrors, ThrowOnError> => (options.client ?? client).put<SetPostReleaseIdResponses, SetPostReleaseIdErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}/release-id',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Put, replace or take off the cover of a post's video, before it is published\n *\n * The cover goes on the post's video (its first `.mp4`): on Instagram, a reel is published with it as its cover, the image in the profile grid. It can change at any time until the post leaves for the platform (a draft, a scheduled post, or one that failed). Nothing else of the post moves: text, date, media and `link` stay. The image is kept by UseNadia as at scheduling (any public URL, a signed one included; a JPEG, 8 MB at most). Refused with a `400` that says why: a YouTube post (YouTube does not use a cover: the thumbnail of a video is the `thumbnail` setting of its post), a post already published or sent to the platform (Instagram does not change the cover of a published reel), a post without a video, a cover that cannot be downloaded or is not a JPEG.\n */\nexport const setPostCover = <ThrowOnError extends boolean = false>(options: Options<SetPostCoverData, ThrowOnError>): RequestResult<SetPostCoverResponses, SetPostCoverErrors, ThrowOnError> => (options.client ?? client).put<SetPostCoverResponses, SetPostCoverErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}/cover',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Group a post with the same content on other channels, or separate it\n *\n * A publication is one content on one or more channels: the posts that share `publication`. Posts written in one request are one publication from the start; this route moves a post (with its thread) into another publication, or out of its own. Nothing else of the post changes, published or not. Refused with a `400` when the publication has no live post in your organisation, `404` for an unknown post.\n */\nexport const setPostPublication = <ThrowOnError extends boolean = false>(options: Options<SetPostPublicationData, ThrowOnError>): RequestResult<SetPostPublicationResponses, SetPostPublicationErrors, ThrowOnError> => (options.client ?? client).put<SetPostPublicationResponses, SetPostPublicationErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}/publication',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Account metrics, read live from the provider\n */\nexport const getChannelAnalytics = <ThrowOnError extends boolean = false>(options: Options<GetChannelAnalyticsData, ThrowOnError>): RequestResult<GetChannelAnalyticsResponses, GetChannelAnalyticsErrors, ThrowOnError> => (options.client ?? client).get<GetChannelAnalyticsResponses, GetChannelAnalyticsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/analytics/{integration}',\n ...options\n});\n\n/**\n * Per-video performance of a channel\n */\nexport const listVideoPerformance = <ThrowOnError extends boolean = false>(options: Options<ListVideoPerformanceData, ThrowOnError>): RequestResult<ListVideoPerformanceResponses, ListVideoPerformanceErrors, ThrowOnError> => (options.client ?? client).get<ListVideoPerformanceResponses, ListVideoPerformanceErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/video-list/{integrationId}',\n ...options\n});\n\n/**\n * Stored account time series, collected every 30 minutes\n */\nexport const getAccountHistory = <ThrowOnError extends boolean = false>(options: Options<GetAccountHistoryData, ThrowOnError>): RequestResult<GetAccountHistoryResponses, GetAccountHistoryErrors, ThrowOnError> => (options.client ?? client).get<GetAccountHistoryResponses, GetAccountHistoryErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/analytics-history/{integrationId}',\n ...options\n});\n\n/**\n * Stored per-video time series\n */\nexport const getVideoHistory = <ThrowOnError extends boolean = false>(options: Options<GetVideoHistoryData, ThrowOnError>): RequestResult<GetVideoHistoryResponses, GetVideoHistoryErrors, ThrowOnError> => (options.client ?? client).get<GetVideoHistoryResponses, GetVideoHistoryErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/video-history/{integrationId}',\n ...options\n});\n\n/**\n * Views gained each day, every video counted\n *\n * The views the channel gained each day of the window, every video counted, old ones included. TikTok and Instagram: the day-to-day difference of every collected video's views (a first reading, unless the video came out that day or the day before, and a reading after a gap of more than 2 days are no gain, counted in `baselines`; a lower reading counts 0, counted in `drops`). Facebook Page, Threads and YouTube: the platform's views of the day (YouTube Analytics, two or three days late: its last days are `null`; only when it gives no day at all, the day-to-day difference of the channel's total views, `source` = `totals`). X and LinkedIn: nothing (`source` = `none`). A day nothing was read has `views: null`, never 0.\n */\nexport const getViewsPerDay = <ThrowOnError extends boolean = false>(options: Options<GetViewsPerDayData, ThrowOnError>): RequestResult<GetViewsPerDayResponses, GetViewsPerDayErrors, ThrowOnError> => (options.client ?? client).get<GetViewsPerDayResponses, GetViewsPerDayErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/views-per-day/{integrationId}',\n ...options\n});\n\n/**\n * Metrics of one published post\n */\nexport const getPostAnalytics = <ThrowOnError extends boolean = false>(options: Options<GetPostAnalyticsData, ThrowOnError>): RequestResult<GetPostAnalyticsResponses, GetPostAnalyticsErrors, ThrowOnError> => (options.client ?? client).get<GetPostAnalyticsResponses, GetPostAnalyticsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/analytics/post/{postId}',\n ...options\n});\n\n/**\n * Run a provider tool on a channel\n */\nexport const runChannelTool = <ThrowOnError extends boolean = false>(options: Options<RunChannelToolData, ThrowOnError>): RequestResult<RunChannelToolResponses, RunChannelToolErrors, ThrowOnError> => (options.client ?? client).post<RunChannelToolResponses, RunChannelToolErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/integration-trigger/{id}',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Recent posts of an Instagram channel\n */\nexport const listChannelMedia = <ThrowOnError extends boolean = false>(options: Options<ListChannelMediaData, ThrowOnError>): RequestResult<ListChannelMediaResponses, ListChannelMediaErrors, ThrowOnError> => (options.client ?? client).get<ListChannelMediaResponses, ListChannelMediaErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/media/{integrationId}',\n ...options\n});\n\n/**\n * Live stories of a channel (they only exist 24 h)\n */\nexport const listChannelStories = <ThrowOnError extends boolean = false>(options: Options<ListChannelStoriesData, ThrowOnError>): RequestResult<ListChannelStoriesResponses, ListChannelStoriesErrors, ThrowOnError> => (options.client ?? client).get<ListChannelStoriesResponses, ListChannelStoriesErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/stories/{integrationId}',\n ...options\n});\n\n/**\n * Comments under a post\n */\nexport const listMediaComments = <ThrowOnError extends boolean = false>(options: Options<ListMediaCommentsData, ThrowOnError>): RequestResult<ListMediaCommentsResponses, ListMediaCommentsErrors, ThrowOnError> => (options.client ?? client).get<ListMediaCommentsResponses, ListMediaCommentsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/comments/{integrationId}/{mediaId}',\n ...options\n});\n\n/**\n * Reply publicly to a comment\n */\nexport const replyToComment = <ThrowOnError extends boolean = false>(options: Options<ReplyToCommentData, ThrowOnError>): RequestResult<ReplyToCommentResponses, ReplyToCommentErrors, ThrowOnError> => (options.client ?? client).post<ReplyToCommentResponses, ReplyToCommentErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/comments/{commentId}/reply',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Hide or unhide a comment under one of your posts\n */\nexport const hideComment = <ThrowOnError extends boolean = false>(options: Options<HideCommentData, ThrowOnError>): RequestResult<HideCommentResponses, HideCommentErrors, ThrowOnError> => (options.client ?? client).post<HideCommentResponses, HideCommentErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/comments/{integrationId}/{commentId}/hide',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Delete a comment under one of your posts\n */\nexport const deleteComment = <ThrowOnError extends boolean = false>(options: Options<DeleteCommentData, ThrowOnError>): RequestResult<DeleteCommentResponses, DeleteCommentErrors, ThrowOnError> => (options.client ?? client).delete<DeleteCommentResponses, DeleteCommentErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/comments/{integrationId}/{commentId}',\n ...options\n});\n\n/**\n * Direct message conversations of a channel\n *\n * One page of a box of the inbox (`box`, `needs_reply` by default), what waits for a human first, newest first inside. For the next page, pass the `cursor` of the last conversation as `after`; fewer rows than `limit` means it was the last page.\n */\nexport const listConversations = <ThrowOnError extends boolean = false>(options: Options<ListConversationsData, ThrowOnError>): RequestResult<ListConversationsResponses, ListConversationsErrors, ThrowOnError> => (options.client ?? client).get<ListConversationsResponses, ListConversationsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/{integrationId}',\n ...options\n});\n\n/**\n * Send a direct message\n */\nexport const sendDirectMessage = <ThrowOnError extends boolean = false>(options: Options<SendDirectMessageData, ThrowOnError>): RequestResult<SendDirectMessageResponses, SendDirectMessageErrors, ThrowOnError> => (options.client ?? client).post<SendDirectMessageResponses, SendDirectMessageErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/{integrationId}/send',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Read the inbox now: what a missed webhook would have delivered reaches the automations\n */\nexport const pollInbox = <ThrowOnError extends boolean = false>(options: Options<PollInboxData, ThrowOnError>): RequestResult<PollInboxResponses, PollInboxErrors, ThrowOnError> => (options.client ?? client).post<PollInboxResponses, PollInboxErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/{integrationId}/poll',\n ...options\n});\n\n/**\n * Opt the account in to Meta webhook delivery\n */\nexport const subscribeInboxWebhook = <ThrowOnError extends boolean = false>(options: Options<SubscribeInboxWebhookData, ThrowOnError>): RequestResult<SubscribeInboxWebhookResponses, SubscribeInboxWebhookErrors, ThrowOnError> => (options.client ?? client).post<SubscribeInboxWebhookResponses, SubscribeInboxWebhookErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/{integrationId}/subscribe-webhook',\n ...options\n});\n\n/**\n * Messages of one conversation\n *\n * By the conversation `id` of `listConversations` (Meta's conversation id, or the person's id while Instagram has not named the thread). Messages newest first, `limit` at a time; `messages.paging.before` is there when older ones remain.\n */\nexport const getConversation = <ThrowOnError extends boolean = false>(options: Options<GetConversationData, ThrowOnError>): RequestResult<GetConversationResponses, GetConversationErrors, ThrowOnError> => (options.client ?? client).get<GetConversationResponses, GetConversationErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/{integrationId}/{conversationId}',\n ...options\n});\n\n/**\n * List your automation templates\n */\nexport const listAutomationFlows = <ThrowOnError extends boolean = false>(options?: Options<ListAutomationFlowsData, ThrowOnError>): RequestResult<ListAutomationFlowsResponses, ListAutomationFlowsErrors, ThrowOnError> => (options?.client ?? client).get<ListAutomationFlowsResponses, ListAutomationFlowsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows',\n ...options\n});\n\n/**\n * Create an automation template\n */\nexport const createAutomationFlow = <ThrowOnError extends boolean = false>(options: Options<CreateAutomationFlowData, ThrowOnError>): RequestResult<CreateAutomationFlowResponses, CreateAutomationFlowErrors, ThrowOnError> => (options.client ?? client).post<CreateAutomationFlowResponses, CreateAutomationFlowErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Render the email of a « Forward the email » step without sending it\n */\nexport const previewAutomationEmail = <ThrowOnError extends boolean = false>(options: Options<PreviewAutomationEmailData, ThrowOnError>): RequestResult<PreviewAutomationEmailResponses, PreviewAutomationEmailErrors, ThrowOnError> => (options.client ?? client).post<PreviewAutomationEmailResponses, PreviewAutomationEmailErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows/email-preview',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Send the email of a « Forward the email » step to one address\n */\nexport const sendAutomationTestEmail = <ThrowOnError extends boolean = false>(options: Options<SendAutomationTestEmailData, ThrowOnError>): RequestResult<SendAutomationTestEmailResponses, SendAutomationTestEmailErrors, ThrowOnError> => (options.client ?? client).post<SendAutomationTestEmailResponses, SendAutomationTestEmailErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows/email-test',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Delete an automation template\n */\nexport const deleteAutomationFlow = <ThrowOnError extends boolean = false>(options: Options<DeleteAutomationFlowData, ThrowOnError>): RequestResult<DeleteAutomationFlowResponses, DeleteAutomationFlowErrors, ThrowOnError> => (options.client ?? client).delete<DeleteAutomationFlowResponses, DeleteAutomationFlowErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows/{id}',\n ...options\n});\n\n/**\n * One automation template\n */\nexport const getAutomationFlow = <ThrowOnError extends boolean = false>(options: Options<GetAutomationFlowData, ThrowOnError>): RequestResult<GetAutomationFlowResponses, GetAutomationFlowErrors, ThrowOnError> => (options.client ?? client).get<GetAutomationFlowResponses, GetAutomationFlowErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows/{id}',\n ...options\n});\n\n/**\n * Update an automation template\n */\nexport const updateAutomationFlow = <ThrowOnError extends boolean = false>(options: Options<UpdateAutomationFlowData, ThrowOnError>): RequestResult<UpdateAutomationFlowResponses, UpdateAutomationFlowErrors, ThrowOnError> => (options.client ?? client).put<UpdateAutomationFlowResponses, UpdateAutomationFlowErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows/{id}',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Activate, pause, archive or unarchive a template (ACTIVE is refused while it has errors; ARCHIVED only from ACTIVE)\n */\nexport const setAutomationFlowStatus = <ThrowOnError extends boolean = false>(options: Options<SetAutomationFlowStatusData, ThrowOnError>): RequestResult<SetAutomationFlowStatusResponses, SetAutomationFlowStatusErrors, ThrowOnError> => (options.client ?? client).put<SetAutomationFlowStatusResponses, SetAutomationFlowStatusErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows/{id}/status',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * The publications a template is posed on\n */\nexport const listAutomationFlowPoses = <ThrowOnError extends boolean = false>(options: Options<ListAutomationFlowPosesData, ThrowOnError>): RequestResult<ListAutomationFlowPosesResponses, ListAutomationFlowPosesErrors, ThrowOnError> => (options.client ?? client).get<ListAutomationFlowPosesResponses, ListAutomationFlowPosesErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows/{id}/poses',\n ...options\n});\n\n/**\n * Pose a template on a post or story already live, with its words and values\n */\nexport const poseAutomationFlow = <ThrowOnError extends boolean = false>(options: Options<PoseAutomationFlowData, ThrowOnError>): RequestResult<PoseAutomationFlowResponses, PoseAutomationFlowErrors, ThrowOnError> => (options.client ?? client).post<PoseAutomationFlowResponses, PoseAutomationFlowErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows/{id}/poses',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * The poses of a channel (one publication, or all) or of every channel of a workspace\n */\nexport const listChannelAutomationPoses = <ThrowOnError extends boolean = false>(options?: Options<ListChannelAutomationPosesData, ThrowOnError>): RequestResult<ListChannelAutomationPosesResponses, ListChannelAutomationPosesErrors, ThrowOnError> => (options?.client ?? client).get<ListChannelAutomationPosesResponses, ListChannelAutomationPosesErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flow-poses',\n ...options\n});\n\n/**\n * Remove a pose from its publication\n */\nexport const deleteAutomationPose = <ThrowOnError extends boolean = false>(options: Options<DeleteAutomationPoseData, ThrowOnError>): RequestResult<DeleteAutomationPoseResponses, DeleteAutomationPoseErrors, ThrowOnError> => (options.client ?? client).delete<DeleteAutomationPoseResponses, DeleteAutomationPoseErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flow-poses/{id}',\n ...options\n});\n\n/**\n * One pose\n */\nexport const getAutomationPose = <ThrowOnError extends boolean = false>(options: Options<GetAutomationPoseData, ThrowOnError>): RequestResult<GetAutomationPoseResponses, GetAutomationPoseErrors, ThrowOnError> => (options.client ?? client).get<GetAutomationPoseResponses, GetAutomationPoseErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flow-poses/{id}',\n ...options\n});\n\n/**\n * Change the words, values or pause of a pose\n */\nexport const updateAutomationPose = <ThrowOnError extends boolean = false>(options: Options<UpdateAutomationPoseData, ThrowOnError>): RequestResult<UpdateAutomationPoseResponses, UpdateAutomationPoseErrors, ThrowOnError> => (options.client ?? client).put<UpdateAutomationPoseResponses, UpdateAutomationPoseErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flow-poses/{id}',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * The people who went through a pose\n */\nexport const listAutomationPoseRuns = <ThrowOnError extends boolean = false>(options: Options<ListAutomationPoseRunsData, ThrowOnError>): RequestResult<ListAutomationPoseRunsResponses, ListAutomationPoseRunsErrors, ThrowOnError> => (options.client ?? client).get<ListAutomationPoseRunsResponses, ListAutomationPoseRunsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flow-poses/{id}/runs',\n ...options\n});\n\n/**\n * Read the publication’s comments now and start what a missed webhook left behind\n */\nexport const pollAutomationPose = <ThrowOnError extends boolean = false>(options: Options<PollAutomationPoseData, ThrowOnError>): RequestResult<PollAutomationPoseResponses, PollAutomationPoseErrors, ThrowOnError> => (options.client ?? client).post<PollAutomationPoseResponses, PollAutomationPoseErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flow-poses/{id}/poll',\n ...options\n});\n\n/**\n * Replay the automation on named comments, whatever their date\n */\nexport const replayAutomationPose = <ThrowOnError extends boolean = false>(options: Options<ReplayAutomationPoseData, ThrowOnError>): RequestResult<ReplayAutomationPoseResponses, ReplayAutomationPoseErrors, ThrowOnError> => (options.client ?? client).post<ReplayAutomationPoseResponses, ReplayAutomationPoseErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flow-poses/{id}/replay',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Preview a catch-up: the comments already on the publication that would start the automation, sending nothing\n */\nexport const previewAutomationPoseCatchUp = <ThrowOnError extends boolean = false>(options: Options<PreviewAutomationPoseCatchUpData, ThrowOnError>): RequestResult<PreviewAutomationPoseCatchUpResponses, PreviewAutomationPoseCatchUpErrors, ThrowOnError> => (options.client ?? client).get<PreviewAutomationPoseCatchUpResponses, PreviewAutomationPoseCatchUpErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flow-poses/{id}/catch-up',\n ...options\n});\n\n/**\n * Catch up the comments already on the publication: each matching comment starts the automation, a few per minute\n */\nexport const catchUpAutomationPose = <ThrowOnError extends boolean = false>(options: Options<CatchUpAutomationPoseData, ThrowOnError>): RequestResult<CatchUpAutomationPoseResponses, CatchUpAutomationPoseErrors, ThrowOnError> => (options.client ?? client).post<CatchUpAutomationPoseResponses, CatchUpAutomationPoseErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flow-poses/{id}/catch-up',\n ...options\n});\n\n/**\n * The event catalogue a webhook can subscribe to\n */\nexport const listWebhookEvents = <ThrowOnError extends boolean = false>(options?: Options<ListWebhookEventsData, ThrowOnError>): RequestResult<ListWebhookEventsResponses, ListWebhookEventsErrors, ThrowOnError> => (options?.client ?? client).get<ListWebhookEventsResponses, ListWebhookEventsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/webhooks/events',\n ...options\n});\n\n/**\n * List your webhook endpoints\n */\nexport const listWebhooks = <ThrowOnError extends boolean = false>(options?: Options<ListWebhooksData, ThrowOnError>): RequestResult<ListWebhooksResponses, ListWebhooksErrors, ThrowOnError> => (options?.client ?? client).get<ListWebhooksResponses, ListWebhooksErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/webhooks',\n ...options\n});\n\n/**\n * Register a webhook endpoint — the response carries the signing secret, once\n */\nexport const createWebhook = <ThrowOnError extends boolean = false>(options: Options<CreateWebhookData, ThrowOnError>): RequestResult<CreateWebhookResponses, CreateWebhookErrors, ThrowOnError> => (options.client ?? client).post<CreateWebhookResponses, CreateWebhookErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/webhooks',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Unregister a webhook endpoint\n */\nexport const deleteWebhook = <ThrowOnError extends boolean = false>(options: Options<DeleteWebhookData, ThrowOnError>): RequestResult<DeleteWebhookResponses, DeleteWebhookErrors, ThrowOnError> => (options.client ?? client).delete<DeleteWebhookResponses, DeleteWebhookErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/webhooks/{id}',\n ...options\n});\n\n/**\n * One webhook endpoint\n */\nexport const getWebhook = <ThrowOnError extends boolean = false>(options: Options<GetWebhookData, ThrowOnError>): RequestResult<GetWebhookResponses, GetWebhookErrors, ThrowOnError> => (options.client ?? client).get<GetWebhookResponses, GetWebhookErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/webhooks/{id}',\n ...options\n});\n\n/**\n * Send one signed test delivery to a webhook and return its HTTP status\n *\n * POSTs a sample of the event to this webhook only — same envelope `{ id, event, occurredAt, organizationId, data }`, same `X-Nadia-*` headers and signature as a real delivery — with `test: true` added to the envelope and `data` a realistic sample (fake `test_…` ids; nothing happened). One attempt, no retry, 10-second timeout; the call waits for it and returns what the endpoint answered. 400 when the event is not in the catalogue or the webhook is not subscribed to it.\n */\nexport const testWebhook = <ThrowOnError extends boolean = false>(options: Options<TestWebhookData, ThrowOnError>): RequestResult<TestWebhookResponses, TestWebhookErrors, ThrowOnError> => (options.client ?? client).post<TestWebhookResponses, TestWebhookErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/webhooks/{id}/test',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * List the cards of the board\n *\n * Filters combine. With `fields`, each card carries only the fields asked for (plus its id). A key limited to some workspaces lists the cards tagged with one of them and tied to no channel or post of another workspace.\n */\nexport const listContents = <ThrowOnError extends boolean = false>(options?: Options<ListContentsData, ThrowOnError>): RequestResult<ListContentsResponses, ListContentsErrors, ThrowOnError> => (options?.client ?? client).get<ListContentsResponses, ListContentsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents',\n ...options\n});\n\n/**\n * Create a card\n *\n * A card created by a key limited to some workspaces is tagged with them; by the organisation's key, it is not tagged.\n */\nexport const createContent = <ThrowOnError extends boolean = false>(options: Options<CreateContentData, ThrowOnError>): RequestResult<CreateContentResponses, CreateContentErrors, ThrowOnError> => (options.client ?? client).post<CreateContentResponses, CreateContentErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * The numbers of the published cards, keyed by card id\n */\nexport const getContentsPerformance = <ThrowOnError extends boolean = false>(options?: Options<GetContentsPerformanceData, ThrowOnError>): RequestResult<GetContentsPerformanceResponses, GetContentsPerformanceErrors, ThrowOnError> => (options?.client ?? client).get<GetContentsPerformanceResponses, GetContentsPerformanceErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents/performance',\n ...options\n});\n\n/**\n * Delete a card\n *\n * A key limited to some workspaces deleting a card that also carries other workspaces only takes its own workspaces off: the card stays for the others and comes back without `deletedAt`.\n */\nexport const deleteContent = <ThrowOnError extends boolean = false>(options: Options<DeleteContentData, ThrowOnError>): RequestResult<DeleteContentResponses, DeleteContentErrors, ThrowOnError> => (options.client ?? client).delete<DeleteContentResponses, DeleteContentErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents/{id}',\n ...options\n});\n\n/**\n * One card\n */\nexport const getContent = <ThrowOnError extends boolean = false>(options: Options<GetContentData, ThrowOnError>): RequestResult<GetContentResponses, GetContentErrors, ThrowOnError> => (options.client ?? client).get<GetContentResponses, GetContentErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents/{id}',\n ...options\n});\n\n/**\n * Update a card (only the fields sent; null clears)\n */\nexport const updateContent = <ThrowOnError extends boolean = false>(options: Options<UpdateContentData, ThrowOnError>): RequestResult<UpdateContentResponses, UpdateContentErrors, ThrowOnError> => (options.client ?? client).put<UpdateContentResponses, UpdateContentErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents/{id}',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Create or update a card by your own id\n *\n * The card holding `externalId` is updated with the fields sent (its column is left alone: use /move); without one, a card is created. Re-running an import never duplicates.\n */\nexport const upsertContent = <ThrowOnError extends boolean = false>(options: Options<UpsertContentData, ThrowOnError>): RequestResult<UpsertContentResponses, UpsertContentErrors, ThrowOnError> => (options.client ?? client).post<UpsertContentResponses, UpsertContentErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents/upsert',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Turn a shared video link into an idea card\n *\n * Send the link of a TikTok, Instagram or YouTube video (or the text a share gives, with the link in it): it becomes a card in IDEA, first of the column, tagged `inspiration`, its `source` PENDING. Nadia then reads the video in the background (its author, caption, duration, views, a copy of its thumbnail, its transcript); the video itself is never kept. `source.status` turns READY, or FAILED with `source.error` saying why (a private video, a dead short link, a platform that refuses our servers: YouTube today). The same video sent again answers 200 with its card, and nothing is read again.\n */\nexport const createContentFromLink = <ThrowOnError extends boolean = false>(options: Options<CreateContentFromLinkData, ThrowOnError>): RequestResult<CreateContentFromLinkResponses, CreateContentFromLinkErrors, ThrowOnError> => (options.client ?? client).post<CreateContentFromLinkResponses, CreateContentFromLinkErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents/from-link',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Move a card to another column\n */\nexport const moveContent = <ThrowOnError extends boolean = false>(options: Options<MoveContentData, ThrowOnError>): RequestResult<MoveContentResponses, MoveContentErrors, ThrowOnError> => (options.client ?? client).put<MoveContentResponses, MoveContentErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents/{id}/move',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Tie a card to a post scheduled from it\n *\n * Pass the `group` of a post created with POST /public/v1/posts. A card holds several posts (e.g. a TikTok draft and an Instagram post): each call adds one. A card behind \"To schedule\" jumps there; it moves to PUBLISHED when the first of its posts goes live.\n */\nexport const linkContentPost = <ThrowOnError extends boolean = false>(options: Options<LinkContentPostData, ThrowOnError>): RequestResult<LinkContentPostResponses, LinkContentPostErrors, ThrowOnError> => (options.client ?? client).put<LinkContentPostResponses, LinkContentPostErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents/{id}/post',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Tag a card with workspaces\n *\n * The whole set of workspaces a card of the idea box is tagged with. A card is never copied: when it serves two workspaces, it carries both tags. An untagged card is the organization's alone: the organization's key and the app see it, a key limited to some workspaces does not. A limited key only adds or takes off its own workspaces; the card's other tags stay. A card created by a limited key is tagged with its workspaces.\n */\nexport const setContentWorkspaces = <ThrowOnError extends boolean = false>(options: Options<SetContentWorkspacesData, ThrowOnError>): RequestResult<SetContentWorkspacesResponses, SetContentWorkspacesErrors, ThrowOnError> => (options.client ?? client).put<SetContentWorkspacesResponses, SetContentWorkspacesErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents/{id}/workspaces',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Search real hooks that worked\n *\n * Words of `q` are looked up in the hook, its opening and the subject of the video; the hooks matching the most words come first, then the best normalised views. Without `q`: the best hooks passing the filters. French only unless `language` says otherwise.\n */\nexport const searchHooks = <ThrowOnError extends boolean = false>(options?: Options<SearchHooksData, ThrowOnError>): RequestResult<SearchHooksResponses, SearchHooksErrors, ThrowOnError> => (options?.client ?? client).get<SearchHooksResponses, SearchHooksErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/hooks',\n ...options\n});\n\n/**\n * The best hook forms for a video, with real examples\n *\n * A catalogue of hook families for the video being prepared, ordered (weakly) by their measured effect on its nature (`nature`), each with real hooks: one on the subject (`q`) when there is one, the rest drawn at random among the hooks of the family, catastrophic ones left out. Two calls never give the same examples. Views follow the size of the subject, they do not rank the examples. The agent adapts the form of these hooks to its subject; it never invents one.\n */\nexport const getHookForms = <ThrowOnError extends boolean = false>(options?: Options<GetHookFormsData, ThrowOnError>): RequestResult<GetHookFormsResponses, GetHookFormsErrors, ThrowOnError> => (options?.client ?? client).get<GetHookFormsResponses, GetHookFormsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/hooks/forms',\n ...options\n});\n\n/**\n * The measured effect of each hook family\n *\n * From the studies corpus: views vs the rest, probability of superiority, share of bangers, and in how many accounts the family beats the rest of the same account. Only a `PROUVÉ` family is a rule. `nature` gives the table measured on one nature of video (`tuto_methode`…), default the whole corpus.\n */\nexport const listHookFamilies = <ThrowOnError extends boolean = false>(options?: Options<ListHookFamiliesData, ThrowOnError>): RequestResult<ListHookFamiliesResponses, ListHookFamiliesErrors, ThrowOnError> => (options?.client ?? client).get<ListHookFamiliesResponses, ListHookFamiliesErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/hooks/families',\n ...options\n});\n\n/**\n * Royalty-free music for a video\n *\n * Public domain and CC-BY tracks only, every file prepared (dynamics flattened, normalised to `storedLufs`). `ok` tracks first, in a random order, then `limite` ones when asked. `howTo` is the recipe: level under the voice, mix, credit line.\n */\nexport const listMusic = <ThrowOnError extends boolean = false>(options?: Options<ListMusicData, ThrowOnError>): RequestResult<ListMusicResponses, ListMusicErrors, ThrowOnError> => (options?.client ?? client).get<ListMusicResponses, ListMusicErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/music',\n ...options\n});\n\n/**\n * The pillars of the music catalogue\n *\n * What each pillar (piano, news, synthwave, epique) is for, with the number of tracks.\n */\nexport const listMusicPillars = <ThrowOnError extends boolean = false>(options?: Options<ListMusicPillarsData, ThrowOnError>): RequestResult<ListMusicPillarsResponses, ListMusicPillarsErrors, ThrowOnError> => (options?.client ?? client).get<ListMusicPillarsResponses, ListMusicPillarsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/music/pillars',\n ...options\n});\n\n/**\n * One track of the catalogue\n */\nexport const getMusicTrack = <ThrowOnError extends boolean = false>(options: Options<GetMusicTrackData, ThrowOnError>): RequestResult<GetMusicTrackResponses, GetMusicTrackErrors, ThrowOnError> => (options.client ?? client).get<GetMusicTrackResponses, GetMusicTrackErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/music/{slug}',\n ...options\n});\n\n/**\n * Import tracks (upsert on slug) — super admin only\n */\nexport const importMusic = <ThrowOnError extends boolean = false>(options: Options<ImportMusicData, ThrowOnError>): RequestResult<ImportMusicResponses, ImportMusicErrors, ThrowOnError> => (options.client ?? client).post<ImportMusicResponses, ImportMusicErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/music/import',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Upload the prepared mp3 of a track — super admin only\n */\nexport const uploadMusicFile = <ThrowOnError extends boolean = false>(options: Options<UploadMusicFileData, ThrowOnError>): RequestResult<UploadMusicFileResponses, UploadMusicFileErrors, ThrowOnError> => (options.client ?? client).put<UploadMusicFileResponses, UploadMusicFileErrors, ThrowOnError>({\n ...formDataBodySerializer,\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/music/{slug}/file',\n ...options,\n headers: {\n 'Content-Type': null,\n ...options.headers\n }\n});\n\n/**\n * Delete a workspace — its channels and their posts move to the first other one\n */\nexport const deleteWorkspace = <ThrowOnError extends boolean = false>(options: Options<DeleteWorkspaceData, ThrowOnError>): RequestResult<DeleteWorkspaceResponses, DeleteWorkspaceErrors, ThrowOnError> => (options.client ?? client).delete<DeleteWorkspaceResponses, DeleteWorkspaceErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/workspaces/{id}',\n ...options\n});\n\n/**\n * Edit a workspace, or move channels into it\n */\nexport const updateWorkspace = <ThrowOnError extends boolean = false>(options: Options<UpdateWorkspaceData, ThrowOnError>): RequestResult<UpdateWorkspaceResponses, UpdateWorkspaceErrors, ThrowOnError> => (options.client ?? client).put<UpdateWorkspaceResponses, UpdateWorkspaceErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/workspaces/{id}',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AAM,QAAQ,MAAM,OAAO;AAEtE,MAAI;AACF,UAAM,OAAO,OAAO,QAAQ,SAAS,WAAW,QAAQ,OAAO,IAAI,YAAY,EAAE,OAAO,QAAQ,IAAI;AACpG,WAAO,KAAK,MAAM,IAAI;AAAA,EACxB,QAAQ;AACN,UAAM,IAAI,kBAAkB,YAAY,uBAAuB;AAAA,EACjE;AACF;","names":["sleep","joinedValues","config","request","url"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/generated/core/bodySerializer.gen.ts","../src/generated/core/params.gen.ts","../src/generated/core/serverSentEvents.gen.ts","../src/generated/core/pathSerializer.gen.ts","../src/generated/core/utils.gen.ts","../src/generated/core/auth.gen.ts","../src/generated/client/utils.gen.ts","../src/generated/client/client.gen.ts","../src/generated/client.gen.ts","../src/generated/sdk.gen.ts"],"sourcesContent":["/**\n * UseNadia Node SDK.\n *\n * Two layers, on purpose (plan 19) — this file is the second one.\n *\n * `src/generated/` transport, regenerated from `openapi.public.json`,\n * covers every operation, never edited by hand.\n * `src/index.ts` this file: the small, hand-written surface that makes\n * the common calls pleasant, and that we take\n * responsibility for.\n *\n * The `Nadia` class wraps the generated client: every call checks the HTTP\n * status and throws on an error (a 402 never comes back looking like a\n * success), and every call returns an awaited result.\n *\n * Everything the facade does not sugar is still reachable: the generated\n * client and its types are re-exported at the bottom of this file.\n */\nimport { createHmac, timingSafeEqual } from 'node:crypto';\nimport { client as generatedClient } from './generated/client.gen';\nimport * as api from './generated/sdk.gen';\nimport type {\n CreateContentDto,\n ListContentsData,\n MoveContentDto,\n PublicCreatePostDto,\n UpdateContentDto,\n UpsertContentDto,\n} from './generated/types.gen';\n\n/** Body of {@link Nadia.post}: the spec's own shape (`group`, `value[].id`\n * and `value[].delay` are optional there since 2026-10-21). */\nexport type CreatePostBody = PublicCreatePostDto;\n\n/** A column of the content board, in board order. */\nexport type ContentStage = MoveContentDto['stage'];\n\nexport const DEFAULT_BASE_URL = 'https://app.usenadia.com/api';\n\n/** Thrown for every response with a status >= 400. */\nexport class NadiaError extends Error {\n readonly status: number;\n readonly body: unknown;\n\n constructor(status: number, body: unknown, message?: string) {\n super(message ?? `UseNadia API responded ${status}`);\n this.name = 'NadiaError';\n this.status = status;\n this.body = body;\n Object.setPrototypeOf(this, NadiaError.prototype);\n }\n\n /**\n * True when retrying later could plausibly work: a rate limit, a server\n * hiccup, or a request that never completed at all (status 0).\n */\n get isTransient(): boolean {\n return this.status === 0 || this.status === 429 || this.status >= 500;\n }\n}\n\n/** What a `428` says the action will do: `action` (e.g. `post.delete`), `request`, and more per action. */\nexport type ConfirmationPreview = { action?: string; request?: string; [key: string]: unknown };\n\n/**\n * Thrown on a `428`: the action waits for a yes (Settings › API & MCP, the\n * same columns as the MCP) and **nothing was done**. Show {@link preview} to\n * the user; once they said yes, {@link confirm} sends the same request again\n * with {@link confirmationToken} (single use, 15 minutes).\n *\n * try {\n * await nadia.deletePost(id);\n * } catch (err) {\n * if (!(err instanceof NadiaConfirmationRequired)) throw err;\n * console.log(err.preview);\n * if (await askUser('Delete?')) await err.confirm();\n * }\n *\n * `new Nadia(key, { autoConfirm: true })` skips the question: every `428` is\n * confirmed at once — only for a program that already has the user's yes.\n */\nexport class NadiaConfirmationRequired extends NadiaError {\n readonly preview: ConfirmationPreview;\n readonly confirmationToken: string;\n private readonly replay: (token: string) => Promise<unknown>;\n\n constructor(body: unknown, replay: (token: string) => Promise<unknown>) {\n const b = (body ?? {}) as { preview?: unknown; confirmationToken?: unknown; errors?: unknown };\n super(\n 428,\n body,\n typeof b.errors === 'string' ? b.errors : 'This action waits for a yes: nothing was done.'\n );\n this.name = 'NadiaConfirmationRequired';\n this.preview = (b.preview && typeof b.preview === 'object' ? b.preview : {}) as ConfirmationPreview;\n this.confirmationToken = typeof b.confirmationToken === 'string' ? b.confirmationToken : '';\n this.replay = replay;\n Object.setPrototypeOf(this, NadiaConfirmationRequired.prototype);\n }\n\n /** Sends the same request again with the token: the action runs. Resolves to its answer. */\n confirm<T = unknown>(): Promise<T> {\n return this.replay(this.confirmationToken) as Promise<T>;\n }\n}\n\n/** A `428` that carries what a confirmation needs. */\nconst isConfirmation = (status: number, body: unknown) =>\n status === 428 &&\n !!body &&\n typeof body === 'object' &&\n (body as { needsConfirmation?: unknown }).needsConfirmation === true;\n\nexport interface NadiaOptions {\n /** Defaults to `https://app.usenadia.com/api`. */\n baseUrl?: string;\n /** Retries on 429 and 5xx. Default 2, set 0 to disable. */\n retries?: number;\n /** Swap in a custom fetch (tests, proxies, instrumentation). */\n fetch?: typeof fetch;\n /**\n * How {@link Nadia.uploadFromUrl} reads a long import again: every\n * `intervalMs` (default 3000), for `timeoutMs` at most (default 15 min:\n * the server gives a download 10 minutes).\n */\n importPoll?: { intervalMs?: number; timeoutMs?: number };\n /**\n * An action that waits for a yes answers `428` (Settings › API & MCP):\n * by default the SDK throws {@link NadiaConfirmationRequired}. `true`\n * sends the same request again with its token at once, so the action runs.\n * Only for a program that already has the user's yes. Default `false`.\n */\n autoConfirm?: boolean;\n}\n\n/** Shape every generated operation resolves to. */\ntype GeneratedResult<T> = {\n data?: T;\n error?: unknown;\n request?: Request;\n response?: Response;\n};\n\nconst sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));\n\n/* ------------------------------------------------------------------ *\n * Uploads (plan 83): in parts straight to the storage when the server\n * offers it, the whole file through the API otherwise\n * ------------------------------------------------------------------ */\n\n/** What {@link Nadia.upload} resolves to: `id` and `path` go in a post. */\nexport interface UploadedMedia {\n id: string;\n path: string;\n /** In parts or single PUT: the checked type, bytes, seconds (null for an image), size as displayed, codec. */\n contentType?: string;\n size?: number;\n duration?: number | null;\n width?: number;\n height?: number;\n codec?: string;\n /** Through `POST /public/v1/upload`: the library row's other fields. */\n name?: string;\n originalName?: string | null;\n thumbnail?: string | null;\n alt?: string | null;\n}\n\n/** The answer of `POST /public/v1/uploads` (`createUploadUrl` in the MCP). */\ninterface UploadSession {\n uploadId: string;\n uploadUrl: string;\n headers?: Record<string, string>;\n /** Absent: the server takes a single PUT of the whole file. */\n partSize?: number;\n parts?: number;\n}\n\n/**\n * The answer of `POST /public/v1/upload-from-url` past 25 s, and of\n * `GET /public/v1/upload-from-url/{importId}` (plan 65).\n */\ninterface UrlImport {\n id: string;\n status: 'running' | 'done' | 'failed';\n media: UploadedMedia | null;\n error: { statusCode: number; msg: string } | null;\n}\n\n/** An import answered 202, not yet a media (a media has a `path`). */\nconst isUrlImport = (v: unknown): v is UrlImport =>\n !!v &&\n typeof v === 'object' &&\n typeof (v as UrlImport).id === 'string' &&\n typeof (v as UrlImport).status === 'string' &&\n !('path' in (v as object));\n\n/** The types the upload in parts takes; anything else goes whole. */\nconst DIRECT_TYPES: Record<string, string> = {\n mp4: 'video/mp4',\n jpg: 'image/jpeg',\n jpeg: 'image/jpeg',\n png: 'image/png',\n webp: 'image/webp',\n gif: 'image/gif',\n};\n\n/** Parts sent at once (4: what was measured on 2026-11-29, plan 83). */\nconst PARALLEL_PARTS = 4;\n/** Tries of one part, on a network error, a 5xx or a 429. */\nconst PART_TRIES = 3;\n/** Confirms of one upload: the first, then after sending what was missing. */\nconst UPLOAD_ROUNDS = 4;\n\nfunction directType(name: string, blobType: string): string | undefined {\n const ext = /\\.([a-z0-9]+)$/i.exec(name)?.[1]?.toLowerCase();\n if (ext && DIRECT_TYPES[ext]) return DIRECT_TYPES[ext];\n return Object.values(DIRECT_TYPES).includes(blobType) ? blobType : undefined;\n}\n\n/**\n * The type a file of this name is sent in parts as (`video/mp4`,\n * `image/jpeg`…), or `undefined` when {@link Nadia.upload} sends it whole\n * through `POST /public/v1/upload` (HEIC, MOV, AVIF…).\n */\nexport const uploadContentType = (filename: string): string | undefined => directType(filename, '');\n\n/**\n * A path becomes a Blob of the file (`fs.openAsBlob`, read lazily, Node ≥ 20;\n * read whole before that), named after it.\n */\nasync function openSource(file: string | Blob, filename?: string) {\n if (typeof file !== 'string') {\n const own = (file as File).name;\n return { blob: file, name: filename ?? (own || 'upload') };\n }\n const fs = await import('node:fs');\n const { basename } = await import('node:path');\n const blob: Blob =\n typeof (fs as { openAsBlob?: unknown }).openAsBlob === 'function'\n ? await (fs as unknown as { openAsBlob: (p: string) => Promise<Blob> }).openAsBlob(file)\n : new Blob([await fs.promises.readFile(file)]);\n return { blob, name: filename ?? basename(file) };\n}\n\nconst range = (from: number, to: number) => Array.from({ length: to - from + 1 }, (_, i) => from + i);\n\n/** The parts a 409 UPLOAD_INCOMPLETE names. */\nfunction missingParts(body: unknown): number[] {\n const list = (body as { missingParts?: unknown } | undefined)?.missingParts;\n return Array.isArray(list) ? list.filter((n): n is number => Number.isInteger(n) && n > 0) : [];\n}\n\n/**\n * Reads the API's error message without assuming it is there: `{ msg }` is\n * the documented shape, but a request rejected by validation comes back in\n * the framework's own `{ message: string[] }`, and that list is the only\n * place saying which field is wrong.\n */\nconst messageOf = (body: unknown): string | undefined => {\n if (!body || typeof body !== 'object') return undefined;\n const { msg, message } = body as { msg?: unknown; message?: unknown };\n if (typeof msg === 'string') return msg;\n if (typeof message === 'string') return message;\n if (Array.isArray(message) && message.length && message.every((m) => typeof m === 'string')) {\n return message.join('; ');\n }\n return undefined;\n};\n\nexport class Nadia {\n private readonly client: typeof generatedClient;\n private readonly retries: number;\n /** For the bytes of an upload, which go to the upload host, not the API. */\n private readonly fetchImpl: typeof fetch;\n private readonly importPoll: { intervalMs: number; timeoutMs: number };\n private readonly autoConfirm: boolean;\n\n constructor(apiKey: string, options: string | NadiaOptions = {}) {\n if (!apiKey) {\n throw new Error('An API key is required.');\n }\n\n // The second argument may also be a base URL string.\n const opts: NadiaOptions =\n typeof options === 'string' ? { baseUrl: options } : options;\n\n this.retries = opts.retries ?? 2;\n this.fetchImpl = opts.fetch ?? ((input, init) => fetch(input, init));\n this.autoConfirm = opts.autoConfirm ?? false;\n this.importPoll = {\n intervalMs: opts.importPoll?.intervalMs ?? 3000,\n timeoutMs: opts.importPoll?.timeoutMs ?? 15 * 60 * 1000,\n };\n\n this.client = generatedClient;\n this.client.setConfig({\n baseUrl: opts.baseUrl ?? DEFAULT_BASE_URL,\n headers: { Authorization: apiKey },\n ...(opts.fetch ? { fetch: opts.fetch } : {}),\n });\n }\n\n /**\n * Runs a generated operation, turns a non-2xx into a `NadiaError`, and\n * retries the transient ones. Every method below goes through here — that is\n * the whole point of the facade.\n */\n private async call<T>(\n operation: (options: { client: typeof generatedClient }) => Promise<\n GeneratedResult<T>\n >,\n confirmationToken?: string\n ): Promise<T> {\n let lastError: NadiaError | undefined;\n // The confirmed request is the same one, plus `?confirmationToken=`: the\n // operation is run again with a fetch that adds it to the URL, so its\n // path, query and body are rebuilt exactly as the first time.\n const options = confirmationToken\n ? { client: this.client, fetch: this.withToken(confirmationToken) }\n : { client: this.client };\n\n for (let attempt = 0; attempt <= this.retries; attempt++) {\n const { data, error, response } = await operation(options);\n\n // No response at all means the request never completed (DNS, TLS,\n // connection reset). Surfaced as status 0 rather than a bare TypeError.\n if (!response) {\n lastError = new NadiaError(0, error, 'The request did not complete.');\n } else if (response.ok) {\n return data as T;\n } else if (isConfirmation(response.status, error)) {\n const replay = (token: string) => this.call(operation, token);\n const required = new NadiaConfirmationRequired(error, replay);\n // Once only: a second 428 (another body, an expired token) is thrown.\n if (this.autoConfirm && !confirmationToken && required.confirmationToken) {\n return replay(required.confirmationToken);\n }\n throw required;\n } else {\n lastError = new NadiaError(response.status, error, messageOf(error));\n }\n\n if (!lastError.isTransient || attempt === this.retries) {\n throw lastError;\n }\n\n await sleep(2 ** attempt * 500);\n }\n\n throw lastError;\n }\n\n /** A fetch that sends each request with `?confirmationToken=<token>`. */\n private withToken(token: string): typeof fetch {\n return (async (input: RequestInfo | URL, init?: RequestInit) => {\n const req = input instanceof Request ? input : new Request(input, init);\n const url = new URL(req.url);\n url.searchParams.set('confirmationToken', token);\n const body = req.body ? await req.arrayBuffer() : undefined;\n return this.fetchImpl(\n new Request(url, { method: req.method, headers: req.headers, body, signal: req.signal })\n );\n }) as typeof fetch;\n }\n\n /* --------------------------------------------------------------- *\n * The five basic calls\n * --------------------------------------------------------------- */\n\n /** Schedule, publish or draft a post on one or more channels. */\n post(body: CreatePostBody) {\n return this.call((o) =>\n api.createPost({ ...o, body: body as never })\n );\n }\n\n /** List posts in a date range. */\n postList(query?: Record<string, unknown>) {\n return this.call((o) =>\n api.listPosts({ ...o, query: query as never })\n );\n }\n\n /**\n * Upload a file and get a URL usable in a post: a path on disk, or a\n * `Blob` / `File` with its name.\n *\n * An MP4, JPEG, PNG, WebP or GIF goes in parts of 20 MB straight to the\n * storage (`POST /public/v1/uploads`, then its confirm): four parts at a\n * time, a part cut by the network sent again, and the parts the confirm\n * says are missing sent again before confirming once more. A server that\n * does not take parts answers a single PUT, which is done instead; a\n * server without that route (an older release) and any other type\n * (HEIC… which the server converts to JPEG) go through\n * `POST /public/v1/upload`, the whole file in one request, as before. A\n * MOV or an M4V is refused there (`415`): convert it to MP4 first.\n *\n * Resolves to the media: `id` and `path` always (what a post takes),\n * plus `size`, `duration`, `width`, `height`, `codec` when it went in\n * parts or in a single PUT.\n */\n async upload(file: string | Blob | File, filename?: string): Promise<UploadedMedia> {\n const source = await openSource(file, filename);\n const type = directType(source.name, source.blob.type);\n if (!type) return this.uploadWhole(source);\n\n let opened: UploadSession;\n try {\n opened = (await this.call((o) =>\n api.createUpload({\n ...o,\n body: { filename: source.name, contentType: type as never, size: source.blob.size },\n })\n )) as UploadSession;\n } catch (err) {\n // No such route: a server from before the upload in parts.\n if (err instanceof NadiaError && (err.status === 404 || err.status === 405)) {\n return this.uploadWhole(source);\n }\n throw err;\n }\n\n if (opened.parts) {\n await this.sendParts(opened, source.blob, range(1, opened.parts));\n } else {\n await this.sendWhole(opened, source.blob);\n }\n\n for (let round = 1; ; round++) {\n try {\n return (await this.call((o) =>\n api.confirmUpload({ ...o, path: { uploadId: opened.uploadId } })\n )) as UploadedMedia;\n } catch (err) {\n if (!(err instanceof NadiaError) || err.status !== 409 || round >= UPLOAD_ROUNDS) throw err;\n const missing = missingParts(err.body);\n if (missing.length && opened.parts) {\n // What the storage did not get: only those, then confirm again.\n await this.sendParts(opened, source.blob, missing);\n } else if (/^CONFIRM_IN_PROGRESS/.test(err.message)) {\n await sleep(3000);\n } else {\n throw err;\n }\n }\n }\n }\n\n /**\n * Import a file from a public HTTPS URL into the media library\n * (`POST /public/v1/upload-from-url`): the path of the URL ends in `.png`,\n * `.jpg`, `.jpeg`, `.gif`, `.webp` or `.mp4`.\n *\n * A long import (not done within 25 s) is answered `202` by the server and\n * goes on there; it is read again here (`GET\n * /public/v1/upload-from-url/{importId}`) until it ends. Resolves to the\n * media either way; a failed import throws the `NadiaError` the server\n * would have answered at once (its status and `msg`).\n */\n async uploadFromUrl(url: string): Promise<UploadedMedia> {\n const first = await this.call((o) => api.uploadFromUrl({ ...o, body: { url } }));\n return this.importEnd(first);\n }\n\n /**\n * The end of an import from a URL: the media at once (`201`), or an import\n * (`202`) read again every few seconds until it is done or failed.\n */\n private async importEnd(answer: unknown): Promise<UploadedMedia> {\n if (!isUrlImport(answer)) return answer as UploadedMedia;\n const deadline = Date.now() + this.importPoll.timeoutMs;\n let current: UrlImport = answer;\n while (current.status === 'running') {\n if (Date.now() >= deadline) {\n throw new NadiaError(\n 504,\n current,\n `The import from a URL ${current.id} did not end within ${Math.round(this.importPoll.timeoutMs / 1000)} s: read it again with getUploadFromUrl.`\n );\n }\n await sleep(this.importPoll.intervalMs);\n const id = current.id;\n current = (await this.call((o) =>\n api.getUploadFromUrl({ ...o, path: { importId: id } })\n )) as UrlImport;\n }\n if (current.status === 'done' && current.media) return current.media;\n const error = current.error ?? { statusCode: 500, msg: 'The import from a URL failed.' };\n throw new NadiaError(error.statusCode, { msg: error.msg }, error.msg);\n }\n\n /** The whole file in one multipart request: `POST /public/v1/upload`. */\n private uploadWhole(source: { blob: Blob; name: string }): Promise<UploadedMedia> {\n const form = new FormData();\n form.append('file', source.blob, source.name);\n // The generated serializer rebuilds a FormData from a plain object's\n // entries: handed this one, it found none and sent an empty form. It also\n // cannot carry a filename. So the finished form goes out as it is.\n return this.call((o) =>\n api.uploadFile({\n ...o,\n body: form as never,\n bodySerializer: (body: unknown) => body as FormData,\n })\n ) as Promise<UploadedMedia>;\n }\n\n /** Each part to `<uploadUrl>/<n>`, a few at a time, each retried. */\n private async sendParts(opened: UploadSession, blob: Blob, numbers: number[]) {\n const queue = [...numbers];\n const size = opened.partSize!;\n const worker = async () => {\n for (let n = queue.shift(); n !== undefined; n = queue.shift()) {\n const from = (n - 1) * size;\n await this.put(`${opened.uploadUrl}/${n}`, blob.slice(from, Math.min(from + size, blob.size)), {\n 'Content-Type': 'application/octet-stream',\n }, 200);\n }\n };\n await Promise.all(Array.from({ length: Math.min(PARALLEL_PARTS, queue.length) }, worker));\n }\n\n /** The single PUT of a server that takes no parts. */\n private sendWhole(opened: UploadSession, blob: Blob) {\n // fetch counts the length of a Blob itself (and refuses to be told it).\n const headers = Object.fromEntries(\n Object.entries(opened.headers ?? {}).filter(([k]) => k.toLowerCase() !== 'content-length')\n );\n return this.put(opened.uploadUrl, blob, headers, 201);\n }\n\n /**\n * A PUT of raw bytes, without the API key (the URL is the credential):\n * three tries on a network error, a 5xx or a 429, none on anything else.\n */\n private async put(url: string, body: Blob, headers: Record<string, string>, ok: number) {\n let last: NadiaError | undefined;\n for (let attempt = 1; attempt <= PART_TRIES; attempt++) {\n let response: Response | undefined;\n try {\n response = await this.fetchImpl(url, { method: 'PUT', headers, body });\n } catch (err) {\n last = new NadiaError(0, err, `The upload of ${url.replace(/\\/v2\\/[^/]+/, '/v2/…')} did not complete.`);\n }\n if (response) {\n if (response.status === ok || response.ok) {\n await response.body?.cancel();\n return;\n }\n const text = await response.text();\n let parsed: unknown = text;\n try {\n parsed = JSON.parse(text);\n } catch {\n /* not JSON: the text */\n }\n last = new NadiaError(response.status, parsed, messageOf(parsed) ?? `The upload answered ${response.status}`);\n if (!last.isTransient) throw last;\n }\n if (attempt < PART_TRIES) await sleep(attempt * 1000);\n }\n throw last;\n }\n\n /** List your connected channels. */\n integrations() {\n return this.call((o) => api.listChannels(o));\n }\n\n /**\n * Delete a post and everything published with it. Waits for a yes by\n * default: throws {@link NadiaConfirmationRequired} unless `autoConfirm`,\n * or unless the token of that 428 is passed here.\n */\n deletePost(id: string, options: { confirmationToken?: string } = {}) {\n return this.call((o) =>\n api.deletePost({ ...o, path: { id } }),\n options.confirmationToken\n );\n }\n\n /* --------------------------------------------------------------- *\n * The rest of the surface\n * --------------------------------------------------------------- */\n\n /** Check that the API key is valid. Throws `NadiaError` with status 401 if not. */\n async isConnected(): Promise<boolean> {\n await this.call((o) => api.checkConnection(o));\n return true;\n }\n\n /** Next free slot in a channel's schedule. */\n findSlot(integrationId: string) {\n return this.call((o) =>\n api.findSlot({\n ...o,\n path: { id: integrationId },\n })\n );\n }\n\n /** List your groups (brands). */\n groups() {\n return this.call((o) => api.listGroups(o));\n }\n\n /** Direct message conversations of a channel. */\n inbox(integrationId: string, limit?: number) {\n return this.call((o) =>\n api.listConversations({\n ...o,\n path: { integrationId },\n query: (limit ? { limit: String(limit) } : undefined) as never,\n })\n );\n }\n\n /* --------------------------------------------------------------- *\n * The content board: one card per video, from the idea to the\n * numbers after publication\n * --------------------------------------------------------------- */\n\n /**\n * The cards of the board, with the posts scheduled from each. Filters\n * combine: `stage`, `tag`, `externalId`; `fields` (`'id,title,stage'`)\n * leaves the scripts out.\n */\n contents(query?: ListContentsData['query']) {\n return this.call((o) => api.listContents({ ...o, query }));\n }\n\n /** One card. */\n content(id: string) {\n return this.call((o) => api.getContent({ ...o, path: { id } }));\n }\n\n /** Create a card — in IDEA unless `stage` says otherwise. */\n createContent(body: CreateContentDto) {\n return this.call((o) => api.createContent({ ...o, body }));\n }\n\n /**\n * Create or update the card holding `externalId` (your own id: a script\n * file path, a build id). Re-running an import never duplicates; an\n * existing card keeps its column.\n */\n upsertContent(body: UpsertContentDto) {\n return this.call((o) => api.upsertContent({ ...o, body }));\n }\n\n /** Update a card: only the fields sent change, `null` clears one. */\n updateContent(id: string, body: UpdateContentDto) {\n return this.call((o) => api.updateContent({ ...o, path: { id }, body }));\n }\n\n /** Move a card to another column (to the bottom unless `position` is given). */\n moveContent(id: string, stage: ContentStage, position?: number) {\n return this.call((o) =>\n api.moveContent({\n ...o,\n path: { id },\n body: position === undefined ? { stage } : { stage, position },\n })\n );\n }\n\n /**\n * Tie a card to a post scheduled from it — the `group` passed on\n * {@link Nadia.post}. A card holds several posts (a TikTok draft, an\n * Instagram post): each call adds one. The card moves to PUBLISHED when\n * the first of them goes live.\n */\n linkContentPost(id: string, postGroup: string) {\n return this.call((o) =>\n api.linkContentPost({ ...o, path: { id }, body: { postGroup } })\n );\n }\n\n /** Delete a card. Waits for a yes by default, like {@link Nadia.deletePost}. */\n deleteContent(id: string, options: { confirmationToken?: string } = {}) {\n return this.call((o) => api.deleteContent({ ...o, path: { id } }), options.confirmationToken);\n }\n\n /** The numbers of the published cards, keyed by card id. */\n contentsPerformance() {\n return this.call((o) => api.getContentsPerformance(o));\n }\n\n /**\n * Runs any generated operation with the facade's guarantees — a non-2xx\n * throws a `NadiaError`, the transient ones are retried. The way to reach\n * what the facade does not sugar without giving those up.\n *\n * import { getChannelAnalytics } from '@usenadia/node';\n * await nadia.request((o) =>\n * getChannelAnalytics({ ...o, path: { integration: id }, query: { date: '7' } })\n * );\n */\n request<T>(\n operation: (options: { client: typeof generatedClient }) => Promise<\n GeneratedResult<T>\n >\n ): Promise<T> {\n return this.call(operation);\n }\n\n /**\n * The generated client, configured with your key. Use it for any of the\n * operations the facade does not wrap — nothing here is a dead end.\n *\n * import { getChannelAnalytics } from '@usenadia/node';\n * await getChannelAnalytics({ client: nadia.raw, path: {...} });\n */\n get raw() {\n return this.client;\n }\n}\n\nexport default Nadia;\n\n/* ----------------------------------------------------------------- *\n * Webhooks: check that a delivery comes from UseNadia\n * ----------------------------------------------------------------- */\n\n/**\n * What every webhook delivery carries (the JSON body). `data` depends on\n * `event` — `nadia.request(listWebhookEvents)` lists the events.\n */\nexport interface WebhookDelivery<T = unknown> {\n id: string;\n event: string;\n occurredAt: string;\n organizationId: string;\n data: T;\n}\n\nexport interface VerifyWebhookOptions {\n /** The secret returned once, when the webhook was created. */\n secret: string;\n /** The `X-Nadia-Signature` header: `sha256=<hex>`. */\n signature: string | null | undefined;\n /** The `X-Nadia-Timestamp` header, epoch seconds. */\n timestamp: string | number | null | undefined;\n /** The body exactly as received — not a re-serialized `JSON.parse`. */\n body: string | Uint8Array;\n /**\n * Reject deliveries whose timestamp is further than this from now, in\n * seconds (a replayed capture). Not checked when left out.\n */\n tolerance?: number;\n /** Current time in epoch milliseconds — for tests. Defaults to `Date.now()`. */\n now?: number;\n}\n\n/** Why {@link parseWebhook} refused a delivery. */\nexport class NadiaWebhookError extends Error {\n readonly reason: 'missing_header' | 'bad_signature' | 'stale' | 'bad_body';\n\n constructor(reason: NadiaWebhookError['reason'], message: string) {\n super(message);\n this.name = 'NadiaWebhookError';\n this.reason = reason;\n Object.setPrototypeOf(this, NadiaWebhookError.prototype);\n }\n}\n\ntype Check =\n | { ok: true }\n | { ok: false; reason: NadiaWebhookError['reason']; message: string };\n\nfunction checkSignature(o: VerifyWebhookOptions): Check {\n const { secret, signature, timestamp, body } = o;\n if (!signature || timestamp === null || timestamp === undefined || timestamp === '') {\n return { ok: false, reason: 'missing_header', message: 'X-Nadia-Signature or X-Nadia-Timestamp is missing.' };\n }\n const ts = String(timestamp);\n\n if (o.tolerance !== undefined) {\n const seconds = Number(ts);\n const now = (o.now ?? Date.now()) / 1000;\n if (!Number.isFinite(seconds) || Math.abs(now - seconds) > o.tolerance) {\n return { ok: false, reason: 'stale', message: `Timestamp outside the ${o.tolerance}s tolerance.` };\n }\n }\n\n // Signed string: `<timestamp>.<raw body>`, HMAC-SHA256 hex, `sha256=` prefix.\n const expected = Buffer.from(\n 'sha256=' + createHmac('sha256', secret).update(`${ts}.`).update(body).digest('hex')\n );\n const received = Buffer.from(signature);\n // timingSafeEqual throws on different lengths; the length itself is public.\n if (received.length !== expected.length || !timingSafeEqual(received, expected)) {\n return { ok: false, reason: 'bad_signature', message: 'Signature does not match.' };\n }\n return { ok: true };\n}\n\n/**\n * True when the delivery was signed with `secret`. Compared in constant time.\n * Pass the **raw** body: a parsed and re-serialized one will not match.\n */\nexport function verifyWebhookSignature(options: VerifyWebhookOptions): boolean {\n return checkSignature(options).ok;\n}\n\n/**\n * Verifies a delivery and returns it parsed — or throws `NadiaWebhookError`.\n * Unlike {@link verifyWebhookSignature}, the timestamp is checked by\n * default (300 s, the margin a retry needs); `tolerance: Infinity` turns it off.\n *\n * `headers` takes a Node `req.headers` object or a `Headers` instance.\n */\nexport function parseWebhook<T = unknown>(options: {\n secret: string;\n headers: Headers | Record<string, string | string[] | undefined>;\n body: string | Uint8Array;\n tolerance?: number;\n now?: number;\n}): WebhookDelivery<T> {\n const header = (name: string): string | undefined => {\n const h = options.headers;\n if (typeof (h as Headers).get === 'function') return (h as Headers).get(name) ?? undefined;\n const record = h as Record<string, string | string[] | undefined>;\n const key = Object.keys(record).find((k) => k.toLowerCase() === name.toLowerCase());\n const value = key === undefined ? undefined : record[key];\n return Array.isArray(value) ? value[0] : value;\n };\n\n const check = checkSignature({\n secret: options.secret,\n signature: header('X-Nadia-Signature'),\n timestamp: header('X-Nadia-Timestamp'),\n body: options.body,\n tolerance: options.tolerance ?? 300,\n now: options.now,\n });\n if (!check.ok) throw new NadiaWebhookError(check.reason, check.message);\n\n try {\n const text = typeof options.body === 'string' ? options.body : new TextDecoder().decode(options.body);\n return JSON.parse(text) as WebhookDelivery<T>;\n } catch {\n throw new NadiaWebhookError('bad_body', 'The body is not JSON.');\n }\n}\n\n/** Every generated operation and type, so nothing is out of reach. */\nexport * from './generated/sdk.gen';\nexport * from './generated/types.gen';\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerializer.gen';\n\nexport type QuerySerializer = (query: Record<string, unknown>) => string;\n\nexport type BodySerializer = (body: unknown) => unknown;\n\ntype QuerySerializerOptionsObject = {\n allowReserved?: boolean;\n array?: Partial<SerializerOptions<ArrayStyle>>;\n object?: Partial<SerializerOptions<ObjectStyle>>;\n};\n\nexport type QuerySerializerOptions = QuerySerializerOptionsObject & {\n /**\n * Per-parameter serialization overrides. When provided, these settings\n * override the global array/object settings for specific parameter names.\n */\n parameters?: Record<string, QuerySerializerOptionsObject>;\n};\n\nconst serializeFormDataPair = (data: FormData, key: string, value: unknown): void => {\n if (typeof value === 'string' || value instanceof Blob) {\n data.append(key, value);\n } else if (value instanceof Date) {\n data.append(key, value.toISOString());\n } else {\n data.append(key, JSON.stringify(value));\n }\n};\n\nconst serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value: unknown): void => {\n if (typeof value === 'string') {\n data.append(key, value);\n } else {\n data.append(key, JSON.stringify(value));\n }\n};\n\nexport const formDataBodySerializer = {\n bodySerializer: (body: unknown): FormData => {\n const data = new FormData();\n\n Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {\n if (value === undefined || value === null) {\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((v) => serializeFormDataPair(data, key, v));\n } else {\n serializeFormDataPair(data, key, value);\n }\n });\n\n return data;\n },\n};\n\nexport const jsonBodySerializer = {\n bodySerializer: (body: unknown): string =>\n JSON.stringify(body, (_key, value) => (typeof value === 'bigint' ? value.toString() : value)),\n};\n\nexport const urlSearchParamsBodySerializer = {\n bodySerializer: (body: unknown): string => {\n const data = new URLSearchParams();\n\n Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {\n if (value === undefined || value === null) {\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((v) => serializeUrlSearchParamsPair(data, key, v));\n } else {\n serializeUrlSearchParamsPair(data, key, value);\n }\n });\n\n return data.toString();\n },\n};\n","// This file is auto-generated by @hey-api/openapi-ts\n\ntype Slot = 'body' | 'headers' | 'path' | 'query';\n\nexport type Field =\n | {\n in: Exclude<Slot, 'body'>;\n /**\n * Field name. This is the name we want the user to see and use.\n */\n key: string;\n /**\n * Field mapped name. This is the name we want to use in the request.\n * If omitted, we use the same value as `key`.\n */\n map?: string;\n }\n | {\n in: Extract<Slot, 'body'>;\n /**\n * Key isn't required for bodies.\n */\n key?: string;\n map?: string;\n }\n | {\n /**\n * Field name. This is the name we want the user to see and use.\n */\n key: string;\n /**\n * Field mapped name. This is the name we want to use in the request.\n * If `in` is omitted, `map` aliases `key` to the transport layer.\n */\n map: Slot;\n };\n\nexport interface Fields {\n allowExtra?: Partial<Record<Slot, boolean>>;\n args?: ReadonlyArray<Field>;\n}\n\nexport type FieldsConfig = ReadonlyArray<Field | Fields>;\n\nconst extraPrefixesMap: Record<string, Slot> = {\n $body_: 'body',\n $headers_: 'headers',\n $path_: 'path',\n $query_: 'query',\n};\nconst extraPrefixes = Object.entries(extraPrefixesMap);\n\ntype KeyMap = Map<\n string,\n | {\n in: Slot;\n map?: string;\n }\n | {\n in?: never;\n map: Slot;\n }\n>;\n\nfunction buildKeyMap(fields: FieldsConfig, map?: KeyMap): KeyMap {\n if (!map) {\n map = new Map();\n }\n\n for (const config of fields) {\n if ('in' in config) {\n if (config.key) {\n map.set(config.key, {\n in: config.in,\n map: config.map,\n });\n }\n } else if ('key' in config) {\n map.set(config.key, {\n map: config.map,\n });\n } else if (config.args) {\n buildKeyMap(config.args, map);\n }\n }\n\n return map;\n}\n\ninterface Params {\n body?: unknown;\n headers: Record<string, unknown>;\n path: Record<string, unknown>;\n query: Record<string, unknown>;\n}\n\nfunction stripEmptySlots(params: Params): void {\n for (const [slot, value] of Object.entries(params)) {\n if (slot === 'body') continue;\n if (value && typeof value === 'object' && !Array.isArray(value) && !Object.keys(value).length) {\n delete params[slot as Slot];\n }\n }\n}\n\nexport function buildClientParams(args: ReadonlyArray<unknown>, fields: FieldsConfig): Params {\n const params: Params = {\n headers: Object.create(null),\n path: Object.create(null),\n query: Object.create(null),\n };\n\n const map = buildKeyMap(fields);\n\n function writeSlot(slot: Slot, key: string, value: unknown): void {\n let record = params[slot] as Record<string, unknown> | undefined;\n if (record === undefined) {\n record = Object.create(null) as Record<string, unknown>;\n params[slot] = record;\n }\n record[key] = value;\n }\n\n let config: FieldsConfig[number] | undefined;\n\n for (const [index, arg] of args.entries()) {\n if (fields[index]) {\n config = fields[index];\n }\n\n if (!config) {\n continue;\n }\n\n if ('in' in config) {\n if (config.key) {\n const field = map.get(config.key)!;\n const name = field.map || config.key;\n if (field.in) {\n writeSlot(field.in, name, arg);\n }\n } else {\n params.body = arg;\n }\n } else {\n for (const [key, value] of Object.entries(arg ?? {})) {\n const field = map.get(key);\n\n if (field) {\n if (field.in) {\n const name = field.map || key;\n writeSlot(field.in, name, value);\n } else {\n params[field.map] = value;\n }\n } else {\n const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix));\n\n if (extra) {\n const [prefix, slot] = extra;\n writeSlot(slot, key.slice(prefix.length), value);\n } else if ('allowExtra' in config && config.allowExtra) {\n for (const [slot, allowed] of Object.entries(config.allowExtra)) {\n if (allowed) {\n writeSlot(slot as Slot, key, value);\n break;\n }\n }\n }\n }\n }\n }\n }\n\n stripEmptySlots(params);\n\n return params;\n}\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { Config } from './types.gen';\n\nexport type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> &\n Pick<Config, 'method' | 'responseTransformer' | 'responseValidator'> & {\n /**\n * Fetch API implementation. You can use this option to provide a custom\n * fetch instance.\n *\n * @default globalThis.fetch\n */\n fetch?: typeof fetch;\n /**\n * Implementing clients can call request interceptors inside this hook.\n */\n onRequest?: (url: string, init: RequestInit) => Promise<Request>;\n /**\n * Callback invoked when a network or parsing error occurs during streaming.\n *\n * This option applies only if the endpoint returns a stream of events.\n *\n * @param error The error that occurred.\n */\n onSseError?: (error: unknown) => void;\n /**\n * Callback invoked when an event is streamed from the server.\n *\n * This option applies only if the endpoint returns a stream of events.\n *\n * @param event Event streamed from the server.\n * @returns Nothing (void).\n */\n onSseEvent?: (event: StreamEvent<TData>) => void;\n serializedBody?: RequestInit['body'];\n /**\n * Default retry delay in milliseconds.\n *\n * This option applies only if the endpoint returns a stream of events.\n *\n * @default 3000\n */\n sseDefaultRetryDelay?: number;\n /**\n * Maximum number of retry attempts before giving up.\n */\n sseMaxRetryAttempts?: number;\n /**\n * Maximum retry delay in milliseconds.\n *\n * Applies only when exponential backoff is used.\n *\n * This option applies only if the endpoint returns a stream of events.\n *\n * @default 30000\n */\n sseMaxRetryDelay?: number;\n /**\n * Optional sleep function for retry backoff.\n *\n * Defaults to using `setTimeout`.\n */\n sseSleepFn?: (ms: number) => Promise<void>;\n url: string;\n };\n\nexport interface StreamEvent<TData = unknown> {\n data: TData;\n event?: string;\n id?: string;\n retry?: number;\n}\n\nexport type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {\n stream: AsyncGenerator<\n TData extends Record<string, unknown> ? TData[keyof TData] : TData,\n TReturn,\n TNext\n >;\n};\n\nexport function createSseClient<TData = unknown>({\n onRequest,\n onSseError,\n onSseEvent,\n responseTransformer,\n responseValidator,\n sseDefaultRetryDelay,\n sseMaxRetryAttempts,\n sseMaxRetryDelay,\n sseSleepFn,\n url,\n ...options\n}: ServerSentEventsOptions): ServerSentEventsResult<TData> {\n let lastEventId: string | undefined;\n\n const sleep = sseSleepFn ?? ((ms: number) => new Promise((resolve) => setTimeout(resolve, ms)));\n\n const createStream = async function* () {\n let retryDelay: number = sseDefaultRetryDelay ?? 3000;\n let attempt = 0;\n const signal = options.signal ?? new AbortController().signal;\n\n while (true) {\n if (signal.aborted) break;\n\n attempt++;\n\n const headers =\n options.headers instanceof Headers\n ? options.headers\n : new Headers(options.headers as Record<string, string> | undefined);\n\n if (lastEventId !== undefined) {\n headers.set('Last-Event-ID', lastEventId);\n }\n\n try {\n const requestInit: RequestInit = {\n redirect: 'follow',\n ...options,\n body: options.serializedBody,\n headers,\n signal,\n };\n let request = new Request(url, requestInit);\n if (onRequest) {\n request = await onRequest(url, requestInit);\n }\n // fetch must be assigned here, otherwise it would throw the error:\n // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation\n const _fetch = options.fetch ?? globalThis.fetch;\n const response = await _fetch(request);\n\n if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`);\n\n if (!response.body) throw new Error('No body in SSE response');\n\n const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();\n\n let buffer = '';\n\n const abortHandler = () => {\n try {\n reader.cancel();\n } catch {\n // noop\n }\n };\n\n signal.addEventListener('abort', abortHandler);\n\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n buffer += value;\n buffer = buffer.replace(/\\r\\n?/g, '\\n'); // normalize line endings\n\n const chunks = buffer.split('\\n\\n');\n buffer = chunks.pop() ?? '';\n\n for (const chunk of chunks) {\n const lines = chunk.split('\\n');\n const dataLines: Array<string> = [];\n let eventName: string | undefined;\n\n for (const line of lines) {\n if (line.startsWith('data:')) {\n dataLines.push(line.replace(/^data:\\s*/, ''));\n } else if (line.startsWith('event:')) {\n eventName = line.replace(/^event:\\s*/, '');\n } else if (line.startsWith('id:')) {\n lastEventId = line.replace(/^id:\\s*/, '');\n } else if (line.startsWith('retry:')) {\n const parsed = Number.parseInt(line.replace(/^retry:\\s*/, ''), 10);\n if (!Number.isNaN(parsed)) {\n retryDelay = parsed;\n }\n }\n }\n\n let data: unknown;\n let parsedJson = false;\n\n if (dataLines.length) {\n const rawData = dataLines.join('\\n');\n try {\n data = JSON.parse(rawData);\n parsedJson = true;\n } catch {\n data = rawData;\n }\n }\n\n if (parsedJson) {\n if (responseValidator) {\n await responseValidator(data);\n }\n\n if (responseTransformer) {\n data = await responseTransformer(data);\n }\n }\n\n onSseEvent?.({\n data,\n event: eventName,\n id: lastEventId,\n retry: retryDelay,\n });\n\n if (dataLines.length) {\n yield data as any;\n }\n }\n }\n } finally {\n signal.removeEventListener('abort', abortHandler);\n reader.releaseLock();\n }\n\n break; // exit loop on normal completion\n } catch (error) {\n // connection failed or aborted; retry after delay\n onSseError?.(error);\n\n if (sseMaxRetryAttempts !== undefined && attempt >= sseMaxRetryAttempts) {\n break; // stop after firing error\n }\n\n // exponential backoff: double retry each attempt, cap at 30s\n const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 30000);\n await sleep(backoff);\n }\n }\n };\n\n const stream = createStream();\n\n return { stream };\n}\n","// This file is auto-generated by @hey-api/openapi-ts\n\ninterface SerializeOptions<T> extends SerializePrimitiveOptions, SerializerOptions<T> {}\n\ninterface SerializePrimitiveOptions {\n allowReserved?: boolean;\n name: string;\n}\n\nexport interface SerializerOptions<T> {\n /**\n * @default true\n */\n explode: boolean;\n style: T;\n}\n\nexport type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';\nexport type ArraySeparatorStyle = ArrayStyle | MatrixStyle;\ntype MatrixStyle = 'label' | 'matrix' | 'simple';\nexport type ObjectStyle = 'form' | 'deepObject';\ntype ObjectSeparatorStyle = ObjectStyle | MatrixStyle;\n\ninterface SerializePrimitiveParam extends SerializePrimitiveOptions {\n value: string;\n}\n\nexport const separatorArrayExplode = (style: ArraySeparatorStyle): '.' | ';' | ',' | '&' => {\n switch (style) {\n case 'label':\n return '.';\n case 'matrix':\n return ';';\n case 'simple':\n return ',';\n default:\n return '&';\n }\n};\n\nexport const separatorArrayNoExplode = (style: ArraySeparatorStyle): ',' | '|' | '%20' => {\n switch (style) {\n case 'form':\n return ',';\n case 'pipeDelimited':\n return '|';\n case 'spaceDelimited':\n return '%20';\n default:\n return ',';\n }\n};\n\nexport const separatorObjectExplode = (style: ObjectSeparatorStyle): '.' | ';' | ',' | '&' => {\n switch (style) {\n case 'label':\n return '.';\n case 'matrix':\n return ';';\n case 'simple':\n return ',';\n default:\n return '&';\n }\n};\n\nexport const serializeArrayParam = ({\n allowReserved,\n explode,\n name,\n style,\n value,\n}: SerializeOptions<ArraySeparatorStyle> & {\n value: unknown[];\n}): string => {\n if (!explode) {\n const joinedValues = (\n allowReserved ? value : value.map((v) => encodeURIComponent(v as string))\n ).join(separatorArrayNoExplode(style));\n switch (style) {\n case 'label':\n return `.${joinedValues}`;\n case 'matrix':\n return `;${name}=${joinedValues}`;\n case 'simple':\n return joinedValues;\n default:\n return `${name}=${joinedValues}`;\n }\n }\n\n const separator = separatorArrayExplode(style);\n const joinedValues = value\n .map((v) => {\n if (style === 'label' || style === 'simple') {\n return allowReserved ? v : encodeURIComponent(v as string);\n }\n\n return serializePrimitiveParam({\n allowReserved,\n name,\n value: v as string,\n });\n })\n .join(separator);\n return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues;\n};\n\nexport const serializePrimitiveParam = ({\n allowReserved,\n name,\n value,\n}: SerializePrimitiveParam): string => {\n if (value === undefined || value === null) {\n return '';\n }\n\n if (typeof value === 'object') {\n throw new Error(\n 'Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.',\n );\n }\n\n return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;\n};\n\nexport const serializeObjectParam = ({\n allowReserved,\n explode,\n name,\n style,\n value,\n valueOnly,\n}: SerializeOptions<ObjectSeparatorStyle> & {\n value: Record<string, unknown> | Date;\n valueOnly?: boolean;\n}): string => {\n if (value instanceof Date) {\n return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;\n }\n\n if (style !== 'deepObject' && !explode) {\n let values: string[] = [];\n Object.entries(value).forEach(([key, v]) => {\n values = [...values, key, allowReserved ? (v as string) : encodeURIComponent(v as string)];\n });\n const joinedValues = values.join(',');\n switch (style) {\n case 'form':\n return `${name}=${joinedValues}`;\n case 'label':\n return `.${joinedValues}`;\n case 'matrix':\n return `;${name}=${joinedValues}`;\n default:\n return joinedValues;\n }\n }\n\n const separator = separatorObjectExplode(style);\n const joinedValues = Object.entries(value)\n .map(([key, v]) =>\n serializePrimitiveParam({\n allowReserved,\n name: style === 'deepObject' ? `${name}[${key}]` : key,\n value: v as string,\n }),\n )\n .join(separator);\n return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues;\n};\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { BodySerializer, QuerySerializer } from './bodySerializer.gen';\nimport {\n type ArraySeparatorStyle,\n serializeArrayParam,\n serializeObjectParam,\n serializePrimitiveParam,\n} from './pathSerializer.gen';\n\nexport interface PathSerializer {\n path: Record<string, unknown>;\n url: string;\n}\n\nexport const PATH_PARAM_RE: RegExp = /\\{[^{}]+\\}/g;\n\nexport const defaultPathSerializer = ({ path, url: _url }: PathSerializer): string => {\n let url = _url;\n const matches = _url.match(PATH_PARAM_RE);\n if (matches) {\n for (const match of matches) {\n let explode = false;\n let name = match.substring(1, match.length - 1);\n let style: ArraySeparatorStyle = 'simple';\n\n if (name.endsWith('*')) {\n explode = true;\n name = name.substring(0, name.length - 1);\n }\n\n if (name.startsWith('.')) {\n name = name.substring(1);\n style = 'label';\n } else if (name.startsWith(';')) {\n name = name.substring(1);\n style = 'matrix';\n }\n\n const value = path[name];\n\n if (value === undefined || value === null) {\n continue;\n }\n\n if (Array.isArray(value)) {\n url = url.replace(match, serializeArrayParam({ explode, name, style, value }));\n continue;\n }\n\n if (typeof value === 'object') {\n url = url.replace(\n match,\n serializeObjectParam({\n explode,\n name,\n style,\n value: value as Record<string, unknown>,\n valueOnly: true,\n }),\n );\n continue;\n }\n\n if (style === 'matrix') {\n url = url.replace(\n match,\n `;${serializePrimitiveParam({\n name,\n value: value as string,\n })}`,\n );\n continue;\n }\n\n const replaceValue = encodeURIComponent(\n style === 'label' ? `.${value as string}` : (value as string),\n );\n url = url.replace(match, replaceValue);\n }\n }\n return url;\n};\n\nexport const getUrl = ({\n baseUrl,\n path,\n query,\n querySerializer,\n url: _url,\n}: {\n baseUrl?: string;\n path?: Record<string, unknown>;\n query?: Record<string, unknown>;\n querySerializer: QuerySerializer;\n url: string;\n}): string => {\n const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;\n let url = (baseUrl ?? '') + pathUrl;\n if (path) {\n url = defaultPathSerializer({ path, url });\n }\n let search = query ? querySerializer(query) : '';\n if (search.startsWith('?')) {\n search = search.substring(1);\n }\n if (search) {\n url += `?${search}`;\n }\n return url;\n};\n\nexport function getValidRequestBody(options: {\n body?: unknown;\n bodySerializer?: BodySerializer | null;\n serializedBody?: unknown;\n}): unknown {\n const hasBody = options.body !== undefined;\n const isSerializedBody = hasBody && options.bodySerializer;\n\n if (isSerializedBody) {\n if ('serializedBody' in options) {\n const hasSerializedBody =\n options.serializedBody !== undefined && options.serializedBody !== '';\n\n return hasSerializedBody ? options.serializedBody : null;\n }\n\n // not all clients implement a serializedBody property (i.e., client-axios)\n return options.body !== '' ? options.body : null;\n }\n\n // plain/text body\n if (hasBody) {\n return options.body;\n }\n\n // no body was provided\n return undefined;\n}\n","// This file is auto-generated by @hey-api/openapi-ts\n\nexport type AuthToken = string | undefined;\n\nexport interface Auth {\n /**\n * Which part of the request do we use to send the auth?\n *\n * @default 'header'\n */\n in?: 'header' | 'query' | 'cookie';\n /**\n * A unique identifier for the security scheme.\n *\n * Defined only when there are multiple security schemes whose `Auth`\n * shape would otherwise be identical.\n */\n key?: string;\n /**\n * Header or query parameter name.\n *\n * @default 'Authorization'\n */\n name?: string;\n scheme?: 'basic' | 'bearer';\n type: 'apiKey' | 'http';\n}\n\nexport const getAuthToken = async (\n auth: Auth,\n callback: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken,\n): Promise<string | undefined> => {\n const token = typeof callback === 'function' ? await callback(auth) : callback;\n\n if (!token) {\n return;\n }\n\n if (auth.scheme === 'bearer') {\n return `Bearer ${token}`;\n }\n\n if (auth.scheme === 'basic') {\n return `Basic ${btoa(token)}`;\n }\n\n return token;\n};\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport { getAuthToken } from '../core/auth.gen';\nimport type { QuerySerializerOptions } from '../core/bodySerializer.gen';\nimport { jsonBodySerializer } from '../core/bodySerializer.gen';\nimport {\n serializeArrayParam,\n serializeObjectParam,\n serializePrimitiveParam,\n} from '../core/pathSerializer.gen';\nimport { getUrl } from '../core/utils.gen';\nimport type { Client, ClientOptions, Config, RequestOptions } from './types.gen';\n\nexport const createQuerySerializer = <T = unknown>({\n parameters = {},\n ...args\n}: QuerySerializerOptions = {}): ((queryParams: T) => string) => {\n const querySerializer = (queryParams: T): string => {\n const search: string[] = [];\n if (queryParams && typeof queryParams === 'object') {\n for (const name in queryParams) {\n const value = queryParams[name];\n\n if (value === undefined || value === null) {\n continue;\n }\n\n const options = parameters[name] || args;\n\n if (Array.isArray(value)) {\n const serializedArray = serializeArrayParam({\n allowReserved: options.allowReserved,\n explode: true,\n name,\n style: 'form',\n value,\n ...options.array,\n });\n if (serializedArray) search.push(serializedArray);\n } else if (typeof value === 'object') {\n const serializedObject = serializeObjectParam({\n allowReserved: options.allowReserved,\n explode: true,\n name,\n style: 'deepObject',\n value: value as Record<string, unknown>,\n ...options.object,\n });\n if (serializedObject) search.push(serializedObject);\n } else {\n const serializedPrimitive = serializePrimitiveParam({\n allowReserved: options.allowReserved,\n name,\n value: value as string,\n });\n if (serializedPrimitive) search.push(serializedPrimitive);\n }\n }\n }\n return search.join('&');\n };\n return querySerializer;\n};\n\n/**\n * Infers parseAs value from provided Content-Type header.\n */\nexport const getParseAs = (contentType: string | null): Exclude<Config['parseAs'], 'auto'> => {\n if (!contentType) {\n // If no Content-Type header is provided, the best we can do is return the raw response body,\n // which is effectively the same as the 'stream' option.\n return 'stream';\n }\n\n const cleanContent = contentType.split(';')[0]?.trim();\n\n if (!cleanContent) {\n return;\n }\n\n if (cleanContent.startsWith('application/json') || cleanContent.endsWith('+json')) {\n return 'json';\n }\n\n if (cleanContent === 'multipart/form-data') {\n return 'formData';\n }\n\n if (\n ['application/', 'audio/', 'image/', 'video/'].some((type) => cleanContent.startsWith(type))\n ) {\n return 'blob';\n }\n\n if (cleanContent.startsWith('text/')) {\n return 'text';\n }\n\n return;\n};\n\nconst checkForExistence = (\n options: Pick<RequestOptions, 'auth' | 'query'> & {\n headers: Headers;\n },\n name?: string,\n): boolean => {\n if (!name) {\n return false;\n }\n if (\n options.headers.has(name) ||\n options.query?.[name] ||\n options.headers.get('Cookie')?.includes(`${name}=`)\n ) {\n return true;\n }\n return false;\n};\n\nexport async function setAuthParams(\n options: Pick<RequestOptions, 'auth' | 'query' | 'security'> & {\n headers: Headers;\n },\n): Promise<void> {\n for (const auth of options.security ?? []) {\n if (checkForExistence(options, auth.name)) {\n continue;\n }\n\n const token = await getAuthToken(auth, options.auth);\n\n if (!token) {\n continue;\n }\n\n const name = auth.name ?? 'Authorization';\n\n switch (auth.in) {\n case 'query':\n if (!options.query) {\n options.query = {};\n }\n options.query[name] = token;\n break;\n case 'cookie':\n options.headers.append('Cookie', `${name}=${token}`);\n break;\n case 'header':\n default:\n options.headers.set(name, token);\n break;\n }\n }\n}\n\nexport const buildUrl: Client['buildUrl'] = (options) =>\n getUrl({\n baseUrl: options.baseUrl as string,\n path: options.path,\n query: options.query,\n querySerializer:\n typeof options.querySerializer === 'function'\n ? options.querySerializer\n : createQuerySerializer(options.querySerializer),\n url: options.url,\n });\n\nexport const mergeConfigs = (a: Config, b: Config): Config => {\n const config = { ...a, ...b };\n if (config.baseUrl?.endsWith('/')) {\n config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1);\n }\n config.headers = mergeHeaders(a.headers, b.headers);\n return config;\n};\n\nconst headersEntries = (headers: Headers): Array<[string, string]> => {\n const entries: Array<[string, string]> = [];\n headers.forEach((value, key) => {\n entries.push([key, value]);\n });\n return entries;\n};\n\nexport const mergeHeaders = (\n ...headers: Array<Required<Config>['headers'] | undefined>\n): Headers => {\n const mergedHeaders = new Headers();\n for (const header of headers) {\n if (!header) {\n continue;\n }\n\n const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);\n\n for (const [key, value] of iterator) {\n if (value === null) {\n mergedHeaders.delete(key);\n } else if (Array.isArray(value)) {\n for (const v of value) {\n mergedHeaders.append(key, v as string);\n }\n } else if (value !== undefined) {\n // assume object headers are meant to be JSON stringified, i.e., their\n // content value in OpenAPI specification is 'application/json'\n mergedHeaders.set(\n key,\n typeof value === 'object' ? JSON.stringify(value) : (value as string),\n );\n }\n }\n }\n return mergedHeaders;\n};\n\ntype ErrInterceptor<Err, Res, Req, Options> = (\n error: Err,\n /** response may be undefined due to a network error where no response object is produced */\n response: Res | undefined,\n /** request may be undefined, because error may be from building the request object itself */\n request: Req | undefined,\n options: Options,\n) => Err | Promise<Err>;\n\ntype ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;\n\ntype ResInterceptor<Res, Req, Options> = (\n response: Res,\n request: Req,\n options: Options,\n) => Res | Promise<Res>;\n\nclass Interceptors<Interceptor> {\n fns: Array<Interceptor | null> = [];\n\n clear(): void {\n this.fns = [];\n }\n\n eject(id: number | Interceptor): void {\n const index = this.getInterceptorIndex(id);\n if (this.fns[index]) {\n this.fns[index] = null;\n }\n }\n\n exists(id: number | Interceptor): boolean {\n const index = this.getInterceptorIndex(id);\n return Boolean(this.fns[index]);\n }\n\n getInterceptorIndex(id: number | Interceptor): number {\n if (typeof id === 'number') {\n return this.fns[id] ? id : -1;\n }\n return this.fns.indexOf(id);\n }\n\n update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false {\n const index = this.getInterceptorIndex(id);\n if (this.fns[index]) {\n this.fns[index] = fn;\n return id;\n }\n return false;\n }\n\n use(fn: Interceptor): number {\n this.fns.push(fn);\n return this.fns.length - 1;\n }\n}\n\nexport interface Middleware<Req, Res, Err, Options> {\n error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;\n request: Interceptors<ReqInterceptor<Req, Options>>;\n response: Interceptors<ResInterceptor<Res, Req, Options>>;\n}\n\nexport const createInterceptors = <Req, Res, Err, Options>(): Middleware<\n Req,\n Res,\n Err,\n Options\n> => ({\n error: new Interceptors<ErrInterceptor<Err, Res, Req, Options>>(),\n request: new Interceptors<ReqInterceptor<Req, Options>>(),\n response: new Interceptors<ResInterceptor<Res, Req, Options>>(),\n});\n\nconst defaultQuerySerializer = createQuerySerializer({\n allowReserved: false,\n array: {\n explode: true,\n style: 'form',\n },\n object: {\n explode: true,\n style: 'deepObject',\n },\n});\n\nconst defaultHeaders = {\n 'Content-Type': 'application/json',\n};\n\nexport const createConfig = <T extends ClientOptions = ClientOptions>(\n override: Config<Omit<ClientOptions, keyof T> & T> = {},\n): Config<Omit<ClientOptions, keyof T> & T> => ({\n ...jsonBodySerializer,\n headers: defaultHeaders,\n parseAs: 'auto',\n querySerializer: defaultQuerySerializer,\n ...override,\n});\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport { createSseClient } from '../core/serverSentEvents.gen';\nimport type { HttpMethod } from '../core/types.gen';\nimport { getValidRequestBody } from '../core/utils.gen';\nimport type { Client, Config, RequestOptions, ResolvedRequestOptions } from './types.gen';\nimport {\n buildUrl,\n createConfig,\n createInterceptors,\n getParseAs,\n mergeConfigs,\n mergeHeaders,\n setAuthParams,\n} from './utils.gen';\n\ntype ReqInit = Omit<RequestInit, 'body' | 'headers'> & {\n body?: any;\n headers: ReturnType<typeof mergeHeaders>;\n};\n\nexport const createClient = (config: Config = {}): Client => {\n let _config = mergeConfigs(createConfig(), config);\n\n const getConfig = (): Config => ({ ..._config });\n\n const setConfig = (config: Config): Config => {\n _config = mergeConfigs(_config, config);\n return getConfig();\n };\n\n const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>();\n\n const beforeRequest = async <\n TData = unknown,\n TResponseStyle extends 'data' | 'fields' = 'fields',\n ThrowOnError extends boolean = boolean,\n Url extends string = string,\n >(\n options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>,\n ) => {\n const opts = {\n ..._config,\n ...options,\n fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,\n headers: mergeHeaders(_config.headers, options.headers),\n serializedBody: undefined as string | undefined,\n };\n\n if (opts.security) {\n await setAuthParams(opts);\n }\n\n if (opts.requestValidator) {\n await opts.requestValidator(opts);\n }\n\n if (opts.body !== undefined && opts.bodySerializer) {\n opts.serializedBody = opts.bodySerializer(opts.body) as string | undefined;\n }\n\n // remove Content-Type header if body is empty to avoid sending invalid requests\n if (opts.body === undefined || opts.serializedBody === '') {\n opts.headers.delete('Content-Type');\n }\n\n const resolvedOpts = opts as typeof opts &\n ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>;\n const url = buildUrl(resolvedOpts);\n\n return { opts: resolvedOpts, url };\n };\n\n const request: Client['request'] = async (options) => {\n const throwOnError = options.throwOnError ?? _config.throwOnError;\n const responseStyle = options.responseStyle ?? _config.responseStyle;\n\n let request: Request | undefined;\n let response: Response | undefined;\n\n try {\n const { opts, url } = await beforeRequest(options);\n const requestInit: ReqInit = {\n redirect: 'follow',\n ...opts,\n body: getValidRequestBody(opts),\n };\n\n request = new Request(url, requestInit);\n\n for (const fn of interceptors.request.fns) {\n if (fn) {\n request = await fn(request, opts);\n }\n }\n\n // fetch must be assigned here, otherwise it would throw the error:\n // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation\n const _fetch = opts.fetch!;\n\n response = await _fetch(request);\n\n for (const fn of interceptors.response.fns) {\n if (fn) {\n response = await fn(response, request, opts);\n }\n }\n\n const result = {\n request,\n response,\n };\n\n if (response.ok) {\n const parseAs =\n (opts.parseAs === 'auto'\n ? getParseAs(response.headers.get('Content-Type'))\n : opts.parseAs) ?? 'json';\n\n if (response.status === 204 || response.headers.get('Content-Length') === '0') {\n let emptyData: any;\n switch (parseAs) {\n case 'arrayBuffer':\n case 'blob':\n case 'text':\n emptyData = await response[parseAs]();\n break;\n case 'formData':\n emptyData = new FormData();\n break;\n case 'stream':\n emptyData = response.body;\n break;\n case 'json':\n default:\n emptyData = {};\n break;\n }\n return opts.responseStyle === 'data'\n ? emptyData\n : {\n data: emptyData,\n ...result,\n };\n }\n\n let data: any;\n switch (parseAs) {\n case 'arrayBuffer':\n case 'blob':\n case 'formData':\n case 'text':\n data = await response[parseAs]();\n break;\n case 'json': {\n // Some servers return 200 with no Content-Length and empty body.\n // response.json() would throw; read as text and parse if non-empty.\n const text = await response.text();\n data = text ? JSON.parse(text) : {};\n break;\n }\n case 'stream':\n return opts.responseStyle === 'data'\n ? response.body\n : {\n data: response.body,\n ...result,\n };\n }\n\n if (parseAs === 'json') {\n if (opts.responseValidator) {\n await opts.responseValidator(data);\n }\n\n if (opts.responseTransformer) {\n data = await opts.responseTransformer(data);\n }\n }\n\n return opts.responseStyle === 'data'\n ? data\n : {\n data,\n ...result,\n };\n }\n\n const textError = await response.text();\n let jsonError: unknown;\n\n try {\n jsonError = JSON.parse(textError);\n } catch {\n // noop\n }\n\n throw jsonError ?? textError;\n } catch (error) {\n let finalError = error;\n\n for (const fn of interceptors.error.fns) {\n if (fn) {\n finalError = await fn(finalError, response, request, options as ResolvedRequestOptions);\n }\n }\n\n finalError = finalError || {};\n\n if (throwOnError) {\n throw finalError;\n }\n\n // TODO: we probably want to return error and improve types\n return responseStyle === 'data'\n ? undefined\n : {\n error: finalError,\n request,\n response,\n };\n }\n };\n\n const makeMethodFn = (method: Uppercase<HttpMethod>) => (options: RequestOptions) =>\n request({ ...options, method });\n\n const makeSseFn = (method: Uppercase<HttpMethod>) => async (options: RequestOptions) => {\n const { opts, url } = await beforeRequest(options);\n return createSseClient({\n ...opts,\n body: opts.body as BodyInit | null | undefined,\n method,\n onRequest: async (url, init) => {\n let request = new Request(url, init);\n for (const fn of interceptors.request.fns) {\n if (fn) {\n request = await fn(request, opts);\n }\n }\n return request;\n },\n serializedBody: getValidRequestBody(opts) as BodyInit | null | undefined,\n url,\n });\n };\n\n const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options });\n\n return {\n buildUrl: _buildUrl,\n connect: makeMethodFn('CONNECT'),\n delete: makeMethodFn('DELETE'),\n get: makeMethodFn('GET'),\n getConfig,\n head: makeMethodFn('HEAD'),\n interceptors,\n options: makeMethodFn('OPTIONS'),\n patch: makeMethodFn('PATCH'),\n post: makeMethodFn('POST'),\n put: makeMethodFn('PUT'),\n request,\n setConfig,\n sse: {\n connect: makeSseFn('CONNECT'),\n delete: makeSseFn('DELETE'),\n get: makeSseFn('GET'),\n head: makeSseFn('HEAD'),\n options: makeSseFn('OPTIONS'),\n patch: makeSseFn('PATCH'),\n post: makeSseFn('POST'),\n put: makeSseFn('PUT'),\n trace: makeSseFn('TRACE'),\n },\n trace: makeMethodFn('TRACE'),\n } as Client;\n};\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport { type Client, type ClientOptions, type Config, createClient, createConfig } from './client';\nimport type { ClientOptions as ClientOptions2 } from './types.gen';\n\n/**\n * The `createClientConfig()` function will be called on client initialization\n * and the returned object will become the client's initial configuration.\n *\n * You may want to initialize your client this way instead of calling\n * `setConfig()`. This is useful for example if you're using Next.js\n * to ensure your client always has the correct values.\n */\nexport type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;\n\nexport const client: Client = createClient(createConfig<ClientOptions2>({ baseUrl: 'https://app.usenadia.com/api' }));\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport { type Client, type ClientMeta, formDataBodySerializer, type Options as Options2, type RequestResult, type TDataShape } from './client';\nimport { client } from './client.gen';\nimport type { ApprovePostData, ApprovePostErrors, ApprovePostResponses, CatchUpAutomationPoseData, CatchUpAutomationPoseErrors, CatchUpAutomationPoseResponses, ChangePostStatusData, ChangePostStatusErrors, ChangePostStatusResponses, CheckConnectionData, CheckConnectionErrors, CheckConnectionResponses, CommentPublicationData, CommentPublicationErrors, CommentPublicationResponses, ConfirmUploadData, ConfirmUploadErrors, ConfirmUploadResponses, CreateApiKeyData, CreateApiKeyErrors, CreateApiKeyResponses, CreateAutomationFlowData, CreateAutomationFlowErrors, CreateAutomationFlowResponses, CreateContentData, CreateContentErrors, CreateContentFromLinkData, CreateContentFromLinkErrors, CreateContentFromLinkResponses, CreateContentResponses, CreatePostData, CreatePostErrors, CreatePostResponses, CreateUploadData, CreateUploadErrors, CreateUploadResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, CreateWorkspaceData, CreateWorkspaceErrors, CreateWorkspaceResponses, DeleteAutomationFlowData, DeleteAutomationFlowErrors, DeleteAutomationFlowResponses, DeleteAutomationPoseData, DeleteAutomationPoseErrors, DeleteAutomationPoseResponses, DeleteChannelData, DeleteChannelErrors, DeleteChannelResponses, DeleteCommentData, DeleteCommentErrors, DeleteCommentResponses, DeleteContentData, DeleteContentErrors, DeleteContentResponses, DeletePostData, DeletePostErrors, DeletePostGroupData, DeletePostGroupErrors, DeletePostGroupResponses, DeletePostResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookResponses, DeleteWorkspaceData, DeleteWorkspaceErrors, DeleteWorkspaceResponses, FindSlotData, FindSlotErrors, FindSlotResponses, GetAccountHistoryData, GetAccountHistoryErrors, GetAccountHistoryResponses, GetAutomationFlowData, GetAutomationFlowErrors, GetAutomationFlowResponses, GetAutomationPoseData, GetAutomationPoseErrors, GetAutomationPoseResponses, GetChannelAnalyticsData, GetChannelAnalyticsErrors, GetChannelAnalyticsResponses, GetChannelSettingsData, GetChannelSettingsErrors, GetChannelSettingsResponses, GetContentData, GetContentErrors, GetContentResponses, GetContentsPerformanceData, GetContentsPerformanceErrors, GetContentsPerformanceResponses, GetConversationData, GetConversationErrors, GetConversationResponses, GetHookFormsData, GetHookFormsErrors, GetHookFormsResponses, GetMusicTrackData, GetMusicTrackErrors, GetMusicTrackResponses, GetPostAnalyticsData, GetPostAnalyticsErrors, GetPostAnalyticsResponses, GetPostAutomationData, GetPostAutomationErrors, GetPostAutomationResponses, GetPostData, GetPostErrors, GetPostingTimesData, GetPostingTimesErrors, GetPostingTimesResponses, GetPostResponses, GetSubscriptionData, GetSubscriptionErrors, GetSubscriptionResponses, GetUploadFromUrlData, GetUploadFromUrlErrors, GetUploadFromUrlResponses, GetVideoHistoryData, GetVideoHistoryErrors, GetVideoHistoryResponses, GetViewsPerDayData, GetViewsPerDayErrors, GetViewsPerDayResponses, GetWebhookData, GetWebhookErrors, GetWebhookResponses, HideCommentData, HideCommentErrors, HideCommentResponses, ImportMusicData, ImportMusicErrors, ImportMusicResponses, LinkContentPostData, LinkContentPostErrors, LinkContentPostResponses, ListApiKeysData, ListApiKeysErrors, ListApiKeysResponses, ListAutomationFlowPosesData, ListAutomationFlowPosesErrors, ListAutomationFlowPosesResponses, ListAutomationFlowsData, ListAutomationFlowsErrors, ListAutomationFlowsResponses, ListAutomationPoseRunsData, ListAutomationPoseRunsErrors, ListAutomationPoseRunsResponses, ListChannelAutomationPosesData, ListChannelAutomationPosesErrors, ListChannelAutomationPosesResponses, ListChannelMediaData, ListChannelMediaErrors, ListChannelMediaResponses, ListChannelsData, ListChannelsErrors, ListChannelsResponses, ListChannelStoriesData, ListChannelStoriesErrors, ListChannelStoriesResponses, ListContentsData, ListContentsErrors, ListContentsResponses, ListConversationsData, ListConversationsErrors, ListConversationsResponses, ListGroupsData, ListGroupsErrors, ListGroupsResponses, ListHookFamiliesData, ListHookFamiliesErrors, ListHookFamiliesResponses, ListMediaCommentsData, ListMediaCommentsErrors, ListMediaCommentsResponses, ListMissingMediaData, ListMissingMediaErrors, ListMissingMediaResponses, ListMusicData, ListMusicErrors, ListMusicPillarsData, ListMusicPillarsErrors, ListMusicPillarsResponses, ListMusicResponses, ListNotificationsData, ListNotificationsErrors, ListNotificationsResponses, ListPostsAwaitingApprovalData, ListPostsAwaitingApprovalErrors, ListPostsAwaitingApprovalResponses, ListPostsData, ListPostsErrors, ListPostsResponses, ListUndatedDraftsData, ListUndatedDraftsErrors, ListUndatedDraftsResponses, ListVideoPerformanceData, ListVideoPerformanceErrors, ListVideoPerformanceResponses, ListWebhookEventsData, ListWebhookEventsErrors, ListWebhookEventsResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, ListWorkspacesData, ListWorkspacesErrors, ListWorkspacesResponses, MoveContentData, MoveContentErrors, MoveContentResponses, PollAutomationPoseData, PollAutomationPoseErrors, PollAutomationPoseResponses, PollInboxData, PollInboxErrors, PollInboxResponses, PoseAutomationFlowData, PoseAutomationFlowErrors, PoseAutomationFlowResponses, PreviewAutomationEmailData, PreviewAutomationEmailErrors, PreviewAutomationEmailResponses, PreviewAutomationPoseCatchUpData, PreviewAutomationPoseCatchUpErrors, PreviewAutomationPoseCatchUpResponses, RefusePostData, RefusePostErrors, RefusePostResponses, RemovePostAutomationData, RemovePostAutomationErrors, RemovePostAutomationResponses, ReplayAutomationPoseData, ReplayAutomationPoseErrors, ReplayAutomationPoseResponses, ReplyToCommentData, ReplyToCommentErrors, ReplyToCommentResponses, RevokeApiKeyData, RevokeApiKeyErrors, RevokeApiKeyResponses, RotateApiKeyData, RotateApiKeyErrors, RotateApiKeyResponses, RunChannelToolData, RunChannelToolErrors, RunChannelToolResponses, SearchHooksData, SearchHooksErrors, SearchHooksResponses, SendAutomationTestEmailData, SendAutomationTestEmailErrors, SendAutomationTestEmailResponses, SendDirectMessageData, SendDirectMessageErrors, SendDirectMessageResponses, SetAutomationFlowStatusData, SetAutomationFlowStatusErrors, SetAutomationFlowStatusResponses, SetContentWorkspacesData, SetContentWorkspacesErrors, SetContentWorkspacesResponses, SetMediaWorkspacesData, SetMediaWorkspacesErrors, SetMediaWorkspacesResponses, SetPostAutomationData, SetPostAutomationErrors, SetPostAutomationResponses, SetPostCoverData, SetPostCoverErrors, SetPostCoverResponses, SetPostingTimesData, SetPostingTimesErrors, SetPostingTimesResponses, SetPostPublicationData, SetPostPublicationErrors, SetPostPublicationResponses, SetPostReleaseIdData, SetPostReleaseIdErrors, SetPostReleaseIdResponses, SetPostThreadData, SetPostThreadErrors, SetPostThreadResponses, StartChannelConnectionData, StartChannelConnectionErrors, StartChannelConnectionResponses, SubscribeInboxWebhookData, SubscribeInboxWebhookErrors, SubscribeInboxWebhookResponses, TestWebhookData, TestWebhookErrors, TestWebhookResponses, UpdateApiKeyData, UpdateApiKeyErrors, UpdateApiKeyResponses, UpdateAutomationFlowData, UpdateAutomationFlowErrors, UpdateAutomationFlowResponses, UpdateAutomationPoseData, UpdateAutomationPoseErrors, UpdateAutomationPoseResponses, UpdateContentData, UpdateContentErrors, UpdateContentResponses, UpdateWorkspaceData, UpdateWorkspaceErrors, UpdateWorkspaceResponses, UploadFileData, UploadFileErrors, UploadFileResponses, UploadFromUrlData, UploadFromUrlErrors, UploadFromUrlResponses, UploadMusicFileData, UploadMusicFileErrors, UploadMusicFileResponses, UpsertContentData, UpsertContentErrors, UpsertContentResponses } from './types.gen';\n\nexport type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {\n /**\n * You can provide a client instance returned by `createClient()` instead of\n * individual options. This might be also useful if you want to implement a\n * custom client.\n */\n client?: Client;\n /**\n * You can pass arbitrary values through the `meta` object. This can be\n * used to access values that aren't defined as part of the SDK function.\n */\n meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;\n};\n\n/**\n * Upload a file and get a URL usable in a post\n *\n * The whole file in one request: an MP4 up to 25 MB, an image up to 10 MB (a HEIC or HEIF photo is converted to JPEG). A MOV or an M4V is refused (`415`): convert it to MP4 first. A larger MP4 goes in parts (`POST /public/v1/uploads`).\n */\nexport const uploadFile = <ThrowOnError extends boolean = false>(options: Options<UploadFileData, ThrowOnError>): RequestResult<UploadFileResponses, UploadFileErrors, ThrowOnError> => (options.client ?? client).post<UploadFileResponses, UploadFileErrors, ThrowOnError>({\n ...formDataBodySerializer,\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/upload',\n ...options,\n headers: {\n 'Content-Type': null,\n ...options.headers\n }\n});\n\n/**\n * Import a file from a URL into your media library\n *\n * Download a public HTTPS file into your media library. When the import is done within 25 seconds, the answer is `201` and the media, as always. A longer import (a big video, a slow host) answers `202` with the import (`id`, `status: \"running\"`): it goes on without the connection, and `GET /public/v1/upload-from-url/{importId}` reads it again until `status` is `done` (the `media`) or `failed` (the `error` the call would have answered). The same URL sent again while it runs, or within ten minutes after it succeeded, answers the same import: one download, one media. The MCP tool `uploadFromUrlTool` waits for the end itself.\n */\nexport const uploadFromUrl = <ThrowOnError extends boolean = false>(options: Options<UploadFromUrlData, ThrowOnError>): RequestResult<UploadFromUrlResponses, UploadFromUrlErrors, ThrowOnError> => (options.client ?? client).post<UploadFromUrlResponses, UploadFromUrlErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/upload-from-url',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Read an import from a URL\n *\n * Read again an import from a URL answered `202` by `POST /public/v1/upload-from-url`: `running` (read again in a few seconds), `done` with its `media`, or `failed` with its `error` (`statusCode` and `msg`, the answer the call would have given: send the URL again to retry). An import is kept a day.\n */\nexport const getUploadFromUrl = <ThrowOnError extends boolean = false>(options: Options<GetUploadFromUrlData, ThrowOnError>): RequestResult<GetUploadFromUrlResponses, GetUploadFromUrlErrors, ThrowOnError> => (options.client ?? client).get<GetUploadFromUrlResponses, GetUploadFromUrlErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/upload-from-url/{importId}',\n ...options\n});\n\n/**\n * Open an upload of a file from your disk\n *\n * Open an upload of a file from your disk, then send its bytes where the answer says and confirm it (`POST /public/v1/uploads/{uploadId}/confirm`). The bytes never go through the API: they go in parts of 20 MB straight to the storage (`partSize` and `parts` in the answer: each part a `PUT` of its raw bytes to `<uploadUrl>/<n>`, `n` from 1 to `parts`, with its exact `Content-Length`; a part cut by the network is sent again, a part sent twice changes nothing; the upload lives 24 hours). `curl` is a shell command that does the sending (macOS or Linux). The same as the MCP tool `createUploadUrl`. Accepted types: MP4, JPEG, PNG, WebP, GIF; 500 MB at most by default.\n */\nexport const createUpload = <ThrowOnError extends boolean = false>(options: Options<CreateUploadData, ThrowOnError>): RequestResult<CreateUploadResponses, CreateUploadErrors, ThrowOnError> => (options.client ?? client).post<CreateUploadResponses, CreateUploadErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/uploads',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Finish an upload and add the file to the media library\n *\n * Finish an upload opened by `POST /public/v1/uploads`, once its bytes are sent: checks that the whole file arrived with the declared size, that the bytes are the declared type, and for a video that ffprobe can read it; then adds the file to the media library. When parts are missing, answers `409 UPLOAD_INCOMPLETE` with their numbers in `missingParts`: send those again, then confirm again. Safe to call again: a confirmed upload answers the same media. The same as the MCP tool `confirmUpload`.\n */\nexport const confirmUpload = <ThrowOnError extends boolean = false>(options: Options<ConfirmUploadData, ThrowOnError>): RequestResult<ConfirmUploadResponses, ConfirmUploadErrors, ThrowOnError> => (options.client ?? client).post<ConfirmUploadResponses, ConfirmUploadErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/uploads/{uploadId}/confirm',\n ...options\n});\n\n/**\n * Tag a media with workspaces\n *\n * The whole set of workspaces a media of your library is tagged with (its id comes back from an upload). A media is never copied: when it serves two workspaces, it carries both tags. An untagged media is the organization's alone: the organization's key and the app see it, a key limited to some workspaces does not. A limited key only adds or takes off its own workspaces; the media's other tags stay. Publishing a media on a channel of another workspace tags it on the way (`mediaTagged` in the answer of `POST /public/v1/posts`).\n */\nexport const setMediaWorkspaces = <ThrowOnError extends boolean = false>(options: Options<SetMediaWorkspacesData, ThrowOnError>): RequestResult<SetMediaWorkspacesResponses, SetMediaWorkspacesErrors, ThrowOnError> => (options.client ?? client).put<SetMediaWorkspacesResponses, SetMediaWorkspacesErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/media/{id}/workspaces',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Next free slot in the channel's schedule\n */\nexport const findSlot = <ThrowOnError extends boolean = false>(options: Options<FindSlotData, ThrowOnError>): RequestResult<FindSlotResponses, FindSlotErrors, ThrowOnError> => (options.client ?? client).get<FindSlotResponses, FindSlotErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/find-slot/{id}',\n ...options\n});\n\n/**\n * The posting slots of a channel (time and weekdays, UTC)\n */\nexport const getPostingTimes = <ThrowOnError extends boolean = false>(options: Options<GetPostingTimesData, ThrowOnError>): RequestResult<GetPostingTimesResponses, GetPostingTimesErrors, ThrowOnError> => (options.client ?? client).get<GetPostingTimesResponses, GetPostingTimesErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/integrations/{id}/posting-times',\n ...options\n});\n\n/**\n * Replace the posting slots of a channel. Posts already scheduled do not move\n */\nexport const setPostingTimes = <ThrowOnError extends boolean = false>(options: Options<SetPostingTimesData, ThrowOnError>): RequestResult<SetPostingTimesResponses, SetPostingTimesErrors, ThrowOnError> => (options.client ?? client).put<SetPostingTimesResponses, SetPostingTimesErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/integrations/{id}/posting-times',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * List posts in a date range\n */\nexport const listPosts = <ThrowOnError extends boolean = false>(options: Options<ListPostsData, ThrowOnError>): RequestResult<ListPostsResponses, ListPostsErrors, ThrowOnError> => (options.client ?? client).get<ListPostsResponses, ListPostsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts',\n ...options\n});\n\n/**\n * Schedule, publish or draft a post on one or more channels\n */\nexport const createPost = <ThrowOnError extends boolean = false>(options: Options<CreatePostData, ThrowOnError>): RequestResult<CreatePostResponses, CreatePostErrors, ThrowOnError> => (options.client ?? client).post<CreatePostResponses, CreatePostErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Delete a post and everything scheduled with it\n *\n * Deleting is three different things. A post not published yet (scheduled, draft, failed) is cancelled: it never goes out. A post already published only leaves UseNadia by default: it stays online on the platform. With `deleteOnPlatform=true`, a published post is also deleted at its platform, for good, where UseNadia can (`deletableOnPlatform`; Threads, YouTube, Instagram and TikTok cannot today). `posts` says which happened, per post of the group.\n */\nexport const deletePost = <ThrowOnError extends boolean = false>(options: Options<DeletePostData, ThrowOnError>): RequestResult<DeletePostResponses, DeletePostErrors, ThrowOnError> => (options.client ?? client).delete<DeletePostResponses, DeletePostErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}',\n ...options\n});\n\n/**\n * Read one post, with its media, its settings and its thread\n *\n * The post as `listPosts` gives it, plus `media`: each media of the post, in order, with the cover of a video (`thumbnail`, the URL UseNadia serves it from, and `thumbnailTimestamp`, the moment of the video used as its cover, in milliseconds; each null without one); `settings`: the settings of the post as they are stored (the platform's own, and a comment → DM automation: `automationFlowId`, `automationKeywords`, `automationVariables`), what an `update` of `createPost` must carry again; and `thread`: the comments under the post, in order. Change the cover with `setPostCover`, the thread with `setPostThread`.\n */\nexport const getPost = <ThrowOnError extends boolean = false>(options: Options<GetPostData, ThrowOnError>): RequestResult<GetPostResponses, GetPostErrors, ThrowOnError> => (options.client ?? client).get<GetPostResponses, GetPostErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}',\n ...options\n});\n\n/**\n * Delete a publication group\n *\n * Deleting is three different things. A post not published yet (scheduled, draft, failed) is cancelled: it never goes out. A post already published only leaves UseNadia by default: it stays online on the platform. With `deleteOnPlatform=true`, a published post is also deleted at its platform, for good, where UseNadia can (`deletableOnPlatform`; Threads, YouTube, Instagram and TikTok cannot today). `posts` says which happened, per post of the group.\n */\nexport const deletePostGroup = <ThrowOnError extends boolean = false>(options: Options<DeletePostGroupData, ThrowOnError>): RequestResult<DeletePostGroupResponses, DeletePostGroupErrors, ThrowOnError> => (options.client ?? client).delete<DeletePostGroupResponses, DeletePostGroupErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/group/{group}',\n ...options\n});\n\n/**\n * Check that an API key is valid\n */\nexport const checkConnection = <ThrowOnError extends boolean = false>(options?: Options<CheckConnectionData, ThrowOnError>): RequestResult<CheckConnectionResponses, CheckConnectionErrors, ThrowOnError> => (options?.client ?? client).get<CheckConnectionResponses, CheckConnectionErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/is-connected',\n ...options\n});\n\n/**\n * List your workspaces\n */\nexport const listWorkspaces = <ThrowOnError extends boolean = false>(options?: Options<ListWorkspacesData, ThrowOnError>): RequestResult<ListWorkspacesResponses, ListWorkspacesErrors, ThrowOnError> => (options?.client ?? client).get<ListWorkspacesResponses, ListWorkspacesErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/workspaces',\n ...options\n});\n\n/**\n * Create a workspace — same fields and refusals as in the app\n */\nexport const createWorkspace = <ThrowOnError extends boolean = false>(options: Options<CreateWorkspaceData, ThrowOnError>): RequestResult<CreateWorkspaceResponses, CreateWorkspaceErrors, ThrowOnError> => (options.client ?? client).post<CreateWorkspaceResponses, CreateWorkspaceErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/workspaces',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Read your subscription\n *\n * The plan, its trial and dates, and what is used against what is included. Behind the paid gate like every route: an organization without an active subscription is refused. `billing` says what will be charged and when, read from Stripe (next invoice, last payment, Stripe's status), or that the amounts are unavailable.\n */\nexport const getSubscription = <ThrowOnError extends boolean = false>(options?: Options<GetSubscriptionData, ThrowOnError>): RequestResult<GetSubscriptionResponses, GetSubscriptionErrors, ThrowOnError> => (options?.client ?? client).get<GetSubscriptionResponses, GetSubscriptionErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/subscription',\n ...options\n});\n\n/**\n * Deprecated: use listWorkspaces\n *\n * Lists your workspaces as `{ id, name }`. Kept for the published SDKs; use `GET /public/v1/workspaces`.\n *\n * @deprecated\n */\nexport const listGroups = <ThrowOnError extends boolean = false>(options?: Options<ListGroupsData, ThrowOnError>): RequestResult<ListGroupsResponses, ListGroupsErrors, ThrowOnError> => (options?.client ?? client).get<ListGroupsResponses, ListGroupsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/groups',\n ...options\n});\n\n/**\n * List your connected channels\n */\nexport const listChannels = <ThrowOnError extends boolean = false>(options?: Options<ListChannelsData, ThrowOnError>): RequestResult<ListChannelsResponses, ListChannelsErrors, ThrowOnError> => (options?.client ?? client).get<ListChannelsResponses, ListChannelsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/integrations',\n ...options\n});\n\n/**\n * Start connecting a channel — returns the URL to open\n *\n * Returns the URL that opens the platform's consent screen for this channel. A channel your plan does not include answers `402` with `This channel is not included in your plan`, as in the app (today: X on the Starter ultime).\n *\n * A partner connecting the channels of the people it serves (one workspace each) names the workspace with `workspace` and the address the person comes back to with `redirectUrl`: both are kept with the URL's state for its hour, the channel lands in that workspace and the person is sent back there, success or failure.\n */\nexport const startChannelConnection = <ThrowOnError extends boolean = false>(options: Options<StartChannelConnectionData, ThrowOnError>): RequestResult<StartChannelConnectionResponses, StartChannelConnectionErrors, ThrowOnError> => (options.client ?? client).get<StartChannelConnectionResponses, StartChannelConnectionErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/social/{integration}',\n ...options\n});\n\n/**\n * List your notifications, paginated\n */\nexport const listNotifications = <ThrowOnError extends boolean = false>(options?: Options<ListNotificationsData, ThrowOnError>): RequestResult<ListNotificationsResponses, ListNotificationsErrors, ThrowOnError> => (options?.client ?? client).get<ListNotificationsResponses, ListNotificationsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/notifications',\n ...options\n});\n\n/**\n * Disconnect a channel and delete its posts\n */\nexport const deleteChannel = <ThrowOnError extends boolean = false>(options: Options<DeleteChannelData, ThrowOnError>): RequestResult<DeleteChannelResponses, DeleteChannelErrors, ThrowOnError> => (options.client ?? client).delete<DeleteChannelResponses, DeleteChannelErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/integrations/{id}',\n ...options\n});\n\n/**\n * Posting rules, maximum length and tools of a channel\n */\nexport const getChannelSettings = <ThrowOnError extends boolean = false>(options: Options<GetChannelSettingsData, ThrowOnError>): RequestResult<GetChannelSettingsResponses, GetChannelSettingsErrors, ThrowOnError> => (options.client ?? client).get<GetChannelSettingsResponses, GetChannelSettingsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/integration-settings/{id}',\n ...options\n});\n\n/**\n * Recent provider items to match a post whose releaseId is `missing`\n *\n * When a post published but the provider returned no usable id (`releaseId` is `missing`), lists the account's recent items so the right one can be recorded with PUT /posts/{id}/release-id. Empty when the post is not in that state, or the provider cannot list (today only TikTok can).\n */\nexport const listMissingMedia = <ThrowOnError extends boolean = false>(options: Options<ListMissingMediaData, ThrowOnError>): RequestResult<ListMissingMediaResponses, ListMissingMediaErrors, ThrowOnError> => (options.client ?? client).get<ListMissingMediaResponses, ListMissingMediaErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}/missing',\n ...options\n});\n\n/**\n * Change a post's status\n */\nexport const changePostStatus = <ThrowOnError extends boolean = false>(options: Options<ChangePostStatusData, ThrowOnError>): RequestResult<ChangePostStatusResponses, ChangePostStatusErrors, ThrowOnError> => (options.client ?? client).put<ChangePostStatusResponses, ChangePostStatusErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}/status',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * List the posts waiting for approval\n *\n * The posts of a Content Creator wait for an approval before they go out. An Owner, an Admin, a Publisher or a Client approves or refuses them.\n */\nexport const listPostsAwaitingApproval = <ThrowOnError extends boolean = false>(options?: Options<ListPostsAwaitingApprovalData, ThrowOnError>): RequestResult<ListPostsAwaitingApprovalResponses, ListPostsAwaitingApprovalErrors, ThrowOnError> => (options?.client ?? client).get<ListPostsAwaitingApprovalResponses, ListPostsAwaitingApprovalErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/approvals',\n ...options\n});\n\n/**\n * List the drafts that have no date\n *\n * A draft created without `date` (or with a `date` already past) has no date: it is in no calendar until it is placed. This lists them; place one by sending it again (`POST /posts` with its ids, `type: schedule` or `now`, and a `date`).\n */\nexport const listUndatedDrafts = <ThrowOnError extends boolean = false>(options?: Options<ListUndatedDraftsData, ThrowOnError>): RequestResult<ListUndatedDraftsResponses, ListUndatedDraftsErrors, ThrowOnError> => (options?.client ?? client).get<ListUndatedDraftsResponses, ListUndatedDraftsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/drafts',\n ...options\n});\n\n/**\n * Approve a post\n *\n * The post enters the queue and goes out at its date (or at `date`). A post whose date is past is refused (400, `code` `date_passed`) until a new `date` is given.\n */\nexport const approvePost = <ThrowOnError extends boolean = false>(options: Options<ApprovePostData, ThrowOnError>): RequestResult<ApprovePostResponses, ApprovePostErrors, ThrowOnError> => (options.client ?? client).post<ApprovePostResponses, ApprovePostErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}/approve',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Refuse a post\n *\n * The post goes back to its author as a draft, with the note.\n */\nexport const refusePost = <ThrowOnError extends boolean = false>(options: Options<RefusePostData, ThrowOnError>): RequestResult<RefusePostResponses, RefusePostErrors, ThrowOnError> => (options.client ?? client).post<RefusePostResponses, RefusePostErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}/refuse',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Take the automation off a post not yet published\n */\nexport const removePostAutomation = <ThrowOnError extends boolean = false>(options: Options<RemovePostAutomationData, ThrowOnError>): RequestResult<RemovePostAutomationResponses, RemovePostAutomationErrors, ThrowOnError> => (options.client ?? client).delete<RemovePostAutomationResponses, RemovePostAutomationErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}/automation',\n ...options\n});\n\n/**\n * Read the automation a post not yet published carries\n */\nexport const getPostAutomation = <ThrowOnError extends boolean = false>(options: Options<GetPostAutomationData, ThrowOnError>): RequestResult<GetPostAutomationResponses, GetPostAutomationErrors, ThrowOnError> => (options.client ?? client).get<GetPostAutomationResponses, GetPostAutomationErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}/automation',\n ...options\n});\n\n/**\n * Put an automation on a scheduled post\n *\n * Put an automation template on an Instagram post or story, a Facebook Page post or reel (no story), or a TikTok (`tiktok-business`) or Threads post, that is scheduled but not published yet, or replace the one it carries. On TikTok and Threads, which have no DM, the template runs as its public reply alone: a comment (a reply on Threads) with one of the words gets the template's TikTok or Threads reply under it, every DM step is skipped; a template whose public reply is off is refused there. It is checked as at scheduling, and at publication it is posed exactly as if `settings.automationFlowId`, `automationKeywords` and `automationVariables` had been passed to POST /public/v1/posts. Once the post is live, pose the template on the publication instead (POST /public/v1/automation-flows/{id}/poses).\n */\nexport const setPostAutomation = <ThrowOnError extends boolean = false>(options: Options<SetPostAutomationData, ThrowOnError>): RequestResult<SetPostAutomationResponses, SetPostAutomationErrors, ThrowOnError> => (options.client ?? client).put<SetPostAutomationResponses, SetPostAutomationErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}/automation',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Record the provider post id against a post\n */\nexport const setPostReleaseId = <ThrowOnError extends boolean = false>(options: Options<SetPostReleaseIdData, ThrowOnError>): RequestResult<SetPostReleaseIdResponses, SetPostReleaseIdErrors, ThrowOnError> => (options.client ?? client).put<SetPostReleaseIdResponses, SetPostReleaseIdErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}/release-id',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Put, replace or take off the cover of a post's video, before it is published\n *\n * The cover goes on the post's video (its first `.mp4`): an image (`thumbnail`), a moment of the video (`thumbnailTimestamp`), or both; a field left out does not move, except that the image wins: a `thumbnail` given without `thumbnailTimestamp` takes the moment off (TikTok through the classic connection then takes the first frame), and the two given together are one cover, a frame and its moment. Read as the cover by Instagram, TikTok (Business API), LinkedIn (profile and page), Telegram, Pinterest, Mastodon and Facebook (Page video, not reels or stories); TikTok through the classic connection reads only `thumbnailTimestamp`; YouTube uses the `thumbnail` setting of its post; Threads, Bluesky, X, Discord and Google Business Profile take no cover. It can change at any time until the post leaves for the platform (a draft, a scheduled post, or one that failed). Nothing else of the post moves: text, date, media and `link` stay. The image is a picture (JPEG, PNG, WebP, AVIF, HEIC or the first frame of a GIF; ideally 1080x1920, 20 MB at most, between 1:4 and 4:1, 100 pixels at least on each side), kept by UseNadia as a JPEG of 2 MB and 1920 pixels at most, which every channel takes, as at scheduling (any public URL, a signed one included). Refused with a `400` that says why: a YouTube post (YouTube does not use a cover: the thumbnail of a video is the `thumbnail` setting of its post), a post already published or sent to the platform (a platform does not change the cover of a published video), a post without a video, a cover that cannot be downloaded or read as a picture, or out of those bounds, a moment that is no number of milliseconds.\n */\nexport const setPostCover = <ThrowOnError extends boolean = false>(options: Options<SetPostCoverData, ThrowOnError>): RequestResult<SetPostCoverResponses, SetPostCoverErrors, ThrowOnError> => (options.client ?? client).put<SetPostCoverResponses, SetPostCoverErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}/cover',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Replace the comments under a post (its thread), before it is published\n *\n * The thread of a post is what goes out with it, in order: on Instagram, Facebook and LinkedIn (profile and page) the comments under the post (the first comment, then the next ones), on X, Threads, Bluesky, Mastodon, Discord and Telegram the next posts of the thread. `thread` is the whole thread as it must be: the comments it gives replace those the post has, in order (a comment kept at its place keeps its id), the ones past the end are added, those past the new end deleted; `[]` takes them all off. Nothing else of the post moves: its id, text, media, `settings` (a comment → DM automation among them), date, `link`, publication and approval stay, and it goes out at its date with the new thread. Each comment is `{\"content\": \"…\", \"image\": [{\"id\": \"…\", \"path\": \"…\"}]}`, as an item of `value` in `createPost` (HTML content, sanitized the same way): a text, an image, or both; Instagram and LinkedIn comments are text only (an image is refused), Facebook publishes the first image of a comment. A comment is as long as a post of its platform at most (`maxLength` of the platform's rules: Threads 500, X 280 or 4,000 with Premium, Instagram 2,200, LinkedIn 3,000, Bluesky 300…). It can change until the post leaves for the platform (a draft, a scheduled post, or one that failed before going out): a published post, one sent to the platform, a comment's id (pass the post's), or a channel that publishes no comment (YouTube, Pinterest, Google Business Profile, TikTok through its classic connection) are refused with a 400 whose `msg` says why. On TikTok through its Business API the thread is one comment, text only, 150 characters at most, posted by the account and pinned once TikTok has published the post. A member whose posts wait for an approval (Content Creator) changes the thread of a draft only (403 `role_refused`). Read the thread with `getPost` (`thread`).\n */\nexport const setPostThread = <ThrowOnError extends boolean = false>(options: Options<SetPostThreadData, ThrowOnError>): RequestResult<SetPostThreadResponses, SetPostThreadErrors, ThrowOnError> => (options.client ?? client).put<SetPostThreadResponses, SetPostThreadErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}/thread',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Group a post with the same content on other channels, or separate it\n *\n * A publication is one content on one or more channels: the posts that share `publication`. Posts written in one request are one publication from the start; this route moves a post (with its thread) into another publication, or out of its own. Nothing else of the post changes, published or not. Refused with a `400` when the publication has no live post in your organisation, `404` for an unknown post.\n */\nexport const setPostPublication = <ThrowOnError extends boolean = false>(options: Options<SetPostPublicationData, ThrowOnError>): RequestResult<SetPostPublicationResponses, SetPostPublicationErrors, ThrowOnError> => (options.client ?? client).put<SetPostPublicationResponses, SetPostPublicationErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/posts/{id}/publication',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Account metrics, read live from the provider\n */\nexport const getChannelAnalytics = <ThrowOnError extends boolean = false>(options: Options<GetChannelAnalyticsData, ThrowOnError>): RequestResult<GetChannelAnalyticsResponses, GetChannelAnalyticsErrors, ThrowOnError> => (options.client ?? client).get<GetChannelAnalyticsResponses, GetChannelAnalyticsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/analytics/{integration}',\n ...options\n});\n\n/**\n * Per-video performance of a channel\n */\nexport const listVideoPerformance = <ThrowOnError extends boolean = false>(options: Options<ListVideoPerformanceData, ThrowOnError>): RequestResult<ListVideoPerformanceResponses, ListVideoPerformanceErrors, ThrowOnError> => (options.client ?? client).get<ListVideoPerformanceResponses, ListVideoPerformanceErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/video-list/{integrationId}',\n ...options\n});\n\n/**\n * Stored account time series, collected every 30 minutes\n */\nexport const getAccountHistory = <ThrowOnError extends boolean = false>(options: Options<GetAccountHistoryData, ThrowOnError>): RequestResult<GetAccountHistoryResponses, GetAccountHistoryErrors, ThrowOnError> => (options.client ?? client).get<GetAccountHistoryResponses, GetAccountHistoryErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/analytics-history/{integrationId}',\n ...options\n});\n\n/**\n * Stored per-video time series\n */\nexport const getVideoHistory = <ThrowOnError extends boolean = false>(options: Options<GetVideoHistoryData, ThrowOnError>): RequestResult<GetVideoHistoryResponses, GetVideoHistoryErrors, ThrowOnError> => (options.client ?? client).get<GetVideoHistoryResponses, GetVideoHistoryErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/video-history/{integrationId}',\n ...options\n});\n\n/**\n * Views gained each day, every video counted\n *\n * The views the channel gained each day of the window, every video counted, old ones included. TikTok and Instagram: the day-to-day difference of every collected video's views (a first reading, unless the video came out that day or the day before, and a reading after a gap of more than 2 days are no gain, counted in `baselines`; a lower reading counts 0, counted in `drops`). Facebook Page, Threads and YouTube: the platform's views of the day (YouTube Analytics, two or three days late: its last days are `null`; only when it gives no day at all, the day-to-day difference of the channel's total views, `source` = `totals`). X and LinkedIn: nothing (`source` = `none`). A day nothing was read has `views: null`, never 0.\n */\nexport const getViewsPerDay = <ThrowOnError extends boolean = false>(options: Options<GetViewsPerDayData, ThrowOnError>): RequestResult<GetViewsPerDayResponses, GetViewsPerDayErrors, ThrowOnError> => (options.client ?? client).get<GetViewsPerDayResponses, GetViewsPerDayErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/views-per-day/{integrationId}',\n ...options\n});\n\n/**\n * Metrics of one published post\n */\nexport const getPostAnalytics = <ThrowOnError extends boolean = false>(options: Options<GetPostAnalyticsData, ThrowOnError>): RequestResult<GetPostAnalyticsResponses, GetPostAnalyticsErrors, ThrowOnError> => (options.client ?? client).get<GetPostAnalyticsResponses, GetPostAnalyticsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/analytics/post/{postId}',\n ...options\n});\n\n/**\n * Run a provider tool on a channel\n */\nexport const runChannelTool = <ThrowOnError extends boolean = false>(options: Options<RunChannelToolData, ThrowOnError>): RequestResult<RunChannelToolResponses, RunChannelToolErrors, ThrowOnError> => (options.client ?? client).post<RunChannelToolResponses, RunChannelToolErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/integration-trigger/{id}',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Recent posts of an Instagram channel\n */\nexport const listChannelMedia = <ThrowOnError extends boolean = false>(options: Options<ListChannelMediaData, ThrowOnError>): RequestResult<ListChannelMediaResponses, ListChannelMediaErrors, ThrowOnError> => (options.client ?? client).get<ListChannelMediaResponses, ListChannelMediaErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/media/{integrationId}',\n ...options\n});\n\n/**\n * Live stories of a channel (they only exist 24 h)\n */\nexport const listChannelStories = <ThrowOnError extends boolean = false>(options: Options<ListChannelStoriesData, ThrowOnError>): RequestResult<ListChannelStoriesResponses, ListChannelStoriesErrors, ThrowOnError> => (options.client ?? client).get<ListChannelStoriesResponses, ListChannelStoriesErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/stories/{integrationId}',\n ...options\n});\n\n/**\n * Comments under a post\n */\nexport const listMediaComments = <ThrowOnError extends boolean = false>(options: Options<ListMediaCommentsData, ThrowOnError>): RequestResult<ListMediaCommentsResponses, ListMediaCommentsErrors, ThrowOnError> => (options.client ?? client).get<ListMediaCommentsResponses, ListMediaCommentsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/comments/{integrationId}/{mediaId}',\n ...options\n});\n\n/**\n * Comment under a post\n *\n * A new comment under a publication already live on the channel, written by the account. `mediaId` is the publication's id at the platform: the `releaseId` of a post read with `GET /public/v1/posts`, or the `id` of `GET /public/v1/inbox/media/{integrationId}`. Instagram, Facebook Page, LinkedIn, Threads, X, Bluesky, TikTok (`tiktok-business`), Discord, Telegram and Mastodon; on X, Threads, Bluesky, Mastodon, Discord and Telegram the comment is a reply to the post. Refused with a 400 saying why on a TikTok channel connected the classic way (reconnect it as TikTok Business), YouTube (not yet), Pinterest and Google Business Profile (no comments). Public at once. To schedule a first comment with a post not out yet, write the post's thread (`PUT /public/v1/posts/{id}/thread`).\n */\nexport const commentPublication = <ThrowOnError extends boolean = false>(options: Options<CommentPublicationData, ThrowOnError>): RequestResult<CommentPublicationResponses, CommentPublicationErrors, ThrowOnError> => (options.client ?? client).post<CommentPublicationResponses, CommentPublicationErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/comments/{integrationId}/{mediaId}',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Reply publicly to a comment\n */\nexport const replyToComment = <ThrowOnError extends boolean = false>(options: Options<ReplyToCommentData, ThrowOnError>): RequestResult<ReplyToCommentResponses, ReplyToCommentErrors, ThrowOnError> => (options.client ?? client).post<ReplyToCommentResponses, ReplyToCommentErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/comments/{commentId}/reply',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Hide or unhide a comment under one of your posts\n */\nexport const hideComment = <ThrowOnError extends boolean = false>(options: Options<HideCommentData, ThrowOnError>): RequestResult<HideCommentResponses, HideCommentErrors, ThrowOnError> => (options.client ?? client).post<HideCommentResponses, HideCommentErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/comments/{integrationId}/{commentId}/hide',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Delete a comment under one of your posts\n */\nexport const deleteComment = <ThrowOnError extends boolean = false>(options: Options<DeleteCommentData, ThrowOnError>): RequestResult<DeleteCommentResponses, DeleteCommentErrors, ThrowOnError> => (options.client ?? client).delete<DeleteCommentResponses, DeleteCommentErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/comments/{integrationId}/{commentId}',\n ...options\n});\n\n/**\n * Direct message conversations of a channel\n *\n * One page of a box of the inbox (`box`, `needs_reply` by default), what waits for a human first, newest first inside. For the next page, pass the `cursor` of the last conversation as `after`; fewer rows than `limit` means it was the last page.\n */\nexport const listConversations = <ThrowOnError extends boolean = false>(options: Options<ListConversationsData, ThrowOnError>): RequestResult<ListConversationsResponses, ListConversationsErrors, ThrowOnError> => (options.client ?? client).get<ListConversationsResponses, ListConversationsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/{integrationId}',\n ...options\n});\n\n/**\n * Send a direct message\n */\nexport const sendDirectMessage = <ThrowOnError extends boolean = false>(options: Options<SendDirectMessageData, ThrowOnError>): RequestResult<SendDirectMessageResponses, SendDirectMessageErrors, ThrowOnError> => (options.client ?? client).post<SendDirectMessageResponses, SendDirectMessageErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/{integrationId}/send',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Read the inbox now: what a missed webhook would have delivered reaches the automations\n */\nexport const pollInbox = <ThrowOnError extends boolean = false>(options: Options<PollInboxData, ThrowOnError>): RequestResult<PollInboxResponses, PollInboxErrors, ThrowOnError> => (options.client ?? client).post<PollInboxResponses, PollInboxErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/{integrationId}/poll',\n ...options\n});\n\n/**\n * Opt the account in to Meta webhook delivery\n */\nexport const subscribeInboxWebhook = <ThrowOnError extends boolean = false>(options: Options<SubscribeInboxWebhookData, ThrowOnError>): RequestResult<SubscribeInboxWebhookResponses, SubscribeInboxWebhookErrors, ThrowOnError> => (options.client ?? client).post<SubscribeInboxWebhookResponses, SubscribeInboxWebhookErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/{integrationId}/subscribe-webhook',\n ...options\n});\n\n/**\n * Messages of one conversation\n *\n * By the conversation `id` of `listConversations` (Meta's conversation id, or the person's id while Instagram has not named the thread). Messages newest first, `limit` at a time; `messages.paging.before` is there when older ones remain.\n */\nexport const getConversation = <ThrowOnError extends boolean = false>(options: Options<GetConversationData, ThrowOnError>): RequestResult<GetConversationResponses, GetConversationErrors, ThrowOnError> => (options.client ?? client).get<GetConversationResponses, GetConversationErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/inbox/{integrationId}/{conversationId}',\n ...options\n});\n\n/**\n * List your automation templates\n */\nexport const listAutomationFlows = <ThrowOnError extends boolean = false>(options?: Options<ListAutomationFlowsData, ThrowOnError>): RequestResult<ListAutomationFlowsResponses, ListAutomationFlowsErrors, ThrowOnError> => (options?.client ?? client).get<ListAutomationFlowsResponses, ListAutomationFlowsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows',\n ...options\n});\n\n/**\n * Create an automation template\n */\nexport const createAutomationFlow = <ThrowOnError extends boolean = false>(options: Options<CreateAutomationFlowData, ThrowOnError>): RequestResult<CreateAutomationFlowResponses, CreateAutomationFlowErrors, ThrowOnError> => (options.client ?? client).post<CreateAutomationFlowResponses, CreateAutomationFlowErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Render the email of a « Forward the email » step without sending it\n */\nexport const previewAutomationEmail = <ThrowOnError extends boolean = false>(options: Options<PreviewAutomationEmailData, ThrowOnError>): RequestResult<PreviewAutomationEmailResponses, PreviewAutomationEmailErrors, ThrowOnError> => (options.client ?? client).post<PreviewAutomationEmailResponses, PreviewAutomationEmailErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows/email-preview',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Send the email of a « Forward the email » step to one address\n */\nexport const sendAutomationTestEmail = <ThrowOnError extends boolean = false>(options: Options<SendAutomationTestEmailData, ThrowOnError>): RequestResult<SendAutomationTestEmailResponses, SendAutomationTestEmailErrors, ThrowOnError> => (options.client ?? client).post<SendAutomationTestEmailResponses, SendAutomationTestEmailErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows/email-test',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Delete an automation template\n */\nexport const deleteAutomationFlow = <ThrowOnError extends boolean = false>(options: Options<DeleteAutomationFlowData, ThrowOnError>): RequestResult<DeleteAutomationFlowResponses, DeleteAutomationFlowErrors, ThrowOnError> => (options.client ?? client).delete<DeleteAutomationFlowResponses, DeleteAutomationFlowErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows/{id}',\n ...options\n});\n\n/**\n * One automation template\n */\nexport const getAutomationFlow = <ThrowOnError extends boolean = false>(options: Options<GetAutomationFlowData, ThrowOnError>): RequestResult<GetAutomationFlowResponses, GetAutomationFlowErrors, ThrowOnError> => (options.client ?? client).get<GetAutomationFlowResponses, GetAutomationFlowErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows/{id}',\n ...options\n});\n\n/**\n * Update an automation template\n */\nexport const updateAutomationFlow = <ThrowOnError extends boolean = false>(options: Options<UpdateAutomationFlowData, ThrowOnError>): RequestResult<UpdateAutomationFlowResponses, UpdateAutomationFlowErrors, ThrowOnError> => (options.client ?? client).put<UpdateAutomationFlowResponses, UpdateAutomationFlowErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows/{id}',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Activate, pause, archive or unarchive a template (ACTIVE is refused while it has errors; ARCHIVED only from ACTIVE)\n */\nexport const setAutomationFlowStatus = <ThrowOnError extends boolean = false>(options: Options<SetAutomationFlowStatusData, ThrowOnError>): RequestResult<SetAutomationFlowStatusResponses, SetAutomationFlowStatusErrors, ThrowOnError> => (options.client ?? client).put<SetAutomationFlowStatusResponses, SetAutomationFlowStatusErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows/{id}/status',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * The publications a template is posed on\n */\nexport const listAutomationFlowPoses = <ThrowOnError extends boolean = false>(options: Options<ListAutomationFlowPosesData, ThrowOnError>): RequestResult<ListAutomationFlowPosesResponses, ListAutomationFlowPosesErrors, ThrowOnError> => (options.client ?? client).get<ListAutomationFlowPosesResponses, ListAutomationFlowPosesErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows/{id}/poses',\n ...options\n});\n\n/**\n * Pose a template on a post or story already live, with its words and values\n */\nexport const poseAutomationFlow = <ThrowOnError extends boolean = false>(options: Options<PoseAutomationFlowData, ThrowOnError>): RequestResult<PoseAutomationFlowResponses, PoseAutomationFlowErrors, ThrowOnError> => (options.client ?? client).post<PoseAutomationFlowResponses, PoseAutomationFlowErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flows/{id}/poses',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * The poses of a channel (one publication, or all) or of every channel of a workspace\n */\nexport const listChannelAutomationPoses = <ThrowOnError extends boolean = false>(options?: Options<ListChannelAutomationPosesData, ThrowOnError>): RequestResult<ListChannelAutomationPosesResponses, ListChannelAutomationPosesErrors, ThrowOnError> => (options?.client ?? client).get<ListChannelAutomationPosesResponses, ListChannelAutomationPosesErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flow-poses',\n ...options\n});\n\n/**\n * Remove a pose from its publication\n */\nexport const deleteAutomationPose = <ThrowOnError extends boolean = false>(options: Options<DeleteAutomationPoseData, ThrowOnError>): RequestResult<DeleteAutomationPoseResponses, DeleteAutomationPoseErrors, ThrowOnError> => (options.client ?? client).delete<DeleteAutomationPoseResponses, DeleteAutomationPoseErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flow-poses/{id}',\n ...options\n});\n\n/**\n * One pose\n */\nexport const getAutomationPose = <ThrowOnError extends boolean = false>(options: Options<GetAutomationPoseData, ThrowOnError>): RequestResult<GetAutomationPoseResponses, GetAutomationPoseErrors, ThrowOnError> => (options.client ?? client).get<GetAutomationPoseResponses, GetAutomationPoseErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flow-poses/{id}',\n ...options\n});\n\n/**\n * Change the words, values or pause of a pose\n */\nexport const updateAutomationPose = <ThrowOnError extends boolean = false>(options: Options<UpdateAutomationPoseData, ThrowOnError>): RequestResult<UpdateAutomationPoseResponses, UpdateAutomationPoseErrors, ThrowOnError> => (options.client ?? client).put<UpdateAutomationPoseResponses, UpdateAutomationPoseErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flow-poses/{id}',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * The people who went through a pose\n */\nexport const listAutomationPoseRuns = <ThrowOnError extends boolean = false>(options: Options<ListAutomationPoseRunsData, ThrowOnError>): RequestResult<ListAutomationPoseRunsResponses, ListAutomationPoseRunsErrors, ThrowOnError> => (options.client ?? client).get<ListAutomationPoseRunsResponses, ListAutomationPoseRunsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flow-poses/{id}/runs',\n ...options\n});\n\n/**\n * Read the publication’s comments now and start what a missed webhook left behind\n */\nexport const pollAutomationPose = <ThrowOnError extends boolean = false>(options: Options<PollAutomationPoseData, ThrowOnError>): RequestResult<PollAutomationPoseResponses, PollAutomationPoseErrors, ThrowOnError> => (options.client ?? client).post<PollAutomationPoseResponses, PollAutomationPoseErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flow-poses/{id}/poll',\n ...options\n});\n\n/**\n * Replay the automation on named comments, whatever their date\n */\nexport const replayAutomationPose = <ThrowOnError extends boolean = false>(options: Options<ReplayAutomationPoseData, ThrowOnError>): RequestResult<ReplayAutomationPoseResponses, ReplayAutomationPoseErrors, ThrowOnError> => (options.client ?? client).post<ReplayAutomationPoseResponses, ReplayAutomationPoseErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flow-poses/{id}/replay',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Preview a catch-up: the comments already on the publication that would start the automation, sending nothing\n */\nexport const previewAutomationPoseCatchUp = <ThrowOnError extends boolean = false>(options: Options<PreviewAutomationPoseCatchUpData, ThrowOnError>): RequestResult<PreviewAutomationPoseCatchUpResponses, PreviewAutomationPoseCatchUpErrors, ThrowOnError> => (options.client ?? client).get<PreviewAutomationPoseCatchUpResponses, PreviewAutomationPoseCatchUpErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flow-poses/{id}/catch-up',\n ...options\n});\n\n/**\n * Catch up the comments already on the publication: each matching comment starts the automation, a few per minute\n */\nexport const catchUpAutomationPose = <ThrowOnError extends boolean = false>(options: Options<CatchUpAutomationPoseData, ThrowOnError>): RequestResult<CatchUpAutomationPoseResponses, CatchUpAutomationPoseErrors, ThrowOnError> => (options.client ?? client).post<CatchUpAutomationPoseResponses, CatchUpAutomationPoseErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/automation-flow-poses/{id}/catch-up',\n ...options\n});\n\n/**\n * The event catalogue a webhook can subscribe to\n */\nexport const listWebhookEvents = <ThrowOnError extends boolean = false>(options?: Options<ListWebhookEventsData, ThrowOnError>): RequestResult<ListWebhookEventsResponses, ListWebhookEventsErrors, ThrowOnError> => (options?.client ?? client).get<ListWebhookEventsResponses, ListWebhookEventsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/webhooks/events',\n ...options\n});\n\n/**\n * List your webhook endpoints\n */\nexport const listWebhooks = <ThrowOnError extends boolean = false>(options?: Options<ListWebhooksData, ThrowOnError>): RequestResult<ListWebhooksResponses, ListWebhooksErrors, ThrowOnError> => (options?.client ?? client).get<ListWebhooksResponses, ListWebhooksErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/webhooks',\n ...options\n});\n\n/**\n * Register a webhook endpoint — the response carries the signing secret, once\n */\nexport const createWebhook = <ThrowOnError extends boolean = false>(options: Options<CreateWebhookData, ThrowOnError>): RequestResult<CreateWebhookResponses, CreateWebhookErrors, ThrowOnError> => (options.client ?? client).post<CreateWebhookResponses, CreateWebhookErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/webhooks',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Unregister a webhook endpoint\n */\nexport const deleteWebhook = <ThrowOnError extends boolean = false>(options: Options<DeleteWebhookData, ThrowOnError>): RequestResult<DeleteWebhookResponses, DeleteWebhookErrors, ThrowOnError> => (options.client ?? client).delete<DeleteWebhookResponses, DeleteWebhookErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/webhooks/{id}',\n ...options\n});\n\n/**\n * One webhook endpoint\n */\nexport const getWebhook = <ThrowOnError extends boolean = false>(options: Options<GetWebhookData, ThrowOnError>): RequestResult<GetWebhookResponses, GetWebhookErrors, ThrowOnError> => (options.client ?? client).get<GetWebhookResponses, GetWebhookErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/webhooks/{id}',\n ...options\n});\n\n/**\n * Send one signed test delivery to a webhook and return its HTTP status\n *\n * POSTs a sample of the event to this webhook only — same envelope `{ id, event, occurredAt, organizationId, data }`, same `X-Nadia-*` headers and signature as a real delivery — with `test: true` added to the envelope and `data` a realistic sample (fake `test_…` ids; nothing happened). One attempt, no retry, 10-second timeout; the call waits for it and returns what the endpoint answered. 400 when the event is not in the catalogue or the webhook is not subscribed to it.\n */\nexport const testWebhook = <ThrowOnError extends boolean = false>(options: Options<TestWebhookData, ThrowOnError>): RequestResult<TestWebhookResponses, TestWebhookErrors, ThrowOnError> => (options.client ?? client).post<TestWebhookResponses, TestWebhookErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/webhooks/{id}/test',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * List the cards of the board\n *\n * Filters combine. With `fields`, each card carries only the fields asked for (plus its id). A key limited to some workspaces lists the cards tagged with one of them and tied to no channel or post of another workspace.\n */\nexport const listContents = <ThrowOnError extends boolean = false>(options?: Options<ListContentsData, ThrowOnError>): RequestResult<ListContentsResponses, ListContentsErrors, ThrowOnError> => (options?.client ?? client).get<ListContentsResponses, ListContentsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents',\n ...options\n});\n\n/**\n * Create a card\n *\n * A card created by a key limited to some workspaces is tagged with them; by the organisation's key, it is not tagged.\n */\nexport const createContent = <ThrowOnError extends boolean = false>(options: Options<CreateContentData, ThrowOnError>): RequestResult<CreateContentResponses, CreateContentErrors, ThrowOnError> => (options.client ?? client).post<CreateContentResponses, CreateContentErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * The numbers of the published cards, keyed by card id\n */\nexport const getContentsPerformance = <ThrowOnError extends boolean = false>(options?: Options<GetContentsPerformanceData, ThrowOnError>): RequestResult<GetContentsPerformanceResponses, GetContentsPerformanceErrors, ThrowOnError> => (options?.client ?? client).get<GetContentsPerformanceResponses, GetContentsPerformanceErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents/performance',\n ...options\n});\n\n/**\n * Delete a card\n *\n * A key limited to some workspaces deleting a card that also carries other workspaces only takes its own workspaces off: the card stays for the others and comes back without `deletedAt`.\n */\nexport const deleteContent = <ThrowOnError extends boolean = false>(options: Options<DeleteContentData, ThrowOnError>): RequestResult<DeleteContentResponses, DeleteContentErrors, ThrowOnError> => (options.client ?? client).delete<DeleteContentResponses, DeleteContentErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents/{id}',\n ...options\n});\n\n/**\n * One card\n */\nexport const getContent = <ThrowOnError extends boolean = false>(options: Options<GetContentData, ThrowOnError>): RequestResult<GetContentResponses, GetContentErrors, ThrowOnError> => (options.client ?? client).get<GetContentResponses, GetContentErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents/{id}',\n ...options\n});\n\n/**\n * Update a card (only the fields sent; null clears)\n */\nexport const updateContent = <ThrowOnError extends boolean = false>(options: Options<UpdateContentData, ThrowOnError>): RequestResult<UpdateContentResponses, UpdateContentErrors, ThrowOnError> => (options.client ?? client).put<UpdateContentResponses, UpdateContentErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents/{id}',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Create or update a card by your own id\n *\n * The card holding `externalId` is updated with the fields sent (its column is left alone: use /move); without one, a card is created. Re-running an import never duplicates.\n */\nexport const upsertContent = <ThrowOnError extends boolean = false>(options: Options<UpsertContentData, ThrowOnError>): RequestResult<UpsertContentResponses, UpsertContentErrors, ThrowOnError> => (options.client ?? client).post<UpsertContentResponses, UpsertContentErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents/upsert',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Turn a shared video link into an idea card\n *\n * Send the link of a TikTok, Instagram or YouTube video (or the text a share gives, with the link in it): it becomes a card in IDEA, first of the column, tagged `inspiration`, its `source` PENDING. Nadia then reads the video in the background (its author, caption, duration, views, a copy of its thumbnail, its transcript); the video itself is never kept. `source.status` turns READY, or FAILED with `source.error` saying why (a private video, a dead short link, a platform that refuses our servers: YouTube today). The same video sent again answers 200 with its card, and nothing is read again.\n */\nexport const createContentFromLink = <ThrowOnError extends boolean = false>(options: Options<CreateContentFromLinkData, ThrowOnError>): RequestResult<CreateContentFromLinkResponses, CreateContentFromLinkErrors, ThrowOnError> => (options.client ?? client).post<CreateContentFromLinkResponses, CreateContentFromLinkErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents/from-link',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Move a card to another column\n */\nexport const moveContent = <ThrowOnError extends boolean = false>(options: Options<MoveContentData, ThrowOnError>): RequestResult<MoveContentResponses, MoveContentErrors, ThrowOnError> => (options.client ?? client).put<MoveContentResponses, MoveContentErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents/{id}/move',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Tie a card to a post scheduled from it\n *\n * Pass the `group` of a post created with POST /public/v1/posts. A card holds several posts (e.g. a TikTok draft and an Instagram post): each call adds one. A card behind \"To schedule\" jumps there; it moves to PUBLISHED when the first of its posts goes live.\n */\nexport const linkContentPost = <ThrowOnError extends boolean = false>(options: Options<LinkContentPostData, ThrowOnError>): RequestResult<LinkContentPostResponses, LinkContentPostErrors, ThrowOnError> => (options.client ?? client).put<LinkContentPostResponses, LinkContentPostErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents/{id}/post',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Tag a card with workspaces\n *\n * The whole set of workspaces a card of the idea box is tagged with. A card is never copied: when it serves two workspaces, it carries both tags. An untagged card is the organization's alone: the organization's key and the app see it, a key limited to some workspaces does not. A limited key only adds or takes off its own workspaces; the card's other tags stay. A card created by a limited key is tagged with its workspaces.\n */\nexport const setContentWorkspaces = <ThrowOnError extends boolean = false>(options: Options<SetContentWorkspacesData, ThrowOnError>): RequestResult<SetContentWorkspacesResponses, SetContentWorkspacesErrors, ThrowOnError> => (options.client ?? client).put<SetContentWorkspacesResponses, SetContentWorkspacesErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/contents/{id}/workspaces',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Search real hooks that worked\n *\n * Words of `q` are looked up in the hook, its opening and the subject of the video; the hooks matching the most words come first, then the best normalised views. Without `q`: the best hooks passing the filters. French only unless `language` says otherwise.\n */\nexport const searchHooks = <ThrowOnError extends boolean = false>(options?: Options<SearchHooksData, ThrowOnError>): RequestResult<SearchHooksResponses, SearchHooksErrors, ThrowOnError> => (options?.client ?? client).get<SearchHooksResponses, SearchHooksErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/hooks',\n ...options\n});\n\n/**\n * The best hook forms for a video, with real examples\n *\n * A catalogue of hook families for the video being prepared, ordered (weakly) by their measured effect on its nature (`nature`), each with real hooks: one on the subject (`q`) when there is one, the rest drawn at random among the hooks of the family, catastrophic ones left out. Two calls never give the same examples. Views follow the size of the subject, they do not rank the examples. The agent adapts the form of these hooks to its subject; it never invents one.\n */\nexport const getHookForms = <ThrowOnError extends boolean = false>(options?: Options<GetHookFormsData, ThrowOnError>): RequestResult<GetHookFormsResponses, GetHookFormsErrors, ThrowOnError> => (options?.client ?? client).get<GetHookFormsResponses, GetHookFormsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/hooks/forms',\n ...options\n});\n\n/**\n * The measured effect of each hook family\n *\n * From the studies corpus: views vs the rest, probability of superiority, share of bangers, and in how many accounts the family beats the rest of the same account. Only a `PROUVÉ` family is a rule. `nature` gives the table measured on one nature of video (`tuto_methode`…), default the whole corpus.\n */\nexport const listHookFamilies = <ThrowOnError extends boolean = false>(options?: Options<ListHookFamiliesData, ThrowOnError>): RequestResult<ListHookFamiliesResponses, ListHookFamiliesErrors, ThrowOnError> => (options?.client ?? client).get<ListHookFamiliesResponses, ListHookFamiliesErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/hooks/families',\n ...options\n});\n\n/**\n * Royalty-free music for a video\n *\n * Public domain and CC-BY tracks only, every file prepared (dynamics flattened, normalised to `storedLufs`). `ok` tracks first, in a random order, then `limite` ones when asked. `howTo` is the recipe: level under the voice, mix, credit line.\n */\nexport const listMusic = <ThrowOnError extends boolean = false>(options?: Options<ListMusicData, ThrowOnError>): RequestResult<ListMusicResponses, ListMusicErrors, ThrowOnError> => (options?.client ?? client).get<ListMusicResponses, ListMusicErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/music',\n ...options\n});\n\n/**\n * The pillars of the music catalogue\n *\n * What each pillar (piano, news, synthwave, epique) is for, with the number of tracks.\n */\nexport const listMusicPillars = <ThrowOnError extends boolean = false>(options?: Options<ListMusicPillarsData, ThrowOnError>): RequestResult<ListMusicPillarsResponses, ListMusicPillarsErrors, ThrowOnError> => (options?.client ?? client).get<ListMusicPillarsResponses, ListMusicPillarsErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/music/pillars',\n ...options\n});\n\n/**\n * One track of the catalogue\n */\nexport const getMusicTrack = <ThrowOnError extends boolean = false>(options: Options<GetMusicTrackData, ThrowOnError>): RequestResult<GetMusicTrackResponses, GetMusicTrackErrors, ThrowOnError> => (options.client ?? client).get<GetMusicTrackResponses, GetMusicTrackErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/music/{slug}',\n ...options\n});\n\n/**\n * Import tracks (upsert on slug) — super admin only\n */\nexport const importMusic = <ThrowOnError extends boolean = false>(options: Options<ImportMusicData, ThrowOnError>): RequestResult<ImportMusicResponses, ImportMusicErrors, ThrowOnError> => (options.client ?? client).post<ImportMusicResponses, ImportMusicErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/music/import',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Upload the prepared mp3 of a track — super admin only\n */\nexport const uploadMusicFile = <ThrowOnError extends boolean = false>(options: Options<UploadMusicFileData, ThrowOnError>): RequestResult<UploadMusicFileResponses, UploadMusicFileErrors, ThrowOnError> => (options.client ?? client).put<UploadMusicFileResponses, UploadMusicFileErrors, ThrowOnError>({\n ...formDataBodySerializer,\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/music/{slug}/file',\n ...options,\n headers: {\n 'Content-Type': null,\n ...options.headers\n }\n});\n\n/**\n * Delete a workspace — its channels and their posts move to the first other one\n */\nexport const deleteWorkspace = <ThrowOnError extends boolean = false>(options: Options<DeleteWorkspaceData, ThrowOnError>): RequestResult<DeleteWorkspaceResponses, DeleteWorkspaceErrors, ThrowOnError> => (options.client ?? client).delete<DeleteWorkspaceResponses, DeleteWorkspaceErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/workspaces/{id}',\n ...options\n});\n\n/**\n * Edit a workspace, or move channels into it\n */\nexport const updateWorkspace = <ThrowOnError extends boolean = false>(options: Options<UpdateWorkspaceData, ThrowOnError>): RequestResult<UpdateWorkspaceResponses, UpdateWorkspaceErrors, ThrowOnError> => (options.client ?? client).put<UpdateWorkspaceResponses, UpdateWorkspaceErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/workspaces/{id}',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * List the keys limited to some workspaces (nws_…), newest first — never their value, only its start\n */\nexport const listApiKeys = <ThrowOnError extends boolean = false>(options?: Options<ListApiKeysData, ThrowOnError>): RequestResult<ListApiKeysResponses, ListApiKeysErrors, ThrowOnError> => (options?.client ?? client).get<ListApiKeysResponses, ListApiKeysErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/api-keys',\n ...options\n});\n\n/**\n * Create a key limited to some workspaces — its value is returned in this answer only\n */\nexport const createApiKey = <ThrowOnError extends boolean = false>(options: Options<CreateApiKeyData, ThrowOnError>): RequestResult<CreateApiKeyResponses, CreateApiKeyErrors, ThrowOnError> => (options.client ?? client).post<CreateApiKeyResponses, CreateApiKeyErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/api-keys',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Revoke a key limited to some workspaces — from now on it answers as an unknown key\n */\nexport const revokeApiKey = <ThrowOnError extends boolean = false>(options: Options<RevokeApiKeyData, ThrowOnError>): RequestResult<RevokeApiKeyResponses, RevokeApiKeyErrors, ThrowOnError> => (options.client ?? client).delete<RevokeApiKeyResponses, RevokeApiKeyErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/api-keys/{id}',\n ...options\n});\n\n/**\n * Rename a key limited to some workspaces, or change its workspaces — its value does not change\n */\nexport const updateApiKey = <ThrowOnError extends boolean = false>(options: Options<UpdateApiKeyData, ThrowOnError>): RequestResult<UpdateApiKeyResponses, UpdateApiKeyErrors, ThrowOnError> => (options.client ?? client).put<UpdateApiKeyResponses, UpdateApiKeyErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/api-keys/{id}',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n});\n\n/**\n * Give a key limited to some workspaces a new value — returned in this answer only; the old value stops working at once\n */\nexport const rotateApiKey = <ThrowOnError extends boolean = false>(options: Options<RotateApiKeyData, ThrowOnError>): RequestResult<RotateApiKeyResponses, RotateApiKeyErrors, ThrowOnError> => (options.client ?? client).post<RotateApiKeyResponses, RotateApiKeyErrors, ThrowOnError>({\n security: [{ name: 'Authorization', type: 'apiKey' }],\n url: '/public/v1/api-keys/{id}/rotate',\n ...options\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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