@visulima/jsdoc-open-api 3.0.0-alpha.3 → 3.0.0-alpha.31
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 +318 -0
- package/LICENSE.md +35 -1
- package/README.md +44 -33
- package/bin/index.js +1 -1
- package/dist/cli/commander/index.cjs +1 -0
- package/dist/cli/commander/index.d.cts +1000 -0
- package/dist/cli/commander/index.d.mts +996 -3
- package/dist/cli/commander/index.d.ts +996 -3
- package/dist/cli/commander/index.mjs +1 -30
- package/dist/cli/index.cjs +1 -0
- package/dist/cli/index.d.cts +9 -0
- package/dist/cli/index.d.mts +5 -6
- package/dist/cli/index.d.ts +5 -6
- package/dist/cli/index.mjs +1 -4
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +266 -0
- package/dist/index.d.mts +200 -182
- package/dist/index.d.ts +200 -182
- package/dist/index.mjs +1 -85
- package/dist/packem_shared/DEFAULT_OPTIONS-C7o6qjwP.mjs +1 -0
- package/dist/packem_shared/DEFAULT_OPTIONS-CP1lNs-k.cjs +1 -0
- package/dist/packem_shared/SpecBuilder-C_KcIxW-.cjs +1 -0
- package/dist/packem_shared/SpecBuilder-Vbq42UbW.mjs +1 -0
- package/dist/packem_shared/SwaggerCompilerPlugin-Bd9L4Djt.cjs +1 -0
- package/dist/packem_shared/SwaggerCompilerPlugin-wRdVpHJS.mjs +1 -0
- package/dist/packem_shared/constants-CdEv9ZcD.mjs +1 -0
- package/dist/packem_shared/constants-DnbfJ7Id.cjs +1 -0
- package/dist/packem_shared/customizer-BXFVpImq.mjs +1 -0
- package/dist/packem_shared/customizer-Bo8QD_ti.cjs +1 -0
- package/dist/packem_shared/generateCommand-CEP0sWth.cjs +5 -0
- package/dist/packem_shared/generateCommand-CkcShFNr.mjs +5 -0
- package/dist/packem_shared/generateCommand-CmoN8jyY.cjs +1 -0
- package/dist/packem_shared/generateCommand-DEhmHbRZ.mjs +1 -0
- package/dist/packem_shared/initCommand-1O6IuWJv.mjs +1 -0
- package/dist/packem_shared/initCommand-C8s0kkim.cjs +1 -0
- package/dist/packem_shared/initCommand-Ca1hGdYS.mjs +35 -0
- package/dist/packem_shared/initCommand-DvNH61Z4.cjs +35 -0
- package/dist/packem_shared/jsDocumentCommentsToOpenApi-BEQrWgpQ.mjs +1 -0
- package/dist/packem_shared/jsDocumentCommentsToOpenApi-CMbdb0uR.cjs +1 -0
- package/dist/packem_shared/loadDefinition-7r9qpfuE.mjs +1 -0
- package/dist/packem_shared/loadDefinition-ah20Zy-G.cjs +1 -0
- package/dist/packem_shared/parseFile-CPb-Kglh.cjs +1 -0
- package/dist/packem_shared/parseFile-Wxs3O0wy.mjs +1 -0
- package/dist/packem_shared/swaggerJsDocumentCommentsToOpenApi-BnPWbZoe.mjs +10 -0
- package/dist/packem_shared/swaggerJsDocumentCommentsToOpenApi-rMEaS4lg.cjs +10 -0
- package/dist/packem_shared/validate-9Rwe2A3r.mjs +1 -0
- package/dist/packem_shared/validate-DLmCjOPl.cjs +1 -0
- package/dist/packem_shared/yamlLoc-DC_7PYVS.cjs +1 -0
- package/dist/packem_shared/yamlLoc-DPq-xUM4.mjs +1 -0
- package/package.json +43 -32
- package/dist/chunk-46IWFMQ2.mjs +0 -1205
- package/dist/chunk-46IWFMQ2.mjs.map +0 -1
- package/dist/chunk-KI63G47G.mjs +0 -142
- package/dist/chunk-KI63G47G.mjs.map +0 -1
- package/dist/chunk-QK4CXNUY.js +0 -149
- package/dist/chunk-QK4CXNUY.js.map +0 -1
- package/dist/chunk-WEX5DMNT.js +0 -1223
- package/dist/chunk-WEX5DMNT.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/index.d.mts
CHANGED
|
@@ -1,248 +1,266 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Block } from 'comment-parser';
|
|
2
|
+
import 'buffer';
|
|
3
|
+
import 'http';
|
|
4
|
+
import 'https';
|
|
5
|
+
import 'inspector';
|
|
6
|
+
import 'net';
|
|
7
|
+
import 'url';
|
|
8
|
+
import 'vm';
|
|
3
9
|
interface BaseDefinition {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
components?: ComponentsObject;
|
|
11
|
+
externalDocs?: ExternalDocumentationObject;
|
|
12
|
+
info: InfoObject;
|
|
13
|
+
openapi: string;
|
|
14
|
+
paths?: PathsObject;
|
|
15
|
+
security?: SecurityRequirementObject[];
|
|
16
|
+
servers?: ServerObject[];
|
|
17
|
+
tags?: TagObject[];
|
|
12
18
|
}
|
|
13
19
|
interface OpenApiObject extends BaseDefinition {
|
|
14
|
-
|
|
20
|
+
paths?: PathsObject;
|
|
15
21
|
}
|
|
16
22
|
interface InfoObject {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
contact?: ContactObject;
|
|
24
|
+
description?: string;
|
|
25
|
+
license?: LicenseObject;
|
|
26
|
+
termsOfService?: string;
|
|
27
|
+
title: string;
|
|
28
|
+
version: string;
|
|
23
29
|
}
|
|
24
30
|
interface ContactObject {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
email?: string;
|
|
32
|
+
name?: string;
|
|
33
|
+
url?: string;
|
|
28
34
|
}
|
|
29
35
|
interface LicenseObject {
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
name: string;
|
|
37
|
+
url?: string;
|
|
32
38
|
}
|
|
33
39
|
interface ServerObject {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
description?: string;
|
|
41
|
+
url: string;
|
|
42
|
+
variables?: Map<ServerVariable>;
|
|
37
43
|
}
|
|
38
44
|
interface ServerVariable {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
default: string;
|
|
46
|
+
description?: string;
|
|
47
|
+
enum?: string[];
|
|
42
48
|
}
|
|
43
49
|
interface ComponentsObject {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
callbacks?: Map<CallbackObject | ReferenceObject>;
|
|
51
|
+
examples?: Map<ExampleObject | ReferenceObject>;
|
|
52
|
+
headers?: Map<HeaderObject | ReferenceObject>;
|
|
53
|
+
links?: Map<LinkObject | ReferenceObject>;
|
|
54
|
+
parameters?: Map<ParameterObject | ReferenceObject>;
|
|
55
|
+
requestBodies?: Map<ReferenceObject | RequestBodyObject>;
|
|
56
|
+
responses?: Map<ReferenceObject | ResponseObject>;
|
|
57
|
+
schemas?: Map<ReferenceObject | SchemaObject>;
|
|
58
|
+
securitySchemes?: Map<ApiKeySecuritySchemeObject | HttpSecuritySchemeObject | Oauth2SecuritySchemeObject | OpenIdConnectSecuritySchemeObject | ReferenceObject>;
|
|
53
59
|
}
|
|
54
60
|
type PathsObject = Record<string, PathItemObject>;
|
|
55
61
|
interface PathItemObject {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
$ref?: string;
|
|
63
|
+
delete?: OperationObject;
|
|
64
|
+
description?: string;
|
|
65
|
+
get?: OperationObject;
|
|
66
|
+
head?: OperationObject;
|
|
67
|
+
options?: OperationObject;
|
|
68
|
+
parameters?: (ParameterObject | ReferenceObject)[];
|
|
69
|
+
patch?: OperationObject;
|
|
70
|
+
post?: OperationObject;
|
|
71
|
+
put?: OperationObject;
|
|
72
|
+
servers?: ServerObject[];
|
|
73
|
+
summary?: string;
|
|
74
|
+
trace?: OperationObject;
|
|
69
75
|
}
|
|
70
76
|
interface OperationObject {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
callbacks?: Map<CallbackObject | ReferenceObject>;
|
|
78
|
+
deprecated?: boolean;
|
|
79
|
+
description?: string;
|
|
80
|
+
externalDocs?: ExternalDocumentationObject;
|
|
81
|
+
operationId?: string;
|
|
82
|
+
parameters?: (ParameterObject | ReferenceObject)[];
|
|
83
|
+
requestBody?: ReferenceObject | RequestBodyObject;
|
|
84
|
+
responses: ResponsesObject;
|
|
85
|
+
security?: SecurityRequirementObject[];
|
|
86
|
+
servers?: ServerObject[];
|
|
87
|
+
summary?: string;
|
|
88
|
+
tags?: string[];
|
|
83
89
|
}
|
|
84
90
|
interface ExternalDocumentationObject {
|
|
85
|
-
|
|
86
|
-
|
|
91
|
+
description?: string;
|
|
92
|
+
url: string;
|
|
87
93
|
}
|
|
88
94
|
interface ParameterObject {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
allowEmptyValue?: boolean;
|
|
96
|
+
allowReserved?: boolean;
|
|
97
|
+
content?: Map<MediaTypeObject>;
|
|
98
|
+
deprecated?: boolean;
|
|
99
|
+
description?: string;
|
|
100
|
+
example?: any;
|
|
101
|
+
examples?: Map<ExampleObject | ReferenceObject>;
|
|
102
|
+
explode?: string;
|
|
103
|
+
in: string;
|
|
104
|
+
name: string;
|
|
105
|
+
required?: boolean;
|
|
106
|
+
schema?: ReferenceObject | SchemaObject;
|
|
107
|
+
style?: string;
|
|
102
108
|
}
|
|
103
109
|
interface RequestBodyObject {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
110
|
+
content: Map<MediaTypeObject>;
|
|
111
|
+
description?: string;
|
|
112
|
+
required?: boolean;
|
|
107
113
|
}
|
|
108
114
|
interface MediaTypeObject {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
115
|
+
encoding?: Map<EncodingObject>;
|
|
116
|
+
example?: any;
|
|
117
|
+
examples?: Map<ExampleObject | ReferenceObject>;
|
|
118
|
+
schema?: ReferenceObject | SchemaObject;
|
|
113
119
|
}
|
|
114
120
|
interface EncodingObject {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
121
|
+
allowReserved?: boolean;
|
|
122
|
+
contentType?: string;
|
|
123
|
+
explode?: boolean;
|
|
124
|
+
headers?: Map<HeaderObject | ReferenceObject>;
|
|
125
|
+
style?: string;
|
|
120
126
|
}
|
|
121
127
|
type ResponsesObject = Record<string, ReferenceObject | ResponseObject>;
|
|
122
128
|
interface ResponseObject {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
129
|
+
content?: Map<MediaTypeObject>;
|
|
130
|
+
description: string;
|
|
131
|
+
headers?: Map<HeaderObject | ReferenceObject>;
|
|
132
|
+
links?: Map<LinkObject | ReferenceObject>;
|
|
127
133
|
}
|
|
128
134
|
type CallbackObject = Record<string, PathItemObject>;
|
|
129
135
|
interface ExampleObject {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
136
|
+
description?: string;
|
|
137
|
+
externalValue?: string;
|
|
138
|
+
summary?: string;
|
|
139
|
+
value?: any;
|
|
134
140
|
}
|
|
135
141
|
interface LinkObject {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
+
description?: string;
|
|
143
|
+
operationId?: string;
|
|
144
|
+
operationRef?: string;
|
|
145
|
+
parameters?: Map<any>;
|
|
146
|
+
requestBody?: any;
|
|
147
|
+
server?: ServerObject;
|
|
142
148
|
}
|
|
143
149
|
interface HeaderObject {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
allowEmptyValue?: boolean;
|
|
151
|
+
allowReserved?: boolean;
|
|
152
|
+
content?: Map<MediaTypeObject>;
|
|
153
|
+
deprecated?: boolean;
|
|
154
|
+
description?: string;
|
|
155
|
+
example?: any;
|
|
156
|
+
examples?: Map<ExampleObject | ReferenceObject>;
|
|
157
|
+
explode?: string;
|
|
158
|
+
required?: boolean;
|
|
159
|
+
schema?: ReferenceObject | SchemaObject;
|
|
160
|
+
style?: string;
|
|
155
161
|
}
|
|
156
162
|
interface TagObject {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
163
|
+
description?: string;
|
|
164
|
+
externalDocs?: ExternalDocumentationObject;
|
|
165
|
+
name: string;
|
|
160
166
|
}
|
|
161
167
|
interface ReferenceObject {
|
|
162
|
-
|
|
168
|
+
$ref: string;
|
|
163
169
|
}
|
|
164
170
|
type SchemaObject = Record<string, any>;
|
|
165
171
|
interface ApiKeySecuritySchemeObject {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
172
|
+
description?: string;
|
|
173
|
+
in: string;
|
|
174
|
+
name: string;
|
|
175
|
+
type: string;
|
|
170
176
|
}
|
|
171
177
|
interface HttpSecuritySchemeObject {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
178
|
+
bearerFormat?: string;
|
|
179
|
+
description?: string;
|
|
180
|
+
scheme: string;
|
|
181
|
+
type: string;
|
|
176
182
|
}
|
|
177
183
|
interface Oauth2SecuritySchemeObject {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
184
|
+
description?: string;
|
|
185
|
+
flows: OAuthFlowsObject;
|
|
186
|
+
type: string;
|
|
181
187
|
}
|
|
182
188
|
interface OpenIdConnectSecuritySchemeObject {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
189
|
+
description?: string;
|
|
190
|
+
openIdConnectUrl: string;
|
|
191
|
+
type: string;
|
|
186
192
|
}
|
|
187
193
|
interface OAuthFlowsObject {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
194
|
+
authorizationCode?: OAuthFlowObject;
|
|
195
|
+
clientCredentials?: OAuthFlowObject;
|
|
196
|
+
implicit?: OAuthFlowObject;
|
|
197
|
+
password?: OAuthFlowObject;
|
|
192
198
|
}
|
|
193
199
|
interface OAuthFlowObject {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
200
|
+
authorizationUrl?: string;
|
|
201
|
+
refreshUrl: string;
|
|
202
|
+
scopes: Map<string>;
|
|
203
|
+
tokenUrl?: string;
|
|
198
204
|
}
|
|
199
205
|
type SecurityRequirementObject = Record<string, string[]>;
|
|
200
206
|
type Map<T> = Record<string, T>;
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
spec: OpenApiObject;
|
|
207
|
+
declare const commentsToOpenApi$1: (fileContents: string, verbose?: boolean, comments?: Block[]) => {
|
|
208
|
+
loc: number;
|
|
209
|
+
spec: OpenApiObject;
|
|
205
210
|
}[];
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
declare const DEFAULT_OPTIONS: {
|
|
212
|
+
cwd: undefined;
|
|
213
|
+
exclude: string[];
|
|
214
|
+
excludeNodeModules: boolean;
|
|
215
|
+
extension: string[];
|
|
216
|
+
include: string[];
|
|
217
|
+
verbose: boolean;
|
|
218
|
+
};
|
|
219
|
+
type CommentsToOpenApi = (fileContent: string, verbose?: boolean, comments?: Block[]) => {
|
|
220
|
+
loc: number;
|
|
221
|
+
spec: OpenApiObject;
|
|
222
|
+
}[];
|
|
223
|
+
declare const parseFile$1: (file: string, commentsToOpenApi: CommentsToOpenApi, verbose?: boolean) => {
|
|
224
|
+
loc: number;
|
|
225
|
+
spec: OpenApiObject;
|
|
226
|
+
}[];
|
|
227
|
+
declare const parseFileMulti: (file: string, translators: CommentsToOpenApi[], verbose?: boolean) => {
|
|
228
|
+
loc: number;
|
|
229
|
+
spec: OpenApiObject;
|
|
213
230
|
}[];
|
|
214
|
-
|
|
215
231
|
declare class SpecBuilder implements OpenApiObject {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
spec: OpenApiObject;
|
|
232
|
+
components?: ComponentsObject;
|
|
233
|
+
externalDocs?: ExternalDocumentationObject;
|
|
234
|
+
info: InfoObject;
|
|
235
|
+
openapi: string;
|
|
236
|
+
paths: PathsObject;
|
|
237
|
+
security?: SecurityRequirementObject[];
|
|
238
|
+
servers?: ServerObject[];
|
|
239
|
+
tags?: TagObject[];
|
|
240
|
+
constructor(baseDefinition: BaseDefinition);
|
|
241
|
+
addData(parsedFile: OpenApiObject[]): void;
|
|
242
|
+
}
|
|
243
|
+
declare const commentsToOpenApi: (fileContents: string, verbose?: boolean, comments?: Block[]) => {
|
|
244
|
+
loc: number;
|
|
245
|
+
spec: OpenApiObject;
|
|
231
246
|
}[];
|
|
232
|
-
|
|
247
|
+
declare const parseFile: (file: string) => BaseDefinition;
|
|
233
248
|
declare const yamlLoc: (string: string) => number;
|
|
234
|
-
|
|
249
|
+
declare const validate: (spec: Record<string, unknown>) => Promise<void>;
|
|
250
|
+
type WebpackCompiler = undefined;
|
|
235
251
|
declare class SwaggerCompilerPlugin {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
|
|
252
|
+
private readonly assetsPath;
|
|
253
|
+
private readonly ignore;
|
|
254
|
+
private readonly silent;
|
|
255
|
+
private readonly sources;
|
|
256
|
+
private readonly swaggerDefinition;
|
|
257
|
+
private readonly verbose;
|
|
258
|
+
constructor(assetsPath: string, sources: string[], swaggerDefinition: BaseDefinition, options: {
|
|
259
|
+
ignore?: (RegExp | string)[];
|
|
260
|
+
silent?: boolean;
|
|
261
|
+
verbose?: boolean;
|
|
262
|
+
});
|
|
263
|
+
apply(compiler: WebpackCompiler): void;
|
|
264
|
+
private log;
|
|
265
|
+
}
|
|
266
|
+
export { type BaseDefinition, type CommentsToOpenApi, DEFAULT_OPTIONS, type OpenApiObject, SpecBuilder, SwaggerCompilerPlugin, commentsToOpenApi$1 as jsDocumentCommentsToOpenApi, parseFile as loadDefinition, parseFile$1 as parseFile, parseFileMulti, commentsToOpenApi as swaggerJsDocumentCommentsToOpenApi, validate, yamlLoc };
|