@trapi/swagger 0.3.8 → 1.0.0-alpha.11
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/config/index.d.ts +3 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +25 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/type.d.ts +83 -0
- package/dist/config/type.d.ts.map +1 -0
- package/dist/config/type.js +9 -0
- package/dist/config/type.js.map +1 -0
- package/dist/config/utils.d.ts +3 -0
- package/dist/config/utils.d.ts.map +1 -0
- package/dist/config/utils.js +54 -0
- package/dist/config/utils.js.map +1 -0
- package/dist/constants.d.ts +15 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +27 -0
- package/dist/constants.js.map +1 -0
- package/dist/generator/abstract.d.ts +35 -0
- package/dist/generator/abstract.d.ts.map +1 -0
- package/dist/generator/abstract.js +252 -0
- package/dist/generator/abstract.js.map +1 -0
- package/dist/{specification → generator}/index.d.ts +0 -2
- package/dist/generator/index.d.ts.map +1 -0
- package/dist/{specification → generator}/index.js +1 -3
- package/dist/generator/index.js.map +1 -0
- package/dist/generator/module.d.ts +14 -0
- package/dist/generator/module.d.ts.map +1 -0
- package/dist/generator/module.js +35 -0
- package/dist/generator/module.js.map +1 -0
- package/dist/generator/v2/index.d.ts +2 -0
- package/dist/generator/v2/index.d.ts.map +1 -0
- package/dist/{specification/utils → generator/v2}/index.js +2 -2
- package/dist/generator/v2/index.js.map +1 -0
- package/dist/generator/v2/module.d.ts +25 -0
- package/dist/generator/v2/module.d.ts.map +1 -0
- package/dist/generator/v2/module.js +517 -0
- package/dist/generator/v2/module.js.map +1 -0
- package/dist/generator/v3/index.d.ts +2 -0
- package/dist/generator/v3/index.d.ts.map +1 -0
- package/dist/generator/v3/index.js +24 -0
- package/dist/generator/v3/index.js.map +1 -0
- package/dist/generator/v3/module.d.ts +30 -0
- package/dist/generator/v3/module.d.ts.map +1 -0
- package/dist/generator/v3/module.js +499 -0
- package/dist/generator/v3/module.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/metadata.d.ts +3 -4
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +3 -15
- package/dist/metadata.js.map +1 -1
- package/dist/schema/constants.d.ts +28 -0
- package/dist/schema/constants.d.ts.map +1 -0
- package/dist/schema/constants.js +40 -0
- package/dist/schema/constants.js.map +1 -0
- package/dist/schema/index.d.ts +5 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +27 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/type.d.ts +139 -0
- package/dist/schema/type.d.ts.map +1 -0
- package/dist/schema/type.js.map +1 -0
- package/dist/schema/v2/constants.d.ts +8 -0
- package/dist/schema/v2/constants.d.ts.map +1 -0
- package/dist/schema/v2/constants.js +18 -0
- package/dist/schema/v2/constants.js.map +1 -0
- package/dist/schema/v2/index.d.ts +3 -0
- package/dist/schema/v2/index.d.ts.map +1 -0
- package/dist/{specification/v3 → schema/v2}/index.js +1 -1
- package/dist/schema/v2/index.js.map +1 -0
- package/dist/schema/v2/type.d.ts +116 -0
- package/dist/schema/v2/type.d.ts.map +1 -0
- package/dist/schema/v2/type.js.map +1 -0
- package/dist/schema/v3/constants.d.ts +7 -0
- package/dist/schema/v3/constants.d.ts.map +1 -0
- package/dist/schema/v3/constants.js +17 -0
- package/dist/schema/v3/constants.js.map +1 -0
- package/dist/schema/v3/index.d.ts +3 -0
- package/dist/schema/v3/index.d.ts.map +1 -0
- package/dist/{specification/v2 → schema/v3}/index.js +1 -1
- package/dist/schema/v3/index.js.map +1 -0
- package/dist/schema/v3/type.d.ts +159 -0
- package/dist/schema/v3/type.d.ts.map +1 -0
- package/dist/schema/v3/type.js +9 -0
- package/dist/schema/v3/type.js.map +1 -0
- package/dist/type.d.ts +44 -2
- package/dist/type.d.ts.map +1 -1
- package/dist/utils/character.d.ts +3 -0
- package/dist/utils/character.d.ts.map +1 -0
- package/dist/{specification/utils → utils}/character.js +4 -5
- package/dist/utils/character.js.map +1 -0
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/object.d.ts.map +1 -1
- package/dist/utils/object.js +1 -0
- package/dist/utils/object.js.map +1 -1
- package/dist/utils/value.d.ts +2 -0
- package/dist/utils/value.d.ts.map +1 -0
- package/dist/utils/value.js +26 -0
- package/dist/utils/value.js.map +1 -0
- package/package.json +7 -10
- package/dist/module.d.ts +0 -8
- package/dist/module.d.ts.map +0 -1
- package/dist/module.js +0 -31
- package/dist/module.js.map +0 -1
- package/dist/specification/abstract.d.ts +0 -29
- package/dist/specification/abstract.d.ts.map +0 -1
- package/dist/specification/abstract.js +0 -226
- package/dist/specification/abstract.js.map +0 -1
- package/dist/specification/index.d.ts.map +0 -1
- package/dist/specification/index.js.map +0 -1
- package/dist/specification/module.d.ts +0 -5
- package/dist/specification/module.d.ts.map +0 -1
- package/dist/specification/module.js +0 -29
- package/dist/specification/module.js.map +0 -1
- package/dist/specification/type.d.ts +0 -268
- package/dist/specification/type.d.ts.map +0 -1
- package/dist/specification/type.js +0 -18
- package/dist/specification/type.js.map +0 -1
- package/dist/specification/utils/character.d.ts +0 -3
- package/dist/specification/utils/character.d.ts.map +0 -1
- package/dist/specification/utils/character.js.map +0 -1
- package/dist/specification/utils/index.d.ts +0 -2
- package/dist/specification/utils/index.d.ts.map +0 -1
- package/dist/specification/utils/index.js.map +0 -1
- package/dist/specification/v2/index.d.ts +0 -3
- package/dist/specification/v2/index.d.ts.map +0 -1
- package/dist/specification/v2/index.js.map +0 -1
- package/dist/specification/v2/module.d.ts +0 -24
- package/dist/specification/v2/module.d.ts.map +0 -1
- package/dist/specification/v2/module.js +0 -389
- package/dist/specification/v2/module.js.map +0 -1
- package/dist/specification/v2/type.d.ts +0 -79
- package/dist/specification/v2/type.d.ts.map +0 -1
- package/dist/specification/v2/type.js.map +0 -1
- package/dist/specification/v3/index.d.ts +0 -3
- package/dist/specification/v3/index.d.ts.map +0 -1
- package/dist/specification/v3/index.js.map +0 -1
- package/dist/specification/v3/module.d.ts +0 -25
- package/dist/specification/v3/module.d.ts.map +0 -1
- package/dist/specification/v3/module.js +0 -377
- package/dist/specification/v3/module.js.map +0 -1
- package/dist/specification/v3/type.d.ts +0 -121
- package/dist/specification/v3/type.d.ts.map +0 -1
- package/dist/specification/v3/type.js.map +0 -1
- package/dist/utils/package-json.d.ts +0 -3
- package/dist/utils/package-json.d.ts.map +0 -1
- package/dist/utils/package-json.js +0 -35
- package/dist/utils/package-json.js.map +0 -1
- /package/dist/{specification/v2 → schema}/type.js +0 -0
- /package/dist/{specification/v3 → schema/v2}/type.js +0 -0
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2021.
|
|
4
|
-
* Author Peter Placzek (tada5hi)
|
|
5
|
-
* For the full copyright and license information,
|
|
6
|
-
* view the LICENSE file that was distributed with this source code.
|
|
7
|
-
*/
|
|
8
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
-
}
|
|
14
|
-
Object.defineProperty(o, k2, desc);
|
|
15
|
-
}) : (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
o[k2] = m[k];
|
|
18
|
-
}));
|
|
19
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
-
}) : function(o, v) {
|
|
22
|
-
o["default"] = v;
|
|
23
|
-
});
|
|
24
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
-
if (mod && mod.__esModule) return mod;
|
|
26
|
-
var result = {};
|
|
27
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
-
__setModuleDefault(result, mod);
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
32
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
33
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
34
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
35
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
36
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
37
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.AbstractSpecGenerator = void 0;
|
|
42
|
-
const decorators_1 = require("@trapi/decorators");
|
|
43
|
-
const path = __importStar(require("path"));
|
|
44
|
-
const fs_1 = require("fs");
|
|
45
|
-
const YAML = __importStar(require("yamljs"));
|
|
46
|
-
const utils_1 = require("../utils");
|
|
47
|
-
class AbstractSpecGenerator {
|
|
48
|
-
constructor(metadata, config) {
|
|
49
|
-
this.metadata = metadata;
|
|
50
|
-
this.config = config;
|
|
51
|
-
}
|
|
52
|
-
save() {
|
|
53
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
const spec = this.build();
|
|
55
|
-
const swaggerDir = path.resolve(this.config.outputDirectory);
|
|
56
|
-
yield fs_1.promises.mkdir(swaggerDir, { recursive: true });
|
|
57
|
-
const data = {
|
|
58
|
-
json: {
|
|
59
|
-
path: path.join(swaggerDir, 'swagger.json'),
|
|
60
|
-
name: 'swagger.json',
|
|
61
|
-
content: JSON.stringify(spec, null, '\t'),
|
|
62
|
-
},
|
|
63
|
-
yaml: undefined,
|
|
64
|
-
};
|
|
65
|
-
if (this.config.yaml) {
|
|
66
|
-
data.yaml = {
|
|
67
|
-
path: path.join(swaggerDir, 'swagger.yaml'),
|
|
68
|
-
name: 'swagger.yaml',
|
|
69
|
-
content: YAML.stringify(spec, 1000),
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
const filePromises = [];
|
|
73
|
-
const keys = Object.keys(data);
|
|
74
|
-
for (let i = 0; i < keys.length; i++) {
|
|
75
|
-
if (typeof data[keys[i]] === 'undefined') {
|
|
76
|
-
continue;
|
|
77
|
-
}
|
|
78
|
-
const output = data[keys[i]];
|
|
79
|
-
filePromises.push(fs_1.promises.writeFile(output.path, output.content));
|
|
80
|
-
}
|
|
81
|
-
yield Promise.all(filePromises);
|
|
82
|
-
return data;
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
getMetaData() {
|
|
86
|
-
return this.metadata;
|
|
87
|
-
}
|
|
88
|
-
buildInfo() {
|
|
89
|
-
const info = {
|
|
90
|
-
title: this.config.name || '',
|
|
91
|
-
version: this.config.version || '1.0.0',
|
|
92
|
-
};
|
|
93
|
-
if (this.config.description) {
|
|
94
|
-
info.description = this.config.description;
|
|
95
|
-
}
|
|
96
|
-
if (this.config.license) {
|
|
97
|
-
info.license = { name: this.config.license };
|
|
98
|
-
}
|
|
99
|
-
return info;
|
|
100
|
-
}
|
|
101
|
-
getSwaggerType(type) {
|
|
102
|
-
if ((0, decorators_1.isVoidType)(type)) {
|
|
103
|
-
return {};
|
|
104
|
-
}
|
|
105
|
-
if ((0, decorators_1.isReferenceType)(type)) {
|
|
106
|
-
return this.getSwaggerTypeForReferenceType(type);
|
|
107
|
-
}
|
|
108
|
-
if (type.typeName === 'any' ||
|
|
109
|
-
type.typeName === 'binary' ||
|
|
110
|
-
type.typeName === 'boolean' ||
|
|
111
|
-
type.typeName === 'buffer' ||
|
|
112
|
-
type.typeName === 'byte' ||
|
|
113
|
-
type.typeName === 'date' ||
|
|
114
|
-
type.typeName === 'datetime' ||
|
|
115
|
-
type.typeName === 'double' ||
|
|
116
|
-
type.typeName === 'float' ||
|
|
117
|
-
type.typeName === 'file' ||
|
|
118
|
-
type.typeName === 'integer' ||
|
|
119
|
-
type.typeName === 'long' ||
|
|
120
|
-
type.typeName === 'object' ||
|
|
121
|
-
type.typeName === 'string') {
|
|
122
|
-
return this.getSwaggerTypeForPrimitiveType(type.typeName);
|
|
123
|
-
}
|
|
124
|
-
if ((0, decorators_1.isArrayType)(type)) {
|
|
125
|
-
return this.getSwaggerTypeForArrayType(type);
|
|
126
|
-
}
|
|
127
|
-
if ((0, decorators_1.isEnumType)(type)) {
|
|
128
|
-
return this.getSwaggerTypeForEnumType(type);
|
|
129
|
-
}
|
|
130
|
-
if ((0, decorators_1.isUnionType)(type)) {
|
|
131
|
-
return this.getSwaggerTypeForUnionType(type);
|
|
132
|
-
}
|
|
133
|
-
if ((0, decorators_1.isIntersectionType)(type)) {
|
|
134
|
-
return this.getSwaggerTypeForIntersectionType(type);
|
|
135
|
-
}
|
|
136
|
-
if ((0, decorators_1.isNestedObjectLiteralType)(type)) {
|
|
137
|
-
return this.getSwaggerTypeForObjectLiteral(type);
|
|
138
|
-
}
|
|
139
|
-
return {};
|
|
140
|
-
}
|
|
141
|
-
getSwaggerTypeForUnionType(type) {
|
|
142
|
-
if (type.members.every((subType) => subType.typeName === 'enum')) {
|
|
143
|
-
const mergedEnum = { typeName: 'enum', members: [] };
|
|
144
|
-
type.members.forEach((t) => {
|
|
145
|
-
mergedEnum.members = [...mergedEnum.members, ...t.members];
|
|
146
|
-
});
|
|
147
|
-
return this.getSwaggerTypeForEnumType(mergedEnum);
|
|
148
|
-
}
|
|
149
|
-
if (type.members.length === 2 && type.members.find((typeInUnion) => typeInUnion.typeName === 'enum' && typeInUnion.members.includes(null))) {
|
|
150
|
-
// Backwards compatible representation of dataType or null, $ref does not allow any sibling attributes, so we have to bail out
|
|
151
|
-
const nullEnumIndex = type.members.findIndex((a) => (0, decorators_1.isEnumType)(a) && a.members.includes(null));
|
|
152
|
-
const typeIndex = nullEnumIndex === 1 ? 0 : 1;
|
|
153
|
-
const swaggerType = this.getSwaggerType(type.members[typeIndex]);
|
|
154
|
-
const isRef = (0, utils_1.hasOwnProperty)(swaggerType, '$ref') && !!swaggerType.$ref;
|
|
155
|
-
if (isRef) {
|
|
156
|
-
return { type: 'object' };
|
|
157
|
-
}
|
|
158
|
-
swaggerType['x-nullable'] = true;
|
|
159
|
-
return swaggerType;
|
|
160
|
-
}
|
|
161
|
-
if (type.members.length === 2) {
|
|
162
|
-
let index = type.members.findIndex((member) => (0, decorators_1.isArrayType)(member));
|
|
163
|
-
if (index !== -1) {
|
|
164
|
-
const otherIndex = index === 0 ? 1 : 0;
|
|
165
|
-
if (type.members[index].elementType.typeName === type.members[otherIndex].typeName) {
|
|
166
|
-
return this.getSwaggerType(type.members[otherIndex]);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
index = type.members.findIndex((member) => (0, decorators_1.isAnyType)(member));
|
|
170
|
-
if (index !== -1) {
|
|
171
|
-
const otherIndex = index === 0 ? 1 : 0;
|
|
172
|
-
if ((0, decorators_1.isAnyType)(type.members[index])) {
|
|
173
|
-
return this.getSwaggerType(type.members[otherIndex]);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
return { type: 'object' };
|
|
178
|
-
}
|
|
179
|
-
getSwaggerTypeForPrimitiveType(type) {
|
|
180
|
-
const PrimitiveSwaggerTypeMap = {
|
|
181
|
-
any: {
|
|
182
|
-
// While the any type is discouraged, it does explicitly allows anything, so it should always allow additionalProperties
|
|
183
|
-
additionalProperties: true,
|
|
184
|
-
},
|
|
185
|
-
binary: { type: 'string', format: 'binary' },
|
|
186
|
-
boolean: { type: 'boolean' },
|
|
187
|
-
buffer: { type: 'string', format: 'byte' },
|
|
188
|
-
byte: { type: 'string', format: 'byte' },
|
|
189
|
-
date: { type: 'string', format: 'date' },
|
|
190
|
-
datetime: { type: 'string', format: 'date-time' },
|
|
191
|
-
double: { type: 'number', format: 'double' },
|
|
192
|
-
file: { type: 'string', format: 'binary' },
|
|
193
|
-
float: { type: 'number', format: 'float' },
|
|
194
|
-
integer: { type: 'integer', format: 'int32' },
|
|
195
|
-
long: { type: 'integer', format: 'int64' },
|
|
196
|
-
object: { type: 'object' },
|
|
197
|
-
string: { type: 'string' },
|
|
198
|
-
};
|
|
199
|
-
return PrimitiveSwaggerTypeMap[type];
|
|
200
|
-
}
|
|
201
|
-
getSwaggerTypeForArrayType(arrayType) {
|
|
202
|
-
return { type: 'array', items: this.getSwaggerType(arrayType.elementType) };
|
|
203
|
-
}
|
|
204
|
-
getSwaggerTypeForObjectLiteral(objectLiteral) {
|
|
205
|
-
const properties = this.buildProperties(objectLiteral.properties);
|
|
206
|
-
const additionalProperties = objectLiteral.additionalProperties && this.getSwaggerType(objectLiteral.additionalProperties);
|
|
207
|
-
const required = objectLiteral.properties
|
|
208
|
-
.filter((prop) => prop.required).map((prop) => prop.name);
|
|
209
|
-
// An empty list required: [] is not valid.
|
|
210
|
-
// If all properties are optional, do not specify the required keyword.
|
|
211
|
-
return Object.assign(Object.assign(Object.assign({ properties }, (additionalProperties && { additionalProperties })), (required && required.length && { required })), { type: 'object' });
|
|
212
|
-
}
|
|
213
|
-
determineTypesUsedInEnum(anEnum) {
|
|
214
|
-
return anEnum.reduce((theSet, curr) => {
|
|
215
|
-
if (curr !== null) {
|
|
216
|
-
theSet.add(typeof curr);
|
|
217
|
-
}
|
|
218
|
-
return theSet;
|
|
219
|
-
}, new Set());
|
|
220
|
-
}
|
|
221
|
-
getOperationId(methodName) {
|
|
222
|
-
return methodName.charAt(0).toUpperCase() + methodName.substring(1);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
exports.AbstractSpecGenerator = AbstractSpecGenerator;
|
|
226
|
-
//# sourceMappingURL=abstract.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"abstract.js","sourceRoot":"","sources":["../../src/specification/abstract.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,kDAS2B;AAG3B,2CAA6B;AAC7B,2BAA8B;AAC9B,6CAA+B;AAC/B,oCAA0C;AAO1C,MAAsB,qBAAqB;IAQvC,YAAY,QAAyB,EAAE,MAA4B;QAC/D,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAEY,IAAI;;YACb,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;YAC1B,MAAM,UAAU,GAAW,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;YAErE,MAAM,aAAQ,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAEtD,MAAM,IAAI,GAAuD;gBAC7D,IAAI,EAAE;oBACF,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC;oBAC3C,IAAI,EAAE,cAAc;oBACpB,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;iBAC5C;gBACD,IAAI,EAAE,SAAS;aAClB,CAAC;YAEF,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;gBAClB,IAAI,CAAC,IAAI,GAAG;oBACR,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC;oBAC3C,IAAI,EAAE,cAAc;oBACpB,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE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;AApOD,sDAoOC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/specification/index.ts"],"names":[],"mappings":"AAOA,cAAc,MAAM,CAAC;AACrB,cAAc,MAAM,CAAC;AACrB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/specification/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,uCAAqB;AACrB,uCAAqB;AACrB,6CAA2B;AAC3B,2CAAyB;AACzB,yCAAuB;AACvB,0CAAwB"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { GeneratorOutput, MetadataGenerator } from '@trapi/metadata';
|
|
2
|
-
import { AbstractSpecGenerator } from './abstract';
|
|
3
|
-
import { Specification } from './type';
|
|
4
|
-
export declare function createSpecificationGenerator(metadata: GeneratorOutput | MetadataGenerator, config?: Specification.Config): AbstractSpecGenerator<any, any>;
|
|
5
|
-
//# sourceMappingURL=module.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/specification/module.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAIvC,wBAAgB,4BAA4B,CACxC,QAAQ,EAAE,eAAe,GAAG,iBAAiB,EAC7C,MAAM,GAAE,aAAa,CAAC,MAAW,mCAkBpC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createSpecificationGenerator = void 0;
|
|
4
|
-
/*
|
|
5
|
-
* Copyright (c) 2022-2022.
|
|
6
|
-
* Author Peter Placzek (tada5hi)
|
|
7
|
-
* For the full copyright and license information,
|
|
8
|
-
* view the LICENSE file that was distributed with this source code.
|
|
9
|
-
*/
|
|
10
|
-
const metadata_1 = require("@trapi/metadata");
|
|
11
|
-
const type_1 = require("./type");
|
|
12
|
-
const v2_1 = require("./v2");
|
|
13
|
-
const v3_1 = require("./v3");
|
|
14
|
-
function createSpecificationGenerator(metadata, config = {}) {
|
|
15
|
-
const data = metadata instanceof metadata_1.MetadataGenerator ? metadata.generate() : metadata;
|
|
16
|
-
const outputFormat = config.specification || type_1.Specification.SpecificationOption.V2;
|
|
17
|
-
let specGenerator;
|
|
18
|
-
switch (outputFormat) {
|
|
19
|
-
case type_1.Specification.SpecificationOption.V2:
|
|
20
|
-
specGenerator = new v2_1.Version2SpecGenerator(data, config);
|
|
21
|
-
break;
|
|
22
|
-
case type_1.Specification.SpecificationOption.V3:
|
|
23
|
-
specGenerator = new v3_1.Version3SpecGenerator(data, config);
|
|
24
|
-
break;
|
|
25
|
-
}
|
|
26
|
-
return specGenerator;
|
|
27
|
-
}
|
|
28
|
-
exports.createSpecificationGenerator = createSpecificationGenerator;
|
|
29
|
-
//# sourceMappingURL=module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/specification/module.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,8CAAqE;AAErE,iCAAuC;AACvC,6BAA6C;AAC7C,6BAA6C;AAE7C,SAAgB,4BAA4B,CACxC,QAA6C,EAC7C,SAA+B,EAAE;IAEjC,MAAM,IAAI,GAAoB,QAAQ,YAAY,4BAAiB,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;IAErG,MAAM,YAAY,GAAsC,MAAM,CAAC,aAAa,IAAI,oBAAa,CAAC,mBAAmB,CAAC,EAAE,CAAC;IAErH,IAAI,aAA8C,CAAC;IAEnD,QAAQ,YAAY,EAAE;QAClB,KAAK,oBAAa,CAAC,mBAAmB,CAAC,EAAE;YACrC,aAAa,GAAG,IAAI,0BAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YACxD,MAAM;QACV,KAAK,oBAAa,CAAC,mBAAmB,CAAC,EAAE;YACrC,aAAa,GAAG,IAAI,0BAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YACxD,MAAM;KACb;IAED,OAAO,aAAa,CAAC;AACzB,CAAC;AApBD,oEAoBC"}
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
export declare namespace Specification {
|
|
2
|
-
type DataType = 'void' | 'integer' | 'number' | 'boolean' | 'string' | 'array' | 'object' | 'file';
|
|
3
|
-
type DataFormat = 'int32' | 'int64' | 'float' | 'double' | 'byte' | 'binary' | 'date' | 'date-time' | 'password';
|
|
4
|
-
type Protocol = 'http' | 'https' | 'ws' | 'wss';
|
|
5
|
-
interface BaseSpec {
|
|
6
|
-
info: Info;
|
|
7
|
-
tags?: Tag[];
|
|
8
|
-
externalDocs?: ExternalDocs;
|
|
9
|
-
}
|
|
10
|
-
interface Info {
|
|
11
|
-
title: string;
|
|
12
|
-
version: string;
|
|
13
|
-
description?: string;
|
|
14
|
-
termsOfService?: string;
|
|
15
|
-
contact?: Contact;
|
|
16
|
-
license?: License;
|
|
17
|
-
}
|
|
18
|
-
interface Contact {
|
|
19
|
-
name?: string;
|
|
20
|
-
email?: string;
|
|
21
|
-
url?: string;
|
|
22
|
-
}
|
|
23
|
-
interface License {
|
|
24
|
-
name: string;
|
|
25
|
-
url?: string;
|
|
26
|
-
}
|
|
27
|
-
interface ExternalDocs {
|
|
28
|
-
url: string;
|
|
29
|
-
description?: string;
|
|
30
|
-
}
|
|
31
|
-
interface Tag {
|
|
32
|
-
name: string;
|
|
33
|
-
description?: string;
|
|
34
|
-
externalDocs?: ExternalDocs;
|
|
35
|
-
}
|
|
36
|
-
interface Examples {
|
|
37
|
-
examples?: Record<string, Example>;
|
|
38
|
-
}
|
|
39
|
-
interface Example {
|
|
40
|
-
value: unknown | unknown[];
|
|
41
|
-
summary?: string;
|
|
42
|
-
description?: string;
|
|
43
|
-
}
|
|
44
|
-
interface BaseParameter<T> {
|
|
45
|
-
name: string;
|
|
46
|
-
in: ParameterInType;
|
|
47
|
-
required?: boolean;
|
|
48
|
-
description?: string;
|
|
49
|
-
example?: unknown;
|
|
50
|
-
examples?: Record<string, Example | string>;
|
|
51
|
-
schema: BaseSchema<T>;
|
|
52
|
-
type?: DataType;
|
|
53
|
-
format?: DataFormat;
|
|
54
|
-
deprecated?: boolean;
|
|
55
|
-
}
|
|
56
|
-
interface BodyParameter<T> extends BaseParameter<T> {
|
|
57
|
-
in: 'body';
|
|
58
|
-
}
|
|
59
|
-
interface QueryParameter<T> extends BaseParameter<T> {
|
|
60
|
-
in: 'query';
|
|
61
|
-
allowEmptyValue?: boolean;
|
|
62
|
-
collectionFormat?: CollectionFormat;
|
|
63
|
-
}
|
|
64
|
-
interface PathParameter<T> extends BaseParameter<T> {
|
|
65
|
-
in: 'path';
|
|
66
|
-
}
|
|
67
|
-
interface HeaderParameter<T> extends BaseParameter<T> {
|
|
68
|
-
in: 'header';
|
|
69
|
-
}
|
|
70
|
-
interface FormDataParameter<T> extends BaseParameter<T> {
|
|
71
|
-
in: 'formData';
|
|
72
|
-
collectionFormat?: CollectionFormat;
|
|
73
|
-
}
|
|
74
|
-
type CollectionFormat = 'csv' | 'ssv' | 'tsv' | 'pipes' | 'multi';
|
|
75
|
-
type ParameterInType = 'query' | 'header' | 'path' | 'formData' | 'body';
|
|
76
|
-
type Parameter<T> = BodyParameter<T> | FormDataParameter<T> | QueryParameter<T> | PathParameter<T> | HeaderParameter<T>;
|
|
77
|
-
interface BaseOperation<P, R, S> {
|
|
78
|
-
responses: {
|
|
79
|
-
[name: string]: R;
|
|
80
|
-
};
|
|
81
|
-
summary?: string;
|
|
82
|
-
description?: string;
|
|
83
|
-
externalDocs?: ExternalDocs;
|
|
84
|
-
operationId?: string;
|
|
85
|
-
consumes?: string[];
|
|
86
|
-
parameters?: P[];
|
|
87
|
-
schemes?: string[];
|
|
88
|
-
deprecated?: boolean;
|
|
89
|
-
security?: S[];
|
|
90
|
-
tags?: string[];
|
|
91
|
-
}
|
|
92
|
-
interface BaseResponse {
|
|
93
|
-
description: string;
|
|
94
|
-
}
|
|
95
|
-
interface BaseSchema<T> {
|
|
96
|
-
type?: DataType | any;
|
|
97
|
-
format?: DataFormat;
|
|
98
|
-
title?: string;
|
|
99
|
-
description?: string;
|
|
100
|
-
default?: string | boolean | number | any;
|
|
101
|
-
multipleOf?: number;
|
|
102
|
-
maximum?: number;
|
|
103
|
-
exclusiveMaximum?: number;
|
|
104
|
-
minimum?: number;
|
|
105
|
-
exclusiveMinimum?: number;
|
|
106
|
-
maxLength?: number;
|
|
107
|
-
minLength?: number;
|
|
108
|
-
pattern?: string;
|
|
109
|
-
maxItems?: number;
|
|
110
|
-
minItems?: number;
|
|
111
|
-
uniqueItems?: boolean;
|
|
112
|
-
maxProperties?: number;
|
|
113
|
-
minProperties?: number;
|
|
114
|
-
enum?: Array<string | number>;
|
|
115
|
-
'x-enum-varnames'?: string[];
|
|
116
|
-
items?: T | BaseSchema<T> | any;
|
|
117
|
-
additionalProperties?: boolean | {
|
|
118
|
-
[ref: string]: string;
|
|
119
|
-
} | T;
|
|
120
|
-
properties?: {
|
|
121
|
-
[propertyName: string]: T;
|
|
122
|
-
};
|
|
123
|
-
discriminator?: string;
|
|
124
|
-
readOnly?: boolean;
|
|
125
|
-
xml?: XML;
|
|
126
|
-
externalDocs?: ExternalDocs;
|
|
127
|
-
example?: {
|
|
128
|
-
[exampleName: string]: Example;
|
|
129
|
-
} | unknown;
|
|
130
|
-
required?: string[];
|
|
131
|
-
$ref?: string;
|
|
132
|
-
}
|
|
133
|
-
interface XML {
|
|
134
|
-
type?: string;
|
|
135
|
-
namespace?: string;
|
|
136
|
-
prefix?: string;
|
|
137
|
-
attribute?: string;
|
|
138
|
-
wrapped?: boolean;
|
|
139
|
-
}
|
|
140
|
-
interface BaseSecurity {
|
|
141
|
-
description?: string;
|
|
142
|
-
}
|
|
143
|
-
interface Path<Operation, Parameter> {
|
|
144
|
-
$ref?: string;
|
|
145
|
-
get?: Operation;
|
|
146
|
-
put?: Operation;
|
|
147
|
-
post?: Operation;
|
|
148
|
-
delete?: Operation;
|
|
149
|
-
options?: Operation;
|
|
150
|
-
head?: Operation;
|
|
151
|
-
patch?: Operation;
|
|
152
|
-
parameters?: Parameter[];
|
|
153
|
-
}
|
|
154
|
-
interface Config {
|
|
155
|
-
/**
|
|
156
|
-
* Support the output to be an yaml file
|
|
157
|
-
*/
|
|
158
|
-
yaml?: boolean;
|
|
159
|
-
/**
|
|
160
|
-
* Generated swagger.{json|yaml} will output here
|
|
161
|
-
*/
|
|
162
|
-
outputDirectory?: string;
|
|
163
|
-
/**
|
|
164
|
-
* Generated documentation base file name. Default: swagger
|
|
165
|
-
*/
|
|
166
|
-
outputFileName?: string;
|
|
167
|
-
/**
|
|
168
|
-
* API host, expressTemplate.g. localhost:3000 or https://myapi.com
|
|
169
|
-
*/
|
|
170
|
-
host?: string;
|
|
171
|
-
/**
|
|
172
|
-
* API version number; defaults to npm package version
|
|
173
|
-
*/
|
|
174
|
-
version?: string;
|
|
175
|
-
/**
|
|
176
|
-
* API name; defaults to npm package name
|
|
177
|
-
*/
|
|
178
|
-
name?: string;
|
|
179
|
-
/**
|
|
180
|
-
* 'API description; defaults to npm package description
|
|
181
|
-
*/
|
|
182
|
-
description?: string;
|
|
183
|
-
/**
|
|
184
|
-
* API license; defaults to npm package license
|
|
185
|
-
*/
|
|
186
|
-
license?: string;
|
|
187
|
-
/**
|
|
188
|
-
* Base API path; e.g. the 'v1' in https://myapi.com/v1
|
|
189
|
-
*/
|
|
190
|
-
basePath?: string;
|
|
191
|
-
/**
|
|
192
|
-
* Inform if the generated spec will be in swagger 2.0 format or regarding the open api 3.0 specification.
|
|
193
|
-
*
|
|
194
|
-
* Default: V2
|
|
195
|
-
*/
|
|
196
|
-
specification?: SpecificationOption;
|
|
197
|
-
/**
|
|
198
|
-
* Extend generated swagger spec with this object
|
|
199
|
-
* Note that generated properties will always take precedence over what get specified here
|
|
200
|
-
*/
|
|
201
|
-
specificationExtra?: Record<string, any>;
|
|
202
|
-
/**
|
|
203
|
-
* Security Definitions Object
|
|
204
|
-
* A declaration of the security schemes available to be used in the
|
|
205
|
-
* specification. This does not enforce the security schemes on the operations
|
|
206
|
-
* and only serves to provide the relevant details for each scheme.
|
|
207
|
-
*/
|
|
208
|
-
securityDefinitions?: SecurityDefinitions;
|
|
209
|
-
/**
|
|
210
|
-
* Default consumes property for the entire API
|
|
211
|
-
*/
|
|
212
|
-
consumes?: string[];
|
|
213
|
-
/**
|
|
214
|
-
* Default produces property for the entire API
|
|
215
|
-
*/
|
|
216
|
-
produces?: string[];
|
|
217
|
-
/**
|
|
218
|
-
* Default collectionFormat property for query parameters of array type.
|
|
219
|
-
* Possible values are `csv`, `ssv`, `tsv`, `pipes`, `multi`. If not specified, Swagger defaults to `csv`.
|
|
220
|
-
*/
|
|
221
|
-
collectionFormat?: string;
|
|
222
|
-
}
|
|
223
|
-
enum SpecificationOption {
|
|
224
|
-
V2 = "V2",
|
|
225
|
-
V3 = "V3"
|
|
226
|
-
}
|
|
227
|
-
interface SecurityDefinitions {
|
|
228
|
-
[key: string]: SecurityDefinition;
|
|
229
|
-
}
|
|
230
|
-
type SecurityDefinition = ApiKeySecurity | BasicSecurity | OAuth2Security;
|
|
231
|
-
type SecurityType = 'apiKey' | 'http' | 'oauth2';
|
|
232
|
-
interface ApiKeySecurity extends BaseSecurity {
|
|
233
|
-
type: 'apiKey';
|
|
234
|
-
name: string;
|
|
235
|
-
in: 'query' | 'header';
|
|
236
|
-
}
|
|
237
|
-
interface BasicSecurity extends BaseSecurity {
|
|
238
|
-
type: 'http';
|
|
239
|
-
schema: 'basic';
|
|
240
|
-
}
|
|
241
|
-
interface OAuth2Security extends BaseSecurity {
|
|
242
|
-
type: 'oauth2';
|
|
243
|
-
flows: {
|
|
244
|
-
implicit?: OAuth2ImplicitFlow;
|
|
245
|
-
password?: OAuth2PasswordFlow;
|
|
246
|
-
authorizationCode?: OAuth2AuthorizationCodeFlow;
|
|
247
|
-
clientCredentials?: OAuth2ClientCredentialsFlow;
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
interface Oauth2BaseFlow {
|
|
251
|
-
scopes?: Record<string, string>;
|
|
252
|
-
refreshUrl?: string;
|
|
253
|
-
}
|
|
254
|
-
interface OAuth2ImplicitFlow extends Oauth2BaseFlow {
|
|
255
|
-
authorizationUrl: string;
|
|
256
|
-
}
|
|
257
|
-
interface OAuth2PasswordFlow extends Oauth2BaseFlow {
|
|
258
|
-
tokenUrl: string;
|
|
259
|
-
}
|
|
260
|
-
interface OAuth2AuthorizationCodeFlow extends Oauth2BaseFlow {
|
|
261
|
-
authorizationUrl: string;
|
|
262
|
-
tokenUrl: string;
|
|
263
|
-
}
|
|
264
|
-
interface OAuth2ClientCredentialsFlow extends Oauth2BaseFlow {
|
|
265
|
-
tokenUrl: string;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
//# sourceMappingURL=type.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/specification/type.ts"],"names":[],"mappings":"AAOA,yBAAiB,aAAa,CAAC;IAC3B,KAAY,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAE1G,KAAY,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,CAAC;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zek (tada5hi)
|
|
5
|
-
* For the full copyright and license information,
|
|
6
|
-
* view the LICENSE file that was distributed with this source code.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.Specification = void 0;
|
|
10
|
-
var Specification;
|
|
11
|
-
(function (Specification) {
|
|
12
|
-
let SpecificationOption;
|
|
13
|
-
(function (SpecificationOption) {
|
|
14
|
-
SpecificationOption["V2"] = "V2";
|
|
15
|
-
SpecificationOption["V3"] = "V3";
|
|
16
|
-
})(SpecificationOption = Specification.SpecificationOption || (Specification.SpecificationOption = {}));
|
|
17
|
-
})(Specification = exports.Specification || (exports.Specification = {}));
|
|
18
|
-
//# sourceMappingURL=type.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/specification/type.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,IAAiB,aAAa,CA4T7B;AA5TD,WAAiB,aAAa;IAqQ1B,IAAY,mBAGX;IAHD,WAAY,mBAAmB;QAC3B,gCAAS,CAAA;QACT,gCAAS,CAAA;IACb,CAAC,EAHW,mBAAmB,GAAnB,iCAAmB,KAAnB,iCAAmB,QAG9B;AAoDL,CAAC,EA5TgB,aAAa,GAAb,qBAAa,KAAb,qBAAa,QA4T7B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"character.d.ts","sourceRoot":"","sources":["../../../src/specification/utils/character.ts"],"names":[],"mappings":"AASA,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAI,MAAM,CAEhF;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAMlE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"character.js","sourceRoot":"","sources":["../../../src/specification/utils/character.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,8CAA8C;AAE9C,SAAgB,wBAAwB,CAAC,GAAW,EAAE,SAAiB;IACnE,OAAO,GAAG,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;AAC9C,CAAC;AAFD,4DAEC;AAED,SAAgB,oBAAoB,CAAC,GAAW,EAAE,SAAiB;IAC/D,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,SAAS,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE;QAC/D,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KAC1B;IAED,OAAO,GAAG,CAAC;AACf,CAAC;AAND,oDAMC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/specification/utils/index.ts"],"names":[],"mappings":"AAOA,cAAc,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/specification/utils/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,8CAA4B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/specification/v2/index.ts"],"names":[],"mappings":"AAOA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/specification/v2/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,yCAAuB"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { EnumType, IntersectionType, ReferenceType, ResolverProperty } from '@trapi/decorators';
|
|
2
|
-
import { SpecificationV2 } from './type';
|
|
3
|
-
import { AbstractSpecGenerator } from '../abstract';
|
|
4
|
-
export declare class Version2SpecGenerator extends AbstractSpecGenerator<SpecificationV2.Spec, SpecificationV2.Schema> {
|
|
5
|
-
getSwaggerSpec(): SpecificationV2.Spec;
|
|
6
|
-
build(): SpecificationV2.Spec;
|
|
7
|
-
private static translateSecurityDefinitions;
|
|
8
|
-
private buildDefinitions;
|
|
9
|
-
private decideEnumType;
|
|
10
|
-
private buildPaths;
|
|
11
|
-
private buildPathMethod;
|
|
12
|
-
private buildParameter;
|
|
13
|
-
private handleMethodConsumes;
|
|
14
|
-
private hasFormParams;
|
|
15
|
-
private supportsBodyParameters;
|
|
16
|
-
protected getSwaggerTypeForEnumType(enumType: EnumType): SpecificationV2.Schema;
|
|
17
|
-
protected getSwaggerTypeForIntersectionType(type: IntersectionType): SpecificationV2.Schema;
|
|
18
|
-
protected getSwaggerTypeForReferenceType(referenceType: ReferenceType): SpecificationV2.Schema;
|
|
19
|
-
protected buildProperties(properties: ResolverProperty[]): Record<string, SpecificationV2.Schema>;
|
|
20
|
-
private buildOperation;
|
|
21
|
-
private getMimeType;
|
|
22
|
-
private handleMethodProduces;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=module.d.ts.map
|