@openapitools/openapi-generator-cli 2.4.26 → 2.5.0
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/README.md +32 -1
- package/config.schema.json +18 -10
- package/main.js +113 -36
- package/package.json +7 -12
package/README.md
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
[](https://renovateapp.com/)
|
|
7
|
-
[](http://hits.dwyl.com/openapitools/openapi-generator-cli)
|
|
8
7
|
[](https://github.com/semantic-release/semantic-release)
|
|
9
8
|
|
|
10
9
|
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and
|
|
@@ -173,6 +172,26 @@ is automatically used to generate your code. 🎉
|
|
|
173
172
|
| relPath | file name and extension of file relative to the glob provided | docs/auth.yaml |
|
|
174
173
|
| ext | just file extension | yaml |
|
|
175
174
|
|
|
175
|
+
### Using custom / private maven registry
|
|
176
|
+
|
|
177
|
+
If you're using a private maven registry you can configure the `downloadUrl` and `queryUrl` like this:
|
|
178
|
+
|
|
179
|
+
```json
|
|
180
|
+
{
|
|
181
|
+
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
|
|
182
|
+
"spaces": 2,
|
|
183
|
+
"generator-cli": {
|
|
184
|
+
"version": "5.3.0",
|
|
185
|
+
"repository": {
|
|
186
|
+
"queryUrl": "https://private.maven.intern/solrsearch/select?q=g:${group.id}+AND+a:${artifact.id}&core=gav&start=0&rows=200",
|
|
187
|
+
"downloadUrl": "https://private.maven.intern/maven2/${groupId}/${artifactId}/${versionName}/${artifactId}-${versionName}.jar"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
If the `version` property param is set it is not necessary to configure the `queryUrl`.
|
|
194
|
+
|
|
176
195
|
## Run specific generators
|
|
177
196
|
|
|
178
197
|
| cmd | v3.0 runs | v2.0 runs |
|
|
@@ -181,6 +200,18 @@ is automatically used to generate your code. 🎉
|
|
|
181
200
|
| openapi-generator-cli generate --generator-key v3.0 v2.0 | yes | yes |
|
|
182
201
|
| openapi-generator-cli generate --generator-key foo | no | no |
|
|
183
202
|
|
|
203
|
+
## Use Docker instead of running java locally
|
|
204
|
+
|
|
205
|
+
```json
|
|
206
|
+
{
|
|
207
|
+
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
|
|
208
|
+
"spaces": 2,
|
|
209
|
+
"generator-cli": {
|
|
210
|
+
"useDocker": true
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
184
215
|
## Custom Generators
|
|
185
216
|
|
|
186
217
|
Custom generators can be used by passing the `--custom-generator=/my/custom-generator.jar` argument.
|
package/config.schema.json
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
4
|
"title": "OpenAPI Generator CLI - Config",
|
|
5
5
|
"type": "object",
|
|
6
|
-
"required": [
|
|
7
|
-
"generator-cli"
|
|
8
|
-
],
|
|
6
|
+
"required": ["generator-cli"],
|
|
9
7
|
"additionalProperties": false,
|
|
10
8
|
"properties": {
|
|
11
9
|
"$schema": {
|
|
@@ -17,9 +15,7 @@
|
|
|
17
15
|
},
|
|
18
16
|
"generator-cli": {
|
|
19
17
|
"type": "object",
|
|
20
|
-
"required": [
|
|
21
|
-
"version"
|
|
22
|
-
],
|
|
18
|
+
"required": ["version"],
|
|
23
19
|
"properties": {
|
|
24
20
|
"version": {
|
|
25
21
|
"type": "string"
|
|
@@ -37,6 +33,14 @@
|
|
|
37
33
|
"default": "https://repo1.maven.org/maven2/${groupId}/${artifactId}/${versionName}/${artifactId}-${versionName}.jar"
|
|
38
34
|
}
|
|
39
35
|
},
|
|
36
|
+
"useDocker": {
|
|
37
|
+
"type": "boolean",
|
|
38
|
+
"default": false
|
|
39
|
+
},
|
|
40
|
+
"dockerImageName": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"default": "openapitools/openapi-generator-cli"
|
|
43
|
+
},
|
|
40
44
|
"generators": {
|
|
41
45
|
"type": "object",
|
|
42
46
|
"additionalProperties": {
|
|
@@ -60,13 +64,17 @@
|
|
|
60
64
|
},
|
|
61
65
|
"generator": {
|
|
62
66
|
"type": "object",
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
"anyOf": [
|
|
68
|
+
{
|
|
69
|
+
"required": ["inputSpec", "output", "generatorName"]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"required": ["glob", "output", "generatorName"]
|
|
73
|
+
}
|
|
67
74
|
],
|
|
68
75
|
"properties": {
|
|
69
76
|
"glob": {
|
|
77
|
+
"description": "matches local specification files using a glob pattern",
|
|
70
78
|
"type": "string",
|
|
71
79
|
"minLength": 1
|
|
72
80
|
},
|
package/main.js
CHANGED
|
@@ -336,13 +336,19 @@ let ConfigService = class ConfigService {
|
|
|
336
336
|
this.cwd = process.env.PWD || process.env.INIT_CWD || process.cwd();
|
|
337
337
|
this.configFile = path__WEBPACK_IMPORTED_MODULE_2__["resolve"](this.cwd, 'openapitools.json');
|
|
338
338
|
this.defaultConfig = {
|
|
339
|
-
$schema: 'node_modules/@openapitools/openapi-generator-cli/config.schema.json',
|
|
339
|
+
$schema: './node_modules/@openapitools/openapi-generator-cli/config.schema.json',
|
|
340
340
|
spaces: 2,
|
|
341
341
|
'generator-cli': {
|
|
342
342
|
version: undefined,
|
|
343
343
|
},
|
|
344
344
|
};
|
|
345
345
|
}
|
|
346
|
+
get useDocker() {
|
|
347
|
+
return this.get('generator-cli.useDocker', false);
|
|
348
|
+
}
|
|
349
|
+
get dockerImageName() {
|
|
350
|
+
return this.get('generator-cli.dockerImageName', 'openapitools/openapi-generator-cli');
|
|
351
|
+
}
|
|
346
352
|
get(path, defaultValue) {
|
|
347
353
|
return Object(lodash__WEBPACK_IMPORTED_MODULE_4__["get"])(this.read(), path, defaultValue);
|
|
348
354
|
}
|
|
@@ -391,13 +397,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
391
397
|
/* harmony import */ var concurrently__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(concurrently__WEBPACK_IMPORTED_MODULE_3__);
|
|
392
398
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! path */ "path");
|
|
393
399
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_4__);
|
|
394
|
-
/* harmony import */ var
|
|
395
|
-
/* harmony import */ var
|
|
396
|
-
/* harmony import */ var
|
|
397
|
-
/* harmony import */ var
|
|
398
|
-
/* harmony import */ var
|
|
399
|
-
/* harmony import */ var
|
|
400
|
-
/* harmony import */ var
|
|
400
|
+
/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! fs-extra */ "fs-extra");
|
|
401
|
+
/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_5__);
|
|
402
|
+
/* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! glob */ "glob");
|
|
403
|
+
/* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(glob__WEBPACK_IMPORTED_MODULE_6__);
|
|
404
|
+
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! chalk */ "chalk");
|
|
405
|
+
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_7__);
|
|
406
|
+
/* harmony import */ var _version_manager_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./version-manager.service */ "./apps/generator-cli/src/app/services/version-manager.service.ts");
|
|
407
|
+
/* harmony import */ var _config_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./config.service */ "./apps/generator-cli/src/app/services/config.service.ts");
|
|
408
|
+
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../constants */ "./apps/generator-cli/src/app/constants/index.ts");
|
|
401
409
|
var _a, _b, _c;
|
|
402
410
|
|
|
403
411
|
|
|
@@ -409,6 +417,7 @@ var _a, _b, _c;
|
|
|
409
417
|
|
|
410
418
|
|
|
411
419
|
|
|
420
|
+
|
|
412
421
|
let GeneratorService = class GeneratorService {
|
|
413
422
|
constructor(logger, configService, versionManager) {
|
|
414
423
|
this.logger = logger;
|
|
@@ -416,15 +425,32 @@ let GeneratorService = class GeneratorService {
|
|
|
416
425
|
this.versionManager = versionManager;
|
|
417
426
|
this.configPath = 'generator-cli.generators';
|
|
418
427
|
this.enabled = this.configService.has(this.configPath);
|
|
419
|
-
this.cmd = (appendix) =>
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
428
|
+
this.cmd = (customGenerator, appendix, dockerVolumes = {}) => {
|
|
429
|
+
if (this.configService.useDocker) {
|
|
430
|
+
const volumes = Object.entries(dockerVolumes).map(([k, v]) => `-v "${v}:${k}"`).join(' ');
|
|
431
|
+
return [
|
|
432
|
+
`docker run --rm`,
|
|
433
|
+
volumes,
|
|
434
|
+
this.versionManager.getDockerImageName(),
|
|
435
|
+
'generate',
|
|
436
|
+
appendix
|
|
437
|
+
].join(' ');
|
|
438
|
+
}
|
|
439
|
+
const cliPath = this.versionManager.filePath();
|
|
440
|
+
const subCmd = customGenerator
|
|
441
|
+
? `-cp "${[cliPath, customGenerator].join(this.isWin() ? ';' : ':')}" org.openapitools.codegen.OpenAPIGenerator`
|
|
442
|
+
: `-jar "${cliPath}"`;
|
|
443
|
+
return [
|
|
444
|
+
'java',
|
|
445
|
+
process.env['JAVA_OPTS'],
|
|
446
|
+
subCmd,
|
|
447
|
+
'generate',
|
|
448
|
+
appendix,
|
|
449
|
+
].filter(lodash__WEBPACK_IMPORTED_MODULE_2__["isString"]).join(' ');
|
|
450
|
+
};
|
|
451
|
+
this.isWin = () => process.platform === "win32";
|
|
426
452
|
}
|
|
427
|
-
generate(...keys) {
|
|
453
|
+
generate(customGenerator, ...keys) {
|
|
428
454
|
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
|
|
429
455
|
const cwd = this.configService.cwd;
|
|
430
456
|
const generators = Object.entries(this.configService.get(this.configPath, {}));
|
|
@@ -432,13 +458,13 @@ let GeneratorService = class GeneratorService {
|
|
|
432
458
|
.filter(([key, { disabled }]) => {
|
|
433
459
|
if (!disabled)
|
|
434
460
|
return true;
|
|
435
|
-
this.logger.log(
|
|
461
|
+
this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_7__["grey"](`[info] Skip ${chalk__WEBPACK_IMPORTED_MODULE_7__["yellow"](key)}, because this generator is disabled`));
|
|
436
462
|
return false;
|
|
437
463
|
})
|
|
438
464
|
.filter(([key]) => {
|
|
439
465
|
if (!keys.length || keys.includes(key))
|
|
440
466
|
return true;
|
|
441
|
-
this.logger.log(
|
|
467
|
+
this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_7__["grey"](`[info] Skip ${chalk__WEBPACK_IMPORTED_MODULE_7__["yellow"](key)}, because only ${keys.map((k) => chalk__WEBPACK_IMPORTED_MODULE_7__["yellow"](k)).join(', ')} shall run`));
|
|
442
468
|
return false;
|
|
443
469
|
});
|
|
444
470
|
const globsWithNoMatches = [];
|
|
@@ -448,16 +474,16 @@ let GeneratorService = class GeneratorService {
|
|
|
448
474
|
if (!globPattern) {
|
|
449
475
|
return [{
|
|
450
476
|
name: `[${name}] ${params.inputSpec}`,
|
|
451
|
-
command: this.buildCommand(cwd, params)
|
|
477
|
+
command: this.buildCommand(cwd, params, customGenerator)
|
|
452
478
|
}];
|
|
453
479
|
}
|
|
454
|
-
const specFiles =
|
|
480
|
+
const specFiles = glob__WEBPACK_IMPORTED_MODULE_6__["sync"](globPattern, { cwd });
|
|
455
481
|
if (specFiles.length < 1) {
|
|
456
482
|
globsWithNoMatches.push(globPattern);
|
|
457
483
|
}
|
|
458
|
-
return
|
|
484
|
+
return glob__WEBPACK_IMPORTED_MODULE_6__["sync"](globPattern, { cwd }).map(spec => ({
|
|
459
485
|
name: `[${name}] ${spec}`,
|
|
460
|
-
command: this.buildCommand(cwd, params, spec)
|
|
486
|
+
command: this.buildCommand(cwd, params, customGenerator, spec)
|
|
461
487
|
}));
|
|
462
488
|
}));
|
|
463
489
|
const generated = commands.length > 0 && (yield (() => Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
|
|
@@ -470,7 +496,7 @@ let GeneratorService = class GeneratorService {
|
|
|
470
496
|
return false;
|
|
471
497
|
}
|
|
472
498
|
}))());
|
|
473
|
-
globsWithNoMatches.map(g => this.logger.log(
|
|
499
|
+
globsWithNoMatches.map(g => this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_7__["yellow"](`[warn] Did not found any file matching glob "${g}"`)));
|
|
474
500
|
return generated;
|
|
475
501
|
});
|
|
476
502
|
}
|
|
@@ -478,12 +504,13 @@ let GeneratorService = class GeneratorService {
|
|
|
478
504
|
this.logger.log(Object(lodash__WEBPACK_IMPORTED_MODULE_2__["sortBy"])(res, 'command.name').map(({ exitCode, command }) => {
|
|
479
505
|
const failed = exitCode > 0;
|
|
480
506
|
return [
|
|
481
|
-
|
|
482
|
-
...(failed ? [
|
|
507
|
+
chalk__WEBPACK_IMPORTED_MODULE_7__[failed ? 'red' : 'green'](command.name),
|
|
508
|
+
...(failed ? [chalk__WEBPACK_IMPORTED_MODULE_7__["yellow"](` ${command.command}\n`)] : []),
|
|
483
509
|
].join('\n');
|
|
484
510
|
}).join('\n'));
|
|
485
511
|
}
|
|
486
|
-
buildCommand(cwd, params, specFile) {
|
|
512
|
+
buildCommand(cwd, params, customGenerator, specFile) {
|
|
513
|
+
const dockerVolumes = {};
|
|
487
514
|
const absoluteSpecPath = specFile ? path__WEBPACK_IMPORTED_MODULE_4__["resolve"](cwd, specFile) : String(params.inputSpec);
|
|
488
515
|
const command = Object.entries(Object.assign({ inputSpec: absoluteSpecPath }, params)).map(([k, v]) => {
|
|
489
516
|
const key = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["kebabCase"])(k);
|
|
@@ -497,6 +524,15 @@ let GeneratorService = class GeneratorService {
|
|
|
497
524
|
case 'boolean':
|
|
498
525
|
return undefined;
|
|
499
526
|
default:
|
|
527
|
+
if (this.configService.useDocker) {
|
|
528
|
+
if (key === 'output') {
|
|
529
|
+
fs_extra__WEBPACK_IMPORTED_MODULE_5__["ensureDirSync"](v);
|
|
530
|
+
}
|
|
531
|
+
if (fs_extra__WEBPACK_IMPORTED_MODULE_5__["existsSync"](v)) {
|
|
532
|
+
dockerVolumes[`/local/${key}`] = path__WEBPACK_IMPORTED_MODULE_4__["resolve"](cwd, v);
|
|
533
|
+
return `"/local/${key}"`;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
500
536
|
return `"${v}"`;
|
|
501
537
|
}
|
|
502
538
|
})();
|
|
@@ -515,17 +551,17 @@ let GeneratorService = class GeneratorService {
|
|
|
515
551
|
relPath: specFile,
|
|
516
552
|
ext: ext.split('.').slice(-1).pop()
|
|
517
553
|
};
|
|
518
|
-
return this.cmd(Object.entries(placeholders)
|
|
554
|
+
return this.cmd(customGenerator, Object.entries(placeholders)
|
|
519
555
|
.filter(([, replacement]) => !!replacement)
|
|
520
556
|
.reduce((cmd, [search, replacement]) => {
|
|
521
557
|
return cmd.split(`#{${search}}`).join(replacement);
|
|
522
|
-
}, command));
|
|
558
|
+
}, command), dockerVolumes);
|
|
523
559
|
}
|
|
524
560
|
};
|
|
525
561
|
GeneratorService = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
|
|
526
562
|
Object(_nestjs_common__WEBPACK_IMPORTED_MODULE_1__["Injectable"])(),
|
|
527
|
-
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(0, Object(_nestjs_common__WEBPACK_IMPORTED_MODULE_1__["Inject"])(
|
|
528
|
-
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:paramtypes", [typeof (_a = typeof
|
|
563
|
+
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(0, Object(_nestjs_common__WEBPACK_IMPORTED_MODULE_1__["Inject"])(_constants__WEBPACK_IMPORTED_MODULE_10__["LOGGER"])),
|
|
564
|
+
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:paramtypes", [typeof (_a = typeof _constants__WEBPACK_IMPORTED_MODULE_10__["LOGGER"] !== "undefined" && _constants__WEBPACK_IMPORTED_MODULE_10__["LOGGER"]) === "function" ? _a : Object, typeof (_b = typeof _config_service__WEBPACK_IMPORTED_MODULE_9__["ConfigService"] !== "undefined" && _config_service__WEBPACK_IMPORTED_MODULE_9__["ConfigService"]) === "function" ? _b : Object, typeof (_c = typeof _version_manager_service__WEBPACK_IMPORTED_MODULE_8__["VersionManagerService"] !== "undefined" && _version_manager_service__WEBPACK_IMPORTED_MODULE_8__["VersionManagerService"]) === "function" ? _c : Object])
|
|
529
565
|
], GeneratorService);
|
|
530
566
|
|
|
531
567
|
|
|
@@ -590,7 +626,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
590
626
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../constants */ "./apps/generator-cli/src/app/constants/index.ts");
|
|
591
627
|
/* harmony import */ var _generator_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./generator.service */ "./apps/generator-cli/src/app/services/generator.service.ts");
|
|
592
628
|
/* harmony import */ var _version_manager_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./version-manager.service */ "./apps/generator-cli/src/app/services/version-manager.service.ts");
|
|
593
|
-
var
|
|
629
|
+
/* harmony import */ var _config_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./config.service */ "./apps/generator-cli/src/app/services/config.service.ts");
|
|
630
|
+
var _a, _b, _c, _d, _e;
|
|
631
|
+
|
|
594
632
|
|
|
595
633
|
|
|
596
634
|
|
|
@@ -601,10 +639,11 @@ var _a, _b, _c, _d;
|
|
|
601
639
|
|
|
602
640
|
|
|
603
641
|
let PassThroughService = class PassThroughService {
|
|
604
|
-
constructor(logger, program, versionManager, generatorService) {
|
|
642
|
+
constructor(logger, program, versionManager, configService, generatorService) {
|
|
605
643
|
this.logger = logger;
|
|
606
644
|
this.program = program;
|
|
607
645
|
this.versionManager = versionManager;
|
|
646
|
+
this.configService = configService;
|
|
608
647
|
this.generatorService = generatorService;
|
|
609
648
|
this.passThrough = (cmd) => {
|
|
610
649
|
const args = [cmd.name(), ...cmd.args];
|
|
@@ -670,11 +709,13 @@ let PassThroughService = class PassThroughService {
|
|
|
670
709
|
commands.get('generate')
|
|
671
710
|
.option("--generator-key <generator...>", "Run generator by key. Separate by comma to run many generators")
|
|
672
711
|
.action((_, cmd) => Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
|
|
712
|
+
var _a;
|
|
673
713
|
if (cmd.args.length === 0 || cmd.opts().generatorKey) {
|
|
714
|
+
const customGenerator = (_a = this.program.opts()) === null || _a === void 0 ? void 0 : _a.customGenerator;
|
|
674
715
|
const generatorKeys = cmd.opts().generatorKey || [];
|
|
675
716
|
if (this.generatorService.enabled) {
|
|
676
717
|
// @todo cover by unit test
|
|
677
|
-
if (!(yield this.generatorService.generate(...generatorKeys))) {
|
|
718
|
+
if (!(yield this.generatorService.generate(customGenerator, ...generatorKeys))) {
|
|
678
719
|
this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_2__["red"]('Code generation failed'));
|
|
679
720
|
process.exit(1);
|
|
680
721
|
}
|
|
@@ -687,6 +728,12 @@ let PassThroughService = class PassThroughService {
|
|
|
687
728
|
}
|
|
688
729
|
cmd() {
|
|
689
730
|
var _a;
|
|
731
|
+
if (this.configService.useDocker) {
|
|
732
|
+
return [
|
|
733
|
+
`docker run --rm -v "${this.configService.cwd}:/local"`,
|
|
734
|
+
this.versionManager.getDockerImageName(),
|
|
735
|
+
].join(' ');
|
|
736
|
+
}
|
|
690
737
|
const customGenerator = (_a = this.program.opts()) === null || _a === void 0 ? void 0 : _a.customGenerator;
|
|
691
738
|
const cliPath = this.versionManager.filePath();
|
|
692
739
|
const subCmd = customGenerator
|
|
@@ -702,7 +749,7 @@ PassThroughService = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
|
|
|
702
749
|
Object(_nestjs_common__WEBPACK_IMPORTED_MODULE_1__["Injectable"])(),
|
|
703
750
|
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(0, Object(_nestjs_common__WEBPACK_IMPORTED_MODULE_1__["Inject"])(_constants__WEBPACK_IMPORTED_MODULE_6__["LOGGER"])),
|
|
704
751
|
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(1, Object(_nestjs_common__WEBPACK_IMPORTED_MODULE_1__["Inject"])(_constants__WEBPACK_IMPORTED_MODULE_6__["COMMANDER_PROGRAM"])),
|
|
705
|
-
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:paramtypes", [typeof (_a = typeof _constants__WEBPACK_IMPORTED_MODULE_6__["LOGGER"] !== "undefined" && _constants__WEBPACK_IMPORTED_MODULE_6__["LOGGER"]) === "function" ? _a : Object, typeof (_b = typeof commander__WEBPACK_IMPORTED_MODULE_4__["Command"] !== "undefined" && commander__WEBPACK_IMPORTED_MODULE_4__["Command"]) === "function" ? _b : Object, typeof (_c = typeof _version_manager_service__WEBPACK_IMPORTED_MODULE_8__["VersionManagerService"] !== "undefined" && _version_manager_service__WEBPACK_IMPORTED_MODULE_8__["VersionManagerService"]) === "function" ? _c : Object, typeof (_d = typeof _generator_service__WEBPACK_IMPORTED_MODULE_7__["GeneratorService"] !== "undefined" && _generator_service__WEBPACK_IMPORTED_MODULE_7__["GeneratorService"]) === "function" ?
|
|
752
|
+
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:paramtypes", [typeof (_a = typeof _constants__WEBPACK_IMPORTED_MODULE_6__["LOGGER"] !== "undefined" && _constants__WEBPACK_IMPORTED_MODULE_6__["LOGGER"]) === "function" ? _a : Object, typeof (_b = typeof commander__WEBPACK_IMPORTED_MODULE_4__["Command"] !== "undefined" && commander__WEBPACK_IMPORTED_MODULE_4__["Command"]) === "function" ? _b : Object, typeof (_c = typeof _version_manager_service__WEBPACK_IMPORTED_MODULE_8__["VersionManagerService"] !== "undefined" && _version_manager_service__WEBPACK_IMPORTED_MODULE_8__["VersionManagerService"]) === "function" ? _c : Object, typeof (_d = typeof _config_service__WEBPACK_IMPORTED_MODULE_9__["ConfigService"] !== "undefined" && _config_service__WEBPACK_IMPORTED_MODULE_9__["ConfigService"]) === "function" ? _d : Object, typeof (_e = typeof _generator_service__WEBPACK_IMPORTED_MODULE_7__["GeneratorService"] !== "undefined" && _generator_service__WEBPACK_IMPORTED_MODULE_7__["GeneratorService"]) === "function" ? _e : Object])
|
|
706
753
|
], PassThroughService);
|
|
707
754
|
|
|
708
755
|
|
|
@@ -813,6 +860,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
813
860
|
/* harmony import */ var _config_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./config.service */ "./apps/generator-cli/src/app/services/config.service.ts");
|
|
814
861
|
/* harmony import */ var _config_schema_json__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../config.schema.json */ "./apps/generator-cli/src/config.schema.json");
|
|
815
862
|
var _config_schema_json__WEBPACK_IMPORTED_MODULE_11___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../../config.schema.json */ "./apps/generator-cli/src/config.schema.json", 1);
|
|
863
|
+
/* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! child_process */ "child_process");
|
|
864
|
+
/* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(child_process__WEBPACK_IMPORTED_MODULE_12__);
|
|
816
865
|
var _a, _b, _c;
|
|
817
866
|
|
|
818
867
|
|
|
@@ -826,6 +875,7 @@ var _a, _b, _c;
|
|
|
826
875
|
|
|
827
876
|
|
|
828
877
|
|
|
878
|
+
|
|
829
879
|
const mvn = {
|
|
830
880
|
repo: 'https://search.maven.org',
|
|
831
881
|
groupId: 'org.openapitools',
|
|
@@ -874,6 +924,9 @@ let VersionManagerService = class VersionManagerService {
|
|
|
874
924
|
getSelectedVersion() {
|
|
875
925
|
return this.configService.get('generator-cli.version');
|
|
876
926
|
}
|
|
927
|
+
getDockerImageName(versionName) {
|
|
928
|
+
return `${this.configService.dockerImageName}:v${versionName || this.getSelectedVersion()}`;
|
|
929
|
+
}
|
|
877
930
|
setSelectedVersion(versionName) {
|
|
878
931
|
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
|
|
879
932
|
const downloaded = yield this.downloadIfNeeded(versionName);
|
|
@@ -885,13 +938,33 @@ let VersionManagerService = class VersionManagerService {
|
|
|
885
938
|
}
|
|
886
939
|
remove(versionName) {
|
|
887
940
|
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
|
|
888
|
-
|
|
941
|
+
if (this.configService.useDocker) {
|
|
942
|
+
yield new Promise(resolve => {
|
|
943
|
+
Object(child_process__WEBPACK_IMPORTED_MODULE_12__["spawn"])('docker', ['rmi', this.getDockerImageName(versionName)], {
|
|
944
|
+
stdio: 'inherit',
|
|
945
|
+
shell: true
|
|
946
|
+
}).on('exit', () => resolve());
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
else {
|
|
950
|
+
fs_extra__WEBPACK_IMPORTED_MODULE_4__["removeSync"](this.filePath(versionName));
|
|
951
|
+
}
|
|
889
952
|
this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_7__["green"](`Removed ${versionName}`));
|
|
890
953
|
});
|
|
891
954
|
}
|
|
892
955
|
download(versionName) {
|
|
893
956
|
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
|
|
894
957
|
this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_7__["yellow"](`Download ${versionName} ...`));
|
|
958
|
+
if (this.configService.useDocker) {
|
|
959
|
+
yield new Promise(resolve => {
|
|
960
|
+
Object(child_process__WEBPACK_IMPORTED_MODULE_12__["spawn"])('docker', ['pull', this.getDockerImageName(versionName)], {
|
|
961
|
+
stdio: 'inherit',
|
|
962
|
+
shell: true
|
|
963
|
+
}).on('exit', () => resolve());
|
|
964
|
+
});
|
|
965
|
+
this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_7__["green"](`Downloaded ${versionName}`));
|
|
966
|
+
return;
|
|
967
|
+
}
|
|
895
968
|
const downloadLink = this.createDownloadLink(versionName);
|
|
896
969
|
const filePath = this.filePath(versionName);
|
|
897
970
|
try {
|
|
@@ -929,6 +1002,10 @@ let VersionManagerService = class VersionManagerService {
|
|
|
929
1002
|
});
|
|
930
1003
|
}
|
|
931
1004
|
isDownloaded(versionName) {
|
|
1005
|
+
if (this.configService.useDocker) {
|
|
1006
|
+
const { status } = Object(child_process__WEBPACK_IMPORTED_MODULE_12__["spawnSync"])('docker', ['image', 'inspect', this.getDockerImageName(versionName)]);
|
|
1007
|
+
return status === 0;
|
|
1008
|
+
}
|
|
932
1009
|
return fs_extra__WEBPACK_IMPORTED_MODULE_4__["existsSync"](path__WEBPACK_IMPORTED_MODULE_5__["resolve"](this.storage, `${versionName}.jar`));
|
|
933
1010
|
}
|
|
934
1011
|
filterVersionsByTags(versions, tags) {
|
|
@@ -979,7 +1056,7 @@ VersionManagerService = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])
|
|
|
979
1056
|
/*! exports provided: $id, $schema, title, type, required, additionalProperties, properties, definitions, default */
|
|
980
1057
|
/***/ (function(module) {
|
|
981
1058
|
|
|
982
|
-
module.exports = JSON.parse("{\"$id\":\"https://openapitools.org/openapi-generator-cli/config.schema.json\",\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"OpenAPI Generator CLI - Config\",\"type\":\"object\",\"required\":[\"generator-cli\"],\"additionalProperties\":false,\"properties\":{\"$schema\":{\"type\":\"string\"},\"spaces\":{\"type\":\"number\",\"default\":2},\"generator-cli\":{\"type\":\"object\",\"required\":[\"version\"],\"properties\":{\"version\":{\"type\":\"string\"},\"storageDir\":{\"type\":\"string\"},\"repository\":{\"queryUrl\":{\"type\":\"string\",\"default\":\"https://search.maven.org/solrsearch/select?q=g:${group.id}+AND+a:${artifact.id}&core=gav&start=0&rows=200\"},\"downloadUrl\":{\"type\":\"string\",\"default\":\"https://repo1.maven.org/maven2/${groupId}/${artifactId}/${versionName}/${artifactId}-${versionName}.jar\"}},\"generators\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/generator\"}}}}},\"definitions\":{\"strOrAnyObject\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}]},\"generator\":{\"type\":\"object\",\"required\":[\"glob\",\"output\",\"generatorName\"],\"properties\":{\"glob\":{\"type\":\"string\",\"minLength\":1},\"output\":{\"type\":\"string\",\"minLength\":1},\"disabled\":{\"type\":\"boolean\",\"default\":false},\"generatorName\":{\"description\":\"generator to use (see list command for list)\",\"anyOf\":[{\"type\":\"string\"},{\"type\":\"string\",\"enum\":[\"ada\",\"ada-server\",\"android\",\"apache2\",\"apex\",\"asciidoc\",\"aspnetcore\",\"avro-schema\",\"bash\",\"c\",\"clojure\",\"cpp-pistache-server\",\"cpp-qt5-client\",\"cpp-qt5-qhttpengine-server\",\"cpp-restbed-server\",\"cpp-restsdk\",\"cpp-tizen\",\"csharp\",\"csharp-nancyfx\",\"csharp-netcore\",\"cwiki\",\"dart\",\"dart-dio\",\"dart-jaguar\",\"dynamic-html\",\"eiffel\",\"elixir\",\"elm\",\"erlang-client\",\"erlang-proper\",\"erlang-server\",\"flash\",\"fsharp-functions\",\"fsharp-giraffe-server\",\"go\",\"go-experimental\",\"go-gin-server\",\"go-server\",\"graphql-nodejs-express-server\",\"graphql-schema\",\"groovy\",\"haskell\",\"haskell-http-client\",\"html\",\"html2\",\"java\",\"java-inflector\",\"java-msf4j\",\"java-pkmst\",\"java-play-framework\",\"java-undertow-server\",\"java-vertx\",\"java-vertx-web\",\"javascript\",\"javascript-apollo\",\"javascript-closure-angular\",\"javascript-flowtyped\",\"jaxrs-cxf\",\"jaxrs-cxf-cdi\",\"jaxrs-cxf-client\",\"jaxrs-cxf-extended\",\"jaxrs-jersey\",\"jaxrs-resteasy\",\"jaxrs-resteasy-eap\",\"jaxrs-spec\",\"jmeter\",\"k6\",\"kotlin\",\"kotlin-server\",\"kotlin-spring\",\"kotlin-vertx\",\"lua\",\"markdown\",\"mysql-schema\",\"nim\",\"nodejs-express-server\",\"objc\",\"ocaml\",\"openapi\",\"openapi-yaml\",\"perl\",\"php\",\"php-laravel\",\"php-lumen\",\"php-silex\",\"php-slim4\",\"php-symfony\",\"php-ze-ph\",\"powershell\",\"powershell-experimental\",\"protobuf-schema\",\"python\",\"python-aiohttp\",\"python-blueplanet\",\"python-experimental\",\"python-flask\",\"r\",\"ruby\",\"ruby-on-rails\",\"ruby-sinatra\",\"rust\",\"rust-server\",\"scala-akka\",\"scala-akka-http-server\",\"scala-finch\",\"scala-gatling\",\"scala-lagom-server\",\"scala-play-server\",\"scala-sttp\",\"scalatra\",\"scalaz\",\"spring\",\"swift4\",\"swift5\",\"typescript-angular\",\"typescript-angularjs\",\"typescript-aurelia\",\"typescript-axios\",\"typescript-fetch\",\"typescript-inversify\",\"typescript-jquery\",\"typescript-node\",\"typescript-redux-query\",\"typescript-rxjs\"]}]},\"auth\":{\"type\":\"string\",\"description\":\"adds authorization headers when fetching the OpenAPI definitions remotely. Pass in a URL-encoded string of name:header with a comma separating multiple values\"},\"apiNameSuffix\":{\"type\":\"string\",\"description\":\"suffix that will be appended to all API names ('tags'). Default: Api. e.g. Pet => PetApi. Note: Only ruby, python, jaxrs generators support this feature at the moment\"},\"apiPackage\":{\"type\":\"string\",\"description\":\"package for generated api classes\"},\"artifactId\":{\"type\":\"string\",\"description\":\"artifactId in generated pom.xml. This also becomes part of the generated library's filename\"},\"artifactVersion\":{\"type\":\"string\",\"description\":\"artifact version in generated pom.xml. This also becomes part of the generated library's filename\"},\"config\":{\"type\":\"string\",\"description\":\"path to configuration file. It can be JSON or YAML\"},\"dryRun\":{\"type\":\"boolean\",\"description\":\"try things out and report on potential changes (without actually making changes)\"},\"engine\":{\"type\":\"string\",\"enum\":[\"mustache\",\"handlebars\"],\"description\":\"templating engine: \\\"mustache\\\" (default) or \\\"handlebars\\\" (beta)\"},\"enablePostProcessFile\":{\"type\":\"boolean\",\"description\":\"enable post-processing file using environment variables\"},\"generateAliasAsModel\":{\"type\":\"boolean\",\"description\":\"generate model implementation for aliases to map and array schemas. An 'alias' is an array, map, or list which is defined inline in a OpenAPI document and becomes a model in the generated code. A 'map' schema is an object that can have undeclared properties, i.e. the 'additionalproperties' attribute is set on that object. An 'array' schema is a list of sub schemas in a OAS document\"},\"gitHost\":{\"type\":\"string\",\"description\":\"git host, e.g. gitlab.com\"},\"gitRepoId\":{\"type\":\"string\",\"description\":\"git repo ID, e.g. openapi-generator\"},\"gitUserId\":{\"type\":\"string\",\"description\":\"git user ID, e.g. openapitools\"},\"globalProperty\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"sets specified global properties (previously called 'system properties') in the format of name=value,name=value (or multiple options, each with name=value)\"},\"groupId\":{\"type\":\"string\",\"description\":\"groupId in generated pom.xml\"},\"httpUserAgent\":{\"type\":\"string\",\"description\":\"HTTP user agent, e.g. codegen_csharp_api_client, default to 'OpenAPI-Generator/{packageVersion}}/{language}'\"},\"inputSpec\":{\"type\":\"string\",\"description\":\"location of the OpenAPI spec, as URL or file (required if not loaded via config using -c)\"},\"ignoreFileOverride\":{\"type\":\"string\",\"description\":\"specifies an override location for the .openapi-generator-ignore file. Most useful on initial generation.\\n\"},\"importMappings\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"specifies mappings between a given class and the import that should be used for that class in the format of type=import,type=import. You can also have multiple occurrences of this option\"},\"instantiationTypes\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"sets instantiation type mappings in the format of type=instantiatedType,type=instantiatedType.For example (in Java): array=ArrayList,map=HashMap. In other words array types will get instantiated as ArrayList in generated code. You can also have multiple occurrences of this option\"},\"invokerPackage\":{\"type\":\"string\",\"description\":\"root package for generated code\"},\"languageSpecificPrimitives\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double. You can also have multiple occurrences of this option\"},\"legacyDiscriminatorBehavior\":{\"type\":\"boolean\",\"description\":\"this flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}\"},\"library\":{\"type\":\"string\",\"description\":\"library template (sub-template)\"},\"logToStderr\":{\"type\":\"boolean\",\"description\":\"write all log messages (not just errors) to STDOUT. Useful for piping the JSON output of debug options (e.g. `-DdebugOperations`) to an external parser directly while testing a generator\"},\"minimalUpdate\":{\"type\":\"boolean\",\"description\":\"only write output files that have changed\"},\"modelNamePrefix\":{\"type\":\"string\",\"description\":\"prefix that will be prepended to all model names\"},\"modelNameSuffix\":{\"type\":\"string\",\"description\":\"suffix that will be appended to all model names\"},\"modelPackage\":{\"type\":\"string\",\"description\":\"package for generated models\"},\"additionalProperties\":{\"description\":\"sets additional properties that can be referenced by the mustache templates in the format of name=value,name=value. You can also have multiple occurrences of this option\",\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}]},\"packageName\":{\"type\":\"string\",\"description\":\"package for generated classes (where supported)\"},\"releaseNote\":{\"type\":\"string\",\"description\":\"release note, default to 'Minor update'\"},\"removeOperationIdPrefix\":{\"type\":\"boolean\",\"description\":\"remove prefix of operationId, e.g. config_getId => getId\"},\"reservedWordsMappings\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"specifies how a reserved name should be escaped to. Otherwise, the default _<name> is used. For example id=identifier. You can also have multiple occurrences of this option\"},\"skipOverwrite\":{\"type\":\"boolean\",\"description\":\"specifies if the existing files should be overwritten during the generation\"},\"serverVariables\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"sets server variables overrides for spec documents which support variable templating of servers\"},\"skipValidateSpec\":{\"type\":\"boolean\",\"description\":\"skips the default behavior of validating an input specification\"},\"strictSpec\":{\"type\":\"boolean\",\"description\":\"'MUST' and 'SHALL' wording in OpenAPI spec is strictly adhered to. e.g. when false, no fixes will be applied to documents which pass validation but don't follow the spec\"},\"templateDir\":{\"type\":\"string\",\"description\":\"folder containing the template files\"},\"typeMappings\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"sets mappings between OpenAPI spec types and generated code types in the format of OpenAPIType=generatedType,OpenAPIType=generatedType. For example: array=List,map=Map,string=String. You can also have multiple occurrences of this option\"},\"verbose\":{\"type\":\"boolean\",\"description\":\"verbose mode\"}}}}}");
|
|
1059
|
+
module.exports = JSON.parse("{\"$id\":\"https://openapitools.org/openapi-generator-cli/config.schema.json\",\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"OpenAPI Generator CLI - Config\",\"type\":\"object\",\"required\":[\"generator-cli\"],\"additionalProperties\":false,\"properties\":{\"$schema\":{\"type\":\"string\"},\"spaces\":{\"type\":\"number\",\"default\":2},\"generator-cli\":{\"type\":\"object\",\"required\":[\"version\"],\"properties\":{\"version\":{\"type\":\"string\"},\"storageDir\":{\"type\":\"string\"},\"repository\":{\"queryUrl\":{\"type\":\"string\",\"default\":\"https://search.maven.org/solrsearch/select?q=g:${group.id}+AND+a:${artifact.id}&core=gav&start=0&rows=200\"},\"downloadUrl\":{\"type\":\"string\",\"default\":\"https://repo1.maven.org/maven2/${groupId}/${artifactId}/${versionName}/${artifactId}-${versionName}.jar\"}},\"useDocker\":{\"type\":\"boolean\",\"default\":false},\"dockerImageName\":{\"type\":\"string\",\"default\":\"openapitools/openapi-generator-cli\"},\"generators\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/generator\"}}}}},\"definitions\":{\"strOrAnyObject\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}]},\"generator\":{\"type\":\"object\",\"anyOf\":[{\"required\":[\"inputSpec\",\"output\",\"generatorName\"]},{\"required\":[\"glob\",\"output\",\"generatorName\"]}],\"properties\":{\"glob\":{\"description\":\"matches local specification files using a glob pattern\",\"type\":\"string\",\"minLength\":1},\"output\":{\"type\":\"string\",\"minLength\":1},\"disabled\":{\"type\":\"boolean\",\"default\":false},\"generatorName\":{\"description\":\"generator to use (see list command for list)\",\"anyOf\":[{\"type\":\"string\"},{\"type\":\"string\",\"enum\":[\"ada\",\"ada-server\",\"android\",\"apache2\",\"apex\",\"asciidoc\",\"aspnetcore\",\"avro-schema\",\"bash\",\"c\",\"clojure\",\"cpp-pistache-server\",\"cpp-qt5-client\",\"cpp-qt5-qhttpengine-server\",\"cpp-restbed-server\",\"cpp-restsdk\",\"cpp-tizen\",\"csharp\",\"csharp-nancyfx\",\"csharp-netcore\",\"cwiki\",\"dart\",\"dart-dio\",\"dart-jaguar\",\"dynamic-html\",\"eiffel\",\"elixir\",\"elm\",\"erlang-client\",\"erlang-proper\",\"erlang-server\",\"flash\",\"fsharp-functions\",\"fsharp-giraffe-server\",\"go\",\"go-experimental\",\"go-gin-server\",\"go-server\",\"graphql-nodejs-express-server\",\"graphql-schema\",\"groovy\",\"haskell\",\"haskell-http-client\",\"html\",\"html2\",\"java\",\"java-inflector\",\"java-msf4j\",\"java-pkmst\",\"java-play-framework\",\"java-undertow-server\",\"java-vertx\",\"java-vertx-web\",\"javascript\",\"javascript-apollo\",\"javascript-closure-angular\",\"javascript-flowtyped\",\"jaxrs-cxf\",\"jaxrs-cxf-cdi\",\"jaxrs-cxf-client\",\"jaxrs-cxf-extended\",\"jaxrs-jersey\",\"jaxrs-resteasy\",\"jaxrs-resteasy-eap\",\"jaxrs-spec\",\"jmeter\",\"k6\",\"kotlin\",\"kotlin-server\",\"kotlin-spring\",\"kotlin-vertx\",\"lua\",\"markdown\",\"mysql-schema\",\"nim\",\"nodejs-express-server\",\"objc\",\"ocaml\",\"openapi\",\"openapi-yaml\",\"perl\",\"php\",\"php-laravel\",\"php-lumen\",\"php-silex\",\"php-slim4\",\"php-symfony\",\"php-ze-ph\",\"powershell\",\"powershell-experimental\",\"protobuf-schema\",\"python\",\"python-aiohttp\",\"python-blueplanet\",\"python-experimental\",\"python-flask\",\"r\",\"ruby\",\"ruby-on-rails\",\"ruby-sinatra\",\"rust\",\"rust-server\",\"scala-akka\",\"scala-akka-http-server\",\"scala-finch\",\"scala-gatling\",\"scala-lagom-server\",\"scala-play-server\",\"scala-sttp\",\"scalatra\",\"scalaz\",\"spring\",\"swift4\",\"swift5\",\"typescript-angular\",\"typescript-angularjs\",\"typescript-aurelia\",\"typescript-axios\",\"typescript-fetch\",\"typescript-inversify\",\"typescript-jquery\",\"typescript-node\",\"typescript-redux-query\",\"typescript-rxjs\"]}]},\"auth\":{\"type\":\"string\",\"description\":\"adds authorization headers when fetching the OpenAPI definitions remotely. Pass in a URL-encoded string of name:header with a comma separating multiple values\"},\"apiNameSuffix\":{\"type\":\"string\",\"description\":\"suffix that will be appended to all API names ('tags'). Default: Api. e.g. Pet => PetApi. Note: Only ruby, python, jaxrs generators support this feature at the moment\"},\"apiPackage\":{\"type\":\"string\",\"description\":\"package for generated api classes\"},\"artifactId\":{\"type\":\"string\",\"description\":\"artifactId in generated pom.xml. This also becomes part of the generated library's filename\"},\"artifactVersion\":{\"type\":\"string\",\"description\":\"artifact version in generated pom.xml. This also becomes part of the generated library's filename\"},\"config\":{\"type\":\"string\",\"description\":\"path to configuration file. It can be JSON or YAML\"},\"dryRun\":{\"type\":\"boolean\",\"description\":\"try things out and report on potential changes (without actually making changes)\"},\"engine\":{\"type\":\"string\",\"enum\":[\"mustache\",\"handlebars\"],\"description\":\"templating engine: \\\"mustache\\\" (default) or \\\"handlebars\\\" (beta)\"},\"enablePostProcessFile\":{\"type\":\"boolean\",\"description\":\"enable post-processing file using environment variables\"},\"generateAliasAsModel\":{\"type\":\"boolean\",\"description\":\"generate model implementation for aliases to map and array schemas. An 'alias' is an array, map, or list which is defined inline in a OpenAPI document and becomes a model in the generated code. A 'map' schema is an object that can have undeclared properties, i.e. the 'additionalproperties' attribute is set on that object. An 'array' schema is a list of sub schemas in a OAS document\"},\"gitHost\":{\"type\":\"string\",\"description\":\"git host, e.g. gitlab.com\"},\"gitRepoId\":{\"type\":\"string\",\"description\":\"git repo ID, e.g. openapi-generator\"},\"gitUserId\":{\"type\":\"string\",\"description\":\"git user ID, e.g. openapitools\"},\"globalProperty\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"sets specified global properties (previously called 'system properties') in the format of name=value,name=value (or multiple options, each with name=value)\"},\"groupId\":{\"type\":\"string\",\"description\":\"groupId in generated pom.xml\"},\"httpUserAgent\":{\"type\":\"string\",\"description\":\"HTTP user agent, e.g. codegen_csharp_api_client, default to 'OpenAPI-Generator/{packageVersion}}/{language}'\"},\"inputSpec\":{\"type\":\"string\",\"description\":\"location of the OpenAPI spec, as URL or file (required if not loaded via config using -c)\"},\"ignoreFileOverride\":{\"type\":\"string\",\"description\":\"specifies an override location for the .openapi-generator-ignore file. Most useful on initial generation.\\n\"},\"importMappings\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"specifies mappings between a given class and the import that should be used for that class in the format of type=import,type=import. You can also have multiple occurrences of this option\"},\"instantiationTypes\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"sets instantiation type mappings in the format of type=instantiatedType,type=instantiatedType.For example (in Java): array=ArrayList,map=HashMap. In other words array types will get instantiated as ArrayList in generated code. You can also have multiple occurrences of this option\"},\"invokerPackage\":{\"type\":\"string\",\"description\":\"root package for generated code\"},\"languageSpecificPrimitives\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double. You can also have multiple occurrences of this option\"},\"legacyDiscriminatorBehavior\":{\"type\":\"boolean\",\"description\":\"this flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}\"},\"library\":{\"type\":\"string\",\"description\":\"library template (sub-template)\"},\"logToStderr\":{\"type\":\"boolean\",\"description\":\"write all log messages (not just errors) to STDOUT. Useful for piping the JSON output of debug options (e.g. `-DdebugOperations`) to an external parser directly while testing a generator\"},\"minimalUpdate\":{\"type\":\"boolean\",\"description\":\"only write output files that have changed\"},\"modelNamePrefix\":{\"type\":\"string\",\"description\":\"prefix that will be prepended to all model names\"},\"modelNameSuffix\":{\"type\":\"string\",\"description\":\"suffix that will be appended to all model names\"},\"modelPackage\":{\"type\":\"string\",\"description\":\"package for generated models\"},\"additionalProperties\":{\"description\":\"sets additional properties that can be referenced by the mustache templates in the format of name=value,name=value. You can also have multiple occurrences of this option\",\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}]},\"packageName\":{\"type\":\"string\",\"description\":\"package for generated classes (where supported)\"},\"releaseNote\":{\"type\":\"string\",\"description\":\"release note, default to 'Minor update'\"},\"removeOperationIdPrefix\":{\"type\":\"boolean\",\"description\":\"remove prefix of operationId, e.g. config_getId => getId\"},\"reservedWordsMappings\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"specifies how a reserved name should be escaped to. Otherwise, the default _<name> is used. For example id=identifier. You can also have multiple occurrences of this option\"},\"skipOverwrite\":{\"type\":\"boolean\",\"description\":\"specifies if the existing files should be overwritten during the generation\"},\"serverVariables\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"sets server variables overrides for spec documents which support variable templating of servers\"},\"skipValidateSpec\":{\"type\":\"boolean\",\"description\":\"skips the default behavior of validating an input specification\"},\"strictSpec\":{\"type\":\"boolean\",\"description\":\"'MUST' and 'SHALL' wording in OpenAPI spec is strictly adhered to. e.g. when false, no fixes will be applied to documents which pass validation but don't follow the spec\"},\"templateDir\":{\"type\":\"string\",\"description\":\"folder containing the template files\"},\"typeMappings\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"sets mappings between OpenAPI spec types and generated code types in the format of OpenAPIType=generatedType,OpenAPIType=generatedType. For example: array=List,map=Map,string=String. You can also have multiple occurrences of this option\"},\"verbose\":{\"type\":\"boolean\",\"description\":\"verbose mode\"}}}}}");
|
|
983
1060
|
|
|
984
1061
|
/***/ }),
|
|
985
1062
|
|
package/package.json
CHANGED
|
@@ -27,11 +27,6 @@
|
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"registry": "https://registry.npmjs.org"
|
|
29
29
|
},
|
|
30
|
-
"husky": {
|
|
31
|
-
"hooks": {
|
|
32
|
-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
30
|
"keywords": [
|
|
36
31
|
"rest-api",
|
|
37
32
|
"rest-client",
|
|
@@ -56,7 +51,7 @@
|
|
|
56
51
|
"text": "Please sponsor OpenAPI Generator."
|
|
57
52
|
}
|
|
58
53
|
},
|
|
59
|
-
"version": "2.
|
|
54
|
+
"version": "2.5.0",
|
|
60
55
|
"name": "@openapitools/openapi-generator-cli",
|
|
61
56
|
"description": "A npm package wrapper for OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator), generates which API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)",
|
|
62
57
|
"scripts": {
|
|
@@ -71,20 +66,20 @@
|
|
|
71
66
|
"main.js"
|
|
72
67
|
],
|
|
73
68
|
"dependencies": {
|
|
74
|
-
"@nestjs/common": "8.
|
|
75
|
-
"@nestjs/core": "8.
|
|
69
|
+
"@nestjs/common": "8.4.4",
|
|
70
|
+
"@nestjs/core": "8.4.4",
|
|
76
71
|
"@nuxtjs/opencollective": "0.3.2",
|
|
77
72
|
"chalk": "4.1.2",
|
|
78
73
|
"commander": "8.3.0",
|
|
79
|
-
"compare-versions": "
|
|
74
|
+
"compare-versions": "4.1.3",
|
|
80
75
|
"concurrently": "6.5.1",
|
|
81
76
|
"console.table": "0.10.0",
|
|
82
|
-
"fs-extra": "10.0.
|
|
77
|
+
"fs-extra": "10.0.1",
|
|
83
78
|
"glob": "7.1.6",
|
|
84
|
-
"inquirer": "8.2.
|
|
79
|
+
"inquirer": "8.2.2",
|
|
85
80
|
"lodash": "4.17.21",
|
|
86
81
|
"reflect-metadata": "0.1.13",
|
|
87
|
-
"rxjs": "7.5.
|
|
82
|
+
"rxjs": "7.5.5",
|
|
88
83
|
"tslib": "2.0.3"
|
|
89
84
|
}
|
|
90
85
|
}
|