@storyblok/api-client 0.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/LICENSE +21 -0
- package/README.md +74 -0
- package/dist/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/error.cjs +21 -0
- package/dist/error.cjs.map +1 -0
- package/dist/error.d.cts +19 -0
- package/dist/error.d.mts +19 -0
- package/dist/error.mjs +20 -0
- package/dist/error.mjs.map +1 -0
- package/dist/generated/datasource_entries/client.gen.cjs +10 -0
- package/dist/generated/datasource_entries/client.gen.cjs.map +1 -0
- package/dist/generated/datasource_entries/client.gen.mjs +10 -0
- package/dist/generated/datasource_entries/client.gen.mjs.map +1 -0
- package/dist/generated/datasource_entries/sdk.gen.cjs +21 -0
- package/dist/generated/datasource_entries/sdk.gen.cjs.map +1 -0
- package/dist/generated/datasource_entries/sdk.gen.mjs +21 -0
- package/dist/generated/datasource_entries/sdk.gen.mjs.map +1 -0
- package/dist/generated/datasource_entries/types.gen.d.cts +67 -0
- package/dist/generated/datasource_entries/types.gen.d.mts +67 -0
- package/dist/generated/datasources/client.gen.cjs +10 -0
- package/dist/generated/datasources/client.gen.cjs.map +1 -0
- package/dist/generated/datasources/client.gen.mjs +10 -0
- package/dist/generated/datasources/client.gen.mjs.map +1 -0
- package/dist/generated/datasources/sdk.gen.cjs +36 -0
- package/dist/generated/datasources/sdk.gen.cjs.map +1 -0
- package/dist/generated/datasources/sdk.gen.mjs +35 -0
- package/dist/generated/datasources/sdk.gen.mjs.map +1 -0
- package/dist/generated/datasources/types.gen.d.cts +109 -0
- package/dist/generated/datasources/types.gen.d.mts +109 -0
- package/dist/generated/links/client.gen.cjs +10 -0
- package/dist/generated/links/client.gen.cjs.map +1 -0
- package/dist/generated/links/client.gen.mjs +10 -0
- package/dist/generated/links/client.gen.mjs.map +1 -0
- package/dist/generated/links/sdk.gen.cjs +21 -0
- package/dist/generated/links/sdk.gen.cjs.map +1 -0
- package/dist/generated/links/sdk.gen.mjs +21 -0
- package/dist/generated/links/sdk.gen.mjs.map +1 -0
- package/dist/generated/links/types.gen.d.cts +142 -0
- package/dist/generated/links/types.gen.d.mts +142 -0
- package/dist/generated/shared/client/client.gen.cjs +215 -0
- package/dist/generated/shared/client/client.gen.cjs.map +1 -0
- package/dist/generated/shared/client/client.gen.mjs +213 -0
- package/dist/generated/shared/client/client.gen.mjs.map +1 -0
- package/dist/generated/shared/client/index.cjs +4 -0
- package/dist/generated/shared/client/index.mjs +6 -0
- package/dist/generated/shared/client/types.gen.d.cts +103 -0
- package/dist/generated/shared/client/types.gen.d.mts +103 -0
- package/dist/generated/shared/client/utils.gen.cjs +188 -0
- package/dist/generated/shared/client/utils.gen.cjs.map +1 -0
- package/dist/generated/shared/client/utils.gen.d.cts +21 -0
- package/dist/generated/shared/client/utils.gen.d.mts +21 -0
- package/dist/generated/shared/client/utils.gen.mjs +182 -0
- package/dist/generated/shared/client/utils.gen.mjs.map +1 -0
- package/dist/generated/shared/core/auth.gen.cjs +13 -0
- package/dist/generated/shared/core/auth.gen.cjs.map +1 -0
- package/dist/generated/shared/core/auth.gen.d.cts +21 -0
- package/dist/generated/shared/core/auth.gen.d.mts +21 -0
- package/dist/generated/shared/core/auth.gen.mjs +12 -0
- package/dist/generated/shared/core/auth.gen.mjs.map +1 -0
- package/dist/generated/shared/core/bodySerializer.gen.cjs +7 -0
- package/dist/generated/shared/core/bodySerializer.gen.cjs.map +1 -0
- package/dist/generated/shared/core/bodySerializer.gen.d.cts +20 -0
- package/dist/generated/shared/core/bodySerializer.gen.d.mts +20 -0
- package/dist/generated/shared/core/bodySerializer.gen.mjs +6 -0
- package/dist/generated/shared/core/bodySerializer.gen.mjs.map +1 -0
- package/dist/generated/shared/core/params.gen.cjs +11 -0
- package/dist/generated/shared/core/params.gen.cjs.map +1 -0
- package/dist/generated/shared/core/params.gen.mjs +11 -0
- package/dist/generated/shared/core/params.gen.mjs.map +1 -0
- package/dist/generated/shared/core/pathSerializer.gen.cjs +85 -0
- package/dist/generated/shared/core/pathSerializer.gen.cjs.map +1 -0
- package/dist/generated/shared/core/pathSerializer.gen.d.cts +13 -0
- package/dist/generated/shared/core/pathSerializer.gen.d.mts +13 -0
- package/dist/generated/shared/core/pathSerializer.gen.mjs +82 -0
- package/dist/generated/shared/core/pathSerializer.gen.mjs.map +1 -0
- package/dist/generated/shared/core/serverSentEvents.gen.cjs +96 -0
- package/dist/generated/shared/core/serverSentEvents.gen.cjs.map +1 -0
- package/dist/generated/shared/core/serverSentEvents.gen.d.cts +72 -0
- package/dist/generated/shared/core/serverSentEvents.gen.d.mts +72 -0
- package/dist/generated/shared/core/serverSentEvents.gen.mjs +95 -0
- package/dist/generated/shared/core/serverSentEvents.gen.mjs.map +1 -0
- package/dist/generated/shared/core/types.gen.d.cts +61 -0
- package/dist/generated/shared/core/types.gen.d.mts +61 -0
- package/dist/generated/shared/core/utils.gen.cjs +80 -0
- package/dist/generated/shared/core/utils.gen.cjs.map +1 -0
- package/dist/generated/shared/core/utils.gen.mjs +79 -0
- package/dist/generated/shared/core/utils.gen.mjs.map +1 -0
- package/dist/generated/spaces/client.gen.cjs +10 -0
- package/dist/generated/spaces/client.gen.cjs.map +1 -0
- package/dist/generated/spaces/client.gen.mjs +10 -0
- package/dist/generated/spaces/client.gen.mjs.map +1 -0
- package/dist/generated/spaces/sdk.gen.cjs +21 -0
- package/dist/generated/spaces/sdk.gen.cjs.map +1 -0
- package/dist/generated/spaces/sdk.gen.mjs +21 -0
- package/dist/generated/spaces/sdk.gen.mjs.map +1 -0
- package/dist/generated/spaces/types.gen.d.cts +34 -0
- package/dist/generated/spaces/types.gen.d.mts +34 -0
- package/dist/generated/stories/client.gen.cjs +10 -0
- package/dist/generated/stories/client.gen.cjs.map +1 -0
- package/dist/generated/stories/client.gen.mjs +10 -0
- package/dist/generated/stories/client.gen.mjs.map +1 -0
- package/dist/generated/stories/sdk.gen.cjs +36 -0
- package/dist/generated/stories/sdk.gen.cjs.map +1 -0
- package/dist/generated/stories/sdk.gen.mjs +35 -0
- package/dist/generated/stories/sdk.gen.mjs.map +1 -0
- package/dist/generated/stories/types.gen.d.cts +544 -0
- package/dist/generated/stories/types.gen.d.mts +544 -0
- package/dist/generated/tags/client.gen.cjs +10 -0
- package/dist/generated/tags/client.gen.cjs.map +1 -0
- package/dist/generated/tags/client.gen.mjs +10 -0
- package/dist/generated/tags/client.gen.mjs.map +1 -0
- package/dist/generated/tags/sdk.gen.cjs +21 -0
- package/dist/generated/tags/sdk.gen.cjs.map +1 -0
- package/dist/generated/tags/sdk.gen.mjs +21 -0
- package/dist/generated/tags/sdk.gen.mjs.map +1 -0
- package/dist/generated/tags/types.gen.d.cts +44 -0
- package/dist/generated/tags/types.gen.d.mts +44 -0
- package/dist/index.cjs +155 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +161 -0
- package/dist/index.d.mts +161 -0
- package/dist/index.mjs +150 -0
- package/dist/index.mjs.map +1 -0
- package/dist/resources/datasource-entries.cjs +22 -0
- package/dist/resources/datasource-entries.cjs.map +1 -0
- package/dist/resources/datasource-entries.mjs +22 -0
- package/dist/resources/datasource-entries.mjs.map +1 -0
- package/dist/resources/datasources.cjs +37 -0
- package/dist/resources/datasources.cjs.map +1 -0
- package/dist/resources/datasources.mjs +37 -0
- package/dist/resources/datasources.mjs.map +1 -0
- package/dist/resources/links.cjs +22 -0
- package/dist/resources/links.cjs.map +1 -0
- package/dist/resources/links.mjs +22 -0
- package/dist/resources/links.mjs.map +1 -0
- package/dist/resources/spaces.cjs +22 -0
- package/dist/resources/spaces.cjs.map +1 -0
- package/dist/resources/spaces.mjs +22 -0
- package/dist/resources/spaces.mjs.map +1 -0
- package/dist/resources/stories.cjs +69 -0
- package/dist/resources/stories.cjs.map +1 -0
- package/dist/resources/stories.d.cts +16 -0
- package/dist/resources/stories.d.mts +16 -0
- package/dist/resources/stories.mjs +69 -0
- package/dist/resources/stories.mjs.map +1 -0
- package/dist/resources/tags.cjs +22 -0
- package/dist/resources/tags.cjs.map +1 -0
- package/dist/resources/tags.mjs +22 -0
- package/dist/resources/tags.mjs.map +1 -0
- package/dist/types.d.cts +19 -0
- package/dist/types.d.mts +19 -0
- package/dist/utils/array.cjs +12 -0
- package/dist/utils/array.cjs.map +1 -0
- package/dist/utils/array.mjs +11 -0
- package/dist/utils/array.mjs.map +1 -0
- package/dist/utils/cache.cjs +73 -0
- package/dist/utils/cache.cjs.map +1 -0
- package/dist/utils/cache.d.cts +26 -0
- package/dist/utils/cache.d.mts +26 -0
- package/dist/utils/cache.mjs +71 -0
- package/dist/utils/cache.mjs.map +1 -0
- package/dist/utils/cv.cjs +19 -0
- package/dist/utils/cv.cjs.map +1 -0
- package/dist/utils/cv.mjs +18 -0
- package/dist/utils/cv.mjs.map +1 -0
- package/dist/utils/fetch-rel-uuids.cjs +45 -0
- package/dist/utils/fetch-rel-uuids.cjs.map +1 -0
- package/dist/utils/fetch-rel-uuids.mjs +45 -0
- package/dist/utils/fetch-rel-uuids.mjs.map +1 -0
- package/dist/utils/inline-relations.cjs +86 -0
- package/dist/utils/inline-relations.cjs.map +1 -0
- package/dist/utils/inline-relations.mjs +84 -0
- package/dist/utils/inline-relations.mjs.map +1 -0
- package/dist/utils/rate-limit.cjs +140 -0
- package/dist/utils/rate-limit.cjs.map +1 -0
- package/dist/utils/rate-limit.d.cts +36 -0
- package/dist/utils/rate-limit.d.mts +36 -0
- package/dist/utils/rate-limit.mjs +137 -0
- package/dist/utils/rate-limit.mjs.map +1 -0
- package/dist/utils/request.cjs +38 -0
- package/dist/utils/request.cjs.map +1 -0
- package/dist/utils/request.mjs +35 -0
- package/dist/utils/request.mjs.map +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
//#region src/generated/shared/core/serverSentEvents.gen.ts
|
|
2
|
+
const createSseClient = ({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url, ...options }) => {
|
|
3
|
+
let lastEventId;
|
|
4
|
+
const sleep = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
5
|
+
const createStream = async function* () {
|
|
6
|
+
let retryDelay = sseDefaultRetryDelay ?? 3e3;
|
|
7
|
+
let attempt = 0;
|
|
8
|
+
const signal = options.signal ?? new AbortController().signal;
|
|
9
|
+
while (true) {
|
|
10
|
+
if (signal.aborted) break;
|
|
11
|
+
attempt++;
|
|
12
|
+
const headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
|
|
13
|
+
if (lastEventId !== void 0) headers.set("Last-Event-ID", lastEventId);
|
|
14
|
+
try {
|
|
15
|
+
const requestInit = {
|
|
16
|
+
redirect: "follow",
|
|
17
|
+
...options,
|
|
18
|
+
body: options.serializedBody,
|
|
19
|
+
headers,
|
|
20
|
+
signal
|
|
21
|
+
};
|
|
22
|
+
let request = new Request(url, requestInit);
|
|
23
|
+
if (onRequest) request = await onRequest(url, requestInit);
|
|
24
|
+
const response = await (options.fetch ?? globalThis.fetch)(request);
|
|
25
|
+
if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`);
|
|
26
|
+
if (!response.body) throw new Error("No body in SSE response");
|
|
27
|
+
const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
|
|
28
|
+
let buffer = "";
|
|
29
|
+
const abortHandler = () => {
|
|
30
|
+
try {
|
|
31
|
+
reader.cancel();
|
|
32
|
+
} catch {}
|
|
33
|
+
};
|
|
34
|
+
signal.addEventListener("abort", abortHandler);
|
|
35
|
+
try {
|
|
36
|
+
while (true) {
|
|
37
|
+
const { done, value } = await reader.read();
|
|
38
|
+
if (done) break;
|
|
39
|
+
buffer += value;
|
|
40
|
+
buffer = buffer.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
41
|
+
const chunks = buffer.split("\n\n");
|
|
42
|
+
buffer = chunks.pop() ?? "";
|
|
43
|
+
for (const chunk of chunks) {
|
|
44
|
+
const lines = chunk.split("\n");
|
|
45
|
+
const dataLines = [];
|
|
46
|
+
let eventName;
|
|
47
|
+
for (const line of lines) if (line.startsWith("data:")) dataLines.push(line.replace(/^data:\s*/, ""));
|
|
48
|
+
else if (line.startsWith("event:")) eventName = line.replace(/^event:\s*/, "");
|
|
49
|
+
else if (line.startsWith("id:")) lastEventId = line.replace(/^id:\s*/, "");
|
|
50
|
+
else if (line.startsWith("retry:")) {
|
|
51
|
+
const parsed = Number.parseInt(line.replace(/^retry:\s*/, ""), 10);
|
|
52
|
+
if (!Number.isNaN(parsed)) retryDelay = parsed;
|
|
53
|
+
}
|
|
54
|
+
let data;
|
|
55
|
+
let parsedJson = false;
|
|
56
|
+
if (dataLines.length) {
|
|
57
|
+
const rawData = dataLines.join("\n");
|
|
58
|
+
try {
|
|
59
|
+
data = JSON.parse(rawData);
|
|
60
|
+
parsedJson = true;
|
|
61
|
+
} catch {
|
|
62
|
+
data = rawData;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (parsedJson) {
|
|
66
|
+
if (responseValidator) await responseValidator(data);
|
|
67
|
+
if (responseTransformer) data = await responseTransformer(data);
|
|
68
|
+
}
|
|
69
|
+
onSseEvent?.({
|
|
70
|
+
data,
|
|
71
|
+
event: eventName,
|
|
72
|
+
id: lastEventId,
|
|
73
|
+
retry: retryDelay
|
|
74
|
+
});
|
|
75
|
+
if (dataLines.length) yield data;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
} finally {
|
|
79
|
+
signal.removeEventListener("abort", abortHandler);
|
|
80
|
+
reader.releaseLock();
|
|
81
|
+
}
|
|
82
|
+
break;
|
|
83
|
+
} catch (error) {
|
|
84
|
+
onSseError?.(error);
|
|
85
|
+
if (sseMaxRetryAttempts !== void 0 && attempt >= sseMaxRetryAttempts) break;
|
|
86
|
+
await sleep(Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 3e4));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
return { stream: createStream() };
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
//#endregion
|
|
94
|
+
export { createSseClient };
|
|
95
|
+
//# sourceMappingURL=serverSentEvents.gen.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverSentEvents.gen.mjs","names":[],"sources":["../../../../src/generated/shared/core/serverSentEvents.gen.ts"],"sourcesContent":["// 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 const 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 // Normalize line endings: CRLF -> LF, then CR -> LF\n buffer = buffer.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\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"],"mappings":";AAiFA,MAAa,mBAAoC,EAC/C,WACA,YACA,YACA,qBACA,mBACA,sBACA,qBACA,kBACA,YACA,KACA,GAAG,cACyD;CAC5D,IAAI;CAEJ,MAAM,QAAQ,gBAAgB,OAAe,IAAI,SAAS,YAAY,WAAW,SAAS,GAAG,CAAC;CAE9F,MAAM,eAAe,mBAAmB;EACtC,IAAI,aAAqB,wBAAwB;EACjD,IAAI,UAAU;EACd,MAAM,SAAS,QAAQ,UAAU,IAAI,iBAAiB,CAAC;AAEvD,SAAO,MAAM;AACX,OAAI,OAAO,QAAS;AAEpB;GAEA,MAAM,UACJ,QAAQ,mBAAmB,UACvB,QAAQ,UACR,IAAI,QAAQ,QAAQ,QAA8C;AAExE,OAAI,gBAAgB,OAClB,SAAQ,IAAI,iBAAiB,YAAY;AAG3C,OAAI;IACF,MAAM,cAA2B;KAC/B,UAAU;KACV,GAAG;KACH,MAAM,QAAQ;KACd;KACA;KACD;IACD,IAAI,UAAU,IAAI,QAAQ,KAAK,YAAY;AAC3C,QAAI,UACF,WAAU,MAAM,UAAU,KAAK,YAAY;IAK7C,MAAM,WAAW,OADF,QAAQ,SAAS,WAAW,OACb,QAAQ;AAEtC,QAAI,CAAC,SAAS,GAAI,OAAM,IAAI,MAAM,eAAe,SAAS,OAAO,GAAG,SAAS,aAAa;AAE1F,QAAI,CAAC,SAAS,KAAM,OAAM,IAAI,MAAM,0BAA0B;IAE9D,MAAM,SAAS,SAAS,KAAK,YAAY,IAAI,mBAAmB,CAAC,CAAC,WAAW;IAE7E,IAAI,SAAS;IAEb,MAAM,qBAAqB;AACzB,SAAI;AACF,aAAO,QAAQ;aACT;;AAKV,WAAO,iBAAiB,SAAS,aAAa;AAE9C,QAAI;AACF,YAAO,MAAM;MACX,MAAM,EAAE,MAAM,UAAU,MAAM,OAAO,MAAM;AAC3C,UAAI,KAAM;AACV,gBAAU;AAEV,eAAS,OAAO,QAAQ,SAAS,KAAK,CAAC,QAAQ,OAAO,KAAK;MAE3D,MAAM,SAAS,OAAO,MAAM,OAAO;AACnC,eAAS,OAAO,KAAK,IAAI;AAEzB,WAAK,MAAM,SAAS,QAAQ;OAC1B,MAAM,QAAQ,MAAM,MAAM,KAAK;OAC/B,MAAM,YAA2B,EAAE;OACnC,IAAI;AAEJ,YAAK,MAAM,QAAQ,MACjB,KAAI,KAAK,WAAW,QAAQ,CAC1B,WAAU,KAAK,KAAK,QAAQ,aAAa,GAAG,CAAC;gBACpC,KAAK,WAAW,SAAS,CAClC,aAAY,KAAK,QAAQ,cAAc,GAAG;gBACjC,KAAK,WAAW,MAAM,CAC/B,eAAc,KAAK,QAAQ,WAAW,GAAG;gBAChC,KAAK,WAAW,SAAS,EAAE;QACpC,MAAM,SAAS,OAAO,SAAS,KAAK,QAAQ,cAAc,GAAG,EAAE,GAAG;AAClE,YAAI,CAAC,OAAO,MAAM,OAAO,CACvB,cAAa;;OAKnB,IAAI;OACJ,IAAI,aAAa;AAEjB,WAAI,UAAU,QAAQ;QACpB,MAAM,UAAU,UAAU,KAAK,KAAK;AACpC,YAAI;AACF,gBAAO,KAAK,MAAM,QAAQ;AAC1B,sBAAa;gBACP;AACN,gBAAO;;;AAIX,WAAI,YAAY;AACd,YAAI,kBACF,OAAM,kBAAkB,KAAK;AAG/B,YAAI,oBACF,QAAO,MAAM,oBAAoB,KAAK;;AAI1C,oBAAa;QACX;QACA,OAAO;QACP,IAAI;QACJ,OAAO;QACR,CAAC;AAEF,WAAI,UAAU,OACZ,OAAM;;;cAIJ;AACR,YAAO,oBAAoB,SAAS,aAAa;AACjD,YAAO,aAAa;;AAGtB;YACO,OAAO;AAEd,iBAAa,MAAM;AAEnB,QAAI,wBAAwB,UAAa,WAAW,oBAClD;AAKF,UAAM,MADU,KAAK,IAAI,aAAa,MAAM,UAAU,IAAI,oBAAoB,IAAM,CAChE;;;;AAO1B,QAAO,EAAE,QAFM,cAAc,EAEZ"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Auth, AuthToken } from "./auth.gen.cjs";
|
|
2
|
+
import { BodySerializer, QuerySerializer, QuerySerializerOptions } from "./bodySerializer.gen.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/generated/shared/core/types.gen.d.ts
|
|
5
|
+
type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
|
|
6
|
+
interface Config {
|
|
7
|
+
/**
|
|
8
|
+
* Auth token or a function returning auth token. The resolved value will be
|
|
9
|
+
* added to the request payload as defined by its `security` array.
|
|
10
|
+
*/
|
|
11
|
+
auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
|
|
12
|
+
/**
|
|
13
|
+
* A function for serializing request body parameter. By default,
|
|
14
|
+
* {@link JSON.stringify()} will be used.
|
|
15
|
+
*/
|
|
16
|
+
bodySerializer?: BodySerializer | null;
|
|
17
|
+
/**
|
|
18
|
+
* An object containing any HTTP headers that you want to pre-populate your
|
|
19
|
+
* `Headers` object with.
|
|
20
|
+
*
|
|
21
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
|
|
22
|
+
*/
|
|
23
|
+
headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
|
|
24
|
+
/**
|
|
25
|
+
* The request method.
|
|
26
|
+
*
|
|
27
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
|
|
28
|
+
*/
|
|
29
|
+
method?: Uppercase<HttpMethod>;
|
|
30
|
+
/**
|
|
31
|
+
* A function for serializing request query parameters. By default, arrays
|
|
32
|
+
* will be exploded in form style, objects will be exploded in deepObject
|
|
33
|
+
* style, and reserved characters are percent-encoded.
|
|
34
|
+
*
|
|
35
|
+
* This method will have no effect if the native `paramsSerializer()` Axios
|
|
36
|
+
* API function is used.
|
|
37
|
+
*
|
|
38
|
+
* {@link https://swagger.io/docs/specification/serialization/#query View examples}
|
|
39
|
+
*/
|
|
40
|
+
querySerializer?: QuerySerializer | QuerySerializerOptions;
|
|
41
|
+
/**
|
|
42
|
+
* A function validating request data. This is useful if you want to ensure
|
|
43
|
+
* the request conforms to the desired shape, so it can be safely sent to
|
|
44
|
+
* the server.
|
|
45
|
+
*/
|
|
46
|
+
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
47
|
+
/**
|
|
48
|
+
* A function transforming response data before it's returned. This is useful
|
|
49
|
+
* for post-processing data, e.g. converting ISO strings into Date objects.
|
|
50
|
+
*/
|
|
51
|
+
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
52
|
+
/**
|
|
53
|
+
* A function validating response data. This is useful if you want to ensure
|
|
54
|
+
* the response conforms to the desired shape, so it can be safely passed to
|
|
55
|
+
* the transformers and returned to the user.
|
|
56
|
+
*/
|
|
57
|
+
responseValidator?: (data: unknown) => Promise<unknown>;
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { Config };
|
|
61
|
+
//# sourceMappingURL=types.gen.d.cts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Auth, AuthToken } from "./auth.gen.mjs";
|
|
2
|
+
import { BodySerializer, QuerySerializer, QuerySerializerOptions } from "./bodySerializer.gen.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/generated/shared/core/types.gen.d.ts
|
|
5
|
+
type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
|
|
6
|
+
interface Config {
|
|
7
|
+
/**
|
|
8
|
+
* Auth token or a function returning auth token. The resolved value will be
|
|
9
|
+
* added to the request payload as defined by its `security` array.
|
|
10
|
+
*/
|
|
11
|
+
auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
|
|
12
|
+
/**
|
|
13
|
+
* A function for serializing request body parameter. By default,
|
|
14
|
+
* {@link JSON.stringify()} will be used.
|
|
15
|
+
*/
|
|
16
|
+
bodySerializer?: BodySerializer | null;
|
|
17
|
+
/**
|
|
18
|
+
* An object containing any HTTP headers that you want to pre-populate your
|
|
19
|
+
* `Headers` object with.
|
|
20
|
+
*
|
|
21
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
|
|
22
|
+
*/
|
|
23
|
+
headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
|
|
24
|
+
/**
|
|
25
|
+
* The request method.
|
|
26
|
+
*
|
|
27
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
|
|
28
|
+
*/
|
|
29
|
+
method?: Uppercase<HttpMethod>;
|
|
30
|
+
/**
|
|
31
|
+
* A function for serializing request query parameters. By default, arrays
|
|
32
|
+
* will be exploded in form style, objects will be exploded in deepObject
|
|
33
|
+
* style, and reserved characters are percent-encoded.
|
|
34
|
+
*
|
|
35
|
+
* This method will have no effect if the native `paramsSerializer()` Axios
|
|
36
|
+
* API function is used.
|
|
37
|
+
*
|
|
38
|
+
* {@link https://swagger.io/docs/specification/serialization/#query View examples}
|
|
39
|
+
*/
|
|
40
|
+
querySerializer?: QuerySerializer | QuerySerializerOptions;
|
|
41
|
+
/**
|
|
42
|
+
* A function validating request data. This is useful if you want to ensure
|
|
43
|
+
* the request conforms to the desired shape, so it can be safely sent to
|
|
44
|
+
* the server.
|
|
45
|
+
*/
|
|
46
|
+
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
47
|
+
/**
|
|
48
|
+
* A function transforming response data before it's returned. This is useful
|
|
49
|
+
* for post-processing data, e.g. converting ISO strings into Date objects.
|
|
50
|
+
*/
|
|
51
|
+
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
52
|
+
/**
|
|
53
|
+
* A function validating response data. This is useful if you want to ensure
|
|
54
|
+
* the response conforms to the desired shape, so it can be safely passed to
|
|
55
|
+
* the transformers and returned to the user.
|
|
56
|
+
*/
|
|
57
|
+
responseValidator?: (data: unknown) => Promise<unknown>;
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { Config };
|
|
61
|
+
//# sourceMappingURL=types.gen.d.mts.map
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
const require_pathSerializer_gen = require('./pathSerializer.gen.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/generated/shared/core/utils.gen.ts
|
|
4
|
+
const PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
5
|
+
const defaultPathSerializer = ({ path, url: _url }) => {
|
|
6
|
+
let url = _url;
|
|
7
|
+
const matches = _url.match(PATH_PARAM_RE);
|
|
8
|
+
if (matches) for (const match of matches) {
|
|
9
|
+
let explode = false;
|
|
10
|
+
let name = match.substring(1, match.length - 1);
|
|
11
|
+
let style = "simple";
|
|
12
|
+
if (name.endsWith("*")) {
|
|
13
|
+
explode = true;
|
|
14
|
+
name = name.substring(0, name.length - 1);
|
|
15
|
+
}
|
|
16
|
+
if (name.startsWith(".")) {
|
|
17
|
+
name = name.substring(1);
|
|
18
|
+
style = "label";
|
|
19
|
+
} else if (name.startsWith(";")) {
|
|
20
|
+
name = name.substring(1);
|
|
21
|
+
style = "matrix";
|
|
22
|
+
}
|
|
23
|
+
const value = path[name];
|
|
24
|
+
if (value === void 0 || value === null) continue;
|
|
25
|
+
if (Array.isArray(value)) {
|
|
26
|
+
url = url.replace(match, require_pathSerializer_gen.serializeArrayParam({
|
|
27
|
+
explode,
|
|
28
|
+
name,
|
|
29
|
+
style,
|
|
30
|
+
value
|
|
31
|
+
}));
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (typeof value === "object") {
|
|
35
|
+
url = url.replace(match, require_pathSerializer_gen.serializeObjectParam({
|
|
36
|
+
explode,
|
|
37
|
+
name,
|
|
38
|
+
style,
|
|
39
|
+
value,
|
|
40
|
+
valueOnly: true
|
|
41
|
+
}));
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (style === "matrix") {
|
|
45
|
+
url = url.replace(match, `;${require_pathSerializer_gen.serializePrimitiveParam({
|
|
46
|
+
name,
|
|
47
|
+
value
|
|
48
|
+
})}`);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
const replaceValue = encodeURIComponent(style === "label" ? `.${value}` : value);
|
|
52
|
+
url = url.replace(match, replaceValue);
|
|
53
|
+
}
|
|
54
|
+
return url;
|
|
55
|
+
};
|
|
56
|
+
const getUrl = ({ baseUrl, path, query, querySerializer, url: _url }) => {
|
|
57
|
+
const pathUrl = _url.startsWith("/") ? _url : `/${_url}`;
|
|
58
|
+
let url = (baseUrl ?? "") + pathUrl;
|
|
59
|
+
if (path) url = defaultPathSerializer({
|
|
60
|
+
path,
|
|
61
|
+
url
|
|
62
|
+
});
|
|
63
|
+
let search = query ? querySerializer(query) : "";
|
|
64
|
+
if (search.startsWith("?")) search = search.substring(1);
|
|
65
|
+
if (search) url += `?${search}`;
|
|
66
|
+
return url;
|
|
67
|
+
};
|
|
68
|
+
function getValidRequestBody(options) {
|
|
69
|
+
const hasBody = options.body !== void 0;
|
|
70
|
+
if (hasBody && options.bodySerializer) {
|
|
71
|
+
if ("serializedBody" in options) return options.serializedBody !== void 0 && options.serializedBody !== "" ? options.serializedBody : null;
|
|
72
|
+
return options.body !== "" ? options.body : null;
|
|
73
|
+
}
|
|
74
|
+
if (hasBody) return options.body;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
exports.getUrl = getUrl;
|
|
79
|
+
exports.getValidRequestBody = getValidRequestBody;
|
|
80
|
+
//# sourceMappingURL=utils.gen.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.gen.cjs","names":["serializeArrayParam","serializeObjectParam","serializePrimitiveParam"],"sources":["../../../../src/generated/shared/core/utils.gen.ts"],"sourcesContent":["// 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 = /\\{[^{}]+\\}/g;\n\nexport const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => {\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}) => {\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}) {\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"],"mappings":";;;AAeA,MAAa,gBAAgB;AAE7B,MAAa,yBAAyB,EAAE,MAAM,KAAK,WAA2B;CAC5E,IAAI,MAAM;CACV,MAAM,UAAU,KAAK,MAAM,cAAc;AACzC,KAAI,QACF,MAAK,MAAM,SAAS,SAAS;EAC3B,IAAI,UAAU;EACd,IAAI,OAAO,MAAM,UAAU,GAAG,MAAM,SAAS,EAAE;EAC/C,IAAI,QAA6B;AAEjC,MAAI,KAAK,SAAS,IAAI,EAAE;AACtB,aAAU;AACV,UAAO,KAAK,UAAU,GAAG,KAAK,SAAS,EAAE;;AAG3C,MAAI,KAAK,WAAW,IAAI,EAAE;AACxB,UAAO,KAAK,UAAU,EAAE;AACxB,WAAQ;aACC,KAAK,WAAW,IAAI,EAAE;AAC/B,UAAO,KAAK,UAAU,EAAE;AACxB,WAAQ;;EAGV,MAAM,QAAQ,KAAK;AAEnB,MAAI,UAAU,UAAa,UAAU,KACnC;AAGF,MAAI,MAAM,QAAQ,MAAM,EAAE;AACxB,SAAM,IAAI,QAAQ,OAAOA,+CAAoB;IAAE;IAAS;IAAM;IAAO;IAAO,CAAC,CAAC;AAC9E;;AAGF,MAAI,OAAO,UAAU,UAAU;AAC7B,SAAM,IAAI,QACR,OACAC,gDAAqB;IACnB;IACA;IACA;IACO;IACP,WAAW;IACZ,CAAC,CACH;AACD;;AAGF,MAAI,UAAU,UAAU;AACtB,SAAM,IAAI,QACR,OACA,IAAIC,mDAAwB;IAC1B;IACO;IACR,CAAC,GACH;AACD;;EAGF,MAAM,eAAe,mBACnB,UAAU,UAAU,IAAI,UAAqB,MAC9C;AACD,QAAM,IAAI,QAAQ,OAAO,aAAa;;AAG1C,QAAO;;AAGT,MAAa,UAAU,EACrB,SACA,MACA,OACA,iBACA,KAAK,WAOD;CACJ,MAAM,UAAU,KAAK,WAAW,IAAI,GAAG,OAAO,IAAI;CAClD,IAAI,OAAO,WAAW,MAAM;AAC5B,KAAI,KACF,OAAM,sBAAsB;EAAE;EAAM;EAAK,CAAC;CAE5C,IAAI,SAAS,QAAQ,gBAAgB,MAAM,GAAG;AAC9C,KAAI,OAAO,WAAW,IAAI,CACxB,UAAS,OAAO,UAAU,EAAE;AAE9B,KAAI,OACF,QAAO,IAAI;AAEb,QAAO;;AAGT,SAAgB,oBAAoB,SAIjC;CACD,MAAM,UAAU,QAAQ,SAAS;AAGjC,KAFyB,WAAW,QAAQ,gBAEtB;AACpB,MAAI,oBAAoB,QAItB,QAFE,QAAQ,mBAAmB,UAAa,QAAQ,mBAAmB,KAE1C,QAAQ,iBAAiB;AAItD,SAAO,QAAQ,SAAS,KAAK,QAAQ,OAAO;;AAI9C,KAAI,QACF,QAAO,QAAQ"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { serializeArrayParam, serializeObjectParam, serializePrimitiveParam } from "./pathSerializer.gen.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/generated/shared/core/utils.gen.ts
|
|
4
|
+
const PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
5
|
+
const defaultPathSerializer = ({ path, url: _url }) => {
|
|
6
|
+
let url = _url;
|
|
7
|
+
const matches = _url.match(PATH_PARAM_RE);
|
|
8
|
+
if (matches) for (const match of matches) {
|
|
9
|
+
let explode = false;
|
|
10
|
+
let name = match.substring(1, match.length - 1);
|
|
11
|
+
let style = "simple";
|
|
12
|
+
if (name.endsWith("*")) {
|
|
13
|
+
explode = true;
|
|
14
|
+
name = name.substring(0, name.length - 1);
|
|
15
|
+
}
|
|
16
|
+
if (name.startsWith(".")) {
|
|
17
|
+
name = name.substring(1);
|
|
18
|
+
style = "label";
|
|
19
|
+
} else if (name.startsWith(";")) {
|
|
20
|
+
name = name.substring(1);
|
|
21
|
+
style = "matrix";
|
|
22
|
+
}
|
|
23
|
+
const value = path[name];
|
|
24
|
+
if (value === void 0 || value === null) continue;
|
|
25
|
+
if (Array.isArray(value)) {
|
|
26
|
+
url = url.replace(match, serializeArrayParam({
|
|
27
|
+
explode,
|
|
28
|
+
name,
|
|
29
|
+
style,
|
|
30
|
+
value
|
|
31
|
+
}));
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (typeof value === "object") {
|
|
35
|
+
url = url.replace(match, serializeObjectParam({
|
|
36
|
+
explode,
|
|
37
|
+
name,
|
|
38
|
+
style,
|
|
39
|
+
value,
|
|
40
|
+
valueOnly: true
|
|
41
|
+
}));
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (style === "matrix") {
|
|
45
|
+
url = url.replace(match, `;${serializePrimitiveParam({
|
|
46
|
+
name,
|
|
47
|
+
value
|
|
48
|
+
})}`);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
const replaceValue = encodeURIComponent(style === "label" ? `.${value}` : value);
|
|
52
|
+
url = url.replace(match, replaceValue);
|
|
53
|
+
}
|
|
54
|
+
return url;
|
|
55
|
+
};
|
|
56
|
+
const getUrl = ({ baseUrl, path, query, querySerializer, url: _url }) => {
|
|
57
|
+
const pathUrl = _url.startsWith("/") ? _url : `/${_url}`;
|
|
58
|
+
let url = (baseUrl ?? "") + pathUrl;
|
|
59
|
+
if (path) url = defaultPathSerializer({
|
|
60
|
+
path,
|
|
61
|
+
url
|
|
62
|
+
});
|
|
63
|
+
let search = query ? querySerializer(query) : "";
|
|
64
|
+
if (search.startsWith("?")) search = search.substring(1);
|
|
65
|
+
if (search) url += `?${search}`;
|
|
66
|
+
return url;
|
|
67
|
+
};
|
|
68
|
+
function getValidRequestBody(options) {
|
|
69
|
+
const hasBody = options.body !== void 0;
|
|
70
|
+
if (hasBody && options.bodySerializer) {
|
|
71
|
+
if ("serializedBody" in options) return options.serializedBody !== void 0 && options.serializedBody !== "" ? options.serializedBody : null;
|
|
72
|
+
return options.body !== "" ? options.body : null;
|
|
73
|
+
}
|
|
74
|
+
if (hasBody) return options.body;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
export { getUrl, getValidRequestBody };
|
|
79
|
+
//# sourceMappingURL=utils.gen.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.gen.mjs","names":[],"sources":["../../../../src/generated/shared/core/utils.gen.ts"],"sourcesContent":["// 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 = /\\{[^{}]+\\}/g;\n\nexport const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => {\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}) => {\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}) {\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"],"mappings":";;;AAeA,MAAa,gBAAgB;AAE7B,MAAa,yBAAyB,EAAE,MAAM,KAAK,WAA2B;CAC5E,IAAI,MAAM;CACV,MAAM,UAAU,KAAK,MAAM,cAAc;AACzC,KAAI,QACF,MAAK,MAAM,SAAS,SAAS;EAC3B,IAAI,UAAU;EACd,IAAI,OAAO,MAAM,UAAU,GAAG,MAAM,SAAS,EAAE;EAC/C,IAAI,QAA6B;AAEjC,MAAI,KAAK,SAAS,IAAI,EAAE;AACtB,aAAU;AACV,UAAO,KAAK,UAAU,GAAG,KAAK,SAAS,EAAE;;AAG3C,MAAI,KAAK,WAAW,IAAI,EAAE;AACxB,UAAO,KAAK,UAAU,EAAE;AACxB,WAAQ;aACC,KAAK,WAAW,IAAI,EAAE;AAC/B,UAAO,KAAK,UAAU,EAAE;AACxB,WAAQ;;EAGV,MAAM,QAAQ,KAAK;AAEnB,MAAI,UAAU,UAAa,UAAU,KACnC;AAGF,MAAI,MAAM,QAAQ,MAAM,EAAE;AACxB,SAAM,IAAI,QAAQ,OAAO,oBAAoB;IAAE;IAAS;IAAM;IAAO;IAAO,CAAC,CAAC;AAC9E;;AAGF,MAAI,OAAO,UAAU,UAAU;AAC7B,SAAM,IAAI,QACR,OACA,qBAAqB;IACnB;IACA;IACA;IACO;IACP,WAAW;IACZ,CAAC,CACH;AACD;;AAGF,MAAI,UAAU,UAAU;AACtB,SAAM,IAAI,QACR,OACA,IAAI,wBAAwB;IAC1B;IACO;IACR,CAAC,GACH;AACD;;EAGF,MAAM,eAAe,mBACnB,UAAU,UAAU,IAAI,UAAqB,MAC9C;AACD,QAAM,IAAI,QAAQ,OAAO,aAAa;;AAG1C,QAAO;;AAGT,MAAa,UAAU,EACrB,SACA,MACA,OACA,iBACA,KAAK,WAOD;CACJ,MAAM,UAAU,KAAK,WAAW,IAAI,GAAG,OAAO,IAAI;CAClD,IAAI,OAAO,WAAW,MAAM;AAC5B,KAAI,KACF,OAAM,sBAAsB;EAAE;EAAM;EAAK,CAAC;CAE5C,IAAI,SAAS,QAAQ,gBAAgB,MAAM,GAAG;AAC9C,KAAI,OAAO,WAAW,IAAI,CACxB,UAAS,OAAO,UAAU,EAAE;AAE9B,KAAI,OACF,QAAO,IAAI;AAEb,QAAO;;AAGT,SAAgB,oBAAoB,SAIjC;CACD,MAAM,UAAU,QAAQ,SAAS;AAGjC,KAFyB,WAAW,QAAQ,gBAEtB;AACpB,MAAI,oBAAoB,QAItB,QAFE,QAAQ,mBAAmB,UAAa,QAAQ,mBAAmB,KAE1C,QAAQ,iBAAiB;AAItD,SAAO,QAAQ,SAAS,KAAK,QAAQ,OAAO;;AAI9C,KAAI,QACF,QAAO,QAAQ"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const require_utils_gen = require('../shared/client/utils.gen.cjs');
|
|
2
|
+
const require_client_gen = require('../shared/client/client.gen.cjs');
|
|
3
|
+
require('../shared/client/index.cjs');
|
|
4
|
+
|
|
5
|
+
//#region src/generated/spaces/client.gen.ts
|
|
6
|
+
const client = require_client_gen.createClient(require_utils_gen.createConfig({ baseUrl: "https://api.storyblok.com" }));
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
exports.client = client;
|
|
10
|
+
//# sourceMappingURL=client.gen.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.gen.cjs","names":["createClient","createConfig"],"sources":["../../../src/generated/spaces/client.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport { type ClientOptions, type Config, createClient, createConfig } from '../shared/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 = createClient(createConfig<ClientOptions2>({ baseUrl: 'https://api.storyblok.com' }));\n"],"mappings":";;;;;AAeA,MAAa,SAASA,gCAAaC,+BAA6B,EAAE,SAAS,6BAA6B,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createConfig } from "../shared/client/utils.gen.mjs";
|
|
2
|
+
import { createClient } from "../shared/client/client.gen.mjs";
|
|
3
|
+
import "../shared/client/index.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/generated/spaces/client.gen.ts
|
|
6
|
+
const client = createClient(createConfig({ baseUrl: "https://api.storyblok.com" }));
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { client };
|
|
10
|
+
//# sourceMappingURL=client.gen.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.gen.mjs","names":[],"sources":["../../../src/generated/spaces/client.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport { type ClientOptions, type Config, createClient, createConfig } from '../shared/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 = createClient(createConfig<ClientOptions2>({ baseUrl: 'https://api.storyblok.com' }));\n"],"mappings":";;;;;AAeA,MAAa,SAAS,aAAa,aAA6B,EAAE,SAAS,6BAA6B,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const require_client_gen = require('./client.gen.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/generated/spaces/sdk.gen.ts
|
|
4
|
+
/**
|
|
5
|
+
* Retrieve Current Space
|
|
6
|
+
*
|
|
7
|
+
* Returns information about the current space
|
|
8
|
+
*/
|
|
9
|
+
const get = (options) => (options?.client ?? require_client_gen.client).get({
|
|
10
|
+
security: [{
|
|
11
|
+
in: "query",
|
|
12
|
+
name: "token",
|
|
13
|
+
type: "apiKey"
|
|
14
|
+
}],
|
|
15
|
+
url: "/v2/cdn/spaces/me",
|
|
16
|
+
...options
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
exports.get = get;
|
|
21
|
+
//# sourceMappingURL=sdk.gen.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.gen.cjs","names":["client"],"sources":["../../../src/generated/spaces/sdk.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { Client, Options as Options2, TDataShape } from '../shared/client';\nimport { client } from './client.gen';\nimport type { GetData, GetErrors, GetResponses } from './types.gen';\n\nexport type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {\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?: Record<string, unknown>;\n};\n\n/**\n * Retrieve Current Space\n *\n * Returns information about the current space\n */\nexport const get = <ThrowOnError extends boolean = false>(options?: Options<GetData, ThrowOnError>) => (options?.client ?? client).get<GetResponses, GetErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/spaces/me',\n ...options\n});\n"],"mappings":";;;;;;;;AAyBA,MAAa,OAA6C,aAA8C,SAAS,UAAUA,2BAAQ,IAA2C;CAC1K,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { client } from "./client.gen.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/generated/spaces/sdk.gen.ts
|
|
4
|
+
/**
|
|
5
|
+
* Retrieve Current Space
|
|
6
|
+
*
|
|
7
|
+
* Returns information about the current space
|
|
8
|
+
*/
|
|
9
|
+
const get = (options) => (options?.client ?? client).get({
|
|
10
|
+
security: [{
|
|
11
|
+
in: "query",
|
|
12
|
+
name: "token",
|
|
13
|
+
type: "apiKey"
|
|
14
|
+
}],
|
|
15
|
+
url: "/v2/cdn/spaces/me",
|
|
16
|
+
...options
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { get };
|
|
21
|
+
//# sourceMappingURL=sdk.gen.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.gen.mjs","names":[],"sources":["../../../src/generated/spaces/sdk.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { Client, Options as Options2, TDataShape } from '../shared/client';\nimport { client } from './client.gen';\nimport type { GetData, GetErrors, GetResponses } from './types.gen';\n\nexport type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {\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?: Record<string, unknown>;\n};\n\n/**\n * Retrieve Current Space\n *\n * Returns information about the current space\n */\nexport const get = <ThrowOnError extends boolean = false>(options?: Options<GetData, ThrowOnError>) => (options?.client ?? client).get<GetResponses, GetErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/spaces/me',\n ...options\n});\n"],"mappings":";;;;;;;;AAyBA,MAAa,OAA6C,aAA8C,SAAS,UAAU,QAAQ,IAA2C;CAC1K,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/generated/spaces/types.gen.d.ts
|
|
2
|
+
type SpaceCapi = {
|
|
3
|
+
/**
|
|
4
|
+
* Unique identifier for the space
|
|
5
|
+
*/
|
|
6
|
+
id: number;
|
|
7
|
+
/**
|
|
8
|
+
* Name of the space
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* Domain of the space
|
|
13
|
+
*/
|
|
14
|
+
domain: string;
|
|
15
|
+
/**
|
|
16
|
+
* Version number of the space
|
|
17
|
+
*/
|
|
18
|
+
version: number;
|
|
19
|
+
/**
|
|
20
|
+
* Array of language codes available in the space
|
|
21
|
+
*/
|
|
22
|
+
language_codes: Array<string>;
|
|
23
|
+
};
|
|
24
|
+
type GetResponses = {
|
|
25
|
+
/**
|
|
26
|
+
* Space details
|
|
27
|
+
*/
|
|
28
|
+
200: {
|
|
29
|
+
space: SpaceCapi;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { GetResponses, SpaceCapi };
|
|
34
|
+
//# sourceMappingURL=types.gen.d.cts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/generated/spaces/types.gen.d.ts
|
|
2
|
+
type SpaceCapi = {
|
|
3
|
+
/**
|
|
4
|
+
* Unique identifier for the space
|
|
5
|
+
*/
|
|
6
|
+
id: number;
|
|
7
|
+
/**
|
|
8
|
+
* Name of the space
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* Domain of the space
|
|
13
|
+
*/
|
|
14
|
+
domain: string;
|
|
15
|
+
/**
|
|
16
|
+
* Version number of the space
|
|
17
|
+
*/
|
|
18
|
+
version: number;
|
|
19
|
+
/**
|
|
20
|
+
* Array of language codes available in the space
|
|
21
|
+
*/
|
|
22
|
+
language_codes: Array<string>;
|
|
23
|
+
};
|
|
24
|
+
type GetResponses = {
|
|
25
|
+
/**
|
|
26
|
+
* Space details
|
|
27
|
+
*/
|
|
28
|
+
200: {
|
|
29
|
+
space: SpaceCapi;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { GetResponses, SpaceCapi };
|
|
34
|
+
//# sourceMappingURL=types.gen.d.mts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const require_utils_gen = require('../shared/client/utils.gen.cjs');
|
|
2
|
+
const require_client_gen = require('../shared/client/client.gen.cjs');
|
|
3
|
+
require('../shared/client/index.cjs');
|
|
4
|
+
|
|
5
|
+
//#region src/generated/stories/client.gen.ts
|
|
6
|
+
const client = require_client_gen.createClient(require_utils_gen.createConfig({ baseUrl: "https://api.storyblok.com" }));
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
exports.client = client;
|
|
10
|
+
//# sourceMappingURL=client.gen.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.gen.cjs","names":["createClient","createConfig"],"sources":["../../../src/generated/stories/client.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport { type ClientOptions, type Config, createClient, createConfig } from '../shared/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 = createClient(createConfig<ClientOptions2>({ baseUrl: 'https://api.storyblok.com' }));\n"],"mappings":";;;;;AAeA,MAAa,SAASA,gCAAaC,+BAA6B,EAAE,SAAS,6BAA6B,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createConfig } from "../shared/client/utils.gen.mjs";
|
|
2
|
+
import { createClient } from "../shared/client/client.gen.mjs";
|
|
3
|
+
import "../shared/client/index.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/generated/stories/client.gen.ts
|
|
6
|
+
const client = createClient(createConfig({ baseUrl: "https://api.storyblok.com" }));
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { client };
|
|
10
|
+
//# sourceMappingURL=client.gen.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.gen.mjs","names":[],"sources":["../../../src/generated/stories/client.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport { type ClientOptions, type Config, createClient, createConfig } from '../shared/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 = createClient(createConfig<ClientOptions2>({ baseUrl: 'https://api.storyblok.com' }));\n"],"mappings":";;;;;AAeA,MAAa,SAAS,aAAa,aAA6B,EAAE,SAAS,6BAA6B,CAAC,CAAC"}
|