@publishq/sdk 0.0.2 → 0.0.3
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/README.md +3 -3
- package/dist/index.cjs +35 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +221 -15
- package/dist/index.d.ts +221 -15
- package/dist/index.js +33 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs.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","../src/generated/zod.gen.ts"],"sourcesContent":["// Official TypeScript SDK for the PublishQ API.\n//\n// The auto-generated functions live in `./generated/`. They're grouped by\n// OpenAPI tag into per-tag classes (e.g. `Posts.listPosts`, `Media.uploadMedia`).\n// This wrapper builds one client per `PublishQ` instance with the user's API\n// key + base URL baked in, then exposes a thin namespaced facade so calls read\n// as `publishq.posts.create(...)`.\n//\n// Tripwire: a vitest test in `tests/tripwire.test.ts` reads every operationId\n// from the OpenAPI spec and asserts each appears in this file. If you add an\n// endpoint to the spec without wrapping it here, the test fails — your CI gate\n// against forgetting to expose new methods.\n\nimport {\n Accounts,\n type CreateMediaUploadData,\n type CreatePostData,\n type CreateWorkspaceData,\n type ListAccountsData,\n type ListMediaData,\n type ListPostsData,\n Media2 as Media,\n Posts,\n type UpdatePostData,\n type UploadMediaData,\n Workspaces,\n} from './generated';\nimport { type Client, createClient, createConfig } from './generated/client';\n\nexport interface PublishQOptions {\n /**\n * Your PublishQ API key (begins with `pq_live_`). Create one in the web app\n * under **API Keys** and select the scopes you need.\n */\n apiKey: string;\n /**\n * Override the API base URL. Defaults to `https://publishq.com/api/v1`.\n * Mostly useful for staging or local development.\n */\n baseUrl?: string;\n}\n\n// Preserve the exact response body for failed HTTP calls before the generated\n// client parses it. The generated client normalizes an empty body to `{}` and\n// cannot otherwise distinguish that from an API that literally returned `{}`.\nconst rawErrorBodies = new WeakMap<Response, Promise<string>>();\n\ninterface SdkFieldsResult {\n error?: unknown;\n response?: Response;\n}\n\nasync function preserveApiError<T extends SdkFieldsResult>(\n call: Promise<T>\n): Promise<T> {\n const result = await call;\n const response = result.response;\n const rawBody = response ? rawErrorBodies.get(response) : undefined;\n\n if (!response || response.ok || !rawBody) {\n return result;\n }\n\n const text = await rawBody;\n if (text.length === 0) {\n return { ...result, error: undefined };\n }\n\n let error: unknown = text;\n try {\n error = JSON.parse(text) as unknown;\n } catch {\n // The API returned text rather than JSON. Preserve it verbatim.\n }\n\n return { ...result, error };\n}\n\n/**\n * Official TypeScript SDK for the PublishQ API.\n *\n * Schedule and publish content across your social platforms with a single call.\n *\n * @example\n * ```ts\n * import PublishQ from \"@publishq/sdk\";\n *\n * const publishq = new PublishQ({ apiKey: process.env.PUBLISHQ_API_KEY! });\n *\n * const { data } = await publishq.accounts.list();\n * if (data) {\n * for (const account of data.accounts) {\n * console.log(account.platform, account.accountName);\n * }\n * }\n * ```\n */\nexport class PublishQ {\n /**\n * Post resources — create, list, retrieve, update, and delete posts across\n * the connected accounts this API key is scoped to.\n */\n readonly posts: ReturnType<typeof createPostsNamespace>;\n /**\n * Account resources — list connected social accounts and read the TikTok\n * creator info required before posting to TikTok.\n */\n readonly accounts: ReturnType<typeof createAccountsNamespace>;\n /**\n * Workspace resources — list, create, and retrieve the workspaces that\n * organize your connected accounts.\n */\n readonly workspaces: ReturnType<typeof createWorkspacesNamespace>;\n /**\n * Media resources — upload, list, and retrieve media files you can attach\n * to posts.\n */\n readonly media: ReturnType<typeof createMediaNamespace>;\n\n constructor(options: PublishQOptions) {\n const client = createClient(\n createConfig({\n baseUrl: options.baseUrl ?? 'https://publishq.com/api/v1',\n headers: {\n Authorization: `Bearer ${options.apiKey}`,\n },\n })\n );\n\n client.interceptors.response.use((response) => {\n if (!response.ok) {\n rawErrorBodies.set(response, response.clone().text());\n }\n return response;\n });\n\n this.posts = createPostsNamespace(client);\n this.accounts = createAccountsNamespace(client);\n this.workspaces = createWorkspacesNamespace(client);\n this.media = createMediaNamespace(client);\n }\n}\n\n// Each resource namespace is a small factory that takes the per-instance client\n// and returns the user-facing methods. Adding a new resource is just a new\n// createXNamespace function + a line in the constructor.\nfunction createPostsNamespace(client: Client) {\n return {\n /** List posts. Optionally filter by status/workspace/account and paginate. Wraps `Posts.listPosts`. */\n list: (query?: ListPostsData['query']) =>\n preserveApiError(Posts.listPosts({ client, query })),\n /** Create a post for one or more connected accounts. Wraps `Posts.createPost`. */\n create: (body: CreatePostData['body']) =>\n preserveApiError(Posts.createPost({ client, body })),\n /** Get one post by its PublishQ post ID. Wraps `Posts.getPost`. */\n get: (id: string) =>\n preserveApiError(Posts.getPost({ client, path: { id } })),\n /** Update a draft or scheduled post. Wraps `Posts.updatePost`. */\n update: (id: string, body: UpdatePostData['body']) =>\n preserveApiError(Posts.updatePost({ client, path: { id }, body })),\n /** Delete a scheduled or draft post by its ID. Wraps `Posts.deletePost`. */\n delete: (id: string) =>\n preserveApiError(Posts.deletePost({ client, path: { id } })),\n /** Remove one account from a post so it's no longer published there. Wraps `Posts.removePostAccount`. */\n removeAccount: (id: string, accountId: string) =>\n preserveApiError(\n Posts.removePostAccount({ client, path: { id, accountId } })\n ),\n };\n}\n\nfunction createAccountsNamespace(client: Client) {\n return {\n /** List connected social accounts. Filter by workspace and platform. Wraps `Accounts.listAccounts`. */\n list: (query?: ListAccountsData['query']) =>\n preserveApiError(Accounts.listAccounts({ client, query })),\n /** Get a TikTok account's creator info (privacy options, limits) before posting. Wraps `Accounts.getTikTokCreatorInfo`. */\n getTikTokCreatorInfo: (id: string) =>\n preserveApiError(\n Accounts.getTikTokCreatorInfo({ client, path: { id } })\n ),\n };\n}\n\nfunction createWorkspacesNamespace(client: Client) {\n return {\n /** List your workspaces with names, colors, and account counts. Wraps `Workspaces.listWorkspaces`. */\n list: () => preserveApiError(Workspaces.listWorkspaces({ client })),\n /** Create a workspace to organize your connected accounts. Wraps `Workspaces.createWorkspace`. */\n create: (body: CreateWorkspaceData['body']) =>\n preserveApiError(Workspaces.createWorkspace({ client, body })),\n /** Get one workspace by ID. Wraps `Workspaces.getWorkspace`. */\n get: (id: string) =>\n preserveApiError(Workspaces.getWorkspace({ client, path: { id } })),\n };\n}\n\n/**\n * The content types the API accepts, by file extension.\n *\n * This exists because of one sharp edge in Node: `new File([buffer], 'photo.jpg')`\n * produces a file whose `type` is the EMPTY STRING, and `fetch` then labels that\n * part of the multipart body `application/octet-stream`. The API rejects an\n * unsupported declared type before reading a byte, so a perfectly good JPEG read\n * off disk was refused with 415 while the same file sent by curl went through:\n * curl fills the type in from the extension, and Node does not.\n *\n * Keyed on the extension rather than sniffed from the bytes on purpose. The API\n * detects the real type from the first chunk itself and stores what it detects, so\n * a wrong extension here changes nothing about what gets stored; this only has to\n * be good enough to get past a metadata check.\n */\nconst UPLOAD_MIME_TYPE_BY_EXTENSION: Record<string, string> = {\n jpg: 'image/jpeg',\n jpeg: 'image/jpeg',\n png: 'image/png',\n gif: 'image/gif',\n webp: 'image/webp',\n mp4: 'video/mp4',\n webm: 'video/webm',\n mov: 'video/quicktime',\n avi: 'video/x-msvideo',\n};\n\n/** A type worth replacing: absent, or the placeholder `fetch` falls back to. */\nfunction isUninformativeType(type: string): boolean {\n return type === '' || type === 'application/octet-stream';\n}\n\n/**\n * Returns the file with a usable `type`, inferring it from the filename when the\n * caller could not supply one. Anything that already declares a type, or whose\n * extension is unknown, is passed through untouched: guessing past that point\n * would be inventing a fact, and the API's own byte-level detection is the thing\n * that decides what the file really is.\n */\nexport function withInferredContentType(file: Blob | File): Blob | File {\n const name = 'name' in file ? file.name : undefined;\n if (!name || !isUninformativeType(file.type)) return file;\n\n const extension = name.split('.').pop()?.toLowerCase();\n const type = extension ? UPLOAD_MIME_TYPE_BY_EXTENSION[extension] : undefined;\n if (!type) return file;\n\n return new File([file], name, { type });\n}\n\n/** Files above this size are sent straight to storage through `createUpload`. */\nexport const STORAGE_UPLOAD_THRESHOLD_BYTES = 90 * 1024 * 1024;\n\nasync function uploadThroughStorage(client: Client, file: Blob | File) {\n const created = await preserveApiError(\n Media.createMediaUpload({\n client,\n body: {\n filename: 'name' in file && file.name ? file.name : 'upload',\n contentType: file.type,\n fileSize: file.size,\n },\n })\n );\n if (!created.data) return created;\n\n const response = await fetch(created.data.uploadUrl, {\n method: 'PUT',\n headers: { 'Content-Type': file.type },\n body: file,\n });\n if (!response.ok) {\n return {\n data: undefined,\n error: {\n error: {\n status: response.status,\n message: 'Storage refused the file upload',\n mediaId: created.data.id,\n storageResponse: await response.text(),\n },\n },\n request: new Request(created.data.uploadUrl, { method: 'PUT' }),\n response,\n };\n }\n\n return preserveApiError(\n Media.completeMediaUpload({ client, path: { id: created.data.id } })\n );\n}\n\nfunction createMediaNamespace(client: Client) {\n return {\n /** List your uploaded and generated media files. Filter by id, type, source. Wraps `Media.listMedia`. */\n list: (query?: ListMediaData['query']) =>\n preserveApiError(Media.listMedia({ client, query })),\n /**\n * Upload one media file and get back a media ID to attach to posts. Wraps\n * `Media.uploadMedia`, or for files over `STORAGE_UPLOAD_THRESHOLD_BYTES`\n * runs `createUpload`, sends the file to storage and returns the finished\n * media from `completeUpload`. Both return the same `Media` object.\n *\n * The file's content type is filled in from its name when it has none, so a\n * file read off disk with `new File([buffer], 'photo.jpg')` is not sent as\n * `application/octet-stream` and refused. See `withInferredContentType`.\n */\n upload: (body: UploadMediaData['body']) => {\n const file = withInferredContentType(body.file);\n if (file.size > STORAGE_UPLOAD_THRESHOLD_BYTES) {\n return uploadThroughStorage(client, file);\n }\n return preserveApiError(\n Media.uploadMedia({ client, body: { ...body, file } })\n );\n },\n /** Get a storage upload URL for a file of up to 4 GB. Send the file there, then use the returned media ID in posts. Wraps `Media.createMediaUpload`. */\n createUpload: (body: CreateMediaUploadData['body']) =>\n preserveApiError(Media.createMediaUpload({ client, body })),\n /** Add a file sent to a `createUpload` URL to the media library now and return it. Optional: using the ID in a post does the same. Wraps `Media.completeMediaUpload`. */\n completeUpload: (id: string) =>\n preserveApiError(Media.completeMediaUpload({ client, path: { id } })),\n /** Get one media file by ID. Wraps `Media.getMedia`. */\n get: (id: string) =>\n preserveApiError(Media.getMedia({ client, path: { id } })),\n };\n}\n\n// Power-user re-exports: the raw generated per-tag classes and all generated\n// types, for callers who'd rather drive the client directly. Note the media\n// class is re-exported as `Media2` (hey-api renames it to avoid clashing with\n// the `Media` schema type); most callers should use the `publishq.media` facade.\nexport * from './generated';\n\n// Runtime schemas are generated from the same OpenAPI contract as the SDK\n// types. Consumers such as @publishq/mcp can validate requests without\n// maintaining a second handwritten copy of the API contract.\nexport * from './generated/zod.gen';\n\nexport default PublishQ;\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://publishq.com/api/v1' }));\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 { CompleteMediaUploadData, CompleteMediaUploadErrors, CompleteMediaUploadResponses, CreateMediaUploadData, CreateMediaUploadErrors, CreateMediaUploadResponses, CreatePostData, CreatePostErrors, CreatePostResponses, CreateWorkspaceData, CreateWorkspaceErrors, CreateWorkspaceResponses, DeletePostData, DeletePostErrors, DeletePostResponses, GetMediaData, GetMediaErrors, GetMediaResponses, GetPostData, GetPostErrors, GetPostResponses, GetTikTokCreatorInfoData, GetTikTokCreatorInfoErrors, GetTikTokCreatorInfoResponses, GetWorkspaceData, GetWorkspaceErrors, GetWorkspaceResponses, ListAccountsData, ListAccountsErrors, ListAccountsResponses, ListMediaData, ListMediaErrors, ListMediaResponses, ListPostsData, ListPostsErrors, ListPostsResponses, ListWorkspacesData, ListWorkspacesErrors, ListWorkspacesResponses, RemovePostAccountData, RemovePostAccountErrors, RemovePostAccountResponses, UpdatePostData, UpdatePostErrors, UpdatePostResponses, UploadMediaData, UploadMediaErrors, UploadMediaResponses } 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\nexport class Posts {\n /**\n * List posts\n *\n * Returns a paginated list of the posts you created through PublishQ. Posts imported from a connected platform are excluded by default; pass includeImported=true to get both, or onlyImported=true for only the imported ones.\n */\n public static listPosts<ThrowOnError extends boolean = false>(options?: Options<ListPostsData, ThrowOnError>): RequestResult<ListPostsResponses, ListPostsErrors, ThrowOnError> {\n return (options?.client ?? client).get<ListPostsResponses, ListPostsErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/posts',\n ...options\n });\n }\n \n /**\n * Create posts\n *\n * Creates a post for one or more connected accounts.\n */\n public static createPost<ThrowOnError extends boolean = false>(options: Options<CreatePostData, ThrowOnError>): RequestResult<CreatePostResponses, CreatePostErrors, ThrowOnError> {\n return (options.client ?? client).post<CreatePostResponses, CreatePostErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/posts',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Delete post\n *\n * Deletes a scheduled or draft post by its ID. Returns no body on success.\n */\n public static deletePost<ThrowOnError extends boolean = false>(options: Options<DeletePostData, ThrowOnError>): RequestResult<DeletePostResponses, DeletePostErrors, ThrowOnError> {\n return (options.client ?? client).delete<DeletePostResponses, DeletePostErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/posts/{id}',\n ...options\n });\n }\n \n /**\n * Get post\n *\n * Get one post by its PublishQ post ID. Returns the post details and the connected account metadata needed to identify where it belongs.\n */\n public static getPost<ThrowOnError extends boolean = false>(options: Options<GetPostData, ThrowOnError>): RequestResult<GetPostResponses, GetPostErrors, ThrowOnError> {\n return (options.client ?? client).get<GetPostResponses, GetPostErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/posts/{id}',\n ...options\n });\n }\n \n /**\n * Update post\n *\n * Update a draft or scheduled post. You can change the content, the scheduled date, or both. Published and publishing posts cannot be updated.\n */\n public static updatePost<ThrowOnError extends boolean = false>(options: Options<UpdatePostData, ThrowOnError>): RequestResult<UpdatePostResponses, UpdatePostErrors, ThrowOnError> {\n return (options.client ?? client).patch<UpdatePostResponses, UpdatePostErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/posts/{id}',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Remove account from post\n *\n * Removes one account from an existing post so it will no longer be published there. Other accounts in the same post are not changed.\n */\n public static removePostAccount<ThrowOnError extends boolean = false>(options: Options<RemovePostAccountData, ThrowOnError>): RequestResult<RemovePostAccountResponses, RemovePostAccountErrors, ThrowOnError> {\n return (options.client ?? client).delete<RemovePostAccountResponses, RemovePostAccountErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/posts/{id}/accounts/{accountId}',\n ...options\n });\n }\n}\n\nexport class Accounts {\n /**\n * List accounts\n *\n * List connected social accounts for the authenticated API key owner. You can filter by workspace and by one or more platforms.\n */\n public static listAccounts<ThrowOnError extends boolean = false>(options?: Options<ListAccountsData, ThrowOnError>): RequestResult<ListAccountsResponses, ListAccountsErrors, ThrowOnError> {\n return (options?.client ?? client).get<ListAccountsResponses, ListAccountsErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/accounts',\n ...options\n });\n }\n \n /**\n * Get TikTok creator info\n *\n * Returns the TikTok creator's current privacy options, interaction settings, and maximum video duration. Call this before posting to TikTok — the `privacyLevel` you set must match one of the returned `privacyLevelOptions`.\n */\n public static getTikTokCreatorInfo<ThrowOnError extends boolean = false>(options: Options<GetTikTokCreatorInfoData, ThrowOnError>): RequestResult<GetTikTokCreatorInfoResponses, GetTikTokCreatorInfoErrors, ThrowOnError> {\n return (options.client ?? client).get<GetTikTokCreatorInfoResponses, GetTikTokCreatorInfoErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/accounts/{id}/tiktok-creator-info',\n ...options\n });\n }\n}\n\nexport class Workspaces {\n /**\n * List workspaces\n *\n * Return your workspaces, including their names, colors, and account counts.\n */\n public static listWorkspaces<ThrowOnError extends boolean = false>(options?: Options<ListWorkspacesData, ThrowOnError>): RequestResult<ListWorkspacesResponses, ListWorkspacesErrors, ThrowOnError> {\n return (options?.client ?? client).get<ListWorkspacesResponses, ListWorkspacesErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/workspaces',\n ...options\n });\n }\n \n /**\n * Create workspace\n *\n * Create a workspace to organize your connected social accounts.\n */\n public static createWorkspace<ThrowOnError extends boolean = false>(options: Options<CreateWorkspaceData, ThrowOnError>): RequestResult<CreateWorkspaceResponses, CreateWorkspaceErrors, ThrowOnError> {\n return (options.client ?? client).post<CreateWorkspaceResponses, CreateWorkspaceErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/workspaces',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Get workspace\n *\n * Return one workspace by ID, including its name, color, description, and account count.\n */\n public static getWorkspace<ThrowOnError extends boolean = false>(options: Options<GetWorkspaceData, ThrowOnError>): RequestResult<GetWorkspaceResponses, GetWorkspaceErrors, ThrowOnError> {\n return (options.client ?? client).get<GetWorkspaceResponses, GetWorkspaceErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/workspaces/{id}',\n ...options\n });\n }\n}\n\nexport class Media {\n /**\n * List media\n *\n * Return your uploaded and generated media files. You can filter by ID, type, and source before reusing them in posts.\n */\n public static listMedia<ThrowOnError extends boolean = false>(options?: Options<ListMediaData, ThrowOnError>): RequestResult<ListMediaResponses, ListMediaErrors, ThrowOnError> {\n return (options?.client ?? client).get<ListMediaResponses, ListMediaErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/media',\n ...options\n });\n }\n \n /**\n * Upload media\n *\n * Upload a file smaller than 100 MB in a single request. It is the simplest way to upload: one call returns a media ID you can attach to posts. For bigger files, use Create media upload.\n */\n public static uploadMedia<ThrowOnError extends boolean = false>(options: Options<UploadMediaData, ThrowOnError>): RequestResult<UploadMediaResponses, UploadMediaErrors, ThrowOnError> {\n return (options.client ?? client).post<UploadMediaResponses, UploadMediaErrors, ThrowOnError>({\n ...formDataBodySerializer,\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/media',\n ...options,\n headers: {\n 'Content-Type': null,\n ...options.headers\n }\n });\n }\n \n /**\n * Get media\n *\n * Return one media file by ID, including its URL, source, and usage count.\n */\n public static getMedia<ThrowOnError extends boolean = false>(options: Options<GetMediaData, ThrowOnError>): RequestResult<GetMediaResponses, GetMediaErrors, ThrowOnError> {\n return (options.client ?? client).get<GetMediaResponses, GetMediaErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/media/{id}',\n ...options\n });\n }\n \n /**\n * Create media upload\n *\n * Upload a file of up to 4 GB (500 MB on the Free plan) straight to storage:\n *\n * 1. Call this endpoint with `filename`, `contentType` and `fileSize`. You get back an `id` and an `uploadUrl`.\n * 2. `PUT` the file to `uploadUrl` with the same `Content-Type` header. Storage answers `200`, or `403` if the file is not exactly `fileSize` bytes.\n * 3. Optional: call Complete media upload to add the file to your media library now.\n * 4. Put the `id` in `mediaIds` when you create or update a post.\n */\n public static createMediaUpload<ThrowOnError extends boolean = false>(options: Options<CreateMediaUploadData, ThrowOnError>): RequestResult<CreateMediaUploadResponses, CreateMediaUploadErrors, ThrowOnError> {\n return (options.client ?? client).post<CreateMediaUploadResponses, CreateMediaUploadErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/media/uploads',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Complete media upload\n *\n * Optional. Adds a file uploaded through Create media upload to your media library now and returns it. Without this call the file is added the first time you use its id in a post, and an upload nobody completes or uses within 1 day expires.\n */\n public static completeMediaUpload<ThrowOnError extends boolean = false>(options: Options<CompleteMediaUploadData, ThrowOnError>): RequestResult<CompleteMediaUploadResponses, CompleteMediaUploadErrors, ThrowOnError> {\n return (options.client ?? client).post<CompleteMediaUploadResponses, CompleteMediaUploadErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/media/uploads/{id}/complete',\n ...options\n });\n }\n}\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport * as z from 'zod/mini';\n\nexport const zApiErrorCode = z.enum([\n 'missing_auth',\n 'invalid_auth_format',\n 'invalid_api_key',\n 'api_key_expired',\n 'insufficient_scope',\n 'validation_failed',\n 'route_not_found',\n 'internal_server_error',\n 'rate_limit_exceeded',\n 'post_not_found',\n 'post_forbidden',\n 'post_not_editable',\n 'media_not_found',\n 'media_in_use',\n 'media_upload_incomplete',\n 'storage_limit_exceeded',\n 'free_media_limit_exceeded',\n 'free_pending_media_limit_exceeded',\n 'file_required',\n 'file_too_large',\n 'unsupported_file_type',\n 'unsupported_media_type',\n 'invalid_file_extension',\n 'social_accounts_not_found',\n 'social_accounts_expired',\n 'social_account_limit_exceeded',\n 'platform_temporarily_unavailable',\n 'platform_permission_missing',\n 'platform_validation_failed',\n 'posting_limits_exceeded',\n 'scheduled_at_required',\n 'invalid_scheduled_at',\n 'scheduled_at_too_soon',\n 'reschedulable_posts_not_found',\n 'workspace_not_found',\n 'workspace_forbidden',\n 'workspace_owner_required',\n 'workspace_limit_exceeded',\n 'workspace_account_not_found',\n 'workspace_account_conflict',\n 'workspace_member_not_found',\n 'workspace_member_conflict',\n 'team_member_limit_exceeded',\n 'workspace_invitation_invalid',\n 'workspace_invitation_expired'\n]);\n\nexport const zApiError = z.object({\n error: z.object({\n title: z.string(),\n status: z.int(),\n code: zApiErrorCode,\n message: z.string(),\n instance: z.optional(z.string()),\n details: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())))\n })\n});\n\nexport const zPagination = z.object({\n page: z.int().register(z.globalRegistry, {\n description: 'Current page number (starting from 1).'\n }),\n limit: z.int().register(z.globalRegistry, {\n description: 'Maximum number of items returned per page.'\n }),\n total: z.int().register(z.globalRegistry, {\n description: 'Total number of matching items.'\n }),\n totalPages: z.int().register(z.globalRegistry, {\n description: 'Total number of pages for the current limit.'\n }),\n hasNext: z.boolean().register(z.globalRegistry, {\n description: 'Whether another page exists after the current one.'\n }),\n hasPrev: z.boolean().register(z.globalRegistry, {\n description: 'Whether another page exists before the current one.'\n })\n});\n\n/**\n * BlueskyPlatformSpecificSettings\n *\n * Bluesky-specific publishing settings. No settings are currently available.\n */\nexport const zBlueskyPlatformSpecificSettings = z.record(z.string(), z.never()).register(z.globalRegistry, {\n description: 'Bluesky-specific publishing settings. No settings are currently available.'\n});\n\n/**\n * InstagramPlatformSpecificSettings\n *\n * Instagram-specific post settings. All fields are optional — omit the entire object for a regular feed post or carousel.\n */\nexport const zInstagramPlatformSpecificSettings = z.object({\n contentType: z.optional(z.enum(['story', 'reels']).register(z.globalRegistry, {\n description: 'Set to \"story\" for ephemeral content that disappears after 24 hours. Set to \"reels\" to explicitly publish as a Reel. Omit for a regular feed post or carousel — single videos are automatically published as Reels.'\n })),\n shareToFeed: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Reels only. When true (default), the reel can appear in both the Feed and Reels tabs. When false, it only appears in the Reels tab. Neither value guarantees placement — Instagram\\'s algorithm decides based on eligibility and relevance.'\n })),\n trialParams: z.optional(z.object({\n graduationStrategy: z.enum(['MANUAL', 'SS_PERFORMANCE']).register(z.globalRegistry, {\n description: 'MANUAL: the trial reel can be graduated (converted to a public reel) manually in the Instagram app. SS_PERFORMANCE: Instagram automatically graduates the reel if it performs well with non-followers.'\n })\n }).register(z.globalRegistry, {\n description: 'Reels only. Publish as a trial reel — shown only to non-followers first. Instagram requires a public account with at least 200 followers and rejects the post otherwise.'\n })),\n audioName: z.optional(z.string().register(z.globalRegistry, {\n description: 'Reels only. Custom name for the audio track of your reel. Can only be set once — either at creation time or later from the audio page in the Instagram app.'\n }))\n}).register(z.globalRegistry, {\n description: 'Instagram-specific post settings. All fields are optional — omit the entire object for a regular feed post or carousel.'\n});\n\n/**\n * FacebookPlatformSpecificSettings\n *\n * Facebook-specific post settings. All fields are optional — omit the entire object for a regular post.\n */\nexport const zFacebookPlatformSpecificSettings = z.object({\n contentType: z.optional(z.enum(['story']).register(z.globalRegistry, {\n description: 'Set to \"story\" for ephemeral content that disappears after 24 hours. Omit for a regular post — single videos are automatically published as Reels (Facebook no longer has a separate video format).'\n }))\n}).register(z.globalRegistry, {\n description: 'Facebook-specific post settings. All fields are optional — omit the entire object for a regular post.'\n});\n\n/**\n * InstagramTrialParams\n *\n * Trial reel graduation settings. Trial reels are shown only to non-followers first. If the reel performs well (SS_PERFORMANCE) or you manually approve it (MANUAL), it gets promoted to a regular reel visible to followers.\n */\nexport const zInstagramTrialParams = z.object({\n graduationStrategy: z.enum(['MANUAL', 'SS_PERFORMANCE']).register(z.globalRegistry, {\n description: 'MANUAL: the trial reel can be graduated (converted to a public reel) manually in the Instagram app. SS_PERFORMANCE: Instagram automatically graduates the reel if it performs well with non-followers.'\n })\n}).register(z.globalRegistry, {\n description: 'Trial reel graduation settings. Trial reels are shown only to non-followers first. If the reel performs well (SS_PERFORMANCE) or you manually approve it (MANUAL), it gets promoted to a regular reel visible to followers.'\n});\n\n/**\n * YouTubePlatformSpecificSettings\n *\n * YouTube-specific upload settings, such as description and privacy.\n */\nexport const zYouTubePlatformSpecificSettings = z.object({\n description: z.optional(z.string().check(z.maxLength(5000)).register(z.globalRegistry, {\n description: 'Video description. Max 5000 characters. Shown below the video title on the watch page.'\n })),\n privacyStatus: z.optional(z.enum([\n 'public',\n 'unlisted',\n 'private'\n ]).register(z.globalRegistry, {\n description: 'Video privacy status. Defaults to public. Unverified API projects are restricted to private.'\n })),\n madeForKids: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Declare the video as made for kids (COPPA). When true, personalized ads are disabled and some features (comments, notifications) are turned off.'\n })),\n containsSyntheticMedia: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Disclose that the video contains realistic altered or synthetic (AI-generated) content.'\n })),\n categoryId: z.optional(z.enum([\n '1',\n '2',\n '10',\n '15',\n '17',\n '19',\n '20',\n '22',\n '23',\n '24',\n '25',\n '26',\n '27',\n '28',\n '29'\n ]).register(z.globalRegistry, {\n description: 'YouTube video category. Defaults to \"22\" (People & Blogs). Valid IDs: 1 (Film & Animation), 2 (Autos & Vehicles), 10 (Music), 15 (Pets & Animals), 17 (Sports), 19 (Travel & Events), 20 (Gaming), 22 (People & Blogs), 23 (Comedy), 24 (Entertainment), 25 (News & Politics), 26 (Howto & Style), 27 (Education), 28 (Science & Technology), 29 (Nonprofits & Activism).'\n })),\n tags: z.optional(z.array(z.string()).register(z.globalRegistry, {\n description: 'Keyword tags for the video. Duplicates are removed. Total of all tags must be under 500 characters. Tags with spaces count as quoted (2 extra chars). Commas between tags also count.'\n })),\n embeddable: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Whether the video can be embedded on other websites. Defaults to true.'\n })),\n playlistId: z.optional(z.string().register(z.globalRegistry, {\n description: 'Playlist ID to add the video to after upload.'\n }))\n}).register(z.globalRegistry, {\n description: 'YouTube-specific upload settings, such as description and privacy.'\n});\n\n/**\n * TikTokPlatformSpecificSettings\n *\n * TikTok-specific publishing settings. Privacy level and brand toggles are required for all posts. Duet/stitch settings only apply to video posts. autoAddMusic only applies to photo posts.\n */\nexport const zTikTokPlatformSpecificSettings = z.object({\n privacyLevel: z.enum([\n 'PUBLIC_TO_EVERYONE',\n 'FOLLOWER_OF_CREATOR',\n 'MUTUAL_FOLLOW_FRIENDS',\n 'SELF_ONLY'\n ]).register(z.globalRegistry, {\n description: 'Who can view this post. The value must match one of the options returned by the TikTok creator_info/query endpoint for the target account.'\n }),\n disableComment: z.boolean().register(z.globalRegistry, {\n description: 'If true, other TikTok users cannot comment on this post. Ignored if the creator has set comments to \"No one\" in their privacy settings.'\n }),\n disableDuet: z.boolean().register(z.globalRegistry, {\n description: 'If true, other TikTok users cannot create Duets with this post. Only applies to video posts. Ignored for photo posts and private accounts.'\n }),\n disableStitch: z.boolean().register(z.globalRegistry, {\n description: 'If true, other TikTok users cannot create Stitches with this post. Only applies to video posts. Ignored for photo posts and private accounts.'\n }),\n brandContentToggle: z.boolean().register(z.globalRegistry, {\n description: 'Set to true if this is a paid partnership promoting a third-party business. Required by TikTok for branded content disclosure.'\n }),\n brandOrganicToggle: z.boolean().register(z.globalRegistry, {\n description: 'Set to true if this post promotes the creator\\'s own business.'\n }),\n autoAddMusic: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Photo posts only. If true, TikTok automatically adds recommended background music to the photo carousel. Users can change the music later in the TikTok app.'\n })),\n videoMadeWithAi: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Video posts only. Set to true if the video is AI-generated content. The video will be labeled with a \"Creator labeled as AI-generated\" tag.'\n })),\n description: z.optional(z.string().check(z.maxLength(4000)).register(z.globalRegistry, {\n description: 'Photo posts only. Additional description text (max 4000 characters). Hashtags and mentions in the description are parsed by TikTok.'\n })),\n photoCoverIndex: z.optional(z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'Photo posts only. Zero-based index of the image to use as the carousel cover. Defaults to 0 (first image).'\n }))\n}).register(z.globalRegistry, {\n description: 'TikTok-specific publishing settings. Privacy level and brand toggles are required for all posts. Duet/stitch settings only apply to video posts. autoAddMusic only applies to photo posts.'\n});\n\n/**\n * LinkedInPlatformSpecificSettings\n *\n * LinkedIn-specific publishing settings, such as post visibility.\n */\nexport const zLinkedInPlatformSpecificSettings = z.object({\n visibility: z.optional(z.enum(['CONNECTIONS', 'PUBLIC']).register(z.globalRegistry, {\n description: 'Who can see the post. PUBLIC (anyone on LinkedIn) or CONNECTIONS (only your connections). Defaults to PUBLIC. Only available for personal profiles — company pages are always public.'\n }))\n}).register(z.globalRegistry, {\n description: 'LinkedIn-specific publishing settings, such as post visibility.'\n});\n\n/**\n * ThreadsPlatformSpecificSettings\n *\n * Threads-specific publishing settings.\n */\nexport const zThreadsPlatformSpecificSettings = z.object({\n topicTag: z.optional(z.string().check(z.minLength(1), z.maxLength(50)).register(z.globalRegistry, {\n description: 'A topic tag for the post (without the # prefix). Max 50 characters. Periods (.) and ampersands (&) are not allowed. Overrides any auto-detected topic from inline hashtags.'\n }))\n}).register(z.globalRegistry, {\n description: 'Threads-specific publishing settings.'\n});\n\n/**\n * TwitterPlatformSpecificSettings\n *\n * X (Twitter) specific post settings. All fields are optional.\n */\nexport const zTwitterPlatformSpecificSettings = z.object({\n communityId: z.optional(z.string().check(z.regex(/^[0-9]{1,19}$/)).register(z.globalRegistry, {\n description: 'Post to a specific X Community. The authenticated user must be a member of the community.'\n })),\n shareWithFollowers: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'When posting to a community, also share the post with your followers. Only applies when `communityId` is set.'\n })),\n forSuperFollowersOnly: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Make this post exclusive to your subscribers (super followers).'\n })),\n replySettings: z.optional(z.enum([\n 'following',\n 'mentionedUsers',\n 'subscribers',\n 'verified'\n ]).register(z.globalRegistry, {\n description: 'Control who can reply. `following`: only people you follow. `mentionedUsers`: only people mentioned in the post. `subscribers`: only your subscribers. `verified`: only verified users.'\n })),\n quoteTweetId: z.optional(z.string().check(z.regex(/^[0-9]{1,19}$/)).register(z.globalRegistry, {\n description: 'ID of an existing tweet to quote. Mutually exclusive with poll and media.'\n })),\n replyToTweetId: z.optional(z.string().check(z.regex(/^[0-9]{1,19}$/)).register(z.globalRegistry, {\n description: 'ID of an existing tweet to reply to. Your post will appear as a reply in that tweet\\'s thread.'\n })),\n poll: z.optional(z.object({\n options: z.array(z.string().check(z.minLength(1), z.maxLength(25))).check(z.minLength(2), z.maxLength(4)).register(z.globalRegistry, {\n description: 'Poll choices. 2-4 options, max 25 characters each.'\n }),\n durationMinutes: z.int().check(z.gte(5), z.lte(10080)).register(z.globalRegistry, {\n description: 'How long the poll stays open, in minutes. Min 5 minutes, max 7 days (10080).'\n })\n }).register(z.globalRegistry, {\n description: 'Create a poll. Mutually exclusive with media and `quoteTweetId`.'\n }))\n}).register(z.globalRegistry, {\n description: 'X (Twitter) specific post settings. All fields are optional.'\n});\n\n/**\n * Where the post came from. PUBLISHQ: created in PublishQ. IMPORTED: published directly on the platform and discovered during an analytics sync, so the post history stays complete.\n */\nexport const zPostSource = z.enum(['PUBLISHQ', 'IMPORTED']).register(z.globalRegistry, {\n description: 'Where the post came from. PUBLISHQ: created in PublishQ. IMPORTED: published directly on the platform and discovered during an analytics sync, so the post history stays complete.'\n});\n\nexport const zPostAnalytics = z.object({\n views: z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'Views the platform reports for this post.'\n }),\n likes: z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'Likes the platform reports for this post.'\n }),\n comments: z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'Comments the platform reports for this post.'\n }),\n shares: z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'Shares the platform reports for this post. 0 on platforms that do not disclose it (including YouTube).'\n }),\n extraMetrics: z.record(z.string(), z.int().check(z.gte(0))).register(z.globalRegistry, {\n description: 'Metrics only this platform reports, keyed by metric name — Bluesky bookmarks, for example. Every metric the platform reports is always present, 0 included, so no key has to be guessed. Empty on platforms that expose nothing beyond the fields above, and a metric that already has its own field is never repeated here.'\n }),\n syncedAt: z.iso.datetime().register(z.globalRegistry, {\n description: 'When these numbers were last recorded. Metrics are refreshed in the background roughly once a day, and only stored when they change.'\n })\n});\n\nexport const zPublishFailure = z.object({\n kind: z.enum([\n 'RECONNECT',\n 'MEDIA',\n 'ACCOUNT_STATE',\n 'TRANSIENT',\n 'MAYBE_PUBLISHED',\n 'UNKNOWN'\n ]).register(z.globalRegistry, {\n description: 'What kind of action this failure needs. `RECONNECT`: the account has to be reconnected. `MEDIA`: the platform refused the attached file. `ACCOUNT_STATE`: the platform is blocking this account, so the fix is on the platform. `TRANSIENT`: the platform was unavailable and the same request can succeed unchanged. `MAYBE_PUBLISHED`: the platform reported an error for a post that may have gone out anyway. `UNKNOWN`: unrecognised, so read `errorMessage`.'\n }),\n title: z.string().register(z.globalRegistry, {\n description: 'Short label for this failure.'\n }),\n whatHappened: z.string().register(z.globalRegistry, {\n description: 'One sentence about what the platform did.'\n }),\n whatToDo: z.string().register(z.globalRegistry, {\n description: 'One sentence naming the next action.'\n }),\n canRetry: z.boolean().register(z.globalRegistry, {\n description: 'Whether retrying can succeed. False when the platform is blocking the account, since the same request will be refused the same way.'\n }),\n checkPlatformFirst: z.boolean().register(z.globalRegistry, {\n description: 'Whether the post may already be live. A publish is not idempotent and no platform accepts a deduplication key, so when this is true a retry can create a second copy: check the profile before retrying.'\n })\n});\n\nexport const zSocialPlatform = z.enum([\n 'TWITTER',\n 'INSTAGRAM',\n 'FACEBOOK',\n 'LINKEDIN',\n 'YOUTUBE',\n 'TIKTOK',\n 'THREADS',\n 'BLUESKY'\n]);\n\nexport const zPostStatus = z.enum([\n 'DRAFT',\n 'SCHEDULED',\n 'PUBLISHING',\n 'PUBLISHED',\n 'FAILED'\n]);\n\nexport const zPostOverrides = z.object({\n content: z.optional(z.string().register(z.globalRegistry, {\n description: 'Custom text for this account, overriding the post-level content.'\n })),\n thumbnailTimestamp: z.optional(z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'Video thumbnail timestamp in milliseconds. Applies to Instagram and TikTok.'\n })),\n mediaIds: z.optional(z.array(z.uuid()).check(z.maxLength(35)).register(z.globalRegistry, {\n description: 'Replacement media for this account. Completely replaces the post-level media. Up to 35.'\n }))\n});\n\n/**\n * Platform-specific settings for this account. The accepted shape depends on the account platform.\n */\nexport const zPlatformSpecificSettings = z.union([\n z.object({\n description: z.optional(z.string().check(z.maxLength(5000)).register(z.globalRegistry, {\n description: 'Video description. Max 5000 characters. Shown below the video title on the watch page.'\n })),\n privacyStatus: z.optional(z.enum([\n 'public',\n 'unlisted',\n 'private'\n ]).register(z.globalRegistry, {\n description: 'Video privacy status. Defaults to public. Unverified API projects are restricted to private.'\n })),\n madeForKids: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Declare the video as made for kids (COPPA). When true, personalized ads are disabled and some features (comments, notifications) are turned off.'\n })),\n containsSyntheticMedia: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Disclose that the video contains realistic altered or synthetic (AI-generated) content.'\n })),\n categoryId: z.optional(z.enum([\n '1',\n '2',\n '10',\n '15',\n '17',\n '19',\n '20',\n '22',\n '23',\n '24',\n '25',\n '26',\n '27',\n '28',\n '29'\n ]).register(z.globalRegistry, {\n description: 'YouTube video category. Defaults to \"22\" (People & Blogs). Valid IDs: 1 (Film & Animation), 2 (Autos & Vehicles), 10 (Music), 15 (Pets & Animals), 17 (Sports), 19 (Travel & Events), 20 (Gaming), 22 (People & Blogs), 23 (Comedy), 24 (Entertainment), 25 (News & Politics), 26 (Howto & Style), 27 (Education), 28 (Science & Technology), 29 (Nonprofits & Activism).'\n })),\n tags: z.optional(z.array(z.string()).register(z.globalRegistry, {\n description: 'Keyword tags for the video. Duplicates are removed. Total of all tags must be under 500 characters. Tags with spaces count as quoted (2 extra chars). Commas between tags also count.'\n })),\n embeddable: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Whether the video can be embedded on other websites. Defaults to true.'\n })),\n playlistId: z.optional(z.string().register(z.globalRegistry, {\n description: 'Playlist ID to add the video to after upload.'\n }))\n }).register(z.globalRegistry, {\n description: 'YouTube-specific upload settings, such as description and privacy.'\n }),\n z.object({\n privacyLevel: z.enum([\n 'PUBLIC_TO_EVERYONE',\n 'FOLLOWER_OF_CREATOR',\n 'MUTUAL_FOLLOW_FRIENDS',\n 'SELF_ONLY'\n ]).register(z.globalRegistry, {\n description: 'Who can view this post. The value must match one of the options returned by the TikTok creator_info/query endpoint for the target account.'\n }),\n disableComment: z.boolean().register(z.globalRegistry, {\n description: 'If true, other TikTok users cannot comment on this post. Ignored if the creator has set comments to \"No one\" in their privacy settings.'\n }),\n disableDuet: z.boolean().register(z.globalRegistry, {\n description: 'If true, other TikTok users cannot create Duets with this post. Only applies to video posts. Ignored for photo posts and private accounts.'\n }),\n disableStitch: z.boolean().register(z.globalRegistry, {\n description: 'If true, other TikTok users cannot create Stitches with this post. Only applies to video posts. Ignored for photo posts and private accounts.'\n }),\n brandContentToggle: z.boolean().register(z.globalRegistry, {\n description: 'Set to true if this is a paid partnership promoting a third-party business. Required by TikTok for branded content disclosure.'\n }),\n brandOrganicToggle: z.boolean().register(z.globalRegistry, {\n description: 'Set to true if this post promotes the creator\\'s own business.'\n }),\n autoAddMusic: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Photo posts only. If true, TikTok automatically adds recommended background music to the photo carousel. Users can change the music later in the TikTok app.'\n })),\n videoMadeWithAi: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Video posts only. Set to true if the video is AI-generated content. The video will be labeled with a \"Creator labeled as AI-generated\" tag.'\n })),\n description: z.optional(z.string().check(z.maxLength(4000)).register(z.globalRegistry, {\n description: 'Photo posts only. Additional description text (max 4000 characters). Hashtags and mentions in the description are parsed by TikTok.'\n })),\n photoCoverIndex: z.optional(z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'Photo posts only. Zero-based index of the image to use as the carousel cover. Defaults to 0 (first image).'\n }))\n }).register(z.globalRegistry, {\n description: 'TikTok-specific publishing settings. Privacy level and brand toggles are required for all posts. Duet/stitch settings only apply to video posts. autoAddMusic only applies to photo posts.'\n }),\n z.object({\n contentType: z.optional(z.enum(['story', 'reels']).register(z.globalRegistry, {\n description: 'Set to \"story\" for ephemeral content that disappears after 24 hours. Set to \"reels\" to explicitly publish as a Reel. Omit for a regular feed post or carousel — single videos are automatically published as Reels.'\n })),\n shareToFeed: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Reels only. When true (default), the reel can appear in both the Feed and Reels tabs. When false, it only appears in the Reels tab. Neither value guarantees placement — Instagram\\'s algorithm decides based on eligibility and relevance.'\n })),\n trialParams: z.optional(z.object({\n graduationStrategy: z.enum(['MANUAL', 'SS_PERFORMANCE']).register(z.globalRegistry, {\n description: 'MANUAL: the trial reel can be graduated (converted to a public reel) manually in the Instagram app. SS_PERFORMANCE: Instagram automatically graduates the reel if it performs well with non-followers.'\n })\n }).register(z.globalRegistry, {\n description: 'Reels only. Publish as a trial reel — shown only to non-followers first. Instagram requires a public account with at least 200 followers and rejects the post otherwise.'\n })),\n audioName: z.optional(z.string().register(z.globalRegistry, {\n description: 'Reels only. Custom name for the audio track of your reel. Can only be set once — either at creation time or later from the audio page in the Instagram app.'\n }))\n }).register(z.globalRegistry, {\n description: 'Instagram-specific post settings. All fields are optional — omit the entire object for a regular feed post or carousel.'\n }),\n z.object({\n contentType: z.optional(z.enum(['story']).register(z.globalRegistry, {\n description: 'Set to \"story\" for ephemeral content that disappears after 24 hours. Omit for a regular post — single videos are automatically published as Reels (Facebook no longer has a separate video format).'\n }))\n }).register(z.globalRegistry, {\n description: 'Facebook-specific post settings. All fields are optional — omit the entire object for a regular post.'\n }),\n z.object({\n topicTag: z.optional(z.string().check(z.minLength(1), z.maxLength(50)).register(z.globalRegistry, {\n description: 'A topic tag for the post (without the # prefix). Max 50 characters. Periods (.) and ampersands (&) are not allowed. Overrides any auto-detected topic from inline hashtags.'\n }))\n }).register(z.globalRegistry, {\n description: 'Threads-specific publishing settings.'\n }),\n z.object({\n communityId: z.optional(z.string().check(z.regex(/^[0-9]{1,19}$/)).register(z.globalRegistry, {\n description: 'Post to a specific X Community. The authenticated user must be a member of the community.'\n })),\n shareWithFollowers: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'When posting to a community, also share the post with your followers. Only applies when `communityId` is set.'\n })),\n forSuperFollowersOnly: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Make this post exclusive to your subscribers (super followers).'\n })),\n replySettings: z.optional(z.enum([\n 'following',\n 'mentionedUsers',\n 'subscribers',\n 'verified'\n ]).register(z.globalRegistry, {\n description: 'Control who can reply. `following`: only people you follow. `mentionedUsers`: only people mentioned in the post. `subscribers`: only your subscribers. `verified`: only verified users.'\n })),\n quoteTweetId: z.optional(z.string().check(z.regex(/^[0-9]{1,19}$/)).register(z.globalRegistry, {\n description: 'ID of an existing tweet to quote. Mutually exclusive with poll and media.'\n })),\n replyToTweetId: z.optional(z.string().check(z.regex(/^[0-9]{1,19}$/)).register(z.globalRegistry, {\n description: 'ID of an existing tweet to reply to. Your post will appear as a reply in that tweet\\'s thread.'\n })),\n poll: z.optional(z.object({\n options: z.array(z.string().check(z.minLength(1), z.maxLength(25))).check(z.minLength(2), z.maxLength(4)).register(z.globalRegistry, {\n description: 'Poll choices. 2-4 options, max 25 characters each.'\n }),\n durationMinutes: z.int().check(z.gte(5), z.lte(10080)).register(z.globalRegistry, {\n description: 'How long the poll stays open, in minutes. Min 5 minutes, max 7 days (10080).'\n })\n }).register(z.globalRegistry, {\n description: 'Create a poll. Mutually exclusive with media and `quoteTweetId`.'\n }))\n }).register(z.globalRegistry, {\n description: 'X (Twitter) specific post settings. All fields are optional.'\n }),\n z.object({\n visibility: z.optional(z.enum(['CONNECTIONS', 'PUBLIC']).register(z.globalRegistry, {\n description: 'Who can see the post. PUBLIC (anyone on LinkedIn) or CONNECTIONS (only your connections). Defaults to PUBLIC. Only available for personal profiles — company pages are always public.'\n }))\n }).register(z.globalRegistry, {\n description: 'LinkedIn-specific publishing settings, such as post visibility.'\n }),\n z.record(z.string(), z.never()).register(z.globalRegistry, {\n description: 'Bluesky-specific publishing settings. No settings are currently available.'\n }),\n z.record(z.string(), z.unknown())\n]);\n\nexport const zPostAccount = z.object({\n accountId: z.uuid().register(z.globalRegistry, {\n description: 'The connected social account identifier.'\n }),\n platform: zSocialPlatform,\n accountName: z.string().register(z.globalRegistry, {\n description: 'Display name or username of the connected account.'\n }),\n status: zPostStatus,\n externalUrl: z.optional(z.url().register(z.globalRegistry, {\n description: 'Link to the published post on the social platform. Present only after successful publishing.'\n })),\n publishedAt: z.optional(z.iso.datetime().register(z.globalRegistry, {\n description: 'When this account\\'s post was published.'\n })),\n errorMessage: z.optional(z.string().register(z.globalRegistry, {\n description: 'Error message from the platform if publishing failed for this account.'\n })),\n failure: z.optional(z.intersection(zPublishFailure, z.unknown().register(z.globalRegistry, {\n description: 'The same failure read as an action: what happened and the one thing to do about it. Present whenever status is FAILED, including when the platform gave no reason. The wording is what the app and the failure email show, so a client does not have to interpret `errorMessage` itself.'\n }))),\n analytics: z.optional(z.intersection(zPostAnalytics, z.unknown().register(z.globalRegistry, {\n description: 'Latest metrics recorded for this delivery. Present only for published posts on platforms with analytics support, once a background sync has run.'\n }))),\n postOverrides: z.optional(zPostOverrides),\n platformSpecificSettings: z.optional(zPlatformSpecificSettings)\n});\n\nexport const zPost = z.object({\n id: z.uuid().register(z.globalRegistry, {\n description: 'Unique post identifier.'\n }),\n content: z.string().register(z.globalRegistry, {\n description: 'The shared text content of the post.'\n }),\n status: zPostStatus,\n source: zPostSource,\n errorMessage: z.optional(z.string().register(z.globalRegistry, {\n description: 'Human-readable error summary when one or more accounts failed.'\n })),\n mediaIds: z.optional(z.array(z.uuid()).register(z.globalRegistry, {\n description: 'Media attached to this post.'\n })),\n deletedMediaCount: z.optional(z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'How many media were attached to this post but have since been deleted (rendered as placeholders). Lets a client tell a post that HAD media apart from one posted with none.'\n })),\n scheduledAt: z.optional(z.iso.datetime().register(z.globalRegistry, {\n description: 'When the post is scheduled to be published.'\n })),\n publishedAt: z.optional(z.iso.datetime().register(z.globalRegistry, {\n description: 'When the post was published. Present only when all accounts are published.'\n })),\n createdAt: z.iso.datetime().register(z.globalRegistry, {\n description: 'When the post was created.'\n }),\n accounts: z.array(zPostAccount).register(z.globalRegistry, {\n description: 'Individual account entries. Each represents the post on one connected social account.'\n })\n});\n\nexport const zPostsResponse = z.object({\n posts: z.array(zPost),\n pagination: zPagination\n});\n\nexport const zCreatePostAccount = z.object({\n accountId: z.uuid().register(z.globalRegistry, {\n description: 'ID of a connected social account to post to.'\n }),\n postOverrides: z.optional(z.intersection(zPostOverrides, z.unknown().register(z.globalRegistry, {\n description: 'Override the post-level content or media for this specific account.'\n }))),\n platformSpecificSettings: z.optional(z.intersection(zPlatformSpecificSettings, z.unknown().register(z.globalRegistry, {\n description: 'Platform-specific settings. The accepted shape depends on the account platform.'\n })))\n});\n\n/**\n * Create a post across one or more connected social accounts.\n */\nexport const zCreatePostRequest = z.object({\n content: z._default(z.optional(z.string().register(z.globalRegistry, {\n description: 'The text content of the post, shared across all accounts unless overridden. Optional when media is attached (platform-dependent).'\n })), ''),\n mediaIds: z.optional(z.array(z.uuid()).check(z.maxLength(35)).register(z.globalRegistry, {\n description: 'Media to attach to the post, up to 35. Shared across all accounts unless an account provides its own mediaIds in postOverrides. Accepts IDs from Upload media and from Create media upload.'\n })),\n thumbnailTimestamp: z.optional(z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'Default video thumbnail timestamp in milliseconds for Instagram and TikTok. Can be overridden per account.'\n })),\n accounts: z.array(zCreatePostAccount).check(z.minLength(1)).register(z.globalRegistry, {\n description: 'Accounts to post to. Each entry can optionally include content overrides and platform-specific settings.'\n }),\n scheduledAt: z.optional(z.iso.datetime().register(z.globalRegistry, {\n description: 'Schedule the post for a future date. If omitted and publishNow is false or absent, the post is saved as a draft. Accepts UTC (2026-04-01T12:00:00Z) or an explicit UTC offset (2026-04-01T14:00:00+02:00); a time without zone information is rejected.'\n })),\n publishNow: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Publish immediately. Cannot be combined with scheduledAt.'\n }))\n}).register(z.globalRegistry, {\n description: 'Create a post across one or more connected social accounts.'\n});\n\n/**\n * Update a draft or scheduled post. Published and publishing posts cannot be updated. Media behavior is explicit: omit mediaIds to keep existing media unchanged, provide mediaIds to replace all current media, or provide an empty mediaIds array to remove all media.\n */\nexport const zUpdatePostRequest = z.object({\n content: z.optional(z.string().register(z.globalRegistry, {\n description: 'New shared text content for the post.'\n })),\n scheduledAt: z.optional(z.iso.datetime().register(z.globalRegistry, {\n description: 'New scheduled date for the post. Must be at least 1 minute in the future. Accepts UTC (2026-04-15T14:00:00Z) or an explicit UTC offset (2026-04-15T16:00:00+02:00); a time without zone information is rejected.'\n })),\n mediaIds: z.optional(z.array(z.uuid()).check(z.maxLength(35)).register(z.globalRegistry, {\n description: 'Full replacement for the post media, up to 35. If omitted, the existing media stays unchanged. If provided, it replaces the current media across all accounts in the post. Send an empty array to remove all media from the post.'\n })),\n thumbnailTimestamp: z.optional(z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'New video thumbnail timestamp in milliseconds for Instagram and TikTok media. Does not change which media files are attached. Combine with mediaIds if you want to replace media and set the new thumbnail timestamp in the same request.'\n })),\n accounts: z.optional(z.array(zCreatePostAccount).check(z.minLength(1)).register(z.globalRegistry, {\n description: 'Accounts whose content overrides or platform-specific settings should be updated, plus any additional connected accounts to add to the post. Existing accounts omitted from this array remain unchanged and must be removed through the account-specific delete endpoint.'\n })),\n publishNow: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Publish an existing draft immediately. Cannot be combined with scheduledAt.'\n }))\n}).register(z.globalRegistry, {\n description: 'Update a draft or scheduled post. Published and publishing posts cannot be updated. Media behavior is explicit: omit mediaIds to keep existing media unchanged, provide mediaIds to replace all current media, or provide an empty mediaIds array to remove all media.'\n});\n\nexport const zSuccessMessage = z.object({\n deleted: z.literal(true),\n id: z.uuid()\n});\n\nexport const zAccount = z.object({\n id: z.uuid().register(z.globalRegistry, {\n description: 'Unique social account identifier in PublishQ.'\n }),\n platform: z.intersection(zSocialPlatform, z.unknown().register(z.globalRegistry, {\n description: 'Social platform that this connected account belongs to.'\n })),\n platformName: z.nullish(z.string()),\n platformUsername: z.string().register(z.globalRegistry, {\n description: 'Primary username or handle on the connected social platform.'\n }),\n platformUserId: z.string().register(z.globalRegistry, {\n description: 'Unique user or channel identifier provided by the social platform.'\n }),\n platformPicture: z.nullish(z.string()),\n workspaceId: z.nullish(z.uuid())\n});\n\nexport const zAccountsResponse = z.object({\n accounts: z.array(zAccount).register(z.globalRegistry, {\n description: 'Connected social accounts visible to the authenticated API key.'\n })\n});\n\nexport const zWorkspace = z.object({\n id: z.uuid().register(z.globalRegistry, {\n description: 'Unique workspace identifier in PublishQ.'\n }),\n name: z.string().register(z.globalRegistry, {\n description: 'Workspace name shown in the PublishQ UI.'\n }),\n description: z.nullish(z.string()),\n color: z.string().register(z.globalRegistry, {\n description: 'Workspace accent color in hex format.'\n }),\n accountCount: z.int().register(z.globalRegistry, {\n description: 'Number of social accounts assigned to this workspace.'\n }),\n createdAt: z.iso.datetime().register(z.globalRegistry, {\n description: 'When the workspace was created.'\n })\n});\n\n/**\n * Create a new workspace.\n */\nexport const zCreateWorkspaceRequest = z.object({\n name: z.string().check(z.minLength(1), z.maxLength(50)).register(z.globalRegistry, {\n description: 'Workspace name shown in PublishQ.'\n }),\n description: z.optional(z.string().check(z.maxLength(500)).register(z.globalRegistry, {\n description: 'Optional short description of the workspace.'\n })),\n color: z._default(z.optional(z.string().check(z.regex(/^#[0-9A-Fa-f]{6}$/)).register(z.globalRegistry, {\n description: 'Workspace accent color as a hex string like `#6366f1`.'\n })), '#6366f1')\n}).register(z.globalRegistry, {\n description: 'Create a new workspace.'\n});\n\nexport const zWorkspacesResponse = z.object({\n workspaces: z.array(zWorkspace).register(z.globalRegistry, {\n description: 'Workspaces visible to the authenticated API key owner.'\n })\n});\n\n/**\n * Media file type.\n */\nexport const zMediaType = z.enum(['IMAGE', 'VIDEO']).register(z.globalRegistry, {\n description: 'Media file type.'\n});\n\n/**\n * How the media was created: uploaded by the user, generated inside PublishQ, or AI-generated inside PublishQ.\n */\nexport const zMediaSource = z.enum([\n 'UPLOAD',\n 'GENERATED',\n 'AI_GENERATED'\n]).register(z.globalRegistry, {\n description: 'How the media was created: uploaded by the user, generated inside PublishQ, or AI-generated inside PublishQ.'\n});\n\nexport const zMedia = z.object({\n id: z.uuid().register(z.globalRegistry, {\n description: 'Unique media identifier in PublishQ.'\n }),\n type: zMediaType,\n url: z.url().register(z.globalRegistry, {\n description: 'Direct URL to the uploaded or generated media file.'\n }),\n source: zMediaSource,\n created_at: z.iso.datetime().register(z.globalRegistry, {\n description: 'When the media item was created in PublishQ.'\n }),\n usageCount: z.int().register(z.globalRegistry, {\n description: 'Number of posts this media item was used in.'\n })\n});\n\nexport const zMediaListResponse = z.object({\n media: z.array(zMedia),\n pagination: zPagination\n});\n\nexport const zUploadMediaRequest = z.object({\n file: z.string()\n});\n\nexport const zCreateMediaUploadRequest = z.object({\n filename: z.string().check(z.minLength(1), z.maxLength(1024)).register(z.globalRegistry, {\n description: 'Name of the file you are uploading.'\n }),\n contentType: z.string().check(z.minLength(1)).register(z.globalRegistry, {\n description: 'Content type of the file. One of: image/jpeg, image/png, image/gif, image/webp, video/mp4, video/webm, video/quicktime, video/x-msvideo.'\n }),\n fileSize: z.int().check(z.gt(0)).register(z.globalRegistry, {\n description: 'Exact size of the file in bytes. Your plan\\'s file size limit and your storage are checked before you upload, and storage refuses a file of any other size. Each platform\\'s own size limits are checked when you attach the media to a post.'\n })\n});\n\nexport const zMediaUpload = z.object({\n id: z.uuid().register(z.globalRegistry, {\n description: 'Media ID of the file. Attach it to posts through mediaIds once the file is uploaded.'\n }),\n uploadUrl: z.url().register(z.globalRegistry, {\n description: 'Signed storage URL. PUT the file to it with the same Content-Type. It goes to storage, not to the PublishQ API, so send no Authorization header.'\n }),\n expiresAt: z.iso.datetime().register(z.globalRegistry, {\n description: 'When uploadUrl stops accepting the file, 1 hour after it is created.'\n })\n});\n\nexport const zTikTokCreatorInfoResponse = z.object({\n privacyLevelOptions: z.array(z.string()).register(z.globalRegistry, {\n description: 'Privacy levels available for this account. Use one of these values as `privacyLevel` in `platformSpecificSettings`.'\n }),\n commentDisabled: z.boolean().register(z.globalRegistry, {\n description: 'True if the creator has disabled comments at the account level.'\n }),\n duetDisabled: z.boolean().register(z.globalRegistry, {\n description: 'True if the creator has disabled Duets at the account level.'\n }),\n stitchDisabled: z.boolean().register(z.globalRegistry, {\n description: 'True if the creator has disabled Stitches at the account level.'\n }),\n maxVideoPostDurationSec: z.number().register(z.globalRegistry, {\n description: 'Maximum video duration in seconds this creator can post (typically 180, 300, or 600).'\n })\n});\n\nexport const zApiKeyScope = z.enum([\n 'posts:read',\n 'posts:write',\n 'accounts:read',\n 'workspaces:read',\n 'workspaces:write',\n 'media:read',\n 'media:write'\n]);\n\nexport const zListPostsQuery = z.object({\n page: z._default(z.optional(z.int().check(z.gt(0)).register(z.globalRegistry, {\n description: 'Page number (starts from 1).'\n })), 1),\n limit: z._default(z.optional(z.int().check(z.gt(0), z.lte(100)).register(z.globalRegistry, {\n description: 'Page size. Max 100.'\n })), 20),\n includeImported: z._default(z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Also return posts imported from a connected platform (posts with source IMPORTED). Defaults to false: only posts created through PublishQ are returned.'\n })), false),\n onlyImported: z._default(z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Return ONLY posts imported from a connected platform. Cannot be combined with includeImported.'\n })), false)\n});\n\n/**\n * Posts retrieved successfully\n */\nexport const zListPostsResponse = zPostsResponse;\n\nexport const zCreatePostBody = zCreatePostRequest;\n\n/**\n * Posts created successfully\n */\nexport const zCreatePostResponse = zPost;\n\nexport const zDeletePostPath = z.object({\n id: z.uuid()\n});\n\n/**\n * Post deleted successfully\n */\nexport const zDeletePostResponse = z.void().register(z.globalRegistry, {\n description: 'Post deleted successfully'\n});\n\nexport const zGetPostPath = z.object({\n id: z.uuid()\n});\n\n/**\n * Post retrieved successfully\n */\nexport const zGetPostResponse = zPost;\n\nexport const zUpdatePostBody = zUpdatePostRequest;\n\nexport const zUpdatePostPath = z.object({\n id: z.uuid()\n});\n\n/**\n * Post updated successfully\n */\nexport const zUpdatePostResponse = zPost;\n\nexport const zRemovePostAccountPath = z.object({\n id: z.uuid(),\n accountId: z.uuid()\n});\n\n/**\n * Account removed from post successfully\n */\nexport const zRemovePostAccountResponse = z.void().register(z.globalRegistry, {\n description: 'Account removed from post successfully'\n});\n\nexport const zListAccountsQuery = z.object({\n workspaceId: z.optional(z.uuid().register(z.globalRegistry, {\n description: 'Return only accounts assigned to the specified workspace. If omitted, accounts from all workspaces are returned.'\n })),\n platform: z.optional(z.array(zSocialPlatform).register(z.globalRegistry, {\n description: 'Return only accounts connected to the specified social platforms. Repeat the parameter to apply OR logic, for example `?platform=twitter&platform=instagram`.'\n }))\n});\n\n/**\n * Accounts retrieved successfully\n */\nexport const zListAccountsResponse = zAccountsResponse;\n\nexport const zGetTikTokCreatorInfoPath = z.object({\n id: z.uuid()\n});\n\n/**\n * Creator info retrieved successfully\n */\nexport const zGetTikTokCreatorInfoResponse = zTikTokCreatorInfoResponse;\n\n/**\n * Workspaces retrieved successfully\n */\nexport const zListWorkspacesResponse = zWorkspacesResponse;\n\nexport const zCreateWorkspaceBody = zCreateWorkspaceRequest;\n\n/**\n * Workspace created successfully\n */\nexport const zCreateWorkspaceResponse = zWorkspace;\n\nexport const zGetWorkspacePath = z.object({\n id: z.uuid()\n});\n\n/**\n * Workspace retrieved successfully\n */\nexport const zGetWorkspaceResponse = zWorkspace;\n\nexport const zListMediaQuery = z.object({\n page: z._default(z.optional(z.int().check(z.gt(0)).register(z.globalRegistry, {\n description: 'Page number (starts from 1).'\n })), 1),\n limit: z._default(z.optional(z.int().check(z.gt(0), z.lte(100)).register(z.globalRegistry, {\n description: 'Page size. Max 100.'\n })), 20),\n ids: z.optional(z.array(z.uuid()).register(z.globalRegistry, {\n description: 'Return only the specified media IDs. Repeat the parameter to apply OR logic, for example `?ids=id1&ids=id2`.'\n })),\n mediaTypes: z.optional(z.array(zMediaType).register(z.globalRegistry, {\n description: 'Return only media items of the specified types. Repeat the parameter to apply OR logic, for example `?mediaTypes=image&mediaTypes=video`.'\n })),\n sources: z.optional(z.array(zMediaSource).register(z.globalRegistry, {\n description: 'Return only media items from the specified sources. Repeat the parameter to apply OR logic, for example `?sources=upload&sources=ai_generated`.'\n }))\n});\n\n/**\n * Media retrieved successfully\n */\nexport const zListMediaResponse = zMediaListResponse;\n\nexport const zUploadMediaBody = zUploadMediaRequest;\n\n/**\n * Media uploaded successfully\n */\nexport const zUploadMediaResponse = zMedia;\n\nexport const zGetMediaPath = z.object({\n id: z.uuid()\n});\n\n/**\n * Media retrieved successfully\n */\nexport const zGetMediaResponse = zMedia;\n\nexport const zCreateMediaUploadBody = zCreateMediaUploadRequest;\n\n/**\n * Upload created. Send the file to uploadUrl next.\n */\nexport const zCreateMediaUploadResponse = zMediaUpload;\n\nexport const zCompleteMediaUploadPath = z.object({\n id: z.uuid()\n});\n\n/**\n * The file is in your media library\n */\nexport const zCompleteMediaUploadResponse = zMedia;\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;AAAA;AAAA;;;ACsBA,IAAM,wBAAwB,CAAC,MAAgB,KAAa,UAAyB;AACnF,MAAI,OAAO,UAAU,YAAY,iBAAiB,MAAM;AACtD,SAAK,OAAO,KAAK,KAAK;AAAA,EACxB,WAAW,iBAAiB,MAAM;AAChC,SAAK,OAAO,KAAK,MAAM,YAAY,CAAC;AAAA,EACtC,OAAO;AACL,SAAK,OAAO,KAAK,KAAK,UAAU,KAAK,CAAC;AAAA,EACxC;AACF;AAUO,IAAM,yBAAyB;AAAA,EACpC,gBAAgB,CAAC,SAA4B;AAC3C,UAAM,OAAO,IAAI,SAAS;AAE1B,WAAO,QAAQ,I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,KAAK,CAAC,CAAC;AAAA;AAAA,IAE5D,gBAAgB,CAAC,OACf,iBAAiB,MAAM,oBAAoB,EAAE,QAAAA,SAAQ,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;AAAA;AAAA,IAEtE,KAAK,CAAC,OACJ,iBAAiB,MAAM,SAAS,EAAE,QAAAA,SAAQ,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;AAAA,EAC7D;AACF;AAaA,IAAO,gBAAQ;","names":["url","joinedValues","url","config","url","request","client"]}
|
|
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","../src/generated/zod.gen.ts"],"sourcesContent":["// Official TypeScript SDK for the PublishQ API.\n//\n// The auto-generated functions live in `./generated/`. They're grouped by\n// OpenAPI tag into per-tag classes (e.g. `Posts.listPosts`, `Media.uploadMedia`).\n// This wrapper builds one client per `PublishQ` instance with the user's API\n// key + base URL baked in, then exposes a thin namespaced facade so calls read\n// as `publishq.posts.create(...)`.\n//\n// Tripwire: a vitest test in `tests/tripwire.test.ts` reads every operationId\n// from the OpenAPI spec and asserts each appears in this file. If you add an\n// endpoint to the spec without wrapping it here, the test fails — your CI gate\n// against forgetting to expose new methods.\n\nimport {\n Accounts,\n type CreateMediaUploadData,\n type CreatePostData,\n type CreateWorkspaceData,\n type ListAccountsData,\n type ListMediaData,\n type ListPostsData,\n Media2 as Media,\n Posts,\n type UpdatePostData,\n type UploadMediaData,\n Workspaces,\n} from './generated';\nimport { type Client, createClient, createConfig } from './generated/client';\n\nexport interface PublishQOptions {\n /**\n * Your PublishQ API key (begins with `pq_live_`). Create one in the web app\n * under **API Keys** and select the scopes you need.\n */\n apiKey: string;\n /**\n * Override the API base URL. Defaults to `https://publishq.com/api/v1`.\n * Mostly useful for staging or local development.\n */\n baseUrl?: string;\n}\n\n// Preserve the exact response body for failed HTTP calls before the generated\n// client parses it. The generated client normalizes an empty body to `{}` and\n// cannot otherwise distinguish that from an API that literally returned `{}`.\nconst rawErrorBodies = new WeakMap<Response, Promise<string>>();\n\ninterface SdkFieldsResult {\n error?: unknown;\n response?: Response;\n}\n\nasync function preserveApiError<T extends SdkFieldsResult>(\n call: Promise<T>\n): Promise<T> {\n const result = await call;\n const response = result.response;\n const rawBody = response ? rawErrorBodies.get(response) : undefined;\n\n if (!response || response.ok || !rawBody) {\n return result;\n }\n\n const text = await rawBody;\n if (text.length === 0) {\n return { ...result, error: undefined };\n }\n\n let error: unknown = text;\n try {\n error = JSON.parse(text) as unknown;\n } catch {\n // The API returned text rather than JSON. Preserve it verbatim.\n }\n\n return { ...result, error };\n}\n\n/**\n * Official TypeScript SDK for the PublishQ API.\n *\n * Schedule and publish content across your social platforms with a single call.\n *\n * @example\n * ```ts\n * import PublishQ from \"@publishq/sdk\";\n *\n * const publishq = new PublishQ({ apiKey: process.env.PUBLISHQ_API_KEY! });\n *\n * const { data } = await publishq.accounts.list();\n * if (data) {\n * for (const account of data.accounts) {\n * console.log(account.platform, account.accountName);\n * }\n * }\n * ```\n */\nexport class PublishQ {\n /**\n * Post resources — create, list, retrieve, update, and delete posts across\n * the connected accounts this API key is scoped to.\n */\n readonly posts: ReturnType<typeof createPostsNamespace>;\n /**\n * Account resources — list connected social accounts and read the TikTok\n * creator info required before posting to TikTok.\n */\n readonly accounts: ReturnType<typeof createAccountsNamespace>;\n /**\n * Workspace resources — list, create, and retrieve the workspaces that\n * organize your connected accounts.\n */\n readonly workspaces: ReturnType<typeof createWorkspacesNamespace>;\n /**\n * Media resources — upload, list, and retrieve media files you can attach\n * to posts.\n */\n readonly media: ReturnType<typeof createMediaNamespace>;\n\n constructor(options: PublishQOptions) {\n const client = createClient(\n createConfig({\n baseUrl: options.baseUrl ?? 'https://publishq.com/api/v1',\n headers: {\n Authorization: `Bearer ${options.apiKey}`,\n },\n })\n );\n\n client.interceptors.response.use((response) => {\n if (!response.ok) {\n rawErrorBodies.set(response, response.clone().text());\n }\n return response;\n });\n\n this.posts = createPostsNamespace(client);\n this.accounts = createAccountsNamespace(client);\n this.workspaces = createWorkspacesNamespace(client);\n this.media = createMediaNamespace(client);\n }\n}\n\n// Each resource namespace is a small factory that takes the per-instance client\n// and returns the user-facing methods. Adding a new resource is just a new\n// createXNamespace function + a line in the constructor.\nfunction createPostsNamespace(client: Client) {\n return {\n /** List posts. Optionally filter by status/workspace/account and paginate. Wraps `Posts.listPosts`. */\n list: (query?: ListPostsData['query']) =>\n preserveApiError(Posts.listPosts({ client, query })),\n /** Create a post for one or more connected accounts. Wraps `Posts.createPost`. */\n create: (body: CreatePostData['body']) =>\n preserveApiError(Posts.createPost({ client, body })),\n /** Get one post by its PublishQ post ID. Wraps `Posts.getPost`. */\n get: (id: string) =>\n preserveApiError(Posts.getPost({ client, path: { id } })),\n /** Update a draft or scheduled post. Wraps `Posts.updatePost`. */\n update: (id: string, body: UpdatePostData['body']) =>\n preserveApiError(Posts.updatePost({ client, path: { id }, body })),\n /** Delete a scheduled or draft post by its ID. Wraps `Posts.deletePost`. */\n delete: (id: string) =>\n preserveApiError(Posts.deletePost({ client, path: { id } })),\n /** Remove one account from a post so it's no longer published there. Wraps `Posts.removePostAccount`. */\n removeAccount: (id: string, accountId: string) =>\n preserveApiError(\n Posts.removePostAccount({ client, path: { id, accountId } })\n ),\n };\n}\n\nfunction createAccountsNamespace(client: Client) {\n return {\n /** List connected social accounts. Filter by workspace and platform. Wraps `Accounts.listAccounts`. */\n list: (query?: ListAccountsData['query']) =>\n preserveApiError(Accounts.listAccounts({ client, query })),\n /** Get a TikTok account's creator info (privacy options, limits) before posting. Wraps `Accounts.getTikTokCreatorInfo`. */\n getTikTokCreatorInfo: (id: string) =>\n preserveApiError(\n Accounts.getTikTokCreatorInfo({ client, path: { id } })\n ),\n };\n}\n\nfunction createWorkspacesNamespace(client: Client) {\n return {\n /** List your workspaces with names, colors, and account counts. Wraps `Workspaces.listWorkspaces`. */\n list: () => preserveApiError(Workspaces.listWorkspaces({ client })),\n /** Create a workspace to organize your connected accounts. Wraps `Workspaces.createWorkspace`. */\n create: (body: CreateWorkspaceData['body']) =>\n preserveApiError(Workspaces.createWorkspace({ client, body })),\n /** Get one workspace by ID. Wraps `Workspaces.getWorkspace`. */\n get: (id: string) =>\n preserveApiError(Workspaces.getWorkspace({ client, path: { id } })),\n };\n}\n\n/**\n * The content types the API accepts, by file extension.\n *\n * This exists because of one sharp edge in Node: `new File([buffer], 'photo.jpg')`\n * produces a file whose `type` is the EMPTY STRING, and `fetch` then labels that\n * part of the multipart body `application/octet-stream`. The API rejects an\n * unsupported declared type before reading a byte, so a perfectly good JPEG read\n * off disk was refused with 415 while the same file sent by curl went through:\n * curl fills the type in from the extension, and Node does not.\n *\n * Keyed on the extension rather than sniffed from the bytes on purpose. The API\n * detects the real type from the first chunk itself and stores what it detects, so\n * a wrong extension here changes nothing about what gets stored; this only has to\n * be good enough to get past a metadata check.\n */\nconst UPLOAD_MIME_TYPE_BY_EXTENSION: Record<string, string> = {\n jpg: 'image/jpeg',\n jpeg: 'image/jpeg',\n png: 'image/png',\n gif: 'image/gif',\n webp: 'image/webp',\n mp4: 'video/mp4',\n webm: 'video/webm',\n mov: 'video/quicktime',\n avi: 'video/x-msvideo',\n};\n\n/** A type worth replacing: absent, or the placeholder `fetch` falls back to. */\nfunction isUninformativeType(type: string): boolean {\n return type === '' || type === 'application/octet-stream';\n}\n\n/**\n * Returns the file with a usable `type`, inferring it from the filename when the\n * caller could not supply one. Anything that already declares a type, or whose\n * extension is unknown, is passed through untouched: guessing past that point\n * would be inventing a fact, and the API's own byte-level detection is the thing\n * that decides what the file really is.\n */\nexport function withInferredContentType(file: Blob | File): Blob | File {\n const name = 'name' in file ? file.name : undefined;\n if (!name || !isUninformativeType(file.type)) return file;\n\n const extension = name.split('.').pop()?.toLowerCase();\n const type = extension ? UPLOAD_MIME_TYPE_BY_EXTENSION[extension] : undefined;\n if (!type) return file;\n\n return new File([file], name, { type });\n}\n\n/** Files above this size are sent straight to storage through `createUpload`. */\nexport const STORAGE_UPLOAD_THRESHOLD_BYTES = 90 * 1024 * 1024;\n\nasync function uploadThroughStorage(client: Client, file: Blob | File) {\n const created = await preserveApiError(\n Media.createMediaUpload({\n client,\n body: {\n filename: 'name' in file && file.name ? file.name : 'upload',\n contentType: file.type,\n fileSize: file.size,\n },\n })\n );\n if (!created.data) return created;\n\n const response = await fetch(created.data.uploadUrl, {\n method: 'PUT',\n headers: { 'Content-Type': file.type },\n body: file,\n });\n if (!response.ok) {\n return {\n data: undefined,\n error: {\n error: {\n status: response.status,\n message: 'Storage refused the file upload',\n mediaId: created.data.id,\n storageResponse: await response.text(),\n },\n },\n request: new Request(created.data.uploadUrl, { method: 'PUT' }),\n response,\n };\n }\n\n return preserveApiError(\n Media.completeMediaUpload({ client, path: { id: created.data.id } })\n );\n}\n\nfunction createMediaNamespace(client: Client) {\n return {\n /** List your uploaded and generated media files. Filter by id, type, source. Wraps `Media.listMedia`. */\n list: (query?: ListMediaData['query']) =>\n preserveApiError(Media.listMedia({ client, query })),\n /**\n * Upload one media file and get back a media ID to attach to posts. Wraps\n * `Media.uploadMedia`, or for files over `STORAGE_UPLOAD_THRESHOLD_BYTES`\n * runs `createUpload`, sends the file to storage and returns the finished\n * media from `completeUpload`. Both return the same `Media` object.\n *\n * The file's content type is filled in from its name when it has none, so a\n * file read off disk with `new File([buffer], 'photo.jpg')` is not sent as\n * `application/octet-stream` and refused. See `withInferredContentType`.\n */\n upload: (body: UploadMediaData['body']) => {\n const file = withInferredContentType(body.file);\n if (file.size > STORAGE_UPLOAD_THRESHOLD_BYTES) {\n return uploadThroughStorage(client, file);\n }\n return preserveApiError(\n Media.uploadMedia({ client, body: { ...body, file } })\n );\n },\n /** Get a storage upload URL for a file of up to 4 GB. Send the file there, then use the returned media ID in posts. Wraps `Media.createMediaUpload`. */\n createUpload: (body: CreateMediaUploadData['body']) =>\n preserveApiError(Media.createMediaUpload({ client, body })),\n /** Add a file sent to a `createUpload` URL to the media library now and return it. Optional: using the ID in a post does the same. Wraps `Media.completeMediaUpload`. */\n completeUpload: (id: string) =>\n preserveApiError(Media.completeMediaUpload({ client, path: { id } })),\n /** Get one media file by ID. Wraps `Media.getMedia`. */\n get: (id: string) =>\n preserveApiError(Media.getMedia({ client, path: { id } })),\n };\n}\n\n// Power-user re-exports: the raw generated per-tag classes and all generated\n// types, for callers who'd rather drive the client directly. Note the media\n// class is re-exported as `Media2` (hey-api renames it to avoid clashing with\n// the `Media` schema type); most callers should use the `publishq.media` facade.\nexport * from './generated';\n\n// Runtime schemas are generated from the same OpenAPI contract as the SDK\n// types. Consumers such as @publishq/mcp can validate requests without\n// maintaining a second handwritten copy of the API contract.\nexport * from './generated/zod.gen';\n\nexport default PublishQ;\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://publishq.com/api/v1' }));\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 { CompleteMediaUploadData, CompleteMediaUploadErrors, CompleteMediaUploadResponses, CreateMediaUploadData, CreateMediaUploadErrors, CreateMediaUploadResponses, CreatePostData, CreatePostErrors, CreatePostResponses, CreateWorkspaceData, CreateWorkspaceErrors, CreateWorkspaceResponses, DeletePostData, DeletePostErrors, DeletePostResponses, GetMediaData, GetMediaErrors, GetMediaResponses, GetPostData, GetPostErrors, GetPostResponses, GetTikTokCreatorInfoData, GetTikTokCreatorInfoErrors, GetTikTokCreatorInfoResponses, GetWorkspaceData, GetWorkspaceErrors, GetWorkspaceResponses, ListAccountsData, ListAccountsErrors, ListAccountsResponses, ListMediaData, ListMediaErrors, ListMediaResponses, ListPostsData, ListPostsErrors, ListPostsResponses, ListWorkspacesData, ListWorkspacesErrors, ListWorkspacesResponses, RemovePostAccountData, RemovePostAccountErrors, RemovePostAccountResponses, UpdatePostData, UpdatePostErrors, UpdatePostResponses, UploadMediaData, UploadMediaErrors, UploadMediaResponses } 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\nexport class Posts {\n /**\n * List posts\n *\n * Returns a paginated list of the posts you created through PublishQ. Posts imported from a connected platform are excluded by default; pass includeImported=true to get both, or onlyImported=true for only the imported ones.\n */\n public static listPosts<ThrowOnError extends boolean = false>(options?: Options<ListPostsData, ThrowOnError>): RequestResult<ListPostsResponses, ListPostsErrors, ThrowOnError> {\n return (options?.client ?? client).get<ListPostsResponses, ListPostsErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/posts',\n ...options\n });\n }\n \n /**\n * Create posts\n *\n * Creates a post for one or more connected accounts.\n */\n public static createPost<ThrowOnError extends boolean = false>(options: Options<CreatePostData, ThrowOnError>): RequestResult<CreatePostResponses, CreatePostErrors, ThrowOnError> {\n return (options.client ?? client).post<CreatePostResponses, CreatePostErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/posts',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Delete post\n *\n * Deletes a scheduled or draft post by its ID. Returns no body on success.\n */\n public static deletePost<ThrowOnError extends boolean = false>(options: Options<DeletePostData, ThrowOnError>): RequestResult<DeletePostResponses, DeletePostErrors, ThrowOnError> {\n return (options.client ?? client).delete<DeletePostResponses, DeletePostErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/posts/{id}',\n ...options\n });\n }\n \n /**\n * Get post\n *\n * Get one post by its PublishQ post ID. Returns the post details and the connected account metadata needed to identify where it belongs.\n */\n public static getPost<ThrowOnError extends boolean = false>(options: Options<GetPostData, ThrowOnError>): RequestResult<GetPostResponses, GetPostErrors, ThrowOnError> {\n return (options.client ?? client).get<GetPostResponses, GetPostErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/posts/{id}',\n ...options\n });\n }\n \n /**\n * Update post\n *\n * Update a draft or scheduled post. You can change the content, the scheduled date, or both. Published and publishing posts cannot be updated.\n */\n public static updatePost<ThrowOnError extends boolean = false>(options: Options<UpdatePostData, ThrowOnError>): RequestResult<UpdatePostResponses, UpdatePostErrors, ThrowOnError> {\n return (options.client ?? client).patch<UpdatePostResponses, UpdatePostErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/posts/{id}',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Remove account from post\n *\n * Removes one account from an existing post so it will no longer be published there. Other accounts in the same post are not changed.\n */\n public static removePostAccount<ThrowOnError extends boolean = false>(options: Options<RemovePostAccountData, ThrowOnError>): RequestResult<RemovePostAccountResponses, RemovePostAccountErrors, ThrowOnError> {\n return (options.client ?? client).delete<RemovePostAccountResponses, RemovePostAccountErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/posts/{id}/accounts/{accountId}',\n ...options\n });\n }\n}\n\nexport class Accounts {\n /**\n * List accounts\n *\n * List connected social accounts for the authenticated API key owner. You can filter by workspace and by one or more platforms.\n */\n public static listAccounts<ThrowOnError extends boolean = false>(options?: Options<ListAccountsData, ThrowOnError>): RequestResult<ListAccountsResponses, ListAccountsErrors, ThrowOnError> {\n return (options?.client ?? client).get<ListAccountsResponses, ListAccountsErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/accounts',\n ...options\n });\n }\n \n /**\n * Get TikTok creator info\n *\n * Returns the TikTok creator's current privacy options, interaction settings, and maximum video duration. Call this before posting to TikTok — the `privacyLevel` you set must match one of the returned `privacyLevelOptions`.\n */\n public static getTikTokCreatorInfo<ThrowOnError extends boolean = false>(options: Options<GetTikTokCreatorInfoData, ThrowOnError>): RequestResult<GetTikTokCreatorInfoResponses, GetTikTokCreatorInfoErrors, ThrowOnError> {\n return (options.client ?? client).get<GetTikTokCreatorInfoResponses, GetTikTokCreatorInfoErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/accounts/{id}/tiktok-creator-info',\n ...options\n });\n }\n}\n\nexport class Workspaces {\n /**\n * List workspaces\n *\n * Return your workspaces, including their names, colors, and account counts.\n */\n public static listWorkspaces<ThrowOnError extends boolean = false>(options?: Options<ListWorkspacesData, ThrowOnError>): RequestResult<ListWorkspacesResponses, ListWorkspacesErrors, ThrowOnError> {\n return (options?.client ?? client).get<ListWorkspacesResponses, ListWorkspacesErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/workspaces',\n ...options\n });\n }\n \n /**\n * Create workspace\n *\n * Create a workspace to organize your connected social accounts.\n */\n public static createWorkspace<ThrowOnError extends boolean = false>(options: Options<CreateWorkspaceData, ThrowOnError>): RequestResult<CreateWorkspaceResponses, CreateWorkspaceErrors, ThrowOnError> {\n return (options.client ?? client).post<CreateWorkspaceResponses, CreateWorkspaceErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/workspaces',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Get workspace\n *\n * Return one workspace by ID, including its name, color, description, and account count.\n */\n public static getWorkspace<ThrowOnError extends boolean = false>(options: Options<GetWorkspaceData, ThrowOnError>): RequestResult<GetWorkspaceResponses, GetWorkspaceErrors, ThrowOnError> {\n return (options.client ?? client).get<GetWorkspaceResponses, GetWorkspaceErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/workspaces/{id}',\n ...options\n });\n }\n}\n\nexport class Media {\n /**\n * List media\n *\n * Return your uploaded and generated media files. You can filter by ID, type, and source before reusing them in posts.\n */\n public static listMedia<ThrowOnError extends boolean = false>(options?: Options<ListMediaData, ThrowOnError>): RequestResult<ListMediaResponses, ListMediaErrors, ThrowOnError> {\n return (options?.client ?? client).get<ListMediaResponses, ListMediaErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/media',\n ...options\n });\n }\n \n /**\n * Upload media\n *\n * Upload a file smaller than 100 MB in a single request. It is the simplest way to upload: one call returns a media ID you can attach to posts. For bigger files, use Create media upload.\n */\n public static uploadMedia<ThrowOnError extends boolean = false>(options: Options<UploadMediaData, ThrowOnError>): RequestResult<UploadMediaResponses, UploadMediaErrors, ThrowOnError> {\n return (options.client ?? client).post<UploadMediaResponses, UploadMediaErrors, ThrowOnError>({\n ...formDataBodySerializer,\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/media',\n ...options,\n headers: {\n 'Content-Type': null,\n ...options.headers\n }\n });\n }\n \n /**\n * Get media\n *\n * Return one media file by ID, including its URL, source, and usage count.\n */\n public static getMedia<ThrowOnError extends boolean = false>(options: Options<GetMediaData, ThrowOnError>): RequestResult<GetMediaResponses, GetMediaErrors, ThrowOnError> {\n return (options.client ?? client).get<GetMediaResponses, GetMediaErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/media/{id}',\n ...options\n });\n }\n \n /**\n * Create media upload\n *\n * Upload a file of up to 4 GB (500 MB on the Free plan) straight to storage:\n *\n * 1. Call this endpoint with `filename`, `contentType` and `fileSize`. You get back an `id` and an `uploadUrl`.\n * 2. `PUT` the file to `uploadUrl` with the same `Content-Type` header. Storage answers `200`, or `403` if the file is not exactly `fileSize` bytes.\n * 3. Optional: call Complete media upload to add the file to your media library now.\n * 4. Put the `id` in `mediaIds` when you create or update a post.\n */\n public static createMediaUpload<ThrowOnError extends boolean = false>(options: Options<CreateMediaUploadData, ThrowOnError>): RequestResult<CreateMediaUploadResponses, CreateMediaUploadErrors, ThrowOnError> {\n return (options.client ?? client).post<CreateMediaUploadResponses, CreateMediaUploadErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/media/uploads',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Complete media upload\n *\n * Optional. Adds a file uploaded through Create media upload to your media library now and returns it. Without this call the file is added the first time you use its id in a post, and an upload nobody completes or uses within 1 day expires.\n */\n public static completeMediaUpload<ThrowOnError extends boolean = false>(options: Options<CompleteMediaUploadData, ThrowOnError>): RequestResult<CompleteMediaUploadResponses, CompleteMediaUploadErrors, ThrowOnError> {\n return (options.client ?? client).post<CompleteMediaUploadResponses, CompleteMediaUploadErrors, ThrowOnError>({\n security: [{ scheme: 'bearer', type: 'http' }],\n url: '/media/uploads/{id}/complete',\n ...options\n });\n }\n}\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport * as z from 'zod/mini';\n\nexport const zApiErrorCode = z.enum([\n 'missing_auth',\n 'invalid_auth_format',\n 'invalid_api_key',\n 'api_key_expired',\n 'insufficient_scope',\n 'validation_failed',\n 'route_not_found',\n 'internal_server_error',\n 'rate_limit_exceeded',\n 'post_not_found',\n 'post_forbidden',\n 'post_not_editable',\n 'media_not_found',\n 'media_in_use',\n 'media_upload_incomplete',\n 'storage_limit_exceeded',\n 'free_media_limit_exceeded',\n 'free_pending_media_limit_exceeded',\n 'file_required',\n 'file_too_large',\n 'unsupported_file_type',\n 'unsupported_media_type',\n 'invalid_file_extension',\n 'social_accounts_not_found',\n 'social_accounts_expired',\n 'social_account_limit_exceeded',\n 'platform_temporarily_unavailable',\n 'platform_permission_missing',\n 'platform_validation_failed',\n 'posting_limits_exceeded',\n 'scheduled_at_required',\n 'invalid_scheduled_at',\n 'scheduled_at_too_soon',\n 'reschedulable_posts_not_found',\n 'workspace_not_found',\n 'workspace_forbidden',\n 'workspace_owner_required',\n 'workspace_limit_exceeded',\n 'workspace_account_not_found',\n 'workspace_account_conflict',\n 'workspace_member_not_found',\n 'workspace_member_conflict',\n 'team_member_limit_exceeded',\n 'workspace_invitation_invalid',\n 'workspace_invitation_expired'\n]);\n\nexport const zApiError = z.object({\n error: z.object({\n title: z.string(),\n status: z.int(),\n code: zApiErrorCode,\n message: z.string(),\n instance: z.optional(z.string()),\n details: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())))\n })\n});\n\nexport const zPagination = z.object({\n page: z.int().register(z.globalRegistry, {\n description: 'Current page number (starting from 1).'\n }),\n limit: z.int().register(z.globalRegistry, {\n description: 'Maximum number of items returned per page.'\n }),\n total: z.int().register(z.globalRegistry, {\n description: 'Total number of matching items.'\n }),\n totalPages: z.int().register(z.globalRegistry, {\n description: 'Total number of pages for the current limit.'\n }),\n hasNext: z.boolean().register(z.globalRegistry, {\n description: 'Whether another page exists after the current one.'\n }),\n hasPrev: z.boolean().register(z.globalRegistry, {\n description: 'Whether another page exists before the current one.'\n })\n});\n\n/**\n * BlueskyPlatformSpecificSettings\n *\n * Bluesky-specific publishing settings. No settings are currently available.\n */\nexport const zBlueskyPlatformSpecificSettings = z.record(z.string(), z.never()).register(z.globalRegistry, {\n description: 'Bluesky-specific publishing settings. No settings are currently available.'\n});\n\n/**\n * InstagramPlatformSpecificSettings\n *\n * Instagram-specific post settings. All fields are optional — omit the entire object for a regular feed post or carousel.\n */\nexport const zInstagramPlatformSpecificSettings = z.object({\n contentType: z.optional(z.enum(['story', 'reels']).register(z.globalRegistry, {\n description: 'Set to \"story\" for ephemeral content that disappears after 24 hours. Set to \"reels\" to explicitly publish as a Reel. Omit for a regular feed post or carousel — single videos are automatically published as Reels.'\n })),\n shareToFeed: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Reels only. When true (default), the reel can appear in both the Feed and Reels tabs. When false, it only appears in the Reels tab. Neither value guarantees placement — Instagram\\'s algorithm decides based on eligibility and relevance.'\n })),\n trialParams: z.optional(z.object({\n graduationStrategy: z.enum(['MANUAL', 'SS_PERFORMANCE']).register(z.globalRegistry, {\n description: 'MANUAL: the trial reel can be graduated (converted to a public reel) manually in the Instagram app. SS_PERFORMANCE: Instagram automatically graduates the reel if it performs well with non-followers.'\n })\n }).register(z.globalRegistry, {\n description: 'Reels only. Publish as a trial reel — shown only to non-followers first. Instagram requires a public account with at least 200 followers and rejects the post otherwise.'\n })),\n audioName: z.optional(z.string().register(z.globalRegistry, {\n description: 'Reels only. Custom name for the audio track of your reel. Can only be set once — either at creation time or later from the audio page in the Instagram app.'\n }))\n}).register(z.globalRegistry, {\n description: 'Instagram-specific post settings. All fields are optional — omit the entire object for a regular feed post or carousel.'\n});\n\n/**\n * FacebookPlatformSpecificSettings\n *\n * Facebook-specific post settings. All fields are optional — omit the entire object for a regular post.\n */\nexport const zFacebookPlatformSpecificSettings = z.object({\n contentType: z.optional(z.enum(['story']).register(z.globalRegistry, {\n description: 'Set to \"story\" for ephemeral content that disappears after 24 hours. Omit for a regular post — single videos are automatically published as Reels (Facebook no longer has a separate video format).'\n }))\n}).register(z.globalRegistry, {\n description: 'Facebook-specific post settings. All fields are optional — omit the entire object for a regular post.'\n});\n\n/**\n * InstagramTrialParams\n *\n * Trial reel graduation settings. Trial reels are shown only to non-followers first. If the reel performs well (SS_PERFORMANCE) or you manually approve it (MANUAL), it gets promoted to a regular reel visible to followers.\n */\nexport const zInstagramTrialParams = z.object({\n graduationStrategy: z.enum(['MANUAL', 'SS_PERFORMANCE']).register(z.globalRegistry, {\n description: 'MANUAL: the trial reel can be graduated (converted to a public reel) manually in the Instagram app. SS_PERFORMANCE: Instagram automatically graduates the reel if it performs well with non-followers.'\n })\n}).register(z.globalRegistry, {\n description: 'Trial reel graduation settings. Trial reels are shown only to non-followers first. If the reel performs well (SS_PERFORMANCE) or you manually approve it (MANUAL), it gets promoted to a regular reel visible to followers.'\n});\n\n/**\n * YouTubePlatformSpecificSettings\n *\n * YouTube-specific upload settings, such as description and privacy.\n */\nexport const zYouTubePlatformSpecificSettings = z.object({\n description: z.optional(z.string().check(z.maxLength(5000)).register(z.globalRegistry, {\n description: 'Video description. Max 5000 characters. Shown below the video title on the watch page.'\n })),\n privacyStatus: z.optional(z.enum([\n 'public',\n 'unlisted',\n 'private'\n ]).register(z.globalRegistry, {\n description: 'Video privacy status. Defaults to public. Unverified API projects are restricted to private.'\n })),\n madeForKids: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Declare the video as made for kids (COPPA). When true, personalized ads are disabled and some features (comments, notifications) are turned off.'\n })),\n containsSyntheticMedia: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Disclose that the video contains realistic altered or synthetic (AI-generated) content.'\n })),\n categoryId: z.optional(z.enum([\n '1',\n '2',\n '10',\n '15',\n '17',\n '19',\n '20',\n '22',\n '23',\n '24',\n '25',\n '26',\n '27',\n '28',\n '29'\n ]).register(z.globalRegistry, {\n description: 'YouTube video category. Defaults to \"22\" (People & Blogs). Valid IDs: 1 (Film & Animation), 2 (Autos & Vehicles), 10 (Music), 15 (Pets & Animals), 17 (Sports), 19 (Travel & Events), 20 (Gaming), 22 (People & Blogs), 23 (Comedy), 24 (Entertainment), 25 (News & Politics), 26 (Howto & Style), 27 (Education), 28 (Science & Technology), 29 (Nonprofits & Activism).'\n })),\n tags: z.optional(z.array(z.string()).register(z.globalRegistry, {\n description: 'Keyword tags for the video. Duplicates are removed. Total of all tags must be under 500 characters. Tags with spaces count as quoted (2 extra chars). Commas between tags also count.'\n })),\n embeddable: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Whether the video can be embedded on other websites. Defaults to true.'\n })),\n playlistId: z.optional(z.string().register(z.globalRegistry, {\n description: 'Playlist ID to add the video to after upload.'\n })),\n thumbnailMediaId: z.optional(z.uuid().register(z.globalRegistry, {\n description: 'ID of an image in your media library to set as the custom thumbnail of this video. JPEG or PNG, up to 50MB; YouTube recommends 1280x720 (16:9). Upload the image with the media endpoints first. The thumbnail is set right after the video uploads. If YouTube refuses it (custom thumbnails need a verified channel), the video still publishes and `thumbnail` on the account says why. To replace it on a draft or scheduled post, update the account with the new id; to remove it, send `thumbnailMediaId: null`.'\n }))\n}).register(z.globalRegistry, {\n description: 'YouTube-specific upload settings, such as description and privacy.'\n});\n\n/**\n * TikTokPlatformSpecificSettings\n *\n * TikTok-specific publishing settings. Privacy level and brand toggles are required for all posts. Duet/stitch settings only apply to video posts. autoAddMusic only applies to photo posts.\n */\nexport const zTikTokPlatformSpecificSettings = z.object({\n privacyLevel: z.enum([\n 'PUBLIC_TO_EVERYONE',\n 'FOLLOWER_OF_CREATOR',\n 'MUTUAL_FOLLOW_FRIENDS',\n 'SELF_ONLY'\n ]).register(z.globalRegistry, {\n description: 'Who can view this post. The value must match one of the options returned by the TikTok creator_info/query endpoint for the target account.'\n }),\n disableComment: z.boolean().register(z.globalRegistry, {\n description: 'If true, other TikTok users cannot comment on this post. Ignored if the creator has set comments to \"No one\" in their privacy settings.'\n }),\n disableDuet: z.boolean().register(z.globalRegistry, {\n description: 'If true, other TikTok users cannot create Duets with this post. Only applies to video posts. Ignored for photo posts and private accounts.'\n }),\n disableStitch: z.boolean().register(z.globalRegistry, {\n description: 'If true, other TikTok users cannot create Stitches with this post. Only applies to video posts. Ignored for photo posts and private accounts.'\n }),\n brandContentToggle: z.boolean().register(z.globalRegistry, {\n description: 'Set to true if this is a paid partnership promoting a third-party business. Required by TikTok for branded content disclosure.'\n }),\n brandOrganicToggle: z.boolean().register(z.globalRegistry, {\n description: 'Set to true if this post promotes the creator\\'s own business.'\n }),\n autoAddMusic: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Photo posts only. If true, TikTok automatically adds recommended background music to the photo carousel. Users can change the music later in the TikTok app.'\n })),\n videoMadeWithAi: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Video posts only. Set to true if the video is AI-generated content. The video will be labeled with a \"Creator labeled as AI-generated\" tag.'\n })),\n description: z.optional(z.string().check(z.maxLength(4000)).register(z.globalRegistry, {\n description: 'Photo posts only. Additional description text (max 4000 characters). Hashtags and mentions in the description are parsed by TikTok.'\n })),\n photoCoverIndex: z.optional(z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'Photo posts only. Zero-based index of the image to use as the carousel cover. Defaults to 0 (first image).'\n }))\n}).register(z.globalRegistry, {\n description: 'TikTok-specific publishing settings. Privacy level and brand toggles are required for all posts. Duet/stitch settings only apply to video posts. autoAddMusic only applies to photo posts.'\n});\n\n/**\n * LinkedInPlatformSpecificSettings\n *\n * LinkedIn-specific publishing settings, such as post visibility.\n */\nexport const zLinkedInPlatformSpecificSettings = z.object({\n visibility: z.optional(z.enum(['CONNECTIONS', 'PUBLIC']).register(z.globalRegistry, {\n description: 'Who can see the post. PUBLIC (anyone on LinkedIn) or CONNECTIONS (only your connections). Defaults to PUBLIC. Only available for personal profiles — company pages are always public.'\n }))\n}).register(z.globalRegistry, {\n description: 'LinkedIn-specific publishing settings, such as post visibility.'\n});\n\n/**\n * ThreadsPlatformSpecificSettings\n *\n * Threads-specific publishing settings.\n */\nexport const zThreadsPlatformSpecificSettings = z.object({\n topicTag: z.optional(z.string().check(z.minLength(1), z.maxLength(50)).register(z.globalRegistry, {\n description: 'A topic tag for the post (without the # prefix). Max 50 characters. Periods (.) and ampersands (&) are not allowed. Overrides any auto-detected topic from inline hashtags.'\n }))\n}).register(z.globalRegistry, {\n description: 'Threads-specific publishing settings.'\n});\n\n/**\n * TwitterPlatformSpecificSettings\n *\n * X (Twitter) specific post settings. All fields are optional.\n */\nexport const zTwitterPlatformSpecificSettings = z.object({\n communityId: z.optional(z.string().check(z.regex(/^[0-9]{1,19}$/)).register(z.globalRegistry, {\n description: 'Post to a specific X Community. The authenticated user must be a member of the community.'\n })),\n shareWithFollowers: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'When posting to a community, also share the post with your followers. Only applies when `communityId` is set.'\n })),\n forSuperFollowersOnly: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Make this post exclusive to your subscribers (super followers).'\n })),\n replySettings: z.optional(z.enum([\n 'following',\n 'mentionedUsers',\n 'subscribers',\n 'verified'\n ]).register(z.globalRegistry, {\n description: 'Control who can reply. `following`: only people you follow. `mentionedUsers`: only people mentioned in the post. `subscribers`: only your subscribers. `verified`: only verified users.'\n })),\n quoteTweetId: z.optional(z.string().check(z.regex(/^[0-9]{1,19}$/)).register(z.globalRegistry, {\n description: 'ID of an existing tweet to quote. Mutually exclusive with poll and media.'\n })),\n replyToTweetId: z.optional(z.string().check(z.regex(/^[0-9]{1,19}$/)).register(z.globalRegistry, {\n description: 'ID of an existing tweet to reply to. Your post will appear as a reply in that tweet\\'s thread.'\n })),\n poll: z.optional(z.object({\n options: z.array(z.string().check(z.minLength(1), z.maxLength(25))).check(z.minLength(2), z.maxLength(4)).register(z.globalRegistry, {\n description: 'Poll choices. 2-4 options, max 25 characters each.'\n }),\n durationMinutes: z.int().check(z.gte(5), z.lte(10080)).register(z.globalRegistry, {\n description: 'How long the poll stays open, in minutes. Min 5 minutes, max 7 days (10080).'\n })\n }).register(z.globalRegistry, {\n description: 'Create a poll. Mutually exclusive with media and `quoteTweetId`.'\n }))\n}).register(z.globalRegistry, {\n description: 'X (Twitter) specific post settings. All fields are optional.'\n});\n\n/**\n * Where the post came from. PUBLISHQ: created in PublishQ. IMPORTED: published directly on the platform and discovered during an analytics sync, so the post history stays complete.\n */\nexport const zPostSource = z.enum(['PUBLISHQ', 'IMPORTED']).register(z.globalRegistry, {\n description: 'Where the post came from. PUBLISHQ: created in PublishQ. IMPORTED: published directly on the platform and discovered during an analytics sync, so the post history stays complete.'\n});\n\nexport const zPostAnalytics = z.object({\n views: z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'Views the platform reports for this post.'\n }),\n likes: z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'Likes the platform reports for this post.'\n }),\n comments: z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'Comments the platform reports for this post.'\n }),\n shares: z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'Shares the platform reports for this post. 0 on platforms that do not disclose it (including YouTube).'\n }),\n extraMetrics: z.record(z.string(), z.int().check(z.gte(0))).register(z.globalRegistry, {\n description: 'Metrics only this platform reports, keyed by metric name — Bluesky bookmarks, for example. Every metric the platform reports is always present, 0 included, so no key has to be guessed. Empty on platforms that expose nothing beyond the fields above, and a metric that already has its own field is never repeated here.'\n }),\n syncedAt: z.iso.datetime().register(z.globalRegistry, {\n description: 'When these numbers were last recorded. Metrics are refreshed in the background roughly once a day, and only stored when they change.'\n })\n});\n\nexport const zPublishFailure = z.object({\n kind: z.enum([\n 'RECONNECT',\n 'MEDIA',\n 'ACCOUNT_STATE',\n 'TRANSIENT',\n 'MAYBE_PUBLISHED',\n 'UNKNOWN'\n ]).register(z.globalRegistry, {\n description: 'What kind of action this failure needs. `RECONNECT`: the account has to be reconnected. `MEDIA`: the platform refused the attached file. `ACCOUNT_STATE`: the platform is blocking this account, so the fix is on the platform. `TRANSIENT`: the platform was unavailable and the same request can succeed unchanged. `MAYBE_PUBLISHED`: the platform reported an error for a post that may have gone out anyway. `UNKNOWN`: unrecognised, so read `errorMessage`.'\n }),\n title: z.string().register(z.globalRegistry, {\n description: 'Short label for this failure.'\n }),\n whatHappened: z.string().register(z.globalRegistry, {\n description: 'One sentence about what the platform did.'\n }),\n whatToDo: z.string().register(z.globalRegistry, {\n description: 'One sentence naming the next action.'\n }),\n canRetry: z.boolean().register(z.globalRegistry, {\n description: 'Whether retrying can succeed. False when the platform is blocking the account, since the same request will be refused the same way.'\n }),\n checkPlatformFirst: z.boolean().register(z.globalRegistry, {\n description: 'Whether the post may already be live. A publish is not idempotent and no platform accepts a deduplication key, so when this is true a retry can create a second copy: check the profile before retrying.'\n })\n});\n\nexport const zSocialPlatform = z.enum([\n 'TWITTER',\n 'INSTAGRAM',\n 'FACEBOOK',\n 'LINKEDIN',\n 'YOUTUBE',\n 'TIKTOK',\n 'THREADS',\n 'BLUESKY'\n]);\n\nexport const zPostStatus = z.enum([\n 'DRAFT',\n 'SCHEDULED',\n 'PUBLISHING',\n 'PUBLISHED',\n 'FAILED'\n]);\n\nexport const zPostOverrides = z.object({\n content: z.optional(z.string().register(z.globalRegistry, {\n description: 'Custom text for this account, overriding the post-level content.'\n })),\n thumbnailTimestamp: z.optional(z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'Video thumbnail timestamp in milliseconds. Applies to Instagram and TikTok.'\n })),\n mediaIds: z.optional(z.array(z.uuid()).check(z.maxLength(35)).register(z.globalRegistry, {\n description: 'Replacement media for this account. Completely replaces the post-level media. Up to 35.'\n }))\n});\n\n/**\n * Platform-specific settings for this account. The accepted shape depends on the account platform.\n */\nexport const zPlatformSpecificSettings = z.union([\n z.object({\n description: z.optional(z.string().check(z.maxLength(5000)).register(z.globalRegistry, {\n description: 'Video description. Max 5000 characters. Shown below the video title on the watch page.'\n })),\n privacyStatus: z.optional(z.enum([\n 'public',\n 'unlisted',\n 'private'\n ]).register(z.globalRegistry, {\n description: 'Video privacy status. Defaults to public. Unverified API projects are restricted to private.'\n })),\n madeForKids: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Declare the video as made for kids (COPPA). When true, personalized ads are disabled and some features (comments, notifications) are turned off.'\n })),\n containsSyntheticMedia: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Disclose that the video contains realistic altered or synthetic (AI-generated) content.'\n })),\n categoryId: z.optional(z.enum([\n '1',\n '2',\n '10',\n '15',\n '17',\n '19',\n '20',\n '22',\n '23',\n '24',\n '25',\n '26',\n '27',\n '28',\n '29'\n ]).register(z.globalRegistry, {\n description: 'YouTube video category. Defaults to \"22\" (People & Blogs). Valid IDs: 1 (Film & Animation), 2 (Autos & Vehicles), 10 (Music), 15 (Pets & Animals), 17 (Sports), 19 (Travel & Events), 20 (Gaming), 22 (People & Blogs), 23 (Comedy), 24 (Entertainment), 25 (News & Politics), 26 (Howto & Style), 27 (Education), 28 (Science & Technology), 29 (Nonprofits & Activism).'\n })),\n tags: z.optional(z.array(z.string()).register(z.globalRegistry, {\n description: 'Keyword tags for the video. Duplicates are removed. Total of all tags must be under 500 characters. Tags with spaces count as quoted (2 extra chars). Commas between tags also count.'\n })),\n embeddable: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Whether the video can be embedded on other websites. Defaults to true.'\n })),\n playlistId: z.optional(z.string().register(z.globalRegistry, {\n description: 'Playlist ID to add the video to after upload.'\n })),\n thumbnailMediaId: z.optional(z.uuid().register(z.globalRegistry, {\n description: 'ID of an image in your media library to set as the custom thumbnail of this video. JPEG or PNG, up to 50MB; YouTube recommends 1280x720 (16:9). Upload the image with the media endpoints first. The thumbnail is set right after the video uploads. If YouTube refuses it (custom thumbnails need a verified channel), the video still publishes and `thumbnail` on the account says why. To replace it on a draft or scheduled post, update the account with the new id; to remove it, send `thumbnailMediaId: null`.'\n }))\n }).register(z.globalRegistry, {\n description: 'YouTube-specific upload settings, such as description and privacy.'\n }),\n z.object({\n privacyLevel: z.enum([\n 'PUBLIC_TO_EVERYONE',\n 'FOLLOWER_OF_CREATOR',\n 'MUTUAL_FOLLOW_FRIENDS',\n 'SELF_ONLY'\n ]).register(z.globalRegistry, {\n description: 'Who can view this post. The value must match one of the options returned by the TikTok creator_info/query endpoint for the target account.'\n }),\n disableComment: z.boolean().register(z.globalRegistry, {\n description: 'If true, other TikTok users cannot comment on this post. Ignored if the creator has set comments to \"No one\" in their privacy settings.'\n }),\n disableDuet: z.boolean().register(z.globalRegistry, {\n description: 'If true, other TikTok users cannot create Duets with this post. Only applies to video posts. Ignored for photo posts and private accounts.'\n }),\n disableStitch: z.boolean().register(z.globalRegistry, {\n description: 'If true, other TikTok users cannot create Stitches with this post. Only applies to video posts. Ignored for photo posts and private accounts.'\n }),\n brandContentToggle: z.boolean().register(z.globalRegistry, {\n description: 'Set to true if this is a paid partnership promoting a third-party business. Required by TikTok for branded content disclosure.'\n }),\n brandOrganicToggle: z.boolean().register(z.globalRegistry, {\n description: 'Set to true if this post promotes the creator\\'s own business.'\n }),\n autoAddMusic: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Photo posts only. If true, TikTok automatically adds recommended background music to the photo carousel. Users can change the music later in the TikTok app.'\n })),\n videoMadeWithAi: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Video posts only. Set to true if the video is AI-generated content. The video will be labeled with a \"Creator labeled as AI-generated\" tag.'\n })),\n description: z.optional(z.string().check(z.maxLength(4000)).register(z.globalRegistry, {\n description: 'Photo posts only. Additional description text (max 4000 characters). Hashtags and mentions in the description are parsed by TikTok.'\n })),\n photoCoverIndex: z.optional(z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'Photo posts only. Zero-based index of the image to use as the carousel cover. Defaults to 0 (first image).'\n }))\n }).register(z.globalRegistry, {\n description: 'TikTok-specific publishing settings. Privacy level and brand toggles are required for all posts. Duet/stitch settings only apply to video posts. autoAddMusic only applies to photo posts.'\n }),\n z.object({\n contentType: z.optional(z.enum(['story', 'reels']).register(z.globalRegistry, {\n description: 'Set to \"story\" for ephemeral content that disappears after 24 hours. Set to \"reels\" to explicitly publish as a Reel. Omit for a regular feed post or carousel — single videos are automatically published as Reels.'\n })),\n shareToFeed: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Reels only. When true (default), the reel can appear in both the Feed and Reels tabs. When false, it only appears in the Reels tab. Neither value guarantees placement — Instagram\\'s algorithm decides based on eligibility and relevance.'\n })),\n trialParams: z.optional(z.object({\n graduationStrategy: z.enum(['MANUAL', 'SS_PERFORMANCE']).register(z.globalRegistry, {\n description: 'MANUAL: the trial reel can be graduated (converted to a public reel) manually in the Instagram app. SS_PERFORMANCE: Instagram automatically graduates the reel if it performs well with non-followers.'\n })\n }).register(z.globalRegistry, {\n description: 'Reels only. Publish as a trial reel — shown only to non-followers first. Instagram requires a public account with at least 200 followers and rejects the post otherwise.'\n })),\n audioName: z.optional(z.string().register(z.globalRegistry, {\n description: 'Reels only. Custom name for the audio track of your reel. Can only be set once — either at creation time or later from the audio page in the Instagram app.'\n }))\n }).register(z.globalRegistry, {\n description: 'Instagram-specific post settings. All fields are optional — omit the entire object for a regular feed post or carousel.'\n }),\n z.object({\n contentType: z.optional(z.enum(['story']).register(z.globalRegistry, {\n description: 'Set to \"story\" for ephemeral content that disappears after 24 hours. Omit for a regular post — single videos are automatically published as Reels (Facebook no longer has a separate video format).'\n }))\n }).register(z.globalRegistry, {\n description: 'Facebook-specific post settings. All fields are optional — omit the entire object for a regular post.'\n }),\n z.object({\n topicTag: z.optional(z.string().check(z.minLength(1), z.maxLength(50)).register(z.globalRegistry, {\n description: 'A topic tag for the post (without the # prefix). Max 50 characters. Periods (.) and ampersands (&) are not allowed. Overrides any auto-detected topic from inline hashtags.'\n }))\n }).register(z.globalRegistry, {\n description: 'Threads-specific publishing settings.'\n }),\n z.object({\n communityId: z.optional(z.string().check(z.regex(/^[0-9]{1,19}$/)).register(z.globalRegistry, {\n description: 'Post to a specific X Community. The authenticated user must be a member of the community.'\n })),\n shareWithFollowers: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'When posting to a community, also share the post with your followers. Only applies when `communityId` is set.'\n })),\n forSuperFollowersOnly: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Make this post exclusive to your subscribers (super followers).'\n })),\n replySettings: z.optional(z.enum([\n 'following',\n 'mentionedUsers',\n 'subscribers',\n 'verified'\n ]).register(z.globalRegistry, {\n description: 'Control who can reply. `following`: only people you follow. `mentionedUsers`: only people mentioned in the post. `subscribers`: only your subscribers. `verified`: only verified users.'\n })),\n quoteTweetId: z.optional(z.string().check(z.regex(/^[0-9]{1,19}$/)).register(z.globalRegistry, {\n description: 'ID of an existing tweet to quote. Mutually exclusive with poll and media.'\n })),\n replyToTweetId: z.optional(z.string().check(z.regex(/^[0-9]{1,19}$/)).register(z.globalRegistry, {\n description: 'ID of an existing tweet to reply to. Your post will appear as a reply in that tweet\\'s thread.'\n })),\n poll: z.optional(z.object({\n options: z.array(z.string().check(z.minLength(1), z.maxLength(25))).check(z.minLength(2), z.maxLength(4)).register(z.globalRegistry, {\n description: 'Poll choices. 2-4 options, max 25 characters each.'\n }),\n durationMinutes: z.int().check(z.gte(5), z.lte(10080)).register(z.globalRegistry, {\n description: 'How long the poll stays open, in minutes. Min 5 minutes, max 7 days (10080).'\n })\n }).register(z.globalRegistry, {\n description: 'Create a poll. Mutually exclusive with media and `quoteTweetId`.'\n }))\n }).register(z.globalRegistry, {\n description: 'X (Twitter) specific post settings. All fields are optional.'\n }),\n z.object({\n visibility: z.optional(z.enum(['CONNECTIONS', 'PUBLIC']).register(z.globalRegistry, {\n description: 'Who can see the post. PUBLIC (anyone on LinkedIn) or CONNECTIONS (only your connections). Defaults to PUBLIC. Only available for personal profiles — company pages are always public.'\n }))\n }).register(z.globalRegistry, {\n description: 'LinkedIn-specific publishing settings, such as post visibility.'\n }),\n z.record(z.string(), z.never()).register(z.globalRegistry, {\n description: 'Bluesky-specific publishing settings. No settings are currently available.'\n }),\n z.record(z.string(), z.unknown())\n]);\n\nexport const zPostAccount = z.object({\n accountId: z.uuid().register(z.globalRegistry, {\n description: 'The connected social account identifier.'\n }),\n platform: zSocialPlatform,\n accountName: z.string().register(z.globalRegistry, {\n description: 'Display name or username of the connected account.'\n }),\n status: zPostStatus,\n externalUrl: z.optional(z.url().register(z.globalRegistry, {\n description: 'Link to the published post on the social platform. Present only after successful publishing.'\n })),\n publishedAt: z.optional(z.iso.datetime().register(z.globalRegistry, {\n description: 'When this account\\'s post was published.'\n })),\n errorMessage: z.optional(z.string().register(z.globalRegistry, {\n description: 'Error message from the platform if publishing failed for this account.'\n })),\n thumbnail: z.optional(z.object({\n status: z.enum(['APPLIED', 'FAILED']),\n errorMessage: z.optional(z.string())\n }).register(z.globalRegistry, {\n description: 'Present on a published account whose post set a custom thumbnail: whether the platform applied it, and if not, why. The post itself is live either way.'\n })),\n failure: z.optional(z.intersection(zPublishFailure, z.unknown().register(z.globalRegistry, {\n description: 'The same failure read as an action: what happened and the one thing to do about it. Present whenever status is FAILED, including when the platform gave no reason. The wording is what the app and the failure email show, so a client does not have to interpret `errorMessage` itself.'\n }))),\n analytics: z.optional(z.intersection(zPostAnalytics, z.unknown().register(z.globalRegistry, {\n description: 'Latest metrics recorded for this delivery. Present only for published posts on platforms with analytics support, once a background sync has run.'\n }))),\n postOverrides: z.optional(zPostOverrides),\n platformSpecificSettings: z.optional(zPlatformSpecificSettings)\n});\n\nexport const zPost = z.object({\n id: z.uuid().register(z.globalRegistry, {\n description: 'Unique post identifier.'\n }),\n content: z.string().register(z.globalRegistry, {\n description: 'The shared text content of the post.'\n }),\n status: zPostStatus,\n source: zPostSource,\n errorMessage: z.optional(z.string().register(z.globalRegistry, {\n description: 'Human-readable error summary when one or more accounts failed.'\n })),\n mediaIds: z.optional(z.array(z.uuid()).register(z.globalRegistry, {\n description: 'Media attached to this post.'\n })),\n deletedMediaCount: z.optional(z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'How many media were attached to this post but have since been deleted (rendered as placeholders). Lets a client tell a post that HAD media apart from one posted with none.'\n })),\n scheduledAt: z.optional(z.iso.datetime().register(z.globalRegistry, {\n description: 'When the post is scheduled to be published.'\n })),\n publishedAt: z.optional(z.iso.datetime().register(z.globalRegistry, {\n description: 'When the post was published. Present only when all accounts are published.'\n })),\n createdAt: z.iso.datetime().register(z.globalRegistry, {\n description: 'When the post was created.'\n }),\n accounts: z.array(zPostAccount).register(z.globalRegistry, {\n description: 'Individual account entries. Each represents the post on one connected social account.'\n })\n});\n\nexport const zPostsResponse = z.object({\n posts: z.array(zPost),\n pagination: zPagination\n});\n\nexport const zCreatePostAccount = z.object({\n accountId: z.uuid().register(z.globalRegistry, {\n description: 'ID of a connected social account to post to.'\n }),\n postOverrides: z.optional(z.intersection(zPostOverrides, z.unknown().register(z.globalRegistry, {\n description: 'Override the post-level content or media for this specific account.'\n }))),\n platformSpecificSettings: z.optional(z.intersection(zPlatformSpecificSettings, z.unknown().register(z.globalRegistry, {\n description: 'Platform-specific settings. The accepted shape depends on the account platform.'\n })))\n});\n\n/**\n * Create a post across one or more connected social accounts.\n */\nexport const zCreatePostRequest = z.object({\n content: z._default(z.optional(z.string().register(z.globalRegistry, {\n description: 'The text content of the post, shared across all accounts unless overridden. Optional when media is attached (platform-dependent).'\n })), ''),\n mediaIds: z.optional(z.array(z.uuid()).check(z.maxLength(35)).register(z.globalRegistry, {\n description: 'Media to attach to the post, up to 35. Shared across all accounts unless an account provides its own mediaIds in postOverrides. Accepts IDs from Upload media and from Create media upload.'\n })),\n thumbnailTimestamp: z.optional(z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'Default video thumbnail timestamp in milliseconds for Instagram and TikTok. Can be overridden per account.'\n })),\n accounts: z.array(zCreatePostAccount).check(z.minLength(1)).register(z.globalRegistry, {\n description: 'Accounts to post to. Each entry can optionally include content overrides and platform-specific settings.'\n }),\n scheduledAt: z.optional(z.iso.datetime().register(z.globalRegistry, {\n description: 'Schedule the post for a future date. If omitted and publishNow is false or absent, the post is saved as a draft. Accepts UTC (2026-04-01T12:00:00Z) or an explicit UTC offset (2026-04-01T14:00:00+02:00); a time without zone information is rejected.'\n })),\n publishNow: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Publish immediately. Cannot be combined with scheduledAt.'\n }))\n}).register(z.globalRegistry, {\n description: 'Create a post across one or more connected social accounts.'\n});\n\n/**\n * Override the post-level content, media or thumbnail timestamp for this specific account.\n */\nexport const zUpdatePostOverrides = z.object({\n content: z.nullish(z.string()),\n mediaIds: z.nullish(z.array(z.uuid()).check(z.maxLength(35))),\n thumbnailTimestamp: z.nullish(z.int().check(z.gte(0)))\n}).register(z.globalRegistry, {\n description: 'Override the post-level content, media or thumbnail timestamp for this specific account.'\n});\n\nexport const zUpdatePostAccount = z.object({\n accountId: z.uuid().register(z.globalRegistry, {\n description: 'ID of a connected social account to post to.'\n }),\n postOverrides: z.optional(zUpdatePostOverrides),\n platformSpecificSettings: z.optional(z.intersection(zPlatformSpecificSettings, z.unknown().register(z.globalRegistry, {\n description: 'Platform-specific settings to change. Only the settings you send change, and every setting you leave out keeps its current value. Send a setting as null to remove it. Nested objects merge the same way (JSON Merge Patch, RFC 7396). The resulting settings must still be valid for the platform, so a required setting cannot be removed.'\n })))\n});\n\n/**\n * Update a draft or scheduled post. Published and publishing posts cannot be updated. Only the fields you send change; everything you leave out keeps its current value. To remove an account setting, or an account's own text, media or thumbnail timestamp, send it as null. Media behavior is explicit: omit mediaIds to keep existing media unchanged, provide mediaIds to replace all current media, or provide an empty mediaIds array to remove all media. The post that results from the update is validated as a whole before anything is saved.\n */\nexport const zUpdatePostRequest = z.object({\n content: z.optional(z.string().register(z.globalRegistry, {\n description: 'New shared text content for the post.'\n })),\n scheduledAt: z.optional(z.iso.datetime().register(z.globalRegistry, {\n description: 'New scheduled date for the post. Must be at least 1 minute in the future. Accepts UTC (2026-04-15T14:00:00Z) or an explicit UTC offset (2026-04-15T16:00:00+02:00); a time without zone information is rejected.'\n })),\n mediaIds: z.optional(z.array(z.uuid()).check(z.maxLength(35)).register(z.globalRegistry, {\n description: 'Full replacement for the post media, up to 35. If omitted, the existing media stays unchanged. If provided, it replaces the current media across all accounts in the post. Send an empty array to remove all media from the post.'\n })),\n thumbnailTimestamp: z.optional(z.int().check(z.gte(0)).register(z.globalRegistry, {\n description: 'New video thumbnail timestamp in milliseconds for Instagram and TikTok media. Does not change which media files are attached. Combine with mediaIds if you want to replace media and set the new thumbnail timestamp in the same request.'\n })),\n accounts: z.optional(z.array(zUpdatePostAccount).check(z.minLength(1)).register(z.globalRegistry, {\n description: 'Accounts to change, plus any connected accounts to add to the post. For an account already in the post, only the fields you send change: omitted fields keep their current value and a field sent as null is removed. Existing accounts left out of this array stay unchanged; remove an account through the account-specific delete endpoint.'\n })),\n publishNow: z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Publish an existing draft immediately. Cannot be combined with scheduledAt.'\n }))\n}).register(z.globalRegistry, {\n description: 'Update a draft or scheduled post. Published and publishing posts cannot be updated. Only the fields you send change; everything you leave out keeps its current value. To remove an account setting, or an account\\'s own text, media or thumbnail timestamp, send it as null. Media behavior is explicit: omit mediaIds to keep existing media unchanged, provide mediaIds to replace all current media, or provide an empty mediaIds array to remove all media. The post that results from the update is validated as a whole before anything is saved.'\n});\n\nexport const zSuccessMessage = z.object({\n deleted: z.literal(true),\n id: z.uuid()\n});\n\nexport const zAccount = z.object({\n id: z.uuid().register(z.globalRegistry, {\n description: 'Unique social account identifier in PublishQ.'\n }),\n platform: z.intersection(zSocialPlatform, z.unknown().register(z.globalRegistry, {\n description: 'Social platform that this connected account belongs to.'\n })),\n platformName: z.nullish(z.string()),\n platformUsername: z.string().register(z.globalRegistry, {\n description: 'Primary username or handle on the connected social platform.'\n }),\n platformUserId: z.string().register(z.globalRegistry, {\n description: 'Unique user or channel identifier provided by the social platform.'\n }),\n platformPicture: z.nullish(z.string()),\n workspaceId: z.nullish(z.uuid())\n});\n\nexport const zAccountsResponse = z.object({\n accounts: z.array(zAccount).register(z.globalRegistry, {\n description: 'Connected social accounts visible to the authenticated API key.'\n })\n});\n\nexport const zWorkspace = z.object({\n id: z.uuid().register(z.globalRegistry, {\n description: 'Unique workspace identifier in PublishQ.'\n }),\n name: z.string().register(z.globalRegistry, {\n description: 'Workspace name shown in the PublishQ UI.'\n }),\n description: z.nullish(z.string()),\n color: z.string().register(z.globalRegistry, {\n description: 'Workspace accent color in hex format.'\n }),\n accountCount: z.int().register(z.globalRegistry, {\n description: 'Number of social accounts assigned to this workspace.'\n }),\n createdAt: z.iso.datetime().register(z.globalRegistry, {\n description: 'When the workspace was created.'\n })\n});\n\n/**\n * Create a new workspace.\n */\nexport const zCreateWorkspaceRequest = z.object({\n name: z.string().check(z.minLength(1), z.maxLength(50)).register(z.globalRegistry, {\n description: 'Workspace name shown in PublishQ.'\n }),\n description: z.optional(z.string().check(z.maxLength(500)).register(z.globalRegistry, {\n description: 'Optional short description of the workspace.'\n })),\n color: z._default(z.optional(z.string().check(z.regex(/^#[0-9A-Fa-f]{6}$/)).register(z.globalRegistry, {\n description: 'Workspace accent color as a hex string like `#6366f1`.'\n })), '#6366f1')\n}).register(z.globalRegistry, {\n description: 'Create a new workspace.'\n});\n\nexport const zWorkspacesResponse = z.object({\n workspaces: z.array(zWorkspace).register(z.globalRegistry, {\n description: 'Workspaces visible to the authenticated API key owner.'\n })\n});\n\n/**\n * Media file type.\n */\nexport const zMediaType = z.enum(['IMAGE', 'VIDEO']).register(z.globalRegistry, {\n description: 'Media file type.'\n});\n\n/**\n * How the media was created: uploaded by the user, generated inside PublishQ, or AI-generated inside PublishQ.\n */\nexport const zMediaSource = z.enum([\n 'UPLOAD',\n 'GENERATED',\n 'AI_GENERATED'\n]).register(z.globalRegistry, {\n description: 'How the media was created: uploaded by the user, generated inside PublishQ, or AI-generated inside PublishQ.'\n});\n\nexport const zMedia = z.object({\n id: z.uuid().register(z.globalRegistry, {\n description: 'Unique media identifier in PublishQ.'\n }),\n type: zMediaType,\n url: z.url().register(z.globalRegistry, {\n description: 'Direct URL to the uploaded or generated media file.'\n }),\n source: zMediaSource,\n created_at: z.iso.datetime().register(z.globalRegistry, {\n description: 'When the media item was created in PublishQ.'\n }),\n usageCount: z.int().register(z.globalRegistry, {\n description: 'Number of posts this media item was used in.'\n })\n});\n\nexport const zMediaListResponse = z.object({\n media: z.array(zMedia),\n pagination: zPagination\n});\n\nexport const zUploadMediaRequest = z.object({\n file: z.string()\n});\n\nexport const zCreateMediaUploadRequest = z.object({\n filename: z.string().check(z.minLength(1), z.maxLength(1024)).register(z.globalRegistry, {\n description: 'Name of the file you are uploading.'\n }),\n contentType: z.string().check(z.minLength(1)).register(z.globalRegistry, {\n description: 'Content type of the file. One of: image/jpeg, image/png, image/gif, image/webp, video/mp4, video/webm, video/quicktime, video/x-msvideo.'\n }),\n fileSize: z.int().check(z.gt(0)).register(z.globalRegistry, {\n description: 'Exact size of the file in bytes. Your plan\\'s file size limit and your storage are checked before you upload, and storage refuses a file of any other size. Each platform\\'s own size limits are checked when you attach the media to a post.'\n })\n});\n\nexport const zMediaUpload = z.object({\n id: z.uuid().register(z.globalRegistry, {\n description: 'Media ID of the file. Attach it to posts through mediaIds once the file is uploaded.'\n }),\n uploadUrl: z.url().register(z.globalRegistry, {\n description: 'Signed storage URL. PUT the file to it with the same Content-Type. It goes to storage, not to the PublishQ API, so send no Authorization header.'\n }),\n expiresAt: z.iso.datetime().register(z.globalRegistry, {\n description: 'When uploadUrl stops accepting the file, 1 hour after it is created.'\n })\n});\n\nexport const zTikTokCreatorInfoResponse = z.object({\n privacyLevelOptions: z.array(z.string()).register(z.globalRegistry, {\n description: 'Privacy levels available for this account. Use one of these values as `privacyLevel` in `platformSpecificSettings`.'\n }),\n commentDisabled: z.boolean().register(z.globalRegistry, {\n description: 'True if the creator has disabled comments at the account level.'\n }),\n duetDisabled: z.boolean().register(z.globalRegistry, {\n description: 'True if the creator has disabled Duets at the account level.'\n }),\n stitchDisabled: z.boolean().register(z.globalRegistry, {\n description: 'True if the creator has disabled Stitches at the account level.'\n }),\n maxVideoPostDurationSec: z.number().register(z.globalRegistry, {\n description: 'Maximum video duration in seconds this creator can post (typically 180, 300, or 600).'\n })\n});\n\nexport const zApiKeyScope = z.enum([\n 'posts:read',\n 'posts:write',\n 'accounts:read',\n 'workspaces:read',\n 'workspaces:write',\n 'media:read',\n 'media:write'\n]);\n\nexport const zListPostsQuery = z.object({\n page: z._default(z.optional(z.int().check(z.gt(0)).register(z.globalRegistry, {\n description: 'Page number (starts from 1).'\n })), 1),\n limit: z._default(z.optional(z.int().check(z.gt(0), z.lte(100)).register(z.globalRegistry, {\n description: 'Page size. Max 100.'\n })), 20),\n includeImported: z._default(z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Also return posts imported from a connected platform (posts with source IMPORTED). Defaults to false: only posts created through PublishQ are returned.'\n })), false),\n onlyImported: z._default(z.optional(z.boolean().register(z.globalRegistry, {\n description: 'Return ONLY posts imported from a connected platform. Cannot be combined with includeImported.'\n })), false)\n});\n\n/**\n * Posts retrieved successfully\n */\nexport const zListPostsResponse = zPostsResponse;\n\nexport const zCreatePostBody = zCreatePostRequest;\n\n/**\n * Posts created successfully\n */\nexport const zCreatePostResponse = zPost;\n\nexport const zDeletePostPath = z.object({\n id: z.uuid()\n});\n\n/**\n * Post deleted successfully\n */\nexport const zDeletePostResponse = z.void().register(z.globalRegistry, {\n description: 'Post deleted successfully'\n});\n\nexport const zGetPostPath = z.object({\n id: z.uuid()\n});\n\n/**\n * Post retrieved successfully\n */\nexport const zGetPostResponse = zPost;\n\nexport const zUpdatePostBody = zUpdatePostRequest;\n\nexport const zUpdatePostPath = z.object({\n id: z.uuid()\n});\n\n/**\n * Post updated successfully\n */\nexport const zUpdatePostResponse = zPost;\n\nexport const zRemovePostAccountPath = z.object({\n id: z.uuid(),\n accountId: z.uuid()\n});\n\n/**\n * Account removed from post successfully\n */\nexport const zRemovePostAccountResponse = z.void().register(z.globalRegistry, {\n description: 'Account removed from post successfully'\n});\n\nexport const zListAccountsQuery = z.object({\n workspaceId: z.optional(z.uuid().register(z.globalRegistry, {\n description: 'Return only accounts assigned to the specified workspace. If omitted, accounts from all workspaces are returned.'\n })),\n platform: z.optional(z.array(zSocialPlatform).register(z.globalRegistry, {\n description: 'Return only accounts connected to the specified social platforms. Repeat the parameter to apply OR logic, for example `?platform=twitter&platform=instagram`.'\n }))\n});\n\n/**\n * Accounts retrieved successfully\n */\nexport const zListAccountsResponse = zAccountsResponse;\n\nexport const zGetTikTokCreatorInfoPath = z.object({\n id: z.uuid()\n});\n\n/**\n * Creator info retrieved successfully\n */\nexport const zGetTikTokCreatorInfoResponse = zTikTokCreatorInfoResponse;\n\n/**\n * Workspaces retrieved successfully\n */\nexport const zListWorkspacesResponse = zWorkspacesResponse;\n\nexport const zCreateWorkspaceBody = zCreateWorkspaceRequest;\n\n/**\n * Workspace created successfully\n */\nexport const zCreateWorkspaceResponse = zWorkspace;\n\nexport const zGetWorkspacePath = z.object({\n id: z.uuid()\n});\n\n/**\n * Workspace retrieved successfully\n */\nexport const zGetWorkspaceResponse = zWorkspace;\n\nexport const zListMediaQuery = z.object({\n page: z._default(z.optional(z.int().check(z.gt(0)).register(z.globalRegistry, {\n description: 'Page number (starts from 1).'\n })), 1),\n limit: z._default(z.optional(z.int().check(z.gt(0), z.lte(100)).register(z.globalRegistry, {\n description: 'Page size. Max 100.'\n })), 20),\n ids: z.optional(z.array(z.uuid()).register(z.globalRegistry, {\n description: 'Return only the specified media IDs. Repeat the parameter to apply OR logic, for example `?ids=id1&ids=id2`.'\n })),\n mediaTypes: z.optional(z.array(zMediaType).register(z.globalRegistry, {\n description: 'Return only media items of the specified types. Repeat the parameter to apply OR logic, for example `?mediaTypes=image&mediaTypes=video`.'\n })),\n sources: z.optional(z.array(zMediaSource).register(z.globalRegistry, {\n description: 'Return only media items from the specified sources. Repeat the parameter to apply OR logic, for example `?sources=upload&sources=ai_generated`.'\n }))\n});\n\n/**\n * Media retrieved successfully\n */\nexport const zListMediaResponse = zMediaListResponse;\n\nexport const zUploadMediaBody = zUploadMediaRequest;\n\n/**\n * Media uploaded successfully\n */\nexport const zUploadMediaResponse = zMedia;\n\nexport const zGetMediaPath = z.object({\n id: z.uuid()\n});\n\n/**\n * Media retrieved successfully\n */\nexport const zGetMediaResponse = zMedia;\n\nexport const zCreateMediaUploadBody = zCreateMediaUploadRequest;\n\n/**\n * Upload created. Send the file to uploadUrl next.\n */\nexport const zCreateMediaUploadResponse = zMediaUpload;\n\nexport const zCompleteMediaUploadPath = z.object({\n id: z.uuid()\n});\n\n/**\n * The file is in your media library\n */\nexport const zCompleteMediaUploadResponse = zMedia;\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;AAAA;AAAA;AAAA;AAAA;;;ACsBA,IAAM,wBAAwB,CAAC,MAAgB,KAAa,UAAyB;AACnF,MAAI,OAAO,UAAU,YAAY,iBAAiB,MAAM;AACtD,SAAK,OAAO,KAAK,KAAK;AAAA,EACxB,WAAW,iBAAi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