@eudiplo/sdk-core 1.14.0-main.6c10d5a → 1.14.0-main.6e495c8

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.
@@ -1,4 +1,4 @@
1
- import { b as Config, C as Client } from '../../types.gen-DKrNRB-E.mjs';
1
+ import { b as Config, C as Client } from '../../types.gen-B0nhFpj5.mjs';
2
2
 
3
3
  declare const createClient: (config?: Config) => Client;
4
4
 
@@ -1,4 +1,4 @@
1
- import { b as Config, C as Client } from '../../types.gen-DKrNRB-E.js';
1
+ import { b as Config, C as Client } from '../../types.gen-B0nhFpj5.js';
2
2
 
3
3
  declare const createClient: (config?: Config) => Client;
4
4
 
@@ -41,10 +41,7 @@ function createSseClient({
41
41
  }
42
42
  const _fetch = options.fetch ?? globalThis.fetch;
43
43
  const response = await _fetch(request);
44
- if (!response.ok)
45
- throw new Error(
46
- `SSE failed: ${response.status} ${response.statusText}`
47
- );
44
+ if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`);
48
45
  if (!response.body) throw new Error("No body in SSE response");
49
46
  const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
50
47
  let buffer = "";
@@ -75,10 +72,7 @@ function createSseClient({
75
72
  } else if (line.startsWith("id:")) {
76
73
  lastEventId = line.replace(/^id:\s*/, "");
77
74
  } else if (line.startsWith("retry:")) {
78
- const parsed = Number.parseInt(
79
- line.replace(/^retry:\s*/, ""),
80
- 10
81
- );
75
+ const parsed = Number.parseInt(line.replace(/^retry:\s*/, ""), 10);
82
76
  if (!Number.isNaN(parsed)) {
83
77
  retryDelay = parsed;
84
78
  }
@@ -124,10 +118,7 @@ function createSseClient({
124
118
  if (sseMaxRetryAttempts !== void 0 && attempt >= sseMaxRetryAttempts) {
125
119
  break;
126
120
  }
127
- const backoff = Math.min(
128
- retryDelay * 2 ** (attempt - 1),
129
- sseMaxRetryDelay ?? 3e4
130
- );
121
+ const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 3e4);
131
122
  await sleep(backoff);
132
123
  }
133
124
  }
@@ -235,11 +226,7 @@ var serializeObjectParam = ({
235
226
  if (style !== "deepObject" && !explode) {
236
227
  let values = [];
237
228
  Object.entries(value).forEach(([key, v]) => {
238
- values = [
239
- ...values,
240
- key,
241
- allowReserved ? v : encodeURIComponent(v)
242
- ];
229
+ values = [...values, key, allowReserved ? v : encodeURIComponent(v)];
243
230
  });
244
231
  const joinedValues2 = values.join(",");
245
232
  switch (style) {
@@ -290,10 +277,7 @@ var defaultPathSerializer = ({ path, url: _url }) => {
290
277
  continue;
291
278
  }
292
279
  if (Array.isArray(value)) {
293
- url = url.replace(
294
- match,
295
- serializeArrayParam({ explode, name, style, value })
296
- );
280
+ url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
297
281
  continue;
298
282
  }
299
283
  if (typeof value === "object") {
@@ -381,10 +365,7 @@ var getAuthToken = async (auth, callback) => {
381
365
 
382
366
  // src/api/core/bodySerializer.gen.ts
383
367
  var jsonBodySerializer = {
384
- bodySerializer: (body) => JSON.stringify(
385
- body,
386
- (_key, value) => typeof value === "bigint" ? value.toString() : value
387
- )
368
+ bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value)
388
369
  };
389
370
 
390
371
  // src/api/client/utils.gen.ts
@@ -449,9 +430,7 @@ var getParseAs = (contentType) => {
449
430
  if (cleanContent === "multipart/form-data") {
450
431
  return "formData";
451
432
  }
452
- if (["application/", "audio/", "image/", "video/"].some(
453
- (type) => cleanContent.startsWith(type)
454
- )) {
433
+ if (["application/", "audio/", "image/", "video/"].some((type) => cleanContent.startsWith(type))) {
455
434
  return "blob";
456
435
  }
457
436
  if (cleanContent.startsWith("text/")) {
@@ -739,12 +718,7 @@ var createClient = (config = {}) => {
739
718
  let finalError = error;
740
719
  for (const fn of interceptors.error.fns) {
741
720
  if (fn) {
742
- finalError = await fn(
743
- finalError,
744
- response,
745
- request2,
746
- options
747
- );
721
+ finalError = await fn(finalError, response, request2, options);
748
722
  }
749
723
  }
750
724
  finalError = finalError || {};
@@ -39,10 +39,7 @@ function createSseClient({
39
39
  }
40
40
  const _fetch = options.fetch ?? globalThis.fetch;
41
41
  const response = await _fetch(request);
42
- if (!response.ok)
43
- throw new Error(
44
- `SSE failed: ${response.status} ${response.statusText}`
45
- );
42
+ if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`);
46
43
  if (!response.body) throw new Error("No body in SSE response");
