@visulima/jsdoc-open-api 3.0.0-alpha.3 → 3.0.0-alpha.30

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.
Files changed (67) hide show
  1. package/CHANGELOG.md +316 -0
  2. package/LICENSE.md +35 -1
  3. package/README.md +44 -33
  4. package/bin/index.js +1 -1
  5. package/dist/cli/commander/index.cjs +1 -0
  6. package/dist/cli/commander/index.d.cts +1000 -0
  7. package/dist/cli/commander/index.d.mts +996 -3
  8. package/dist/cli/commander/index.d.ts +996 -3
  9. package/dist/cli/commander/index.mjs +1 -30
  10. package/dist/cli/index.cjs +1 -0
  11. package/dist/cli/index.d.cts +9 -0
  12. package/dist/cli/index.d.mts +5 -6
  13. package/dist/cli/index.d.ts +5 -6
  14. package/dist/cli/index.mjs +1 -4
  15. package/dist/index.cjs +1 -0
  16. package/dist/index.d.cts +266 -0
  17. package/dist/index.d.mts +200 -182
  18. package/dist/index.d.ts +200 -182
  19. package/dist/index.mjs +1 -85
  20. package/dist/packem_shared/DEFAULT_OPTIONS-C7o6qjwP.mjs +1 -0
  21. package/dist/packem_shared/DEFAULT_OPTIONS-CP1lNs-k.cjs +1 -0
  22. package/dist/packem_shared/SpecBuilder-C_KcIxW-.cjs +1 -0
  23. package/dist/packem_shared/SpecBuilder-Vbq42UbW.mjs +1 -0
  24. package/dist/packem_shared/SwaggerCompilerPlugin-Bd9L4Djt.cjs +1 -0
  25. package/dist/packem_shared/SwaggerCompilerPlugin-wRdVpHJS.mjs +1 -0
  26. package/dist/packem_shared/constants-CdEv9ZcD.mjs +1 -0
  27. package/dist/packem_shared/constants-DnbfJ7Id.cjs +1 -0
  28. package/dist/packem_shared/customizer-BXFVpImq.mjs +1 -0
  29. package/dist/packem_shared/customizer-Bo8QD_ti.cjs +1 -0
  30. package/dist/packem_shared/generateCommand-CEP0sWth.cjs +5 -0
  31. package/dist/packem_shared/generateCommand-CkcShFNr.mjs +5 -0
  32. package/dist/packem_shared/generateCommand-CmoN8jyY.cjs +1 -0
  33. package/dist/packem_shared/generateCommand-DEhmHbRZ.mjs +1 -0
  34. package/dist/packem_shared/initCommand-1O6IuWJv.mjs +1 -0
  35. package/dist/packem_shared/initCommand-C8s0kkim.cjs +1 -0
  36. package/dist/packem_shared/initCommand-Ca1hGdYS.mjs +35 -0
  37. package/dist/packem_shared/initCommand-DvNH61Z4.cjs +35 -0
  38. package/dist/packem_shared/jsDocumentCommentsToOpenApi-BEQrWgpQ.mjs +1 -0
  39. package/dist/packem_shared/jsDocumentCommentsToOpenApi-CMbdb0uR.cjs +1 -0
  40. package/dist/packem_shared/loadDefinition-7r9qpfuE.mjs +1 -0
  41. package/dist/packem_shared/loadDefinition-ah20Zy-G.cjs +1 -0
  42. package/dist/packem_shared/parseFile-CPb-Kglh.cjs +1 -0
  43. package/dist/packem_shared/parseFile-Wxs3O0wy.mjs +1 -0
  44. package/dist/packem_shared/swaggerJsDocumentCommentsToOpenApi-BnPWbZoe.mjs +10 -0
  45. package/dist/packem_shared/swaggerJsDocumentCommentsToOpenApi-rMEaS4lg.cjs +10 -0
  46. package/dist/packem_shared/validate-9Rwe2A3r.mjs +1 -0
  47. package/dist/packem_shared/validate-DLmCjOPl.cjs +1 -0
  48. package/dist/packem_shared/yamlLoc-DC_7PYVS.cjs +1 -0
  49. package/dist/packem_shared/yamlLoc-DPq-xUM4.mjs +1 -0
  50. package/package.json +43 -32
  51. package/dist/chunk-46IWFMQ2.mjs +0 -1205
  52. package/dist/chunk-46IWFMQ2.mjs.map +0 -1
  53. package/dist/chunk-KI63G47G.mjs +0 -142
  54. package/dist/chunk-KI63G47G.mjs.map +0 -1
  55. package/dist/chunk-QK4CXNUY.js +0 -149
  56. package/dist/chunk-QK4CXNUY.js.map +0 -1
  57. package/dist/chunk-WEX5DMNT.js +0 -1223
  58. package/dist/chunk-WEX5DMNT.js.map +0 -1
  59. package/dist/cli/commander/index.js +0 -33
  60. package/dist/cli/commander/index.js.map +0 -1
  61. package/dist/cli/commander/index.mjs.map +0 -1
  62. package/dist/cli/index.js +0 -17
  63. package/dist/cli/index.js.map +0 -1
  64. package/dist/cli/index.mjs.map +0 -1
  65. package/dist/index.js +0 -106
  66. package/dist/index.js.map +0 -1
  67. package/dist/index.mjs.map +0 -1
