@silverfish-app/sdk 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1008,6 +1008,36 @@ var Sdk = class _Sdk extends HeyApiClient {
1008
1008
  }
1009
1009
  });
1010
1010
  }
1011
+ /**
1012
+ * Get Config
1013
+ *
1014
+ * Return the requested config values (None when unset).
1015
+ *
1016
+ * Only known keys are returned; secret keys (the SMTP password) read back as a
1017
+ * masked placeholder when set, never their value.
1018
+ */
1019
+ getConfig(options) {
1020
+ return (options.client ?? this.client).get({ url: "/config", ...options });
1021
+ }
1022
+ /**
1023
+ * Set Config
1024
+ *
1025
+ * Set one or more config values and return their (masked) readback.
1026
+ *
1027
+ * Only the provided keys change; others are untouched, so a UI can edit just
1028
+ * ``kindle_email`` without resending SMTP. Unknown keys → 422. After a write,
1029
+ * the mailer is rebuilt so SMTP changes take effect without a restart.
1030
+ */
1031
+ setConfig(options) {
1032
+ return (options.client ?? this.client).post({
1033
+ url: "/config",
1034
+ ...options,
1035
+ headers: {
1036
+ "Content-Type": "application/json",
1037
+ ...options.headers
1038
+ }
1039
+ });
1040
+ }
1011
1041
  /**
1012
1042
  * Get Email Config
1013
1043
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/bodySerializer.gen.ts","../src/core/serverSentEvents.gen.ts","../src/core/pathSerializer.gen.ts","../src/core/utils.gen.ts","../src/core/auth.gen.ts","../src/client/utils.gen.ts","../src/client/client.gen.ts","../src/client.gen.ts","../src/sdk.gen.ts"],"names":["joinedValues","config","request","url"],"mappings":";;;AAsBA,IAAM,qBAAA,GAAwB,CAAC,IAAA,EAAgB,GAAA,EAAa,KAAA,KAAyB;AACnF,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,YAAiB,IAAA,EAAM;AACtD,IAAA,IAAA,CAAK,MAAA,CAAO,KAAK,KAAK,CAAA;AAAA,EACxB,CAAA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A,EAC9I;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaO,YAAkD,OAAA,EAAwH;AAC7K,IAAA,OAAA,CAAQ,OAAA,EAAS,MAAA,IAAU,IAAA,CAAK,MAAA,EAAQ,GAAA,CAA2D,EAAE,GAAA,EAAK,SAAA,EAAW,GAAG,OAAA,EAAS,CAAA;AAAA,EACrI;AACJ","file":"index.cjs","sourcesContent":["// 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\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>());\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 { ConvertBookData, ConvertBookErrors, ConvertBookResponses, DeleteBookData, DeleteBookErrors, DeleteBookFormatData, DeleteBookFormatErrors, DeleteBookFormatResponses, DeleteBookResponses, DownloadBookFormatData, DownloadBookFormatErrors, DownloadBookFormatResponses, DownloadExportData, DownloadExportErrors, DownloadExportResponses, GetBookCoverData, GetBookCoverErrors, GetBookCoverResponses, GetBookData, GetBookErrors, GetBookResponses, GetEmailConfigData, GetEmailConfigErrors, GetEmailConfigResponses, GetJobData, GetJobErrors, GetJobResponses, HealthData, HealthErrors, HealthResponses, ListBooksData, ListBooksErrors, ListBooksResponses, RefreshMetadataData, RefreshMetadataErrors, RefreshMetadataResponses, SearchBooksData, SearchBooksErrors, SearchBooksResponses, SendBookData, SendBookErrors, SendBookResponses, StartExportData, StartExportErrors, StartExportResponses, StreamJobData, StreamJobErrors, StreamJobResponses, TestEmailConfigData, TestEmailConfigErrors, TestEmailConfigResponses, UpdateBookData, UpdateBookErrors, UpdateBookResponses, UploadBookData, UploadBookErrors, UploadBookResponses } 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\nclass HeyApiClient {\n protected client: Client;\n \n constructor(args?: {\n client?: Client;\n }) {\n this.client = args?.client ?? client;\n }\n}\n\nclass HeyApiRegistry<T> {\n private readonly defaultKey = 'default';\n \n private readonly instances: Map<string, T> = new Map();\n \n get(key?: string): T {\n const instance = this.instances.get(key ?? this.defaultKey);\n if (!instance) {\n throw new Error(`No SDK client found. Create one with \"new Sdk()\" to fix this error.`);\n }\n return instance;\n }\n \n set(value: T, key?: string): void {\n this.instances.set(key ?? this.defaultKey, value);\n }\n}\n\nexport class Sdk extends HeyApiClient {\n public static readonly __registry: HeyApiRegistry<Sdk> = new HeyApiRegistry<Sdk>();\n \n constructor(args?: {\n client?: Client;\n key?: string;\n }) {\n super(args);\n Sdk.__registry.set(this, args?.key);\n }\n \n /**\n * List Books\n *\n * List books, paginated and sorted.\n *\n * Returns a page of books controlled by `page` and `page_size`, ordered by\n * `sort` field in the given `direction`. Out-of-range pagination values are\n * rejected with `422`.\n */\n public listBooks<ThrowOnError extends boolean = false>(options?: Options<ListBooksData, ThrowOnError>): RequestResult<ListBooksResponses, ListBooksErrors, ThrowOnError> {\n return (options?.client ?? this.client).get<ListBooksResponses, ListBooksErrors, ThrowOnError>({ url: '/books', ...options });\n }\n \n /**\n * Upload Book\n *\n * Upload a book file and create a new book.\n *\n * Accepts a multipart `file` whose extension must be one of the allowed\n * upload formats; metadata is extracted from the file on import. Returns the\n * created book with `201`, `400` if the file is rejected (unsupported\n * extension or unreadable content), or `413` if it exceeds the upload size\n * limit.\n */\n public uploadBook<ThrowOnError extends boolean = false>(options: Options<UploadBookData, ThrowOnError>): RequestResult<UploadBookResponses, UploadBookErrors, ThrowOnError> {\n return (options.client ?? this.client).post<UploadBookResponses, UploadBookErrors, ThrowOnError>({\n ...formDataBodySerializer,\n url: '/books',\n ...options,\n headers: {\n 'Content-Type': null,\n ...options.headers\n }\n });\n }\n \n /**\n * Delete Book\n *\n * Delete a book and all of its files.\n *\n * Removes the book identified by `book_id` along with its stored formats and\n * cover, returning `204` with no body on success. Responds with `404` when the\n * book does not exist.\n */\n public deleteBook<ThrowOnError extends boolean = false>(options: Options<DeleteBookData, ThrowOnError>): RequestResult<DeleteBookResponses, DeleteBookErrors, ThrowOnError> {\n return (options.client ?? this.client).delete<DeleteBookResponses, DeleteBookErrors, ThrowOnError>({ url: '/books/{book_id}', ...options });\n }\n \n /**\n * Get Book\n *\n * Get a single book by its public id.\n *\n * Looks up the book identified by `book_id` (the book's public id) and returns\n * its full metadata. Responds with `404` when no such book exists.\n */\n public getBook<ThrowOnError extends boolean = false>(options: Options<GetBookData, ThrowOnError>): RequestResult<GetBookResponses, GetBookErrors, ThrowOnError> {\n return (options.client ?? this.client).get<GetBookResponses, GetBookErrors, ThrowOnError>({ url: '/books/{book_id}', ...options });\n }\n \n /**\n * Update Book\n *\n * Partially update a book's metadata.\n *\n * Applies only the fields explicitly set in the request body, leaving omitted\n * fields untouched, and returns the updated book. Responds with `400` when the\n * patch is empty or violates a domain rule (e.g. an out-of-range `rating`),\n * and `404` when the book does not exist.\n */\n public updateBook<ThrowOnError extends boolean = false>(options: Options<UpdateBookData, ThrowOnError>): RequestResult<UpdateBookResponses, UpdateBookErrors, ThrowOnError> {\n return (options.client ?? this.client).patch<UpdateBookResponses, UpdateBookErrors, ThrowOnError>({\n url: '/books/{book_id}',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Convert Book\n *\n * Convert a book to another format.\n *\n * Enqueues a background conversion to `target_format`, optionally from an\n * explicit `source_format` (otherwise the best available source is chosen), and\n * returns `202` with a job to poll at `/jobs/{id}`. Responds with `404` if the\n * book is missing, `503` if `ebook-convert` is unavailable, `409` if the target\n * format already exists or an identical conversion is already in progress, and\n * `400` if no suitable source format is available.\n */\n public convertBook<ThrowOnError extends boolean = false>(options: Options<ConvertBookData, ThrowOnError>): RequestResult<ConvertBookResponses, ConvertBookErrors, ThrowOnError> {\n return (options.client ?? this.client).post<ConvertBookResponses, ConvertBookErrors, ThrowOnError>({\n url: '/books/{book_id}/convert',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Get Book Cover\n *\n * Download a book's cover image.\n *\n * Returns the cover bytes as `image/jpeg` for the book identified by\n * `book_id`. Responds with `404` when the book has no recorded cover or the\n * cover file is missing from storage.\n */\n public getBookCover<ThrowOnError extends boolean = false>(options: Options<GetBookCoverData, ThrowOnError>): RequestResult<GetBookCoverResponses, GetBookCoverErrors, ThrowOnError> {\n return (options.client ?? this.client).get<GetBookCoverResponses, GetBookCoverErrors, ThrowOnError>({ url: '/books/{book_id}/cover', ...options });\n }\n \n /**\n * Delete Book Format\n *\n * Delete one format of a book.\n *\n * Removes the file for the given `book_format` of the book identified by\n * `book_id`, returning `204` with no body on success. Responds with `404` when\n * the book does not exist or it has no such format.\n */\n public deleteBookFormat<ThrowOnError extends boolean = false>(options: Options<DeleteBookFormatData, ThrowOnError>): RequestResult<DeleteBookFormatResponses, DeleteBookFormatErrors, ThrowOnError> {\n return (options.client ?? this.client).delete<DeleteBookFormatResponses, DeleteBookFormatErrors, ThrowOnError>({ url: '/books/{book_id}/formats/{book_format}', ...options });\n }\n \n /**\n * Download Book Format\n *\n * Download one format of a book.\n *\n * Returns the file for the given `book_format` of the book identified by\n * `book_id` as an `application/octet-stream` attachment, with the stored\n * filename in the `Content-Disposition` header. Responds with `404` when the\n * book lacks that format or the file is missing from storage.\n */\n public downloadBookFormat<ThrowOnError extends boolean = false>(options: Options<DownloadBookFormatData, ThrowOnError>): RequestResult<DownloadBookFormatResponses, DownloadBookFormatErrors, ThrowOnError> {\n return (options.client ?? this.client).get<DownloadBookFormatResponses, DownloadBookFormatErrors, ThrowOnError>({ url: '/books/{book_id}/formats/{book_format}', ...options });\n }\n \n /**\n * Refresh Metadata\n *\n * Re-extract metadata from a book file and return the updated book.\n *\n * Reads metadata afresh from the book's `source_format` file and merges it in:\n * fields the extraction produced replace the current ones, fields it could not\n * read are kept. Responds with `404` when the book or requested format is not\n * found, and `400` for any other refresh failure.\n */\n public refreshMetadata<ThrowOnError extends boolean = false>(options: Options<RefreshMetadataData, ThrowOnError>): RequestResult<RefreshMetadataResponses, RefreshMetadataErrors, ThrowOnError> {\n return (options.client ?? this.client).post<RefreshMetadataResponses, RefreshMetadataErrors, ThrowOnError>({\n url: '/books/{book_id}/refresh-metadata',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Send Book\n *\n * Email a book to a recipient.\n *\n * Enqueues a background job to send the book to `to_email` in the requested\n * `format` (or the best available sendable format if unspecified), and returns\n * `202` with a job to poll at `/jobs/{id}`. Responds with `404` if the book is\n * missing, `503` if SMTP is not configured, and `400` if the book has no\n * matching or sendable format.\n */\n public sendBook<ThrowOnError extends boolean = false>(options: Options<SendBookData, ThrowOnError>): RequestResult<SendBookResponses, SendBookErrors, ThrowOnError> {\n return (options.client ?? this.client).post<SendBookResponses, SendBookErrors, ThrowOnError>({\n url: '/books/{book_id}/send',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Get Email Config\n *\n * Return the non-secret SMTP settings for display.\n *\n * Reports whether SMTP is `configured` along with `host`, `port`,\n * `from_address` (falling back to the username when no explicit from is set)\n * and `security`. The password is never read or returned.\n */\n public getEmailConfig<ThrowOnError extends boolean = false>(options?: Options<GetEmailConfigData, ThrowOnError>): RequestResult<GetEmailConfigResponses, GetEmailConfigErrors, ThrowOnError> {\n return (options?.client ?? this.client).get<GetEmailConfigResponses, GetEmailConfigErrors, ThrowOnError>({ url: '/config/email', ...options });\n }\n \n /**\n * Test Email Config\n *\n * Send a test email to verify SMTP connectivity.\n *\n * Sends a test message to `to_email` and returns 204 on success. Responds 503\n * if SMTP is not configured, or 502 if the connection, authentication or send\n * fails.\n */\n public testEmailConfig<ThrowOnError extends boolean = false>(options: Options<TestEmailConfigData, ThrowOnError>): RequestResult<TestEmailConfigResponses, TestEmailConfigErrors, ThrowOnError> {\n return (options.client ?? this.client).post<TestEmailConfigResponses, TestEmailConfigErrors, ThrowOnError>({\n url: '/config/email/test',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Start Export\n *\n * Start an async Calibre export; the download link is emailed when ready.\n *\n * Enqueues a background job that snapshots the requested books (or the whole\n * library when `book_ids` is omitted) to a zip and emails a time-limited link\n * to `to_email`, returning 202 with the new job. Responds 503 when export is\n * unavailable (the calibredb binary is missing, SMTP is not configured, or no\n * public base URL is set for an absolute link), and 400 for a malformed book id.\n */\n public startExport<ThrowOnError extends boolean = false>(options: Options<StartExportData, ThrowOnError>): RequestResult<StartExportResponses, StartExportErrors, ThrowOnError> {\n return (options.client ?? this.client).post<StartExportResponses, StartExportErrors, ThrowOnError>({\n url: '/export/calibre',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Download Export\n *\n * Stream a finished export zip for a valid, unexpired token.\n *\n * Served via ``FileResponse``, which streams the file and honours HTTP Range\n * requests, so a large download is memory-light and resumable.\n */\n public downloadExport<ThrowOnError extends boolean = false>(options: Options<DownloadExportData, ThrowOnError>): RequestResult<DownloadExportResponses, DownloadExportErrors, ThrowOnError> {\n return (options.client ?? this.client).get<DownloadExportResponses, DownloadExportErrors, ThrowOnError>({ url: '/export/download/{token}', ...options });\n }\n \n /**\n * Health\n *\n * Report liveness and the availability of optional dependencies.\n *\n * Always returns `status` ``\"ok\"`` and the API `version`, plus the\n * Calibre binary availability (`convert_available`, `metadata_available`)\n * and whether send-to-ereader is usable (`send_available`, true when SMTP\n * is configured).\n */\n public health<ThrowOnError extends boolean = false>(options?: Options<HealthData, ThrowOnError>): RequestResult<HealthResponses, HealthErrors, ThrowOnError> {\n return (options?.client ?? this.client).get<HealthResponses, HealthErrors, ThrowOnError>({ url: '/health', ...options });\n }\n \n /**\n * Get Job\n *\n * Return the current status and progress of a single job.\n *\n * Looks up the job by `job_id` and returns its latest state for one-shot\n * polling. Responds 404 if no job with that id exists; use `/jobs/{job_id}/stream`\n * instead to follow progress live.\n */\n public getJob<ThrowOnError extends boolean = false>(options: Options<GetJobData, ThrowOnError>): RequestResult<GetJobResponses, GetJobErrors, ThrowOnError> {\n return (options.client ?? this.client).get<GetJobResponses, GetJobErrors, ThrowOnError>({ url: '/jobs/{job_id}', ...options });\n }\n \n /**\n * Stream Job\n *\n * Stream a job's status/progress as Server-Sent Events until it finishes.\n *\n * One open connection replaces repeated polling. Updates are event-driven: the\n * stream blocks (in a threadpool, so the event loop stays free) until the job\n * actually changes, then emits — so it reflects each new binary output, not a\n * fixed tick.\n */\n public streamJob<ThrowOnError extends boolean = false>(options: Options<StreamJobData, ThrowOnError>): RequestResult<StreamJobResponses, StreamJobErrors, ThrowOnError> {\n return (options.client ?? this.client).get<StreamJobResponses, StreamJobErrors, ThrowOnError>({ url: '/jobs/{job_id}/stream', ...options });\n }\n \n /**\n * Search Books\n *\n * Search books by a text query and filters.\n *\n * Returns a paginated page of books whose title, author, series or tags match\n * the query `q` (case-insensitive substring match), narrowed by the optional\n * `include_tags`, `exclude_tags`, `languages`, `formats`, and\n * `rating_min`/`rating_max` filters. Out-of-range pagination or rating values\n * are rejected with `422`.\n */\n public searchBooks<ThrowOnError extends boolean = false>(options?: Options<SearchBooksData, ThrowOnError>): RequestResult<SearchBooksResponses, SearchBooksErrors, ThrowOnError> {\n return (options?.client ?? this.client).get<SearchBooksResponses, SearchBooksErrors, ThrowOnError>({ url: '/search', ...options });\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/core/bodySerializer.gen.ts","../src/core/serverSentEvents.gen.ts","../src/core/pathSerializer.gen.ts","../src/core/utils.gen.ts","../src/core/auth.gen.ts","../src/client/utils.gen.ts","../src/client/client.gen.ts","../src/client.gen.ts","../src/sdk.gen.ts"],"names":["joinedValues","config","request","url"],"mappings":";;;AAsBA,IAAM,qBAAA,GAAwB,CAAC,IAAA,EAAgB,GAAA,EAAa,KAA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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYO,OAA6C,OAAA,EAAyG;AACzJ,IAAA,OAAA,CAAQ,OAAA,EAAS,MAAA,IAAU,IAAA,CAAK,MAAA,EAAQ,GAAA,CAAiD,EAAE,GAAA,EAAK,SAAA,EAAW,GAAG,OAAA,EAAS,CAAA;AAAA,EAC3H;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWO,OAA6C,OAAA,EAAwG;AACxJ,IAAA,OAAA,CAAQ,OAAA,CAAQ,MAAA,IAAU,IAAA,CAAK,MAAA,EAAQ,GAAA,CAAiD,EAAE,GAAA,EAAK,gBAAA,EAAkB,GAAG,OAAA,EAAS,CAAA;AAAA,EACjI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYO,UAAgD,OAAA,EAAiH;AACpK,IAAA,OAAA,CAAQ,OAAA,CAAQ,MAAA,IAAU,IAAA,CAAK,MAAA,EAAQ,GAAA,CAAuD,EAAE,GAAA,EAAK,uBAAA,EAAyB,GAAG,OAAA,EAAS,CAAA;AAAA,EAC9I;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaO,YAAkD,OAAA,EAAwH;AAC7K,IAAA,OAAA,CAAQ,OAAA,EAAS,MAAA,IAAU,IAAA,CAAK,MAAA,EAAQ,GAAA,CAA2D,EAAE,GAAA,EAAK,SAAA,EAAW,GAAG,OAAA,EAAS,CAAA;AAAA,EACrI;AACJ","file":"index.cjs","sourcesContent":["// 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\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>());\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 { ConvertBookData, ConvertBookErrors, ConvertBookResponses, DeleteBookData, DeleteBookErrors, DeleteBookFormatData, DeleteBookFormatErrors, DeleteBookFormatResponses, DeleteBookResponses, DownloadBookFormatData, DownloadBookFormatErrors, DownloadBookFormatResponses, DownloadExportData, DownloadExportErrors, DownloadExportResponses, GetBookCoverData, GetBookCoverErrors, GetBookCoverResponses, GetBookData, GetBookErrors, GetBookResponses, GetConfigData, GetConfigErrors, GetConfigResponses, GetEmailConfigData, GetEmailConfigErrors, GetEmailConfigResponses, GetJobData, GetJobErrors, GetJobResponses, HealthData, HealthErrors, HealthResponses, ListBooksData, ListBooksErrors, ListBooksResponses, RefreshMetadataData, RefreshMetadataErrors, RefreshMetadataResponses, SearchBooksData, SearchBooksErrors, SearchBooksResponses, SendBookData, SendBookErrors, SendBookResponses, SetConfigData, SetConfigErrors, SetConfigResponses, StartExportData, StartExportErrors, StartExportResponses, StreamJobData, StreamJobErrors, StreamJobResponses, TestEmailConfigData, TestEmailConfigErrors, TestEmailConfigResponses, UpdateBookData, UpdateBookErrors, UpdateBookResponses, UploadBookData, UploadBookErrors, UploadBookResponses } 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\nclass HeyApiClient {\n protected client: Client;\n \n constructor(args?: {\n client?: Client;\n }) {\n this.client = args?.client ?? client;\n }\n}\n\nclass HeyApiRegistry<T> {\n private readonly defaultKey = 'default';\n \n private readonly instances: Map<string, T> = new Map();\n \n get(key?: string): T {\n const instance = this.instances.get(key ?? this.defaultKey);\n if (!instance) {\n throw new Error(`No SDK client found. Create one with \"new Sdk()\" to fix this error.`);\n }\n return instance;\n }\n \n set(value: T, key?: string): void {\n this.instances.set(key ?? this.defaultKey, value);\n }\n}\n\nexport class Sdk extends HeyApiClient {\n public static readonly __registry: HeyApiRegistry<Sdk> = new HeyApiRegistry<Sdk>();\n \n constructor(args?: {\n client?: Client;\n key?: string;\n }) {\n super(args);\n Sdk.__registry.set(this, args?.key);\n }\n \n /**\n * List Books\n *\n * List books, paginated and sorted.\n *\n * Returns a page of books controlled by `page` and `page_size`, ordered by\n * `sort` field in the given `direction`. Out-of-range pagination values are\n * rejected with `422`.\n */\n public listBooks<ThrowOnError extends boolean = false>(options?: Options<ListBooksData, ThrowOnError>): RequestResult<ListBooksResponses, ListBooksErrors, ThrowOnError> {\n return (options?.client ?? this.client).get<ListBooksResponses, ListBooksErrors, ThrowOnError>({ url: '/books', ...options });\n }\n \n /**\n * Upload Book\n *\n * Upload a book file and create a new book.\n *\n * Accepts a multipart `file` whose extension must be one of the allowed\n * upload formats; metadata is extracted from the file on import. Returns the\n * created book with `201`, `400` if the file is rejected (unsupported\n * extension or unreadable content), or `413` if it exceeds the upload size\n * limit.\n */\n public uploadBook<ThrowOnError extends boolean = false>(options: Options<UploadBookData, ThrowOnError>): RequestResult<UploadBookResponses, UploadBookErrors, ThrowOnError> {\n return (options.client ?? this.client).post<UploadBookResponses, UploadBookErrors, ThrowOnError>({\n ...formDataBodySerializer,\n url: '/books',\n ...options,\n headers: {\n 'Content-Type': null,\n ...options.headers\n }\n });\n }\n \n /**\n * Delete Book\n *\n * Delete a book and all of its files.\n *\n * Removes the book identified by `book_id` along with its stored formats and\n * cover, returning `204` with no body on success. Responds with `404` when the\n * book does not exist.\n */\n public deleteBook<ThrowOnError extends boolean = false>(options: Options<DeleteBookData, ThrowOnError>): RequestResult<DeleteBookResponses, DeleteBookErrors, ThrowOnError> {\n return (options.client ?? this.client).delete<DeleteBookResponses, DeleteBookErrors, ThrowOnError>({ url: '/books/{book_id}', ...options });\n }\n \n /**\n * Get Book\n *\n * Get a single book by its public id.\n *\n * Looks up the book identified by `book_id` (the book's public id) and returns\n * its full metadata. Responds with `404` when no such book exists.\n */\n public getBook<ThrowOnError extends boolean = false>(options: Options<GetBookData, ThrowOnError>): RequestResult<GetBookResponses, GetBookErrors, ThrowOnError> {\n return (options.client ?? this.client).get<GetBookResponses, GetBookErrors, ThrowOnError>({ url: '/books/{book_id}', ...options });\n }\n \n /**\n * Update Book\n *\n * Partially update a book's metadata.\n *\n * Applies only the fields explicitly set in the request body, leaving omitted\n * fields untouched, and returns the updated book. Responds with `400` when the\n * patch is empty or violates a domain rule (e.g. an out-of-range `rating`),\n * and `404` when the book does not exist.\n */\n public updateBook<ThrowOnError extends boolean = false>(options: Options<UpdateBookData, ThrowOnError>): RequestResult<UpdateBookResponses, UpdateBookErrors, ThrowOnError> {\n return (options.client ?? this.client).patch<UpdateBookResponses, UpdateBookErrors, ThrowOnError>({\n url: '/books/{book_id}',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Convert Book\n *\n * Convert a book to another format.\n *\n * Enqueues a background conversion to `target_format`, optionally from an\n * explicit `source_format` (otherwise the best available source is chosen), and\n * returns `202` with a job to poll at `/jobs/{id}`. Responds with `404` if the\n * book is missing, `503` if `ebook-convert` is unavailable, `409` if the target\n * format already exists or an identical conversion is already in progress, and\n * `400` if no suitable source format is available.\n */\n public convertBook<ThrowOnError extends boolean = false>(options: Options<ConvertBookData, ThrowOnError>): RequestResult<ConvertBookResponses, ConvertBookErrors, ThrowOnError> {\n return (options.client ?? this.client).post<ConvertBookResponses, ConvertBookErrors, ThrowOnError>({\n url: '/books/{book_id}/convert',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Get Book Cover\n *\n * Download a book's cover image.\n *\n * Returns the cover bytes as `image/jpeg` for the book identified by\n * `book_id`. Responds with `404` when the book has no recorded cover or the\n * cover file is missing from storage.\n */\n public getBookCover<ThrowOnError extends boolean = false>(options: Options<GetBookCoverData, ThrowOnError>): RequestResult<GetBookCoverResponses, GetBookCoverErrors, ThrowOnError> {\n return (options.client ?? this.client).get<GetBookCoverResponses, GetBookCoverErrors, ThrowOnError>({ url: '/books/{book_id}/cover', ...options });\n }\n \n /**\n * Delete Book Format\n *\n * Delete one format of a book.\n *\n * Removes the file for the given `book_format` of the book identified by\n * `book_id`, returning `204` with no body on success. Responds with `404` when\n * the book does not exist or it has no such format.\n */\n public deleteBookFormat<ThrowOnError extends boolean = false>(options: Options<DeleteBookFormatData, ThrowOnError>): RequestResult<DeleteBookFormatResponses, DeleteBookFormatErrors, ThrowOnError> {\n return (options.client ?? this.client).delete<DeleteBookFormatResponses, DeleteBookFormatErrors, ThrowOnError>({ url: '/books/{book_id}/formats/{book_format}', ...options });\n }\n \n /**\n * Download Book Format\n *\n * Download one format of a book.\n *\n * Returns the file for the given `book_format` of the book identified by\n * `book_id` as an `application/octet-stream` attachment, with the stored\n * filename in the `Content-Disposition` header. Responds with `404` when the\n * book lacks that format or the file is missing from storage.\n */\n public downloadBookFormat<ThrowOnError extends boolean = false>(options: Options<DownloadBookFormatData, ThrowOnError>): RequestResult<DownloadBookFormatResponses, DownloadBookFormatErrors, ThrowOnError> {\n return (options.client ?? this.client).get<DownloadBookFormatResponses, DownloadBookFormatErrors, ThrowOnError>({ url: '/books/{book_id}/formats/{book_format}', ...options });\n }\n \n /**\n * Refresh Metadata\n *\n * Re-extract metadata from a book file and return the updated book.\n *\n * Reads metadata afresh from the book's `source_format` file and merges it in:\n * fields the extraction produced replace the current ones, fields it could not\n * read are kept. Responds with `404` when the book or requested format is not\n * found, and `400` for any other refresh failure.\n */\n public refreshMetadata<ThrowOnError extends boolean = false>(options: Options<RefreshMetadataData, ThrowOnError>): RequestResult<RefreshMetadataResponses, RefreshMetadataErrors, ThrowOnError> {\n return (options.client ?? this.client).post<RefreshMetadataResponses, RefreshMetadataErrors, ThrowOnError>({\n url: '/books/{book_id}/refresh-metadata',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Send Book\n *\n * Email a book to a recipient.\n *\n * Enqueues a background job to send the book to `to_email` in the requested\n * `format` (or the best available sendable format if unspecified), and returns\n * `202` with a job to poll at `/jobs/{id}`. Responds with `404` if the book is\n * missing, `503` if SMTP is not configured, and `400` if the book has no\n * matching or sendable format.\n */\n public sendBook<ThrowOnError extends boolean = false>(options: Options<SendBookData, ThrowOnError>): RequestResult<SendBookResponses, SendBookErrors, ThrowOnError> {\n return (options.client ?? this.client).post<SendBookResponses, SendBookErrors, ThrowOnError>({\n url: '/books/{book_id}/send',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Get Config\n *\n * Return the requested config values (None when unset).\n *\n * Only known keys are returned; secret keys (the SMTP password) read back as a\n * masked placeholder when set, never their value.\n */\n public getConfig<ThrowOnError extends boolean = false>(options: Options<GetConfigData, ThrowOnError>): RequestResult<GetConfigResponses, GetConfigErrors, ThrowOnError> {\n return (options.client ?? this.client).get<GetConfigResponses, GetConfigErrors, ThrowOnError>({ url: '/config', ...options });\n }\n \n /**\n * Set Config\n *\n * Set one or more config values and return their (masked) readback.\n *\n * Only the provided keys change; others are untouched, so a UI can edit just\n * ``kindle_email`` without resending SMTP. Unknown keys → 422. After a write,\n * the mailer is rebuilt so SMTP changes take effect without a restart.\n */\n public setConfig<ThrowOnError extends boolean = false>(options: Options<SetConfigData, ThrowOnError>): RequestResult<SetConfigResponses, SetConfigErrors, ThrowOnError> {\n return (options.client ?? this.client).post<SetConfigResponses, SetConfigErrors, ThrowOnError>({\n url: '/config',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Get Email Config\n *\n * Return the non-secret SMTP settings for display.\n *\n * Reports whether SMTP is `configured` along with `host`, `port`,\n * `from_address` (falling back to the username when no explicit from is set)\n * and `security`. The password is never read or returned.\n */\n public getEmailConfig<ThrowOnError extends boolean = false>(options?: Options<GetEmailConfigData, ThrowOnError>): RequestResult<GetEmailConfigResponses, GetEmailConfigErrors, ThrowOnError> {\n return (options?.client ?? this.client).get<GetEmailConfigResponses, GetEmailConfigErrors, ThrowOnError>({ url: '/config/email', ...options });\n }\n \n /**\n * Test Email Config\n *\n * Send a test email to verify SMTP connectivity.\n *\n * Sends a test message to `to_email` and returns 204 on success. Responds 503\n * if SMTP is not configured, or 502 if the connection, authentication or send\n * fails.\n */\n public testEmailConfig<ThrowOnError extends boolean = false>(options: Options<TestEmailConfigData, ThrowOnError>): RequestResult<TestEmailConfigResponses, TestEmailConfigErrors, ThrowOnError> {\n return (options.client ?? this.client).post<TestEmailConfigResponses, TestEmailConfigErrors, ThrowOnError>({\n url: '/config/email/test',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Start Export\n *\n * Start an async Calibre export; the download link is emailed when ready.\n *\n * Enqueues a background job that snapshots the requested books (or the whole\n * library when `book_ids` is omitted) to a zip and emails a time-limited link\n * to `to_email`, returning 202 with the new job. Responds 503 when export is\n * unavailable (the calibredb binary is missing, SMTP is not configured, or no\n * public base URL is set for an absolute link), and 400 for a malformed book id.\n */\n public startExport<ThrowOnError extends boolean = false>(options: Options<StartExportData, ThrowOnError>): RequestResult<StartExportResponses, StartExportErrors, ThrowOnError> {\n return (options.client ?? this.client).post<StartExportResponses, StartExportErrors, ThrowOnError>({\n url: '/export/calibre',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Download Export\n *\n * Stream a finished export zip for a valid, unexpired token.\n *\n * Served via ``FileResponse``, which streams the file and honours HTTP Range\n * requests, so a large download is memory-light and resumable.\n */\n public downloadExport<ThrowOnError extends boolean = false>(options: Options<DownloadExportData, ThrowOnError>): RequestResult<DownloadExportResponses, DownloadExportErrors, ThrowOnError> {\n return (options.client ?? this.client).get<DownloadExportResponses, DownloadExportErrors, ThrowOnError>({ url: '/export/download/{token}', ...options });\n }\n \n /**\n * Health\n *\n * Report liveness and the availability of optional dependencies.\n *\n * Always returns `status` ``\"ok\"`` and the API `version`, plus the\n * Calibre binary availability (`convert_available`, `metadata_available`)\n * and whether send-to-ereader is usable (`send_available`, true when SMTP\n * is configured).\n */\n public health<ThrowOnError extends boolean = false>(options?: Options<HealthData, ThrowOnError>): RequestResult<HealthResponses, HealthErrors, ThrowOnError> {\n return (options?.client ?? this.client).get<HealthResponses, HealthErrors, ThrowOnError>({ url: '/health', ...options });\n }\n \n /**\n * Get Job\n *\n * Return the current status and progress of a single job.\n *\n * Looks up the job by `job_id` and returns its latest state for one-shot\n * polling. Responds 404 if no job with that id exists; use `/jobs/{job_id}/stream`\n * instead to follow progress live.\n */\n public getJob<ThrowOnError extends boolean = false>(options: Options<GetJobData, ThrowOnError>): RequestResult<GetJobResponses, GetJobErrors, ThrowOnError> {\n return (options.client ?? this.client).get<GetJobResponses, GetJobErrors, ThrowOnError>({ url: '/jobs/{job_id}', ...options });\n }\n \n /**\n * Stream Job\n *\n * Stream a job's status/progress as Server-Sent Events until it finishes.\n *\n * One open connection replaces repeated polling. Updates are event-driven: the\n * stream blocks (in a threadpool, so the event loop stays free) until the job\n * actually changes, then emits — so it reflects each new binary output, not a\n * fixed tick.\n */\n public streamJob<ThrowOnError extends boolean = false>(options: Options<StreamJobData, ThrowOnError>): RequestResult<StreamJobResponses, StreamJobErrors, ThrowOnError> {\n return (options.client ?? this.client).get<StreamJobResponses, StreamJobErrors, ThrowOnError>({ url: '/jobs/{job_id}/stream', ...options });\n }\n \n /**\n * Search Books\n *\n * Search books by a text query and filters.\n *\n * Returns a paginated page of books whose title, author, series or tags match\n * the query `q` (case-insensitive substring match), narrowed by the optional\n * `include_tags`, `exclude_tags`, `languages`, `formats`, and\n * `rating_min`/`rating_max` filters. Out-of-range pagination or rating values\n * are rejected with `422`.\n */\n public searchBooks<ThrowOnError extends boolean = false>(options?: Options<SearchBooksData, ThrowOnError>): RequestResult<SearchBooksResponses, SearchBooksErrors, ThrowOnError> {\n return (options?.client ?? this.client).get<SearchBooksResponses, SearchBooksErrors, ThrowOnError>({ url: '/search', ...options });\n }\n}\n"]}
package/dist/index.d.cts CHANGED
@@ -58,6 +58,10 @@ type BookOut = {
58
58
  * Authors
59
59
  */
60
60
  authors: Array<AuthorOut>;
61
+ /**
62
+ * Comment
63
+ */
64
+ comment: string | null;
61
65
  /**
62
66
  * Cover Url
63
67
  */
@@ -204,6 +208,24 @@ type BookUpdate = {
204
208
  */
205
209
  title?: string | null;
206
210
  };
211
+ /**
212
+ * ConfigUpdate
213
+ *
214
+ * Generic config write: a map of allowed keys to their new string values.
215
+ *
216
+ * Only known keys are accepted (SMTP settings + kindle_email). Sending an empty
217
+ * string for a secret key (the SMTP password) clears it.
218
+ */
219
+ type ConfigUpdate = {
220
+ /**
221
+ * Values
222
+ *
223
+ * Config key/value pairs to set. Unknown keys are rejected.
224
+ */
225
+ values: {
226
+ [key: string]: string;
227
+ };
228
+ };
207
229
  /**
208
230
  * ConvertRequest
209
231
  *
@@ -933,6 +955,69 @@ type SendBookResponses = {
933
955
  202: JobOut;
934
956
  };
935
957
  type SendBookResponse = SendBookResponses[keyof SendBookResponses];
958
+ type GetConfigData = {
959
+ body?: never;
960
+ path?: never;
961
+ query: {
962
+ /**
963
+ * Keys
964
+ *
965
+ * Config keys to read. Unknown keys are omitted.
966
+ */
967
+ keys: Array<string>;
968
+ };
969
+ url: '/config';
970
+ };
971
+ type GetConfigErrors = {
972
+ /**
973
+ * Validation Error
974
+ */
975
+ 422: HttpValidationError;
976
+ /**
977
+ * Internal server error
978
+ */
979
+ 500: ErrorResponse;
980
+ };
981
+ type GetConfigError = GetConfigErrors[keyof GetConfigErrors];
982
+ type GetConfigResponses = {
983
+ /**
984
+ * Response Get Config
985
+ *
986
+ * Successful Response
987
+ */
988
+ 200: {
989
+ [key: string]: string | null;
990
+ };
991
+ };
992
+ type GetConfigResponse = GetConfigResponses[keyof GetConfigResponses];
993
+ type SetConfigData = {
994
+ body: ConfigUpdate;
995
+ path?: never;
996
+ query?: never;
997
+ url: '/config';
998
+ };
999
+ type SetConfigErrors = {
1000
+ /**
1001
+ * Validation error
1002
+ */
1003
+ 422: ErrorResponse;
1004
+ /**
1005
+ * Internal server error
1006
+ */
1007
+ 500: ErrorResponse;
1008
+ };
1009
+ type SetConfigError = SetConfigErrors[keyof SetConfigErrors];
1010
+ type SetConfigResponses = {
1011
+ /**
1012
+ * Response Set Config
1013
+ *
1014
+ * Successful Response
1015
+ */
1016
+ 200: {
1017
+ [key: string]: string | null;
1018
+ };
1019
+ };
1020
+ type SetConfigResponse = SetConfigResponses[keyof SetConfigResponses];
936
1021
  type GetEmailConfigData = {
937
1022
  body?: never;
938
1023
  path?: never;
@@ -1342,6 +1427,25 @@ declare class Sdk extends HeyApiClient {
1342
1427
  * matching or sendable format.
1343
1428
  */
1344
1429
  sendBook<ThrowOnError extends boolean = false>(options: Options<SendBookData, ThrowOnError>): RequestResult<SendBookResponses, SendBookErrors, ThrowOnError>;
1430
+ /**
1431
+ * Get Config
1432
+ *
1433
+ * Return the requested config values (None when unset).
1434
+ *
1435
+ * Only known keys are returned; secret keys (the SMTP password) read back as a
1436
+ * masked placeholder when set, never their value.
1437
+ */
1438
+ getConfig<ThrowOnError extends boolean = false>(options: Options<GetConfigData, ThrowOnError>): RequestResult<GetConfigResponses, GetConfigErrors, ThrowOnError>;
1439
+ /**
1440
+ * Set Config
1441
+ *
1442
+ * Set one or more config values and return their (masked) readback.
1443
+ *
1444
+ * Only the provided keys change; others are untouched, so a UI can edit just
1445
+ * ``kindle_email`` without resending SMTP. Unknown keys → 422. After a write,
1446
+ * the mailer is rebuilt so SMTP changes take effect without a restart.
1447
+ */
1448
+ setConfig<ThrowOnError extends boolean = false>(options: Options<SetConfigData, ThrowOnError>): RequestResult<SetConfigResponses, SetConfigErrors, ThrowOnError>;
1345
1449
  /**
1346
1450
  * Get Email Config
1347
1451
  *
@@ -1429,4 +1533,4 @@ declare class Sdk extends HeyApiClient {
1429
1533
  searchBooks<ThrowOnError extends boolean = false>(options?: Options<SearchBooksData, ThrowOnError>): RequestResult<SearchBooksResponses, SearchBooksErrors, ThrowOnError>;
1430
1534
  }
1431
1535
 
1432
- export { type AuthorOut, type BinaryHealthOut, type BodyUploadBook, type BookOut, type BookPage, type BookUpdate, type ClientOptions, type ConvertBookData, type ConvertBookError, type ConvertBookErrors, type ConvertBookResponse, type ConvertBookResponses, type ConvertRequest, type DeleteBookData, type DeleteBookError, type DeleteBookErrors, type DeleteBookFormatData, type DeleteBookFormatError, type DeleteBookFormatErrors, type DeleteBookFormatResponse, type DeleteBookFormatResponses, type DeleteBookResponse, type DeleteBookResponses, type DownloadBookFormatData, type DownloadBookFormatError, type DownloadBookFormatErrors, type DownloadBookFormatResponses, type DownloadExportData, type DownloadExportError, type DownloadExportErrors, type DownloadExportResponses, type EmailConfigOut, type EmailTestRequest, type ErrorBody, type ErrorDetail, type ErrorResponse, type ExportRequest, type FormatOut, type GetBookCoverData, type GetBookCoverError, type GetBookCoverErrors, type GetBookCoverResponses, type GetBookData, type GetBookError, type GetBookErrors, type GetBookResponse, type GetBookResponses, type GetEmailConfigData, type GetEmailConfigError, type GetEmailConfigErrors, type GetEmailConfigResponse, type GetEmailConfigResponses, type GetJobData, type GetJobError, type GetJobErrors, type GetJobResponse, type GetJobResponses, type HealthData, type HealthError, type HealthErrors, type HealthResponse, type HealthResponse2, type HealthResponses, type HttpValidationError, type IdentifierOut, type JobOut, type JobStatusOut, type JobType, type ListBooksData, type ListBooksError, type ListBooksErrors, type ListBooksResponse, type ListBooksResponses, type Options, type RefreshMetadataData, type RefreshMetadataError, type RefreshMetadataErrors, type RefreshMetadataResponse, type RefreshMetadataResponses, type RefreshRequest, Sdk, type SearchBooksData, type SearchBooksError, type SearchBooksErrors, type SearchBooksResponse, type SearchBooksResponses, type SendBookData, type SendBookError, type SendBookErrors, type SendBookResponse, type SendBookResponses, type SendRequest, type SeriesOut, type SortDirection, type SortField, type StartExportData, type StartExportError, type StartExportErrors, type StartExportResponse, type StartExportResponses, type StreamJobData, type StreamJobError, type StreamJobErrors, type StreamJobResponses, type TagOut, type TestEmailConfigData, type TestEmailConfigError, type TestEmailConfigErrors, type TestEmailConfigResponse, type TestEmailConfigResponses, type UpdateBookData, type UpdateBookError, type UpdateBookErrors, type UpdateBookResponse, type UpdateBookResponses, type UploadBookData, type UploadBookError, type UploadBookErrors, type UploadBookResponse, type UploadBookResponses, type ValidationError };
1536
+ export { type AuthorOut, type BinaryHealthOut, type BodyUploadBook, type BookOut, type BookPage, type BookUpdate, type ClientOptions, type ConfigUpdate, type ConvertBookData, type ConvertBookError, type ConvertBookErrors, type ConvertBookResponse, type ConvertBookResponses, type ConvertRequest, type DeleteBookData, type DeleteBookError, type DeleteBookErrors, type DeleteBookFormatData, type DeleteBookFormatError, type DeleteBookFormatErrors, type DeleteBookFormatResponse, type DeleteBookFormatResponses, type DeleteBookResponse, type DeleteBookResponses, type DownloadBookFormatData, type DownloadBookFormatError, type DownloadBookFormatErrors, type DownloadBookFormatResponses, type DownloadExportData, type DownloadExportError, type DownloadExportErrors, type DownloadExportResponses, type EmailConfigOut, type EmailTestRequest, type ErrorBody, type ErrorDetail, type ErrorResponse, type ExportRequest, type FormatOut, type GetBookCoverData, type GetBookCoverError, type GetBookCoverErrors, type GetBookCoverResponses, type GetBookData, type GetBookError, type GetBookErrors, type GetBookResponse, type GetBookResponses, type GetConfigData, type GetConfigError, type GetConfigErrors, type GetConfigResponse, type GetConfigResponses, type GetEmailConfigData, type GetEmailConfigError, type GetEmailConfigErrors, type GetEmailConfigResponse, type GetEmailConfigResponses, type GetJobData, type GetJobError, type GetJobErrors, type GetJobResponse, type GetJobResponses, type HealthData, type HealthError, type HealthErrors, type HealthResponse, type HealthResponse2, type HealthResponses, type HttpValidationError, type IdentifierOut, type JobOut, type JobStatusOut, type JobType, type ListBooksData, type ListBooksError, type ListBooksErrors, type ListBooksResponse, type ListBooksResponses, type Options, type RefreshMetadataData, type RefreshMetadataError, type RefreshMetadataErrors, type RefreshMetadataResponse, type RefreshMetadataResponses, type RefreshRequest, Sdk, type SearchBooksData, type SearchBooksError, type SearchBooksErrors, type SearchBooksResponse, type SearchBooksResponses, type SendBookData, type SendBookError, type SendBookErrors, type SendBookResponse, type SendBookResponses, type SendRequest, type SeriesOut, type SetConfigData, type SetConfigError, type SetConfigErrors, type SetConfigResponse, type SetConfigResponses, type SortDirection, type SortField, type StartExportData, type StartExportError, type StartExportErrors, type StartExportResponse, type StartExportResponses, type StreamJobData, type StreamJobError, type StreamJobErrors, type StreamJobResponses, type TagOut, type TestEmailConfigData, type TestEmailConfigError, type TestEmailConfigErrors, type TestEmailConfigResponse, type TestEmailConfigResponses, type UpdateBookData, type UpdateBookError, type UpdateBookErrors, type UpdateBookResponse, type UpdateBookResponses, type UploadBookData, type UploadBookError, type UploadBookErrors, type UploadBookResponse, type UploadBookResponses, type ValidationError };
package/dist/index.d.ts CHANGED
@@ -58,6 +58,10 @@ type BookOut = {
58
58
  * Authors
59
59
  */
60
60
  authors: Array<AuthorOut>;
61
+ /**
62
+ * Comment
63
+ */
64
+ comment: string | null;
61
65
  /**
62
66
  * Cover Url
63
67
  */
@@ -204,6 +208,24 @@ type BookUpdate = {
204
208
  */
205
209
  title?: string | null;
206
210
  };
211
+ /**
212
+ * ConfigUpdate
213
+ *
214
+ * Generic config write: a map of allowed keys to their new string values.
215
+ *
216
+ * Only known keys are accepted (SMTP settings + kindle_email). Sending an empty
217
+ * string for a secret key (the SMTP password) clears it.
218
+ */
219
+ type ConfigUpdate = {
220
+ /**
221
+ * Values
222
+ *
223
+ * Config key/value pairs to set. Unknown keys are rejected.
224
+ */
225
+ values: {
226
+ [key: string]: string;
227
+ };
228
+ };
207
229
  /**
208
230
  * ConvertRequest
209
231
  *
@@ -933,6 +955,69 @@ type SendBookResponses = {
933
955
  202: JobOut;
934
956
  };
935
957
  type SendBookResponse = SendBookResponses[keyof SendBookResponses];
958
+ type GetConfigData = {
959
+ body?: never;
960
+ path?: never;
961
+ query: {
962
+ /**
963
+ * Keys
964
+ *
965
+ * Config keys to read. Unknown keys are omitted.
966
+ */
967
+ keys: Array<string>;
968
+ };
969
+ url: '/config';
970
+ };
971
+ type GetConfigErrors = {
972
+ /**
973
+ * Validation Error
974
+ */
975
+ 422: HttpValidationError;
976
+ /**
977
+ * Internal server error
978
+ */
979
+ 500: ErrorResponse;
980
+ };
981
+ type GetConfigError = GetConfigErrors[keyof GetConfigErrors];
982
+ type GetConfigResponses = {
983
+ /**
984
+ * Response Get Config
985
+ *
986
+ * Successful Response
987
+ */
988
+ 200: {
989
+ [key: string]: string | null;
990
+ };
991
+ };
992
+ type GetConfigResponse = GetConfigResponses[keyof GetConfigResponses];
993
+ type SetConfigData = {
994
+ body: ConfigUpdate;
995
+ path?: never;
996
+ query?: never;
997
+ url: '/config';
998
+ };
999
+ type SetConfigErrors = {
1000
+ /**
1001
+ * Validation error
1002
+ */
1003
+ 422: ErrorResponse;
1004
+ /**
1005
+ * Internal server error
1006
+ */
1007
+ 500: ErrorResponse;
1008
+ };
1009
+ type SetConfigError = SetConfigErrors[keyof SetConfigErrors];
1010
+ type SetConfigResponses = {
1011
+ /**
1012
+ * Response Set Config
1013
+ *
1014
+ * Successful Response
1015
+ */
1016
+ 200: {
1017
+ [key: string]: string | null;
1018
+ };
1019
+ };
1020
+ type SetConfigResponse = SetConfigResponses[keyof SetConfigResponses];
936
1021
  type GetEmailConfigData = {
937
1022
  body?: never;
938
1023
  path?: never;
@@ -1342,6 +1427,25 @@ declare class Sdk extends HeyApiClient {
1342
1427
  * matching or sendable format.
1343
1428
  */
1344
1429
  sendBook<ThrowOnError extends boolean = false>(options: Options<SendBookData, ThrowOnError>): RequestResult<SendBookResponses, SendBookErrors, ThrowOnError>;
1430
+ /**
1431
+ * Get Config
1432
+ *
1433
+ * Return the requested config values (None when unset).
1434
+ *
1435
+ * Only known keys are returned; secret keys (the SMTP password) read back as a
1436
+ * masked placeholder when set, never their value.
1437
+ */
1438
+ getConfig<ThrowOnError extends boolean = false>(options: Options<GetConfigData, ThrowOnError>): RequestResult<GetConfigResponses, GetConfigErrors, ThrowOnError>;
1439
+ /**
1440
+ * Set Config
1441
+ *
1442
+ * Set one or more config values and return their (masked) readback.
1443
+ *
1444
+ * Only the provided keys change; others are untouched, so a UI can edit just
1445
+ * ``kindle_email`` without resending SMTP. Unknown keys → 422. After a write,
1446
+ * the mailer is rebuilt so SMTP changes take effect without a restart.
1447
+ */
1448
+ setConfig<ThrowOnError extends boolean = false>(options: Options<SetConfigData, ThrowOnError>): RequestResult<SetConfigResponses, SetConfigErrors, ThrowOnError>;
1345
1449
  /**
1346
1450
  * Get Email Config
1347
1451
  *
@@ -1429,4 +1533,4 @@ declare class Sdk extends HeyApiClient {
1429
1533
  searchBooks<ThrowOnError extends boolean = false>(options?: Options<SearchBooksData, ThrowOnError>): RequestResult<SearchBooksResponses, SearchBooksErrors, ThrowOnError>;
1430
1534
  }
1431
1535
 
1432
- export { type AuthorOut, type BinaryHealthOut, type BodyUploadBook, type BookOut, type BookPage, type BookUpdate, type ClientOptions, type ConvertBookData, type ConvertBookError, type ConvertBookErrors, type ConvertBookResponse, type ConvertBookResponses, type ConvertRequest, type DeleteBookData, type DeleteBookError, type DeleteBookErrors, type DeleteBookFormatData, type DeleteBookFormatError, type DeleteBookFormatErrors, type DeleteBookFormatResponse, type DeleteBookFormatResponses, type DeleteBookResponse, type DeleteBookResponses, type DownloadBookFormatData, type DownloadBookFormatError, type DownloadBookFormatErrors, type DownloadBookFormatResponses, type DownloadExportData, type DownloadExportError, type DownloadExportErrors, type DownloadExportResponses, type EmailConfigOut, type EmailTestRequest, type ErrorBody, type ErrorDetail, type ErrorResponse, type ExportRequest, type FormatOut, type GetBookCoverData, type GetBookCoverError, type GetBookCoverErrors, type GetBookCoverResponses, type GetBookData, type GetBookError, type GetBookErrors, type GetBookResponse, type GetBookResponses, type GetEmailConfigData, type GetEmailConfigError, type GetEmailConfigErrors, type GetEmailConfigResponse, type GetEmailConfigResponses, type GetJobData, type GetJobError, type GetJobErrors, type GetJobResponse, type GetJobResponses, type HealthData, type HealthError, type HealthErrors, type HealthResponse, type HealthResponse2, type HealthResponses, type HttpValidationError, type IdentifierOut, type JobOut, type JobStatusOut, type JobType, type ListBooksData, type ListBooksError, type ListBooksErrors, type ListBooksResponse, type ListBooksResponses, type Options, type RefreshMetadataData, type RefreshMetadataError, type RefreshMetadataErrors, type RefreshMetadataResponse, type RefreshMetadataResponses, type RefreshRequest, Sdk, type SearchBooksData, type SearchBooksError, type SearchBooksErrors, type SearchBooksResponse, type SearchBooksResponses, type SendBookData, type SendBookError, type SendBookErrors, type SendBookResponse, type SendBookResponses, type SendRequest, type SeriesOut, type SortDirection, type SortField, type StartExportData, type StartExportError, type StartExportErrors, type StartExportResponse, type StartExportResponses, type StreamJobData, type StreamJobError, type StreamJobErrors, type StreamJobResponses, type TagOut, type TestEmailConfigData, type TestEmailConfigError, type TestEmailConfigErrors, type TestEmailConfigResponse, type TestEmailConfigResponses, type UpdateBookData, type UpdateBookError, type UpdateBookErrors, type UpdateBookResponse, type UpdateBookResponses, type UploadBookData, type UploadBookError, type UploadBookErrors, type UploadBookResponse, type UploadBookResponses, type ValidationError };
1536
+ export { type AuthorOut, type BinaryHealthOut, type BodyUploadBook, type BookOut, type BookPage, type BookUpdate, type ClientOptions, type ConfigUpdate, type ConvertBookData, type ConvertBookError, type ConvertBookErrors, type ConvertBookResponse, type ConvertBookResponses, type ConvertRequest, type DeleteBookData, type DeleteBookError, type DeleteBookErrors, type DeleteBookFormatData, type DeleteBookFormatError, type DeleteBookFormatErrors, type DeleteBookFormatResponse, type DeleteBookFormatResponses, type DeleteBookResponse, type DeleteBookResponses, type DownloadBookFormatData, type DownloadBookFormatError, type DownloadBookFormatErrors, type DownloadBookFormatResponses, type DownloadExportData, type DownloadExportError, type DownloadExportErrors, type DownloadExportResponses, type EmailConfigOut, type EmailTestRequest, type ErrorBody, type ErrorDetail, type ErrorResponse, type ExportRequest, type FormatOut, type GetBookCoverData, type GetBookCoverError, type GetBookCoverErrors, type GetBookCoverResponses, type GetBookData, type GetBookError, type GetBookErrors, type GetBookResponse, type GetBookResponses, type GetConfigData, type GetConfigError, type GetConfigErrors, type GetConfigResponse, type GetConfigResponses, type GetEmailConfigData, type GetEmailConfigError, type GetEmailConfigErrors, type GetEmailConfigResponse, type GetEmailConfigResponses, type GetJobData, type GetJobError, type GetJobErrors, type GetJobResponse, type GetJobResponses, type HealthData, type HealthError, type HealthErrors, type HealthResponse, type HealthResponse2, type HealthResponses, type HttpValidationError, type IdentifierOut, type JobOut, type JobStatusOut, type JobType, type ListBooksData, type ListBooksError, type ListBooksErrors, type ListBooksResponse, type ListBooksResponses, type Options, type RefreshMetadataData, type RefreshMetadataError, type RefreshMetadataErrors, type RefreshMetadataResponse, type RefreshMetadataResponses, type RefreshRequest, Sdk, type SearchBooksData, type SearchBooksError, type SearchBooksErrors, type SearchBooksResponse, type SearchBooksResponses, type SendBookData, type SendBookError, type SendBookErrors, type SendBookResponse, type SendBookResponses, type SendRequest, type SeriesOut, type SetConfigData, type SetConfigError, type SetConfigErrors, type SetConfigResponse, type SetConfigResponses, type SortDirection, type SortField, type StartExportData, type StartExportError, type StartExportErrors, type StartExportResponse, type StartExportResponses, type StreamJobData, type StreamJobError, type StreamJobErrors, type StreamJobResponses, type TagOut, type TestEmailConfigData, type TestEmailConfigError, type TestEmailConfigErrors, type TestEmailConfigResponse, type TestEmailConfigResponses, type UpdateBookData, type UpdateBookError, type UpdateBookErrors, type UpdateBookResponse, type UpdateBookResponses, type UploadBookData, type UploadBookError, type UploadBookErrors, type UploadBookResponse, type UploadBookResponses, type ValidationError };
package/dist/index.js CHANGED
@@ -207,6 +207,36 @@ var Sdk = class _Sdk extends HeyApiClient {
207
207
  }
208
208
  });
209
209
  }
210
+ /**
211
+ * Get Config
212
+ *
213
+ * Return the requested config values (None when unset).
214
+ *
215
+ * Only known keys are returned; secret keys (the SMTP password) read back as a
216
+ * masked placeholder when set, never their value.
217
+ */
218
+ getConfig(options) {
219
+ return (options.client ?? this.client).get({ url: "/config", ...options });
220
+ }
221
+ /**
222
+ * Set Config
223
+ *
224
+ * Set one or more config values and return their (masked) readback.
225
+ *
226
+ * Only the provided keys change; others are untouched, so a UI can edit just
227
+ * ``kindle_email`` without resending SMTP. Unknown keys → 422. After a write,
228
+ * the mailer is rebuilt so SMTP changes take effect without a restart.
229
+ */
230
+ setConfig(options) {
231
+ return (options.client ?? this.client).post({
232
+ url: "/config",
233
+ ...options,
234
+ headers: {
235
+ "Content-Type": "application/json",
236
+ ...options.headers
237
+ }
238
+ });
239
+ }
210
240
  /**
211
241
  * Get Email Config
212
242
  *
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/client.gen.ts","../src/sdk.gen.ts"],"names":[],"mappings":";;;AAeO,IAAM,MAAA,GAAiB,YAAA,CAAa,YAAA,EAA8B,CAAA;;;ACKzE,IAAM,eAAN,MAAmB;AAAA,EACL,MAAA;AAAA,EAEV,YAAY,IAAA,EAET;AACC,IAAA,IAAA,CAAK,MAAA,GAAS,MAAM,MAAA,IAAU,MAAA;AAAA,EAClC;AACJ,CAAA;AAEA,IAAM,iBAAN,MAAwB;AAAA,EACH,UAAA,GAAa,SAAA;AAAA,EAEb,SAAA,uBAAgC,GAAA,EAAI;AAAA,EAErD,IAAI,GAAA,EAAiB;AACjB,IAAA,MAAM,WAAW,IAAA,CAAK,SAAA,CAAU,GAAA,CAAI,GAAA,IAAO,KAAK,UAAU,CAAA;AAC1D,IAAA,IAAI,CAAC,QAAA,EAAU;AACX,MAAA,MAAM,IAAI,MAAM,CAAA,mEAAA,CAAqE,CAAA;AAAA,IACzF;AACA,IAAA,OAAO,QAAA;AAAA,EACX;AAAA,EAEA,GAAA,CAAI,OAAU,GAAA,EAAoB;AAC9B,IAAA,IAAA,CAAK,SAAA,CAAU,GAAA,CAAI,GAAA,IAAO,IAAA,CAAK,YAAY,KAAK,CAAA;AAAA,EACpD;AACJ,CAAA;AAEO,IAAM,GAAA,GAAN,MAAM,IAAA,SAAY,YAAA,CAAa;AAAA,EAClC,OAAuB,UAAA,GAAkC,IAAI,cAAA,EAAoB;AAAA,EAEjF,YAAY,IAAA,EAGT;AACC,IA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,OAAA,EAAwG;AACxJ,IAAA,OAAA,CAAQ,OAAA,CAAQ,MAAA,IAAU,IAAA,CAAK,MAAA,EAAQ,GAAA,CAAiD,EAAE,GAAA,EAAK,gBAAA,EAAkB,GAAG,OAAA,EAAS,CAAA;AAAA,EACjI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYO,UAAgD,OAAA,EAAiH;AACpK,IAAA,OAAA,CAAQ,OAAA,CAAQ,MAAA,IAAU,IAAA,CAAK,MAAA,EAAQ,GAAA,CAAuD,EAAE,GAAA,EAAK,uBAAA,EAAyB,GAAG,OAAA,EAAS,CAAA;AAAA,EAC9I;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaO,YAAkD,OAAA,EAAwH;AAC7K,IAAA,OAAA,CAAQ,OAAA,EAAS,MAAA,IAAU,IAAA,CAAK,MAAA,EAAQ,GAAA,CAA2D,EAAE,GAAA,EAAK,SAAA,EAAW,GAAG,OAAA,EAAS,CAAA;AAAA,EACrI;AACJ","file":"index.js","sourcesContent":["// 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>());\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 { ConvertBookData, ConvertBookErrors, ConvertBookResponses, DeleteBookData, DeleteBookErrors, DeleteBookFormatData, DeleteBookFormatErrors, DeleteBookFormatResponses, DeleteBookResponses, DownloadBookFormatData, DownloadBookFormatErrors, DownloadBookFormatResponses, DownloadExportData, DownloadExportErrors, DownloadExportResponses, GetBookCoverData, GetBookCoverErrors, GetBookCoverResponses, GetBookData, GetBookErrors, GetBookResponses, GetEmailConfigData, GetEmailConfigErrors, GetEmailConfigResponses, GetJobData, GetJobErrors, GetJobResponses, HealthData, HealthErrors, HealthResponses, ListBooksData, ListBooksErrors, ListBooksResponses, RefreshMetadataData, RefreshMetadataErrors, RefreshMetadataResponses, SearchBooksData, SearchBooksErrors, SearchBooksResponses, SendBookData, SendBookErrors, SendBookResponses, StartExportData, StartExportErrors, StartExportResponses, StreamJobData, StreamJobErrors, StreamJobResponses, TestEmailConfigData, TestEmailConfigErrors, TestEmailConfigResponses, UpdateBookData, UpdateBookErrors, UpdateBookResponses, UploadBookData, UploadBookErrors, UploadBookResponses } 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\nclass HeyApiClient {\n protected client: Client;\n \n constructor(args?: {\n client?: Client;\n }) {\n this.client = args?.client ?? client;\n }\n}\n\nclass HeyApiRegistry<T> {\n private readonly defaultKey = 'default';\n \n private readonly instances: Map<string, T> = new Map();\n \n get(key?: string): T {\n const instance = this.instances.get(key ?? this.defaultKey);\n if (!instance) {\n throw new Error(`No SDK client found. Create one with \"new Sdk()\" to fix this error.`);\n }\n return instance;\n }\n \n set(value: T, key?: string): void {\n this.instances.set(key ?? this.defaultKey, value);\n }\n}\n\nexport class Sdk extends HeyApiClient {\n public static readonly __registry: HeyApiRegistry<Sdk> = new HeyApiRegistry<Sdk>();\n \n constructor(args?: {\n client?: Client;\n key?: string;\n }) {\n super(args);\n Sdk.__registry.set(this, args?.key);\n }\n \n /**\n * List Books\n *\n * List books, paginated and sorted.\n *\n * Returns a page of books controlled by `page` and `page_size`, ordered by\n * `sort` field in the given `direction`. Out-of-range pagination values are\n * rejected with `422`.\n */\n public listBooks<ThrowOnError extends boolean = false>(options?: Options<ListBooksData, ThrowOnError>): RequestResult<ListBooksResponses, ListBooksErrors, ThrowOnError> {\n return (options?.client ?? this.client).get<ListBooksResponses, ListBooksErrors, ThrowOnError>({ url: '/books', ...options });\n }\n \n /**\n * Upload Book\n *\n * Upload a book file and create a new book.\n *\n * Accepts a multipart `file` whose extension must be one of the allowed\n * upload formats; metadata is extracted from the file on import. Returns the\n * created book with `201`, `400` if the file is rejected (unsupported\n * extension or unreadable content), or `413` if it exceeds the upload size\n * limit.\n */\n public uploadBook<ThrowOnError extends boolean = false>(options: Options<UploadBookData, ThrowOnError>): RequestResult<UploadBookResponses, UploadBookErrors, ThrowOnError> {\n return (options.client ?? this.client).post<UploadBookResponses, UploadBookErrors, ThrowOnError>({\n ...formDataBodySerializer,\n url: '/books',\n ...options,\n headers: {\n 'Content-Type': null,\n ...options.headers\n }\n });\n }\n \n /**\n * Delete Book\n *\n * Delete a book and all of its files.\n *\n * Removes the book identified by `book_id` along with its stored formats and\n * cover, returning `204` with no body on success. Responds with `404` when the\n * book does not exist.\n */\n public deleteBook<ThrowOnError extends boolean = false>(options: Options<DeleteBookData, ThrowOnError>): RequestResult<DeleteBookResponses, DeleteBookErrors, ThrowOnError> {\n return (options.client ?? this.client).delete<DeleteBookResponses, DeleteBookErrors, ThrowOnError>({ url: '/books/{book_id}', ...options });\n }\n \n /**\n * Get Book\n *\n * Get a single book by its public id.\n *\n * Looks up the book identified by `book_id` (the book's public id) and returns\n * its full metadata. Responds with `404` when no such book exists.\n */\n public getBook<ThrowOnError extends boolean = false>(options: Options<GetBookData, ThrowOnError>): RequestResult<GetBookResponses, GetBookErrors, ThrowOnError> {\n return (options.client ?? this.client).get<GetBookResponses, GetBookErrors, ThrowOnError>({ url: '/books/{book_id}', ...options });\n }\n \n /**\n * Update Book\n *\n * Partially update a book's metadata.\n *\n * Applies only the fields explicitly set in the request body, leaving omitted\n * fields untouched, and returns the updated book. Responds with `400` when the\n * patch is empty or violates a domain rule (e.g. an out-of-range `rating`),\n * and `404` when the book does not exist.\n */\n public updateBook<ThrowOnError extends boolean = false>(options: Options<UpdateBookData, ThrowOnError>): RequestResult<UpdateBookResponses, UpdateBookErrors, ThrowOnError> {\n return (options.client ?? this.client).patch<UpdateBookResponses, UpdateBookErrors, ThrowOnError>({\n url: '/books/{book_id}',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Convert Book\n *\n * Convert a book to another format.\n *\n * Enqueues a background conversion to `target_format`, optionally from an\n * explicit `source_format` (otherwise the best available source is chosen), and\n * returns `202` with a job to poll at `/jobs/{id}`. Responds with `404` if the\n * book is missing, `503` if `ebook-convert` is unavailable, `409` if the target\n * format already exists or an identical conversion is already in progress, and\n * `400` if no suitable source format is available.\n */\n public convertBook<ThrowOnError extends boolean = false>(options: Options<ConvertBookData, ThrowOnError>): RequestResult<ConvertBookResponses, ConvertBookErrors, ThrowOnError> {\n return (options.client ?? this.client).post<ConvertBookResponses, ConvertBookErrors, ThrowOnError>({\n url: '/books/{book_id}/convert',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Get Book Cover\n *\n * Download a book's cover image.\n *\n * Returns the cover bytes as `image/jpeg` for the book identified by\n * `book_id`. Responds with `404` when the book has no recorded cover or the\n * cover file is missing from storage.\n */\n public getBookCover<ThrowOnError extends boolean = false>(options: Options<GetBookCoverData, ThrowOnError>): RequestResult<GetBookCoverResponses, GetBookCoverErrors, ThrowOnError> {\n return (options.client ?? this.client).get<GetBookCoverResponses, GetBookCoverErrors, ThrowOnError>({ url: '/books/{book_id}/cover', ...options });\n }\n \n /**\n * Delete Book Format\n *\n * Delete one format of a book.\n *\n * Removes the file for the given `book_format` of the book identified by\n * `book_id`, returning `204` with no body on success. Responds with `404` when\n * the book does not exist or it has no such format.\n */\n public deleteBookFormat<ThrowOnError extends boolean = false>(options: Options<DeleteBookFormatData, ThrowOnError>): RequestResult<DeleteBookFormatResponses, DeleteBookFormatErrors, ThrowOnError> {\n return (options.client ?? this.client).delete<DeleteBookFormatResponses, DeleteBookFormatErrors, ThrowOnError>({ url: '/books/{book_id}/formats/{book_format}', ...options });\n }\n \n /**\n * Download Book Format\n *\n * Download one format of a book.\n *\n * Returns the file for the given `book_format` of the book identified by\n * `book_id` as an `application/octet-stream` attachment, with the stored\n * filename in the `Content-Disposition` header. Responds with `404` when the\n * book lacks that format or the file is missing from storage.\n */\n public downloadBookFormat<ThrowOnError extends boolean = false>(options: Options<DownloadBookFormatData, ThrowOnError>): RequestResult<DownloadBookFormatResponses, DownloadBookFormatErrors, ThrowOnError> {\n return (options.client ?? this.client).get<DownloadBookFormatResponses, DownloadBookFormatErrors, ThrowOnError>({ url: '/books/{book_id}/formats/{book_format}', ...options });\n }\n \n /**\n * Refresh Metadata\n *\n * Re-extract metadata from a book file and return the updated book.\n *\n * Reads metadata afresh from the book's `source_format` file and merges it in:\n * fields the extraction produced replace the current ones, fields it could not\n * read are kept. Responds with `404` when the book or requested format is not\n * found, and `400` for any other refresh failure.\n */\n public refreshMetadata<ThrowOnError extends boolean = false>(options: Options<RefreshMetadataData, ThrowOnError>): RequestResult<RefreshMetadataResponses, RefreshMetadataErrors, ThrowOnError> {\n return (options.client ?? this.client).post<RefreshMetadataResponses, RefreshMetadataErrors, ThrowOnError>({\n url: '/books/{book_id}/refresh-metadata',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Send Book\n *\n * Email a book to a recipient.\n *\n * Enqueues a background job to send the book to `to_email` in the requested\n * `format` (or the best available sendable format if unspecified), and returns\n * `202` with a job to poll at `/jobs/{id}`. Responds with `404` if the book is\n * missing, `503` if SMTP is not configured, and `400` if the book has no\n * matching or sendable format.\n */\n public sendBook<ThrowOnError extends boolean = false>(options: Options<SendBookData, ThrowOnError>): RequestResult<SendBookResponses, SendBookErrors, ThrowOnError> {\n return (options.client ?? this.client).post<SendBookResponses, SendBookErrors, ThrowOnError>({\n url: '/books/{book_id}/send',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Get Email Config\n *\n * Return the non-secret SMTP settings for display.\n *\n * Reports whether SMTP is `configured` along with `host`, `port`,\n * `from_address` (falling back to the username when no explicit from is set)\n * and `security`. The password is never read or returned.\n */\n public getEmailConfig<ThrowOnError extends boolean = false>(options?: Options<GetEmailConfigData, ThrowOnError>): RequestResult<GetEmailConfigResponses, GetEmailConfigErrors, ThrowOnError> {\n return (options?.client ?? this.client).get<GetEmailConfigResponses, GetEmailConfigErrors, ThrowOnError>({ url: '/config/email', ...options });\n }\n \n /**\n * Test Email Config\n *\n * Send a test email to verify SMTP connectivity.\n *\n * Sends a test message to `to_email` and returns 204 on success. Responds 503\n * if SMTP is not configured, or 502 if the connection, authentication or send\n * fails.\n */\n public testEmailConfig<ThrowOnError extends boolean = false>(options: Options<TestEmailConfigData, ThrowOnError>): RequestResult<TestEmailConfigResponses, TestEmailConfigErrors, ThrowOnError> {\n return (options.client ?? this.client).post<TestEmailConfigResponses, TestEmailConfigErrors, ThrowOnError>({\n url: '/config/email/test',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Start Export\n *\n * Start an async Calibre export; the download link is emailed when ready.\n *\n * Enqueues a background job that snapshots the requested books (or the whole\n * library when `book_ids` is omitted) to a zip and emails a time-limited link\n * to `to_email`, returning 202 with the new job. Responds 503 when export is\n * unavailable (the calibredb binary is missing, SMTP is not configured, or no\n * public base URL is set for an absolute link), and 400 for a malformed book id.\n */\n public startExport<ThrowOnError extends boolean = false>(options: Options<StartExportData, ThrowOnError>): RequestResult<StartExportResponses, StartExportErrors, ThrowOnError> {\n return (options.client ?? this.client).post<StartExportResponses, StartExportErrors, ThrowOnError>({\n url: '/export/calibre',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Download Export\n *\n * Stream a finished export zip for a valid, unexpired token.\n *\n * Served via ``FileResponse``, which streams the file and honours HTTP Range\n * requests, so a large download is memory-light and resumable.\n */\n public downloadExport<ThrowOnError extends boolean = false>(options: Options<DownloadExportData, ThrowOnError>): RequestResult<DownloadExportResponses, DownloadExportErrors, ThrowOnError> {\n return (options.client ?? this.client).get<DownloadExportResponses, DownloadExportErrors, ThrowOnError>({ url: '/export/download/{token}', ...options });\n }\n \n /**\n * Health\n *\n * Report liveness and the availability of optional dependencies.\n *\n * Always returns `status` ``\"ok\"`` and the API `version`, plus the\n * Calibre binary availability (`convert_available`, `metadata_available`)\n * and whether send-to-ereader is usable (`send_available`, true when SMTP\n * is configured).\n */\n public health<ThrowOnError extends boolean = false>(options?: Options<HealthData, ThrowOnError>): RequestResult<HealthResponses, HealthErrors, ThrowOnError> {\n return (options?.client ?? this.client).get<HealthResponses, HealthErrors, ThrowOnError>({ url: '/health', ...options });\n }\n \n /**\n * Get Job\n *\n * Return the current status and progress of a single job.\n *\n * Looks up the job by `job_id` and returns its latest state for one-shot\n * polling. Responds 404 if no job with that id exists; use `/jobs/{job_id}/stream`\n * instead to follow progress live.\n */\n public getJob<ThrowOnError extends boolean = false>(options: Options<GetJobData, ThrowOnError>): RequestResult<GetJobResponses, GetJobErrors, ThrowOnError> {\n return (options.client ?? this.client).get<GetJobResponses, GetJobErrors, ThrowOnError>({ url: '/jobs/{job_id}', ...options });\n }\n \n /**\n * Stream Job\n *\n * Stream a job's status/progress as Server-Sent Events until it finishes.\n *\n * One open connection replaces repeated polling. Updates are event-driven: the\n * stream blocks (in a threadpool, so the event loop stays free) until the job\n * actually changes, then emits — so it reflects each new binary output, not a\n * fixed tick.\n */\n public streamJob<ThrowOnError extends boolean = false>(options: Options<StreamJobData, ThrowOnError>): RequestResult<StreamJobResponses, StreamJobErrors, ThrowOnError> {\n return (options.client ?? this.client).get<StreamJobResponses, StreamJobErrors, ThrowOnError>({ url: '/jobs/{job_id}/stream', ...options });\n }\n \n /**\n * Search Books\n *\n * Search books by a text query and filters.\n *\n * Returns a paginated page of books whose title, author, series or tags match\n * the query `q` (case-insensitive substring match), narrowed by the optional\n * `include_tags`, `exclude_tags`, `languages`, `formats`, and\n * `rating_min`/`rating_max` filters. Out-of-range pagination or rating values\n * are rejected with `422`.\n */\n public searchBooks<ThrowOnError extends boolean = false>(options?: Options<SearchBooksData, ThrowOnError>): RequestResult<SearchBooksResponses, SearchBooksErrors, ThrowOnError> {\n return (options?.client ?? this.client).get<SearchBooksResponses, SearchBooksErrors, ThrowOnError>({ url: '/search', ...options });\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/client.gen.ts","../src/sdk.gen.ts"],"names":[],"mappings":";;;AAeO,IAAM,MAAA,GAAiB,YAAA,CAAa,YAAA,EAA8B,CAAA;;;ACKzE,IAAM,eAAN,MAAmB;AAAA,EACL,MAAA;AAAA,EAEV,YAAY,IAAA,EAET;AACC,IAAA,IAAA,CAAK,MAAA,GAAS,MAAM,MAAA,IAAU,MAAA;AAAA,EAClC;AACJ,CAAA;AAEA,IAAM,iBAAN,MAAwB;AAAA,EACH,UAAA,GAAa,SAAA;AAAA,EAEb,SAAA,uBAAgC,GAAA,EAAI;AAAA,EAErD,IAAI,GAAA,EAAiB;AACjB,IAAA,MAAM,WAAW,IAAA,CAAK,SAAA,CAAU,GAAA,CAAI,GAAA,IAAO,KAAK,UAAU,CAAA;AAC1D,IAAA,IAAI,CAAC,QAAA,EAAU;AACX,MAAA,MAAM,IAAI,MAAM,CAAA,mEAAA,CAAqE,CAAA;AAAA,IACzF;AACA,IAAA,OAAO,QA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AA,EAAQ,GAAA,CAAuD,EAAE,GAAA,EAAK,uBAAA,EAAyB,GAAG,OAAA,EAAS,CAAA;AAAA,EAC9I;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaO,YAAkD,OAAA,EAAwH;AAC7K,IAAA,OAAA,CAAQ,OAAA,EAAS,MAAA,IAAU,IAAA,CAAK,MAAA,EAAQ,GAAA,CAA2D,EAAE,GAAA,EAAK,SAAA,EAAW,GAAG,OAAA,EAAS,CAAA;AAAA,EACrI;AACJ","file":"index.js","sourcesContent":["// 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>());\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 { ConvertBookData, ConvertBookErrors, ConvertBookResponses, DeleteBookData, DeleteBookErrors, DeleteBookFormatData, DeleteBookFormatErrors, DeleteBookFormatResponses, DeleteBookResponses, DownloadBookFormatData, DownloadBookFormatErrors, DownloadBookFormatResponses, DownloadExportData, DownloadExportErrors, DownloadExportResponses, GetBookCoverData, GetBookCoverErrors, GetBookCoverResponses, GetBookData, GetBookErrors, GetBookResponses, GetConfigData, GetConfigErrors, GetConfigResponses, GetEmailConfigData, GetEmailConfigErrors, GetEmailConfigResponses, GetJobData, GetJobErrors, GetJobResponses, HealthData, HealthErrors, HealthResponses, ListBooksData, ListBooksErrors, ListBooksResponses, RefreshMetadataData, RefreshMetadataErrors, RefreshMetadataResponses, SearchBooksData, SearchBooksErrors, SearchBooksResponses, SendBookData, SendBookErrors, SendBookResponses, SetConfigData, SetConfigErrors, SetConfigResponses, StartExportData, StartExportErrors, StartExportResponses, StreamJobData, StreamJobErrors, StreamJobResponses, TestEmailConfigData, TestEmailConfigErrors, TestEmailConfigResponses, UpdateBookData, UpdateBookErrors, UpdateBookResponses, UploadBookData, UploadBookErrors, UploadBookResponses } 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\nclass HeyApiClient {\n protected client: Client;\n \n constructor(args?: {\n client?: Client;\n }) {\n this.client = args?.client ?? client;\n }\n}\n\nclass HeyApiRegistry<T> {\n private readonly defaultKey = 'default';\n \n private readonly instances: Map<string, T> = new Map();\n \n get(key?: string): T {\n const instance = this.instances.get(key ?? this.defaultKey);\n if (!instance) {\n throw new Error(`No SDK client found. Create one with \"new Sdk()\" to fix this error.`);\n }\n return instance;\n }\n \n set(value: T, key?: string): void {\n this.instances.set(key ?? this.defaultKey, value);\n }\n}\n\nexport class Sdk extends HeyApiClient {\n public static readonly __registry: HeyApiRegistry<Sdk> = new HeyApiRegistry<Sdk>();\n \n constructor(args?: {\n client?: Client;\n key?: string;\n }) {\n super(args);\n Sdk.__registry.set(this, args?.key);\n }\n \n /**\n * List Books\n *\n * List books, paginated and sorted.\n *\n * Returns a page of books controlled by `page` and `page_size`, ordered by\n * `sort` field in the given `direction`. Out-of-range pagination values are\n * rejected with `422`.\n */\n public listBooks<ThrowOnError extends boolean = false>(options?: Options<ListBooksData, ThrowOnError>): RequestResult<ListBooksResponses, ListBooksErrors, ThrowOnError> {\n return (options?.client ?? this.client).get<ListBooksResponses, ListBooksErrors, ThrowOnError>({ url: '/books', ...options });\n }\n \n /**\n * Upload Book\n *\n * Upload a book file and create a new book.\n *\n * Accepts a multipart `file` whose extension must be one of the allowed\n * upload formats; metadata is extracted from the file on import. Returns the\n * created book with `201`, `400` if the file is rejected (unsupported\n * extension or unreadable content), or `413` if it exceeds the upload size\n * limit.\n */\n public uploadBook<ThrowOnError extends boolean = false>(options: Options<UploadBookData, ThrowOnError>): RequestResult<UploadBookResponses, UploadBookErrors, ThrowOnError> {\n return (options.client ?? this.client).post<UploadBookResponses, UploadBookErrors, ThrowOnError>({\n ...formDataBodySerializer,\n url: '/books',\n ...options,\n headers: {\n 'Content-Type': null,\n ...options.headers\n }\n });\n }\n \n /**\n * Delete Book\n *\n * Delete a book and all of its files.\n *\n * Removes the book identified by `book_id` along with its stored formats and\n * cover, returning `204` with no body on success. Responds with `404` when the\n * book does not exist.\n */\n public deleteBook<ThrowOnError extends boolean = false>(options: Options<DeleteBookData, ThrowOnError>): RequestResult<DeleteBookResponses, DeleteBookErrors, ThrowOnError> {\n return (options.client ?? this.client).delete<DeleteBookResponses, DeleteBookErrors, ThrowOnError>({ url: '/books/{book_id}', ...options });\n }\n \n /**\n * Get Book\n *\n * Get a single book by its public id.\n *\n * Looks up the book identified by `book_id` (the book's public id) and returns\n * its full metadata. Responds with `404` when no such book exists.\n */\n public getBook<ThrowOnError extends boolean = false>(options: Options<GetBookData, ThrowOnError>): RequestResult<GetBookResponses, GetBookErrors, ThrowOnError> {\n return (options.client ?? this.client).get<GetBookResponses, GetBookErrors, ThrowOnError>({ url: '/books/{book_id}', ...options });\n }\n \n /**\n * Update Book\n *\n * Partially update a book's metadata.\n *\n * Applies only the fields explicitly set in the request body, leaving omitted\n * fields untouched, and returns the updated book. Responds with `400` when the\n * patch is empty or violates a domain rule (e.g. an out-of-range `rating`),\n * and `404` when the book does not exist.\n */\n public updateBook<ThrowOnError extends boolean = false>(options: Options<UpdateBookData, ThrowOnError>): RequestResult<UpdateBookResponses, UpdateBookErrors, ThrowOnError> {\n return (options.client ?? this.client).patch<UpdateBookResponses, UpdateBookErrors, ThrowOnError>({\n url: '/books/{book_id}',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Convert Book\n *\n * Convert a book to another format.\n *\n * Enqueues a background conversion to `target_format`, optionally from an\n * explicit `source_format` (otherwise the best available source is chosen), and\n * returns `202` with a job to poll at `/jobs/{id}`. Responds with `404` if the\n * book is missing, `503` if `ebook-convert` is unavailable, `409` if the target\n * format already exists or an identical conversion is already in progress, and\n * `400` if no suitable source format is available.\n */\n public convertBook<ThrowOnError extends boolean = false>(options: Options<ConvertBookData, ThrowOnError>): RequestResult<ConvertBookResponses, ConvertBookErrors, ThrowOnError> {\n return (options.client ?? this.client).post<ConvertBookResponses, ConvertBookErrors, ThrowOnError>({\n url: '/books/{book_id}/convert',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Get Book Cover\n *\n * Download a book's cover image.\n *\n * Returns the cover bytes as `image/jpeg` for the book identified by\n * `book_id`. Responds with `404` when the book has no recorded cover or the\n * cover file is missing from storage.\n */\n public getBookCover<ThrowOnError extends boolean = false>(options: Options<GetBookCoverData, ThrowOnError>): RequestResult<GetBookCoverResponses, GetBookCoverErrors, ThrowOnError> {\n return (options.client ?? this.client).get<GetBookCoverResponses, GetBookCoverErrors, ThrowOnError>({ url: '/books/{book_id}/cover', ...options });\n }\n \n /**\n * Delete Book Format\n *\n * Delete one format of a book.\n *\n * Removes the file for the given `book_format` of the book identified by\n * `book_id`, returning `204` with no body on success. Responds with `404` when\n * the book does not exist or it has no such format.\n */\n public deleteBookFormat<ThrowOnError extends boolean = false>(options: Options<DeleteBookFormatData, ThrowOnError>): RequestResult<DeleteBookFormatResponses, DeleteBookFormatErrors, ThrowOnError> {\n return (options.client ?? this.client).delete<DeleteBookFormatResponses, DeleteBookFormatErrors, ThrowOnError>({ url: '/books/{book_id}/formats/{book_format}', ...options });\n }\n \n /**\n * Download Book Format\n *\n * Download one format of a book.\n *\n * Returns the file for the given `book_format` of the book identified by\n * `book_id` as an `application/octet-stream` attachment, with the stored\n * filename in the `Content-Disposition` header. Responds with `404` when the\n * book lacks that format or the file is missing from storage.\n */\n public downloadBookFormat<ThrowOnError extends boolean = false>(options: Options<DownloadBookFormatData, ThrowOnError>): RequestResult<DownloadBookFormatResponses, DownloadBookFormatErrors, ThrowOnError> {\n return (options.client ?? this.client).get<DownloadBookFormatResponses, DownloadBookFormatErrors, ThrowOnError>({ url: '/books/{book_id}/formats/{book_format}', ...options });\n }\n \n /**\n * Refresh Metadata\n *\n * Re-extract metadata from a book file and return the updated book.\n *\n * Reads metadata afresh from the book's `source_format` file and merges it in:\n * fields the extraction produced replace the current ones, fields it could not\n * read are kept. Responds with `404` when the book or requested format is not\n * found, and `400` for any other refresh failure.\n */\n public refreshMetadata<ThrowOnError extends boolean = false>(options: Options<RefreshMetadataData, ThrowOnError>): RequestResult<RefreshMetadataResponses, RefreshMetadataErrors, ThrowOnError> {\n return (options.client ?? this.client).post<RefreshMetadataResponses, RefreshMetadataErrors, ThrowOnError>({\n url: '/books/{book_id}/refresh-metadata',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Send Book\n *\n * Email a book to a recipient.\n *\n * Enqueues a background job to send the book to `to_email` in the requested\n * `format` (or the best available sendable format if unspecified), and returns\n * `202` with a job to poll at `/jobs/{id}`. Responds with `404` if the book is\n * missing, `503` if SMTP is not configured, and `400` if the book has no\n * matching or sendable format.\n */\n public sendBook<ThrowOnError extends boolean = false>(options: Options<SendBookData, ThrowOnError>): RequestResult<SendBookResponses, SendBookErrors, ThrowOnError> {\n return (options.client ?? this.client).post<SendBookResponses, SendBookErrors, ThrowOnError>({\n url: '/books/{book_id}/send',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Get Config\n *\n * Return the requested config values (None when unset).\n *\n * Only known keys are returned; secret keys (the SMTP password) read back as a\n * masked placeholder when set, never their value.\n */\n public getConfig<ThrowOnError extends boolean = false>(options: Options<GetConfigData, ThrowOnError>): RequestResult<GetConfigResponses, GetConfigErrors, ThrowOnError> {\n return (options.client ?? this.client).get<GetConfigResponses, GetConfigErrors, ThrowOnError>({ url: '/config', ...options });\n }\n \n /**\n * Set Config\n *\n * Set one or more config values and return their (masked) readback.\n *\n * Only the provided keys change; others are untouched, so a UI can edit just\n * ``kindle_email`` without resending SMTP. Unknown keys → 422. After a write,\n * the mailer is rebuilt so SMTP changes take effect without a restart.\n */\n public setConfig<ThrowOnError extends boolean = false>(options: Options<SetConfigData, ThrowOnError>): RequestResult<SetConfigResponses, SetConfigErrors, ThrowOnError> {\n return (options.client ?? this.client).post<SetConfigResponses, SetConfigErrors, ThrowOnError>({\n url: '/config',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Get Email Config\n *\n * Return the non-secret SMTP settings for display.\n *\n * Reports whether SMTP is `configured` along with `host`, `port`,\n * `from_address` (falling back to the username when no explicit from is set)\n * and `security`. The password is never read or returned.\n */\n public getEmailConfig<ThrowOnError extends boolean = false>(options?: Options<GetEmailConfigData, ThrowOnError>): RequestResult<GetEmailConfigResponses, GetEmailConfigErrors, ThrowOnError> {\n return (options?.client ?? this.client).get<GetEmailConfigResponses, GetEmailConfigErrors, ThrowOnError>({ url: '/config/email', ...options });\n }\n \n /**\n * Test Email Config\n *\n * Send a test email to verify SMTP connectivity.\n *\n * Sends a test message to `to_email` and returns 204 on success. Responds 503\n * if SMTP is not configured, or 502 if the connection, authentication or send\n * fails.\n */\n public testEmailConfig<ThrowOnError extends boolean = false>(options: Options<TestEmailConfigData, ThrowOnError>): RequestResult<TestEmailConfigResponses, TestEmailConfigErrors, ThrowOnError> {\n return (options.client ?? this.client).post<TestEmailConfigResponses, TestEmailConfigErrors, ThrowOnError>({\n url: '/config/email/test',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Start Export\n *\n * Start an async Calibre export; the download link is emailed when ready.\n *\n * Enqueues a background job that snapshots the requested books (or the whole\n * library when `book_ids` is omitted) to a zip and emails a time-limited link\n * to `to_email`, returning 202 with the new job. Responds 503 when export is\n * unavailable (the calibredb binary is missing, SMTP is not configured, or no\n * public base URL is set for an absolute link), and 400 for a malformed book id.\n */\n public startExport<ThrowOnError extends boolean = false>(options: Options<StartExportData, ThrowOnError>): RequestResult<StartExportResponses, StartExportErrors, ThrowOnError> {\n return (options.client ?? this.client).post<StartExportResponses, StartExportErrors, ThrowOnError>({\n url: '/export/calibre',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options.headers\n }\n });\n }\n \n /**\n * Download Export\n *\n * Stream a finished export zip for a valid, unexpired token.\n *\n * Served via ``FileResponse``, which streams the file and honours HTTP Range\n * requests, so a large download is memory-light and resumable.\n */\n public downloadExport<ThrowOnError extends boolean = false>(options: Options<DownloadExportData, ThrowOnError>): RequestResult<DownloadExportResponses, DownloadExportErrors, ThrowOnError> {\n return (options.client ?? this.client).get<DownloadExportResponses, DownloadExportErrors, ThrowOnError>({ url: '/export/download/{token}', ...options });\n }\n \n /**\n * Health\n *\n * Report liveness and the availability of optional dependencies.\n *\n * Always returns `status` ``\"ok\"`` and the API `version`, plus the\n * Calibre binary availability (`convert_available`, `metadata_available`)\n * and whether send-to-ereader is usable (`send_available`, true when SMTP\n * is configured).\n */\n public health<ThrowOnError extends boolean = false>(options?: Options<HealthData, ThrowOnError>): RequestResult<HealthResponses, HealthErrors, ThrowOnError> {\n return (options?.client ?? this.client).get<HealthResponses, HealthErrors, ThrowOnError>({ url: '/health', ...options });\n }\n \n /**\n * Get Job\n *\n * Return the current status and progress of a single job.\n *\n * Looks up the job by `job_id` and returns its latest state for one-shot\n * polling. Responds 404 if no job with that id exists; use `/jobs/{job_id}/stream`\n * instead to follow progress live.\n */\n public getJob<ThrowOnError extends boolean = false>(options: Options<GetJobData, ThrowOnError>): RequestResult<GetJobResponses, GetJobErrors, ThrowOnError> {\n return (options.client ?? this.client).get<GetJobResponses, GetJobErrors, ThrowOnError>({ url: '/jobs/{job_id}', ...options });\n }\n \n /**\n * Stream Job\n *\n * Stream a job's status/progress as Server-Sent Events until it finishes.\n *\n * One open connection replaces repeated polling. Updates are event-driven: the\n * stream blocks (in a threadpool, so the event loop stays free) until the job\n * actually changes, then emits — so it reflects each new binary output, not a\n * fixed tick.\n */\n public streamJob<ThrowOnError extends boolean = false>(options: Options<StreamJobData, ThrowOnError>): RequestResult<StreamJobResponses, StreamJobErrors, ThrowOnError> {\n return (options.client ?? this.client).get<StreamJobResponses, StreamJobErrors, ThrowOnError>({ url: '/jobs/{job_id}/stream', ...options });\n }\n \n /**\n * Search Books\n *\n * Search books by a text query and filters.\n *\n * Returns a paginated page of books whose title, author, series or tags match\n * the query `q` (case-insensitive substring match), narrowed by the optional\n * `include_tags`, `exclude_tags`, `languages`, `formats`, and\n * `rating_min`/`rating_max` filters. Out-of-range pagination or rating values\n * are rejected with `422`.\n */\n public searchBooks<ThrowOnError extends boolean = false>(options?: Options<SearchBooksData, ThrowOnError>): RequestResult<SearchBooksResponses, SearchBooksErrors, ThrowOnError> {\n return (options?.client ?? this.client).get<SearchBooksResponses, SearchBooksErrors, ThrowOnError>({ url: '/search', ...options });\n }\n}\n"]}
package/openapi.json CHANGED
@@ -66,6 +66,17 @@
66
66
  "title": "Authors",
67
67
  "type": "array"
68
68
  },
69
+ "comment": {
70
+ "anyOf": [
71
+ {
72
+ "type": "string"
73
+ },
74
+ {
75
+ "type": "null"
76
+ }
77
+ ],
78
+ "title": "Comment"
79
+ },
69
80
  "cover_url": {
70
81
  "anyOf": [
71
82
  {
@@ -168,7 +179,8 @@
168
179
  "identifiers",
169
180
  "formats",
170
181
  "has_cover",
171
- "cover_url"
182
+ "cover_url",
183
+ "comment"
172
184
  ],
173
185
  "title": "BookOut",
174
186
  "type": "object"
@@ -346,6 +358,24 @@
346
358
  "title": "BookUpdate",
347
359
  "type": "object"
348
360
  },
361
+ "ConfigUpdate": {
362
+ "description": "Generic config write: a map of allowed keys to their new string values.\n\nOnly known keys are accepted (SMTP settings + kindle_email). Sending an empty\nstring for a secret key (the SMTP password) clears it.",
363
+ "properties": {
364
+ "values": {
365
+ "additionalProperties": {
366
+ "type": "string"
367
+ },
368
+ "description": "Config key/value pairs to set. Unknown keys are rejected.",
369
+ "title": "Values",
370
+ "type": "object"
371
+ }
372
+ },
373
+ "required": [
374
+ "values"
375
+ ],
376
+ "title": "ConfigUpdate",
377
+ "type": "object"
378
+ },
349
379
  "ConvertRequest": {
350
380
  "description": "Request to convert a book from one format to another.",
351
381
  "properties": {
@@ -814,7 +844,7 @@
814
844
  "info": {
815
845
  "summary": "Open-source core for an ebook library, exposed over HTTP.",
816
846
  "title": "Silverfish API",
817
- "version": "0.13.0"
847
+ "version": "1.0.1.dev2+d68fe21"
818
848
  },
819
849
  "openapi": "3.1.0",
820
850
  "paths": {
@@ -1634,6 +1664,136 @@
1634
1664
  ]
1635
1665
  }
1636
1666
  },
1667
+ "/config": {
1668
+ "get": {
1669
+ "description": "Return the requested config values (None when unset).\n\nOnly known keys are returned; secret keys (the SMTP password) read back as a\nmasked placeholder when set, never their value.",
1670
+ "operationId": "get_config",
1671
+ "parameters": [
1672
+ {
1673
+ "description": "Config keys to read. Unknown keys are omitted.",
1674
+ "in": "query",
1675
+ "name": "keys",
1676
+ "required": true,
1677
+ "schema": {
1678
+ "description": "Config keys to read. Unknown keys are omitted.",
1679
+ "items": {
1680
+ "type": "string"
1681
+ },
1682
+ "title": "Keys",
1683
+ "type": "array"
1684
+ }
1685
+ }
1686
+ ],
1687
+ "responses": {
1688
+ "200": {
1689
+ "content": {
1690
+ "application/json": {
1691
+ "schema": {
1692
+ "additionalProperties": {
1693
+ "anyOf": [
1694
+ {
1695
+ "type": "string"
1696
+ },
1697
+ {
1698
+ "type": "null"
1699
+ }
1700
+ ]
1701
+ },
1702
+ "title": "Response Get Config",
1703
+ "type": "object"
1704
+ }
1705
+ }
1706
+ },
1707
+ "description": "Successful Response"
1708
+ },
1709
+ "422": {
1710
+ "content": {
1711
+ "application/json": {
1712
+ "schema": {
1713
+ "$ref": "#/components/schemas/HTTPValidationError"
1714
+ }
1715
+ }
1716
+ },
1717
+ "description": "Validation Error"
1718
+ },
1719
+ "500": {
1720
+ "content": {
1721
+ "application/json": {
1722
+ "schema": {
1723
+ "$ref": "#/components/schemas/ErrorResponse"
1724
+ }
1725
+ }
1726
+ },
1727
+ "description": "Internal server error"
1728
+ }
1729
+ },
1730
+ "summary": "Get Config",
1731
+ "tags": [
1732
+ "config"
1733
+ ]
1734
+ },
1735
+ "post": {
1736
+ "description": "Set one or more config values and return their (masked) readback.\n\nOnly the provided keys change; others are untouched, so a UI can edit just\n``kindle_email`` without resending SMTP. Unknown keys \u2192 422. After a write,\nthe mailer is rebuilt so SMTP changes take effect without a restart.",
1737
+ "operationId": "set_config",
1738
+ "requestBody": {
1739
+ "content": {
1740
+ "application/json": {
1741
+ "schema": {
1742
+ "$ref": "#/components/schemas/ConfigUpdate"
1743
+ }
1744
+ }
1745
+ },
1746
+ "required": true
1747
+ },
1748
+ "responses": {
1749
+ "200": {
1750
+ "content": {
1751
+ "application/json": {
1752
+ "schema": {
1753
+ "additionalProperties": {
1754
+ "anyOf": [
1755
+ {
1756
+ "type": "string"
1757
+ },
1758
+ {
1759
+ "type": "null"
1760
+ }
1761
+ ]
1762
+ },
1763
+ "title": "Response Set Config",
1764
+ "type": "object"
1765
+ }
1766
+ }
1767
+ },
1768
+ "description": "Successful Response"
1769
+ },
1770
+ "422": {
1771
+ "content": {
1772
+ "application/json": {
1773
+ "schema": {
1774
+ "$ref": "#/components/schemas/ErrorResponse"
1775
+ }
1776
+ }
1777
+ },
1778
+ "description": "Validation error"
1779
+ },
1780
+ "500": {
1781
+ "content": {
1782
+ "application/json": {
1783
+ "schema": {
1784
+ "$ref": "#/components/schemas/ErrorResponse"
1785
+ }
1786
+ }
1787
+ },
1788
+ "description": "Internal server error"
1789
+ }
1790
+ },
1791
+ "summary": "Set Config",
1792
+ "tags": [
1793
+ "config"
1794
+ ]
1795
+ }
1796
+ },
1637
1797
  "/config/email": {
1638
1798
  "get": {
1639
1799
  "description": "Return the non-secret SMTP settings for display.\n\nReports whether SMTP is `configured` along with `host`, `port`,\n`from_address` (falling back to the username when no explicit from is set)\nand `security`. The password is never read or returned.",
package/package.json CHANGED
@@ -1,8 +1,14 @@
1
1
  {
2
2
  "name": "@silverfish-app/sdk",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Official TypeScript client for the Silverfish API, generated from its OpenAPI contract.",
5
5
  "license": "GPL-3.0-or-later",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/washingtonjnl/silverfish-core.git",
9
+ "directory": "packages/sdk-node"
10
+ },
11
+ "homepage": "https://github.com/washingtonjnl/silverfish-core/tree/main/packages/sdk-node",
6
12
  "type": "module",
7
13
  "main": "./dist/index.cjs",
8
14
  "module": "./dist/index.js",