@asyncapi/cli 1.17.0 → 2.0.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/lib/commands/bundle.d.ts +1 -1
- package/lib/commands/bundle.js +4 -10
- package/lib/commands/config/analytics.d.ts +1 -1
- package/lib/commands/config/analytics.js +3 -8
- package/lib/commands/config/context/add.d.ts +1 -1
- package/lib/commands/config/context/add.js +5 -12
- package/lib/commands/config/context/current.d.ts +1 -1
- package/lib/commands/config/context/current.js +5 -7
- package/lib/commands/config/context/edit.d.ts +1 -1
- package/lib/commands/config/context/edit.js +5 -6
- package/lib/commands/config/context/index.d.ts +1 -1
- package/lib/commands/config/context/index.js +1 -1
- package/lib/commands/config/context/init.d.ts +1 -1
- package/lib/commands/config/context/init.js +4 -5
- package/lib/commands/config/context/list.d.ts +1 -1
- package/lib/commands/config/context/list.js +5 -7
- package/lib/commands/config/context/remove.d.ts +1 -1
- package/lib/commands/config/context/remove.js +5 -6
- package/lib/commands/config/context/use.d.ts +1 -1
- package/lib/commands/config/context/use.js +5 -6
- package/lib/commands/config/index.d.ts +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/versions.d.ts +1 -1
- package/lib/commands/config/versions.js +3 -5
- package/lib/commands/convert.d.ts +1 -1
- package/lib/commands/convert.js +6 -9
- package/lib/commands/diff.d.ts +1 -1
- package/lib/commands/diff.js +9 -28
- package/lib/commands/generate/fromTemplate.d.ts +1 -1
- package/lib/commands/generate/fromTemplate.js +7 -59
- package/lib/commands/generate/index.d.ts +1 -1
- package/lib/commands/generate/index.js +1 -1
- package/lib/commands/generate/models.d.ts +13 -31
- package/lib/commands/generate/models.js +18 -306
- package/lib/commands/new/file.d.ts +1 -1
- package/lib/commands/new/file.js +5 -12
- package/lib/commands/new/glee.d.ts +2 -2
- package/lib/commands/new/glee.js +6 -26
- package/lib/commands/optimize.d.ts +1 -1
- package/lib/commands/optimize.js +5 -9
- package/lib/commands/start/index.d.ts +1 -1
- package/lib/commands/start/index.js +2 -2
- package/lib/commands/start/studio.d.ts +1 -1
- package/lib/commands/start/studio.js +5 -9
- package/lib/commands/validate.d.ts +1 -1
- package/lib/commands/validate.js +6 -6
- package/lib/{base.d.ts → core/base.d.ts} +1 -1
- package/lib/core/flags/bundle.flags.d.ts +7 -0
- package/lib/core/flags/bundle.flags.js +14 -0
- package/lib/core/flags/config/analytics.flags.d.ts +6 -0
- package/lib/core/flags/config/analytics.flags.js +13 -0
- package/lib/core/flags/config/context.flags.d.ts +4 -0
- package/lib/core/flags/config/context.flags.js +16 -0
- package/lib/core/flags/convert.flags.d.ts +5 -0
- package/lib/core/flags/convert.flags.js +12 -0
- package/lib/core/flags/diff.flags.d.ts +12 -0
- package/lib/core/flags/diff.flags.js +29 -0
- package/lib/core/flags/generate/fromTemplate.flags.d.ts +16 -0
- package/lib/core/flags/generate/fromTemplate.flags.js +61 -0
- package/lib/core/flags/generate/models.flags.d.ts +28 -0
- package/lib/core/flags/generate/models.flags.js +14 -0
- package/lib/{flags.d.ts → core/flags/global.flags.d.ts} +3 -0
- package/lib/{flags.js → core/flags/global.flags.js} +7 -1
- package/lib/core/flags/new/file.flags.d.ts +8 -0
- package/lib/core/flags/new/file.flags.js +15 -0
- package/lib/core/flags/new/glee.flags.d.ts +7 -0
- package/lib/core/flags/new/glee.flags.js +28 -0
- package/lib/core/flags/optimize.flags.d.ts +17 -0
- package/lib/core/flags/optimize.flags.js +26 -0
- package/lib/core/flags/start/studio.flags.d.ts +5 -0
- package/lib/core/flags/start/studio.flags.js +12 -0
- package/lib/core/flags/validate.flags.d.ts +7 -0
- package/lib/core/flags/validate.flags.js +10 -0
- package/oclif.manifest.json +49 -48
- package/package.json +2 -2
- /package/lib/{base.js → core/base.js} +0 -0
- /package/lib/{errors → core/errors}/context-error.d.ts +0 -0
- /package/lib/{errors → core/errors}/context-error.js +0 -0
- /package/lib/{errors → core/errors}/diff-error.d.ts +0 -0
- /package/lib/{errors → core/errors}/diff-error.js +0 -0
- /package/lib/{errors → core/errors}/generator-error.d.ts +0 -0
- /package/lib/{errors → core/errors}/generator-error.js +0 -0
- /package/lib/{errors → core/errors}/specification-file.d.ts +0 -0
- /package/lib/{errors → core/errors}/specification-file.js +0 -0
- /package/lib/{errors → core/errors}/validation-error.d.ts +0 -0
- /package/lib/{errors → core/errors}/validation-error.js +0 -0
- /package/lib/{globals.d.ts → core/globals.d.ts} +0 -0
- /package/lib/{globals.js → core/globals.js} +0 -0
- /package/lib/{hooks → core/hooks}/command_not_found/myhook.d.ts +0 -0
- /package/lib/{hooks → core/hooks}/command_not_found/myhook.js +0 -0
- /package/lib/{models → core/models}/Context.d.ts +0 -0
- /package/lib/{models → core/models}/Context.js +0 -0
- /package/lib/{models → core/models}/SpecificationFile.d.ts +0 -0
- /package/lib/{models → core/models}/SpecificationFile.js +0 -0
- /package/lib/{models → core/models}/Studio.d.ts +0 -0
- /package/lib/{models → core/models}/Studio.js +0 -0
- /package/lib/{parser.d.ts → core/parser.d.ts} +0 -0
- /package/lib/{parser.js → core/parser.js} +0 -0
- /package/lib/{utils → core/utils}/generator.d.ts +0 -0
- /package/lib/{utils → core/utils}/generator.js +0 -0
package/lib/commands/validate.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
-
const base_1 = tslib_1.__importDefault(require("../base"));
|
|
6
|
-
const parser_1 = require("../parser");
|
|
7
|
-
const SpecificationFile_1 = require("../models/SpecificationFile");
|
|
8
|
-
const globals_1 = require("../globals");
|
|
9
|
-
const
|
|
5
|
+
const base_1 = tslib_1.__importDefault(require("../core/base"));
|
|
6
|
+
const parser_1 = require("../core/parser");
|
|
7
|
+
const SpecificationFile_1 = require("../core/models/SpecificationFile");
|
|
8
|
+
const globals_1 = require("../core/globals");
|
|
9
|
+
const validate_flags_1 = require("../core/flags/validate.flags");
|
|
10
10
|
class Validate extends base_1.default {
|
|
11
11
|
run() {
|
|
12
12
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -27,7 +27,7 @@ class Validate extends base_1.default {
|
|
|
27
27
|
}
|
|
28
28
|
exports.default = Validate;
|
|
29
29
|
Validate.description = 'validate asyncapi file';
|
|
30
|
-
Validate.flags =
|
|
30
|
+
Validate.flags = (0, validate_flags_1.validateFlags)();
|
|
31
31
|
Validate.args = {
|
|
32
32
|
'spec-file': core_1.Args.string({ description: 'spec path, url, or context-name', required: false }),
|
|
33
33
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
import { MetricMetadata, Recorder } from '@smoya/asyncapi-adoption-metrics';
|
|
3
3
|
import { Parser } from '@asyncapi/parser';
|
|
4
|
-
import { Specification } from 'models/SpecificationFile';
|
|
4
|
+
import { Specification } from './models/SpecificationFile';
|
|
5
5
|
export default abstract class extends Command {
|
|
6
6
|
recorder: Promise<Recorder>;
|
|
7
7
|
parser: Parser;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const bundleFlags: () => {
|
|
2
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
3
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
4
|
+
base: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
5
|
+
baseDir: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
|
+
xOrigin: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bundleFlags = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const bundleFlags = () => {
|
|
6
|
+
return {
|
|
7
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
8
|
+
output: core_1.Flags.string({ char: 'o', description: 'The output file name. Omitting this flag the result will be printed in the console.' }),
|
|
9
|
+
base: core_1.Flags.string({ char: 'b', description: 'Path to the file which will act as a base. This is required when some properties need to be overwritten.' }),
|
|
10
|
+
baseDir: core_1.Flags.string({ char: 'd', description: 'One relative/absolute path to directory relative to which paths to AsyncAPI Documents that should be bundled will be resolved.' }),
|
|
11
|
+
xOrigin: core_1.Flags.boolean({ char: 'x', description: 'Pass this switch to generate properties "x-origin" that will contain historical values of dereferenced "$ref"s.' }),
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
exports.bundleFlags = bundleFlags;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const analyticsFlags: () => {
|
|
2
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
3
|
+
disable: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
4
|
+
enable: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
5
|
+
status: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.analyticsFlags = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const analyticsFlags = () => {
|
|
6
|
+
return {
|
|
7
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
8
|
+
disable: core_1.Flags.boolean({ char: 'd', description: 'disable analytics', default: false }),
|
|
9
|
+
enable: core_1.Flags.boolean({ char: 'e', description: 'enable analytics', default: false }),
|
|
10
|
+
status: core_1.Flags.boolean({ char: 's', description: 'show current status of analytics' }),
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
exports.analyticsFlags = analyticsFlags;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addFlags = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const addFlags = () => {
|
|
6
|
+
return {
|
|
7
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
8
|
+
'set-current': core_1.Flags.boolean({
|
|
9
|
+
char: 's',
|
|
10
|
+
description: 'Set context being added as the current context',
|
|
11
|
+
default: false,
|
|
12
|
+
required: false,
|
|
13
|
+
})
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
exports.addFlags = addFlags;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const convertFlags: (latestVersion: string) => {
|
|
2
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
3
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
4
|
+
'target-version': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
5
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertFlags = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const convertFlags = (latestVersion) => {
|
|
6
|
+
return {
|
|
7
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
8
|
+
output: core_1.Flags.string({ char: 'o', description: 'path to the file where the result is saved' }),
|
|
9
|
+
'target-version': core_1.Flags.string({ char: 't', description: 'asyncapi version to convert to', default: latestVersion })
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
exports.convertFlags = convertFlags;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const diffFlags: () => {
|
|
2
|
+
'log-diagnostics': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
3
|
+
'diagnostics-format': import("@oclif/core/lib/interfaces").OptionFlag<import("@stoplight/spectral-cli/dist/services/config").OutputFormat, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
4
|
+
'fail-severity': import("@oclif/core/lib/interfaces").OptionFlag<"error" | "warn" | "info" | "hint", import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
5
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
6
|
+
format: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
type: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
markdownSubtype: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
overrides: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
'no-error': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
watch: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.diffFlags = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const parser_1 = require("../parser");
|
|
6
|
+
const global_flags_1 = require("./global.flags");
|
|
7
|
+
const diffFlags = () => {
|
|
8
|
+
return Object.assign({ help: core_1.Flags.help({ char: 'h' }), format: core_1.Flags.string({
|
|
9
|
+
char: 'f',
|
|
10
|
+
description: 'format of the output',
|
|
11
|
+
default: 'yaml',
|
|
12
|
+
options: ['json', 'yaml', 'yml', 'md'],
|
|
13
|
+
}), type: core_1.Flags.string({
|
|
14
|
+
char: 't',
|
|
15
|
+
description: 'type of the output',
|
|
16
|
+
default: 'all',
|
|
17
|
+
options: ['breaking', 'non-breaking', 'unclassified', 'all'],
|
|
18
|
+
}), markdownSubtype: core_1.Flags.string({
|
|
19
|
+
description: 'the format of changes made to AsyncAPI document. It works only when diff is generated using md type. For example, when you specify subtype as json, then diff information in markdown is dumped as json structure.',
|
|
20
|
+
default: undefined,
|
|
21
|
+
options: ['json', 'yaml', 'yml']
|
|
22
|
+
}), overrides: core_1.Flags.string({
|
|
23
|
+
char: 'o',
|
|
24
|
+
description: 'path to JSON file containing the override properties',
|
|
25
|
+
}), 'no-error': core_1.Flags.boolean({
|
|
26
|
+
description: 'don\'t show error on breaking changes',
|
|
27
|
+
}), watch: (0, global_flags_1.watchFlag)() }, (0, parser_1.validationFlags)({ logDiagnostics: false }));
|
|
28
|
+
};
|
|
29
|
+
exports.diffFlags = diffFlags;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const fromTemplateFlags: () => {
|
|
2
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
3
|
+
'disable-hook': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
4
|
+
'no-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
5
|
+
install: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
debug: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
'no-overwrite': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
'force-write': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
watch: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
param: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
'map-base-url': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
'registry-url': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
'registry-auth': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
'registry-token': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fromTemplateFlags = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const global_flags_1 = require("../global.flags");
|
|
6
|
+
const fromTemplateFlags = () => {
|
|
7
|
+
return {
|
|
8
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
9
|
+
'disable-hook': core_1.Flags.string({
|
|
10
|
+
char: 'd',
|
|
11
|
+
description: 'Disable a specific hook type or hooks from a given hook type',
|
|
12
|
+
multiple: true
|
|
13
|
+
}),
|
|
14
|
+
'no-interactive': core_1.Flags.boolean({
|
|
15
|
+
description: 'Disable interactive mode and run with the provided flags.',
|
|
16
|
+
required: false,
|
|
17
|
+
default: false,
|
|
18
|
+
}),
|
|
19
|
+
install: core_1.Flags.boolean({
|
|
20
|
+
char: 'i',
|
|
21
|
+
default: false,
|
|
22
|
+
description: 'Installs the template and its dependencies (defaults to false)'
|
|
23
|
+
}),
|
|
24
|
+
debug: core_1.Flags.boolean({
|
|
25
|
+
description: 'Enable more specific errors in the console'
|
|
26
|
+
}),
|
|
27
|
+
'no-overwrite': core_1.Flags.string({
|
|
28
|
+
char: 'n',
|
|
29
|
+
multiple: true,
|
|
30
|
+
description: 'Glob or path of the file(s) to skip when regenerating'
|
|
31
|
+
}),
|
|
32
|
+
output: core_1.Flags.string({
|
|
33
|
+
char: 'o',
|
|
34
|
+
description: 'Directory where to put the generated files (defaults to current directory)',
|
|
35
|
+
}),
|
|
36
|
+
'force-write': core_1.Flags.boolean({
|
|
37
|
+
default: false,
|
|
38
|
+
description: 'Force writing of the generated files to given directory even if it is a git repo with unstaged files or not empty dir (defaults to false)'
|
|
39
|
+
}),
|
|
40
|
+
watch: (0, global_flags_1.watchFlag)('Watches the template directory and the AsyncAPI document, and re-generate the files when changes occur. Ignores the output directory.'),
|
|
41
|
+
param: core_1.Flags.string({
|
|
42
|
+
char: 'p',
|
|
43
|
+
description: 'Additional param to pass to templates',
|
|
44
|
+
multiple: true
|
|
45
|
+
}),
|
|
46
|
+
'map-base-url': core_1.Flags.string({
|
|
47
|
+
description: 'Maps all schema references from base url to local folder'
|
|
48
|
+
}),
|
|
49
|
+
'registry-url': core_1.Flags.string({
|
|
50
|
+
default: 'https://registry.npmjs.org',
|
|
51
|
+
description: 'Specifies the URL of the private registry for fetching templates and dependencies'
|
|
52
|
+
}),
|
|
53
|
+
'registry-auth': core_1.Flags.string({
|
|
54
|
+
description: 'The registry username and password encoded with base64, formatted as username:password'
|
|
55
|
+
}),
|
|
56
|
+
'registry-token': core_1.Flags.string({
|
|
57
|
+
description: 'The npm registry authentication token, that can be passed instead of base64 encoded username and password'
|
|
58
|
+
})
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
exports.fromTemplateFlags = fromTemplateFlags;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const modelsFlags: () => {
|
|
2
|
+
'log-diagnostics': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
3
|
+
'diagnostics-format': import("@oclif/core/lib/interfaces").OptionFlag<import("@stoplight/spectral-cli/dist/services/config").OutputFormat, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
4
|
+
'fail-severity': import("@oclif/core/lib/interfaces").OptionFlag<"error" | "warn" | "info" | "hint", import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
5
|
+
'no-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
javaIncludeComments: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
javaJackson: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
javaConstraints: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
csharpAutoImplement: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
csharpNewtonsoft: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
csharpArrayType: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
csharpHashcode: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
csharpEqual: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
csharpSystemJson: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
tsModelType: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
+
tsEnumType: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
|
+
tsModuleSystem: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
18
|
+
tsIncludeComments: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
19
|
+
tsExportType: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
|
+
tsJsonBinPack: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
21
|
+
tsMarshalling: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
22
|
+
tsExampleInstance: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
23
|
+
tsRawPropertyNames: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
24
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
25
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
26
|
+
packageName: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
27
|
+
namespace: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
28
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.modelsFlags = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const parser_1 = require("../../parser");
|
|
6
|
+
const modelina_cli_1 = require("@asyncapi/modelina-cli");
|
|
7
|
+
const modelsFlags = () => {
|
|
8
|
+
return Object.assign(Object.assign(Object.assign({}, modelina_cli_1.ModelinaFlags), { 'no-interactive': core_1.Flags.boolean({
|
|
9
|
+
description: 'Disable interactive mode and run with the provided flags.',
|
|
10
|
+
required: false,
|
|
11
|
+
default: false,
|
|
12
|
+
}) }), (0, parser_1.validationFlags)({ logDiagnostics: false }));
|
|
13
|
+
};
|
|
14
|
+
exports.modelsFlags = modelsFlags;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.watchFlag = void 0;
|
|
3
|
+
exports.helpFlag = exports.watchFlag = void 0;
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
const watchFlag = (description) => {
|
|
6
6
|
return core_1.Flags.boolean({
|
|
@@ -10,3 +10,9 @@ const watchFlag = (description) => {
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
exports.watchFlag = watchFlag;
|
|
13
|
+
const helpFlag = () => {
|
|
14
|
+
return {
|
|
15
|
+
help: core_1.Flags.help({ char: 'h' })
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
exports.helpFlag = helpFlag;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const fileFlags: (exampleFlagDescription: string) => {
|
|
2
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
3
|
+
'file-name': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
4
|
+
example: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
5
|
+
studio: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
port: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
'no-tty': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fileFlags = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const fileFlags = (exampleFlagDescription) => {
|
|
6
|
+
return {
|
|
7
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
8
|
+
'file-name': core_1.Flags.string({ char: 'n', description: 'name of the file' }),
|
|
9
|
+
example: core_1.Flags.string({ char: 'e', description: exampleFlagDescription }),
|
|
10
|
+
studio: core_1.Flags.boolean({ char: 's', description: 'open in Studio' }),
|
|
11
|
+
port: core_1.Flags.integer({ char: 'p', description: 'port in which to start Studio' }),
|
|
12
|
+
'no-tty': core_1.Flags.boolean({ description: 'do not use an interactive terminal' }),
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
exports.fileFlags = fileFlags;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const gleeFlags: () => {
|
|
2
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
3
|
+
name: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
4
|
+
template: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
5
|
+
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
|
+
'force-write': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gleeFlags = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const gleeFlags = () => {
|
|
6
|
+
return {
|
|
7
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
8
|
+
name: core_1.Flags.string({
|
|
9
|
+
char: 'n',
|
|
10
|
+
description: 'Name of the Project',
|
|
11
|
+
default: 'project',
|
|
12
|
+
}),
|
|
13
|
+
template: core_1.Flags.string({
|
|
14
|
+
char: 't',
|
|
15
|
+
description: 'Name of the Template',
|
|
16
|
+
default: 'default',
|
|
17
|
+
}),
|
|
18
|
+
file: core_1.Flags.string({
|
|
19
|
+
char: 'f',
|
|
20
|
+
description: 'The path to the AsyncAPI file for generating a Glee project.',
|
|
21
|
+
}),
|
|
22
|
+
'force-write': core_1.Flags.boolean({
|
|
23
|
+
default: false,
|
|
24
|
+
description: 'Force writing of the generated files to given directory even if it is a git repo with unstaged files or not empty dir (defaults to false)',
|
|
25
|
+
}),
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
exports.gleeFlags = gleeFlags;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare enum Optimizations {
|
|
2
|
+
REMOVE_COMPONENTS = "remove-components",
|
|
3
|
+
REUSE_COMPONENTS = "reuse-components",
|
|
4
|
+
MOVE_DUPLICATES_TO_COMPONENTS = "move-duplicates-to-components",
|
|
5
|
+
MOVE_ALL_TO_COMPONENTS = "move-all-to-components"
|
|
6
|
+
}
|
|
7
|
+
export declare enum Outputs {
|
|
8
|
+
TERMINAL = "terminal",
|
|
9
|
+
NEW_FILE = "new-file",
|
|
10
|
+
OVERWRITE = "overwrite"
|
|
11
|
+
}
|
|
12
|
+
export declare const optimizeFlags: () => {
|
|
13
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
14
|
+
optimization: import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
+
'no-tty': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.optimizeFlags = exports.Outputs = exports.Optimizations = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
var Optimizations;
|
|
6
|
+
(function (Optimizations) {
|
|
7
|
+
Optimizations["REMOVE_COMPONENTS"] = "remove-components";
|
|
8
|
+
Optimizations["REUSE_COMPONENTS"] = "reuse-components";
|
|
9
|
+
Optimizations["MOVE_DUPLICATES_TO_COMPONENTS"] = "move-duplicates-to-components";
|
|
10
|
+
Optimizations["MOVE_ALL_TO_COMPONENTS"] = "move-all-to-components";
|
|
11
|
+
})(Optimizations = exports.Optimizations || (exports.Optimizations = {}));
|
|
12
|
+
var Outputs;
|
|
13
|
+
(function (Outputs) {
|
|
14
|
+
Outputs["TERMINAL"] = "terminal";
|
|
15
|
+
Outputs["NEW_FILE"] = "new-file";
|
|
16
|
+
Outputs["OVERWRITE"] = "overwrite";
|
|
17
|
+
})(Outputs = exports.Outputs || (exports.Outputs = {}));
|
|
18
|
+
const optimizeFlags = () => {
|
|
19
|
+
return {
|
|
20
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
21
|
+
optimization: core_1.Flags.string({ char: 'p', default: Object.values(Optimizations), options: Object.values(Optimizations), multiple: true, description: 'select the type of optimizations that you want to apply.' }),
|
|
22
|
+
output: core_1.Flags.string({ char: 'o', default: Outputs.TERMINAL, options: Object.values(Outputs), description: 'select where you want the output.' }),
|
|
23
|
+
'no-tty': core_1.Flags.boolean({ description: 'do not use an interactive terminal', default: false }),
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
exports.optimizeFlags = optimizeFlags;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const studioFlags: () => {
|
|
2
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
3
|
+
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
4
|
+
port: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
5
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.studioFlags = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const studioFlags = () => {
|
|
6
|
+
return {
|
|
7
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
8
|
+
file: core_1.Flags.string({ char: 'f', description: 'path to the AsyncAPI file to link with Studio' }),
|
|
9
|
+
port: core_1.Flags.integer({ char: 'p', description: 'port in which to start Studio' }),
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
exports.studioFlags = studioFlags;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const validateFlags: () => {
|
|
2
|
+
'log-diagnostics': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
3
|
+
'diagnostics-format': import("@oclif/core/lib/interfaces").OptionFlag<import("@stoplight/spectral-cli/dist/services/config").OutputFormat, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
4
|
+
'fail-severity': import("@oclif/core/lib/interfaces").OptionFlag<"error" | "warn" | "info" | "hint", import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
5
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
6
|
+
watch: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateFlags = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const parser_1 = require("../parser");
|
|
6
|
+
const global_flags_1 = require("./global.flags");
|
|
7
|
+
const validateFlags = () => {
|
|
8
|
+
return Object.assign({ help: core_1.Flags.help({ char: 'h' }), watch: (0, global_flags_1.watchFlag)() }, (0, parser_1.validationFlags)());
|
|
9
|
+
};
|
|
10
|
+
exports.validateFlags = validateFlags;
|
package/oclif.manifest.json
CHANGED
|
@@ -680,7 +680,8 @@
|
|
|
680
680
|
"rust",
|
|
681
681
|
"kotlin",
|
|
682
682
|
"php",
|
|
683
|
-
"cplusplus"
|
|
683
|
+
"cplusplus",
|
|
684
|
+
"scala"
|
|
684
685
|
],
|
|
685
686
|
"required": true
|
|
686
687
|
},
|
|
@@ -699,13 +700,6 @@
|
|
|
699
700
|
"allowNo": false,
|
|
700
701
|
"type": "boolean"
|
|
701
702
|
},
|
|
702
|
-
"no-interactive": {
|
|
703
|
-
"description": "Disable interactive mode and run with the provided flags.",
|
|
704
|
-
"name": "no-interactive",
|
|
705
|
-
"required": false,
|
|
706
|
-
"allowNo": false,
|
|
707
|
-
"type": "boolean"
|
|
708
|
-
},
|
|
709
703
|
"output": {
|
|
710
704
|
"char": "o",
|
|
711
705
|
"description": "The output directory where the models should be written to. Omitting this flag will write the models to `stdout`.",
|
|
@@ -715,6 +709,22 @@
|
|
|
715
709
|
"multiple": false,
|
|
716
710
|
"type": "option"
|
|
717
711
|
},
|
|
712
|
+
"packageName": {
|
|
713
|
+
"description": "Go, Java and Kotlin specific, define the package to use for the generated models. This is required when language is `go`, `java` or `kotlin`.",
|
|
714
|
+
"name": "packageName",
|
|
715
|
+
"required": false,
|
|
716
|
+
"hasDynamicHelp": false,
|
|
717
|
+
"multiple": false,
|
|
718
|
+
"type": "option"
|
|
719
|
+
},
|
|
720
|
+
"namespace": {
|
|
721
|
+
"description": "C#, C++ and PHP specific, define the namespace to use for the generated models. This is required when language is `csharp`,`c++` or `php`.",
|
|
722
|
+
"name": "namespace",
|
|
723
|
+
"required": false,
|
|
724
|
+
"hasDynamicHelp": false,
|
|
725
|
+
"multiple": false,
|
|
726
|
+
"type": "option"
|
|
727
|
+
},
|
|
718
728
|
"tsModelType": {
|
|
719
729
|
"description": "TypeScript specific, define which type of model needs to be generated.",
|
|
720
730
|
"name": "tsModelType",
|
|
@@ -789,7 +799,7 @@
|
|
|
789
799
|
"type": "boolean"
|
|
790
800
|
},
|
|
791
801
|
"tsExampleInstance": {
|
|
792
|
-
"description": "Typescript specific, generate example of the model",
|
|
802
|
+
"description": "Typescript specific, generate example of the model.",
|
|
793
803
|
"name": "tsExampleInstance",
|
|
794
804
|
"required": false,
|
|
795
805
|
"allowNo": false,
|
|
@@ -802,43 +812,6 @@
|
|
|
802
812
|
"allowNo": false,
|
|
803
813
|
"type": "boolean"
|
|
804
814
|
},
|
|
805
|
-
"packageName": {
|
|
806
|
-
"description": "Go, Java and Kotlin specific, define the package to use for the generated models. This is required when language is `go`, `java` or `kotlin`.",
|
|
807
|
-
"name": "packageName",
|
|
808
|
-
"required": false,
|
|
809
|
-
"hasDynamicHelp": false,
|
|
810
|
-
"multiple": false,
|
|
811
|
-
"type": "option"
|
|
812
|
-
},
|
|
813
|
-
"javaIncludeComments": {
|
|
814
|
-
"description": "Java specific, if enabled add comments while generating models.",
|
|
815
|
-
"name": "javaIncludeComments",
|
|
816
|
-
"required": false,
|
|
817
|
-
"allowNo": false,
|
|
818
|
-
"type": "boolean"
|
|
819
|
-
},
|
|
820
|
-
"javaJackson": {
|
|
821
|
-
"description": "Java specific, generate the models with Jackson serialization support",
|
|
822
|
-
"name": "javaJackson",
|
|
823
|
-
"required": false,
|
|
824
|
-
"allowNo": false,
|
|
825
|
-
"type": "boolean"
|
|
826
|
-
},
|
|
827
|
-
"javaConstraints": {
|
|
828
|
-
"description": "Java specific, generate the models with constraints",
|
|
829
|
-
"name": "javaConstraints",
|
|
830
|
-
"required": false,
|
|
831
|
-
"allowNo": false,
|
|
832
|
-
"type": "boolean"
|
|
833
|
-
},
|
|
834
|
-
"namespace": {
|
|
835
|
-
"description": "C#, C++ and PHP specific, define the namespace to use for the generated models. This is required when language is `csharp`,`c++` or `php`.",
|
|
836
|
-
"name": "namespace",
|
|
837
|
-
"required": false,
|
|
838
|
-
"hasDynamicHelp": false,
|
|
839
|
-
"multiple": false,
|
|
840
|
-
"type": "option"
|
|
841
|
-
},
|
|
842
815
|
"csharpAutoImplement": {
|
|
843
816
|
"description": "C# specific, define whether to generate auto-implemented properties or not.",
|
|
844
817
|
"name": "csharpAutoImplement",
|
|
@@ -887,6 +860,34 @@
|
|
|
887
860
|
"allowNo": false,
|
|
888
861
|
"type": "boolean"
|
|
889
862
|
},
|
|
863
|
+
"javaIncludeComments": {
|
|
864
|
+
"description": "Java specific, if enabled add comments while generating models.",
|
|
865
|
+
"name": "javaIncludeComments",
|
|
866
|
+
"required": false,
|
|
867
|
+
"allowNo": false,
|
|
868
|
+
"type": "boolean"
|
|
869
|
+
},
|
|
870
|
+
"javaJackson": {
|
|
871
|
+
"description": "Java specific, generate the models with Jackson serialization support",
|
|
872
|
+
"name": "javaJackson",
|
|
873
|
+
"required": false,
|
|
874
|
+
"allowNo": false,
|
|
875
|
+
"type": "boolean"
|
|
876
|
+
},
|
|
877
|
+
"javaConstraints": {
|
|
878
|
+
"description": "Java specific, generate the models with constraints",
|
|
879
|
+
"name": "javaConstraints",
|
|
880
|
+
"required": false,
|
|
881
|
+
"allowNo": false,
|
|
882
|
+
"type": "boolean"
|
|
883
|
+
},
|
|
884
|
+
"no-interactive": {
|
|
885
|
+
"description": "Disable interactive mode and run with the provided flags.",
|
|
886
|
+
"name": "no-interactive",
|
|
887
|
+
"required": false,
|
|
888
|
+
"allowNo": false,
|
|
889
|
+
"type": "boolean"
|
|
890
|
+
},
|
|
890
891
|
"log-diagnostics": {
|
|
891
892
|
"description": "log validation diagnostics or not",
|
|
892
893
|
"name": "log-diagnostics",
|
|
@@ -1141,7 +1142,7 @@
|
|
|
1141
1142
|
"start": {
|
|
1142
1143
|
"aliases": [],
|
|
1143
1144
|
"args": {},
|
|
1144
|
-
"description": "
|
|
1145
|
+
"description": "",
|
|
1145
1146
|
"flags": {},
|
|
1146
1147
|
"hasDynamicHelp": false,
|
|
1147
1148
|
"hiddenAliases": [],
|
|
@@ -1476,5 +1477,5 @@
|
|
|
1476
1477
|
]
|
|
1477
1478
|
}
|
|
1478
1479
|
},
|
|
1479
|
-
"version": "
|
|
1480
|
+
"version": "2.0.0"
|
|
1480
1481
|
}
|