@storyblok/api-client 0.2.3 → 1.0.0-alpha.1
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/client.cjs +176 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.cts +333 -0
- package/dist/client.d.mts +333 -0
- package/dist/client.mjs +175 -0
- package/dist/client.mjs.map +1 -0
- package/dist/error.cjs.map +1 -1
- package/dist/error.d.cts +13 -2
- package/dist/error.d.mts +13 -2
- package/dist/error.mjs.map +1 -1
- package/dist/generated/datasource_entries/types.gen.d.cts +1 -16
- package/dist/generated/datasource_entries/types.gen.d.mts +1 -16
- package/dist/generated/datasources/types.gen.d.cts +1 -28
- package/dist/generated/datasources/types.gen.d.mts +1 -28
- package/dist/generated/links/types.gen.d.cts +1 -18
- package/dist/generated/links/types.gen.d.mts +1 -18
- package/dist/generated/shared/client/index.d.mts +1 -1
- package/dist/generated/shared/client/types.gen.d.cts +39 -3
- package/dist/generated/shared/client/types.gen.d.mts +39 -3
- package/dist/generated/shared/core/serverSentEvents.gen.d.cts +4 -1
- package/dist/generated/shared/core/serverSentEvents.gen.d.mts +4 -1
- package/dist/generated/shared/core/types.gen.d.cts +14 -1
- package/dist/generated/shared/core/types.gen.d.mts +14 -1
- package/dist/generated/spaces/types.gen.d.cts +1 -9
- package/dist/generated/spaces/types.gen.d.mts +1 -9
- package/dist/generated/stories/index.d.mts +1 -1
- package/dist/generated/stories/types.gen.d.cts +72 -9
- package/dist/generated/stories/types.gen.d.mts +72 -9
- package/dist/generated/tags/types.gen.d.cts +1 -16
- package/dist/generated/tags/types.gen.d.mts +1 -16
- package/dist/index.cjs +2 -153
- package/dist/index.d.cts +4 -172
- package/dist/index.d.mts +4 -172
- package/dist/index.mjs +2 -150
- package/dist/resources/datasource-entries.cjs.map +1 -1
- package/dist/resources/datasource-entries.mjs.map +1 -1
- package/dist/resources/datasources.cjs.map +1 -1
- package/dist/resources/datasources.mjs.map +1 -1
- package/dist/resources/links.cjs.map +1 -1
- package/dist/resources/links.mjs.map +1 -1
- package/dist/resources/spaces.cjs.map +1 -1
- package/dist/resources/spaces.mjs.map +1 -1
- package/dist/resources/stories.cjs +6 -4
- package/dist/resources/stories.cjs.map +1 -1
- package/dist/resources/stories.d.cts +78 -3
- package/dist/resources/stories.d.mts +79 -3
- package/dist/resources/stories.mjs +6 -4
- package/dist/resources/stories.mjs.map +1 -1
- package/dist/resources/tags.cjs.map +1 -1
- package/dist/resources/tags.mjs.map +1 -1
- package/dist/utils/inline-relations.cjs +13 -1
- package/dist/utils/inline-relations.cjs.map +1 -1
- package/dist/utils/inline-relations.mjs +13 -1
- package/dist/utils/inline-relations.mjs.map +1 -1
- package/dist/utils/rate-limit.cjs +9 -5
- package/dist/utils/rate-limit.cjs.map +1 -1
- package/dist/utils/rate-limit.d.cts +4 -18
- package/dist/utils/rate-limit.d.mts +4 -18
- package/dist/utils/rate-limit.mjs +10 -4
- package/dist/utils/rate-limit.mjs.map +1 -1
- package/package.json +18 -8
- package/dist/index.cjs.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/types.d.cts +0 -37
- package/dist/types.d.mts +0 -37
|
@@ -61,21 +61,6 @@ type ListData = {
|
|
|
61
61
|
};
|
|
62
62
|
url: '/v2/cdn/datasources';
|
|
63
63
|
};
|
|
64
|
-
type ListResponses = {
|
|
65
|
-
/**
|
|
66
|
-
* Array of datasources
|
|
67
|
-
*/
|
|
68
|
-
200: {
|
|
69
|
-
/**
|
|
70
|
-
* Array of datasource objects
|
|
71
|
-
*/
|
|
72
|
-
datasources: Array<DatasourceCapi>;
|
|
73
|
-
/**
|
|
74
|
-
* Cache version Unix timestamp
|
|
75
|
-
*/
|
|
76
|
-
cv?: number;
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
64
|
type GetData = {
|
|
80
65
|
body?: never;
|
|
81
66
|
path: {
|
|
@@ -92,18 +77,6 @@ type GetData = {
|
|
|
92
77
|
};
|
|
93
78
|
url: '/v2/cdn/datasources/{id}';
|
|
94
79
|
};
|
|
95
|
-
type GetResponses = {
|
|
96
|
-
/**
|
|
97
|
-
* Datasource details
|
|
98
|
-
*/
|
|
99
|
-
200: {
|
|
100
|
-
datasource: DatasourceCapi;
|
|
101
|
-
/**
|
|
102
|
-
* Cache version Unix timestamp
|
|
103
|
-
*/
|
|
104
|
-
cv?: number;
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
80
|
//#endregion
|
|
108
|
-
export { DatasourceCapi, GetData,
|
|
81
|
+
export { DatasourceCapi, GetData, ListData };
|
|
109
82
|
//# sourceMappingURL=types.gen.d.cts.map
|
|
@@ -61,21 +61,6 @@ type ListData = {
|
|
|
61
61
|
};
|
|
62
62
|
url: '/v2/cdn/datasources';
|
|
63
63
|
};
|
|
64
|
-
type ListResponses = {
|
|
65
|
-
/**
|
|
66
|
-
* Array of datasources
|
|
67
|
-
*/
|
|
68
|
-
200: {
|
|
69
|
-
/**
|
|
70
|
-
* Array of datasource objects
|
|
71
|
-
*/
|
|
72
|
-
datasources: Array<DatasourceCapi>;
|
|
73
|
-
/**
|
|
74
|
-
* Cache version Unix timestamp
|
|
75
|
-
*/
|
|
76
|
-
cv?: number;
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
64
|
type GetData = {
|
|
80
65
|
body?: never;
|
|
81
66
|
path: {
|
|
@@ -92,18 +77,6 @@ type GetData = {
|
|
|
92
77
|
};
|
|
93
78
|
url: '/v2/cdn/datasources/{id}';
|
|
94
79
|
};
|
|
95
|
-
type GetResponses = {
|
|
96
|
-
/**
|
|
97
|
-
* Datasource details
|
|
98
|
-
*/
|
|
99
|
-
200: {
|
|
100
|
-
datasource: DatasourceCapi;
|
|
101
|
-
/**
|
|
102
|
-
* Cache version Unix timestamp
|
|
103
|
-
*/
|
|
104
|
-
cv?: number;
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
80
|
//#endregion
|
|
108
|
-
export { DatasourceCapi, GetData,
|
|
81
|
+
export { DatasourceCapi, GetData, ListData };
|
|
109
82
|
//# sourceMappingURL=types.gen.d.mts.map
|
|
@@ -120,23 +120,6 @@ type ListData = {
|
|
|
120
120
|
};
|
|
121
121
|
url: '/v2/cdn/links';
|
|
122
122
|
};
|
|
123
|
-
type ListResponses = {
|
|
124
|
-
/**
|
|
125
|
-
* Map of links
|
|
126
|
-
*/
|
|
127
|
-
200: {
|
|
128
|
-
/**
|
|
129
|
-
* Map of link objects keyed by UUID
|
|
130
|
-
*/
|
|
131
|
-
links: {
|
|
132
|
-
[key: string]: LinkCapi;
|
|
133
|
-
};
|
|
134
|
-
/**
|
|
135
|
-
* Cache version Unix timestamp
|
|
136
|
-
*/
|
|
137
|
-
cv?: number;
|
|
138
|
-
};
|
|
139
|
-
};
|
|
140
123
|
//#endregion
|
|
141
|
-
export { LinkCapi, ListData
|
|
124
|
+
export { LinkCapi, ListData };
|
|
142
125
|
//# sourceMappingURL=types.gen.d.cts.map
|
|
@@ -120,23 +120,6 @@ type ListData = {
|
|
|
120
120
|
};
|
|
121
121
|
url: '/v2/cdn/links';
|
|
122
122
|
};
|
|
123
|
-
type ListResponses = {
|
|
124
|
-
/**
|
|
125
|
-
* Map of links
|
|
126
|
-
*/
|
|
127
|
-
200: {
|
|
128
|
-
/**
|
|
129
|
-
* Map of link objects keyed by UUID
|
|
130
|
-
*/
|
|
131
|
-
links: {
|
|
132
|
-
[key: string]: LinkCapi;
|
|
133
|
-
};
|
|
134
|
-
/**
|
|
135
|
-
* Cache version Unix timestamp
|
|
136
|
-
*/
|
|
137
|
-
cv?: number;
|
|
138
|
-
};
|
|
139
|
-
};
|
|
140
123
|
//#endregion
|
|
141
|
-
export { LinkCapi, ListData
|
|
124
|
+
export { LinkCapi, ListData };
|
|
142
125
|
//# sourceMappingURL=types.gen.d.mts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Auth } from "../core/auth.gen.mjs";
|
|
2
2
|
import { QuerySerializerOptions } from "../core/bodySerializer.gen.mjs";
|
|
3
|
-
import { ClientOptions, Config, RequestOptions, ResolvedRequestOptions, ResponseStyle, RetryOptions } from "./types.gen.mjs";
|
|
3
|
+
import { Client, ClientOptions, Config, Options, RequestOptions, RequestResult, ResolvedRequestOptions, ResponseStyle, RetryOptions, TDataShape } from "./types.gen.mjs";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Auth } from "../core/auth.gen.cjs";
|
|
2
|
-
import { Config as Config$1 } from "../core/types.gen.cjs";
|
|
3
|
-
import { ServerSentEventsOptions } from "../core/serverSentEvents.gen.cjs";
|
|
2
|
+
import { Client as Client$1, Config as Config$1 } from "../core/types.gen.cjs";
|
|
3
|
+
import { ServerSentEventsOptions, ServerSentEventsResult } from "../core/serverSentEvents.gen.cjs";
|
|
4
|
+
import { Middleware } from "./utils.gen.cjs";
|
|
4
5
|
import ky, { Options } from "ky";
|
|
5
6
|
|
|
6
7
|
//#region src/generated/shared/client/types.gen.d.ts
|
|
@@ -93,11 +94,46 @@ interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle =
|
|
|
93
94
|
interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
94
95
|
serializedBody?: string;
|
|
95
96
|
}
|
|
97
|
+
type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
|
|
98
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
99
|
+
request: Request;
|
|
100
|
+
response: Response;
|
|
101
|
+
}> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
|
|
102
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
103
|
+
error: undefined;
|
|
104
|
+
} | {
|
|
105
|
+
data: undefined;
|
|
106
|
+
error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
|
|
107
|
+
}) & {
|
|
108
|
+
request: Request;
|
|
109
|
+
response: Response;
|
|
110
|
+
}>;
|
|
96
111
|
interface ClientOptions {
|
|
97
112
|
baseUrl?: string;
|
|
98
113
|
responseStyle?: ResponseStyle;
|
|
99
114
|
throwOnError?: boolean;
|
|
100
115
|
}
|
|
116
|
+
type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
117
|
+
type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
|
|
118
|
+
type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
119
|
+
type BuildUrlFn = <TData extends {
|
|
120
|
+
body?: unknown;
|
|
121
|
+
path?: Record<string, unknown>;
|
|
122
|
+
query?: Record<string, unknown>;
|
|
123
|
+
url: string;
|
|
124
|
+
}>(options: TData & Options$1<TData>) => string;
|
|
125
|
+
type Client = Client$1<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
|
|
126
|
+
interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
|
|
127
|
+
};
|
|
128
|
+
interface TDataShape {
|
|
129
|
+
body?: unknown;
|
|
130
|
+
headers?: unknown;
|
|
131
|
+
path?: unknown;
|
|
132
|
+
query?: unknown;
|
|
133
|
+
url: string;
|
|
134
|
+
}
|
|
135
|
+
type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
136
|
+
type Options$1<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
|
|
101
137
|
//#endregion
|
|
102
|
-
export { RequestOptions, ResolvedRequestOptions };
|
|
138
|
+
export { Client, RequestOptions, ResolvedRequestOptions };
|
|
103
139
|
//# sourceMappingURL=types.gen.d.cts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Auth } from "../core/auth.gen.mjs";
|
|
2
|
-
import { Config as Config$1 } from "../core/types.gen.mjs";
|
|
3
|
-
import { ServerSentEventsOptions } from "../core/serverSentEvents.gen.mjs";
|
|
2
|
+
import { Client as Client$1, Config as Config$1 } from "../core/types.gen.mjs";
|
|
3
|
+
import { ServerSentEventsOptions, ServerSentEventsResult } from "../core/serverSentEvents.gen.mjs";
|
|
4
|
+
import { Middleware } from "./utils.gen.mjs";
|
|
4
5
|
import ky, { Options } from "ky";
|
|
5
6
|
|
|
6
7
|
//#region src/generated/shared/client/types.gen.d.ts
|
|
@@ -93,11 +94,46 @@ interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle =
|
|
|
93
94
|
interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
94
95
|
serializedBody?: string;
|
|
95
96
|
}
|
|
97
|
+
type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
|
|
98
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
99
|
+
request: Request;
|
|
100
|
+
response: Response;
|
|
101
|
+
}> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
|
|
102
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
103
|
+
error: undefined;
|
|
104
|
+
} | {
|
|
105
|
+
data: undefined;
|
|
106
|
+
error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
|
|
107
|
+
}) & {
|
|
108
|
+
request: Request;
|
|
109
|
+
response: Response;
|
|
110
|
+
}>;
|
|
96
111
|
interface ClientOptions {
|
|
97
112
|
baseUrl?: string;
|
|
98
113
|
responseStyle?: ResponseStyle;
|
|
99
114
|
throwOnError?: boolean;
|
|
100
115
|
}
|
|
116
|
+
type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
117
|
+
type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
|
|
118
|
+
type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
119
|
+
type BuildUrlFn = <TData extends {
|
|
120
|
+
body?: unknown;
|
|
121
|
+
path?: Record<string, unknown>;
|
|
122
|
+
query?: Record<string, unknown>;
|
|
123
|
+
url: string;
|
|
124
|
+
}>(options: TData & Options$1<TData>) => string;
|
|
125
|
+
type Client = Client$1<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
|
|
126
|
+
interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
|
|
127
|
+
};
|
|
128
|
+
interface TDataShape {
|
|
129
|
+
body?: unknown;
|
|
130
|
+
headers?: unknown;
|
|
131
|
+
path?: unknown;
|
|
132
|
+
query?: unknown;
|
|
133
|
+
url: string;
|
|
134
|
+
}
|
|
135
|
+
type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
136
|
+
type Options$1<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
|
|
101
137
|
//#endregion
|
|
102
|
-
export { ClientOptions, Config, RequestOptions, ResolvedRequestOptions, ResponseStyle, RetryOptions$1 as RetryOptions };
|
|
138
|
+
export { Client, ClientOptions, Config, Options$1 as Options, RequestOptions, RequestResult, ResolvedRequestOptions, ResponseStyle, RetryOptions$1 as RetryOptions, TDataShape };
|
|
103
139
|
//# sourceMappingURL=types.gen.d.mts.map
|
|
@@ -67,6 +67,9 @@ interface StreamEvent<TData = unknown> {
|
|
|
67
67
|
id?: string;
|
|
68
68
|
retry?: number;
|
|
69
69
|
}
|
|
70
|
+
type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
|
|
71
|
+
stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
|
|
72
|
+
};
|
|
70
73
|
//#endregion
|
|
71
|
-
export { ServerSentEventsOptions };
|
|
74
|
+
export { ServerSentEventsOptions, ServerSentEventsResult };
|
|
72
75
|
//# sourceMappingURL=serverSentEvents.gen.d.cts.map
|
|
@@ -67,6 +67,9 @@ interface StreamEvent<TData = unknown> {
|
|
|
67
67
|
id?: string;
|
|
68
68
|
retry?: number;
|
|
69
69
|
}
|
|
70
|
+
type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
|
|
71
|
+
stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
|
|
72
|
+
};
|
|
70
73
|
//#endregion
|
|
71
|
-
export { ServerSentEventsOptions };
|
|
74
|
+
export { ServerSentEventsOptions, ServerSentEventsResult };
|
|
72
75
|
//# sourceMappingURL=serverSentEvents.gen.d.mts.map
|
|
@@ -3,6 +3,19 @@ import { BodySerializer, QuerySerializer, QuerySerializerOptions } from "./bodyS
|
|
|
3
3
|
|
|
4
4
|
//#region src/generated/shared/core/types.gen.d.ts
|
|
5
5
|
type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
|
|
6
|
+
type Client<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
|
|
7
|
+
/**
|
|
8
|
+
* Returns the final request URL.
|
|
9
|
+
*/
|
|
10
|
+
buildUrl: BuildUrlFn;
|
|
11
|
+
getConfig: () => Config;
|
|
12
|
+
request: RequestFn;
|
|
13
|
+
setConfig: (config: Config) => Config;
|
|
14
|
+
} & { [K in HttpMethod]: MethodFn } & ([SseFn] extends [never] ? {
|
|
15
|
+
sse?: never;
|
|
16
|
+
} : {
|
|
17
|
+
sse: { [K in HttpMethod]: SseFn };
|
|
18
|
+
});
|
|
6
19
|
interface Config {
|
|
7
20
|
/**
|
|
8
21
|
* Auth token or a function returning auth token. The resolved value will be
|
|
@@ -57,5 +70,5 @@ interface Config {
|
|
|
57
70
|
responseValidator?: (data: unknown) => Promise<unknown>;
|
|
58
71
|
}
|
|
59
72
|
//#endregion
|
|
60
|
-
export { Config };
|
|
73
|
+
export { Client, Config };
|
|
61
74
|
//# sourceMappingURL=types.gen.d.cts.map
|
|
@@ -3,6 +3,19 @@ import { BodySerializer, QuerySerializer, QuerySerializerOptions } from "./bodyS
|
|
|
3
3
|
|
|
4
4
|
//#region src/generated/shared/core/types.gen.d.ts
|
|
5
5
|
type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
|
|
6
|
+
type Client<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
|
|
7
|
+
/**
|
|
8
|
+
* Returns the final request URL.
|
|
9
|
+
*/
|
|
10
|
+
buildUrl: BuildUrlFn;
|
|
11
|
+
getConfig: () => Config;
|
|
12
|
+
request: RequestFn;
|
|
13
|
+
setConfig: (config: Config) => Config;
|
|
14
|
+
} & { [K in HttpMethod]: MethodFn } & ([SseFn] extends [never] ? {
|
|
15
|
+
sse?: never;
|
|
16
|
+
} : {
|
|
17
|
+
sse: { [K in HttpMethod]: SseFn };
|
|
18
|
+
});
|
|
6
19
|
interface Config {
|
|
7
20
|
/**
|
|
8
21
|
* Auth token or a function returning auth token. The resolved value will be
|
|
@@ -57,5 +70,5 @@ interface Config {
|
|
|
57
70
|
responseValidator?: (data: unknown) => Promise<unknown>;
|
|
58
71
|
}
|
|
59
72
|
//#endregion
|
|
60
|
-
export { Config };
|
|
73
|
+
export { Client, Config };
|
|
61
74
|
//# sourceMappingURL=types.gen.d.mts.map
|
|
@@ -21,14 +21,6 @@ type SpaceCapi = {
|
|
|
21
21
|
*/
|
|
22
22
|
language_codes: Array<string>;
|
|
23
23
|
};
|
|
24
|
-
type GetResponses = {
|
|
25
|
-
/**
|
|
26
|
-
* Space details
|
|
27
|
-
*/
|
|
28
|
-
200: {
|
|
29
|
-
space: SpaceCapi;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
24
|
//#endregion
|
|
33
|
-
export {
|
|
25
|
+
export { SpaceCapi };
|
|
34
26
|
//# sourceMappingURL=types.gen.d.cts.map
|
|
@@ -21,14 +21,6 @@ type SpaceCapi = {
|
|
|
21
21
|
*/
|
|
22
22
|
language_codes: Array<string>;
|
|
23
23
|
};
|
|
24
|
-
type GetResponses = {
|
|
25
|
-
/**
|
|
26
|
-
* Space details
|
|
27
|
-
*/
|
|
28
|
-
200: {
|
|
29
|
-
space: SpaceCapi;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
24
|
//#endregion
|
|
33
|
-
export {
|
|
25
|
+
export { SpaceCapi };
|
|
34
26
|
//# sourceMappingURL=types.gen.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AssetFieldValue, BlokContent, GetData, GetResponses, ListData, ListResponses, MultilinkFieldValue, PluginFieldValue, RichtextFieldValue, StoryAlternate, StoryBase, StoryCapi, StoryLocalizedPath, StoryTranslatedSlug, TableFieldValue } from "./types.gen.mjs";
|
|
@@ -35,7 +35,7 @@ type StoryAlternate = {
|
|
|
35
35
|
/**
|
|
36
36
|
* Asset field type - single asset (image, video, audio, or document)
|
|
37
37
|
*/
|
|
38
|
-
type
|
|
38
|
+
type AssetFieldValue = {
|
|
39
39
|
/**
|
|
40
40
|
* Identifies this as an asset field
|
|
41
41
|
*/
|
|
@@ -86,7 +86,7 @@ type AssetField = {
|
|
|
86
86
|
/**
|
|
87
87
|
* Content object representing a component instance. Contains a _uid, a component technical name, and dynamic fields whose values depend on the component's schema field types (text, textarea, richtext, markdown, number, datetime, boolean, option, options, asset, multiasset, multilink, bloks, table, section, custom/plugin).
|
|
88
88
|
*/
|
|
89
|
-
type
|
|
89
|
+
type BlokContent = {
|
|
90
90
|
/**
|
|
91
91
|
* Unique identifier for this component instance
|
|
92
92
|
*/
|
|
@@ -99,12 +99,12 @@ type StoryContent = {
|
|
|
99
99
|
* Storyblok editor markup string for inline editing (present in draft/preview mode)
|
|
100
100
|
*/
|
|
101
101
|
_editable?: string;
|
|
102
|
-
[key: string]: string | number | boolean | Array<string |
|
|
102
|
+
[key: string]: string | number | boolean | Array<string | AssetFieldValue | BlokContent> | AssetFieldValue | MultilinkFieldValue | TableFieldValue | RichtextFieldValue | PluginFieldValue | string | undefined;
|
|
103
103
|
};
|
|
104
104
|
/**
|
|
105
105
|
* Multilink field type - link to internal stories, external URLs, emails, etc.
|
|
106
106
|
*/
|
|
107
|
-
type
|
|
107
|
+
type MultilinkFieldValue = {
|
|
108
108
|
/**
|
|
109
109
|
* Identifies this as a multilink field
|
|
110
110
|
*/
|
|
@@ -137,7 +137,7 @@ type MultilinkField = {
|
|
|
137
137
|
/**
|
|
138
138
|
* Table field type - structured table data
|
|
139
139
|
*/
|
|
140
|
-
type
|
|
140
|
+
type TableFieldValue = {
|
|
141
141
|
/**
|
|
142
142
|
* Table header cells
|
|
143
143
|
*/
|
|
@@ -171,7 +171,7 @@ type TableField = {
|
|
|
171
171
|
/**
|
|
172
172
|
* Richtext field type - structured rich text document (ProseMirror format)
|
|
173
173
|
*/
|
|
174
|
-
type
|
|
174
|
+
type RichtextFieldValue = {
|
|
175
175
|
/**
|
|
176
176
|
* Root node type for richtext documents
|
|
177
177
|
*/
|
|
@@ -186,7 +186,7 @@ type RichtextField = {
|
|
|
186
186
|
/**
|
|
187
187
|
* Plugin/Custom field type - field plugin with custom structure
|
|
188
188
|
*/
|
|
189
|
-
type
|
|
189
|
+
type PluginFieldValue = {
|
|
190
190
|
/**
|
|
191
191
|
* Technical name of the field plugin
|
|
192
192
|
*/
|
|
@@ -287,7 +287,7 @@ type StoryBase = {
|
|
|
287
287
|
* Generated UUID string
|
|
288
288
|
*/
|
|
289
289
|
readonly uuid: string;
|
|
290
|
-
content:
|
|
290
|
+
content: BlokContent;
|
|
291
291
|
/**
|
|
292
292
|
* The slug specific for the story
|
|
293
293
|
*/
|
|
@@ -483,6 +483,39 @@ type ListData = {
|
|
|
483
483
|
};
|
|
484
484
|
url: '/v2/cdn/stories';
|
|
485
485
|
};
|
|
486
|
+
type ListResponses = {
|
|
487
|
+
/**
|
|
488
|
+
* Array of stories
|
|
489
|
+
*/
|
|
490
|
+
200: {
|
|
491
|
+
/**
|
|
492
|
+
* Array of story objects
|
|
493
|
+
*/
|
|
494
|
+
stories: Array<StoryCapi>;
|
|
495
|
+
/**
|
|
496
|
+
* Cache version Unix timestamp
|
|
497
|
+
*/
|
|
498
|
+
cv?: number;
|
|
499
|
+
/**
|
|
500
|
+
* Array of resolved stories (when resolve_relations is used)
|
|
501
|
+
*/
|
|
502
|
+
rels?: Array<StoryCapi>;
|
|
503
|
+
/**
|
|
504
|
+
* Array of resolved links (when resolve_links is used)
|
|
505
|
+
*/
|
|
506
|
+
links?: Array<{
|
|
507
|
+
[key: string]: unknown;
|
|
508
|
+
}>;
|
|
509
|
+
/**
|
|
510
|
+
* Array of UUIDs of referenced stories (if limit exceeded)
|
|
511
|
+
*/
|
|
512
|
+
rel_uuids?: Array<string>;
|
|
513
|
+
/**
|
|
514
|
+
* Array of UUIDs of linked stories (if limit exceeded)
|
|
515
|
+
*/
|
|
516
|
+
link_uuids?: Array<string>;
|
|
517
|
+
};
|
|
518
|
+
};
|
|
486
519
|
type GetData = {
|
|
487
520
|
body?: never;
|
|
488
521
|
path: {
|
|
@@ -539,6 +572,36 @@ type GetData = {
|
|
|
539
572
|
};
|
|
540
573
|
url: '/v2/cdn/stories/{identifier}';
|
|
541
574
|
};
|
|
575
|
+
type GetResponses = {
|
|
576
|
+
/**
|
|
577
|
+
* Story details
|
|
578
|
+
*/
|
|
579
|
+
200: {
|
|
580
|
+
story: StoryCapi;
|
|
581
|
+
/**
|
|
582
|
+
* Cache version Unix timestamp
|
|
583
|
+
*/
|
|
584
|
+
cv?: number;
|
|
585
|
+
/**
|
|
586
|
+
* Array of resolved stories (when resolve_relations is used)
|
|
587
|
+
*/
|
|
588
|
+
rels?: Array<StoryCapi>;
|
|
589
|
+
/**
|
|
590
|
+
* Array of resolved links (when resolve_links is used)
|
|
591
|
+
*/
|
|
592
|
+
links?: Array<{
|
|
593
|
+
[key: string]: unknown;
|
|
594
|
+
}>;
|
|
595
|
+
/**
|
|
596
|
+
* Array of UUIDs of referenced stories (if limit exceeded)
|
|
597
|
+
*/
|
|
598
|
+
rel_uuids?: Array<string>;
|
|
599
|
+
/**
|
|
600
|
+
* Array of UUIDs of linked stories (if limit exceeded)
|
|
601
|
+
*/
|
|
602
|
+
link_uuids?: Array<string>;
|
|
603
|
+
};
|
|
604
|
+
};
|
|
542
605
|
//#endregion
|
|
543
|
-
export {
|
|
606
|
+
export { AssetFieldValue, BlokContent, GetData, GetResponses, ListData, ListResponses, MultilinkFieldValue, PluginFieldValue, RichtextFieldValue, StoryCapi, TableFieldValue };
|
|
544
607
|
//# sourceMappingURL=types.gen.d.cts.map
|
|
@@ -35,7 +35,7 @@ type StoryAlternate = {
|
|
|
35
35
|
/**
|
|
36
36
|
* Asset field type - single asset (image, video, audio, or document)
|
|
37
37
|
*/
|
|
38
|
-
type
|
|
38
|
+
type AssetFieldValue = {
|
|
39
39
|
/**
|
|
40
40
|
* Identifies this as an asset field
|
|
41
41
|
*/
|
|
@@ -86,7 +86,7 @@ type AssetField = {
|
|
|
86
86
|
/**
|
|
87
87
|
* Content object representing a component instance. Contains a _uid, a component technical name, and dynamic fields whose values depend on the component's schema field types (text, textarea, richtext, markdown, number, datetime, boolean, option, options, asset, multiasset, multilink, bloks, table, section, custom/plugin).
|
|
88
88
|
*/
|
|
89
|
-
type
|
|
89
|
+
type BlokContent = {
|
|
90
90
|
/**
|
|
91
91
|
* Unique identifier for this component instance
|
|
92
92
|
*/
|
|
@@ -99,12 +99,12 @@ type StoryContent = {
|
|
|
99
99
|
* Storyblok editor markup string for inline editing (present in draft/preview mode)
|
|
100
100
|
*/
|
|
101
101
|
_editable?: string;
|
|
102
|
-
[key: string]: string | number | boolean | Array<string |
|
|
102
|
+
[key: string]: string | number | boolean | Array<string | AssetFieldValue | BlokContent> | AssetFieldValue | MultilinkFieldValue | TableFieldValue | RichtextFieldValue | PluginFieldValue | string | undefined;
|
|
103
103
|
};
|
|
104
104
|
/**
|
|
105
105
|
* Multilink field type - link to internal stories, external URLs, emails, etc.
|
|
106
106
|
*/
|
|
107
|
-
type
|
|
107
|
+
type MultilinkFieldValue = {
|
|
108
108
|
/**
|
|
109
109
|
* Identifies this as a multilink field
|
|
110
110
|
*/
|
|
@@ -137,7 +137,7 @@ type MultilinkField = {
|
|
|
137
137
|
/**
|
|
138
138
|
* Table field type - structured table data
|
|
139
139
|
*/
|
|
140
|
-
type
|
|
140
|
+
type TableFieldValue = {
|
|
141
141
|
/**
|
|
142
142
|
* Table header cells
|
|
143
143
|
*/
|
|
@@ -171,7 +171,7 @@ type TableField = {
|
|
|
171
171
|
/**
|
|
172
172
|
* Richtext field type - structured rich text document (ProseMirror format)
|
|
173
173
|
*/
|
|
174
|
-
type
|
|
174
|
+
type RichtextFieldValue = {
|
|
175
175
|
/**
|
|
176
176
|
* Root node type for richtext documents
|
|
177
177
|
*/
|
|
@@ -186,7 +186,7 @@ type RichtextField = {
|
|
|
186
186
|
/**
|
|
187
187
|
* Plugin/Custom field type - field plugin with custom structure
|
|
188
188
|
*/
|
|
189
|
-
type
|
|
189
|
+
type PluginFieldValue = {
|
|
190
190
|
/**
|
|
191
191
|
* Technical name of the field plugin
|
|
192
192
|
*/
|
|
@@ -287,7 +287,7 @@ type StoryBase = {
|
|
|
287
287
|
* Generated UUID string
|
|
288
288
|
*/
|
|
289
289
|
readonly uuid: string;
|
|
290
|
-
content:
|
|
290
|
+
content: BlokContent;
|
|
291
291
|
/**
|
|
292
292
|
* The slug specific for the story
|
|
293
293
|
*/
|
|
@@ -483,6 +483,39 @@ type ListData = {
|
|
|
483
483
|
};
|
|
484
484
|
url: '/v2/cdn/stories';
|
|
485
485
|
};
|
|
486
|
+
type ListResponses = {
|
|
487
|
+
/**
|
|
488
|
+
* Array of stories
|
|
489
|
+
*/
|
|
490
|
+
200: {
|
|
491
|
+
/**
|
|
492
|
+
* Array of story objects
|
|
493
|
+
*/
|
|
494
|
+
stories: Array<StoryCapi>;
|
|
495
|
+
/**
|
|
496
|
+
* Cache version Unix timestamp
|
|
497
|
+
*/
|
|
498
|
+
cv?: number;
|
|
499
|
+
/**
|
|
500
|
+
* Array of resolved stories (when resolve_relations is used)
|
|
501
|
+
*/
|
|
502
|
+
rels?: Array<StoryCapi>;
|
|
503
|
+
/**
|
|
504
|
+
* Array of resolved links (when resolve_links is used)
|
|
505
|
+
*/
|
|
506
|
+
links?: Array<{
|
|
507
|
+
[key: string]: unknown;
|
|
508
|
+
}>;
|
|
509
|
+
/**
|
|
510
|
+
* Array of UUIDs of referenced stories (if limit exceeded)
|
|
511
|
+
*/
|
|
512
|
+
rel_uuids?: Array<string>;
|
|
513
|
+
/**
|
|
514
|
+
* Array of UUIDs of linked stories (if limit exceeded)
|
|
515
|
+
*/
|
|
516
|
+
link_uuids?: Array<string>;
|
|
517
|
+
};
|
|
518
|
+
};
|
|
486
519
|
type GetData = {
|
|
487
520
|
body?: never;
|
|
488
521
|
path: {
|
|
@@ -539,6 +572,36 @@ type GetData = {
|
|
|
539
572
|
};
|
|
540
573
|
url: '/v2/cdn/stories/{identifier}';
|
|
541
574
|
};
|
|
575
|
+
type GetResponses = {
|
|
576
|
+
/**
|
|
577
|
+
* Story details
|
|
578
|
+
*/
|
|
579
|
+
200: {
|
|
580
|
+
story: StoryCapi;
|
|
581
|
+
/**
|
|
582
|
+
* Cache version Unix timestamp
|
|
583
|
+
*/
|
|
584
|
+
cv?: number;
|
|
585
|
+
/**
|
|
586
|
+
* Array of resolved stories (when resolve_relations is used)
|
|
587
|
+
*/
|
|
588
|
+
rels?: Array<StoryCapi>;
|
|
589
|
+
/**
|
|
590
|
+
* Array of resolved links (when resolve_links is used)
|
|
591
|
+
*/
|
|
592
|
+
links?: Array<{
|
|
593
|
+
[key: string]: unknown;
|
|
594
|
+
}>;
|
|
595
|
+
/**
|
|
596
|
+
* Array of UUIDs of referenced stories (if limit exceeded)
|
|
597
|
+
*/
|
|
598
|
+
rel_uuids?: Array<string>;
|
|
599
|
+
/**
|
|
600
|
+
* Array of UUIDs of linked stories (if limit exceeded)
|
|
601
|
+
*/
|
|
602
|
+
link_uuids?: Array<string>;
|
|
603
|
+
};
|
|
604
|
+
};
|
|
542
605
|
//#endregion
|
|
543
|
-
export {
|
|
606
|
+
export { AssetFieldValue, BlokContent, GetData, GetResponses, ListData, ListResponses, MultilinkFieldValue, PluginFieldValue, RichtextFieldValue, StoryAlternate, StoryBase, StoryCapi, StoryLocalizedPath, StoryTranslatedSlug, TableFieldValue };
|
|
544
607
|
//# sourceMappingURL=types.gen.d.mts.map
|