@layer-drone/protocol 0.0.9-alpha.2 → 0.0.9-alpha.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/index.js CHANGED
@@ -27,18 +27,24 @@ __export(index_exports, {
27
27
  apiTokenControllerGetToken: () => apiTokenControllerGetToken,
28
28
  apiTokenControllerUpdateToken: () => apiTokenControllerUpdateToken,
29
29
  appControllerGetHello: () => appControllerGetHello,
30
- client: () => client,
30
+ buildClientParams: () => buildClientParams,
31
31
  conditionsControllerGetSunAltitudeTimeLimits: () => conditionsControllerGetSunAltitudeTimeLimits,
32
+ createClient: () => createClient,
33
+ createConfig: () => createConfig,
32
34
  flightsControllerCreatePresignedUrls: () => flightsControllerCreatePresignedUrls,
33
35
  flightsControllerGenerateFlightId: () => flightsControllerGenerateFlightId,
34
36
  flightsControllerValidateFlight: () => flightsControllerValidateFlight,
37
+ formDataBodySerializer: () => formDataBodySerializer,
38
+ jsonBodySerializer: () => jsonBodySerializer,
35
39
  keysControllerGetProvenanceCryptoKey: () => keysControllerGetProvenanceCryptoKey,
40
+ mergeHeaders: () => mergeHeaders,
36
41
  parseWebhookEvent: () => parseWebhookEvent,
37
42
  quotesControllerCreateQuote: () => quotesControllerCreateQuote,
38
43
  quotesControllerGetQuote: () => quotesControllerGetQuote,
39
44
  rewardsControllerDepositRewards: () => rewardsControllerDepositRewards,
40
45
  rewardsControllerDistributeRewards: () => rewardsControllerDistributeRewards,
41
46
  schemaControllerGetEventSchema: () => schemaControllerGetEventSchema,
47
+ urlSearchParamsBodySerializer: () => urlSearchParamsBodySerializer,
42
48
  webhooksControllerCreate: () => webhooksControllerCreate,
43
49
  webhooksControllerDelete: () => webhooksControllerDelete,
44
50
  webhooksControllerGet: () => webhooksControllerGet,
@@ -50,9 +56,693 @@ __export(index_exports, {
50
56
  });
51
57
  module.exports = __toCommonJS(index_exports);
52
58
 
59
+ // src/client/core/bodySerializer.ts
60
+ var serializeFormDataPair = /* @__PURE__ */ __name((data, key, value) => {
61
+ if (typeof value === "string" || value instanceof Blob) {
62
+ data.append(key, value);
63
+ } else {
64
+ data.append(key, JSON.stringify(value));
65
+ }
66
+ }, "serializeFormDataPair");
67
+ var serializeUrlSearchParamsPair = /* @__PURE__ */ __name((data, key, value) => {
68
+ if (typeof value === "string") {
69
+ data.append(key, value);
70
+ } else {
71
+ data.append(key, JSON.stringify(value));
72
+ }
73
+ }, "serializeUrlSearchParamsPair");
74
+ var formDataBodySerializer = {
75
+ bodySerializer: /* @__PURE__ */ __name((body) => {
76
+ const data = new FormData();
77
+ Object.entries(body).forEach(([key, value]) => {
78
+ if (value === void 0 || value === null) {
79
+ return;
80
+ }
81
+ if (Array.isArray(value)) {
82
+ value.forEach((v) => serializeFormDataPair(data, key, v));
83
+ } else {
84
+ serializeFormDataPair(data, key, value);
85
+ }
86
+ });
87
+ return data;
88
+ }, "bodySerializer")
89
+ };
90
+ var jsonBodySerializer = {
91
+ bodySerializer: /* @__PURE__ */ __name((body) => JSON.stringify(body, (key, value) => typeof value === "bigint" ? value.toString() : value), "bodySerializer")
92
+ };
93
+ var urlSearchParamsBodySerializer = {
94
+ bodySerializer: /* @__PURE__ */ __name((body) => {
95
+ const data = new URLSearchParams();
96
+ Object.entries(body).forEach(([key, value]) => {
97
+ if (value === void 0 || value === null) {
98
+ return;
99
+ }
100
+ if (Array.isArray(value)) {
101
+ value.forEach((v) => serializeUrlSearchParamsPair(data, key, v));
102
+ } else {
103
+ serializeUrlSearchParamsPair(data, key, value);
104
+ }
105
+ });
106
+ return data.toString();
107
+ }, "bodySerializer")
108
+ };
109
+
110
+ // src/client/core/params.ts
111
+ var extraPrefixesMap = {
112
+ $body_: "body",
113
+ $headers_: "headers",
114
+ $path_: "path",
115
+ $query_: "query"
116
+ };
117
+ var extraPrefixes = Object.entries(extraPrefixesMap);
118
+ var buildKeyMap = /* @__PURE__ */ __name((fields, map) => {
119
+ if (!map) {
120
+ map = /* @__PURE__ */ new Map();
121
+ }
122
+ for (const config of fields) {
123
+ if ("in" in config) {
124
+ if (config.key) {
125
+ map.set(config.key, {
126
+ in: config.in,
127
+ map: config.map
128
+ });
129
+ }
130
+ } else if (config.args) {
131
+ buildKeyMap(config.args, map);
132
+ }
133
+ }
134
+ return map;
135
+ }, "buildKeyMap");
136
+ var stripEmptySlots = /* @__PURE__ */ __name((params) => {
137
+ for (const [slot, value] of Object.entries(params)) {
138
+ if (value && typeof value === "object" && !Object.keys(value).length) {
139
+ delete params[slot];
140
+ }
141
+ }
142
+ }, "stripEmptySlots");
143
+ var buildClientParams = /* @__PURE__ */ __name((args, fields) => {
144
+ const params = {
145
+ body: {},
146
+ headers: {},
147
+ path: {},
148
+ query: {}
149
+ };
150
+ const map = buildKeyMap(fields);
151
+ let config;
152
+ for (const [index, arg] of args.entries()) {
153
+ if (fields[index]) {
154
+ config = fields[index];
155
+ }
156
+ if (!config) {
157
+ continue;
158
+ }
159
+ if ("in" in config) {
160
+ if (config.key) {
161
+ const field = map.get(config.key);
162
+ const name = field.map || config.key;
163
+ params[field.in][name] = arg;
164
+ } else {
165
+ params.body = arg;
166
+ }
167
+ } else {
168
+ for (const [key, value] of Object.entries(arg ?? {})) {
169
+ const field = map.get(key);
170
+ if (field) {
171
+ const name = field.map || key;
172
+ params[field.in][name] = value;
173
+ } else {
174
+ const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix));
175
+ if (extra) {
176
+ const [prefix, slot] = extra;
177
+ params[slot][key.slice(prefix.length)] = value;
178
+ } else {
179
+ for (const [slot, allowed] of Object.entries(config.allowExtra ?? {})) {
180
+ if (allowed) {
181
+ params[slot][key] = value;
182
+ break;
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
188
+ }
189
+ }
190
+ stripEmptySlots(params);
191
+ return params;
192
+ }, "buildClientParams");
193
+
194
+ // src/client/core/auth.ts
195
+ var getAuthToken = /* @__PURE__ */ __name(async (auth, callback) => {
196
+ const token = typeof callback === "function" ? await callback(auth) : callback;
197
+ if (!token) {
198
+ return;
199
+ }
200
+ if (auth.scheme === "bearer") {
201
+ return `Bearer ${token}`;
202
+ }
203
+ if (auth.scheme === "basic") {
204
+ return `Basic ${btoa(token)}`;
205
+ }
206
+ return token;
207
+ }, "getAuthToken");
208
+
209
+ // src/client/core/pathSerializer.ts
210
+ var separatorArrayExplode = /* @__PURE__ */ __name((style) => {
211
+ switch (style) {
212
+ case "label":
213
+ return ".";
214
+ case "matrix":
215
+ return ";";
216
+ case "simple":
217
+ return ",";
218
+ default:
219
+ return "&";
220
+ }
221
+ }, "separatorArrayExplode");
222
+ var separatorArrayNoExplode = /* @__PURE__ */ __name((style) => {
223
+ switch (style) {
224
+ case "form":
225
+ return ",";
226
+ case "pipeDelimited":
227
+ return "|";
228
+ case "spaceDelimited":
229
+ return "%20";
230
+ default:
231
+ return ",";
232
+ }
233
+ }, "separatorArrayNoExplode");
234
+ var separatorObjectExplode = /* @__PURE__ */ __name((style) => {
235
+ switch (style) {
236
+ case "label":
237
+ return ".";
238
+ case "matrix":
239
+ return ";";
240
+ case "simple":
241
+ return ",";
242
+ default:
243
+ return "&";
244
+ }
245
+ }, "separatorObjectExplode");
246
+ var serializeArrayParam = /* @__PURE__ */ __name(({ allowReserved, explode, name, style, value }) => {
247
+ if (!explode) {
248
+ const joinedValues2 = (allowReserved ? value : value.map((v) => encodeURIComponent(v))).join(separatorArrayNoExplode(style));
249
+ switch (style) {
250
+ case "label":
251
+ return `.${joinedValues2}`;
252
+ case "matrix":
253
+ return `;${name}=${joinedValues2}`;
254
+ case "simple":
255
+ return joinedValues2;
256
+ default:
257
+ return `${name}=${joinedValues2}`;
258
+ }
259
+ }
260
+ const separator = separatorArrayExplode(style);
261
+ const joinedValues = value.map((v) => {
262
+ if (style === "label" || style === "simple") {
263
+ return allowReserved ? v : encodeURIComponent(v);
264
+ }
265
+ return serializePrimitiveParam({
266
+ allowReserved,
267
+ name,
268
+ value: v
269
+ });
270
+ }).join(separator);
271
+ return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
272
+ }, "serializeArrayParam");
273
+ var serializePrimitiveParam = /* @__PURE__ */ __name(({ allowReserved, name, value }) => {
274
+ if (value === void 0 || value === null) {
275
+ return "";
276
+ }
277
+ if (typeof value === "object") {
278
+ throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");
279
+ }
280
+ return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;
281
+ }, "serializePrimitiveParam");
282
+ var serializeObjectParam = /* @__PURE__ */ __name(({ allowReserved, explode, name, style, value, valueOnly }) => {
283
+ if (value instanceof Date) {
284
+ return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;
285
+ }
286
+ if (style !== "deepObject" && !explode) {
287
+ let values = [];
288
+ Object.entries(value).forEach(([key, v]) => {
289
+ values = [
290
+ ...values,
291
+ key,
292
+ allowReserved ? v : encodeURIComponent(v)
293
+ ];
294
+ });
295
+ const joinedValues2 = values.join(",");
296
+ switch (style) {
297
+ case "form":
298
+ return `${name}=${joinedValues2}`;
299
+ case "label":
300
+ return `.${joinedValues2}`;
301
+ case "matrix":
302
+ return `;${name}=${joinedValues2}`;
303
+ default:
304
+ return joinedValues2;
305
+ }
306
+ }
307
+ const separator = separatorObjectExplode(style);
308
+ const joinedValues = Object.entries(value).map(([key, v]) => serializePrimitiveParam({
309
+ allowReserved,
310
+ name: style === "deepObject" ? `${name}[${key}]` : key,
311
+ value: v
312
+ })).join(separator);
313
+ return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
314
+ }, "serializeObjectParam");
315
+
316
+ // src/client/client/utils.ts
317
+ var PATH_PARAM_RE = /\{[^{}]+\}/g;
318
+ var defaultPathSerializer = /* @__PURE__ */ __name(({ path, url: _url }) => {
319
+ let url = _url;
320
+ const matches = _url.match(PATH_PARAM_RE);
321
+ if (matches) {
322
+ for (const match of matches) {
323
+ let explode = false;
324
+ let name = match.substring(1, match.length - 1);
325
+ let style = "simple";
326
+ if (name.endsWith("*")) {
327
+ explode = true;
328
+ name = name.substring(0, name.length - 1);
329
+ }
330
+ if (name.startsWith(".")) {
331
+ name = name.substring(1);
332
+ style = "label";
333
+ } else if (name.startsWith(";")) {
334
+ name = name.substring(1);
335
+ style = "matrix";
336
+ }
337
+ const value = path[name];
338
+ if (value === void 0 || value === null) {
339
+ continue;
340
+ }
341
+ if (Array.isArray(value)) {
342
+ url = url.replace(match, serializeArrayParam({
343
+ explode,
344
+ name,
345
+ style,
346
+ value
347
+ }));
348
+ continue;
349
+ }
350
+ if (typeof value === "object") {
351
+ url = url.replace(match, serializeObjectParam({
352
+ explode,
353
+ name,
354
+ style,
355
+ value,
356
+ valueOnly: true
357
+ }));
358
+ continue;
359
+ }
360
+ if (style === "matrix") {
361
+ url = url.replace(match, `;${serializePrimitiveParam({
362
+ name,
363
+ value
364
+ })}`);
365
+ continue;
366
+ }
367
+ const replaceValue = encodeURIComponent(style === "label" ? `.${value}` : value);
368
+ url = url.replace(match, replaceValue);
369
+ }
370
+ }
371
+ return url;
372
+ }, "defaultPathSerializer");
373
+ var createQuerySerializer = /* @__PURE__ */ __name(({ allowReserved, array, object } = {}) => {
374
+ const querySerializer = /* @__PURE__ */ __name((queryParams) => {
375
+ const search = [];
376
+ if (queryParams && typeof queryParams === "object") {
377
+ for (const name in queryParams) {
378
+ const value = queryParams[name];
379
+ if (value === void 0 || value === null) {
380
+ continue;
381
+ }
382
+ if (Array.isArray(value)) {
383
+ const serializedArray = serializeArrayParam({
384
+ allowReserved,
385
+ explode: true,
386
+ name,
387
+ style: "form",
388
+ value,
389
+ ...array
390
+ });
391
+ if (serializedArray) search.push(serializedArray);
392
+ } else if (typeof value === "object") {
393
+ const serializedObject = serializeObjectParam({
394
+ allowReserved,
395
+ explode: true,
396
+ name,
397
+ style: "deepObject",
398
+ value,
399
+ ...object
400
+ });
401
+ if (serializedObject) search.push(serializedObject);
402
+ } else {
403
+ const serializedPrimitive = serializePrimitiveParam({
404
+ allowReserved,
405
+ name,
406
+ value
407
+ });
408
+ if (serializedPrimitive) search.push(serializedPrimitive);
409
+ }
410
+ }
411
+ }
412
+ return search.join("&");
413
+ }, "querySerializer");
414
+ return querySerializer;
415
+ }, "createQuerySerializer");
416
+ var getParseAs = /* @__PURE__ */ __name((contentType) => {
417
+ if (!contentType) {
418
+ return "stream";
419
+ }
420
+ const cleanContent = contentType.split(";")[0]?.trim();
421
+ if (!cleanContent) {
422
+ return;
423
+ }
424
+ if (cleanContent.startsWith("application/json") || cleanContent.endsWith("+json")) {
425
+ return "json";
426
+ }
427
+ if (cleanContent === "multipart/form-data") {
428
+ return "formData";
429
+ }
430
+ if ([
431
+ "application/",
432
+ "audio/",
433
+ "image/",
434
+ "video/"
435
+ ].some((type) => cleanContent.startsWith(type))) {
436
+ return "blob";
437
+ }
438
+ if (cleanContent.startsWith("text/")) {
439
+ return "text";
440
+ }
441
+ }, "getParseAs");
442
+ var setAuthParams = /* @__PURE__ */ __name(async ({ security, ...options }) => {
443
+ for (const auth of security) {
444
+ const token = await getAuthToken(auth, options.auth);
445
+ if (!token) {
446
+ continue;
447
+ }
448
+ const name = auth.name ?? "Authorization";
449
+ switch (auth.in) {
450
+ case "query":
451
+ if (!options.query) {
452
+ options.query = {};
453
+ }
454
+ options.query[name] = token;
455
+ break;
456
+ case "cookie":
457
+ options.headers.append("Cookie", `${name}=${token}`);
458
+ break;
459
+ case "header":
460
+ default:
461
+ options.headers.set(name, token);
462
+ break;
463
+ }
464
+ return;
465
+ }
466
+ }, "setAuthParams");
467
+ var buildUrl = /* @__PURE__ */ __name((options) => {
468
+ const url = getUrl({
469
+ baseUrl: options.baseUrl,
470
+ path: options.path,
471
+ query: options.query,
472
+ querySerializer: typeof options.querySerializer === "function" ? options.querySerializer : createQuerySerializer(options.querySerializer),
473
+ url: options.url
474
+ });
475
+ return url;
476
+ }, "buildUrl");
477
+ var getUrl = /* @__PURE__ */ __name(({ baseUrl, path, query, querySerializer, url: _url }) => {
478
+ const pathUrl = _url.startsWith("/") ? _url : `/${_url}`;
479
+ let url = (baseUrl ?? "") + pathUrl;
480
+ if (path) {
481
+ url = defaultPathSerializer({
482
+ path,
483
+ url
484
+ });
485
+ }
486
+ let search = query ? querySerializer(query) : "";
487
+ if (search.startsWith("?")) {
488
+ search = search.substring(1);
489
+ }
490
+ if (search) {
491
+ url += `?${search}`;
492
+ }
493
+ return url;
494
+ }, "getUrl");
495
+ var mergeConfigs = /* @__PURE__ */ __name((a, b) => {
496
+ const config = {
497
+ ...a,
498
+ ...b
499
+ };
500
+ if (config.baseUrl?.endsWith("/")) {
501
+ config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1);
502
+ }
503
+ config.headers = mergeHeaders(a.headers, b.headers);
504
+ return config;
505
+ }, "mergeConfigs");
506
+ var mergeHeaders = /* @__PURE__ */ __name((...headers) => {
507
+ const mergedHeaders = new Headers();
508
+ for (const header of headers) {
509
+ if (!header || typeof header !== "object") {
510
+ continue;
511
+ }
512
+ const iterator = header instanceof Headers ? header.entries() : Object.entries(header);
513
+ for (const [key, value] of iterator) {
514
+ if (value === null) {
515
+ mergedHeaders.delete(key);
516
+ } else if (Array.isArray(value)) {
517
+ for (const v of value) {
518
+ mergedHeaders.append(key, v);
519
+ }
520
+ } else if (value !== void 0) {
521
+ mergedHeaders.set(key, typeof value === "object" ? JSON.stringify(value) : value);
522
+ }
523
+ }
524
+ }
525
+ return mergedHeaders;
526
+ }, "mergeHeaders");
527
+ var Interceptors = class Interceptors2 {
528
+ static {
529
+ __name(this, "Interceptors");
530
+ }
531
+ _fns;
532
+ constructor() {
533
+ this._fns = [];
534
+ }
535
+ clear() {
536
+ this._fns = [];
537
+ }
538
+ getInterceptorIndex(id) {
539
+ if (typeof id === "number") {
540
+ return this._fns[id] ? id : -1;
541
+ } else {
542
+ return this._fns.indexOf(id);
543
+ }
544
+ }
545
+ exists(id) {
546
+ const index = this.getInterceptorIndex(id);
547
+ return !!this._fns[index];
548
+ }
549
+ eject(id) {
550
+ const index = this.getInterceptorIndex(id);
551
+ if (this._fns[index]) {
552
+ this._fns[index] = null;
553
+ }
554
+ }
555
+ update(id, fn) {
556
+ const index = this.getInterceptorIndex(id);
557
+ if (this._fns[index]) {
558
+ this._fns[index] = fn;
559
+ return id;
560
+ } else {
561
+ return false;
562
+ }
563
+ }
564
+ use(fn) {
565
+ this._fns = [
566
+ ...this._fns,
567
+ fn
568
+ ];
569
+ return this._fns.length - 1;
570
+ }
571
+ };
572
+ var createInterceptors = /* @__PURE__ */ __name(() => ({
573
+ error: new Interceptors(),
574
+ request: new Interceptors(),
575
+ response: new Interceptors()
576
+ }), "createInterceptors");
577
+ var defaultQuerySerializer = createQuerySerializer({
578
+ allowReserved: false,
579
+ array: {
580
+ explode: true,
581
+ style: "form"
582
+ },
583
+ object: {
584
+ explode: true,
585
+ style: "deepObject"
586
+ }
587
+ });
588
+ var defaultHeaders = {
589
+ "Content-Type": "application/json"
590
+ };
591
+ var createConfig = /* @__PURE__ */ __name((override = {}) => ({
592
+ ...jsonBodySerializer,
593
+ headers: defaultHeaders,
594
+ parseAs: "auto",
595
+ querySerializer: defaultQuerySerializer,
596
+ ...override
597
+ }), "createConfig");
598
+
599
+ // src/client/client/client.ts
600
+ var createClient = /* @__PURE__ */ __name((config = {}) => {
601
+ let _config = mergeConfigs(createConfig(), config);
602
+ const getConfig = /* @__PURE__ */ __name(() => ({
603
+ ..._config
604
+ }), "getConfig");
605
+ const setConfig = /* @__PURE__ */ __name((config2) => {
606
+ _config = mergeConfigs(_config, config2);
607
+ return getConfig();
608
+ }, "setConfig");
609
+ const interceptors = createInterceptors();
610
+ const request = /* @__PURE__ */ __name(async (options) => {
611
+ const opts = {
612
+ ..._config,
613
+ ...options,
614
+ fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
615
+ headers: mergeHeaders(_config.headers, options.headers)
616
+ };
617
+ if (opts.security) {
618
+ await setAuthParams({
619
+ ...opts,
620
+ security: opts.security
621
+ });
622
+ }
623
+ if (opts.body && opts.bodySerializer) {
624
+ opts.body = opts.bodySerializer(opts.body);
625
+ }
626
+ if (opts.body === void 0 || opts.body === "") {
627
+ opts.headers.delete("Content-Type");
628
+ }
629
+ const url = buildUrl(opts);
630
+ const requestInit = {
631
+ redirect: "follow",
632
+ ...opts
633
+ };
634
+ let request2 = new Request(url, requestInit);
635
+ for (const fn of interceptors.request._fns) {
636
+ if (fn) {
637
+ request2 = await fn(request2, opts);
638
+ }
639
+ }
640
+ const _fetch = opts.fetch;
641
+ let response = await _fetch(request2);
642
+ for (const fn of interceptors.response._fns) {
643
+ if (fn) {
644
+ response = await fn(response, request2, opts);
645
+ }
646
+ }
647
+ const result = {
648
+ request: request2,
649
+ response
650
+ };
651
+ if (response.ok) {
652
+ if (response.status === 204 || response.headers.get("Content-Length") === "0") {
653
+ return opts.responseStyle === "data" ? {} : {
654
+ data: {},
655
+ ...result
656
+ };
657
+ }
658
+ const parseAs = (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json";
659
+ if (parseAs === "stream") {
660
+ return opts.responseStyle === "data" ? response.body : {
661
+ data: response.body,
662
+ ...result
663
+ };
664
+ }
665
+ let data = await response[parseAs]();
666
+ if (parseAs === "json") {
667
+ if (opts.responseValidator) {
668
+ await opts.responseValidator(data);
669
+ }
670
+ if (opts.responseTransformer) {
671
+ data = await opts.responseTransformer(data);
672
+ }
673
+ }
674
+ return opts.responseStyle === "data" ? data : {
675
+ data,
676
+ ...result
677
+ };
678
+ }
679
+ let error = await response.text();
680
+ try {
681
+ error = JSON.parse(error);
682
+ } catch {
683
+ }
684
+ let finalError = error;
685
+ for (const fn of interceptors.error._fns) {
686
+ if (fn) {
687
+ finalError = await fn(error, response, request2, opts);
688
+ }
689
+ }
690
+ finalError = finalError || {};
691
+ if (opts.throwOnError) {
692
+ throw finalError;
693
+ }
694
+ return opts.responseStyle === "data" ? void 0 : {
695
+ error: finalError,
696
+ ...result
697
+ };
698
+ }, "request");
699
+ return {
700
+ buildUrl,
701
+ connect: /* @__PURE__ */ __name((options) => request({
702
+ ...options,
703
+ method: "CONNECT"
704
+ }), "connect"),
705
+ delete: /* @__PURE__ */ __name((options) => request({
706
+ ...options,
707
+ method: "DELETE"
708
+ }), "delete"),
709
+ get: /* @__PURE__ */ __name((options) => request({
710
+ ...options,
711
+ method: "GET"
712
+ }), "get"),
713
+ getConfig,
714
+ head: /* @__PURE__ */ __name((options) => request({
715
+ ...options,
716
+ method: "HEAD"
717
+ }), "head"),
718
+ interceptors,
719
+ options: /* @__PURE__ */ __name((options) => request({
720
+ ...options,
721
+ method: "OPTIONS"
722
+ }), "options"),
723
+ patch: /* @__PURE__ */ __name((options) => request({
724
+ ...options,
725
+ method: "PATCH"
726
+ }), "patch"),
727
+ post: /* @__PURE__ */ __name((options) => request({
728
+ ...options,
729
+ method: "POST"
730
+ }), "post"),
731
+ put: /* @__PURE__ */ __name((options) => request({
732
+ ...options,
733
+ method: "PUT"
734
+ }), "put"),
735
+ request,
736
+ setConfig,
737
+ trace: /* @__PURE__ */ __name((options) => request({
738
+ ...options,
739
+ method: "TRACE"
740
+ }), "trace")
741
+ };
742
+ }, "createClient");
743
+
53
744
  // src/client/client.gen.ts
54
- var import_client_fetch = require("@hey-api/client-fetch");
55
- var client = (0, import_client_fetch.createClient)((0, import_client_fetch.createConfig)());
745
+ var client = createClient(createConfig());
56
746
 
57
747
  // src/client/transformers.gen.ts
58
748
  var updateApiTokenResponseDtoSchemaResponseTransformer = /* @__PURE__ */ __name((data) => {
@@ -101,7 +791,7 @@ var rewardsControllerDepositRewards = /* @__PURE__ */ __name((options) => {
101
791
  ...options,
102
792
  headers: {
103
793
  "Content-Type": "application/json",
104
- ...options?.headers
794
+ ...options.headers
105
795
  }
106
796
  });
107
797
  }, "rewardsControllerDepositRewards");
@@ -117,7 +807,7 @@ var rewardsControllerDistributeRewards = /* @__PURE__ */ __name((options) => {
117
807
  ...options,
118
808
  headers: {
119
809
  "Content-Type": "application/json",
120
- ...options?.headers
810
+ ...options.headers
121
811
  }
122
812
  });
123
813
  }, "rewardsControllerDistributeRewards");
@@ -133,7 +823,7 @@ var apiTokenControllerCreateToken = /* @__PURE__ */ __name((options) => {
133
823
  ...options,
134
824
  headers: {
135
825
  "Content-Type": "application/json",
136
- ...options?.headers
826
+ ...options.headers
137
827
  }
138
828
  });
139
829
  }, "apiTokenControllerCreateToken");
@@ -174,7 +864,7 @@ var apiTokenControllerUpdateToken = /* @__PURE__ */ __name((options) => {
174
864
  ...options,
175
865
  headers: {
176
866
  "Content-Type": "application/json",
177
- ...options?.headers
867
+ ...options.headers
178
868
  }
179
869
  });
180
870
  }, "apiTokenControllerUpdateToken");
