@visulima/jsdoc-open-api 3.0.0-alpha.2 → 3.0.0-alpha.21
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 +220 -0
- package/LICENSE.md +35 -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 +8 -0
- package/dist/cli/index.d.mts +4 -6
- package/dist/cli/index.d.ts +4 -6
- package/dist/cli/index.mjs +1 -4
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +247 -0
- package/dist/index.d.mts +176 -177
- package/dist/index.d.ts +176 -177
- package/dist/index.mjs +1 -85
- package/dist/packem_shared/SpecBuilder-CR4EZk93.cjs +1 -0
- package/dist/packem_shared/SpecBuilder-DjnDJFpv.mjs +1 -0
- package/dist/packem_shared/SwaggerCompilerPlugin-CLoD91_H.mjs +1 -0
- package/dist/packem_shared/SwaggerCompilerPlugin-lwIg0m84.cjs +1 -0
- package/dist/packem_shared/customizer-COfd-Xr1.mjs +1 -0
- package/dist/packem_shared/customizer-DUz3nxAJ.cjs +1 -0
- package/dist/packem_shared/generateCommand-BQuj1FCe.cjs +1 -0
- package/dist/packem_shared/generateCommand-Bn19mSDL.mjs +1 -0
- package/dist/packem_shared/generateCommand-DLJ2Ac1D.mjs +4 -0
- package/dist/packem_shared/generateCommand-DPOEw62Z.cjs +4 -0
- package/dist/packem_shared/initCommand-Bm4veOwd.mjs +1 -0
- package/dist/packem_shared/initCommand-CiV7G3q4.cjs +35 -0
- package/dist/packem_shared/initCommand-CwoPwelm.mjs +35 -0
- package/dist/packem_shared/initCommand-DAcI_ilX.cjs +1 -0
- package/dist/packem_shared/jsDocumentCommentsToOpenApi-Bvfi25DQ.mjs +1 -0
- package/dist/packem_shared/jsDocumentCommentsToOpenApi-DBYlHL5i.cjs +1 -0
- package/dist/packem_shared/parseFile-C7tyTcIn.cjs +1 -0
- package/dist/packem_shared/parseFile-CtAVjmPd.mjs +1 -0
- package/dist/packem_shared/swaggerJsDocumentCommentsToOpenApi-Bo1geBuG.cjs +10 -0
- package/dist/packem_shared/swaggerJsDocumentCommentsToOpenApi-xKOqHvN2.mjs +10 -0
- package/dist/packem_shared/validate-_k84qawx.mjs +1 -0
- package/dist/packem_shared/validate-tZa-jyuN.cjs +1 -0
- package/dist/packem_shared/yamlLoc-C2tVIYaz.mjs +1 -0
- package/dist/packem_shared/yamlLoc-DyGcp8YC.cjs +1 -0
- package/package.json +66 -54
- 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
|
@@ -1,30 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '../../chunk-46IWFMQ2.mjs';
|
|
3
|
-
import { exit } from 'process';
|
|
4
|
-
|
|
5
|
-
var generateCommand = (program, commandName = "generate", configName = ".openapirc.js") => {
|
|
6
|
-
program.command(commandName).description("Generates OpenAPI (Swagger) documentation from JSDoc's").usage("[options] <path ...>").argument("[path ...]", "Paths to files or directories to parse").option("-c, --config [.openapirc.js]", "@visulima/jsdoc-open-api config file path.").option("-o, --output [swaggerSpec.json]", "Output swagger specification.").option("-v, --verbose", "Verbose output.").option("-d, --very-verbose", "Very verbose output.").action(async (paths, options) => {
|
|
7
|
-
try {
|
|
8
|
-
await generate_command_default(configName, paths, options);
|
|
9
|
-
} catch (error) {
|
|
10
|
-
console.error(error);
|
|
11
|
-
exit(1);
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
var generate_command_default2 = generateCommand;
|
|
16
|
-
var initCommand = (program, commandName = "init", description = "Inits a pre-configured @visulima/jsdoc-open-api config file.", configName = ".openapirc.js") => {
|
|
17
|
-
program.command(commandName).description(description).action(() => {
|
|
18
|
-
try {
|
|
19
|
-
init_command_default(configName);
|
|
20
|
-
} catch (error) {
|
|
21
|
-
console.error(error);
|
|
22
|
-
exit(1);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var init_command_default2 = initCommand;
|
|
27
|
-
|
|
28
|
-
export { generate_command_default2 as generateCommand, init_command_default2 as initCommand };
|
|
29
|
-
//# sourceMappingURL=index.mjs.map
|
|
30
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
import{default as m}from"../../packem_shared/generateCommand-Bn19mSDL.mjs";import{default as t}from"../../packem_shared/initCommand-Bm4veOwd.mjs";export{m as generateCommand,t as initCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../packem_shared/generateCommand-DPOEw62Z.cjs"),t=require("../packem_shared/initCommand-CiV7G3q4.cjs");exports.generateCommand=e;exports.initCommand=t;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const generateCommand: (configName: string, paths: string[], options: {
|
|
2
|
+
config?: string;
|
|
3
|
+
output?: string;
|
|
4
|
+
verbose?: boolean;
|
|
5
|
+
veryVerbose?: boolean;
|
|
6
|
+
}) => Promise<void>;
|
|
7
|
+
declare const initCommand: (configName: string, packageJsonPath?: string) => void;
|
|
8
|
+
export { generateCommand, initCommand };
|
package/dist/cli/index.d.mts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
declare const generateCommand: (configName: string, paths: string[], options: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
config?: string;
|
|
3
|
+
output?: string;
|
|
4
|
+
verbose?: boolean;
|
|
5
|
+
veryVerbose?: boolean;
|
|
6
6
|
}) => Promise<void>;
|
|
7
|
-
|
|
8
7
|
declare const initCommand: (configName: string, packageJsonPath?: string) => void;
|
|
9
|
-
|
|
10
8
|
export { generateCommand, initCommand };
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
declare const generateCommand: (configName: string, paths: string[], options: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
config?: string;
|
|
3
|
+
output?: string;
|
|
4
|
+
verbose?: boolean;
|
|
5
|
+
veryVerbose?: boolean;
|
|
6
6
|
}) => Promise<void>;
|
|
7
|
-
|
|
8
7
|
declare const initCommand: (configName: string, packageJsonPath?: string) => void;
|
|
9
|
-
|
|
10
8
|
export { generateCommand, initCommand };
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import '../chunk-46IWFMQ2.mjs';
|
|
3
|
-
//# sourceMappingURL=index.mjs.map
|
|
4
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
import{default as m}from"../packem_shared/generateCommand-DLJ2Ac1D.mjs";import{default as t}from"../packem_shared/initCommand-CwoPwelm.mjs";export{m as generateCommand,t as initCommand};
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./packem_shared/jsDocumentCommentsToOpenApi-DBYlHL5i.cjs"),r=require("./packem_shared/parseFile-C7tyTcIn.cjs"),i=require("./packem_shared/SpecBuilder-CR4EZk93.cjs"),o=require("./packem_shared/swaggerJsDocumentCommentsToOpenApi-Bo1geBuG.cjs"),u=require("./packem_shared/yamlLoc-DyGcp8YC.cjs"),m=require("./packem_shared/SwaggerCompilerPlugin-lwIg0m84.cjs");exports.jsDocumentCommentsToOpenApi=e;exports.parseFile=r;exports.SpecBuilder=i;exports.swaggerJsDocumentCommentsToOpenApi=o;exports.yamlLoc=u;exports.SwaggerCompilerPlugin=m;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import 'buffer';
|
|
2
|
+
import 'http';
|
|
3
|
+
import 'https';
|
|
4
|
+
import 'inspector';
|
|
5
|
+
import 'net';
|
|
6
|
+
import 'url';
|
|
7
|
+
import 'vm';
|
|
8
|
+
interface BaseDefinition {
|
|
9
|
+
components?: ComponentsObject;
|
|
10
|
+
externalDocs?: ExternalDocumentationObject;
|
|
11
|
+
info: InfoObject;
|
|
12
|
+
openapi: string;
|
|
13
|
+
paths?: PathsObject;
|
|
14
|
+
security?: SecurityRequirementObject[];
|
|
15
|
+
servers?: ServerObject[];
|
|
16
|
+
tags?: TagObject[];
|
|
17
|
+
}
|
|
18
|
+
interface OpenApiObject extends BaseDefinition {
|
|
19
|
+
paths?: PathsObject;
|
|
20
|
+
}
|
|
21
|
+
interface InfoObject {
|
|
22
|
+
contact?: ContactObject;
|
|
23
|
+
description?: string;
|
|
24
|
+
license?: LicenseObject;
|
|
25
|
+
termsOfService?: string;
|
|
26
|
+
title: string;
|
|
27
|
+
version: string;
|
|
28
|
+
}
|
|
29
|
+
interface ContactObject {
|
|
30
|
+
email?: string;
|
|
31
|
+
name?: string;
|
|
32
|
+
url?: string;
|
|
33
|
+
}
|
|
34
|
+
interface LicenseObject {
|
|
35
|
+
name: string;
|
|
36
|
+
url?: string;
|
|
37
|
+
}
|
|
38
|
+
interface ServerObject {
|
|
39
|
+
description?: string;
|
|
40
|
+
url: string;
|
|
41
|
+
variables?: Map<ServerVariable>;
|
|
42
|
+
}
|
|
43
|
+
interface ServerVariable {
|
|
44
|
+
default: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
enum?: string[];
|
|
47
|
+
}
|
|
48
|
+
interface ComponentsObject {
|
|
49
|
+
callbacks?: Map<CallbackObject | ReferenceObject>;
|
|
50
|
+
examples?: Map<ExampleObject | ReferenceObject>;
|
|
51
|
+
headers?: Map<HeaderObject | ReferenceObject>;
|
|
52
|
+
links?: Map<LinkObject | ReferenceObject>;
|
|
53
|
+
parameters?: Map<ParameterObject | ReferenceObject>;
|
|
54
|
+
requestBodies?: Map<ReferenceObject | RequestBodyObject>;
|
|
55
|
+
responses?: Map<ReferenceObject | ResponseObject>;
|
|
56
|
+
schemas?: Map<ReferenceObject | SchemaObject>;
|
|
57
|
+
securitySchemes?: Map<ApiKeySecuritySchemeObject | HttpSecuritySchemeObject | Oauth2SecuritySchemeObject | OpenIdConnectSecuritySchemeObject | ReferenceObject>;
|
|
58
|
+
}
|
|
59
|
+
type PathsObject = Record<string, PathItemObject>;
|
|
60
|
+
interface PathItemObject {
|
|
61
|
+
$ref?: string;
|
|
62
|
+
delete?: OperationObject;
|
|
63
|
+
description?: string;
|
|
64
|
+
get?: OperationObject;
|
|
65
|
+
head?: OperationObject;
|
|
66
|
+
options?: OperationObject;
|
|
67
|
+
parameters?: (ParameterObject | ReferenceObject)[];
|
|
68
|
+
patch?: OperationObject;
|
|
69
|
+
post?: OperationObject;
|
|
70
|
+
put?: OperationObject;
|
|
71
|
+
servers?: ServerObject[];
|
|
72
|
+
summary?: string;
|
|
73
|
+
trace?: OperationObject;
|
|
74
|
+
}
|
|
75
|
+
interface OperationObject {
|
|
76
|
+
callbacks?: Map<CallbackObject | ReferenceObject>;
|
|
77
|
+
deprecated?: boolean;
|
|
78
|
+
description?: string;
|
|
79
|
+
externalDocs?: ExternalDocumentationObject;
|
|
80
|
+
operationId?: string;
|
|
81
|
+
parameters?: (ParameterObject | ReferenceObject)[];
|
|
82
|
+
requestBody?: ReferenceObject | RequestBodyObject;
|
|
83
|
+
responses: ResponsesObject;
|
|
84
|
+
security?: SecurityRequirementObject[];
|
|
85
|
+
servers?: ServerObject[];
|
|
86
|
+
summary?: string;
|
|
87
|
+
tags?: string[];
|
|
88
|
+
}
|
|
89
|
+
interface ExternalDocumentationObject {
|
|
90
|
+
description?: string;
|
|
91
|
+
url: string;
|
|
92
|
+
}
|
|
93
|
+
interface ParameterObject {
|
|
94
|
+
allowEmptyValue?: boolean;
|
|
95
|
+
allowReserved?: boolean;
|
|
96
|
+
content?: Map<MediaTypeObject>;
|
|
97
|
+
deprecated?: boolean;
|
|
98
|
+
description?: string;
|
|
99
|
+
example?: any;
|
|
100
|
+
examples?: Map<ExampleObject | ReferenceObject>;
|
|
101
|
+
explode?: string;
|
|
102
|
+
in: string;
|
|
103
|
+
name: string;
|
|
104
|
+
required?: boolean;
|
|
105
|
+
schema?: ReferenceObject | SchemaObject;
|
|
106
|
+
style?: string;
|
|
107
|
+
}
|
|
108
|
+
interface RequestBodyObject {
|
|
109
|
+
content: Map<MediaTypeObject>;
|
|
110
|
+
description?: string;
|
|
111
|
+
required?: boolean;
|
|
112
|
+
}
|
|
113
|
+
interface MediaTypeObject {
|
|
114
|
+
encoding?: Map<EncodingObject>;
|
|
115
|
+
example?: any;
|
|
116
|
+
examples?: Map<ExampleObject | ReferenceObject>;
|
|
117
|
+
schema?: ReferenceObject | SchemaObject;
|
|
118
|
+
}
|
|
119
|
+
interface EncodingObject {
|
|
120
|
+
allowReserved?: boolean;
|
|
121
|
+
contentType?: string;
|
|
122
|
+
explode?: boolean;
|
|
123
|
+
headers?: Map<HeaderObject | ReferenceObject>;
|
|
124
|
+
style?: string;
|
|
125
|
+
}
|
|
126
|
+
type ResponsesObject = Record<string, ReferenceObject | ResponseObject>;
|
|
127
|
+
interface ResponseObject {
|
|
128
|
+
content?: Map<MediaTypeObject>;
|
|
129
|
+
description: string;
|
|
130
|
+
headers?: Map<HeaderObject | ReferenceObject>;
|
|
131
|
+
links?: Map<LinkObject | ReferenceObject>;
|
|
132
|
+
}
|
|
133
|
+
type CallbackObject = Record<string, PathItemObject>;
|
|
134
|
+
interface ExampleObject {
|
|
135
|
+
description?: string;
|
|
136
|
+
externalValue?: string;
|
|
137
|
+
summary?: string;
|
|
138
|
+
value?: any;
|
|
139
|
+
}
|
|
140
|
+
interface LinkObject {
|
|
141
|
+
description?: string;
|
|
142
|
+
operationId?: string;
|
|
143
|
+
operationRef?: string;
|
|
144
|
+
parameters?: Map<any>;
|
|
145
|
+
requestBody?: any;
|
|
146
|
+
server?: ServerObject;
|
|
147
|
+
}
|
|
148
|
+
interface HeaderObject {
|
|
149
|
+
allowEmptyValue?: boolean;
|
|
150
|
+
allowReserved?: boolean;
|
|
151
|
+
content?: Map<MediaTypeObject>;
|
|
152
|
+
deprecated?: boolean;
|
|
153
|
+
description?: string;
|
|
154
|
+
example?: any;
|
|
155
|
+
examples?: Map<ExampleObject | ReferenceObject>;
|
|
156
|
+
explode?: string;
|
|
157
|
+
required?: boolean;
|
|
158
|
+
schema?: ReferenceObject | SchemaObject;
|
|
159
|
+
style?: string;
|
|
160
|
+
}
|
|
161
|
+
interface TagObject {
|
|
162
|
+
description?: string;
|
|
163
|
+
externalDocs?: ExternalDocumentationObject;
|
|
164
|
+
name: string;
|
|
165
|
+
}
|
|
166
|
+
interface ReferenceObject {
|
|
167
|
+
$ref: string;
|
|
168
|
+
}
|
|
169
|
+
type SchemaObject = Record<string, any>;
|
|
170
|
+
interface ApiKeySecuritySchemeObject {
|
|
171
|
+
description?: string;
|
|
172
|
+
in: string;
|
|
173
|
+
name: string;
|
|
174
|
+
type: string;
|
|
175
|
+
}
|
|
176
|
+
interface HttpSecuritySchemeObject {
|
|
177
|
+
bearerFormat?: string;
|
|
178
|
+
description?: string;
|
|
179
|
+
scheme: string;
|
|
180
|
+
type: string;
|
|
181
|
+
}
|
|
182
|
+
interface Oauth2SecuritySchemeObject {
|
|
183
|
+
description?: string;
|
|
184
|
+
flows: OAuthFlowsObject;
|
|
185
|
+
type: string;
|
|
186
|
+
}
|
|
187
|
+
interface OpenIdConnectSecuritySchemeObject {
|
|
188
|
+
description?: string;
|
|
189
|
+
openIdConnectUrl: string;
|
|
190
|
+
type: string;
|
|
191
|
+
}
|
|
192
|
+
interface OAuthFlowsObject {
|
|
193
|
+
authorizationCode?: OAuthFlowObject;
|
|
194
|
+
clientCredentials?: OAuthFlowObject;
|
|
195
|
+
implicit?: OAuthFlowObject;
|
|
196
|
+
password?: OAuthFlowObject;
|
|
197
|
+
}
|
|
198
|
+
interface OAuthFlowObject {
|
|
199
|
+
authorizationUrl?: string;
|
|
200
|
+
refreshUrl: string;
|
|
201
|
+
scopes: Map<string>;
|
|
202
|
+
tokenUrl?: string;
|
|
203
|
+
}
|
|
204
|
+
type SecurityRequirementObject = Record<string, string[]>;
|
|
205
|
+
type Map<T> = Record<string, T>;
|
|
206
|
+
declare const commentsToOpenApi$1: (fileContents: string, verbose?: boolean) => {
|
|
207
|
+
loc: number;
|
|
208
|
+
spec: OpenApiObject;
|
|
209
|
+
}[];
|
|
210
|
+
declare const parseFile: (file: string, commentsToOpenApi: (fileContent: string, verbose?: boolean) => {
|
|
211
|
+
loc: number;
|
|
212
|
+
spec: OpenApiObject;
|
|
213
|
+
}[], verbose?: boolean) => {
|
|
214
|
+
loc: number;
|
|
215
|
+
spec: OpenApiObject;
|
|
216
|
+
}[];
|
|
217
|
+
declare class SpecBuilder implements OpenApiObject {
|
|
218
|
+
components?: ComponentsObject;
|
|
219
|
+
externalDocs?: ExternalDocumentationObject;
|
|
220
|
+
info: InfoObject;
|
|
221
|
+
openapi: string;
|
|
222
|
+
paths: PathsObject;
|
|
223
|
+
security?: SecurityRequirementObject[];
|
|
224
|
+
servers?: ServerObject[];
|
|
225
|
+
tags?: TagObject[];
|
|
226
|
+
constructor(baseDefinition: BaseDefinition);
|
|
227
|
+
addData(parsedFile: OpenApiObject[]): void;
|
|
228
|
+
}
|
|
229
|
+
declare const commentsToOpenApi: (fileContents: string, verbose?: boolean) => {
|
|
230
|
+
loc: number;
|
|
231
|
+
spec: OpenApiObject;
|
|
232
|
+
}[];
|
|
233
|
+
declare const yamlLoc: (string: string) => number;
|
|
234
|
+
type WebpackCompiler = undefined;
|
|
235
|
+
declare class SwaggerCompilerPlugin {
|
|
236
|
+
private readonly assetsPath;
|
|
237
|
+
private readonly ignore;
|
|
238
|
+
private readonly sources;
|
|
239
|
+
private readonly swaggerDefinition;
|
|
240
|
+
private readonly verbose;
|
|
241
|
+
constructor(assetsPath: string, sources: string[], swaggerDefinition: BaseDefinition, options: {
|
|
242
|
+
ignore?: (RegExp | string)[];
|
|
243
|
+
verbose?: boolean;
|
|
244
|
+
});
|
|
245
|
+
apply(compiler: WebpackCompiler): void;
|
|
246
|
+
}
|
|
247
|
+
export { type BaseDefinition, type OpenApiObject, SpecBuilder, SwaggerCompilerPlugin, commentsToOpenApi$1 as jsDocumentCommentsToOpenApi, parseFile, commentsToOpenApi as swaggerJsDocumentCommentsToOpenApi, yamlLoc };
|