@tsoa-next/runtime 7.1.0
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/README.MD +3 -0
- package/dist/config.d.ts +240 -0
- package/dist/config.js +3 -0
- package/dist/config.js.map +1 -0
- package/dist/decorators/customAttribute.d.ts +1 -0
- package/dist/decorators/customAttribute.js +9 -0
- package/dist/decorators/customAttribute.js.map +1 -0
- package/dist/decorators/deprecated.d.ts +4 -0
- package/dist/decorators/deprecated.js +12 -0
- package/dist/decorators/deprecated.js.map +1 -0
- package/dist/decorators/example.d.ts +1 -0
- package/dist/decorators/example.js +9 -0
- package/dist/decorators/example.js.map +1 -0
- package/dist/decorators/extension.d.ts +4 -0
- package/dist/decorators/extension.js +9 -0
- package/dist/decorators/extension.js.map +1 -0
- package/dist/decorators/methods.d.ts +7 -0
- package/dist/decorators/methods.js +45 -0
- package/dist/decorators/methods.js.map +1 -0
- package/dist/decorators/middlewares.d.ts +15 -0
- package/dist/decorators/middlewares.js +53 -0
- package/dist/decorators/middlewares.js.map +1 -0
- package/dist/decorators/operationid.d.ts +1 -0
- package/dist/decorators/operationid.js +9 -0
- package/dist/decorators/operationid.js.map +1 -0
- package/dist/decorators/parameter.d.ts +73 -0
- package/dist/decorators/parameter.js +141 -0
- package/dist/decorators/parameter.js.map +1 -0
- package/dist/decorators/response.d.ts +17 -0
- package/dist/decorators/response.js +38 -0
- package/dist/decorators/response.js.map +1 -0
- package/dist/decorators/route.d.ts +5 -0
- package/dist/decorators/route.js +18 -0
- package/dist/decorators/route.js.map +1 -0
- package/dist/decorators/security.d.ts +10 -0
- package/dist/decorators/security.js +21 -0
- package/dist/decorators/security.js.map +1 -0
- package/dist/decorators/tags.d.ts +1 -0
- package/dist/decorators/tags.js +9 -0
- package/dist/decorators/tags.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +41 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/controller.d.ts +16 -0
- package/dist/interfaces/controller.js +24 -0
- package/dist/interfaces/controller.js.map +1 -0
- package/dist/interfaces/file.d.ts +31 -0
- package/dist/interfaces/file.js +3 -0
- package/dist/interfaces/file.js.map +1 -0
- package/dist/interfaces/iocModule.d.ts +7 -0
- package/dist/interfaces/iocModule.js +3 -0
- package/dist/interfaces/iocModule.js.map +1 -0
- package/dist/interfaces/response.d.ts +5 -0
- package/dist/interfaces/response.js +3 -0
- package/dist/interfaces/response.js.map +1 -0
- package/dist/metadataGeneration/tsoa.d.ts +219 -0
- package/dist/metadataGeneration/tsoa.js +3 -0
- package/dist/metadataGeneration/tsoa.js.map +1 -0
- package/dist/routeGeneration/additionalProps.d.ts +6 -0
- package/dist/routeGeneration/additionalProps.js +3 -0
- package/dist/routeGeneration/additionalProps.js.map +1 -0
- package/dist/routeGeneration/templateHelpers.d.ts +203 -0
- package/dist/routeGeneration/templateHelpers.js +859 -0
- package/dist/routeGeneration/templateHelpers.js.map +1 -0
- package/dist/routeGeneration/templates/express/expressTemplateService.d.ts +29 -0
- package/dist/routeGeneration/templates/express/expressTemplateService.js +118 -0
- package/dist/routeGeneration/templates/express/expressTemplateService.js.map +1 -0
- package/dist/routeGeneration/templates/hapi/hapiTemplateService.d.ts +36 -0
- package/dist/routeGeneration/templates/hapi/hapiTemplateService.js +120 -0
- package/dist/routeGeneration/templates/hapi/hapiTemplateService.js.map +1 -0
- package/dist/routeGeneration/templates/index.d.ts +4 -0
- package/dist/routeGeneration/templates/index.js +21 -0
- package/dist/routeGeneration/templates/index.js.map +1 -0
- package/dist/routeGeneration/templates/koa/koaTemplateService.d.ts +29 -0
- package/dist/routeGeneration/templates/koa/koaTemplateService.js +116 -0
- package/dist/routeGeneration/templates/koa/koaTemplateService.js.map +1 -0
- package/dist/routeGeneration/templates/templateService.d.ts +15 -0
- package/dist/routeGeneration/templates/templateService.js +37 -0
- package/dist/routeGeneration/templates/templateService.js.map +1 -0
- package/dist/routeGeneration/tsoa-route.d.ts +56 -0
- package/dist/routeGeneration/tsoa-route.js +11 -0
- package/dist/routeGeneration/tsoa-route.js.map +1 -0
- package/dist/swagger/swagger.d.ts +550 -0
- package/dist/swagger/swagger.js +12 -0
- package/dist/swagger/swagger.js.map +1 -0
- package/dist/utils/assertNever.d.ts +4 -0
- package/dist/utils/assertNever.js +10 -0
- package/dist/utils/assertNever.js.map +1 -0
- package/dist/utils/isHeaderType.d.ts +5 -0
- package/dist/utils/isHeaderType.js +3 -0
- package/dist/utils/isHeaderType.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TemplateService = void 0;
|
|
4
|
+
const templateHelpers_1 = require("../templateHelpers");
|
|
5
|
+
class TemplateService {
|
|
6
|
+
models;
|
|
7
|
+
config;
|
|
8
|
+
validationService;
|
|
9
|
+
constructor(models, config) {
|
|
10
|
+
this.models = models;
|
|
11
|
+
this.config = config;
|
|
12
|
+
this.validationService = new templateHelpers_1.ValidationService(models, config);
|
|
13
|
+
}
|
|
14
|
+
isController(object) {
|
|
15
|
+
return 'getHeaders' in object && 'getStatus' in object && 'setStatus' in object;
|
|
16
|
+
}
|
|
17
|
+
buildPromise(methodName, controller, validatedArgs) {
|
|
18
|
+
const ownPrototype = Object.getPrototypeOf(controller);
|
|
19
|
+
let prototype = ownPrototype;
|
|
20
|
+
let descriptor;
|
|
21
|
+
// Search up the prototype chain so inherited controller actions can be dispatched.
|
|
22
|
+
// We stop at Object.prototype because methods above that level are not user actions.
|
|
23
|
+
while (prototype && prototype !== Object.prototype) {
|
|
24
|
+
descriptor = Object.getOwnPropertyDescriptor(prototype, methodName);
|
|
25
|
+
if (descriptor?.value && typeof descriptor.value === 'function') {
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
prototype = Object.getPrototypeOf(prototype);
|
|
29
|
+
}
|
|
30
|
+
// Keep previous behavior when nothing is found by allowing the same
|
|
31
|
+
// descriptor access failure path to occur on the original prototype.
|
|
32
|
+
const resolvedDescriptor = descriptor || Object.getOwnPropertyDescriptor(ownPrototype, methodName);
|
|
33
|
+
return resolvedDescriptor.value.apply(controller, validatedArgs);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.TemplateService = TemplateService;
|
|
37
|
+
//# sourceMappingURL=templateService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateService.js","sourceRoot":"","sources":["../../../src/routeGeneration/templates/templateService.ts"],"names":[],"mappings":";;;AAEA,wDAAsD;AAGtD,MAAsB,eAAe;IAId;IACA;IAJX,iBAAiB,CAAmB;IAE9C,YACqB,MAAwB,EACxB,MAAuB;QADvB,WAAM,GAAN,MAAM,CAAkB;QACxB,WAAM,GAAN,MAAM,CAAiB;QAE1C,IAAI,CAAC,iBAAiB,GAAG,IAAI,mCAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChE,CAAC;IAQS,YAAY,CAAC,MAA2B;QAChD,OAAO,YAAY,IAAI,MAAM,IAAI,WAAW,IAAI,MAAM,IAAI,WAAW,IAAI,MAAM,CAAA;IACjF,CAAC;IAES,YAAY,CAAC,UAAkB,EAAE,UAA+B,EAAE,aAAkB;QAC5F,MAAM,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,CAAA;QACtD,IAAI,SAAS,GAAkB,YAAY,CAAA;QAC3C,IAAI,UAA0C,CAAA;QAE9C,mFAAmF;QACnF,qFAAqF;QACrF,OAAO,SAAS,IAAI,SAAS,KAAK,MAAM,CAAC,SAAS,EAAE,CAAC;YACnD,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;YACnE,IAAI,UAAU,EAAE,KAAK,IAAI,OAAO,UAAU,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;gBAChE,MAAK;YACP,CAAC;YAED,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,CAAA;QAC9C,CAAC;QAED,oEAAoE;QACpE,qEAAqE;QACrE,MAAM,kBAAkB,GAAG,UAAU,IAAI,MAAM,CAAC,wBAAwB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAA;QAClG,OAAQ,kBAAmB,CAAC,KAA0C,CAAC,KAAK,CAAC,UAAU,EAAE,aAAa,CAAC,CAAA;IACzG,CAAC;CACF;AAzCD,0CAyCC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Tsoa } from './../metadataGeneration/tsoa';
|
|
2
|
+
/**
|
|
3
|
+
* For Swagger, additionalProperties is implicitly allowed. So use this function to clarify that undefined should be associated with allowing additional properties
|
|
4
|
+
* @param test if this is undefined then you should interpret it as a "yes"
|
|
5
|
+
*/
|
|
6
|
+
export declare function isDefaultForAdditionalPropertiesAllowed(test: TsoaRoute.RefObjectModelSchema['additionalProperties']): test is undefined;
|
|
7
|
+
export declare namespace TsoaRoute {
|
|
8
|
+
interface Models {
|
|
9
|
+
[name: string]: ModelSchema;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* This is a convenience type so you can check .properties on the items in the Record without having TypeScript throw a compiler error. That's because this Record can't have enums in it. If you want that, then just use the base interface
|
|
13
|
+
*/
|
|
14
|
+
interface RefObjectModels extends TsoaRoute.Models {
|
|
15
|
+
[refNames: string]: TsoaRoute.RefObjectModelSchema;
|
|
16
|
+
}
|
|
17
|
+
interface RefEnumModelSchema {
|
|
18
|
+
dataType: 'refEnum';
|
|
19
|
+
enums: Array<string | number>;
|
|
20
|
+
}
|
|
21
|
+
interface RefObjectModelSchema {
|
|
22
|
+
dataType: 'refObject';
|
|
23
|
+
properties: {
|
|
24
|
+
[name: string]: PropertySchema;
|
|
25
|
+
};
|
|
26
|
+
additionalProperties?: boolean | PropertySchema;
|
|
27
|
+
}
|
|
28
|
+
interface RefTypeAliasModelSchema {
|
|
29
|
+
dataType: 'refAlias';
|
|
30
|
+
type: PropertySchema;
|
|
31
|
+
}
|
|
32
|
+
type ModelSchema = RefEnumModelSchema | RefObjectModelSchema | RefTypeAliasModelSchema;
|
|
33
|
+
type ValidatorSchema = Tsoa.Validators;
|
|
34
|
+
interface PropertySchema {
|
|
35
|
+
dataType?: Tsoa.TypeStringLiteral;
|
|
36
|
+
ref?: string;
|
|
37
|
+
required?: boolean;
|
|
38
|
+
array?: PropertySchema;
|
|
39
|
+
enums?: Array<string | number | boolean | null>;
|
|
40
|
+
type?: PropertySchema;
|
|
41
|
+
subSchemas?: PropertySchema[];
|
|
42
|
+
validators?: ValidatorSchema;
|
|
43
|
+
default?: unknown;
|
|
44
|
+
additionalProperties?: boolean | PropertySchema;
|
|
45
|
+
nestedProperties?: {
|
|
46
|
+
[name: string]: PropertySchema;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
interface ParameterSchema extends PropertySchema {
|
|
50
|
+
name: string;
|
|
51
|
+
in: string;
|
|
52
|
+
}
|
|
53
|
+
interface Security {
|
|
54
|
+
[key: string]: string[];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isDefaultForAdditionalPropertiesAllowed = isDefaultForAdditionalPropertiesAllowed;
|
|
4
|
+
/**
|
|
5
|
+
* For Swagger, additionalProperties is implicitly allowed. So use this function to clarify that undefined should be associated with allowing additional properties
|
|
6
|
+
* @param test if this is undefined then you should interpret it as a "yes"
|
|
7
|
+
*/
|
|
8
|
+
function isDefaultForAdditionalPropertiesAllowed(test) {
|
|
9
|
+
return test === undefined;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=tsoa-route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsoa-route.js","sourceRoot":"","sources":["../../src/routeGeneration/tsoa-route.ts"],"names":[],"mappings":";;AAMA,0FAEC;AAND;;;GAGG;AACH,SAAgB,uCAAuC,CAAC,IAA4D;IAClH,OAAO,IAAI,KAAK,SAAS,CAAA;AAC3B,CAAC"}
|
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
export declare namespace Swagger {
|
|
2
|
+
export type DataType = 'integer' | 'number' | 'boolean' | 'string' | 'array' | 'object' | 'file' | 'undefined';
|
|
3
|
+
export type DataFormat = 'int32' | 'int64' | 'float' | 'double' | 'byte' | 'binary' | 'date' | 'date-time' | 'password';
|
|
4
|
+
export type Protocol = 'http' | 'https' | 'ws' | 'wss';
|
|
5
|
+
export type SupportedSpecMajorVersion = 2 | 3 | 3.1;
|
|
6
|
+
export interface Spec {
|
|
7
|
+
info: Info;
|
|
8
|
+
tags?: Tag[];
|
|
9
|
+
externalDocs?: ExternalDocs;
|
|
10
|
+
}
|
|
11
|
+
export interface Spec2 extends Spec {
|
|
12
|
+
swagger: '2.0';
|
|
13
|
+
host?: string;
|
|
14
|
+
basePath?: string;
|
|
15
|
+
schemes?: Protocol[];
|
|
16
|
+
consumes?: string[];
|
|
17
|
+
produces?: string[];
|
|
18
|
+
paths: {
|
|
19
|
+
[name: string]: Path;
|
|
20
|
+
};
|
|
21
|
+
definitions?: {
|
|
22
|
+
[name: string]: Schema2;
|
|
23
|
+
};
|
|
24
|
+
parameters?: {
|
|
25
|
+
[name: string]: Parameter2;
|
|
26
|
+
};
|
|
27
|
+
responses?: {
|
|
28
|
+
[name: string]: Response;
|
|
29
|
+
};
|
|
30
|
+
security?: Security[];
|
|
31
|
+
securityDefinitions?: {
|
|
32
|
+
[name: string]: SecuritySchemes;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Base interface for all OpenAPI 3.x specifications
|
|
37
|
+
* Contains fields shared across all 3.x versions
|
|
38
|
+
*/
|
|
39
|
+
export interface Spec3x extends Spec {
|
|
40
|
+
servers: Server[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* OpenAPI 3.0.x specification
|
|
44
|
+
*/
|
|
45
|
+
export interface Spec30 extends Spec3x {
|
|
46
|
+
openapi: '3.0.0';
|
|
47
|
+
components: Components;
|
|
48
|
+
paths: {
|
|
49
|
+
[name: string]: Path3;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* OpenAPI 3.1.x specification
|
|
54
|
+
*/
|
|
55
|
+
export interface Spec31 extends Spec3x {
|
|
56
|
+
openapi: '3.1.0';
|
|
57
|
+
components: Components31;
|
|
58
|
+
paths: {
|
|
59
|
+
[name: string]: Path31;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Union type representing any OpenAPI 3.x specification (3.0 or 3.1)
|
|
64
|
+
* Use Spec30 or Spec31 when you know the specific version
|
|
65
|
+
*/
|
|
66
|
+
export type Spec3 = Spec30 | Spec31;
|
|
67
|
+
export interface Path31 {
|
|
68
|
+
$ref?: string;
|
|
69
|
+
get?: Operation31;
|
|
70
|
+
put?: Operation31;
|
|
71
|
+
post?: Operation31;
|
|
72
|
+
delete?: Operation31;
|
|
73
|
+
options?: Operation31;
|
|
74
|
+
head?: Operation31;
|
|
75
|
+
patch?: Operation31;
|
|
76
|
+
parameters?: Parameter31[];
|
|
77
|
+
}
|
|
78
|
+
export interface Components {
|
|
79
|
+
callbacks?: {
|
|
80
|
+
[name: string]: unknown;
|
|
81
|
+
};
|
|
82
|
+
examples?: {
|
|
83
|
+
[name: string]: Example3 | string;
|
|
84
|
+
};
|
|
85
|
+
headers?: {
|
|
86
|
+
[name: string]: unknown;
|
|
87
|
+
};
|
|
88
|
+
links?: {
|
|
89
|
+
[name: string]: unknown;
|
|
90
|
+
};
|
|
91
|
+
parameters?: {
|
|
92
|
+
[name: string]: Parameter3;
|
|
93
|
+
};
|
|
94
|
+
requestBodies?: {
|
|
95
|
+
[name: string]: unknown;
|
|
96
|
+
};
|
|
97
|
+
responses?: {
|
|
98
|
+
[name: string]: Response;
|
|
99
|
+
};
|
|
100
|
+
schemas?: {
|
|
101
|
+
[name: string]: Schema3;
|
|
102
|
+
};
|
|
103
|
+
securitySchemes?: {
|
|
104
|
+
[name: string]: SecuritySchemes;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
export interface Components31 extends Omit<Components, 'schemas'> {
|
|
108
|
+
schemas?: {
|
|
109
|
+
[name: string]: Schema31;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
export interface Server {
|
|
113
|
+
url: string;
|
|
114
|
+
}
|
|
115
|
+
export interface Info {
|
|
116
|
+
title: string;
|
|
117
|
+
version?: string;
|
|
118
|
+
description?: string;
|
|
119
|
+
termsOfService?: string;
|
|
120
|
+
contact?: Contact;
|
|
121
|
+
license?: License;
|
|
122
|
+
}
|
|
123
|
+
export interface Contact {
|
|
124
|
+
name?: string;
|
|
125
|
+
email?: string;
|
|
126
|
+
url?: string;
|
|
127
|
+
}
|
|
128
|
+
export interface License {
|
|
129
|
+
name: string;
|
|
130
|
+
url?: string;
|
|
131
|
+
}
|
|
132
|
+
export interface ExternalDocs {
|
|
133
|
+
url: string;
|
|
134
|
+
description?: string;
|
|
135
|
+
}
|
|
136
|
+
export interface Tag {
|
|
137
|
+
name: string;
|
|
138
|
+
description?: string;
|
|
139
|
+
externalDocs?: ExternalDocs;
|
|
140
|
+
}
|
|
141
|
+
export interface Example3 {
|
|
142
|
+
value: unknown;
|
|
143
|
+
summary?: string;
|
|
144
|
+
description?: string;
|
|
145
|
+
}
|
|
146
|
+
export type BaseParameter = {
|
|
147
|
+
name: string;
|
|
148
|
+
in: 'query' | 'header' | 'path' | 'formData' | 'body' | 'cookie';
|
|
149
|
+
required?: boolean;
|
|
150
|
+
description?: string;
|
|
151
|
+
deprecated?: boolean;
|
|
152
|
+
[ext: `x-${string}`]: unknown;
|
|
153
|
+
} & Pick<BaseSchema, 'type' | 'items' | 'enum' | 'format' | 'minimum' | 'maximum' | 'minLength' | 'maxLength' | 'pattern'>;
|
|
154
|
+
export type BodyParameter = BaseParameter & {
|
|
155
|
+
in: 'body';
|
|
156
|
+
};
|
|
157
|
+
export type FormDataParameter = BaseParameter & {
|
|
158
|
+
in: 'formData';
|
|
159
|
+
type: DataType;
|
|
160
|
+
format?: DataFormat;
|
|
161
|
+
collectionFormat?: 'csv' | 'ssv' | 'tsv' | 'pipes' | 'multi';
|
|
162
|
+
default?: unknown;
|
|
163
|
+
};
|
|
164
|
+
type QueryParameter = BaseParameter & {
|
|
165
|
+
in: 'query';
|
|
166
|
+
type: DataType;
|
|
167
|
+
format?: DataFormat;
|
|
168
|
+
collectionFormat?: 'csv' | 'ssv' | 'tsv' | 'pipes' | 'multi';
|
|
169
|
+
default?: unknown;
|
|
170
|
+
};
|
|
171
|
+
type PathParameter = BaseParameter & {
|
|
172
|
+
in: 'path';
|
|
173
|
+
type: DataType;
|
|
174
|
+
format?: DataFormat;
|
|
175
|
+
default?: unknown;
|
|
176
|
+
};
|
|
177
|
+
type HeaderParameter = BaseParameter & {
|
|
178
|
+
in: 'header';
|
|
179
|
+
type: DataType;
|
|
180
|
+
format?: DataFormat;
|
|
181
|
+
default?: unknown;
|
|
182
|
+
};
|
|
183
|
+
type Swagger2BaseParameter = BaseParameter & {
|
|
184
|
+
schema: Schema2;
|
|
185
|
+
};
|
|
186
|
+
export type Swagger2BodyParameter = Swagger2BaseParameter & BodyParameter;
|
|
187
|
+
export type Swagger2FormDataParameter = Swagger2BaseParameter & FormDataParameter;
|
|
188
|
+
export type Swagger2QueryParameter = Swagger2BaseParameter & QueryParameter;
|
|
189
|
+
export type Swagger2PathParameter = Swagger2BaseParameter & PathParameter;
|
|
190
|
+
export type Swagger2HeaderParameter = Swagger2BaseParameter & HeaderParameter;
|
|
191
|
+
export type Parameter2 = Swagger2BodyParameter | Swagger2FormDataParameter | Swagger2QueryParameter | Swagger2PathParameter | Swagger2HeaderParameter;
|
|
192
|
+
export function isQueryParameter(parameter: unknown): parameter is Swagger2QueryParameter;
|
|
193
|
+
export interface Parameter3 extends BaseParameter {
|
|
194
|
+
in: 'query' | 'header' | 'path' | 'cookie';
|
|
195
|
+
schema: Schema3;
|
|
196
|
+
style?: string;
|
|
197
|
+
explode?: boolean;
|
|
198
|
+
allowReserved?: boolean;
|
|
199
|
+
example?: unknown;
|
|
200
|
+
examples?: {
|
|
201
|
+
[name: string]: Example3 | string;
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
export interface Parameter31 extends Omit<Parameter3, 'schema'> {
|
|
205
|
+
schema: Schema31;
|
|
206
|
+
}
|
|
207
|
+
export interface Path {
|
|
208
|
+
$ref?: string;
|
|
209
|
+
get?: Operation;
|
|
210
|
+
put?: Operation;
|
|
211
|
+
post?: Operation;
|
|
212
|
+
delete?: Operation;
|
|
213
|
+
options?: Operation;
|
|
214
|
+
head?: Operation;
|
|
215
|
+
patch?: Operation;
|
|
216
|
+
parameters?: Parameter2[];
|
|
217
|
+
}
|
|
218
|
+
export interface Path3 {
|
|
219
|
+
$ref?: string;
|
|
220
|
+
get?: Operation3;
|
|
221
|
+
put?: Operation3;
|
|
222
|
+
post?: Operation3;
|
|
223
|
+
delete?: Operation3;
|
|
224
|
+
options?: Operation3;
|
|
225
|
+
head?: Operation3;
|
|
226
|
+
patch?: Operation3;
|
|
227
|
+
parameters?: Parameter3[];
|
|
228
|
+
}
|
|
229
|
+
export interface Operation {
|
|
230
|
+
tags?: string[];
|
|
231
|
+
summary?: string;
|
|
232
|
+
description?: string;
|
|
233
|
+
externalDocs?: ExternalDocs;
|
|
234
|
+
operationId: string;
|
|
235
|
+
consumes?: string[];
|
|
236
|
+
produces?: string[];
|
|
237
|
+
parameters?: Parameter2[];
|
|
238
|
+
responses: {
|
|
239
|
+
[name: string]: Response;
|
|
240
|
+
};
|
|
241
|
+
schemes?: Protocol[];
|
|
242
|
+
deprecated?: boolean;
|
|
243
|
+
security?: Security[];
|
|
244
|
+
[key: string]: unknown;
|
|
245
|
+
}
|
|
246
|
+
export interface Operation3 {
|
|
247
|
+
tags?: string[];
|
|
248
|
+
summary?: string;
|
|
249
|
+
description?: string;
|
|
250
|
+
externalDocs?: ExternalDocs;
|
|
251
|
+
operationId: string;
|
|
252
|
+
consumes?: string[];
|
|
253
|
+
parameters?: Parameter3[];
|
|
254
|
+
responses: {
|
|
255
|
+
[name: string]: Response3;
|
|
256
|
+
};
|
|
257
|
+
schemes?: Protocol[];
|
|
258
|
+
deprecated?: boolean;
|
|
259
|
+
security?: Security[];
|
|
260
|
+
requestBody?: RequestBody;
|
|
261
|
+
[ext: `x-${string}`]: unknown;
|
|
262
|
+
}
|
|
263
|
+
export interface Operation31 extends Omit<Operation3, 'responses' | 'requestBody' | 'parameters'> {
|
|
264
|
+
parameters?: Parameter31[];
|
|
265
|
+
requestBody?: RequestBody31;
|
|
266
|
+
responses: {
|
|
267
|
+
[name: string]: Response31;
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
export interface RequestBody {
|
|
271
|
+
content: {
|
|
272
|
+
[requestMediaType: string]: MediaType;
|
|
273
|
+
};
|
|
274
|
+
description?: string;
|
|
275
|
+
required?: boolean;
|
|
276
|
+
}
|
|
277
|
+
export interface RequestBody31 {
|
|
278
|
+
content: {
|
|
279
|
+
[requestMediaType: string]: MediaType31;
|
|
280
|
+
};
|
|
281
|
+
description?: string;
|
|
282
|
+
required?: boolean;
|
|
283
|
+
$ref?: string;
|
|
284
|
+
summary?: string;
|
|
285
|
+
examples?: {
|
|
286
|
+
[media: string]: Example3 | string;
|
|
287
|
+
};
|
|
288
|
+
[ext: `x-${string}`]: unknown;
|
|
289
|
+
}
|
|
290
|
+
export interface MediaType {
|
|
291
|
+
schema?: Schema3;
|
|
292
|
+
example?: unknown;
|
|
293
|
+
examples?: {
|
|
294
|
+
[name: string]: Example3 | string;
|
|
295
|
+
};
|
|
296
|
+
encoding?: {
|
|
297
|
+
[name: string]: unknown;
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
export interface MediaType31 {
|
|
301
|
+
schema?: Schema31;
|
|
302
|
+
example?: unknown;
|
|
303
|
+
examples?: {
|
|
304
|
+
[name: string]: Example3 | string;
|
|
305
|
+
};
|
|
306
|
+
encoding?: {
|
|
307
|
+
[name: string]: unknown;
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
export interface Response {
|
|
311
|
+
description: string;
|
|
312
|
+
schema?: BaseSchema;
|
|
313
|
+
headers?: {
|
|
314
|
+
[name: string]: Header;
|
|
315
|
+
};
|
|
316
|
+
examples?: {
|
|
317
|
+
[responseMediaType: string]: {
|
|
318
|
+
[exampleName: string]: Example3 | string;
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
export interface Response3 {
|
|
323
|
+
description: string;
|
|
324
|
+
content?: {
|
|
325
|
+
[responseMediaType: string]: {
|
|
326
|
+
schema: Schema3;
|
|
327
|
+
examples?: {
|
|
328
|
+
[name: string]: Example3 | string;
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
};
|
|
332
|
+
headers?: {
|
|
333
|
+
[name: string]: Header3;
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
export interface Response31 {
|
|
337
|
+
description: string;
|
|
338
|
+
content?: {
|
|
339
|
+
[responseMediaType: string]: {
|
|
340
|
+
schema?: Schema31;
|
|
341
|
+
examples?: {
|
|
342
|
+
[name: string]: Example3 | string;
|
|
343
|
+
};
|
|
344
|
+
example?: unknown;
|
|
345
|
+
encoding?: {
|
|
346
|
+
[name: string]: unknown;
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
headers?: {
|
|
351
|
+
[name: string]: Header3;
|
|
352
|
+
};
|
|
353
|
+
links?: {
|
|
354
|
+
[name: string]: unknown;
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
export interface BaseSchema<P = unknown> {
|
|
358
|
+
type?: string;
|
|
359
|
+
format?: DataFormat;
|
|
360
|
+
$ref?: string;
|
|
361
|
+
title?: string;
|
|
362
|
+
description?: string;
|
|
363
|
+
default?: string | boolean | number | unknown;
|
|
364
|
+
multipleOf?: number;
|
|
365
|
+
maximum?: number;
|
|
366
|
+
exclusiveMaximum?: number;
|
|
367
|
+
minimum?: number;
|
|
368
|
+
exclusiveMinimum?: number;
|
|
369
|
+
maxLength?: number;
|
|
370
|
+
minLength?: number;
|
|
371
|
+
pattern?: string;
|
|
372
|
+
maxItems?: number;
|
|
373
|
+
minItems?: number;
|
|
374
|
+
uniqueItems?: boolean;
|
|
375
|
+
maxProperties?: number;
|
|
376
|
+
minProperties?: number;
|
|
377
|
+
enum?: Array<boolean | string | number | null>;
|
|
378
|
+
'x-enum-varnames'?: string[];
|
|
379
|
+
[ext: `x-${string}`]: unknown;
|
|
380
|
+
additionalProperties?: boolean | BaseSchema;
|
|
381
|
+
properties?: {
|
|
382
|
+
[propertyName: string]: P;
|
|
383
|
+
};
|
|
384
|
+
discriminator?: string;
|
|
385
|
+
readOnly?: boolean;
|
|
386
|
+
xml?: XML;
|
|
387
|
+
externalDocs?: ExternalDocs;
|
|
388
|
+
example?: unknown;
|
|
389
|
+
required?: string[];
|
|
390
|
+
items?: BaseSchema;
|
|
391
|
+
}
|
|
392
|
+
export interface Schema31 extends Omit<Schema3, 'items' | 'properties' | 'additionalProperties' | 'discriminator' | 'anyOf' | 'allOf'> {
|
|
393
|
+
examples?: unknown[];
|
|
394
|
+
properties?: {
|
|
395
|
+
[key: string]: Schema31;
|
|
396
|
+
};
|
|
397
|
+
additionalProperties?: boolean | Schema31;
|
|
398
|
+
items?: Schema31 | false;
|
|
399
|
+
prefixItems?: Schema31[];
|
|
400
|
+
contains?: Schema31;
|
|
401
|
+
allOf?: Schema31[];
|
|
402
|
+
anyOf?: Schema31[];
|
|
403
|
+
oneOf?: Schema31[];
|
|
404
|
+
not?: Schema31;
|
|
405
|
+
propertyNames?: Schema31;
|
|
406
|
+
discriminator?: {
|
|
407
|
+
propertyName: string;
|
|
408
|
+
mapping?: Record<string, string>;
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
export interface Schema3 extends Omit<BaseSchema, 'type'> {
|
|
412
|
+
type?: DataType;
|
|
413
|
+
nullable?: boolean;
|
|
414
|
+
anyOf?: BaseSchema[];
|
|
415
|
+
allOf?: BaseSchema[];
|
|
416
|
+
deprecated?: boolean;
|
|
417
|
+
properties?: {
|
|
418
|
+
[propertyName: string]: Schema3;
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
export interface Schema2 extends BaseSchema {
|
|
422
|
+
type?: DataType;
|
|
423
|
+
properties?: {
|
|
424
|
+
[propertyName: string]: Schema2;
|
|
425
|
+
};
|
|
426
|
+
['x-nullable']?: boolean;
|
|
427
|
+
['x-deprecated']?: boolean;
|
|
428
|
+
}
|
|
429
|
+
export interface Header {
|
|
430
|
+
description?: string;
|
|
431
|
+
type: 'string' | 'number' | 'integer' | 'boolean' | 'array';
|
|
432
|
+
format?: string;
|
|
433
|
+
items?: BaseSchema;
|
|
434
|
+
collectionFormat?: 'csv' | 'ssv' | 'tsv' | 'pipes' | 'multi';
|
|
435
|
+
default?: string | boolean | number | unknown;
|
|
436
|
+
maximum?: number;
|
|
437
|
+
exclusiveMaximum?: boolean;
|
|
438
|
+
minimum?: number;
|
|
439
|
+
exclusiveMinimum?: boolean;
|
|
440
|
+
maxLength?: number;
|
|
441
|
+
minLength?: number;
|
|
442
|
+
pattern?: string;
|
|
443
|
+
maxItems?: number;
|
|
444
|
+
minItems?: number;
|
|
445
|
+
uniqueItems?: boolean;
|
|
446
|
+
enum?: Array<string | number | null>;
|
|
447
|
+
multipleOf?: number;
|
|
448
|
+
}
|
|
449
|
+
export interface Header3 {
|
|
450
|
+
description?: string;
|
|
451
|
+
required?: boolean;
|
|
452
|
+
deprecated?: boolean;
|
|
453
|
+
allowEmptyValue?: boolean;
|
|
454
|
+
style?: string;
|
|
455
|
+
explode?: boolean;
|
|
456
|
+
allowReserved?: boolean;
|
|
457
|
+
schema?: Schema3 | Schema31;
|
|
458
|
+
example?: unknown;
|
|
459
|
+
examples?: {
|
|
460
|
+
[media: string]: Example3 | string;
|
|
461
|
+
};
|
|
462
|
+
content?: {
|
|
463
|
+
[media: string]: {
|
|
464
|
+
schema?: Schema3 | Schema31;
|
|
465
|
+
example?: unknown;
|
|
466
|
+
examples?: {
|
|
467
|
+
[name: string]: Example3 | string;
|
|
468
|
+
};
|
|
469
|
+
};
|
|
470
|
+
};
|
|
471
|
+
[ext: `x-${string}`]: unknown;
|
|
472
|
+
}
|
|
473
|
+
export interface XML {
|
|
474
|
+
type?: string;
|
|
475
|
+
namespace?: string;
|
|
476
|
+
prefix?: string;
|
|
477
|
+
attribute?: string;
|
|
478
|
+
wrapped?: boolean;
|
|
479
|
+
}
|
|
480
|
+
interface BaseSecurity {
|
|
481
|
+
description?: string;
|
|
482
|
+
}
|
|
483
|
+
export interface ApiKeySecurity extends BaseSecurity {
|
|
484
|
+
type: 'apiKey';
|
|
485
|
+
name: string;
|
|
486
|
+
in: 'query' | 'header';
|
|
487
|
+
}
|
|
488
|
+
interface BaseOAuthSecurity extends BaseSecurity {
|
|
489
|
+
scopes?: OAuthScope;
|
|
490
|
+
}
|
|
491
|
+
export interface BasicSecurity3 extends BaseSecurity {
|
|
492
|
+
type: 'http';
|
|
493
|
+
scheme: 'basic';
|
|
494
|
+
}
|
|
495
|
+
export interface BasicSecurity extends BaseSecurity {
|
|
496
|
+
type: 'basic';
|
|
497
|
+
}
|
|
498
|
+
export interface BearerSecurity3 extends BaseSecurity {
|
|
499
|
+
type: 'http';
|
|
500
|
+
scheme: 'bearer';
|
|
501
|
+
bearerFormat?: string;
|
|
502
|
+
}
|
|
503
|
+
export interface OpenIDSecurity extends BaseSecurity {
|
|
504
|
+
type: 'openIdConnect';
|
|
505
|
+
openIdConnectUrl: string;
|
|
506
|
+
}
|
|
507
|
+
export interface OAuth2Security3 extends BaseSecurity {
|
|
508
|
+
type: 'oauth2';
|
|
509
|
+
flows: OAuthFlow;
|
|
510
|
+
}
|
|
511
|
+
export interface OAuth2SecurityFlow3 extends BaseSecurity {
|
|
512
|
+
tokenUrl?: string;
|
|
513
|
+
authorizationUrl?: string;
|
|
514
|
+
scopes?: OAuthScope;
|
|
515
|
+
}
|
|
516
|
+
export interface OAuth2ImplicitSecurity extends BaseOAuthSecurity {
|
|
517
|
+
type: 'oauth2';
|
|
518
|
+
description?: string;
|
|
519
|
+
flow: 'implicit';
|
|
520
|
+
authorizationUrl: string;
|
|
521
|
+
}
|
|
522
|
+
export interface OAuth2PasswordSecurity extends BaseOAuthSecurity {
|
|
523
|
+
type: 'oauth2';
|
|
524
|
+
flow: 'password';
|
|
525
|
+
tokenUrl: string;
|
|
526
|
+
}
|
|
527
|
+
export interface OAuth2ApplicationSecurity extends BaseOAuthSecurity {
|
|
528
|
+
type: 'oauth2';
|
|
529
|
+
flow: 'application';
|
|
530
|
+
tokenUrl: string;
|
|
531
|
+
}
|
|
532
|
+
export interface OAuth2AccessCodeSecurity extends BaseOAuthSecurity {
|
|
533
|
+
type: 'oauth2';
|
|
534
|
+
flow: 'accessCode';
|
|
535
|
+
tokenUrl: string;
|
|
536
|
+
authorizationUrl: string;
|
|
537
|
+
}
|
|
538
|
+
export interface OAuthScope {
|
|
539
|
+
[scopeName: string]: string;
|
|
540
|
+
}
|
|
541
|
+
export type OAuthFlow = {
|
|
542
|
+
[flowName in OAuth2FlowTypes]?: OAuth2SecurityFlow3;
|
|
543
|
+
};
|
|
544
|
+
export type OAuth2FlowTypes = 'authorizationCode' | 'implicit' | 'password' | 'clientCredentials';
|
|
545
|
+
export type SecuritySchemes = ApiKeySecurity | BasicSecurity | BasicSecurity3 | BearerSecurity3 | OpenIDSecurity | OAuth2AccessCodeSecurity | OAuth2ApplicationSecurity | OAuth2ImplicitSecurity | OAuth2PasswordSecurity | OAuth2Security3;
|
|
546
|
+
export interface Security {
|
|
547
|
+
[key: string]: string[];
|
|
548
|
+
}
|
|
549
|
+
export {};
|
|
550
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Swagger = void 0;
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
5
|
+
var Swagger;
|
|
6
|
+
(function (Swagger) {
|
|
7
|
+
function isQueryParameter(parameter) {
|
|
8
|
+
return typeof parameter === 'object' && parameter !== null && 'in' in parameter && parameter.in === 'query';
|
|
9
|
+
}
|
|
10
|
+
Swagger.isQueryParameter = isQueryParameter;
|
|
11
|
+
})(Swagger || (exports.Swagger = Swagger = {}));
|
|
12
|
+
//# sourceMappingURL=swagger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swagger.js","sourceRoot":"","sources":["../../src/swagger/swagger.ts"],"names":[],"mappings":";;;AAAA,2DAA2D;AAC3D,IAAiB,OAAO,CA2iBvB;AA3iBD,WAAiB,OAAO;IA0LtB,SAAgB,gBAAgB,CAAC,SAAkB;QACjD,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI,IAAI,IAAI,IAAI,SAAS,IAAI,SAAS,CAAC,EAAE,KAAK,OAAO,CAAA;IAC7G,CAAC;IAFe,wBAAgB,mBAE/B,CAAA;AA+WH,CAAC,EA3iBgB,OAAO,uBAAP,OAAO,QA2iBvB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This function does exhaustiveness checking to ensure that you have discriminated a union so that no type remains. Use this to get the typescript compiler to help discover cases that were not considered.
|
|
3
|
+
*/
|
|
4
|
+
export declare function assertNever(value: never): never;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assertNever = assertNever;
|
|
4
|
+
/**
|
|
5
|
+
* This function does exhaustiveness checking to ensure that you have discriminated a union so that no type remains. Use this to get the typescript compiler to help discover cases that were not considered.
|
|
6
|
+
*/
|
|
7
|
+
function assertNever(value) {
|
|
8
|
+
throw new Error(`Unhandled discriminated union member: ${JSON.stringify(value)}`);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=assertNever.js.map
|