package/dist/index.d.mts CHANGED
@@ -1,248 +1,266 @@
1
- import { Compiler } from 'webpack';
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
- components?: ComponentsObject;
5
- externalDocs?: ExternalDocumentationObject;
6
- info: InfoObject;
7
- openapi: string;
8
- paths?: PathsObject;
9
- security?: SecurityRequirementObject[];
10
- servers?: ServerObject[];
11
- tags?: TagObject[];
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
- paths?: PathsObject;
20
+ paths?: PathsObject;
15
21
  }
16
22
  interface InfoObject {
17
- contact?: ContactObject;
18
- description?: string;
19
- license?: LicenseObject;
20
- termsOfService?: string;
21
- title: string;
22
- version: string;
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
- email?: string;
26
- name?: string;
27
- url?: string;
31
+ email?: string;
32
+ name?: string;
33
+ url?: string;
28
34
  }
29
35
  interface LicenseObject {
30
- name: string;
31
- url?: string;
36
+ name: string;
37
+ url?: string;
32
38
  }
33
39
  interface ServerObject {
34
- description?: string;
35
- url: string;
36
- variables?: Map<ServerVariable>;
40
+ description?: string;
41
+ url: string;
42
+ variables?: Map<ServerVariable>;
37
43
  }
38
44
  interface ServerVariable {
39
- default: string;
40
- description?: string;
41
- enum?: string[];
45
+ default: string;
46
+ description?: string;
47
+ enum?: string[];
42
48
  }
43
49
  interface ComponentsObject {
44
- callbacks?: Map<CallbackObject | ReferenceObject>;
45
- examples?: Map<ExampleObject | ReferenceObject>;
46
- headers?: Map<HeaderObject | ReferenceObject>;
47
- links?: Map<LinkObject | ReferenceObject>;
48
- parameters?: Map<ParameterObject | ReferenceObject>;
49
- requestBodies?: Map<ReferenceObject | RequestBodyObject>;
50
- responses?: Map<ReferenceObject | ResponseObject>;
51
- schemas?: Map<ReferenceObject | SchemaObject>;
52
- securitySchemes?: Map<ApiKeySecuritySchemeObject | HttpSecuritySchemeObject | Oauth2SecuritySchemeObject | OpenIdConnectSecuritySchemeObject | ReferenceObject>;
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
- $ref?: string;
57
- delete?: OperationObject;
58
- description?: string;
59
- get?: OperationObject;
60
- head?: OperationObject;
61
- options?: OperationObject;
62
- parameters?: (ParameterObject | ReferenceObject)[];
63
- patch?: OperationObject;
64
- post?: OperationObject;
65
- put?: OperationObject;
66
- servers?: ServerObject[];
67
- summary?: string;
68
- trace?: OperationObject;
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
- callbacks?: Map<CallbackObject | ReferenceObject>;
72
- deprecated?: boolean;
73
- description?: string;
74
- externalDocs?: ExternalDocumentationObject;
75
- operationId?: string;
76
- parameters?: (ParameterObject | ReferenceObject)[];
77
- requestBody?: ReferenceObject | RequestBodyObject;
78
- responses: ResponsesObject;
79
- security?: SecurityRequirementObject[];
80
- servers?: ServerObject[];
81
- summary?: string;
82
- tags?: string[];
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
- description?: string;
86
- url: string;
91
+ description?: string;
92
+ url: string;
87
93
  }
88
94
  interface ParameterObject {
89
- allowEmptyValue?: boolean;
90
- allowReserved?: boolean;
91
- content?: Map<MediaTypeObject>;
92
- deprecated?: boolean;
93
- description?: string;
94
- example?: any;
95
- examples?: Map<ExampleObject | ReferenceObject>;
96
- explode?: string;
97
- in: string;
98
- name: string;
99
- required?: boolean;
100
- schema?: ReferenceObject | SchemaObject;
101
- style?: string;
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
- content: Map<MediaTypeObject>;
105
- description?: string;
106
- required?: boolean;
110
+ content: Map<MediaTypeObject>;
111
+ description?: string;
112
+ required?: boolean;
107
113
  }
108
114
  interface MediaTypeObject {
109
- encoding?: Map<EncodingObject>;
110
- example?: any;
111
- examples?: Map<ExampleObject | ReferenceObject>;
112
- schema?: ReferenceObject | SchemaObject;
115
+ encoding?: Map<EncodingObject>;
116
+ example?: any;
117
+ examples?: Map<ExampleObject | ReferenceObject>;
118
+ schema?: ReferenceObject | SchemaObject;
113
119
  }
