@dazl/internal-api-client 1.6.1 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/client.gen.d.ts.map +1 -1
- package/dist/client/client.gen.js +1 -2
- package/dist/client/client.gen.js.map +1 -1
- package/dist/client/types.gen.d.ts.map +1 -1
- package/dist/client/utils.gen.d.ts.map +1 -1
- package/dist/client/utils.gen.js +2 -5
- package/dist/client/utils.gen.js.map +1 -1
- package/dist/core/auth.gen.d.ts.map +1 -1
- package/dist/core/auth.gen.js.map +1 -1
- package/dist/core/bodySerializer.gen.d.ts.map +1 -1
- package/dist/core/bodySerializer.gen.js +1 -1
- package/dist/core/bodySerializer.gen.js.map +1 -1
- package/dist/core/params.gen.d.ts.map +1 -1
- package/dist/core/params.gen.js.map +1 -1
- package/dist/core/pathSerializer.gen.d.ts.map +1 -1
- package/dist/core/pathSerializer.gen.js +3 -11
- package/dist/core/pathSerializer.gen.js.map +1 -1
- package/dist/core/queryKeySerializer.gen.d.ts.map +1 -1
- package/dist/core/queryKeySerializer.gen.js +4 -11
- package/dist/core/queryKeySerializer.gen.js.map +1 -1
- package/dist/core/serverSentEvents.gen.d.ts.map +1 -1
- package/dist/core/serverSentEvents.gen.js +3 -7
- package/dist/core/serverSentEvents.gen.js.map +1 -1
- package/dist/core/types.gen.d.ts.map +1 -1
- package/dist/core/utils.gen.d.ts.map +1 -1
- package/dist/core/utils.gen.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/sdk.gen.d.ts +2 -2
- package/dist/sdk.gen.d.ts.map +1 -1
- package/dist/sdk.gen.js +3 -3
- package/dist/sdk.gen.js.map +1 -1
- package/dist/types.gen.d.ts +69 -52
- package/dist/types.gen.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client/client.gen.ts +25 -48
- package/src/client/types.gen.ts +12 -40
- package/src/client/utils.gen.ts +6 -22
- package/src/core/auth.gen.ts +1 -2
- package/src/core/bodySerializer.gen.ts +5 -21
- package/src/core/params.gen.ts +3 -10
- package/src/core/pathSerializer.gen.ts +4 -14
- package/src/core/queryKeySerializer.gen.ts +6 -25
- package/src/core/serverSentEvents.gen.ts +8 -31
- package/src/core/types.gen.ts +4 -18
- package/src/core/utils.gen.ts +1 -4
- package/src/index.ts +1 -1
- package/src/sdk.gen.ts +5 -5
- package/src/types.gen.ts +74 -57
package/src/client/types.gen.ts
CHANGED
|
@@ -5,17 +5,13 @@ import type {
|
|
|
5
5
|
ServerSentEventsOptions,
|
|
6
6
|
ServerSentEventsResult,
|
|
7
7
|
} from '../core/serverSentEvents.gen.ts';
|
|
8
|
-
import type {
|
|
9
|
-
Client as CoreClient,
|
|
10
|
-
Config as CoreConfig,
|
|
11
|
-
} from '../core/types.gen.ts';
|
|
8
|
+
import type { Client as CoreClient, Config as CoreConfig } from '../core/types.gen.ts';
|
|
12
9
|
import type { Middleware } from './utils.gen.ts';
|
|
13
10
|
|
|
14
11
|
export type ResponseStyle = 'data' | 'fields';
|
|
15
12
|
|
|
16
13
|
export interface Config<T extends ClientOptions = ClientOptions>
|
|
17
|
-
extends Omit<RequestInit, 'body' | 'headers' | 'method'>,
|
|
18
|
-
CoreConfig {
|
|
14
|
+
extends Omit<RequestInit, 'body' | 'headers' | 'method'>, CoreConfig {
|
|
19
15
|
/**
|
|
20
16
|
* Base URL for all requests made by this client.
|
|
21
17
|
*/
|
|
@@ -42,14 +38,7 @@ export interface Config<T extends ClientOptions = ClientOptions>
|
|
|
42
38
|
*
|
|
43
39
|
* @default 'auto'
|
|
44
40
|
*/
|
|
45
|
-
parseAs?:
|
|
46
|
-
| 'arrayBuffer'
|
|
47
|
-
| 'auto'
|
|
48
|
-
| 'blob'
|
|
49
|
-
| 'formData'
|
|
50
|
-
| 'json'
|
|
51
|
-
| 'stream'
|
|
52
|
-
| 'text';
|
|
41
|
+
parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
|
|
53
42
|
/**
|
|
54
43
|
* Should we return only data or multiple fields (data, error, response, etc.)?
|
|
55
44
|
*
|
|
@@ -69,7 +58,9 @@ export interface RequestOptions<
|
|
|
69
58
|
TResponseStyle extends ResponseStyle = 'fields',
|
|
70
59
|
ThrowOnError extends boolean = boolean,
|
|
71
60
|
Url extends string = string,
|
|
72
|
-
>
|
|
61
|
+
>
|
|
62
|
+
extends
|
|
63
|
+
Config<{
|
|
73
64
|
responseStyle: TResponseStyle;
|
|
74
65
|
throwOnError: ThrowOnError;
|
|
75
66
|
}>,
|
|
@@ -116,32 +107,22 @@ export type RequestResult<
|
|
|
116
107
|
? TData[keyof TData]
|
|
117
108
|
: TData
|
|
118
109
|
: {
|
|
119
|
-
data: TData extends Record<string, unknown>
|
|
120
|
-
? TData[keyof TData]
|
|
121
|
-
: TData;
|
|
110
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
122
111
|
request: Request;
|
|
123
112
|
response: Response;
|
|
124
113
|
}
|
|
125
114
|
>
|
|
126
115
|
: Promise<
|
|
127
116
|
TResponseStyle extends 'data'
|
|
128
|
-
?
|
|
129
|
-
| (TData extends Record<string, unknown>
|
|
130
|
-
? TData[keyof TData]
|
|
131
|
-
: TData)
|
|
132
|
-
| undefined
|
|
117
|
+
? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined
|
|
133
118
|
: (
|
|
134
119
|
| {
|
|
135
|
-
data: TData extends Record<string, unknown>
|
|
136
|
-
? TData[keyof TData]
|
|
137
|
-
: TData;
|
|
120
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
138
121
|
error: undefined;
|
|
139
122
|
}
|
|
140
123
|
| {
|
|
141
124
|
data: undefined;
|
|
142
|
-
error: TError extends Record<string, unknown>
|
|
143
|
-
? TError[keyof TError]
|
|
144
|
-
: TError;
|
|
125
|
+
error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
|
|
145
126
|
}
|
|
146
127
|
) & {
|
|
147
128
|
request: Request;
|
|
@@ -180,10 +161,7 @@ type RequestFn = <
|
|
|
180
161
|
TResponseStyle extends ResponseStyle = 'fields',
|
|
181
162
|
>(
|
|
182
163
|
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> &
|
|
183
|
-
Pick<
|
|
184
|
-
Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>,
|
|
185
|
-
'method'
|
|
186
|
-
>,
|
|
164
|
+
Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>,
|
|
187
165
|
) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
188
166
|
|
|
189
167
|
type BuildUrlFn = <
|
|
@@ -197,13 +175,7 @@ type BuildUrlFn = <
|
|
|
197
175
|
options: TData & Options<TData>,
|
|
198
176
|
) => string;
|
|
199
177
|
|
|
200
|
-
export type Client = CoreClient<
|
|
201
|
-
RequestFn,
|
|
202
|
-
Config,
|
|
203
|
-
MethodFn,
|
|
204
|
-
BuildUrlFn,
|
|
205
|
-
SseFn
|
|
206
|
-
> & {
|
|
178
|
+
export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
|
|
207
179
|
interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
|
|
208
180
|
};
|
|
209
181
|
|
package/src/client/utils.gen.ts
CHANGED
|
@@ -65,9 +65,7 @@ export const createQuerySerializer = <T = unknown>({
|
|
|
65
65
|
/**
|
|
66
66
|
* Infers parseAs value from provided Content-Type header.
|
|
67
67
|
*/
|
|
68
|
-
export const getParseAs = (
|
|
69
|
-
contentType: string | null,
|
|
70
|
-
): Exclude<Config['parseAs'], 'auto'> => {
|
|
68
|
+
export const getParseAs = (contentType: string | null): Exclude<Config['parseAs'], 'auto'> => {
|
|
71
69
|
if (!contentType) {
|
|
72
70
|
// If no Content-Type header is provided, the best we can do is return the raw response body,
|
|
73
71
|
// which is effectively the same as the 'stream' option.
|
|
@@ -80,10 +78,7 @@ export const getParseAs = (
|
|
|
80
78
|
return;
|
|
81
79
|
}
|
|
82
80
|
|
|
83
|
-
if (
|
|
84
|
-
cleanContent.startsWith('application/json') ||
|
|
85
|
-
cleanContent.endsWith('+json')
|
|
86
|
-
) {
|
|
81
|
+
if (cleanContent.startsWith('application/json') || cleanContent.endsWith('+json')) {
|
|
87
82
|
return 'json';
|
|
88
83
|
}
|
|
89
84
|
|
|
@@ -92,9 +87,7 @@ export const getParseAs = (
|
|
|
92
87
|
}
|
|
93
88
|
|
|
94
89
|
if (
|
|
95
|
-
['application/', 'audio/', 'image/', 'video/'].some((type) =>
|
|
96
|
-
cleanContent.startsWith(type),
|
|
97
|
-
)
|
|
90
|
+
['application/', 'audio/', 'image/', 'video/'].some((type) => cleanContent.startsWith(type))
|
|
98
91
|
) {
|
|
99
92
|
return 'blob';
|
|
100
93
|
}
|
|
@@ -201,10 +194,7 @@ export const mergeHeaders = (
|
|
|
201
194
|
continue;
|
|
202
195
|
}
|
|
203
196
|
|
|
204
|
-
const iterator =
|
|
205
|
-
header instanceof Headers
|
|
206
|
-
? headersEntries(header)
|
|
207
|
-
: Object.entries(header);
|
|
197
|
+
const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);
|
|
208
198
|
|
|
209
199
|
for (const [key, value] of iterator) {
|
|
210
200
|
if (value === null) {
|
|
@@ -233,10 +223,7 @@ type ErrInterceptor<Err, Res, Req, Options> = (
|
|
|
233
223
|
options: Options,
|
|
234
224
|
) => Err | Promise<Err>;
|
|
235
225
|
|
|
236
|
-
type ReqInterceptor<Req, Options> = (
|
|
237
|
-
request: Req,
|
|
238
|
-
options: Options,
|
|
239
|
-
) => Req | Promise<Req>;
|
|
226
|
+
type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
|
|
240
227
|
|
|
241
228
|
type ResInterceptor<Res, Req, Options> = (
|
|
242
229
|
response: Res,
|
|
@@ -270,10 +257,7 @@ class Interceptors<Interceptor> {
|
|
|
270
257
|
return this.fns.indexOf(id);
|
|
271
258
|
}
|
|
272
259
|
|
|
273
|
-
update(
|
|
274
|
-
id: number | Interceptor,
|
|
275
|
-
fn: Interceptor,
|
|
276
|
-
): number | Interceptor | false {
|
|
260
|
+
update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false {
|
|
277
261
|
const index = this.getInterceptorIndex(id);
|
|
278
262
|
if (this.fns[index]) {
|
|
279
263
|
this.fns[index] = fn;
|
package/src/core/auth.gen.ts
CHANGED
|
@@ -23,8 +23,7 @@ export const getAuthToken = async (
|
|
|
23
23
|
auth: Auth,
|
|
24
24
|
callback: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken,
|
|
25
25
|
): Promise<string | undefined> => {
|
|
26
|
-
const token =
|
|
27
|
-
typeof callback === 'function' ? await callback(auth) : callback;
|
|
26
|
+
const token = typeof callback === 'function' ? await callback(auth) : callback;
|
|
28
27
|
|
|
29
28
|
if (!token) {
|
|
30
29
|
return;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
|
|
3
|
-
import type {
|
|
4
|
-
ArrayStyle,
|
|
5
|
-
ObjectStyle,
|
|
6
|
-
SerializerOptions,
|
|
7
|
-
} from './pathSerializer.gen.ts';
|
|
3
|
+
import type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerializer.gen.ts';
|
|
8
4
|
|
|
9
5
|
export type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
10
6
|
|
|
@@ -24,11 +20,7 @@ export type QuerySerializerOptions = QuerySerializerOptionsObject & {
|
|
|
24
20
|
parameters?: Record<string, QuerySerializerOptionsObject>;
|
|
25
21
|
};
|
|
26
22
|
|
|
27
|
-
const serializeFormDataPair = (
|
|
28
|
-
data: FormData,
|
|
29
|
-
key: string,
|
|
30
|
-
value: unknown,
|
|
31
|
-
): void => {
|
|
23
|
+
const serializeFormDataPair = (data: FormData, key: string, value: unknown): void => {
|
|
32
24
|
if (typeof value === 'string' || value instanceof Blob) {
|
|
33
25
|
data.append(key, value);
|
|
34
26
|
} else if (value instanceof Date) {
|
|
@@ -38,11 +30,7 @@ const serializeFormDataPair = (
|
|
|
38
30
|
}
|
|
39
31
|
};
|
|
40
32
|
|
|
41
|
-
const serializeUrlSearchParamsPair = (
|
|
42
|
-
data: URLSearchParams,
|
|
43
|
-
key: string,
|
|
44
|
-
value: unknown,
|
|
45
|
-
): void => {
|
|
33
|
+
const serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value: unknown): void => {
|
|
46
34
|
if (typeof value === 'string') {
|
|
47
35
|
data.append(key, value);
|
|
48
36
|
} else {
|
|
@@ -73,15 +61,11 @@ export const formDataBodySerializer = {
|
|
|
73
61
|
|
|
74
62
|
export const jsonBodySerializer = {
|
|
75
63
|
bodySerializer: <T>(body: T): string =>
|
|
76
|
-
JSON.stringify(body, (_key, value) =>
|
|
77
|
-
typeof value === 'bigint' ? value.toString() : value,
|
|
78
|
-
),
|
|
64
|
+
JSON.stringify(body, (_key, value) => (typeof value === 'bigint' ? value.toString() : value)),
|
|
79
65
|
};
|
|
80
66
|
|
|
81
67
|
export const urlSearchParamsBodySerializer = {
|
|
82
|
-
bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(
|
|
83
|
-
body: T,
|
|
84
|
-
): string => {
|
|
68
|
+
bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(body: T): string => {
|
|
85
69
|
const data = new URLSearchParams();
|
|
86
70
|
|
|
87
71
|
Object.entries(body).forEach(([key, value]) => {
|
package/src/core/params.gen.ts
CHANGED
|
@@ -102,10 +102,7 @@ const stripEmptySlots = (params: Params) => {
|
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
-
export const buildClientParams = (
|
|
106
|
-
args: ReadonlyArray<unknown>,
|
|
107
|
-
fields: FieldsConfig,
|
|
108
|
-
) => {
|
|
105
|
+
export const buildClientParams = (args: ReadonlyArray<unknown>, fields: FieldsConfig) => {
|
|
109
106
|
const params: Params = {
|
|
110
107
|
body: {},
|
|
111
108
|
headers: {},
|
|
@@ -148,15 +145,11 @@ export const buildClientParams = (
|
|
|
148
145
|
params[field.map] = value;
|
|
149
146
|
}
|
|
150
147
|
} else {
|
|
151
|
-
const extra = extraPrefixes.find(([prefix]) =>
|
|
152
|
-
key.startsWith(prefix),
|
|
153
|
-
);
|
|
148
|
+
const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix));
|
|
154
149
|
|
|
155
150
|
if (extra) {
|
|
156
151
|
const [prefix, slot] = extra;
|
|
157
|
-
(params[slot] as Record<string, unknown>)[
|
|
158
|
-
key.slice(prefix.length)
|
|
159
|
-
] = value;
|
|
152
|
+
(params[slot] as Record<string, unknown>)[key.slice(prefix.length)] = value;
|
|
160
153
|
} else if ('allowExtra' in config && config.allowExtra) {
|
|
161
154
|
for (const [slot, allowed] of Object.entries(config.allowExtra)) {
|
|
162
155
|
if (allowed) {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
|
|
3
|
-
interface SerializeOptions<T>
|
|
4
|
-
extends SerializePrimitiveOptions,
|
|
5
|
-
SerializerOptions<T> {}
|
|
3
|
+
interface SerializeOptions<T> extends SerializePrimitiveOptions, SerializerOptions<T> {}
|
|
6
4
|
|
|
7
5
|
interface SerializePrimitiveOptions {
|
|
8
6
|
allowReserved?: boolean;
|
|
@@ -105,9 +103,7 @@ export const serializeArrayParam = ({
|
|
|
105
103
|
});
|
|
106
104
|
})
|
|
107
105
|
.join(separator);
|
|
108
|
-
return style === 'label' || style === 'matrix'
|
|
109
|
-
? separator + joinedValues
|
|
110
|
-
: joinedValues;
|
|
106
|
+
return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues;
|
|
111
107
|
};
|
|
112
108
|
|
|
113
109
|
export const serializePrimitiveParam = ({
|
|
@@ -146,11 +142,7 @@ export const serializeObjectParam = ({
|
|
|
146
142
|
if (style !== 'deepObject' && !explode) {
|
|
147
143
|
let values: string[] = [];
|
|
148
144
|
Object.entries(value).forEach(([key, v]) => {
|
|
149
|
-
values = [
|
|
150
|
-
...values,
|
|
151
|
-
key,
|
|
152
|
-
allowReserved ? (v as string) : encodeURIComponent(v as string),
|
|
153
|
-
];
|
|
145
|
+
values = [...values, key, allowReserved ? (v as string) : encodeURIComponent(v as string)];
|
|
154
146
|
});
|
|
155
147
|
const joinedValues = values.join(',');
|
|
156
148
|
switch (style) {
|
|
@@ -175,7 +167,5 @@ export const serializeObjectParam = ({
|
|
|
175
167
|
}),
|
|
176
168
|
)
|
|
177
169
|
.join(separator);
|
|
178
|
-
return style === 'label' || style === 'matrix'
|
|
179
|
-
? separator + joinedValues
|
|
180
|
-
: joinedValues;
|
|
170
|
+
return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues;
|
|
181
171
|
};
|
|
@@ -15,11 +15,7 @@ export type JsonValue =
|
|
|
15
15
|
* Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes.
|
|
16
16
|
*/
|
|
17
17
|
export const queryKeyJsonReplacer = (_key: string, value: unknown) => {
|
|
18
|
-
if (
|
|
19
|
-
value === undefined ||
|
|
20
|
-
typeof value === 'function' ||
|
|
21
|
-
typeof value === 'symbol'
|
|
22
|
-
) {
|
|
18
|
+
if (value === undefined || typeof value === 'function' || typeof value === 'symbol') {
|
|
23
19
|
return undefined;
|
|
24
20
|
}
|
|
25
21
|
if (typeof value === 'bigint') {
|
|
@@ -61,9 +57,7 @@ const isPlainObject = (value: unknown): value is Record<string, unknown> => {
|
|
|
61
57
|
* Turns URLSearchParams into a sorted JSON object for deterministic keys.
|
|
62
58
|
*/
|
|
63
59
|
const serializeSearchParams = (params: URLSearchParams): JsonValue => {
|
|
64
|
-
const entries = Array.from(params.entries()).sort(([a], [b]) =>
|
|
65
|
-
a.localeCompare(b),
|
|
66
|
-
);
|
|
60
|
+
const entries = Array.from(params.entries()).sort(([a], [b]) => a.localeCompare(b));
|
|
67
61
|
const result: Record<string, JsonValue> = {};
|
|
68
62
|
|
|
69
63
|
for (const [key, value] of entries) {
|
|
@@ -86,26 +80,16 @@ const serializeSearchParams = (params: URLSearchParams): JsonValue => {
|
|
|
86
80
|
/**
|
|
87
81
|
* Normalizes any accepted value into a JSON-friendly shape for query keys.
|
|
88
82
|
*/
|
|
89
|
-
export const serializeQueryKeyValue = (
|
|
90
|
-
value: unknown,
|
|
91
|
-
): JsonValue | undefined => {
|
|
83
|
+
export const serializeQueryKeyValue = (value: unknown): JsonValue | undefined => {
|
|
92
84
|
if (value === null) {
|
|
93
85
|
return null;
|
|
94
86
|
}
|
|
95
87
|
|
|
96
|
-
if (
|
|
97
|
-
typeof value === 'string' ||
|
|
98
|
-
typeof value === 'number' ||
|
|
99
|
-
typeof value === 'boolean'
|
|
100
|
-
) {
|
|
88
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
101
89
|
return value;
|
|
102
90
|
}
|
|
103
91
|
|
|
104
|
-
if (
|
|
105
|
-
value === undefined ||
|
|
106
|
-
typeof value === 'function' ||
|
|
107
|
-
typeof value === 'symbol'
|
|
108
|
-
) {
|
|
92
|
+
if (value === undefined || typeof value === 'function' || typeof value === 'symbol') {
|
|
109
93
|
return undefined;
|
|
110
94
|
}
|
|
111
95
|
|
|
@@ -121,10 +105,7 @@ export const serializeQueryKeyValue = (
|
|
|
121
105
|
return stringifyToJsonValue(value);
|
|
122
106
|
}
|
|
123
107
|
|
|
124
|
-
if (
|
|
125
|
-
typeof URLSearchParams !== 'undefined' &&
|
|
126
|
-
value instanceof URLSearchParams
|
|
127
|
-
) {
|
|
108
|
+
if (typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams) {
|
|
128
109
|
return serializeSearchParams(value);
|
|
129
110
|
}
|
|
130
111
|
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import type { Config } from './types.gen.ts';
|
|
4
4
|
|
|
5
|
-
export type ServerSentEventsOptions<TData = unknown> = Omit<
|
|
6
|
-
RequestInit,
|
|
7
|
-
'method'
|
|
8
|
-
> &
|
|
5
|
+
export type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> &
|
|
9
6
|
Pick<Config, 'method' | 'responseTransformer' | 'responseValidator'> & {
|
|
10
7
|
/**
|
|
11
8
|
* Fetch API implementation. You can use this option to provide a custom
|
|
@@ -74,11 +71,7 @@ export interface StreamEvent<TData = unknown> {
|
|
|
74
71
|
retry?: number;
|
|
75
72
|
}
|
|
76
73
|
|
|
77
|
-
export type ServerSentEventsResult<
|
|
78
|
-
TData = unknown,
|
|
79
|
-
TReturn = void,
|
|
80
|
-
TNext = unknown,
|
|
81
|
-
> = {
|
|
74
|
+
export type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
|
|
82
75
|
stream: AsyncGenerator<
|
|
83
76
|
TData extends Record<string, unknown> ? TData[keyof TData] : TData,
|
|
84
77
|
TReturn,
|
|
@@ -101,9 +94,7 @@ export const createSseClient = <TData = unknown>({
|
|
|
101
94
|
}: ServerSentEventsOptions): ServerSentEventsResult<TData> => {
|
|
102
95
|
let lastEventId: string | undefined;
|
|
103
96
|
|
|
104
|
-
const sleep =
|
|
105
|
-
sseSleepFn ??
|
|
106
|
-
((ms: number) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
97
|
+
const sleep = sseSleepFn ?? ((ms: number) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
107
98
|
|
|
108
99
|
const createStream = async function* () {
|
|
109
100
|
let retryDelay: number = sseDefaultRetryDelay ?? 3000;
|
|
@@ -141,16 +132,11 @@ export const createSseClient = <TData = unknown>({
|
|
|
141
132
|
const _fetch = options.fetch ?? globalThis.fetch;
|
|
142
133
|
const response = await _fetch(request);
|
|
143
134
|
|
|
144
|
-
if (!response.ok)
|
|
145
|
-
throw new Error(
|
|
146
|
-
`SSE failed: ${response.status} ${response.statusText}`,
|
|
147
|
-
);
|
|
135
|
+
if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`);
|
|
148
136
|
|
|
149
137
|
if (!response.body) throw new Error('No body in SSE response');
|
|
150
138
|
|
|
151
|
-
const reader = response.body
|
|
152
|
-
.pipeThrough(new TextDecoderStream())
|
|
153
|
-
.getReader();
|
|
139
|
+
const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
|
|
154
140
|
|
|
155
141
|
let buffer = '';
|
|
156
142
|
|
|
@@ -188,10 +174,7 @@ export const createSseClient = <TData = unknown>({
|
|
|
188
174
|
} else if (line.startsWith('id:')) {
|
|
189
175
|
lastEventId = line.replace(/^id:\s*/, '');
|
|
190
176
|
} else if (line.startsWith('retry:')) {
|
|
191
|
-
const parsed = Number.parseInt(
|
|
192
|
-
line.replace(/^retry:\s*/, ''),
|
|
193
|
-
10,
|
|
194
|
-
);
|
|
177
|
+
const parsed = Number.parseInt(line.replace(/^retry:\s*/, ''), 10);
|
|
195
178
|
if (!Number.isNaN(parsed)) {
|
|
196
179
|
retryDelay = parsed;
|
|
197
180
|
}
|
|
@@ -243,18 +226,12 @@ export const createSseClient = <TData = unknown>({
|
|
|
243
226
|
// connection failed or aborted; retry after delay
|
|
244
227
|
onSseError?.(error);
|
|
245
228
|
|
|
246
|
-
if (
|
|
247
|
-
sseMaxRetryAttempts !== undefined &&
|
|
248
|
-
attempt >= sseMaxRetryAttempts
|
|
249
|
-
) {
|
|
229
|
+
if (sseMaxRetryAttempts !== undefined && attempt >= sseMaxRetryAttempts) {
|
|
250
230
|
break; // stop after firing error
|
|
251
231
|
}
|
|
252
232
|
|
|
253
233
|
// exponential backoff: double retry each attempt, cap at 30s
|
|
254
|
-
const backoff = Math.min(
|
|
255
|
-
retryDelay * 2 ** (attempt - 1),
|
|
256
|
-
sseMaxRetryDelay ?? 30000,
|
|
257
|
-
);
|
|
234
|
+
const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 30000);
|
|
258
235
|
await sleep(backoff);
|
|
259
236
|
}
|
|
260
237
|
}
|
package/src/core/types.gen.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
|
|
3
3
|
import type { Auth, AuthToken } from './auth.gen.ts';
|
|
4
|
-
import type {
|
|
5
|
-
BodySerializer,
|
|
6
|
-
QuerySerializer,
|
|
7
|
-
QuerySerializerOptions,
|
|
8
|
-
} from './bodySerializer.gen.ts';
|
|
4
|
+
import type { BodySerializer, QuerySerializer, QuerySerializerOptions } from './bodySerializer.gen.ts';
|
|
9
5
|
|
|
10
6
|
export type HttpMethod =
|
|
11
7
|
| 'connect'
|
|
@@ -34,9 +30,7 @@ export type Client<
|
|
|
34
30
|
setConfig: (config: Config) => Config;
|
|
35
31
|
} & {
|
|
36
32
|
[K in HttpMethod]: MethodFn;
|
|
37
|
-
} & ([SseFn] extends [never]
|
|
38
|
-
? { sse?: never }
|
|
39
|
-
: { sse: { [K in HttpMethod]: SseFn } });
|
|
33
|
+
} & ([SseFn] extends [never] ? { sse?: never } : { sse: { [K in HttpMethod]: SseFn } });
|
|
40
34
|
|
|
41
35
|
export interface Config {
|
|
42
36
|
/**
|
|
@@ -59,13 +53,7 @@ export interface Config {
|
|
|
59
53
|
| RequestInit['headers']
|
|
60
54
|
| Record<
|
|
61
55
|
string,
|
|
62
|
-
| string
|
|
63
|
-
| number
|
|
64
|
-
| boolean
|
|
65
|
-
| (string | number | boolean)[]
|
|
66
|
-
| null
|
|
67
|
-
| undefined
|
|
68
|
-
| unknown
|
|
56
|
+
string | number | boolean | (string | number | boolean)[] | null | undefined | unknown
|
|
69
57
|
>;
|
|
70
58
|
/**
|
|
71
59
|
* The request method.
|
|
@@ -112,7 +100,5 @@ type IsExactlyNeverOrNeverUndefined<T> = [T] extends [never]
|
|
|
112
100
|
: false;
|
|
113
101
|
|
|
114
102
|
export type OmitNever<T extends Record<string, unknown>> = {
|
|
115
|
-
[K in keyof T as IsExactlyNeverOrNeverUndefined<T[K]> extends true
|
|
116
|
-
? never
|
|
117
|
-
: K]: T[K];
|
|
103
|
+
[K in keyof T as IsExactlyNeverOrNeverUndefined<T[K]> extends true ? never : K]: T[K];
|
|
118
104
|
};
|
package/src/core/utils.gen.ts
CHANGED
|
@@ -44,10 +44,7 @@ export const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
if (Array.isArray(value)) {
|
|
47
|
-
url = url.replace(
|
|
48
|
-
match,
|
|
49
|
-
serializeArrayParam({ explode, name, style, value }),
|
|
50
|
-
);
|
|
47
|
+
url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
|
|
51
48
|
continue;
|
|
52
49
|
}
|
|
53
50
|
|
package/src/index.ts
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
export { client, type CreateClientConfig } from './client.gen.ts';
|
|
4
4
|
export { Admin, Billing, Capture, GitHub, Media, type Options, Project, Publish, Search, Template, User, UserSettings } from './sdk.gen.ts';
|
|
5
|
-
export type { AddCustomDomainData, AddCustomDomainError, AddCustomDomainErrors, AddCustomDomainResponse, AddCustomDomainResponses, AdminCleanupProjectData, AdminCleanupProjectError, AdminCleanupProjectErrors, AdminCleanupProjectResponse, AdminCleanupProjectResponses, AdminCloneProjectCreateData, AdminCloneProjectCreateError, AdminCloneProjectCreateErrors, AdminCloneProjectCreateResponse, AdminCloneProjectCreateResponses, AdminCloneProjectLogData, AdminCloneProjectLogError, AdminCloneProjectLogErrors, AdminCloneProjectLogResponse, AdminCloneProjectLogResponses, AdminDeleteProjectData, AdminDeleteProjectError, AdminDeleteProjectErrors, AdminDeleteProjectResponse, AdminDeleteProjectResponses, AdminUpdateCreditsData, AdminUpdateCreditsError, AdminUpdateCreditsErrors, AdminUpdateCreditsResponse, AdminUpdateCreditsResponses, BillingPrice, BillingProduct, CancelScheduledUpdateByDazlIdData, CancelScheduledUpdateByDazlIdError, CancelScheduledUpdateByDazlIdErrors, CancelScheduledUpdateByDazlIdResponse, CancelScheduledUpdateByDazlIdResponses, CleanupProjectInput, ClientOptions, CloneProjectCreateInput, CloneProjectLogInput, ConnectUserData, ConnectUserError, ConnectUserErrors, ConnectUserResponse, ConnectUserResponses, CreateCustomerPortalSessionData, CreateCustomerPortalSessionError, CreateCustomerPortalSessionErrors, CreateCustomerPortalSessionResponse, CreateCustomerPortalSessionResponses, CreateCustomerWithDefaultSubscriptionData, CreateCustomerWithDefaultSubscriptionError, CreateCustomerWithDefaultSubscriptionErrors, CreateCustomerWithDefaultSubscriptionResponse, CreateCustomerWithDefaultSubscriptionResponses, CreateMediaData, CreateMediaError, CreateMediaErrors, CreateMediaResponses, CreateProjectData, CreateProjectError, CreateProjectErrors, CreateProjectResponse, CreateProjectResponses, CreateRepositoryData, CreateRepositoryError, CreateRepositoryErrors, CreateRepositoryResponse, CreateRepositoryResponses, CreateTemplateData, CreateTemplateError, CreateTemplateErrors, CreateTemplateResponse, CreateTemplateResponses, CreateUserData, CreateUserError, CreateUserErrors, CreateUserResponse, CreateUserResponses, CustomerInfo, DeleteCustomDomainData, DeleteCustomDomainError, DeleteCustomDomainErrors, DeleteCustomDomainResponse, DeleteCustomDomainResponses, DeleteProjectData, DeleteProjectError, DeleteProjectErrors, DeleteProjectInput, DeleteProjectResponse, DeleteProjectResponses, DeleteTemplateData, DeleteTemplateError, DeleteTemplateErrors, DeleteTemplateResponse, DeleteTemplateResponses, Deployment, DuplicateProjectData, DuplicateProjectError, DuplicateProjectErrors, DuplicateProjectResponse, DuplicateProjectResponses, EnsureSiteIdData, EnsureSiteIdError, EnsureSiteIdErrors, EnsureSiteIdResponse, EnsureSiteIdResponses, ErrorResponse, GetAccountScreenshotsData, GetAccountScreenshotsError, GetAccountScreenshotsErrors, GetAccountScreenshotsResponse, GetAccountScreenshotsResponses, GetAllProductsData, GetAllProductsError, GetAllProductsErrors, GetAllProductsResponse, GetAllProductsResponses, GetByDazlIdData, GetByDazlIdError, GetByDazlIdErrors, GetByDazlIdResponse, GetByDazlIdResponses, GetCustomDomainData, GetCustomDomainError, GetCustomDomainErrors, GetCustomDomainResponse, GetCustomDomainResponses, GetCustomerInfoByDazlIdData, GetCustomerInfoByDazlIdError, GetCustomerInfoByDazlIdErrors, GetCustomerInfoByDazlIdResponse, GetCustomerInfoByDazlIdResponses, GetHasSufficientCreditsByDazlIdData, GetHasSufficientCreditsByDazlIdError, GetHasSufficientCreditsByDazlIdErrors, GetHasSufficientCreditsByDazlIdResponse, GetHasSufficientCreditsByDazlIdResponses, GetInstallationsData, GetInstallationsError, GetInstallationsErrors, GetInstallationsResponse, GetInstallationsResponses,
|
|
5
|
+
export type { AddCustomDomainData, AddCustomDomainError, AddCustomDomainErrors, AddCustomDomainResponse, AddCustomDomainResponses, AdminCleanupProjectData, AdminCleanupProjectError, AdminCleanupProjectErrors, AdminCleanupProjectResponse, AdminCleanupProjectResponses, AdminCloneProjectCreateData, AdminCloneProjectCreateError, AdminCloneProjectCreateErrors, AdminCloneProjectCreateResponse, AdminCloneProjectCreateResponses, AdminCloneProjectLogData, AdminCloneProjectLogError, AdminCloneProjectLogErrors, AdminCloneProjectLogResponse, AdminCloneProjectLogResponses, AdminDeleteProjectData, AdminDeleteProjectError, AdminDeleteProjectErrors, AdminDeleteProjectResponse, AdminDeleteProjectResponses, AdminUpdateCreditsData, AdminUpdateCreditsError, AdminUpdateCreditsErrors, AdminUpdateCreditsResponse, AdminUpdateCreditsResponses, BillingPrice, BillingProduct, CancelScheduledUpdateByDazlIdData, CancelScheduledUpdateByDazlIdError, CancelScheduledUpdateByDazlIdErrors, CancelScheduledUpdateByDazlIdResponse, CancelScheduledUpdateByDazlIdResponses, CleanupProjectInput, ClientOptions, CloneProjectCreateInput, CloneProjectLogInput, ConnectUserData, ConnectUserError, ConnectUserErrors, ConnectUserResponse, ConnectUserResponses, CreateCustomerPortalSessionData, CreateCustomerPortalSessionError, CreateCustomerPortalSessionErrors, CreateCustomerPortalSessionResponse, CreateCustomerPortalSessionResponses, CreateCustomerWithDefaultSubscriptionData, CreateCustomerWithDefaultSubscriptionError, CreateCustomerWithDefaultSubscriptionErrors, CreateCustomerWithDefaultSubscriptionResponse, CreateCustomerWithDefaultSubscriptionResponses, CreateMediaData, CreateMediaError, CreateMediaErrors, CreateMediaResponses, CreateProjectData, CreateProjectError, CreateProjectErrors, CreateProjectResponse, CreateProjectResponses, CreateRepositoryData, CreateRepositoryError, CreateRepositoryErrors, CreateRepositoryResponse, CreateRepositoryResponses, CreateTemplateData, CreateTemplateError, CreateTemplateErrors, CreateTemplateResponse, CreateTemplateResponses, CreateUserData, CreateUserError, CreateUserErrors, CreateUserResponse, CreateUserResponses, CustomerInfo, DeleteCustomDomainData, DeleteCustomDomainError, DeleteCustomDomainErrors, DeleteCustomDomainResponse, DeleteCustomDomainResponses, DeleteProjectData, DeleteProjectError, DeleteProjectErrors, DeleteProjectInput, DeleteProjectResponse, DeleteProjectResponses, DeleteTemplateData, DeleteTemplateError, DeleteTemplateErrors, DeleteTemplateResponse, DeleteTemplateResponses, Deployment, DuplicateProjectData, DuplicateProjectError, DuplicateProjectErrors, DuplicateProjectResponse, DuplicateProjectResponses, EnsureSiteIdData, EnsureSiteIdError, EnsureSiteIdErrors, EnsureSiteIdResponse, EnsureSiteIdResponses, ErrorResponse, GetAccountScreenshotsData, GetAccountScreenshotsError, GetAccountScreenshotsErrors, GetAccountScreenshotsResponse, GetAccountScreenshotsResponses, GetAllProductsData, GetAllProductsError, GetAllProductsErrors, GetAllProductsResponse, GetAllProductsResponses, GetByDazlIdData, GetByDazlIdError, GetByDazlIdErrors, GetByDazlIdResponse, GetByDazlIdResponses, GetCustomDomainData, GetCustomDomainError, GetCustomDomainErrors, GetCustomDomainResponse, GetCustomDomainResponses, GetCustomerInfoByDazlIdData, GetCustomerInfoByDazlIdError, GetCustomerInfoByDazlIdErrors, GetCustomerInfoByDazlIdResponse, GetCustomerInfoByDazlIdResponses, GetEntriConfigData, GetEntriConfigError, GetEntriConfigErrors, GetEntriConfigResponse, GetEntriConfigResponses, GetHasSufficientCreditsByDazlIdData, GetHasSufficientCreditsByDazlIdError, GetHasSufficientCreditsByDazlIdErrors, GetHasSufficientCreditsByDazlIdResponse, GetHasSufficientCreditsByDazlIdResponses, GetInstallationsData, GetInstallationsError, GetInstallationsErrors, GetInstallationsResponse, GetInstallationsResponses, GetInstallationUrlData, GetInstallationUrlError, GetInstallationUrlErrors, GetInstallationUrlResponse, GetInstallationUrlResponses, GetLatestDeployData, GetLatestDeployError, GetLatestDeployErrors, GetLatestDeployResponse, GetLatestDeployResponses, GetMaxCreditsForDefaultFreeData, GetMaxCreditsForDefaultFreeError, GetMaxCreditsForDefaultFreeErrors, GetMaxCreditsForDefaultFreeResponse, GetMaxCreditsForDefaultFreeResponses, GetPriceByIdData, GetPriceByIdError, GetPriceByIdErrors, GetPriceByIdResponse, GetPriceByIdResponses, GetProjectByIdData, GetProjectByIdError, GetProjectByIdErrors, GetProjectByIdResponse, GetProjectByIdResponses, GetProjectInfoData, GetProjectInfoError, GetProjectInfoErrors, GetProjectInfoResponse, GetProjectInfoResponses, GetProjectScreenshotsData, GetProjectScreenshotsError, GetProjectScreenshotsErrors, GetProjectScreenshotsResponse, GetProjectScreenshotsResponses, GetTemplateData, GetTemplateError, GetTemplateErrors, GetTemplateResponse, GetTemplateResponses, GetUploadConfigurationData, GetUploadConfigurationError, GetUploadConfigurationErrors, GetUploadConfigurationResponse, GetUploadConfigurationResponses, GetUserByDazlIdData, GetUserByDazlIdError, GetUserByDazlIdErrors, GetUserByDazlIdResponse, GetUserByDazlIdResponses, GetUserInfoByDazlIdData, GetUserInfoByDazlIdError, GetUserInfoByDazlIdErrors, GetUserInfoByDazlIdResponse, GetUserInfoByDazlIdResponses, GetUserInfoData, GetUserInfoError, GetUserInfoErrors, GetUserInfoResponse, GetUserInfoResponses, GetUserProjectsData, GetUserProjectsError, GetUserProjectsErrors, GetUserProjectsResponse, GetUserProjectsResponses, GetUserTemplatesData, GetUserTemplatesError, GetUserTemplatesErrors, GetUserTemplatesResponse, GetUserTemplatesResponses, ListFilesData, ListFilesError, ListFilesErrors, ListFilesResponse, ListFilesResponses, MediaFile, MediaFileList, OwnerDazlId, ProjectRaw, ProjectWithScreenshot, ScheduledUpdate, ScrapePageContentData, ScrapePageContentError, ScrapePageContentErrors, ScrapePageContentResponse, ScrapePageContentResponses, Screenshot, SearchWebData, SearchWebError, SearchWebErrors, SearchWebResponse, SearchWebResponses, StripeProduct, TakeScreenshotData, TakeScreenshotError, TakeScreenshotErrors, TakeScreenshotResponse, TakeScreenshotResponses, TemplateRaw, UpdateByDazlIdData, UpdateByDazlIdError, UpdateByDazlIdErrors, UpdateByDazlIdResponse, UpdateByDazlIdResponses, UpdateCreditsInput, UpdateEnvVarsData, UpdateEnvVarsError, UpdateEnvVarsErrors, UpdateEnvVarsResponse, UpdateEnvVarsResponses, UpdateProjectData, UpdateProjectError, UpdateProjectErrors, UpdateProjectResponse, UpdateProjectResponses, UpdateTemplateData, UpdateTemplateError, UpdateTemplateErrors, UpdateTemplateResponse, UpdateTemplateResponses, UpdateUserData, UpdateUserError, UpdateUserErrors, UpdateUserResponse, UpdateUserResponses, UpdateUserSubscriptionData, UpdateUserSubscriptionError, UpdateUserSubscriptionErrors, UpdateUserSubscriptionResponse, UpdateUserSubscriptionResponses, UploadConfiguration, UpsertDeployInDbData, UpsertDeployInDbError, UpsertDeployInDbErrors, UpsertDeployInDbResponse, UpsertDeployInDbResponses, UserRaw } from './types.gen.ts';
|
package/src/sdk.gen.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { client } from './client.gen.ts';
|
|
4
4
|
import type { Client, Options as Options2, TDataShape } from './client/index.ts';
|
|
5
|
-
import type { AddCustomDomainData, AddCustomDomainErrors, AddCustomDomainResponses, AdminCleanupProjectData, AdminCleanupProjectErrors, AdminCleanupProjectResponses, AdminCloneProjectCreateData, AdminCloneProjectCreateErrors, AdminCloneProjectCreateResponses, AdminCloneProjectLogData, AdminCloneProjectLogErrors, AdminCloneProjectLogResponses, AdminDeleteProjectData, AdminDeleteProjectErrors, AdminDeleteProjectResponses, AdminUpdateCreditsData, AdminUpdateCreditsErrors, AdminUpdateCreditsResponses, CancelScheduledUpdateByDazlIdData, CancelScheduledUpdateByDazlIdErrors, CancelScheduledUpdateByDazlIdResponses, ConnectUserData, ConnectUserErrors, ConnectUserResponses, CreateCustomerPortalSessionData, CreateCustomerPortalSessionErrors, CreateCustomerPortalSessionResponses, CreateCustomerWithDefaultSubscriptionData, CreateCustomerWithDefaultSubscriptionErrors, CreateCustomerWithDefaultSubscriptionResponses, CreateMediaData, CreateMediaErrors, CreateMediaResponses, CreateProjectData, CreateProjectErrors, CreateProjectResponses, CreateRepositoryData, CreateRepositoryErrors, CreateRepositoryResponses, CreateTemplateData, CreateTemplateErrors, CreateTemplateResponses, CreateUserData, CreateUserErrors, CreateUserResponses, DeleteCustomDomainData, DeleteCustomDomainErrors, DeleteCustomDomainResponses, DeleteProjectData, DeleteProjectErrors, DeleteProjectResponses, DeleteTemplateData, DeleteTemplateErrors, DeleteTemplateResponses, DuplicateProjectData, DuplicateProjectErrors, DuplicateProjectResponses, EnsureSiteIdData, EnsureSiteIdErrors, EnsureSiteIdResponses, GetAccountScreenshotsData, GetAccountScreenshotsErrors, GetAccountScreenshotsResponses, GetAllProductsData, GetAllProductsErrors, GetAllProductsResponses, GetByDazlIdData, GetByDazlIdErrors, GetByDazlIdResponses, GetCustomDomainData, GetCustomDomainErrors, GetCustomDomainResponses, GetCustomerInfoByDazlIdData, GetCustomerInfoByDazlIdErrors, GetCustomerInfoByDazlIdResponses, GetHasSufficientCreditsByDazlIdData, GetHasSufficientCreditsByDazlIdErrors, GetHasSufficientCreditsByDazlIdResponses, GetInstallationsData, GetInstallationsErrors, GetInstallationsResponses,
|
|
5
|
+
import type { AddCustomDomainData, AddCustomDomainErrors, AddCustomDomainResponses, AdminCleanupProjectData, AdminCleanupProjectErrors, AdminCleanupProjectResponses, AdminCloneProjectCreateData, AdminCloneProjectCreateErrors, AdminCloneProjectCreateResponses, AdminCloneProjectLogData, AdminCloneProjectLogErrors, AdminCloneProjectLogResponses, AdminDeleteProjectData, AdminDeleteProjectErrors, AdminDeleteProjectResponses, AdminUpdateCreditsData, AdminUpdateCreditsErrors, AdminUpdateCreditsResponses, CancelScheduledUpdateByDazlIdData, CancelScheduledUpdateByDazlIdErrors, CancelScheduledUpdateByDazlIdResponses, ConnectUserData, ConnectUserErrors, ConnectUserResponses, CreateCustomerPortalSessionData, CreateCustomerPortalSessionErrors, CreateCustomerPortalSessionResponses, CreateCustomerWithDefaultSubscriptionData, CreateCustomerWithDefaultSubscriptionErrors, CreateCustomerWithDefaultSubscriptionResponses, CreateMediaData, CreateMediaErrors, CreateMediaResponses, CreateProjectData, CreateProjectErrors, CreateProjectResponses, CreateRepositoryData, CreateRepositoryErrors, CreateRepositoryResponses, CreateTemplateData, CreateTemplateErrors, CreateTemplateResponses, CreateUserData, CreateUserErrors, CreateUserResponses, DeleteCustomDomainData, DeleteCustomDomainErrors, DeleteCustomDomainResponses, DeleteProjectData, DeleteProjectErrors, DeleteProjectResponses, DeleteTemplateData, DeleteTemplateErrors, DeleteTemplateResponses, DuplicateProjectData, DuplicateProjectErrors, DuplicateProjectResponses, EnsureSiteIdData, EnsureSiteIdErrors, EnsureSiteIdResponses, GetAccountScreenshotsData, GetAccountScreenshotsErrors, GetAccountScreenshotsResponses, GetAllProductsData, GetAllProductsErrors, GetAllProductsResponses, GetByDazlIdData, GetByDazlIdErrors, GetByDazlIdResponses, GetCustomDomainData, GetCustomDomainErrors, GetCustomDomainResponses, GetCustomerInfoByDazlIdData, GetCustomerInfoByDazlIdErrors, GetCustomerInfoByDazlIdResponses, GetEntriConfigData, GetEntriConfigErrors, GetEntriConfigResponses, GetHasSufficientCreditsByDazlIdData, GetHasSufficientCreditsByDazlIdErrors, GetHasSufficientCreditsByDazlIdResponses, GetInstallationsData, GetInstallationsErrors, GetInstallationsResponses, GetInstallationUrlData, GetInstallationUrlErrors, GetInstallationUrlResponses, GetLatestDeployData, GetLatestDeployErrors, GetLatestDeployResponses, GetMaxCreditsForDefaultFreeData, GetMaxCreditsForDefaultFreeErrors, GetMaxCreditsForDefaultFreeResponses, GetPriceByIdData, GetPriceByIdErrors, GetPriceByIdResponses, GetProjectByIdData, GetProjectByIdErrors, GetProjectByIdResponses, GetProjectInfoData, GetProjectInfoErrors, GetProjectInfoResponses, GetProjectScreenshotsData, GetProjectScreenshotsErrors, GetProjectScreenshotsResponses, GetTemplateData, GetTemplateErrors, GetTemplateResponses, GetUploadConfigurationData, GetUploadConfigurationErrors, GetUploadConfigurationResponses, GetUserByDazlIdData, GetUserByDazlIdErrors, GetUserByDazlIdResponses, GetUserInfoByDazlIdData, GetUserInfoByDazlIdErrors, GetUserInfoByDazlIdResponses, GetUserInfoData, GetUserInfoErrors, GetUserInfoResponses, GetUserProjectsData, GetUserProjectsErrors, GetUserProjectsResponses, GetUserTemplatesData, GetUserTemplatesErrors, GetUserTemplatesResponses, ListFilesData, ListFilesErrors, ListFilesResponses, ScrapePageContentData, ScrapePageContentErrors, ScrapePageContentResponses, SearchWebData, SearchWebErrors, SearchWebResponses, TakeScreenshotData, TakeScreenshotErrors, TakeScreenshotResponses, UpdateByDazlIdData, UpdateByDazlIdErrors, UpdateByDazlIdResponses, UpdateEnvVarsData, UpdateEnvVarsErrors, UpdateEnvVarsResponses, UpdateProjectData, UpdateProjectErrors, UpdateProjectResponses, UpdateTemplateData, UpdateTemplateErrors, UpdateTemplateResponses, UpdateUserData, UpdateUserErrors, UpdateUserResponses, UpdateUserSubscriptionData, UpdateUserSubscriptionErrors, UpdateUserSubscriptionResponses, UpsertDeployInDbData, UpsertDeployInDbErrors, UpsertDeployInDbResponses } from './types.gen.ts';
|
|
6
6
|
|
|
7
7
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
|
|
8
8
|
/**
|
|
@@ -118,10 +118,6 @@ export class GitHub {
|
|
|
118
118
|
return (options.client ?? client).get<GetInstallationsResponses, GetInstallationsErrors, ThrowOnError>({ url: '/github/user/{dazlId}/installations', ...options });
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
public static getInstallationToken<ThrowOnError extends boolean = false>(options: Options<GetInstallationTokenData, ThrowOnError>) {
|
|
122
|
-
return (options.client ?? client).get<GetInstallationTokenResponses, GetInstallationTokenErrors, ThrowOnError>({ url: '/github/project/{projectId}/token', ...options });
|
|
123
|
-
}
|
|
124
|
-
|
|
125
121
|
public static getProjectInfo<ThrowOnError extends boolean = false>(options: Options<GetProjectInfoData, ThrowOnError>) {
|
|
126
122
|
return (options.client ?? client).get<GetProjectInfoResponses, GetProjectInfoErrors, ThrowOnError>({ url: '/github/project/{projectId}/info', ...options });
|
|
127
123
|
}
|
|
@@ -198,6 +194,10 @@ export class Publish {
|
|
|
198
194
|
}
|
|
199
195
|
});
|
|
200
196
|
}
|
|
197
|
+
|
|
198
|
+
public static getEntriConfig<ThrowOnError extends boolean = false>(options: Options<GetEntriConfigData, ThrowOnError>) {
|
|
199
|
+
return (options.client ?? client).get<GetEntriConfigResponses, GetEntriConfigErrors, ThrowOnError>({ url: '/publish/entri-config', ...options });
|
|
200
|
+
}
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
export class Project {
|