@visulima/jsdoc-open-api 3.0.0-alpha.4 → 3.0.0-alpha.6
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/CHANGELOG.md +48 -0
- package/LICENSE.md +1 -1
- package/dist/cli/command/generate-command.d.cts +7 -0
- package/dist/cli/command/generate-command.d.mts +7 -0
- package/dist/cli/command/generate-command.d.ts +7 -0
- package/dist/cli/command/init-command.d.cts +2 -0
- package/dist/cli/command/init-command.d.mts +2 -0
- package/dist/cli/command/init-command.d.ts +2 -0
- package/dist/cli/commander/command/generate-command.d.cts +3 -0
- package/dist/cli/commander/command/generate-command.d.mts +3 -0
- package/dist/cli/commander/command/generate-command.d.ts +3 -0
- package/dist/cli/commander/command/init-command.d.cts +3 -0
- package/dist/cli/commander/command/init-command.d.mts +3 -0
- package/dist/cli/commander/command/init-command.d.ts +3 -0
- package/dist/cli/commander/index.cjs +11 -0
- package/dist/cli/commander/index.d.cts +2 -0
- package/dist/cli/commander/index.d.mts +2 -7
- package/dist/cli/commander/index.d.ts +2 -7
- package/dist/cli/commander/index.mjs +2 -30
- package/dist/cli/index.cjs +11 -0
- package/dist/cli/index.d.cts +2 -0
- package/dist/cli/index.d.mts +2 -10
- package/dist/cli/index.d.ts +2 -10
- package/dist/cli/index.mjs +2 -4
- package/dist/constants.d.cts +1 -0
- package/dist/constants.d.mts +1 -0
- package/dist/constants.d.ts +1 -0
- package/dist/exported.d.cts +198 -0
- package/dist/exported.d.mts +198 -0
- package/dist/exported.d.ts +198 -0
- package/dist/index.cjs +19 -0
- package/dist/index.d.cts +7 -0
- package/dist/index.d.mts +7 -248
- package/dist/index.d.ts +7 -248
- package/dist/index.mjs +6 -85
- package/dist/jsdoc/comments-to-open-api.d.cts +6 -0
- package/dist/jsdoc/comments-to-open-api.d.mts +6 -0
- package/dist/jsdoc/comments-to-open-api.d.ts +6 -0
- package/dist/packem_shared/SpecBuilder-B7YiF7zR.mjs +61 -0
- package/dist/packem_shared/SpecBuilder-CCESkmm5.cjs +63 -0
- package/dist/packem_shared/SwaggerCompilerPlugin-BEbFO9Dt.mjs +86 -0
- package/dist/packem_shared/SwaggerCompilerPlugin-BHbHAPK-.cjs +88 -0
- package/dist/packem_shared/customizer-CoMXMU7a.mjs +8 -0
- package/dist/packem_shared/customizer-DDFwFqJl.cjs +10 -0
- package/dist/packem_shared/generateCommand-B1t3VSDX.mjs +15 -0
- package/dist/packem_shared/generateCommand-CZEFuXr9.mjs +83 -0
- package/dist/packem_shared/generateCommand-CmyavGTZ.cjs +17 -0
- package/dist/packem_shared/generateCommand-Cu0UQUh8.cjs +85 -0
- package/dist/packem_shared/initCommand-B6Z9EXHP.mjs +15 -0
- package/dist/packem_shared/initCommand-Ch-72dKZ.cjs +65 -0
- package/dist/packem_shared/initCommand-D3yVEMwO.cjs +17 -0
- package/dist/packem_shared/initCommand-zE4VRDGW.mjs +63 -0
- package/dist/packem_shared/jsDocumentCommentsToOpenApi-C8kxIQH2.cjs +334 -0
- package/dist/packem_shared/jsDocumentCommentsToOpenApi-eOlxMuMO.mjs +328 -0
- package/dist/packem_shared/parseFile-BJwu_na4.cjs +42 -0
- package/dist/packem_shared/parseFile-Bxis7tbW.mjs +35 -0
- package/dist/packem_shared/swaggerJsDocumentCommentsToOpenApi-Cb5s1J29.mjs +130 -0
- package/dist/packem_shared/swaggerJsDocumentCommentsToOpenApi-JFymRz50.cjs +137 -0
- package/dist/packem_shared/validate-DZHaKH07.mjs +30 -0
- package/dist/packem_shared/validate-FKieC3ln.cjs +37 -0
- package/dist/packem_shared/yamlLoc-BLoIYoXs.cjs +14 -0
- package/dist/packem_shared/yamlLoc-Cmx4vbRt.mjs +12 -0
- package/dist/parse-file.d.cts +9 -0
- package/dist/parse-file.d.mts +9 -0
- package/dist/parse-file.d.ts +9 -0
- package/dist/spec-builder.d.cts +14 -0
- package/dist/spec-builder.d.mts +14 -0
- package/dist/spec-builder.d.ts +14 -0
- package/dist/swagger-jsdoc/comments-to-open-api.d.cts +6 -0
- package/dist/swagger-jsdoc/comments-to-open-api.d.mts +6 -0
- package/dist/swagger-jsdoc/comments-to-open-api.d.ts +6 -0
- package/dist/swagger-jsdoc/organize-swagger-object.d.cts +7 -0
- package/dist/swagger-jsdoc/organize-swagger-object.d.mts +7 -0
- package/dist/swagger-jsdoc/organize-swagger-object.d.ts +7 -0
- package/dist/swagger-jsdoc/utils.d.cts +21 -0
- package/dist/swagger-jsdoc/utils.d.mts +21 -0
- package/dist/swagger-jsdoc/utils.d.ts +21 -0
- package/dist/util/customizer.d.cts +2 -0
- package/dist/util/customizer.d.mts +2 -0
- package/dist/util/customizer.d.ts +2 -0
- package/dist/util/object-merge.d.cts +2 -0
- package/dist/util/object-merge.d.mts +2 -0
- package/dist/util/object-merge.d.ts +2 -0
- package/dist/util/yaml-loc.d.cts +2 -0
- package/dist/util/yaml-loc.d.mts +2 -0
- package/dist/util/yaml-loc.d.ts +2 -0
- package/dist/validate.d.cts +2 -0
- package/dist/validate.d.mts +2 -0
- package/dist/validate.d.ts +2 -0
- package/dist/webpack/swagger-compiler-plugin.d.cts +15 -0
- package/dist/webpack/swagger-compiler-plugin.d.mts +15 -0
- package/dist/webpack/swagger-compiler-plugin.d.ts +15 -0
- package/package.json +33 -20
- package/dist/chunk-2T6HMUIL.mjs +0 -1215
- package/dist/chunk-2T6HMUIL.mjs.map +0 -1
- package/dist/chunk-PTFTJY7I.js +0 -1233
- package/dist/chunk-PTFTJY7I.js.map +0 -1
- package/dist/chunk-RGP6RTJO.mjs +0 -142
- package/dist/chunk-RGP6RTJO.mjs.map +0 -1
- package/dist/chunk-RVCK3H3U.js +0 -149
- package/dist/chunk-RVCK3H3U.js.map +0 -1
- package/dist/cli/commander/index.js +0 -33
- package/dist/cli/commander/index.js.map +0 -1
- package/dist/cli/commander/index.mjs.map +0 -1
- package/dist/cli/index.js +0 -17
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/index.mjs.map +0 -1
- package/dist/index.js +0 -106
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
package/dist/chunk-PTFTJY7I.js
DELETED
|
@@ -1,1233 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var commentParser = require('comment-parser');
|
|
4
|
-
var mergeWith = require('lodash.mergewith');
|
|
5
|
-
var fs = require('fs');
|
|
6
|
-
var path = require('path');
|
|
7
|
-
var yaml = require('yaml');
|
|
8
|
-
var module$1 = require('module');
|
|
9
|
-
var SwaggerParser = require('@apidevtools/swagger-parser');
|
|
10
|
-
|
|
11
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
|
|
13
|
-
var mergeWith__default = /*#__PURE__*/_interopDefault(mergeWith);
|
|
14
|
-
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
15
|
-
var yaml__default = /*#__PURE__*/_interopDefault(yaml);
|
|
16
|
-
var SwaggerParser__default = /*#__PURE__*/_interopDefault(SwaggerParser);
|
|
17
|
-
|
|
18
|
-
// ../../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.13.5_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/cjs_shims.js
|
|
19
|
-
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
20
|
-
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
21
|
-
|
|
22
|
-
// src/util/customizer.ts
|
|
23
|
-
var customizer = (objectValue, sourceValue) => {
|
|
24
|
-
if (Array.isArray(objectValue)) {
|
|
25
|
-
return [...objectValue, ...sourceValue];
|
|
26
|
-
}
|
|
27
|
-
return void 0;
|
|
28
|
-
};
|
|
29
|
-
var customizer_default = customizer;
|
|
30
|
-
|
|
31
|
-
// src/jsdoc/comments-to-open-api.ts
|
|
32
|
-
var fixSecurityObject = (thing) => {
|
|
33
|
-
if (thing.security) {
|
|
34
|
-
thing.security = Object.keys(thing.security).map((s) => {
|
|
35
|
-
return {
|
|
36
|
-
[s]: thing.security[s]
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var primitiveTypes = /* @__PURE__ */ new Set(["array", "boolean", "integer", "number", "object", "string"]);
|
|
42
|
-
var formatMap = {
|
|
43
|
-
binary: "string",
|
|
44
|
-
byte: "string",
|
|
45
|
-
date: "string",
|
|
46
|
-
"date-time": "string",
|
|
47
|
-
double: "number",
|
|
48
|
-
float: "number",
|
|
49
|
-
int32: "integer",
|
|
50
|
-
int64: "integer",
|
|
51
|
-
password: "string"
|
|
52
|
-
};
|
|
53
|
-
var parseDescription = (tag) => {
|
|
54
|
-
const rawType = tag.type;
|
|
55
|
-
const isArray = rawType.endsWith("[]");
|
|
56
|
-
const parsedType = rawType.replace(/\[]$/, "");
|
|
57
|
-
const isPrimitive = primitiveTypes.has(parsedType);
|
|
58
|
-
const isFormat = Object.keys(formatMap).includes(parsedType);
|
|
59
|
-
let defaultValue;
|
|
60
|
-
if (tag.default) {
|
|
61
|
-
switch (parsedType) {
|
|
62
|
-
case "double":
|
|
63
|
-
case "float":
|
|
64
|
-
case "number": {
|
|
65
|
-
defaultValue = Number.parseFloat(tag.default);
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
68
|
-
case "int32":
|
|
69
|
-
case "int64":
|
|
70
|
-
case "integer": {
|
|
71
|
-
defaultValue = Number.parseInt(tag.default, 10);
|
|
72
|
-
break;
|
|
73
|
-
}
|
|
74
|
-
default: {
|
|
75
|
-
defaultValue = tag.default;
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
let rootType;
|
|
81
|
-
if (isPrimitive) {
|
|
82
|
-
rootType = { default: defaultValue, type: parsedType };
|
|
83
|
-
} else if (isFormat) {
|
|
84
|
-
rootType = {
|
|
85
|
-
default: defaultValue,
|
|
86
|
-
format: parsedType,
|
|
87
|
-
type: formatMap[parsedType]
|
|
88
|
-
};
|
|
89
|
-
} else {
|
|
90
|
-
rootType = { $ref: `#/components/schemas/${parsedType}` };
|
|
91
|
-
}
|
|
92
|
-
let schema = isArray ? {
|
|
93
|
-
items: {
|
|
94
|
-
...rootType
|
|
95
|
-
},
|
|
96
|
-
type: "array"
|
|
97
|
-
} : {
|
|
98
|
-
...rootType
|
|
99
|
-
};
|
|
100
|
-
if (parsedType === "") {
|
|
101
|
-
schema = void 0;
|
|
102
|
-
}
|
|
103
|
-
let description = tag.description.trim().replace(/^- /u, "");
|
|
104
|
-
if (description === "") {
|
|
105
|
-
description = void 0;
|
|
106
|
-
}
|
|
107
|
-
return {
|
|
108
|
-
description,
|
|
109
|
-
name: tag.name,
|
|
110
|
-
rawType,
|
|
111
|
-
required: !tag.optional,
|
|
112
|
-
schema
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
var tagsToObjects = (tags, verbose) => tags.map((tag) => {
|
|
116
|
-
const parsedResponse = parseDescription(tag);
|
|
117
|
-
let nameAndDescription = "";
|
|
118
|
-
if (parsedResponse.name) {
|
|
119
|
-
nameAndDescription += parsedResponse.name;
|
|
120
|
-
}
|
|
121
|
-
if (parsedResponse.description) {
|
|
122
|
-
nameAndDescription += ` ${parsedResponse.description.trim()}`;
|
|
123
|
-
}
|
|
124
|
-
switch (tag.tag) {
|
|
125
|
-
case "bodyComponent": {
|
|
126
|
-
return {
|
|
127
|
-
requestBody: {
|
|
128
|
-
$ref: `#/components/requestBodies/${parsedResponse.rawType}`
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
case "bodyContent": {
|
|
133
|
-
return {
|
|
134
|
-
requestBody: {
|
|
135
|
-
content: {
|
|
136
|
-
[parsedResponse.name.replace(String.raw`*\/*`, "*/*")]: {
|
|
137
|
-
schema: parsedResponse.schema
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
case "bodyDescription": {
|
|
144
|
-
return { requestBody: { description: nameAndDescription } };
|
|
145
|
-
}
|
|
146
|
-
case "bodyExample": {
|
|
147
|
-
const [contentType, example] = parsedResponse.name.split(".");
|
|
148
|
-
return {
|
|
149
|
-
requestBody: {
|
|
150
|
-
content: {
|
|
151
|
-
[contentType]: {
|
|
152
|
-
examples: {
|
|
153
|
-
[example]: {
|
|
154
|
-
$ref: `#/components/examples/${parsedResponse.rawType}`
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
case "bodyRequired": {
|
|
163
|
-
return { requestBody: { required: true } };
|
|
164
|
-
}
|
|
165
|
-
case "callback": {
|
|
166
|
-
return {
|
|
167
|
-
callbacks: {
|
|
168
|
-
[parsedResponse.name]: {
|
|
169
|
-
$ref: `#/components/callbacks/${parsedResponse.rawType}`
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
case "cookieParam":
|
|
175
|
-
case "headerParam":
|
|
176
|
-
case "pathParam":
|
|
177
|
-
case "queryParam": {
|
|
178
|
-
return {
|
|
179
|
-
parameters: [
|
|
180
|
-
{
|
|
181
|
-
description: parsedResponse.description,
|
|
182
|
-
in: tag.tag.replace(/Param$/u, ""),
|
|
183
|
-
name: parsedResponse.name,
|
|
184
|
-
required: parsedResponse.required,
|
|
185
|
-
schema: parsedResponse.schema
|
|
186
|
-
}
|
|
187
|
-
]
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
case "deprecated": {
|
|
191
|
-
return { deprecated: true };
|
|
192
|
-
}
|
|
193
|
-
case "description":
|
|
194
|
-
case "operationId":
|
|
195
|
-
case "summary": {
|
|
196
|
-
return { [tag.tag]: nameAndDescription };
|
|
197
|
-
}
|
|
198
|
-
case "externalDocs": {
|
|
199
|
-
return {
|
|
200
|
-
externalDocs: {
|
|
201
|
-
description: parsedResponse.description,
|
|
202
|
-
url: parsedResponse.name
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
case "paramComponent": {
|
|
207
|
-
return {
|
|
208
|
-
parameters: [{ $ref: `#/components/parameters/${parsedResponse.rawType}` }]
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
case "response": {
|
|
212
|
-
return {
|
|
213
|
-
responses: {
|
|
214
|
-
[parsedResponse.name]: {
|
|
215
|
-
description: parsedResponse.description
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
case "responseComponent": {
|
|
221
|
-
return {
|
|
222
|
-
responses: {
|
|
223
|
-
[parsedResponse.name]: {
|
|
224
|
-
$ref: `#/components/responses/${parsedResponse.rawType}`
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
case "responseContent": {
|
|
230
|
-
const [status, contentType] = parsedResponse.name.split(".");
|
|
231
|
-
return {
|
|
232
|
-
responses: {
|
|
233
|
-
[status]: {
|
|
234
|
-
content: {
|
|
235
|
-
[contentType]: {
|
|
236
|
-
schema: parsedResponse.schema
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
case "responseExample": {
|
|
244
|
-
const [status, contentType, example] = parsedResponse.name.split(".");
|
|
245
|
-
return {
|
|
246
|
-
responses: {
|
|
247
|
-
[status]: {
|
|
248
|
-
content: {
|
|
249
|
-
[contentType]: {
|
|
250
|
-
examples: {
|
|
251
|
-
[example]: {
|
|
252
|
-
$ref: `#/components/examples/${parsedResponse.rawType}`
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
case "responseHeader": {
|
|
262
|
-
const [status, header] = parsedResponse.name.split(".");
|
|
263
|
-
return {
|
|
264
|
-
responses: {
|
|
265
|
-
[status]: {
|
|
266
|
-
headers: {
|
|
267
|
-
[header]: {
|
|
268
|
-
description: parsedResponse.description,
|
|
269
|
-
schema: parsedResponse.schema
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
case "responseHeaderComponent": {
|
|
277
|
-
const [status, header] = parsedResponse.name.split(".");
|
|
278
|
-
return {
|
|
279
|
-
responses: {
|
|
280
|
-
[status]: {
|
|
281
|
-
headers: {
|
|
282
|
-
[header]: {
|
|
283
|
-
$ref: `#/components/headers/${parsedResponse.rawType}`
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
case "responseLink": {
|
|
291
|
-
const [status, link] = parsedResponse.name.split(".");
|
|
292
|
-
return {
|
|
293
|
-
responses: {
|
|
294
|
-
[status]: {
|
|
295
|
-
links: {
|
|
296
|
-
[link]: {
|
|
297
|
-
$ref: `#/components/links/${parsedResponse.rawType}`
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
case "security": {
|
|
305
|
-
const [security, scopeItem] = parsedResponse.name.split(".");
|
|
306
|
-
let scope = [];
|
|
307
|
-
if (scopeItem) {
|
|
308
|
-
scope = [scopeItem];
|
|
309
|
-
}
|
|
310
|
-
return {
|
|
311
|
-
security: { [security]: scope }
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
case "server": {
|
|
315
|
-
return {
|
|
316
|
-
servers: [
|
|
317
|
-
{
|
|
318
|
-
description: parsedResponse.description,
|
|
319
|
-
url: parsedResponse.name
|
|
320
|
-
}
|
|
321
|
-
]
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
case "tag": {
|
|
325
|
-
return { tags: [nameAndDescription] };
|
|
326
|
-
}
|
|
327
|
-
default: {
|
|
328
|
-
return {};
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
var commentsToOpenApi = (fileContents, verbose) => {
|
|
333
|
-
const openAPIRegex = /^(GET|PUT|POST|DELETE|OPTIONS|HEAD|PATCH|TRACE) \/.*$/;
|
|
334
|
-
const jsDocumentComments = commentParser.parse(fileContents, { spacing: "preserve" });
|
|
335
|
-
return jsDocumentComments.filter((comment) => openAPIRegex.test(comment.description.trim())).map((comment) => {
|
|
336
|
-
const loc = comment.tags.length + 1;
|
|
337
|
-
const result = mergeWith__default.default({}, ...tagsToObjects(comment.tags), customizer_default);
|
|
338
|
-
fixSecurityObject(result);
|
|
339
|
-
const [method, path2] = comment.description.split(" ");
|
|
340
|
-
const pathsObject = {
|
|
341
|
-
[path2.trim()]: {
|
|
342
|
-
[method.toLowerCase().trim()]: {
|
|
343
|
-
...result
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
};
|
|
347
|
-
const spec = JSON.parse(JSON.stringify({ paths: pathsObject }));
|
|
348
|
-
return {
|
|
349
|
-
loc,
|
|
350
|
-
spec
|
|
351
|
-
};
|
|
352
|
-
});
|
|
353
|
-
};
|
|
354
|
-
var comments_to_open_api_default = commentsToOpenApi;
|
|
355
|
-
|
|
356
|
-
// src/util/yaml-loc.ts
|
|
357
|
-
var yamlLoc = (string) => {
|
|
358
|
-
const split = string.split(/\r\n|\r|\n/u);
|
|
359
|
-
const filtered = split.filter((line) => {
|
|
360
|
-
if (/^\s*(#\s*(?:\S.*)?)?$/u.test(line)) {
|
|
361
|
-
return false;
|
|
362
|
-
}
|
|
363
|
-
return line.trim().length > 0;
|
|
364
|
-
});
|
|
365
|
-
return filtered.length;
|
|
366
|
-
};
|
|
367
|
-
var yaml_loc_default = yamlLoc;
|
|
368
|
-
var ALLOWED_KEYS = /* @__PURE__ */ new Set(["components", "externalDocs", "info", "openapi", "paths", "security", "servers", "tags"]);
|
|
369
|
-
var ParseError = class extends Error {
|
|
370
|
-
filePath;
|
|
371
|
-
};
|
|
372
|
-
var parseFile = (file, commentsToOpenApi3, verbose) => {
|
|
373
|
-
const fileContent = fs.readFileSync(file, { encoding: "utf8" });
|
|
374
|
-
const extension = path__default.default.extname(file);
|
|
375
|
-
if (extension === ".yaml" || extension === ".yml") {
|
|
376
|
-
const spec = yaml__default.default.parse(fileContent);
|
|
377
|
-
const invalidKeys = Object.keys(spec).filter((key) => !ALLOWED_KEYS.has(key));
|
|
378
|
-
if (invalidKeys.length > 0) {
|
|
379
|
-
const error = new ParseError(`Unexpected keys: ${invalidKeys.join(", ")}`);
|
|
380
|
-
error.filePath = file;
|
|
381
|
-
throw error;
|
|
382
|
-
}
|
|
383
|
-
if (Object.keys(spec).some((key) => ALLOWED_KEYS.has(key))) {
|
|
384
|
-
const loc = yaml_loc_default(fileContent);
|
|
385
|
-
return [{ loc, spec }];
|
|
386
|
-
}
|
|
387
|
-
return [];
|
|
388
|
-
}
|
|
389
|
-
try {
|
|
390
|
-
return commentsToOpenApi3(fileContent, verbose);
|
|
391
|
-
} catch (error) {
|
|
392
|
-
error.filePath = file;
|
|
393
|
-
throw error;
|
|
394
|
-
}
|
|
395
|
-
};
|
|
396
|
-
var parse_file_default = parseFile;
|
|
397
|
-
|
|
398
|
-
// src/util/object-merge.ts
|
|
399
|
-
var objectMerge = (a, b) => {
|
|
400
|
-
Object.keys(b).forEach((key) => {
|
|
401
|
-
if (a[key] === void 0) {
|
|
402
|
-
a[key] = {
|
|
403
|
-
...b[key]
|
|
404
|
-
};
|
|
405
|
-
} else {
|
|
406
|
-
Object.keys(b[key]).forEach((subKey) => {
|
|
407
|
-
a[key][subKey] = {
|
|
408
|
-
...a[key][subKey],
|
|
409
|
-
...b[key][subKey]
|
|
410
|
-
};
|
|
411
|
-
});
|
|
412
|
-
}
|
|
413
|
-
});
|
|
414
|
-
};
|
|
415
|
-
var object_merge_default = objectMerge;
|
|
416
|
-
|
|
417
|
-
// src/spec-builder.ts
|
|
418
|
-
var SpecBuilder = class {
|
|
419
|
-
components;
|
|
420
|
-
externalDocs;
|
|
421
|
-
info;
|
|
422
|
-
openapi;
|
|
423
|
-
paths;
|
|
424
|
-
security;
|
|
425
|
-
servers;
|
|
426
|
-
tags;
|
|
427
|
-
constructor(baseDefinition) {
|
|
428
|
-
this.openapi = baseDefinition.openapi;
|
|
429
|
-
this.info = baseDefinition.info;
|
|
430
|
-
this.paths = baseDefinition.paths ?? {};
|
|
431
|
-
if (baseDefinition.servers) {
|
|
432
|
-
this.servers = baseDefinition.servers;
|
|
433
|
-
}
|
|
434
|
-
if (baseDefinition.components) {
|
|
435
|
-
this.components = baseDefinition.components;
|
|
436
|
-
}
|
|
437
|
-
if (baseDefinition.security) {
|
|
438
|
-
this.security = baseDefinition.security;
|
|
439
|
-
}
|
|
440
|
-
if (baseDefinition.tags) {
|
|
441
|
-
this.tags = baseDefinition.tags;
|
|
442
|
-
}
|
|
443
|
-
if (baseDefinition.externalDocs) {
|
|
444
|
-
this.externalDocs = baseDefinition.externalDocs;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
addData(parsedFile) {
|
|
448
|
-
parsedFile.forEach((file) => {
|
|
449
|
-
const { components, paths, ...rest } = file;
|
|
450
|
-
object_merge_default(this, {
|
|
451
|
-
components: components ?? {},
|
|
452
|
-
paths: paths ?? {}
|
|
453
|
-
});
|
|
454
|
-
Object.entries(rest).forEach(([key, value]) => {
|
|
455
|
-
this[key] = value;
|
|
456
|
-
});
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
};
|
|
460
|
-
var spec_builder_default = SpecBuilder;
|
|
461
|
-
var mergeDeep = (first, second) => mergeWith__default.default({}, first, second, (a, b) => b === null ? a : void 0);
|
|
462
|
-
var hasEmptyProperty = (object) => Object.keys(object).map((key) => object[key]).every((keyObject) => typeof keyObject === "object" && Object.keys(keyObject).every((key) => !(key in keyObject)));
|
|
463
|
-
var isTagPresentInTags = (tag, tags) => tags.some((targetTag) => tag.name === targetTag.name);
|
|
464
|
-
var getSwaggerVersionFromSpec = (tag) => {
|
|
465
|
-
switch (tag.tag) {
|
|
466
|
-
case "asyncapi": {
|
|
467
|
-
return "v4";
|
|
468
|
-
}
|
|
469
|
-
case "openapi": {
|
|
470
|
-
return "v3";
|
|
471
|
-
}
|
|
472
|
-
case "swagger": {
|
|
473
|
-
return "v2";
|
|
474
|
-
}
|
|
475
|
-
default: {
|
|
476
|
-
return "v2";
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
};
|
|
480
|
-
|
|
481
|
-
// src/swagger-jsdoc/organize-swagger-object.ts
|
|
482
|
-
var organizeSwaggerObject = (swaggerObject, annotation, property) => {
|
|
483
|
-
if (property === "x-webhooks") {
|
|
484
|
-
swaggerObject[property] = annotation[property];
|
|
485
|
-
}
|
|
486
|
-
if (property.startsWith("x-")) {
|
|
487
|
-
return;
|
|
488
|
-
}
|
|
489
|
-
const commonProperties = [
|
|
490
|
-
"components",
|
|
491
|
-
"consumes",
|
|
492
|
-
"produces",
|
|
493
|
-
"paths",
|
|
494
|
-
"schemas",
|
|
495
|
-
"securityDefinitions",
|
|
496
|
-
"responses",
|
|
497
|
-
"parameters",
|
|
498
|
-
"definitions",
|
|
499
|
-
"channels"
|
|
500
|
-
];
|
|
501
|
-
if (commonProperties.includes(property)) {
|
|
502
|
-
Object.keys(annotation[property]).forEach((definition) => {
|
|
503
|
-
swaggerObject[property][definition] = mergeDeep(swaggerObject[property][definition], annotation[property][definition]);
|
|
504
|
-
});
|
|
505
|
-
} else if (property === "tags") {
|
|
506
|
-
const { tags } = annotation;
|
|
507
|
-
if (Array.isArray(tags)) {
|
|
508
|
-
tags.forEach((tag) => {
|
|
509
|
-
if (!isTagPresentInTags(tag, swaggerObject.tags)) {
|
|
510
|
-
swaggerObject.tags.push(tag);
|
|
511
|
-
}
|
|
512
|
-
});
|
|
513
|
-
} else if (!isTagPresentInTags(tags, swaggerObject.tags)) {
|
|
514
|
-
swaggerObject.tags.push(tags);
|
|
515
|
-
}
|
|
516
|
-
} else if (property === "security") {
|
|
517
|
-
const { security } = annotation;
|
|
518
|
-
swaggerObject.security = security;
|
|
519
|
-
} else if (property.startsWith("/")) {
|
|
520
|
-
swaggerObject.paths[property] = mergeDeep(swaggerObject.paths[property], annotation[property]);
|
|
521
|
-
}
|
|
522
|
-
};
|
|
523
|
-
var organize_swagger_object_default = organizeSwaggerObject;
|
|
524
|
-
|
|
525
|
-
// src/swagger-jsdoc/comments-to-open-api.ts
|
|
526
|
-
var specificationTemplate = {
|
|
527
|
-
v2: ["paths", "definitions", "responses", "parameters", "securityDefinitions"],
|
|
528
|
-
v3: ["paths", "definitions", "responses", "parameters", "securityDefinitions", "components"],
|
|
529
|
-
v4: ["components", "channels"]
|
|
530
|
-
};
|
|
531
|
-
var tagsToObjects2 = (specs, verbose) => specs.map((spec) => {
|
|
532
|
-
const hasContent = spec.description !== "" || spec.name !== void 0 && (spec.name.startsWith("/") || spec.name.endsWith(":"));
|
|
533
|
-
if ((spec.tag === "openapi" || spec.tag === "swagger" || spec.tag === "asyncapi") && hasContent) {
|
|
534
|
-
let yamlContent = spec.description;
|
|
535
|
-
if (spec.name !== void 0 && (spec.name.startsWith("/") || spec.name.endsWith(":"))) {
|
|
536
|
-
if (yamlContent.trim() === "") {
|
|
537
|
-
yamlContent = spec.name;
|
|
538
|
-
} else {
|
|
539
|
-
yamlContent = `${spec.name}
|
|
540
|
-
${yamlContent}`;
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
const parsed = yaml__default.default.parseDocument(yamlContent);
|
|
544
|
-
if (parsed.errors.length > 0) {
|
|
545
|
-
parsed.errors.map((error) => {
|
|
546
|
-
const newError = error;
|
|
547
|
-
newError.annotation = yamlContent;
|
|
548
|
-
return newError;
|
|
549
|
-
});
|
|
550
|
-
let errorString = "Error parsing YAML in @openapi spec:";
|
|
551
|
-
errorString += verbose ? parsed.errors.map(
|
|
552
|
-
(error) => `${error.toString()}
|
|
553
|
-
Imbedded within:
|
|
554
|
-
\`\`\`
|
|
555
|
-
${error.annotation?.replaceAll("\n", "\n ")}
|
|
556
|
-
\`\`\``
|
|
557
|
-
).join("\n") : parsed.errors.map((error) => error.toString()).join("\n");
|
|
558
|
-
throw new Error(errorString);
|
|
559
|
-
}
|
|
560
|
-
const parsedDocument = parsed.toJSON();
|
|
561
|
-
const specification = {
|
|
562
|
-
tags: []
|
|
563
|
-
};
|
|
564
|
-
specificationTemplate[getSwaggerVersionFromSpec(spec)].forEach((property) => {
|
|
565
|
-
specification[property] = specification[property] || {};
|
|
566
|
-
});
|
|
567
|
-
Object.keys(parsedDocument).forEach((property) => {
|
|
568
|
-
organize_swagger_object_default(specification, parsedDocument, property);
|
|
569
|
-
});
|
|
570
|
-
return specification;
|
|
571
|
-
}
|
|
572
|
-
return {};
|
|
573
|
-
});
|
|
574
|
-
var commentsToOpenApi2 = (fileContents, verbose) => {
|
|
575
|
-
const jsDocumentComments = commentParser.parse(fileContents, { spacing: "preserve" });
|
|
576
|
-
return jsDocumentComments.map((comment) => {
|
|
577
|
-
const loc = comment.tags.length + 1;
|
|
578
|
-
const result = mergeWith__default.default({}, ...tagsToObjects2(comment.tags, verbose), customizer_default);
|
|
579
|
-
["definitions", "responses", "parameters", "securityDefinitions", "components", "tags"].forEach((property) => {
|
|
580
|
-
if (result[property] !== void 0 && hasEmptyProperty(result[property])) {
|
|
581
|
-
delete result[property];
|
|
582
|
-
}
|
|
583
|
-
});
|
|
584
|
-
const spec = JSON.parse(JSON.stringify(result));
|
|
585
|
-
return {
|
|
586
|
-
loc,
|
|
587
|
-
spec
|
|
588
|
-
};
|
|
589
|
-
});
|
|
590
|
-
};
|
|
591
|
-
var comments_to_open_api_default2 = commentsToOpenApi2;
|
|
592
|
-
|
|
593
|
-
// ../../filesystem/path/dist/packem_shared/path-CR6YkPXX.js
|
|
594
|
-
var DRIVE_LETTER_START_RE = /^[A-Z]:\//i;
|
|
595
|
-
var normalizeWindowsPath = (input = "") => {
|
|
596
|
-
if (!input) {
|
|
597
|
-
return input;
|
|
598
|
-
}
|
|
599
|
-
return input.replaceAll("\\", "/").replace(DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
600
|
-
};
|
|
601
|
-
var UNC_REGEX = /^[/\\]{2}/;
|
|
602
|
-
var IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i;
|
|
603
|
-
var DRIVE_LETTER_RE = /^[A-Z]:$/i;
|
|
604
|
-
var cwd = () => {
|
|
605
|
-
if (typeof process.cwd === "function") {
|
|
606
|
-
return process.cwd().replaceAll("\\", "/");
|
|
607
|
-
}
|
|
608
|
-
return "/";
|
|
609
|
-
};
|
|
610
|
-
/^win/i.test(globalThis.process?.platform) ? ";" : ":";
|
|
611
|
-
var normalizeString = (path2, allowAboveRoot) => {
|
|
612
|
-
let result = "";
|
|
613
|
-
let lastSegmentLength = 0;
|
|
614
|
-
let lastSlash = -1;
|
|
615
|
-
let dots = 0;
|
|
616
|
-
let char;
|
|
617
|
-
for (let index = 0; index <= path2.length; ++index) {
|
|
618
|
-
if (index < path2.length) {
|
|
619
|
-
char = path2[index];
|
|
620
|
-
} else if (char === "/") {
|
|
621
|
-
break;
|
|
622
|
-
} else {
|
|
623
|
-
char = "/";
|
|
624
|
-
}
|
|
625
|
-
if (char === "/") {
|
|
626
|
-
if (lastSlash === index - 1 || dots === 1) ;
|
|
627
|
-
else if (dots === 2) {
|
|
628
|
-
if (result.length < 2 || lastSegmentLength !== 2 || !result.endsWith(".") || result.at(-2) !== ".") {
|
|
629
|
-
if (result.length > 2) {
|
|
630
|
-
const lastSlashIndex = result.lastIndexOf("/");
|
|
631
|
-
if (lastSlashIndex === -1) {
|
|
632
|
-
result = "";
|
|
633
|
-
lastSegmentLength = 0;
|
|
634
|
-
} else {
|
|
635
|
-
result = result.slice(0, lastSlashIndex);
|
|
636
|
-
lastSegmentLength = result.length - 1 - result.lastIndexOf("/");
|
|
637
|
-
}
|
|
638
|
-
lastSlash = index;
|
|
639
|
-
dots = 0;
|
|
640
|
-
continue;
|
|
641
|
-
} else if (result.length > 0) {
|
|
642
|
-
result = "";
|
|
643
|
-
lastSegmentLength = 0;
|
|
644
|
-
lastSlash = index;
|
|
645
|
-
dots = 0;
|
|
646
|
-
continue;
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
if (allowAboveRoot) {
|
|
650
|
-
result += result.length > 0 ? "/.." : "..";
|
|
651
|
-
lastSegmentLength = 2;
|
|
652
|
-
}
|
|
653
|
-
} else {
|
|
654
|
-
if (result.length > 0) {
|
|
655
|
-
result += `/${path2.slice(lastSlash + 1, index)}`;
|
|
656
|
-
} else {
|
|
657
|
-
result = path2.slice(lastSlash + 1, index);
|
|
658
|
-
}
|
|
659
|
-
lastSegmentLength = index - lastSlash - 1;
|
|
660
|
-
}
|
|
661
|
-
lastSlash = index;
|
|
662
|
-
dots = 0;
|
|
663
|
-
} else if (char === "." && dots !== -1) {
|
|
664
|
-
++dots;
|
|
665
|
-
} else {
|
|
666
|
-
dots = -1;
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
return result;
|
|
670
|
-
};
|
|
671
|
-
var isAbsolute = (path2) => IS_ABSOLUTE_RE.test(path2);
|
|
672
|
-
var normalize = function(path2) {
|
|
673
|
-
if (path2.length === 0) {
|
|
674
|
-
return ".";
|
|
675
|
-
}
|
|
676
|
-
path2 = normalizeWindowsPath(path2);
|
|
677
|
-
const isUNCPath = UNC_REGEX.exec(path2);
|
|
678
|
-
const isPathAbsolute = isAbsolute(path2);
|
|
679
|
-
const trailingSeparator = path2.at(-1) === "/";
|
|
680
|
-
path2 = normalizeString(path2, !isPathAbsolute);
|
|
681
|
-
if (path2.length === 0) {
|
|
682
|
-
if (isPathAbsolute) {
|
|
683
|
-
return "/";
|
|
684
|
-
}
|
|
685
|
-
return trailingSeparator ? "./" : ".";
|
|
686
|
-
}
|
|
687
|
-
if (trailingSeparator) {
|
|
688
|
-
path2 += "/";
|
|
689
|
-
}
|
|
690
|
-
if (DRIVE_LETTER_RE.test(path2)) {
|
|
691
|
-
path2 += "/";
|
|
692
|
-
}
|
|
693
|
-
if (isUNCPath) {
|
|
694
|
-
if (!isPathAbsolute) {
|
|
695
|
-
return `//./${path2}`;
|
|
696
|
-
}
|
|
697
|
-
return `//${path2}`;
|
|
698
|
-
}
|
|
699
|
-
return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
|
|
700
|
-
};
|
|
701
|
-
var join = (...segments) => {
|
|
702
|
-
let path2 = "";
|
|
703
|
-
for (const seg of segments) {
|
|
704
|
-
if (!seg) {
|
|
705
|
-
continue;
|
|
706
|
-
}
|
|
707
|
-
if (path2.length > 0) {
|
|
708
|
-
const pathTrailing = path2[path2.length - 1] === "/";
|
|
709
|
-
const segLeading = seg[0] === "/";
|
|
710
|
-
const both = pathTrailing && segLeading;
|
|
711
|
-
if (both) {
|
|
712
|
-
path2 += seg.slice(1);
|
|
713
|
-
} else {
|
|
714
|
-
path2 += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
715
|
-
}
|
|
716
|
-
} else {
|
|
717
|
-
path2 += seg;
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
return normalize(path2);
|
|
721
|
-
};
|
|
722
|
-
var resolve = function(...arguments_) {
|
|
723
|
-
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
724
|
-
let resolvedPath = "";
|
|
725
|
-
let resolvedAbsolute = false;
|
|
726
|
-
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
727
|
-
const path2 = index >= 0 ? arguments_[index] : cwd();
|
|
728
|
-
if (!path2 || path2.length === 0) {
|
|
729
|
-
continue;
|
|
730
|
-
}
|
|
731
|
-
resolvedPath = `${path2}/${resolvedPath}`;
|
|
732
|
-
resolvedAbsolute = isAbsolute(path2);
|
|
733
|
-
}
|
|
734
|
-
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
735
|
-
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
|
736
|
-
return `/${resolvedPath}`;
|
|
737
|
-
}
|
|
738
|
-
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
739
|
-
};
|
|
740
|
-
var basename = (path2, extension) => {
|
|
741
|
-
const lastSegment = normalizeWindowsPath(path2).split("/").pop();
|
|
742
|
-
return lastSegment;
|
|
743
|
-
};
|
|
744
|
-
var __cjs_require = module$1.createRequire(importMetaUrl);
|
|
745
|
-
var __cjs_getProcess = typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" ? globalThis.process : process;
|
|
746
|
-
var __cjs_getBuiltinModule = (module) => {
|
|
747
|
-
if (typeof __cjs_getProcess !== "undefined" && __cjs_getProcess.versions && __cjs_getProcess.versions.node) {
|
|
748
|
-
const [major, minor] = __cjs_getProcess.versions.node.split(".").map(Number);
|
|
749
|
-
if (major > 22 || major === 22 && minor >= 3 || major === 20 && minor >= 16) {
|
|
750
|
-
return __cjs_getProcess.getBuiltinModule(module);
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
return __cjs_require(module);
|
|
754
|
-
};
|
|
755
|
-
var {
|
|
756
|
-
fileURLToPath
|
|
757
|
-
} = __cjs_getBuiltinModule("node:url");
|
|
758
|
-
function getDefaultExportFromCjs(x) {
|
|
759
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
760
|
-
}
|
|
761
|
-
var binaryExtensions$1;
|
|
762
|
-
var hasRequiredBinaryExtensions;
|
|
763
|
-
function requireBinaryExtensions() {
|
|
764
|
-
if (hasRequiredBinaryExtensions) return binaryExtensions$1;
|
|
765
|
-
hasRequiredBinaryExtensions = 1;
|
|
766
|
-
binaryExtensions$1 = [
|
|
767
|
-
"3dm",
|
|
768
|
-
"3ds",
|
|
769
|
-
"3g2",
|
|
770
|
-
"3gp",
|
|
771
|
-
"7z",
|
|
772
|
-
"a",
|
|
773
|
-
"aac",
|
|
774
|
-
"adp",
|
|
775
|
-
"afdesign",
|
|
776
|
-
"afphoto",
|
|
777
|
-
"afpub",
|
|
778
|
-
"ai",
|
|
779
|
-
"aif",
|
|
780
|
-
"aiff",
|
|
781
|
-
"alz",
|
|
782
|
-
"ape",
|
|
783
|
-
"apk",
|
|
784
|
-
"appimage",
|
|
785
|
-
"ar",
|
|
786
|
-
"arj",
|
|
787
|
-
"asf",
|
|
788
|
-
"au",
|
|
789
|
-
"avi",
|
|
790
|
-
"bak",
|
|
791
|
-
"baml",
|
|
792
|
-
"bh",
|
|
793
|
-
"bin",
|
|
794
|
-
"bk",
|
|
795
|
-
"bmp",
|
|
796
|
-
"btif",
|
|
797
|
-
"bz2",
|
|
798
|
-
"bzip2",
|
|
799
|
-
"cab",
|
|
800
|
-
"caf",
|
|
801
|
-
"cgm",
|
|
802
|
-
"class",
|
|
803
|
-
"cmx",
|
|
804
|
-
"cpio",
|
|
805
|
-
"cr2",
|
|
806
|
-
"cr3",
|
|
807
|
-
"cur",
|
|
808
|
-
"dat",
|
|
809
|
-
"dcm",
|
|
810
|
-
"deb",
|
|
811
|
-
"dex",
|
|
812
|
-
"djvu",
|
|
813
|
-
"dll",
|
|
814
|
-
"dmg",
|
|
815
|
-
"dng",
|
|
816
|
-
"doc",
|
|
817
|
-
"docm",
|
|
818
|
-
"docx",
|
|
819
|
-
"dot",
|
|
820
|
-
"dotm",
|
|
821
|
-
"dra",
|
|
822
|
-
"DS_Store",
|
|
823
|
-
"dsk",
|
|
824
|
-
"dts",
|
|
825
|
-
"dtshd",
|
|
826
|
-
"dvb",
|
|
827
|
-
"dwg",
|
|
828
|
-
"dxf",
|
|
829
|
-
"ecelp4800",
|
|
830
|
-
"ecelp7470",
|
|
831
|
-
"ecelp9600",
|
|
832
|
-
"egg",
|
|
833
|
-
"eol",
|
|
834
|
-
"eot",
|
|
835
|
-
"epub",
|
|
836
|
-
"exe",
|
|
837
|
-
"f4v",
|
|
838
|
-
"fbs",
|
|
839
|
-
"fh",
|
|
840
|
-
"fla",
|
|
841
|
-
"flac",
|
|
842
|
-
"flatpak",
|
|
843
|
-
"fli",
|
|
844
|
-
"flv",
|
|
845
|
-
"fpx",
|
|
846
|
-
"fst",
|
|
847
|
-
"fvt",
|
|
848
|
-
"g3",
|
|
849
|
-
"gh",
|
|
850
|
-
"gif",
|
|
851
|
-
"graffle",
|
|
852
|
-
"gz",
|
|
853
|
-
"gzip",
|
|
854
|
-
"h261",
|
|
855
|
-
"h263",
|
|
856
|
-
"h264",
|
|
857
|
-
"icns",
|
|
858
|
-
"ico",
|
|
859
|
-
"ief",
|
|
860
|
-
"img",
|
|
861
|
-
"ipa",
|
|
862
|
-
"iso",
|
|
863
|
-
"jar",
|
|
864
|
-
"jpeg",
|
|
865
|
-
"jpg",
|
|
866
|
-
"jpgv",
|
|
867
|
-
"jpm",
|
|
868
|
-
"jxr",
|
|
869
|
-
"key",
|
|
870
|
-
"ktx",
|
|
871
|
-
"lha",
|
|
872
|
-
"lib",
|
|
873
|
-
"lvp",
|
|
874
|
-
"lz",
|
|
875
|
-
"lzh",
|
|
876
|
-
"lzma",
|
|
877
|
-
"lzo",
|
|
878
|
-
"m3u",
|
|
879
|
-
"m4a",
|
|
880
|
-
"m4v",
|
|
881
|
-
"mar",
|
|
882
|
-
"mdi",
|
|
883
|
-
"mht",
|
|
884
|
-
"mid",
|
|
885
|
-
"midi",
|
|
886
|
-
"mj2",
|
|
887
|
-
"mka",
|
|
888
|
-
"mkv",
|
|
889
|
-
"mmr",
|
|
890
|
-
"mng",
|
|
891
|
-
"mobi",
|
|
892
|
-
"mov",
|
|
893
|
-
"movie",
|
|
894
|
-
"mp3",
|
|
895
|
-
"mp4",
|
|
896
|
-
"mp4a",
|
|
897
|
-
"mpeg",
|
|
898
|
-
"mpg",
|
|
899
|
-
"mpga",
|
|
900
|
-
"mxu",
|
|
901
|
-
"nef",
|
|
902
|
-
"npx",
|
|
903
|
-
"numbers",
|
|
904
|
-
"nupkg",
|
|
905
|
-
"o",
|
|
906
|
-
"odp",
|
|
907
|
-
"ods",
|
|
908
|
-
"odt",
|
|
909
|
-
"oga",
|
|
910
|
-
"ogg",
|
|
911
|
-
"ogv",
|
|
912
|
-
"otf",
|
|
913
|
-
"ott",
|
|
914
|
-
"pages",
|
|
915
|
-
"pbm",
|
|
916
|
-
"pcx",
|
|
917
|
-
"pdb",
|
|
918
|
-
"pdf",
|
|
919
|
-
"pea",
|
|
920
|
-
"pgm",
|
|
921
|
-
"pic",
|
|
922
|
-
"png",
|
|
923
|
-
"pnm",
|
|
924
|
-
"pot",
|
|
925
|
-
"potm",
|
|
926
|
-
"potx",
|
|
927
|
-
"ppa",
|
|
928
|
-
"ppam",
|
|
929
|
-
"ppm",
|
|
930
|
-
"pps",
|
|
931
|
-
"ppsm",
|
|
932
|
-
"ppsx",
|
|
933
|
-
"ppt",
|
|
934
|
-
"pptm",
|
|
935
|
-
"pptx",
|
|
936
|
-
"psd",
|
|
937
|
-
"pya",
|
|
938
|
-
"pyc",
|
|
939
|
-
"pyo",
|
|
940
|
-
"pyv",
|
|
941
|
-
"qt",
|
|
942
|
-
"rar",
|
|
943
|
-
"ras",
|
|
944
|
-
"raw",
|
|
945
|
-
"resources",
|
|
946
|
-
"rgb",
|
|
947
|
-
"rip",
|
|
948
|
-
"rlc",
|
|
949
|
-
"rmf",
|
|
950
|
-
"rmvb",
|
|
951
|
-
"rpm",
|
|
952
|
-
"rtf",
|
|
953
|
-
"rz",
|
|
954
|
-
"s3m",
|
|
955
|
-
"s7z",
|
|
956
|
-
"scpt",
|
|
957
|
-
"sgi",
|
|
958
|
-
"shar",
|
|
959
|
-
"snap",
|
|
960
|
-
"sil",
|
|
961
|
-
"sketch",
|
|
962
|
-
"slk",
|
|
963
|
-
"smv",
|
|
964
|
-
"snk",
|
|
965
|
-
"so",
|
|
966
|
-
"stl",
|
|
967
|
-
"suo",
|
|
968
|
-
"sub",
|
|
969
|
-
"swf",
|
|
970
|
-
"tar",
|
|
971
|
-
"tbz",
|
|
972
|
-
"tbz2",
|
|
973
|
-
"tga",
|
|
974
|
-
"tgz",
|
|
975
|
-
"thmx",
|
|
976
|
-
"tif",
|
|
977
|
-
"tiff",
|
|
978
|
-
"tlz",
|
|
979
|
-
"ttc",
|
|
980
|
-
"ttf",
|
|
981
|
-
"txz",
|
|
982
|
-
"udf",
|
|
983
|
-
"uvh",
|
|
984
|
-
"uvi",
|
|
985
|
-
"uvm",
|
|
986
|
-
"uvp",
|
|
987
|
-
"uvs",
|
|
988
|
-
"uvu",
|
|
989
|
-
"viv",
|
|
990
|
-
"vob",
|
|
991
|
-
"war",
|
|
992
|
-
"wav",
|
|
993
|
-
"wax",
|
|
994
|
-
"wbmp",
|
|
995
|
-
"wdp",
|
|
996
|
-
"weba",
|
|
997
|
-
"webm",
|
|
998
|
-
"webp",
|
|
999
|
-
"whl",
|
|
1000
|
-
"wim",
|
|
1001
|
-
"wm",
|
|
1002
|
-
"wma",
|
|
1003
|
-
"wmv",
|
|
1004
|
-
"wmx",
|
|
1005
|
-
"woff",
|
|
1006
|
-
"woff2",
|
|
1007
|
-
"wrm",
|
|
1008
|
-
"wvx",
|
|
1009
|
-
"xbm",
|
|
1010
|
-
"xif",
|
|
1011
|
-
"xla",
|
|
1012
|
-
"xlam",
|
|
1013
|
-
"xls",
|
|
1014
|
-
"xlsb",
|
|
1015
|
-
"xlsm",
|
|
1016
|
-
"xlsx",
|
|
1017
|
-
"xlt",
|
|
1018
|
-
"xltm",
|
|
1019
|
-
"xltx",
|
|
1020
|
-
"xm",
|
|
1021
|
-
"xmind",
|
|
1022
|
-
"xpi",
|
|
1023
|
-
"xpm",
|
|
1024
|
-
"xwd",
|
|
1025
|
-
"xz",
|
|
1026
|
-
"z",
|
|
1027
|
-
"zip",
|
|
1028
|
-
"zipx"
|
|
1029
|
-
];
|
|
1030
|
-
return binaryExtensions$1;
|
|
1031
|
-
}
|
|
1032
|
-
var binaryExtensionsExports = /* @__PURE__ */ requireBinaryExtensions();
|
|
1033
|
-
var binaryExtensions = /* @__PURE__ */ getDefaultExportFromCjs(binaryExtensionsExports);
|
|
1034
|
-
new Set(binaryExtensions);
|
|
1035
|
-
var toPath = (urlOrPath) => normalizeWindowsPath(urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath);
|
|
1036
|
-
|
|
1037
|
-
// ../../filesystem/fs/dist/packem_shared/WalkError-DUdQd6FT.js
|
|
1038
|
-
var WalkError = class extends Error {
|
|
1039
|
-
/** File path of the root that's being walked. */
|
|
1040
|
-
root;
|
|
1041
|
-
/**
|
|
1042
|
-
* Constructs a new instance.
|
|
1043
|
-
* @param cause The underlying error or reason for the walk failure.
|
|
1044
|
-
* @param root The root directory path where the walk operation started or encountered the error.
|
|
1045
|
-
*/
|
|
1046
|
-
constructor(cause, root) {
|
|
1047
|
-
super(`${cause instanceof Error ? cause.message : cause} for path "${root}"`);
|
|
1048
|
-
this.cause = cause;
|
|
1049
|
-
this.root = root;
|
|
1050
|
-
}
|
|
1051
|
-
// eslint-disable-next-line class-methods-use-this
|
|
1052
|
-
get name() {
|
|
1053
|
-
return "WalkError";
|
|
1054
|
-
}
|
|
1055
|
-
// eslint-disable-next-line class-methods-use-this,@typescript-eslint/explicit-module-boundary-types
|
|
1056
|
-
set name(_name) {
|
|
1057
|
-
throw new Error("Cannot overwrite name of WalkError");
|
|
1058
|
-
}
|
|
1059
|
-
};
|
|
1060
|
-
|
|
1061
|
-
// ../../filesystem/fs/dist/packem_shared/assertValidFileOrDirectoryPath-8HANmVjk.js
|
|
1062
|
-
var assertValidFileOrDirectoryPath = (fileOrDirectoryPath) => {
|
|
1063
|
-
if (!fileOrDirectoryPath || !(fileOrDirectoryPath instanceof URL) && typeof fileOrDirectoryPath !== "string") {
|
|
1064
|
-
throw new TypeError("Path must be a non-empty string or URL.");
|
|
1065
|
-
}
|
|
1066
|
-
};
|
|
1067
|
-
|
|
1068
|
-
// ../../filesystem/fs/dist/packem_shared/walk-include-CZco7BvN.js
|
|
1069
|
-
var globToRegExp = (glob) => {
|
|
1070
|
-
const reString = glob.replace(/\.\*/g, ".([^/]*)").replace(/\*\*/g, "(.*)").replace(/(?<!\.)\*(?!\*)/g, "([^/]*)").replace(/\?/g, "[^/]").replace(/\.(?!\*)/g, String.raw`\.`).replace(/\{/g, "(").replace(/\}/g, ")").replace(/,/g, "|").replace(/\[!(.*?)\]/g, "[^$1]");
|
|
1071
|
-
return new RegExp(`^${reString}$`);
|
|
1072
|
-
};
|
|
1073
|
-
var walkInclude = (path2, extensions2, match, skip) => {
|
|
1074
|
-
if (Array.isArray(extensions2) && extensions2.length > 0 && !extensions2.some((extension) => path2.endsWith(extension))) {
|
|
1075
|
-
return false;
|
|
1076
|
-
}
|
|
1077
|
-
if (match && !match.some((pattern) => pattern.test(path2))) {
|
|
1078
|
-
return false;
|
|
1079
|
-
}
|
|
1080
|
-
return !skip?.some((pattern) => pattern.test(path2));
|
|
1081
|
-
};
|
|
1082
|
-
|
|
1083
|
-
// ../../filesystem/fs/dist/packem_shared/walk-BhTbpr3y.js
|
|
1084
|
-
var __cjs_require2 = module$1.createRequire(importMetaUrl);
|
|
1085
|
-
var __cjs_getProcess2 = typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" ? globalThis.process : process;
|
|
1086
|
-
var __cjs_getBuiltinModule2 = (module) => {
|
|
1087
|
-
if (typeof __cjs_getProcess2 !== "undefined" && __cjs_getProcess2.versions && __cjs_getProcess2.versions.node) {
|
|
1088
|
-
const [major, minor] = __cjs_getProcess2.versions.node.split(".").map(Number);
|
|
1089
|
-
if (major > 22 || major === 22 && minor >= 3 || major === 20 && minor >= 16) {
|
|
1090
|
-
return __cjs_getProcess2.getBuiltinModule(module);
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
return __cjs_require2(module);
|
|
1094
|
-
};
|
|
1095
|
-
var {
|
|
1096
|
-
readdir,
|
|
1097
|
-
realpath,
|
|
1098
|
-
stat
|
|
1099
|
-
} = __cjs_getBuiltinModule2("node:fs/promises");
|
|
1100
|
-
var _createWalkEntry = async (path2) => {
|
|
1101
|
-
const normalizePath = normalize(path2);
|
|
1102
|
-
const name = basename(normalizePath);
|
|
1103
|
-
const info = await stat(normalizePath);
|
|
1104
|
-
return {
|
|
1105
|
-
isDirectory: () => info.isDirectory(),
|
|
1106
|
-
isFile: () => info.isFile(),
|
|
1107
|
-
isSymbolicLink: () => info.isSymbolicLink(),
|
|
1108
|
-
name,
|
|
1109
|
-
path: normalizePath
|
|
1110
|
-
};
|
|
1111
|
-
};
|
|
1112
|
-
async function* walk(directory, {
|
|
1113
|
-
extensions: extensions2,
|
|
1114
|
-
followSymlinks = false,
|
|
1115
|
-
includeDirs: includeDirectories = true,
|
|
1116
|
-
includeFiles = true,
|
|
1117
|
-
includeSymlinks = true,
|
|
1118
|
-
match,
|
|
1119
|
-
maxDepth = Number.POSITIVE_INFINITY,
|
|
1120
|
-
skip
|
|
1121
|
-
} = {}) {
|
|
1122
|
-
assertValidFileOrDirectoryPath(directory);
|
|
1123
|
-
if (maxDepth < 0) {
|
|
1124
|
-
return;
|
|
1125
|
-
}
|
|
1126
|
-
const mappedMatch = match ? match.map((pattern) => typeof pattern === "string" ? globToRegExp(pattern) : pattern) : void 0;
|
|
1127
|
-
const mappedSkip = skip ? skip.map((pattern) => typeof pattern === "string" ? globToRegExp(pattern) : pattern) : void 0;
|
|
1128
|
-
directory = resolve(toPath(directory));
|
|
1129
|
-
if (includeDirectories && walkInclude(directory, extensions2, mappedMatch, mappedSkip)) {
|
|
1130
|
-
yield await _createWalkEntry(directory);
|
|
1131
|
-
}
|
|
1132
|
-
if (maxDepth < 1 || !walkInclude(directory, void 0, void 0, mappedSkip)) {
|
|
1133
|
-
return;
|
|
1134
|
-
}
|
|
1135
|
-
try {
|
|
1136
|
-
for await (const entry of await readdir(directory, {
|
|
1137
|
-
withFileTypes: true
|
|
1138
|
-
})) {
|
|
1139
|
-
let path2 = join(directory, entry.name);
|
|
1140
|
-
if (entry.isSymbolicLink()) {
|
|
1141
|
-
if (followSymlinks) {
|
|
1142
|
-
path2 = await realpath(path2);
|
|
1143
|
-
} else if (includeSymlinks && walkInclude(path2, extensions2, mappedMatch, mappedSkip)) {
|
|
1144
|
-
yield {
|
|
1145
|
-
isDirectory: entry.isDirectory,
|
|
1146
|
-
isFile: entry.isFile,
|
|
1147
|
-
isSymbolicLink: entry.isSymbolicLink,
|
|
1148
|
-
name: entry.name,
|
|
1149
|
-
path: path2
|
|
1150
|
-
};
|
|
1151
|
-
} else {
|
|
1152
|
-
continue;
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
if (entry.isSymbolicLink() || entry.isDirectory()) {
|
|
1156
|
-
yield* walk(path2, {
|
|
1157
|
-
extensions: extensions2,
|
|
1158
|
-
followSymlinks,
|
|
1159
|
-
includeDirs: includeDirectories,
|
|
1160
|
-
includeFiles,
|
|
1161
|
-
includeSymlinks,
|
|
1162
|
-
match: mappedMatch,
|
|
1163
|
-
maxDepth: maxDepth - 1,
|
|
1164
|
-
skip: mappedSkip
|
|
1165
|
-
});
|
|
1166
|
-
} else if (entry.isFile() && includeFiles && walkInclude(path2, extensions2, mappedMatch, mappedSkip)) {
|
|
1167
|
-
yield {
|
|
1168
|
-
isDirectory: () => entry.isDirectory(),
|
|
1169
|
-
isFile: () => entry.isFile(),
|
|
1170
|
-
isSymbolicLink: () => entry.isSymbolicLink(),
|
|
1171
|
-
name: entry.name,
|
|
1172
|
-
path: path2
|
|
1173
|
-
};
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
} catch (error) {
|
|
1177
|
-
if (error instanceof WalkError) {
|
|
1178
|
-
throw error;
|
|
1179
|
-
}
|
|
1180
|
-
throw new WalkError(error, directory);
|
|
1181
|
-
}
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
// ../../filesystem/fs/dist/packem_shared/collect-DcBwsYYd.js
|
|
1185
|
-
var collect = async (directory, options = {}) => {
|
|
1186
|
-
if (!Array.isArray(options.extensions)) {
|
|
1187
|
-
options.extensions = ["js", "mjs", "cjs", "ts"];
|
|
1188
|
-
}
|
|
1189
|
-
const entries = [];
|
|
1190
|
-
for await (const entry of walk(directory, options)) {
|
|
1191
|
-
entries.push(entry.path);
|
|
1192
|
-
}
|
|
1193
|
-
return entries;
|
|
1194
|
-
};
|
|
1195
|
-
|
|
1196
|
-
// src/constants.ts
|
|
1197
|
-
var DEFAULT_EXCLUDE = [
|
|
1198
|
-
"coverage/**",
|
|
1199
|
-
".github/**",
|
|
1200
|
-
"**/*.d.ts",
|
|
1201
|
-
"**/test{,s}/**",
|
|
1202
|
-
"**/test{,-*}.{js,cjs,mjs,ts,tsx,jsx,yaml,yml}",
|
|
1203
|
-
"**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx,yaml,yml}",
|
|
1204
|
-
"**/__tests__/**",
|
|
1205
|
-
"**/{ava,babel,nyc}.config.{js,cjs,mjs}",
|
|
1206
|
-
"**/jest.config.{js,cjs,mjs,ts}",
|
|
1207
|
-
"**/{karma,rollup,webpack}.config.js",
|
|
1208
|
-
"**/.{eslint,mocha}rc.{js,cjs}",
|
|
1209
|
-
"**/.{travis,yarnrc}.yml",
|
|
1210
|
-
"**/{docker-compose,docker}.yml",
|
|
1211
|
-
"**/.yamllint.{yaml,yml}",
|
|
1212
|
-
"**/node_modules/**",
|
|
1213
|
-
"**/{pnpm-workspace,pnpm-lock}.yaml",
|
|
1214
|
-
"**/{package,package-lock}.json",
|
|
1215
|
-
"**/yarn.lock",
|
|
1216
|
-
"**/package.json5",
|
|
1217
|
-
"**/.next/**"
|
|
1218
|
-
];
|
|
1219
|
-
var validate = async (spec) => {
|
|
1220
|
-
await SwaggerParser__default.default.validate(spec);
|
|
1221
|
-
};
|
|
1222
|
-
var validate_default = validate;
|
|
1223
|
-
|
|
1224
|
-
exports.DEFAULT_EXCLUDE = DEFAULT_EXCLUDE;
|
|
1225
|
-
exports.collect = collect;
|
|
1226
|
-
exports.comments_to_open_api_default = comments_to_open_api_default;
|
|
1227
|
-
exports.comments_to_open_api_default2 = comments_to_open_api_default2;
|
|
1228
|
-
exports.parse_file_default = parse_file_default;
|
|
1229
|
-
exports.spec_builder_default = spec_builder_default;
|
|
1230
|
-
exports.validate_default = validate_default;
|
|
1231
|
-
exports.yaml_loc_default = yaml_loc_default;
|
|
1232
|
-
//# sourceMappingURL=chunk-PTFTJY7I.js.map
|
|
1233
|
-
//# sourceMappingURL=chunk-PTFTJY7I.js.map
|