114
120
  interface EncodingObject {
115
- allowReserved?: boolean;
116
- contentType?: string;
117
- explode?: boolean;
118
- headers?: Map<HeaderObject | ReferenceObject>;
119
- style?: string;
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
- content?: Map<MediaTypeObject>;
124
- description: string;
125
- headers?: Map<HeaderObject | ReferenceObject>;
126
- links?: Map<LinkObject | ReferenceObject>;
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
- description?: string;
131
- externalValue?: string;
132
- summary?: string;
133
- value?: any;
136
+ description?: string;
137
+ externalValue?: string;
138
+ summary?: string;
139
+ value?: any;
134
140
  }
135
141
  interface LinkObject {
136
- description?: string;
137
- operationId?: string;
138
- operationRef?: string;
139
- parameters?: Map<any>;
140
- requestBody?: any;
141
- server?: ServerObject;
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
- allowEmptyValue?: boolean;
145
- allowReserved?: boolean;
146
- content?: Map<MediaTypeObject>;
147
- deprecated?: boolean;
148
- description?: string;
149
- example?: any;
150
- examples?: Map<ExampleObject | ReferenceObject>;
151
- explode?: string;
152
- required?: boolean;
153
- schema?: ReferenceObject | SchemaObject;
154
- style?: string;
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
- description?: string;
158
- externalDocs?: ExternalDocumentationObject;
159
- name: string;
163
+ description?: string;
164
+ externalDocs?: ExternalDocumentationObject;
165
+ name: string;
160
166
  }
161
167
  interface ReferenceObject {
162
- $ref: string;
168
+ $ref: string;
163
169
  }
164
170
  type SchemaObject = Record<string, any>;
165
171
  interface ApiKeySecuritySchemeObject {
166
- description?: string;
167
- in: string;
168
- name: string;
169
- type: string;
172
+ description?: string;
173
+ in: string;
174
+ name: string;
175
+ type: string;
170
176
  }
171
177
  interface HttpSecuritySchemeObject {
172
- bearerFormat?: string;
173
- description?: string;
174
- scheme: string;
175
- type: string;
178
+ bearerFormat?: string;
179
+ description?: string;
180
+ scheme: string;
181
+ type: string;
176
182
  }
177
183
  interface Oauth2SecuritySchemeObject {
178
- description?: string;
179
- flows: OAuthFlowsObject;
180
- type: string;
184
+ description?: string;
185
+ flows: OAuthFlowsObject;
186
+ type: string;
181
187
  }
182
188
  interface OpenIdConnectSecuritySchemeObject {
183
- description?: string;
184
- openIdConnectUrl: string;
185
- type: string;
189
+ description?: string;
190
+ openIdConnectUrl: string;
191
+ type: string;
186
192
  }
187
193
  interface OAuthFlowsObject {
188
- authorizationCode?: OAuthFlowObject;
189
- clientCredentials?: OAuthFlowObject;
190
- implicit?: OAuthFlowObject;
191
- password?: OAuthFlowObject;
194
+ authorizationCode?: OAuthFlowObject;
195
+ clientCredentials?: OAuthFlowObject;
196
+ implicit?: OAuthFlowObject;
197
+ password?: OAuthFlowObject;
192
198
  }
193
199
  interface OAuthFlowObject {
194
- authorizationUrl?: string;
195
- refreshUrl: string;
196
- scopes: Map<string>;
197
- tokenUrl?: string;
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
- declare const commentsToOpenApi$1: (fileContents: string, verbose?: boolean) => {
203
- loc: number;
204
- spec: OpenApiObject;
207
+ declare const commentsToOpenApi$1: (fileContents: string, verbose?: boolean, comments?: Block[]) => {
208
+ loc: number;
209
+ spec: OpenApiObject;
205
210
  }[];
206
-
207
- declare const parseFile: (file: string, commentsToOpenApi: (fileContent: string, verbose?: boolean) => {
208
- loc: number;
209
- spec: OpenApiObject;
210
- }[], verbose?: boolean) => {
211
- loc: number;
212
- spec: OpenApiObject;
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
- components?: ComponentsObject;
217
- externalDocs?: ExternalDocumentationObject;
218
- info: InfoObject;
219
- openapi: string;
220
- paths: PathsObject;
221
- security?: SecurityRequirementObject[];
222
- servers?: ServerObject[];
223
- tags?: TagObject[];
224
- constructor(baseDefinition: BaseDefinition);
225
- addData(parsedFile: OpenApiObject[]): void;
226
- }
227
-
228
- declare const commentsToOpenApi: (fileContents: string, verbose?: boolean) => {
229
- loc: number;
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
- 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: Compiler): void;
246
- }
247
-
248
- export { type BaseDefinition, type OpenApiObject, SpecBuilder, SwaggerCompilerPlugin, commentsToOpenApi$1 as jsDocumentCommentsToOpenApi, parseFile, commentsToOpenApi as swaggerJsDocumentCommentsToOpenApi, yamlLoc };
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 };