47
44
  const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
48
45
  let buffer = "";
@@ -73,10 +70,7 @@ function createSseClient({
73
70
  } else if (line.startsWith("id:")) {
74
71
  lastEventId = line.replace(/^id:\s*/, "");
75
72
  } else if (line.startsWith("retry:")) {
76
- const parsed = Number.parseInt(
77
- line.replace(/^retry:\s*/, ""),
78
- 10
79
- );
73
+ const parsed = Number.parseInt(line.replace(/^retry:\s*/, ""), 10);
80
74
  if (!Number.isNaN(parsed)) {
81
75
  retryDelay = parsed;
82
76
  }
@@ -122,10 +116,7 @@ function createSseClient({
122
116
  if (sseMaxRetryAttempts !== void 0 && attempt >= sseMaxRetryAttempts) {
123
117
  break;
124
118
  }
125
- const backoff = Math.min(
126
- retryDelay * 2 ** (attempt - 1),
127
- sseMaxRetryDelay ?? 3e4
128
- );
119
+ const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 3e4);
129
120
  await sleep(backoff);
130
121
  }
131
122
  }
@@ -233,11 +224,7 @@ var serializeObjectParam = ({
233
224
  if (style !== "deepObject" && !explode) {
234
225
  let values = [];
235
226
  Object.entries(value).forEach(([key, v]) => {
236
- values = [
237
- ...values,
238
- key,
239
- allowReserved ? v : encodeURIComponent(v)
240
- ];
227
+ values = [...values, key, allowReserved ? v : encodeURIComponent(v)];
241
228
  });
242
229
  const joinedValues2 = values.join(",");
243
230
  switch (style) {
@@ -288,10 +275,7 @@ var defaultPathSerializer = ({ path, url: _url }) => {
288
275
  continue;
289
276
  }
290
277
  if (Array.isArray(value)) {
291
- url = url.replace(
292
- match,
293
- serializeArrayParam({ explode, name, style, value })
294
- );
278
+ url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
295
279
  continue;
296
280
  }
297
281
  if (typeof value === "object") {
@@ -379,10 +363,7 @@ var getAuthToken = async (auth, callback) => {
379
363
 
380
364
  // src/api/core/bodySerializer.gen.ts
381
365
  var jsonBodySerializer = {
382
- bodySerializer: (body) => JSON.stringify(
383
- body,
384
- (_key, value) => typeof value === "bigint" ? value.toString() : value
385
- )
366
+ bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value)
386
367
  };
387
368
 
388
369
  // src/api/client/utils.gen.ts
@@ -447,9 +428,7 @@ var getParseAs = (contentType) => {
447
428
  if (cleanContent === "multipart/form-data") {
448
429
  return "formData";
449
430
  }
450
- if (["application/", "audio/", "image/", "video/"].some(
451
- (type) => cleanContent.startsWith(type)
452
- )) {
431
+ if (["application/", "audio/", "image/", "video/"].some((type) => cleanContent.startsWith(type))) {
453
432
  return "blob";
454
433
  }
455
434
  if (cleanContent.startsWith("text/")) {
@@ -737,12 +716,7 @@ var createClient = (config = {}) => {
737
716
  let finalError = error;
738
717
  for (const fn of interceptors.error.fns) {
739
718
  if (fn) {
740
- finalError = await fn(
741
- finalError,
742
- response,
743
- request2,
744
- options
745
- );
719
+ finalError = await fn(finalError, response, request2, options);
746
720
  }
747
721
  }
748
722
  finalError = finalError || {};
@@ -1,9 +1,9 @@
1
- export { A as Auth, C as Client, a as ClientOptions, b as Config, c as CreateClientConfig, O as Options, Q as QuerySerializerOptions, R as RequestOptions, d as RequestResult, e as ResolvedRequestOptions, f as ResponseStyle, T as TDataShape, g as createConfig, h as formDataBodySerializer, j as jsonBodySerializer, m as mergeHeaders, u as urlSearchParamsBodySerializer } from '../../types.gen-DKrNRB-E.mjs';
1
+ export { A as Auth, C as Client, a as ClientOptions, b as Config, c as CreateClientConfig, O as Options, Q as QuerySerializerOptions, R as RequestOptions, d as RequestResult, e as ResolvedRequestOptions, f as ResponseStyle, T as TDataShape, g as createConfig, h as formDataBodySerializer, j as jsonBodySerializer, m as mergeHeaders, u as urlSearchParamsBodySerializer } from '../../types.gen-B0nhFpj5.mjs';
2
2
  export { createClient } from './client.gen.mjs';
3
3
 
4
- type Slot = "body" | "headers" | "path" | "query";
4
+ type Slot = 'body' | 'headers' | 'path' | 'query';
5
5
  type Field = {
6
- in: Exclude<Slot, "body">;
6
+ in: Exclude<Slot, 'body'>;
7
7
  /**
8
8
  * Field name. This is the name we want the user to see and use.
9
9
  */
@@ -14,7 +14,7 @@ type Field = {
14
14
  */
15
15
  map?: string;
16
16
  } | {
17
- in: Extract<Slot, "body">;
17
+ in: Extract<Slot, 'body'>;
18
18
  /**
19
19
  * Key isn't required for bodies.
20
20
  */
@@ -1,9 +1,9 @@
1
- export { A as Auth, C as Client, a as ClientOptions, b as Config, c as CreateClientConfig, O as Options, Q as QuerySerializerOptions, R as RequestOptions, d as RequestResult, e as ResolvedRequestOptions, f as ResponseStyle, T as TDataShape, g as createConfig, h as formDataBodySerializer, j as jsonBodySerializer, m as mergeHeaders, u as urlSearchParamsBodySerializer } from '../../types.gen-DKrNRB-E.js';
1
+ export { A as Auth, C as Client, a as ClientOptions, b as Config, c as CreateClientConfig, O as Options, Q as QuerySerializerOptions, R as RequestOptions, d as RequestResult, e as ResolvedRequestOptions, f as ResponseStyle, T as TDataShape, g as createConfig, h as formDataBodySerializer, j as jsonBodySerializer, m as mergeHeaders, u as urlSearchParamsBodySerializer } from '../../types.gen-B0nhFpj5.js';
2
2
  export { createClient } from './client.gen.js';
3
3
 
4
- type Slot = "body" | "headers" | "path" | "query";
4
+ type Slot = 'body' | 'headers' | 'path' | 'query';
5
5
  type Field = {
6
- in: Exclude<Slot, "body">;
6
+ in: Exclude<Slot, 'body'>;
7
7
  /**
8
8
  * Field name. This is the name we want the user to see and use.
9
9
  */
@@ -14,7 +14,7 @@ type Field = {
14
14
  */
15
15
  map?: string;
16
16
  } | {
17
- in: Extract<Slot, "body">;
17
+ in: Extract<Slot, 'body'>;
18
18
  /**
19
19
  * Key isn't required for bodies.
20
20
  */
@@ -34,10 +34,7 @@ var formDataBodySerializer = {
34
34
  }
35
35
  };
36
36
  var jsonBodySerializer = {
37
- bodySerializer: (body) => JSON.stringify(
38
- body,
39
- (_key, value) => typeof value === "bigint" ? value.toString() : value
40
- )
37
+ bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value)
41
38
  };
42
39
  var urlSearchParamsBodySerializer = {
43
40
  bodySerializer: (body) => {
@@ -130,9 +127,7 @@ var buildClientParams = (args, fields) => {
130
127
  params[field.map] = value;
131
128
  }
132
129
  } else {
133
- const extra = extraPrefixes.find(
134
- ([prefix]) => key.startsWith(prefix)
135
- );
130
+ const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix));
136
131
  if (extra) {
137
132
  const [prefix, slot] = extra;
138
133
  params[slot][key.slice(prefix.length)] = value;
@@ -184,9 +179,7 @@ var isPlainObject = (value) => {
184
179
  return prototype === Object.prototype || prototype === null;
185
180
  };
186
181
  var serializeSearchParams = (params) => {
187
- const entries = Array.from(params.entries()).sort(
188
- ([a], [b]) => a.localeCompare(b)
189
- );
182
+ const entries = Array.from(params.entries()).sort(([a], [b]) => a.localeCompare(b));
190
183
  const result = {};
191
184
  for (const [key, value] of entries) {
192
185
  const existing = result[key];
@@ -271,10 +264,7 @@ function createSseClient({
271
264
  }
272
265
  const _fetch = options.fetch ?? globalThis.fetch;
273
266
  const response = await _fetch(request);
274
- if (!response.ok)
275
- throw new Error(
276
- `SSE failed: ${response.status} ${response.statusText}`
277
- );
267
+ if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`);
278
268
  if (!response.body) throw new Error("No body in SSE response");
279
269
  const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
280
270
  let buffer = "";
@@ -305,10 +295,7 @@ function createSseClient({
305
295
  } else if (line.startsWith("id:")) {
306
296
  lastEventId = line.replace(/^id:\s*/, "");
307
297
  } else if (line.startsWith("retry:")) {
308
- const parsed = Number.parseInt(
309
- line.replace(/^retry:\s*/, ""),
310
- 10
311
- );
298
+ const parsed = Number.parseInt(line.replace(/^retry:\s*/, ""), 10);
312
299
  if (!Number.isNaN(parsed)) {
313
300
  retryDelay = parsed;
314
301
  }
@@ -354,10 +341,7 @@ function createSseClient({
354
341
  if (sseMaxRetryAttempts !== void 0 && attempt >= sseMaxRetryAttempts) {
355
342
  break;
356
343
  }
357
- const backoff = Math.min(
358
- retryDelay * 2 ** (attempt - 1),
359
- sseMaxRetryDelay ?? 3e4
360
- );
344
+ const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 3e4);
361
345
  await sleep(backoff);
362
346
  }
363
347
  }
@@ -465,11 +449,7 @@ var serializeObjectParam = ({
465
449
  if (style !== "deepObject" && !explode) {
466
450
  let values = [];
467
451
  Object.entries(value).forEach(([key, v]) => {
468
- values = [
469
- ...values,
470
- key,
471
- allowReserved ? v : encodeURIComponent(v)
472
- ];
452
+ values = [...values, key, allowReserved ? v : encodeURIComponent(v)];
473
453
  });
474
454
  const joinedValues2 = values.join(",");
475
455
  switch (style) {
@@ -520,10 +500,7 @@ var defaultPathSerializer = ({ path, url: _url }) => {
520
500
  continue;
521
501
  }
522
502
  if (Array.isArray(value)) {
523
- url = url.replace(
524
- match,
525
- serializeArrayParam({ explode, name, style, value })
526
- );
503
+ url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
527
504
  continue;
528
505
  }
529
506
  if (typeof value === "object") {
@@ -671,9 +648,7 @@ var getParseAs = (contentType) => {
671
648
  if (cleanContent === "multipart/form-data") {
672
649
  return "formData";
673
650
  }
674
- if (["application/", "audio/", "image/", "video/"].some(
675
- (type) => cleanContent.startsWith(type)
676
- )) {
651
+ if (["application/", "audio/", "image/", "video/"].some((type) => cleanContent.startsWith(type))) {
677
652
  return "blob";
678
653
  }
679
654
  if (cleanContent.startsWith("text/")) {
@@ -961,12 +936,7 @@ var createClient = (config = {}) => {
961
936
  let finalError = error;
962
937
  for (const fn of interceptors.error.fns) {
963
938
  if (fn) {
964
- finalError = await fn(
965
- finalError,
966
- response,
967
- request2,
968
- options
969
- );
939
+ finalError = await fn(finalError, response, request2, options);
970
940
  }
971
941
  }
972
942
  finalError = finalError || {};
@@ -32,10 +32,7 @@ var formDataBodySerializer = {
32
32
  }
33
33
  };
34
34
  var jsonBodySerializer = {
35
- bodySerializer: (body) => JSON.stringify(
36
- body,
37
- (_key, value) => typeof value === "bigint" ? value.toString() : value
38
- )
35
+ bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value)
39
36
  };
40
37
  var urlSearchParamsBodySerializer = {
41
38
  bodySerializer: (body) => {
@@ -128,9 +125,7 @@ var buildClientParams = (args, fields) => {
128
125
  params[field.map] = value;
129
126
  }
130
127
  } else {
131
- const extra = extraPrefixes.find(
132
- ([prefix]) => key.startsWith(prefix)
133
- );
128
+ const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix));
134
129
  if (extra) {
135
130
  const [prefix, slot] = extra;
136
131
  params[slot][key.slice(prefix.length)] = value;
@@ -182,9 +177,7 @@ var isPlainObject = (value) => {
182
177
  return prototype === Object.prototype || prototype === null;
183
178
  };
184
179
  var serializeSearchParams = (params) => {
185
- const entries = Array.from(params.entries()).sort(
186
- ([a], [b]) => a.localeCompare(b)
187
- );
180
+ const entries = Array.from(params.entries()).sort(([a], [b]) => a.localeCompare(b));
188
181
  const result = {};
189
182
  for (const [key, value] of entries) {
190
183
  const existing = result[key];
@@ -269,10 +262,7 @@ function createSseClient({
269
262
  }
270
263
  const _fetch = options.fetch ?? globalThis.fetch;
271
264
  const response = await _fetch(request);
272
- if (!response.ok)
273
- throw new Error(
274
- `SSE failed: ${response.status} ${response.statusText}`
275
- );
265
+ if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`);
276
266
  if (!response.body) throw new Error("No body in SSE response");
277
267
  const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
278
268
  let buffer = "";
@@ -303,10 +293,7 @@ function createSseClient({
303
293
  } else if (line.startsWith("id:")) {
304
294
  lastEventId = line.replace(/^id:\s*/, "");
305
295
  } else if (line.startsWith("retry:")) {
306
- const parsed = Number.parseInt(
307
- line.replace(/^retry:\s*/, ""),
308
- 10
309
- );
296
+ const parsed = Number.parseInt(line.replace(/^retry:\s*/, ""), 10);
310
297
  if (!Number.isNaN(parsed)) {
311
298
  retryDelay = parsed;
312
299
  }
@@ -352,10 +339,7 @@ function createSseClient({
352
339
  if (sseMaxRetryAttempts !== void 0 && attempt >= sseMaxRetryAttempts) {
353
340
  break;
354
341
  }
355
- const backoff = Math.min(
356
- retryDelay * 2 ** (attempt - 1),
357
- sseMaxRetryDelay ?? 3e4
358
- );
342
+ const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 3e4);
359
343
  await sleep(backoff);
360
344
  }
361
345
  }
@@ -463,11 +447,7 @@ var serializeObjectParam = ({
463
447
  if (style !== "deepObject" && !explode) {
464
448
  let values = [];
465
449
  Object.entries(value).forEach(([key, v]) => {
466
- values = [
467
- ...values,
468
- key,
469
- allowReserved ? v : encodeURIComponent(v)
470
- ];
450
+ values = [...values, key, allowReserved ? v : encodeURIComponent(v)];
471
451
  });
472
452
  const joinedValues2 = values.join(",");
473
453
  switch (style) {
@@ -518,10 +498,7 @@ var defaultPathSerializer = ({ path, url: _url }) => {
518
498
  continue;
519
499
  }
520
500
  if (Array.isArray(value)) {
521
- url = url.replace(
522
- match,
523
- serializeArrayParam({ explode, name, style, value })
524
- );
501
+ url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
525
502
  continue;
526
503
  }
527
504
  if (typeof value === "object") {
@@ -669,9 +646,7 @@ var getParseAs = (contentType) => {
669
646
  if (cleanContent === "multipart/form-data") {
670
647
  return "formData";
671
648
  }
672
- if (["application/", "audio/", "image/", "video/"].some(
673
- (type) => cleanContent.startsWith(type)
674
- )) {
649
+ if (["application/", "audio/", "image/", "video/"].some((type) => cleanContent.startsWith(type))) {
675
650
  return "blob";
676
651
  }
677
652
  if (cleanContent.startsWith("text/")) {
@@ -959,12 +934,7 @@ var createClient = (config = {}) => {
959
934
  let finalError = error;
960
935
  for (const fn of interceptors.error.fns) {
961
936
  if (fn) {
962
- finalError = await fn(
963
- finalError,
964
- response,
965
- request2,
966
- options
967
- );
937
+ finalError = await fn(finalError, response, request2, options);
968
938
  }
969
939
  }
970
940
  finalError = finalError || {};
@@ -1 +1 @@
1
- export { C as Client, a as ClientOptions, b as Config, c as CreateClientConfig, O as Options, R as RequestOptions, d as RequestResult, e as ResolvedRequestOptions, f as ResponseStyle, T as TDataShape } from '../../types.gen-DKrNRB-E.mjs';
1
+ export { C as Client, a as ClientOptions, b as Config, c as CreateClientConfig, O as Options, R as RequestOptions, d as RequestResult, e as ResolvedRequestOptions, f as ResponseStyle, T as TDataShape } from '../../types.gen-B0nhFpj5.mjs';
@@ -1 +1 @@
1
- export { C as Client, a as ClientOptions, b as Config, c as CreateClientConfig, O as Options, R as RequestOptions, d as RequestResult, e as ResolvedRequestOptions, f as ResponseStyle, T as TDataShape } from '../../types.gen-DKrNRB-E.js';
1
+ export { C as Client, a as ClientOptions, b as Config, c as CreateClientConfig, O as Options, R as RequestOptions, d as RequestResult, e as ResolvedRequestOptions, f as ResponseStyle, T as TDataShape } from '../../types.gen-B0nhFpj5.js';
@@ -1,5 +1,5 @@
1
- import { C as Client, a as ClientOptions, b as Config } from '../types.gen-DKrNRB-E.mjs';
2
- import { ar as ClientOptions$1 } from '../types.gen-DpwDhqbe.mjs';
1
+ import { C as Client, a as ClientOptions, b as Config } from '../types.gen-B0nhFpj5.mjs';
2
+ import { C as ClientOptions$1 } from '../types.gen-BXTtmC9a.mjs';
3
3
 
4
4
  /**
5
5
  * The `createClientConfig()` function will be called on client initialization
@@ -1,5 +1,5 @@
1
- import { C as Client, a as ClientOptions, b as Config } from '../types.gen-DKrNRB-E.js';
2
- import { ar as ClientOptions$1 } from '../types.gen-DpwDhqbe.js';
1
+ import { C as Client, a as ClientOptions, b as Config } from '../types.gen-B0nhFpj5.js';
2
+ import { C as ClientOptions$1 } from '../types.gen-BXTtmC9a.js';
3
3
 
4
4
  /**
5
5
  * The `createClientConfig()` function will be called on client initialization
@@ -2,10 +2,7 @@
2
2
 
3
3
  // src/api/core/bodySerializer.gen.ts
4
4
  var jsonBodySerializer = {
5
- bodySerializer: (body) => JSON.stringify(
6
- body,
7
- (_key, value) => typeof value === "bigint" ? value.toString() : value
8
- )
5
+ bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value)
9
6
  };
10
7
 
11
8
  // src/api/core/serverSentEvents.gen.ts
@@ -49,10 +46,7 @@ function createSseClient({
49
46
  }
50
47
  const _fetch = options.fetch ?? globalThis.fetch;
51
48
  const response = await _fetch(request);
52
- if (!response.ok)
53
- throw new Error(
54
- `SSE failed: ${response.status} ${response.statusText}`
55
- );
49
+ if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`);
56
50
  if (!response.body) throw new Error("No body in SSE response");
57
51
  const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
58
52
  let buffer = "";
@@ -83,10 +77,7 @@ function createSseClient({
83
77
  } else if (line.startsWith("id:")) {
84
78
  lastEventId = line.replace(/^id:\s*/, "");
85
79
  } else if (line.startsWith("retry:")) {
86
- const parsed = Number.parseInt(
87
- line.replace(/^retry:\s*/, ""),
88
- 10
89
- );
80
+ const parsed = Number.parseInt(line.replace(/^retry:\s*/, ""), 10);
90
81
  if (!Number.isNaN(parsed)) {
91
82
  retryDelay = parsed;
92
83
  }
@@ -132,10 +123,7 @@ function createSseClient({
132
123
  if (sseMaxRetryAttempts !== void 0 && attempt >= sseMaxRetryAttempts) {
133
124
  break;
134
125
  }
135
- const backoff = Math.min(
136
- retryDelay * 2 ** (attempt - 1),
137
- sseMaxRetryDelay ?? 3e4
138
- );
126
+ const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 3e4);
139
127
  await sleep(backoff);
140
128
  }
141
129
  }
@@ -243,11 +231,7 @@ var serializeObjectParam = ({
243
231
  if (style !== "deepObject" && !explode) {
244
232
  let values = [];
245
233
  Object.entries(value).forEach(([key, v]) => {
246
- values = [
247
- ...values,
248
- key,
249
- allowReserved ? v : encodeURIComponent(v)
250
- ];
234
+ values = [...values, key, allowReserved ? v : encodeURIComponent(v)];
251
235
  });
252
236
  const joinedValues2 = values.join(",");
253
237
  switch (style) {
@@ -298,10 +282,7 @@ var defaultPathSerializer = ({ path, url: _url }) => {
298
282
  continue;
299
283
  }
300
284
  if (Array.isArray(value)) {
301
- url = url.replace(
302
- match,
303
- serializeArrayParam({ explode, name, style, value })
304
- );
285
+ url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
305
286
  continue;
306
287
  }
307
288
  if (typeof value === "object") {
@@ -449,9 +430,7 @@ var getParseAs = (contentType) => {
449
430
  if (cleanContent === "multipart/form-data") {
450
431
  return "formData";
451
432
  }
452
- if (["application/", "audio/", "image/", "video/"].some(
453
- (type) => cleanContent.startsWith(type)
454
- )) {
433
+ if (["application/", "audio/", "image/", "video/"].some((type) => cleanContent.startsWith(type))) {
455
434
  return "blob";
456
435
  }
457
436
  if (cleanContent.startsWith("text/")) {
@@ -739,12 +718,7 @@ var createClient = (config = {}) => {
739
718
  let finalError = error;
740
719
  for (const fn of interceptors.error.fns) {
741
720
  if (fn) {
742
- finalError = await fn(
743
- finalError,
744
- response,
745
- request2,
746
- options
747
- );
721
+ finalError = await fn(finalError, response, request2, options);
748
722
  }
749
723
  }
750
724
  finalError = finalError || {};
@@ -809,9 +783,7 @@ var createClient = (config = {}) => {
809
783
  };
810
784
 
811
785
  // src/api/client.gen.ts
812
- var client = createClient(
813
- createConfig({ throwOnError: true })
814
- );
786
+ var client = createClient(createConfig({ throwOnError: true }));
815
787
 
816
788
  exports.client = client;
817
789
  //# sourceMappingURL=client.gen.js.map