@sebspark/openapi-core 4.0.6 → 4.0.8

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.ts DELETED
@@ -1,729 +0,0 @@
1
- import { AxiosError } from 'axios';
2
- import { OutgoingHttpHeaders } from 'node:http';
3
- import { RetrySettings } from '@sebspark/retry';
4
- import { Request, RequestHandler } from 'express-serve-static-core';
5
-
6
- type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' | 'HEAD';
7
- type SchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
8
- type SchemaEnum = string[] | number[] | boolean[];
9
- type DefaultValue = string | number | boolean | any[] | any;
10
- type Example = any;
11
- type ExampleObject = {
12
- summary?: string;
13
- description?: string;
14
- value?: Example;
15
- externalValue?: string;
16
- };
17
- type SchemaObject = {
18
- title?: string;
19
- multipleOf?: number;
20
- maximum?: number;
21
- exclusiveMaximum?: boolean;
22
- minimum?: number;
23
- exclusiveMinimum?: boolean;
24
- maxLength?: number;
25
- minLength?: number;
26
- pattern?: string;
27
- maxItems?: number;
28
- minItems?: number;
29
- uniqueItems?: boolean;
30
- maxProperties?: number;
31
- minProperties?: number;
32
- required?: string[];
33
- enum?: SchemaEnum;
34
- type?: SchemaType | SchemaType[];
35
- allOf?: (SchemaObject | ReferenceObject)[];
36
- oneOf?: (SchemaObject | ReferenceObject)[];
37
- anyOf?: (SchemaObject | ReferenceObject)[];
38
- not?: SchemaObject | ReferenceObject;
39
- items?: SchemaObject | ReferenceObject;
40
- properties?: Record<string, SchemaObject | ReferenceObject>;
41
- additionalProperties?: boolean | SchemaObject | ReferenceObject;
42
- description?: string;
43
- format?: string;
44
- default?: DefaultValue;
45
- nullable?: boolean;
46
- discriminator?: DiscriminatorObject;
47
- readOnly?: boolean;
48
- writeOnly?: boolean;
49
- xml?: XMLObject;
50
- externalDocs?: ExternalDocumentationObject;
51
- example?: Example;
52
- deprecated?: boolean;
53
- };
54
- type XMLObject = {
55
- name?: string;
56
- namespace?: string;
57
- prefix?: string;
58
- attribute?: boolean;
59
- wrapped?: boolean;
60
- };
61
- type ParameterIn = 'query' | 'header' | 'path' | 'cookie';
62
- type ParameterStyle = 'matrix' | 'label' | 'form' | 'simple' | 'spaceDelimited' | 'pipeDelimited' | 'deepObject';
63
- type ParameterObject = {
64
- name: string;
65
- in: ParameterIn;
66
- description?: string;
67
- required?: boolean;
68
- deprecated?: boolean;
69
- allowEmptyValue?: boolean;
70
- style?: ParameterStyle;
71
- explode?: boolean;
72
- allowReserved?: boolean;
73
- schema?: SchemaObject | ReferenceObject;
74
- example?: Example;
75
- examples?: Record<string, ExampleObject | ReferenceObject>;
76
- content?: Record<string, MediaTypeObject>;
77
- };
78
- type MediaTypeObject = {
79
- schema?: SchemaObject | ReferenceObject;
80
- example?: Example;
81
- examples?: Record<string, ExampleObject | ReferenceObject>;
82
- encoding?: Record<string, EncodingObject>;
83
- };
84
- type EncodingObject = {
85
- contentType?: string;
86
- headers?: Record<string, HeaderObject | ReferenceObject>;
87
- style?: string;
88
- explode?: boolean;
89
- allowReserved?: boolean;
90
- };
91
- type HeaderStyle = 'simple';
92
- type HeaderObject = {
93
- description?: string;
94
- required?: boolean;
95
- deprecated?: boolean;
96
- allowEmptyValue?: boolean;
97
- style?: HeaderStyle;
98
- explode?: boolean;
99
- allowReserved?: boolean;
100
- schema?: SchemaObject | ReferenceObject;
101
- example?: Example;
102
- examples?: Record<string, ExampleObject | ReferenceObject>;
103
- content?: Record<string, MediaTypeObject>;
104
- };
105
- type DiscriminatorObject = {
106
- propertyName: string;
107
- mapping?: Record<string, string>;
108
- };
109
- type ReferenceObject = {
110
- $ref: string;
111
- };
112
- type InfoObject = {
113
- title: string;
114
- summary?: string;
115
- description?: string;
116
- termsOfService?: string;
117
- contact?: ContactObject;
118
- license?: LicenseObject;
119
- version: string;
120
- };
121
- type ContactObject = {
122
- name?: string;
123
- url?: string;
124
- email?: string;
125
- };
126
- type LicenseObject = {
127
- name: string;
128
- url?: string;
129
- };
130
- type ServerObject = {
131
- url: string;
132
- description?: string;
133
- variables?: Record<string, ServerVariableObject>;
134
- };
135
- type ServerVariableObject = {
136
- default: string;
137
- enum?: string[];
138
- description?: string;
139
- };
140
- type TagObject = {
141
- name: string;
142
- description?: string;
143
- externalDocs?: ExternalDocumentationObject;
144
- };
145
- type ExternalDocumentationObject = {
146
- description?: string;
147
- url: string;
148
- };
149
- type SecuritySchemeType = 'apiKey' | 'http' | 'oauth2' | 'openIdConnect';
150
- type SecuritySchemeObject = {
151
- type: SecuritySchemeType;
152
- description?: string;
153
- name?: string;
154
- in?: ParameterIn;
155
- scheme?: string;
156
- bearerFormat?: string;
157
- flows?: OAuthFlowsObject;
158
- openIdConnectUrl?: string;
159
- };
160
- type OAuthFlowsObject = {
161
- implicit?: OAuthFlowObject;
162
- password?: OAuthFlowObject;
163
- clientCredentials?: OAuthFlowObject;
164
- authorizationCode?: OAuthFlowObject;
165
- };
166
- type OAuthFlowObject = {
167
- authorizationUrl?: string;
168
- tokenUrl?: string;
169
- refreshUrl?: string;
170
- scopes: Record<string, string>;
171
- };
172
-
173
- type ChannelBindingsObject = {
174
- http?: HttpChannelBindingObject;
175
- ws?: WebSocketChannelBindingObject;
176
- kafka?: KafkaChannelBindingObject;
177
- redis?: RedisChannelBindingObject;
178
- rabbitmq?: RabbitMQChannelBindingObject;
179
- googlepubsub?: GooglePubSubChannelBindingObject;
180
- };
181
- type HttpChannelBindingObject = {
182
- type: string;
183
- method: string;
184
- query: SchemaObject | ReferenceObject;
185
- bindingVersion?: string;
186
- };
187
- type WebSocketChannelBindingObject = {
188
- type: string;
189
- method: string;
190
- query: SchemaObject | ReferenceObject;
191
- headers: SchemaObject | ReferenceObject;
192
- bindingVersion?: string;
193
- };
194
- type KafkaChannelBindingObject = {
195
- groupId?: SchemaObject | ReferenceObject;
196
- clientId?: SchemaObject | ReferenceObject;
197
- bindingVersion?: string;
198
- };
199
- type RedisChannelBindingObject = {
200
- type: string;
201
- method: string;
202
- query: SchemaObject | ReferenceObject;
203
- bindingVersion?: string;
204
- };
205
- type RabbitMQChannelBindingObject = {
206
- is: string;
207
- exchange: {
208
- name: string;
209
- type: string;
210
- durable: boolean;
211
- autoDelete: boolean;
212
- vhost: string;
213
- };
214
- queue: {
215
- name: string;
216
- durable: boolean;
217
- exclusive: boolean;
218
- autoDelete: boolean;
219
- vhost: string;
220
- };
221
- bindingVersion?: string;
222
- };
223
- type GooglePubSubChannelBindingObject = {
224
- topic: {
225
- name: string;
226
- };
227
- subscription: {
228
- name: string;
229
- };
230
- bindingVersion?: string;
231
- };
232
- type OperationBindingsObject = {
233
- ws?: WebSocketOperationBindingObject;
234
- http?: HttpOperationBindingObject;
235
- kafka?: KafkaOperationBindingObject;
236
- redis?: RedisOperationBindingObject;
237
- rabbitmq?: RabbitMQOperationBindingObject;
238
- googlepubsub?: GooglePubSubOperationBindingObject;
239
- };
240
- type OperationType = 'publish' | 'subscribe';
241
- type MessageFormat = 'json' | 'xml' | 'text' | 'binary';
242
- type WebSocketOperationBindingObject = {
243
- type?: OperationType;
244
- method?: 'GET';
245
- query?: SchemaObject | ReferenceObject;
246
- headers?: SchemaObject | ReferenceObject;
247
- messageFormat?: MessageFormat;
248
- persistent?: boolean;
249
- bindingVersion?: string;
250
- };
251
- type HttpOperationBindingObject = {
252
- type: 'request' | 'response';
253
- method: HttpMethod;
254
- query?: SchemaObject | ReferenceObject;
255
- bindingVersion?: string;
256
- };
257
- type KafkaOperationBindingObject = {
258
- groupId?: {
259
- type: 'string';
260
- description?: string;
261
- };
262
- clientId?: {
263
- type: 'string';
264
- description?: string;
265
- };
266
- bindingVersion?: string;
267
- };
268
- type RedisOperationBindingObject = {
269
- command?: 'PUBLISH' | 'SUBSCRIBE';
270
- channel?: string;
271
- bindingVersion?: string;
272
- };
273
- type RabbitMQOperationBindingObject = {
274
- exchangeType?: 'direct' | 'fanout' | 'topic' | 'headers';
275
- exchangeName?: string;
276
- durable?: boolean;
277
- autoDelete?: boolean;
278
- vhost?: string;
279
- bindingVersion?: string;
280
- };
281
- type GooglePubSubOperationBindingObject = {
282
- ackDeadlineSeconds?: number;
283
- retryPolicy?: GooglePubSubRetryPolicy;
284
- deadLetterPolicy?: GooglePubSubDeadLetterPolicy;
285
- detachSubscription?: boolean;
286
- messageRetentionDuration?: string;
287
- filter?: string;
288
- bindingVersion?: string;
289
- };
290
- type GooglePubSubRetryPolicy = {
291
- minimumBackoff?: string;
292
- maximumBackoff?: string;
293
- };
294
- type GooglePubSubDeadLetterPolicy = {
295
- deadLetterTopic?: string;
296
- maxDeliveryAttempts?: number;
297
- };
298
- type MessageBindingsObject = {
299
- http?: HttpMessageBindingObject;
300
- ws?: WebSocketMessageBindingObject;
301
- kafka?: KafkaMessageBindingObject;
302
- redis?: RedisMessageBindingObject;
303
- rabbitmq?: RabbitMQMessageBindingObject;
304
- googlepubsub?: GooglePubSubMessageBindingObject;
305
- };
306
- type MessageBindingObject = {
307
- headers?: SchemaObject | ReferenceObject;
308
- bindingVersion?: string;
309
- };
310
- type HttpMessageBindingObject = MessageBindingObject & {};
311
- type WebSocketMessageBindingObject = MessageBindingObject & {};
312
- type KafkaMessageBindingObject = MessageBindingObject & {};
313
- type RedisMessageBindingObject = MessageBindingObject & {};
314
- type RabbitMQMessageBindingObject = MessageBindingObject & {};
315
- type GooglePubSubMessageBindingObject = MessageBindingObject & {};
316
- type ServerBindingsObject = {
317
- http?: HttpServerBindingObject;
318
- ws?: WebSocketServerBindingObject;
319
- kafka?: KafkaServerBindingObject;
320
- mqtt?: MqttServerBindingObject;
321
- amqp?: AmqpServerBindingObject;
322
- };
323
- type BaseServerBindingObject = {
324
- bindingVersion?: string;
325
- };
326
- type HttpServerBindingObject = BaseServerBindingObject & {};
327
- type WebSocketServerBindingObject = BaseServerBindingObject & {};
328
- type KafkaServerBindingObject = BaseServerBindingObject & {};
329
- type MqttServerBindingObject = BaseServerBindingObject & {};
330
- type AmqpServerBindingObject = BaseServerBindingObject & {};
331
-
332
- type AsyncApiDocument = {
333
- asyncapi: string;
334
- id?: string;
335
- info: InfoObject;
336
- servers?: Record<string, ServerObject>;
337
- defaultContentType?: string;
338
- channels: Record<string, ChannelItemObject>;
339
- components?: AsyncApiComponentsObject;
340
- tags?: TagObject[];
341
- externalDocs?: ExternalDocumentationObject;
342
- };
343
- type ChannelItemObject = {
344
- $ref?: string;
345
- description?: string;
346
- subscribe?: AsyncOperationObject;
347
- publish?: AsyncOperationObject;
348
- parameters?: Record<string, ParameterObject | ReferenceObject>;
349
- bindings?: ChannelBindingsObject;
350
- };
351
- type AsyncOperationObject = {
352
- tags?: TagObject[];
353
- summary?: string;
354
- description?: string;
355
- externalDocs?: ExternalDocumentationObject;
356
- operationId?: string;
357
- traits?: OperationTraitObject[];
358
- message?: MessageObject | ReferenceObject;
359
- };
360
- type MessageObject = {
361
- headers?: SchemaObject | ReferenceObject;
362
- payload?: SchemaObject | ReferenceObject;
363
- correlationId?: CorrelationIdObject | ReferenceObject;
364
- schemaFormat?: string;
365
- contentType?: string;
366
- name?: string;
367
- title?: string;
368
- summary?: string;
369
- description?: string;
370
- tags?: TagObject[];
371
- externalDocs?: ExternalDocumentationObject;
372
- bindings?: MessageBindingsObject;
373
- examples?: Example[];
374
- traits?: MessageTraitObject[];
375
- };
376
- type AsyncApiComponentsObject = {
377
- schemas?: Record<string, SchemaObject | ReferenceObject>;
378
- messages?: Record<string, MessageObject | ReferenceObject>;
379
- securitySchemes?: Record<string, SecuritySchemeObject | ReferenceObject>;
380
- parameters?: Record<string, ParameterObject | ReferenceObject>;
381
- correlationIds?: Record<string, CorrelationIdObject | ReferenceObject>;
382
- operationTraits?: Record<string, OperationTraitObject | ReferenceObject>;
383
- messageTraits?: Record<string, MessageTraitObject | ReferenceObject>;
384
- serverBindings?: Record<string, ServerBindingsObject | ReferenceObject>;
385
- channelBindings?: Record<string, ChannelBindingsObject | ReferenceObject>;
386
- messageBindings?: Record<string, MessageBindingsObject | ReferenceObject>;
387
- };
388
- type OperationTraitObject = {
389
- operationId?: string;
390
- summary?: string;
391
- description?: string;
392
- tags?: TagObject[];
393
- externalDocs?: ExternalDocumentationObject;
394
- bindings?: OperationBindingsObject;
395
- message?: MessageTraitObject | ReferenceObject;
396
- };
397
- type MessageTraitObject = {
398
- headers?: SchemaObject | ReferenceObject;
399
- correlationId?: CorrelationIdObject | ReferenceObject;
400
- schemaFormat?: string;
401
- contentType?: string;
402
- name?: string;
403
- title?: string;
404
- summary?: string;
405
- description?: string;
406
- tags?: TagObject[];
407
- externalDocs?: ExternalDocumentationObject;
408
- examples?: Example[];
409
- bindings?: MessageBindingsObject;
410
- };
411
- type CorrelationIdObject = {
412
- description?: string;
413
- location: string;
414
- };
415
-
416
- type AvroSchema = AvroRecord | AvroEnum | AvroArray | AvroMap | AvroPrimitive | AvroUnion;
417
- type AvroRecord = {
418
- type: 'record';
419
- name: string;
420
- namespace?: string;
421
- doc?: string;
422
- fields: AvroField[];
423
- };
424
- type AvroField = {
425
- name: string;
426
- type: AvroSchema;
427
- doc?: string;
428
- default?: any;
429
- order?: 'ascending' | 'descending' | 'ignore';
430
- };
431
- type AvroEnum = {
432
- type: 'enum';
433
- name: string;
434
- symbols: string[];
435
- doc?: string;
436
- };
437
- type AvroArray = {
438
- type: 'array';
439
- items: AvroSchema;
440
- doc?: string;
441
- };
442
- type AvroMap = {
443
- type: 'map';
444
- values: AvroSchema;
445
- doc?: string;
446
- };
447
- type AvroUnion = AvroSchema[];
448
- type AvroPrimitive = 'null' | 'boolean' | 'int' | 'long' | 'float' | 'double' | 'bytes' | 'string';
449
-
450
- type ClientErrorCode = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451;
451
- type ServerErrorCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
452
- type ErrorCode = ClientErrorCode | ServerErrorCode;
453
- type SerializedError = {
454
- message: string;
455
- stack?: string;
456
- };
457
- declare class HttpError extends Error {
458
- statusCode: number;
459
- constructor(statusCode: number, message: string, cause?: Error);
460
- toJSON(showStack?: boolean): SerializedError;
461
- }
462
- declare class BadRequestError extends HttpError {
463
- constructor(message?: string, cause?: Error);
464
- }
465
- declare class UnauthorizedError extends HttpError {
466
- constructor(message?: string, cause?: Error);
467
- }
468
- declare class PaymentRequiredError extends HttpError {
469
- constructor(message?: string, cause?: Error);
470
- }
471
- declare class ForbiddenError extends HttpError {
472
- constructor(message?: string, cause?: Error);
473
- }
474
- declare class NotFoundError extends HttpError {
475
- constructor(message?: string, cause?: Error);
476
- }
477
- declare class MethodNotAllowedError extends HttpError {
478
- constructor(message?: string, cause?: Error);
479
- }
480
- declare class NotAcceptableError extends HttpError {
481
- constructor(message?: string, cause?: Error);
482
- }
483
- declare class ProxyAuthenticationRequiredError extends HttpError {
484
- constructor(message?: string, cause?: Error);
485
- }
486
- declare class RequestTimeoutError extends HttpError {
487
- constructor(message?: string, cause?: Error);
488
- }
489
- declare class ConflictError extends HttpError {
490
- constructor(message?: string, cause?: Error);
491
- }
492
- declare class GoneError extends HttpError {
493
- constructor(message?: string, cause?: Error);
494
- }
495
- declare class LengthRequiredError extends HttpError {
496
- constructor(message?: string, cause?: Error);
497
- }
498
- declare class PreconditionFailedError extends HttpError {
499
- constructor(message?: string, cause?: Error);
500
- }
501
- declare class PayloadTooLargeError extends HttpError {
502
- constructor(message?: string, cause?: Error);
503
- }
504
- declare class URITooLongError extends HttpError {
505
- constructor(message?: string, cause?: Error);
506
- }
507
- declare class UnsupportedMediaTypeError extends HttpError {
508
- constructor(message?: string, cause?: Error);
509
- }
510
- declare class RangeNotSatisfiableError extends HttpError {
511
- constructor(message?: string, cause?: Error);
512
- }
513
- declare class ExpectationFailedError extends HttpError {
514
- constructor(message?: string, cause?: Error);
515
- }
516
- declare class IMATeapotError extends HttpError {
517
- constructor(message?: string, cause?: Error);
518
- }
519
- declare class MisdirectedRequestError extends HttpError {
520
- constructor(message?: string, cause?: Error);
521
- }
522
- declare class UnprocessableEntityError extends HttpError {
523
- constructor(message?: string, cause?: Error);
524
- }
525
- declare class LockedError extends HttpError {
526
- constructor(message?: string, cause?: Error);
527
- }
528
- declare class FailedDependencyError extends HttpError {
529
- constructor(message?: string, cause?: Error);
530
- }
531
- declare class TooEarlyError extends HttpError {
532
- constructor(message?: string, cause?: Error);
533
- }
534
- declare class UpgradeRequiredError extends HttpError {
535
- constructor(message?: string, cause?: Error);
536
- }
537
- declare class PreconditionRequiredError extends HttpError {
538
- constructor(message?: string, cause?: Error);
539
- }
540
- declare class TooManyRequestsError extends HttpError {
541
- constructor(message?: string, cause?: Error);
542
- }
543
- declare class RequestHeaderFieldsTooLargeError extends HttpError {
544
- constructor(message?: string, cause?: Error);
545
- }
546
- declare class UnavailableForLegalReasonsError extends HttpError {
547
- constructor(message?: string, cause?: Error);
548
- }
549
- declare class InternalServerError extends HttpError {
550
- constructor(message?: string, cause?: Error);
551
- }
552
- declare class NotImplementedError extends HttpError {
553
- constructor(message?: string, cause?: Error);
554
- }
555
- declare class BadGatewayError extends HttpError {
556
- constructor(message?: string, cause?: Error);
557
- }
558
- declare class ServiceUnavailableError extends HttpError {
559
- constructor(message?: string, cause?: Error);
560
- }
561
- declare class GatewayTimeoutError extends HttpError {
562
- constructor(message?: string, cause?: Error);
563
- }
564
- declare class HTTPVersionNotSupportedError extends HttpError {
565
- constructor(message?: string, cause?: Error);
566
- }
567
- declare class VariantAlsoNegotiatesError extends HttpError {
568
- constructor(message?: string, cause?: Error);
569
- }
570
- declare class InsufficientStorageError extends HttpError {
571
- constructor(message?: string, cause?: Error);
572
- }
573
- declare class LoopDetectedError extends HttpError {
574
- constructor(message?: string, cause?: Error);
575
- }
576
- declare class NotExtendedError extends HttpError {
577
- constructor(message?: string, cause?: Error);
578
- }
579
- declare class NetworkAuthenticationRequiredError extends HttpError {
580
- constructor(message?: string, cause?: Error);
581
- }
582
- declare const createHttpError: (statusCode: ErrorCode, message?: string, cause?: Error) => HttpError;
583
- declare const fromAxiosError: (axiosError: AxiosError) => HttpError;
584
-
585
- type OpenApiDocument = {
586
- openapi: string;
587
- info: InfoObject;
588
- jsonSchemaDialect?: string;
589
- servers?: ServerObject[];
590
- paths: Record<string, PathItemObject | ReferenceObject>;
591
- webhooks?: Record<string, PathItemObject | ReferenceObject>;
592
- components?: ComponentsObject;
593
- security?: SecurityRequirementObject[];
594
- tags?: TagObject[];
595
- externalDocs?: ExternalDocumentationObject;
596
- };
597
- type PathItemObject = {
598
- summary?: string;
599
- description?: string;
600
- get?: OperationObject;
601
- put?: OperationObject;
602
- post?: OperationObject;
603
- delete?: OperationObject;
604
- options?: OperationObject;
605
- head?: OperationObject;
606
- patch?: OperationObject;
607
- trace?: OperationObject;
608
- servers?: ServerObject[];
609
- parameters?: (ParameterObject | ReferenceObject)[];
610
- };
611
- type OperationObject = {
612
- tags?: string[];
613
- summary?: string;
614
- description?: string;
615
- externalDocs?: ExternalDocumentationObject;
616
- operationId?: string;
617
- parameters?: (ParameterObject | ReferenceObject)[];
618
- requestBody?: RequestBodyObject | ReferenceObject;
619
- responses: ResponsesObject;
620
- callbacks?: Record<string, CallbackObject | ReferenceObject>;
621
- deprecated?: boolean;
622
- security?: SecurityRequirementObject[];
623
- servers?: ServerObject[];
624
- };
625
- type RequestBodyObject = {
626
- description?: string;
627
- content: Record<'application/json' | (string & {}), MediaTypeObject>;
628
- required?: boolean;
629
- };
630
- type ResponsesObject = Record<string, ResponseObject | ReferenceObject>;
631
- type ResponseObject = {
632
- description: string;
633
- headers?: Record<string, HeaderObject | ReferenceObject>;
634
- content?: Record<'application/json' | (string & {}), MediaTypeObject>;
635
- links?: Record<string, LinkObject | ReferenceObject>;
636
- };
637
- type ComponentsObject = {
638
- schemas?: Record<string, SchemaObject>;
639
- responses?: Record<string, ResponseObject>;
640
- parameters?: Record<string, ParameterObject>;
641
- examples?: Record<string, ExampleObject>;
642
- requestBodies?: Record<string, RequestBodyObject>;
643
- headers?: Record<string, HeaderObject>;
644
- securitySchemes?: Record<string, SecuritySchemeObject>;
645
- links?: Record<string, LinkObject>;
646
- callbacks?: Record<string, CallbackObject>;
647
- pathItems?: Record<string, PathItemObject>;
648
- };
649
- type RequestBody = any;
650
- type LinkObject = {
651
- operationRef?: string;
652
- operationId?: string;
653
- parameters?: Record<string, string>;
654
- requestBody?: RequestBody;
655
- description?: string;
656
- server?: ServerObject;
657
- };
658
- type CallbackObject = Record<string, PathItemObject | ReferenceObject>;
659
- type SecurityRequirementObject = Record<string, string[]>;
660
-
661
- type Empty = Record<never, never>;
662
- type Serialized<T> = {
663
- [P in keyof T]: T[P] extends Date ? string : T[P] extends Date | undefined ? string | undefined : T[P] extends Array<infer U> ? Array<Serialized<U>> : T[P] extends (...args: any) => any ? T[P] : T[P] extends object ? Serialized<T[P]> : T[P] extends object | undefined ? Serialized<NonNullable<T[P]>> | undefined : T[P];
664
- };
665
- type ConvertToQueryParam<T> = T extends number ? string : T extends boolean ? string : T extends Date ? string : T extends string ? T : T extends Array<infer U> ? Array<ConvertToQueryParam<U>> : T extends object ? {
666
- [K in keyof T]: ConvertToQueryParam<T[K]>;
667
- } : T;
668
- type QueryParams<T> = {
669
- [K in keyof T]: ConvertToQueryParam<T[K]>;
670
- };
671
- type PartiallySerialized<T> = T | Serialized<T>;
672
- type LowerCaseHeaders<T> = {
673
- [P in keyof T as Lowercase<P & string>]: T[P];
674
- };
675
-
676
- type ExpressRequest = Request;
677
-
678
- type Verb = 'get' | 'post' | 'put' | 'patch' | 'delete';
679
- type APIResponse<Data = undefined, Headers = undefined> = Data extends undefined ? Headers extends undefined ? Empty : {
680
- headers: Headers;
681
- } : Headers extends undefined ? {
682
- data: Data;
683
- } : {
684
- data: Data;
685
- headers: Headers;
686
- };
687
- type GenericRouteHandler = RequestHandler;
688
- type RouteHandler = {
689
- pre?: RequestHandler | RequestHandler[];
690
- handler: <RequestArgs, Response extends [
691
- number,
692
- APIResponse<unknown | undefined, Record<string, string> | undefined>
693
- ]>(args?: RequestArgs) => Promise<Response>;
694
- };
695
- type Route<Handler extends RouteHandler = RouteHandler> = Record<Verb, Handler>;
696
- type APIServerDefinition = Record<string, Partial<Route>>;
697
- type APIServerOptions = {
698
- pre?: RequestHandler | RequestHandler[];
699
- };
700
- type RequestArgs = Request & {
701
- params?: Record<string, string>;
702
- query?: Record<string, string>;
703
- headers?: Record<string, string>;
704
- };
705
- type PayloadRequestArgs = RequestArgs & {
706
- body?: Record<string, string>;
707
- };
708
- type RequestOptions = {
709
- retry?: RetrySettings;
710
- headers?: OutgoingHttpHeaders & Record<string, string>;
711
- httpsAgent?: any;
712
- httpAgent?: any;
713
- timeout?: number;
714
- };
715
- type ArrayFormat = 'indices' | 'brackets' | 'repeat' | 'comma';
716
- type ClientOptions = RequestOptions & {
717
- arrayFormat?: ArrayFormat;
718
- authorizationTokenGenerator?: (url: string) => Promise<Record<string, string>> | undefined;
719
- authorizationTokenRefresh?: (url: string) => Promise<void> | undefined;
720
- };
721
- type BaseClient = {
722
- get: <U extends string, A extends RequestArgs | never, R extends APIResponse<unknown | undefined, Record<string, string> | undefined>>(url: U, args?: A, opts?: RequestOptions) => Promise<R>;
723
- post: <U extends string, A extends PayloadRequestArgs | never, R extends APIResponse<unknown | undefined, Record<string, string> | undefined>>(url: U, args?: A, opts?: RequestOptions) => Promise<R>;
724
- put: <U extends string, A extends PayloadRequestArgs | never, R extends APIResponse<unknown | undefined, Record<string, string> | undefined>>(url: U, args?: A, opts?: RequestOptions) => Promise<R>;
725
- patch: <U extends string, A extends PayloadRequestArgs | never, R extends APIResponse<unknown | undefined, Record<string, string> | undefined>>(url: U, args?: A, opts?: RequestOptions) => Promise<R>;
726
- delete: <U extends string, A extends RequestArgs | never, R extends APIResponse<unknown, unknown>>(url: U, args?: A, opts?: RequestOptions) => Promise<R>;
727
- };
728
-
729
- export { type APIResponse, type APIServerDefinition, type APIServerOptions, type ArrayFormat, type AsyncApiComponentsObject, type AsyncApiDocument, type AsyncOperationObject, type AvroArray, type AvroEnum, type AvroField, type AvroMap, type AvroPrimitive, type AvroRecord, type AvroSchema, type AvroUnion, BadGatewayError, BadRequestError, type BaseClient, type CallbackObject, type ChannelItemObject, type ClientErrorCode, type ClientOptions, type ComponentsObject, ConflictError, type ContactObject, type CorrelationIdObject, type DefaultValue, type DiscriminatorObject, type EncodingObject, type ErrorCode, type Example, type ExampleObject, ExpectationFailedError, type ExpressRequest, type ExternalDocumentationObject, FailedDependencyError, ForbiddenError, GatewayTimeoutError, type GenericRouteHandler, GoneError, HTTPVersionNotSupportedError, type HeaderObject, type HeaderStyle, HttpError, type HttpMethod, IMATeapotError, type InfoObject, InsufficientStorageError, InternalServerError, LengthRequiredError, type LicenseObject, type LinkObject, LockedError, LoopDetectedError, type LowerCaseHeaders, type MediaTypeObject, type MessageObject, type MessageTraitObject, MethodNotAllowedError, MisdirectedRequestError, NetworkAuthenticationRequiredError, NotAcceptableError, NotExtendedError, NotFoundError, NotImplementedError, type OAuthFlowObject, type OAuthFlowsObject, type OpenApiDocument, type OperationObject, type OperationTraitObject, type ParameterIn, type ParameterObject, type ParameterStyle, type PartiallySerialized, type PathItemObject, type PayloadRequestArgs, PayloadTooLargeError, PaymentRequiredError, PreconditionFailedError, PreconditionRequiredError, ProxyAuthenticationRequiredError, type QueryParams, RangeNotSatisfiableError, type ReferenceObject, type RequestArgs, type RequestBodyObject, RequestHeaderFieldsTooLargeError, type RequestOptions, RequestTimeoutError, type ResponseObject, type ResponsesObject, type Route, type RouteHandler, type SchemaEnum, type SchemaObject, type SchemaType, type SecurityRequirementObject, type SecuritySchemeObject, type SecuritySchemeType, type Serialized, type ServerErrorCode, type ServerObject, type ServerVariableObject, ServiceUnavailableError, type TagObject, TooEarlyError, TooManyRequestsError, URITooLongError, UnauthorizedError, UnavailableForLegalReasonsError, UnprocessableEntityError, UnsupportedMediaTypeError, UpgradeRequiredError, VariantAlsoNegotiatesError, type Verb, type XMLObject, createHttpError, fromAxiosError };