@@ -190,7 +880,7 @@ var quotesControllerCreateQuote = /* @__PURE__ */ __name((options) => {
190
880
  ...options,
191
881
  headers: {
192
882
  "Content-Type": "application/json",
193
- ...options?.headers
883
+ ...options.headers
194
884
  }
195
885
  });
196
886
  }, "quotesControllerCreateQuote");
@@ -230,7 +920,7 @@ var flightsControllerCreatePresignedUrls = /* @__PURE__ */ __name((options) => {
230
920
  ...options,
231
921
  headers: {
232
922
  "Content-Type": "application/json",
233
- ...options?.headers
923
+ ...options.headers
234
924
  }
235
925
  });
236
926
  }, "flightsControllerCreatePresignedUrls");
@@ -246,7 +936,7 @@ var flightsControllerValidateFlight = /* @__PURE__ */ __name((options) => {
246
936
  ...options,
247
937
  headers: {
248
938
  "Content-Type": "application/json",
249
- ...options?.headers
939
+ ...options.headers
250
940
  }
251
941
  });
252
942
  }, "flightsControllerValidateFlight");
@@ -287,7 +977,7 @@ var webhooksControllerCreate = /* @__PURE__ */ __name((options) => {
287
977
  ...options,
288
978
  headers: {
289
979
  "Content-Type": "application/json",
290
- ...options?.headers
980
+ ...options.headers
291
981
  }
292
982
  });
