@layer-drone/protocol 0.0.9-alpha.1 → 0.0.9-alpha.2
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.d.mts +41 -165
- package/dist/index.d.ts +41 -165
- package/dist/index.js +11 -574
- package/dist/index.mjs +10 -573
- package/package.json +2 -2
- package/src/client/client.gen.ts +3 -2
- package/src/client/index.ts +2 -2
- package/src/client/sdk.gen.ts +92 -130
- package/src/client/transformers.gen.ts +1 -1
- package/src/client/client/client.ts +0 -181
- package/src/client/client/index.ts +0 -22
- package/src/client/client/types.ts +0 -215
- package/src/client/client/utils.ts +0 -415
- package/src/client/core/auth.ts +0 -40
- package/src/client/core/bodySerializer.ts +0 -84
- package/src/client/core/params.ts +0 -141
- package/src/client/core/pathSerializer.ts +0 -179
- package/src/client/core/types.ts +0 -98
package/src/client/sdk.gen.ts
CHANGED
|
@@ -1,81 +1,57 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
import { client as _heyApiClient } from "./client.gen.js";
|
|
3
2
|
import type {
|
|
4
3
|
Client,
|
|
5
4
|
Options as ClientOptions,
|
|
6
5
|
TDataShape,
|
|
7
|
-
} from "
|
|
6
|
+
} from "@hey-api/client-fetch";
|
|
7
|
+
|
|
8
|
+
import { client as _heyApiClient } from "./client.gen";
|
|
8
9
|
import {
|
|
9
10
|
apiTokenControllerUpdateTokenResponseTransformer,
|
|
10
11
|
conditionsControllerGetSunAltitudeTimeLimitsResponseTransformer,
|
|
11
|
-
} from "./transformers.gen
|
|
12
|
+
} from "./transformers.gen";
|
|
12
13
|
import type {
|
|
13
14
|
ApiTokenControllerCreateTokenData,
|
|
14
|
-
|
|
15
|
-
ApiTokenControllerCreateTokenResponses,
|
|
15
|
+
ApiTokenControllerCreateTokenResponse,
|
|
16
16
|
ApiTokenControllerDeleteTokenData,
|
|
17
|
-
ApiTokenControllerDeleteTokenErrors,
|
|
18
|
-
ApiTokenControllerDeleteTokenResponses,
|
|
19
17
|
ApiTokenControllerGetTokenData,
|
|
20
|
-
ApiTokenControllerGetTokenErrors,
|
|
21
|
-
ApiTokenControllerGetTokenResponses,
|
|
22
18
|
ApiTokenControllerUpdateTokenData,
|
|
23
|
-
|
|
24
|
-
ApiTokenControllerUpdateTokenResponses,
|
|
19
|
+
ApiTokenControllerUpdateTokenResponse,
|
|
25
20
|
AppControllerGetHelloData,
|
|
26
|
-
AppControllerGetHelloResponses,
|
|
27
21
|
ConditionsControllerGetSunAltitudeTimeLimitsData,
|
|
28
|
-
|
|
22
|
+
ConditionsControllerGetSunAltitudeTimeLimitsResponse,
|
|
29
23
|
FlightsControllerCreatePresignedUrlsData,
|
|
30
|
-
|
|
31
|
-
FlightsControllerCreatePresignedUrlsResponses,
|
|
24
|
+
FlightsControllerCreatePresignedUrlsResponse,
|
|
32
25
|
FlightsControllerGenerateFlightIdData,
|
|
33
|
-
|
|
34
|
-
FlightsControllerGenerateFlightIdResponses,
|
|
26
|
+
FlightsControllerGenerateFlightIdResponse,
|
|
35
27
|
FlightsControllerValidateFlightData,
|
|
36
|
-
|
|
37
|
-
FlightsControllerValidateFlightResponses,
|
|
28
|
+
FlightsControllerValidateFlightResponse,
|
|
38
29
|
KeysControllerGetProvenanceCryptoKeyData,
|
|
39
|
-
|
|
30
|
+
KeysControllerGetProvenanceCryptoKeyResponse,
|
|
40
31
|
QuotesControllerCreateQuoteData,
|
|
41
|
-
QuotesControllerCreateQuoteErrors,
|
|
42
|
-
QuotesControllerCreateQuoteResponses,
|
|
43
32
|
QuotesControllerGetQuoteData,
|
|
44
|
-
QuotesControllerGetQuoteErrors,
|
|
45
|
-
QuotesControllerGetQuoteResponses,
|
|
46
33
|
RewardsControllerDepositRewardsData,
|
|
47
|
-
|
|
48
|
-
RewardsControllerDepositRewardsResponses,
|
|
34
|
+
RewardsControllerDepositRewardsResponse,
|
|
49
35
|
RewardsControllerDistributeRewardsData,
|
|
50
|
-
|
|
51
|
-
RewardsControllerDistributeRewardsResponses,
|
|
36
|
+
RewardsControllerDistributeRewardsResponse,
|
|
52
37
|
SchemaControllerGetEventSchemaData,
|
|
53
|
-
SchemaControllerGetEventSchemaResponses,
|
|
54
38
|
WebhooksControllerCreateData,
|
|
55
|
-
|
|
56
|
-
WebhooksControllerCreateResponses,
|
|
39
|
+
WebhooksControllerCreateResponse,
|
|
57
40
|
WebhooksControllerDeleteData,
|
|
58
|
-
|
|
59
|
-
WebhooksControllerDeleteResponses,
|
|
41
|
+
WebhooksControllerDeleteResponse,
|
|
60
42
|
WebhooksControllerGetData,
|
|
61
|
-
WebhooksControllerGetErrors,
|
|
62
43
|
WebhooksControllerGetManyData,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
WebhooksControllerGetResponses,
|
|
44
|
+
WebhooksControllerGetManyResponse,
|
|
45
|
+
WebhooksControllerGetResponse,
|
|
66
46
|
WebhooksControllerGetStatusData,
|
|
67
|
-
|
|
68
|
-
WebhooksControllerGetStatusResponses,
|
|
47
|
+
WebhooksControllerGetStatusResponse,
|
|
69
48
|
WebhooksControllerRegenerateSecretData,
|
|
70
|
-
|
|
71
|
-
WebhooksControllerRegenerateSecretResponses,
|
|
49
|
+
WebhooksControllerRegenerateSecretResponse,
|
|
72
50
|
WebhooksControllerTestData,
|
|
73
|
-
|
|
74
|
-
WebhooksControllerTestResponses,
|
|
51
|
+
WebhooksControllerTestResponse,
|
|
75
52
|
WebhooksControllerUpdateData,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
} from "./types.gen.js";
|
|
53
|
+
WebhooksControllerUpdateResponse,
|
|
54
|
+
} from "./types.gen";
|
|
79
55
|
|
|
80
56
|
export type Options<
|
|
81
57
|
TData extends TDataShape = TDataShape,
|
|
@@ -97,14 +73,12 @@ export type Options<
|
|
|
97
73
|
export const appControllerGetHello = <ThrowOnError extends boolean = false>(
|
|
98
74
|
options?: Options<AppControllerGetHelloData, ThrowOnError>,
|
|
99
75
|
) => {
|
|
100
|
-
return (options?.client ?? _heyApiClient).get<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
...options,
|
|
107
|
-
});
|
|
76
|
+
return (options?.client ?? _heyApiClient).get<unknown, unknown, ThrowOnError>(
|
|
77
|
+
{
|
|
78
|
+
url: "/",
|
|
79
|
+
...options,
|
|
80
|
+
},
|
|
81
|
+
);
|
|
108
82
|
};
|
|
109
83
|
|
|
110
84
|
export const keysControllerGetProvenanceCryptoKey = <
|
|
@@ -113,7 +87,7 @@ export const keysControllerGetProvenanceCryptoKey = <
|
|
|
113
87
|
options?: Options<KeysControllerGetProvenanceCryptoKeyData, ThrowOnError>,
|
|
114
88
|
) => {
|
|
115
89
|
return (options?.client ?? _heyApiClient).get<
|
|
116
|
-
|
|
90
|
+
KeysControllerGetProvenanceCryptoKeyResponse,
|
|
117
91
|
unknown,
|
|
118
92
|
ThrowOnError
|
|
119
93
|
>({
|
|
@@ -128,8 +102,8 @@ export const rewardsControllerDepositRewards = <
|
|
|
128
102
|
options: Options<RewardsControllerDepositRewardsData, ThrowOnError>,
|
|
129
103
|
) => {
|
|
130
104
|
return (options.client ?? _heyApiClient).post<
|
|
131
|
-
|
|
132
|
-
|
|
105
|
+
RewardsControllerDepositRewardsResponse,
|
|
106
|
+
unknown,
|
|
133
107
|
ThrowOnError
|
|
134
108
|
>({
|
|
135
109
|
security: [
|
|
@@ -142,7 +116,7 @@ export const rewardsControllerDepositRewards = <
|
|
|
142
116
|
...options,
|
|
143
117
|
headers: {
|
|
144
118
|
"Content-Type": "application/json",
|
|
145
|
-
...options
|
|
119
|
+
...options?.headers,
|
|
146
120
|
},
|
|
147
121
|
});
|
|
148
122
|
};
|
|
@@ -153,8 +127,8 @@ export const rewardsControllerDistributeRewards = <
|
|
|
153
127
|
options: Options<RewardsControllerDistributeRewardsData, ThrowOnError>,
|
|
154
128
|
) => {
|
|
155
129
|
return (options.client ?? _heyApiClient).post<
|
|
156
|
-
|
|
157
|
-
|
|
130
|
+
RewardsControllerDistributeRewardsResponse,
|
|
131
|
+
unknown,
|
|
158
132
|
ThrowOnError
|
|
159
133
|
>({
|
|
160
134
|
security: [
|
|
@@ -167,7 +141,7 @@ export const rewardsControllerDistributeRewards = <
|
|
|
167
141
|
...options,
|
|
168
142
|
headers: {
|
|
169
143
|
"Content-Type": "application/json",
|
|
170
|
-
...options
|
|
144
|
+
...options?.headers,
|
|
171
145
|
},
|
|
172
146
|
});
|
|
173
147
|
};
|
|
@@ -178,8 +152,8 @@ export const apiTokenControllerCreateToken = <
|
|
|
178
152
|
options: Options<ApiTokenControllerCreateTokenData, ThrowOnError>,
|
|
179
153
|
) => {
|
|
180
154
|
return (options.client ?? _heyApiClient).post<
|
|
181
|
-
|
|
182
|
-
|
|
155
|
+
ApiTokenControllerCreateTokenResponse,
|
|
156
|
+
unknown,
|
|
183
157
|
ThrowOnError
|
|
184
158
|
>({
|
|
185
159
|
security: [
|
|
@@ -192,7 +166,7 @@ export const apiTokenControllerCreateToken = <
|
|
|
192
166
|
...options,
|
|
193
167
|
headers: {
|
|
194
168
|
"Content-Type": "application/json",
|
|
195
|
-
...options
|
|
169
|
+
...options?.headers,
|
|
196
170
|
},
|
|
197
171
|
});
|
|
198
172
|
};
|
|
@@ -203,8 +177,8 @@ export const apiTokenControllerDeleteToken = <
|
|
|
203
177
|
options: Options<ApiTokenControllerDeleteTokenData, ThrowOnError>,
|
|
204
178
|
) => {
|
|
205
179
|
return (options.client ?? _heyApiClient).delete<
|
|
206
|
-
|
|
207
|
-
|
|
180
|
+
unknown,
|
|
181
|
+
unknown,
|
|
208
182
|
ThrowOnError
|
|
209
183
|
>({
|
|
210
184
|
security: [
|
|
@@ -223,11 +197,7 @@ export const apiTokenControllerGetToken = <
|
|
|
223
197
|
>(
|
|
224
198
|
options: Options<ApiTokenControllerGetTokenData, ThrowOnError>,
|
|
225
199
|
) => {
|
|
226
|
-
return (options.client ?? _heyApiClient).get<
|
|
227
|
-
ApiTokenControllerGetTokenResponses,
|
|
228
|
-
ApiTokenControllerGetTokenErrors,
|
|
229
|
-
ThrowOnError
|
|
230
|
-
>({
|
|
200
|
+
return (options.client ?? _heyApiClient).get<unknown, unknown, ThrowOnError>({
|
|
231
201
|
security: [
|
|
232
202
|
{
|
|
233
203
|
name: "x-api-token",
|
|
@@ -245,8 +215,8 @@ export const apiTokenControllerUpdateToken = <
|
|
|
245
215
|
options: Options<ApiTokenControllerUpdateTokenData, ThrowOnError>,
|
|
246
216
|
) => {
|
|
247
217
|
return (options.client ?? _heyApiClient).patch<
|
|
248
|
-
|
|
249
|
-
|
|
218
|
+
ApiTokenControllerUpdateTokenResponse,
|
|
219
|
+
unknown,
|
|
250
220
|
ThrowOnError
|
|
251
221
|
>({
|
|
252
222
|
security: [
|
|
@@ -260,7 +230,7 @@ export const apiTokenControllerUpdateToken = <
|
|
|
260
230
|
...options,
|
|
261
231
|
headers: {
|
|
262
232
|
"Content-Type": "application/json",
|
|
263
|
-
...options
|
|
233
|
+
...options?.headers,
|
|
264
234
|
},
|
|
265
235
|
});
|
|
266
236
|
};
|
|
@@ -270,34 +240,28 @@ export const quotesControllerCreateQuote = <
|
|
|
270
240
|
>(
|
|
271
241
|
options: Options<QuotesControllerCreateQuoteData, ThrowOnError>,
|
|
272
242
|
) => {
|
|
273
|
-
return (options.client ?? _heyApiClient).post<
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
243
|
+
return (options.client ?? _heyApiClient).post<unknown, unknown, ThrowOnError>(
|
|
244
|
+
{
|
|
245
|
+
security: [
|
|
246
|
+
{
|
|
247
|
+
name: "x-api-token",
|
|
248
|
+
type: "apiKey",
|
|
249
|
+
},
|
|
250
|
+
],
|
|
251
|
+
url: "/quotes",
|
|
252
|
+
...options,
|
|
253
|
+
headers: {
|
|
254
|
+
"Content-Type": "application/json",
|
|
255
|
+
...options?.headers,
|
|
282
256
|
},
|
|
283
|
-
],
|
|
284
|
-
url: "/quotes",
|
|
285
|
-
...options,
|
|
286
|
-
headers: {
|
|
287
|
-
"Content-Type": "application/json",
|
|
288
|
-
...options.headers,
|
|
289
257
|
},
|
|
290
|
-
|
|
258
|
+
);
|
|
291
259
|
};
|
|
292
260
|
|
|
293
261
|
export const quotesControllerGetQuote = <ThrowOnError extends boolean = false>(
|
|
294
262
|
options: Options<QuotesControllerGetQuoteData, ThrowOnError>,
|
|
295
263
|
) => {
|
|
296
|
-
return (options.client ?? _heyApiClient).get<
|
|
297
|
-
QuotesControllerGetQuoteResponses,
|
|
298
|
-
QuotesControllerGetQuoteErrors,
|
|
299
|
-
ThrowOnError
|
|
300
|
-
>({
|
|
264
|
+
return (options.client ?? _heyApiClient).get<unknown, unknown, ThrowOnError>({
|
|
301
265
|
security: [
|
|
302
266
|
{
|
|
303
267
|
name: "x-api-token",
|
|
@@ -315,8 +279,8 @@ export const flightsControllerGenerateFlightId = <
|
|
|
315
279
|
options: Options<FlightsControllerGenerateFlightIdData, ThrowOnError>,
|
|
316
280
|
) => {
|
|
317
281
|
return (options.client ?? _heyApiClient).get<
|
|
318
|
-
|
|
319
|
-
|
|
282
|
+
FlightsControllerGenerateFlightIdResponse,
|
|
283
|
+
unknown,
|
|
320
284
|
ThrowOnError
|
|
321
285
|
>({
|
|
322
286
|
security: [
|
|
@@ -336,8 +300,8 @@ export const flightsControllerCreatePresignedUrls = <
|
|
|
336
300
|
options: Options<FlightsControllerCreatePresignedUrlsData, ThrowOnError>,
|
|
337
301
|
) => {
|
|
338
302
|
return (options.client ?? _heyApiClient).post<
|
|
339
|
-
|
|
340
|
-
|
|
303
|
+
FlightsControllerCreatePresignedUrlsResponse,
|
|
304
|
+
unknown,
|
|
341
305
|
ThrowOnError
|
|
342
306
|
>({
|
|
343
307
|
security: [
|
|
@@ -350,7 +314,7 @@ export const flightsControllerCreatePresignedUrls = <
|
|
|
350
314
|
...options,
|
|
351
315
|
headers: {
|
|
352
316
|
"Content-Type": "application/json",
|
|
353
|
-
...options
|
|
317
|
+
...options?.headers,
|
|
354
318
|
},
|
|
355
319
|
});
|
|
356
320
|
};
|
|
@@ -361,8 +325,8 @@ export const flightsControllerValidateFlight = <
|
|
|
361
325
|
options: Options<FlightsControllerValidateFlightData, ThrowOnError>,
|
|
362
326
|
) => {
|
|
363
327
|
return (options.client ?? _heyApiClient).post<
|
|
364
|
-
|
|
365
|
-
|
|
328
|
+
FlightsControllerValidateFlightResponse,
|
|
329
|
+
unknown,
|
|
366
330
|
ThrowOnError
|
|
367
331
|
>({
|
|
368
332
|
security: [
|
|
@@ -375,7 +339,7 @@ export const flightsControllerValidateFlight = <
|
|
|
375
339
|
...options,
|
|
376
340
|
headers: {
|
|
377
341
|
"Content-Type": "application/json",
|
|
378
|
-
...options
|
|
342
|
+
...options?.headers,
|
|
379
343
|
},
|
|
380
344
|
});
|
|
381
345
|
};
|
|
@@ -389,7 +353,7 @@ export const conditionsControllerGetSunAltitudeTimeLimits = <
|
|
|
389
353
|
>,
|
|
390
354
|
) => {
|
|
391
355
|
return (options.client ?? _heyApiClient).get<
|
|
392
|
-
|
|
356
|
+
ConditionsControllerGetSunAltitudeTimeLimitsResponse,
|
|
393
357
|
unknown,
|
|
394
358
|
ThrowOnError
|
|
395
359
|
>({
|
|
@@ -405,22 +369,20 @@ export const schemaControllerGetEventSchema = <
|
|
|
405
369
|
>(
|
|
406
370
|
options?: Options<SchemaControllerGetEventSchemaData, ThrowOnError>,
|
|
407
371
|
) => {
|
|
408
|
-
return (options?.client ?? _heyApiClient).get<
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
...options,
|
|
415
|
-
});
|
|
372
|
+
return (options?.client ?? _heyApiClient).get<unknown, unknown, ThrowOnError>(
|
|
373
|
+
{
|
|
374
|
+
url: "/schema/event",
|
|
375
|
+
...options,
|
|
376
|
+
},
|
|
377
|
+
);
|
|
416
378
|
};
|
|
417
379
|
|
|
418
380
|
export const webhooksControllerGetMany = <ThrowOnError extends boolean = false>(
|
|
419
381
|
options: Options<WebhooksControllerGetManyData, ThrowOnError>,
|
|
420
382
|
) => {
|
|
421
383
|
return (options.client ?? _heyApiClient).get<
|
|
422
|
-
|
|
423
|
-
|
|
384
|
+
WebhooksControllerGetManyResponse,
|
|
385
|
+
unknown,
|
|
424
386
|
ThrowOnError
|
|
425
387
|
>({
|
|
426
388
|
security: [
|
|
@@ -438,8 +400,8 @@ export const webhooksControllerCreate = <ThrowOnError extends boolean = false>(
|
|
|
438
400
|
options: Options<WebhooksControllerCreateData, ThrowOnError>,
|
|
439
401
|
) => {
|
|
440
402
|
return (options.client ?? _heyApiClient).post<
|
|
441
|
-
|
|
442
|
-
|
|
403
|
+
WebhooksControllerCreateResponse,
|
|
404
|
+
unknown,
|
|
443
405
|
ThrowOnError
|
|
444
406
|
>({
|
|
445
407
|
security: [
|
|
@@ -452,7 +414,7 @@ export const webhooksControllerCreate = <ThrowOnError extends boolean = false>(
|
|
|
452
414
|
...options,
|
|
453
415
|
headers: {
|
|
454
416
|
"Content-Type": "application/json",
|
|
455
|
-
...options
|
|
417
|
+
...options?.headers,
|
|
456
418
|
},
|
|
457
419
|
});
|
|
458
420
|
};
|
|
@@ -461,8 +423,8 @@ export const webhooksControllerDelete = <ThrowOnError extends boolean = false>(
|
|
|
461
423
|
options: Options<WebhooksControllerDeleteData, ThrowOnError>,
|
|
462
424
|
) => {
|
|
463
425
|
return (options.client ?? _heyApiClient).delete<
|
|
464
|
-
|
|
465
|
-
|
|
426
|
+
WebhooksControllerDeleteResponse,
|
|
427
|
+
unknown,
|
|
466
428
|
ThrowOnError
|
|
467
429
|
>({
|
|
468
430
|
security: [
|
|
@@ -480,8 +442,8 @@ export const webhooksControllerGet = <ThrowOnError extends boolean = false>(
|
|
|
480
442
|
options: Options<WebhooksControllerGetData, ThrowOnError>,
|
|
481
443
|
) => {
|
|
482
444
|
return (options.client ?? _heyApiClient).get<
|
|
483
|
-
|
|
484
|
-
|
|
445
|
+
WebhooksControllerGetResponse,
|
|
446
|
+
unknown,
|
|
485
447
|
ThrowOnError
|
|
486
448
|
>({
|
|
487
449
|
security: [
|
|
@@ -499,8 +461,8 @@ export const webhooksControllerUpdate = <ThrowOnError extends boolean = false>(
|
|
|
499
461
|
options: Options<WebhooksControllerUpdateData, ThrowOnError>,
|
|
500
462
|
) => {
|
|
501
463
|
return (options.client ?? _heyApiClient).put<
|
|
502
|
-
|
|
503
|
-
|
|
464
|
+
WebhooksControllerUpdateResponse,
|
|
465
|
+
unknown,
|
|
504
466
|
ThrowOnError
|
|
505
467
|
>({
|
|
506
468
|
security: [
|
|
@@ -513,7 +475,7 @@ export const webhooksControllerUpdate = <ThrowOnError extends boolean = false>(
|
|
|
513
475
|
...options,
|
|
514
476
|
headers: {
|
|
515
477
|
"Content-Type": "application/json",
|
|
516
|
-
...options
|
|
478
|
+
...options?.headers,
|
|
517
479
|
},
|
|
518
480
|
});
|
|
519
481
|
};
|
|
@@ -524,8 +486,8 @@ export const webhooksControllerRegenerateSecret = <
|
|
|
524
486
|
options: Options<WebhooksControllerRegenerateSecretData, ThrowOnError>,
|
|
525
487
|
) => {
|
|
526
488
|
return (options.client ?? _heyApiClient).post<
|
|
527
|
-
|
|
528
|
-
|
|
489
|
+
WebhooksControllerRegenerateSecretResponse,
|
|
490
|
+
unknown,
|
|
529
491
|
ThrowOnError
|
|
530
492
|
>({
|
|
531
493
|
security: [
|
|
@@ -543,8 +505,8 @@ export const webhooksControllerTest = <ThrowOnError extends boolean = false>(
|
|
|
543
505
|
options: Options<WebhooksControllerTestData, ThrowOnError>,
|
|
544
506
|
) => {
|
|
545
507
|
return (options.client ?? _heyApiClient).post<
|
|
546
|
-
|
|
547
|
-
|
|
508
|
+
WebhooksControllerTestResponse,
|
|
509
|
+
unknown,
|
|
548
510
|
ThrowOnError
|
|
549
511
|
>({
|
|
550
512
|
security: [
|
|
@@ -564,8 +526,8 @@ export const webhooksControllerGetStatus = <
|
|
|
564
526
|
options: Options<WebhooksControllerGetStatusData, ThrowOnError>,
|
|
565
527
|
) => {
|
|
566
528
|
return (options.client ?? _heyApiClient).get<
|
|
567
|
-
|
|
568
|
-
|
|
529
|
+
WebhooksControllerGetStatusResponse,
|
|
530
|
+
unknown,
|
|
569
531
|
ThrowOnError
|
|
570
532
|
>({
|
|
571
533
|
security: [
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type {
|
|
3
3
|
ApiTokenControllerUpdateTokenResponse,
|
|
4
4
|
ConditionsControllerGetSunAltitudeTimeLimitsResponse,
|
|
5
|
-
} from "./types.gen
|
|
5
|
+
} from "./types.gen";
|
|
6
6
|
|
|
7
7
|
const updateApiTokenResponseDtoSchemaResponseTransformer = (data: any) => {
|
|
8
8
|
data.deleted_at = new Date(data.deleted_at);
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import type { Client, Config, RequestOptions } from "./types.js";
|
|
2
|
-
import {
|
|
3
|
-
buildUrl,
|
|
4
|
-
createConfig,
|
|
5
|
-
createInterceptors,
|
|
6
|
-
getParseAs,
|
|
7
|
-
mergeConfigs,
|
|
8
|
-
mergeHeaders,
|
|
9
|
-
setAuthParams,
|
|
10
|
-
} from "./utils.js";
|
|
11
|
-
|
|
12
|
-
type ReqInit = Omit<RequestInit, "body" | "headers"> & {
|
|
13
|
-
body?: any;
|
|
14
|
-
headers: ReturnType<typeof mergeHeaders>;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const createClient = (config: Config = {}): Client => {
|
|
18
|
-
let _config = mergeConfigs(createConfig(), config);
|
|
19
|
-
|
|
20
|
-
const getConfig = (): Config => ({ ..._config });
|
|
21
|
-
|
|
22
|
-
const setConfig = (config: Config): Config => {
|
|
23
|
-
_config = mergeConfigs(_config, config);
|
|
24
|
-
return getConfig();
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const interceptors = createInterceptors<
|
|
28
|
-
Request,
|
|
29
|
-
Response,
|
|
30
|
-
unknown,
|
|
31
|
-
RequestOptions
|
|
32
|
-
>();
|
|
33
|
-
|
|
34
|
-
const request: Client["request"] = async (options) => {
|
|
35
|
-
const opts = {
|
|
36
|
-
..._config,
|
|
37
|
-
...options,
|
|
38
|
-
fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
|
|
39
|
-
headers: mergeHeaders(_config.headers, options.headers),
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
if (opts.security) {
|
|
43
|
-
await setAuthParams({
|
|
44
|
-
...opts,
|
|
45
|
-
security: opts.security,
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (opts.body && opts.bodySerializer) {
|
|
50
|
-
opts.body = opts.bodySerializer(opts.body);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// remove Content-Type header if body is empty to avoid sending invalid requests
|
|
54
|
-
if (opts.body === undefined || opts.body === "") {
|
|
55
|
-
opts.headers.delete("Content-Type");
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const url = buildUrl(opts);
|
|
59
|
-
const requestInit: ReqInit = {
|
|
60
|
-
redirect: "follow",
|
|
61
|
-
...opts,
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
let request = new Request(url, requestInit);
|
|
65
|
-
|
|
66
|
-
for (const fn of interceptors.request._fns) {
|
|
67
|
-
if (fn) {
|
|
68
|
-
request = await fn(request, opts);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// fetch must be assigned here, otherwise it would throw the error:
|
|
73
|
-
// TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
|
|
74
|
-
const _fetch = opts.fetch!;
|
|
75
|
-
let response = await _fetch(request);
|
|
76
|
-
|
|
77
|
-
for (const fn of interceptors.response._fns) {
|
|
78
|
-
if (fn) {
|
|
79
|
-
response = await fn(response, request, opts);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const result = {
|
|
84
|
-
request,
|
|
85
|
-
response,
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
if (response.ok) {
|
|
89
|
-
if (
|
|
90
|
-
response.status === 204 ||
|
|
91
|
-
response.headers.get("Content-Length") === "0"
|
|
92
|
-
) {
|
|
93
|
-
return opts.responseStyle === "data"
|
|
94
|
-
? {}
|
|
95
|
-
: {
|
|
96
|
-
data: {},
|
|
97
|
-
...result,
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const parseAs =
|
|
102
|
-
(opts.parseAs === "auto"
|
|
103
|
-
? getParseAs(response.headers.get("Content-Type"))
|
|
104
|
-
: opts.parseAs) ?? "json";
|
|
105
|
-
|
|
106
|
-
if (parseAs === "stream") {
|
|
107
|
-
return opts.responseStyle === "data"
|
|
108
|
-
? response.body
|
|
109
|
-
: {
|
|
110
|
-
data: response.body,
|
|
111
|
-
...result,
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
let data = await response[parseAs]();
|
|
116
|
-
if (parseAs === "json") {
|
|
117
|
-
if (opts.responseValidator) {
|
|
118
|
-
await opts.responseValidator(data);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (opts.responseTransformer) {
|
|
122
|
-
data = await opts.responseTransformer(data);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return opts.responseStyle === "data"
|
|
127
|
-
? data
|
|
128
|
-
: {
|
|
129
|
-
data,
|
|
130
|
-
...result,
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
let error = await response.text();
|
|
135
|
-
|
|
136
|
-
try {
|
|
137
|
-
error = JSON.parse(error);
|
|
138
|
-
} catch {
|
|
139
|
-
// noop
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
let finalError = error;
|
|
143
|
-
|
|
144
|
-
for (const fn of interceptors.error._fns) {
|
|
145
|
-
if (fn) {
|
|
146
|
-
finalError = (await fn(error, response, request, opts)) as string;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
finalError = finalError || ({} as string);
|
|
151
|
-
|
|
152
|
-
if (opts.throwOnError) {
|
|
153
|
-
throw finalError;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// TODO: we probably want to return error and improve types
|
|
157
|
-
return opts.responseStyle === "data"
|
|
158
|
-
? undefined
|
|
159
|
-
: {
|
|
160
|
-
error: finalError,
|
|
161
|
-
...result,
|
|
162
|
-
};
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
return {
|
|
166
|
-
buildUrl,
|
|
167
|
-
connect: (options) => request({ ...options, method: "CONNECT" }),
|
|
168
|
-
delete: (options) => request({ ...options, method: "DELETE" }),
|
|
169
|
-
get: (options) => request({ ...options, method: "GET" }),
|
|
170
|
-
getConfig,
|
|
171
|
-
head: (options) => request({ ...options, method: "HEAD" }),
|
|
172
|
-
interceptors,
|
|
173
|
-
options: (options) => request({ ...options, method: "OPTIONS" }),
|
|
174
|
-
patch: (options) => request({ ...options, method: "PATCH" }),
|
|
175
|
-
post: (options) => request({ ...options, method: "POST" }),
|
|
176
|
-
put: (options) => request({ ...options, method: "PUT" }),
|
|
177
|
-
request,
|
|
178
|
-
setConfig,
|
|
179
|
-
trace: (options) => request({ ...options, method: "TRACE" }),
|
|
180
|
-
};
|
|
181
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export type { Auth } from "../core/auth.js";
|
|
2
|
-
export type { QuerySerializerOptions } from "../core/bodySerializer.js";
|
|
3
|
-
export {
|
|
4
|
-
formDataBodySerializer,
|
|
5
|
-
jsonBodySerializer,
|
|
6
|
-
urlSearchParamsBodySerializer,
|
|
7
|
-
} from "../core/bodySerializer.js";
|
|
8
|
-
export { buildClientParams } from "../core/params.js";
|
|
9
|
-
export { createClient } from "./client.js";
|
|
10
|
-
export type {
|
|
11
|
-
Client,
|
|
12
|
-
ClientOptions,
|
|
13
|
-
Config,
|
|
14
|
-
CreateClientConfig,
|
|
15
|
-
Options,
|
|
16
|
-
OptionsLegacyParser,
|
|
17
|
-
RequestOptions,
|
|
18
|
-
RequestResult,
|
|
19
|
-
ResponseStyle,
|
|
20
|
-
TDataShape,
|
|
21
|
-
} from "./types.js";
|
|
22
|
-
export { createConfig, mergeHeaders } from "./utils.js";
|