293
983
  }, "webhooksControllerCreate");
@@ -327,7 +1017,7 @@ var webhooksControllerUpdate = /* @__PURE__ */ __name((options) => {
327
1017
  ...options,
328
1018
  headers: {
329
1019
  "Content-Type": "application/json",
330
- ...options?.headers
1020
+ ...options.headers
331
1021
  }
332
1022
  });
333
1023
  }, "webhooksControllerUpdate");
@@ -423,18 +1113,24 @@ __name(getSecretHeader, "getSecretHeader");
423
1113
  apiTokenControllerGetToken,
424
1114
  apiTokenControllerUpdateToken,
425
1115
  appControllerGetHello,
426
- client,
1116
+ buildClientParams,
427
1117
  conditionsControllerGetSunAltitudeTimeLimits,
1118
+ createClient,
1119
+ createConfig,
428
1120
  flightsControllerCreatePresignedUrls,
429
1121
  flightsControllerGenerateFlightId,
430
1122
  flightsControllerValidateFlight,
1123
+ formDataBodySerializer,
1124
+ jsonBodySerializer,
431
1125
  keysControllerGetProvenanceCryptoKey,
1126
+ mergeHeaders,
432
1127
  parseWebhookEvent,
433
1128
  quotesControllerCreateQuote,
434
1129
  quotesControllerGetQuote,
435
1130
  rewardsControllerDepositRewards,
436
1131
  rewardsControllerDistributeRewards,
437
1132
  schemaControllerGetEventSchema,
1133
+ urlSearchParamsBodySerializer,
438
1134
  webhooksControllerCreate,
439
1135
  webhooksControllerDelete,
440
1136
  webhooksControllerGet,