@asyncapi/cli 3.4.2 → 3.5.1
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/apps/cli/commands/generate/client.d.ts +30 -0
- package/lib/apps/cli/commands/generate/client.js +94 -0
- package/lib/apps/cli/commands/generate/fromTemplate.d.ts +28 -16
- package/lib/apps/cli/commands/generate/fromTemplate.js +29 -296
- package/lib/apps/cli/commands/start/preview.d.ts +1 -0
- package/lib/apps/cli/commands/start/preview.js +1 -1
- package/lib/apps/cli/commands/start/studio.d.ts +1 -0
- package/lib/apps/cli/commands/start/studio.js +1 -1
- package/lib/apps/cli/internal/args/generate.args.d.ts +3 -0
- package/lib/apps/cli/internal/args/generate.args.js +10 -0
- package/lib/apps/cli/internal/base/BaseGeneratorCommand.d.ts +42 -0
- package/lib/apps/cli/internal/base/BaseGeneratorCommand.js +119 -0
- package/lib/apps/cli/internal/flags/generate/clients.flags.d.ts +16 -0
- package/lib/apps/cli/internal/flags/generate/clients.flags.js +8 -0
- package/lib/apps/cli/internal/flags/generate/fromTemplate.flags.d.ts +25 -1
- package/lib/apps/cli/internal/flags/generate/fromTemplate.flags.js +2 -58
- package/lib/apps/cli/internal/flags/generate/sharedFlags.d.ts +16 -0
- package/lib/apps/cli/internal/flags/generate/sharedFlags.js +57 -0
- package/lib/apps/cli/internal/flags/start/preview.flags.d.ts +1 -0
- package/lib/apps/cli/internal/flags/start/preview.flags.js +1 -0
- package/lib/apps/cli/internal/flags/start/studio.flags.d.ts +1 -0
- package/lib/apps/cli/internal/flags/start/studio.flags.js +1 -0
- package/lib/domains/models/Preview.d.ts +1 -1
- package/lib/domains/models/Preview.js +145 -132
- package/lib/domains/models/Studio.d.ts +1 -1
- package/lib/domains/models/Studio.js +115 -100
- package/lib/domains/models/generate/ClientLanguages.d.ts +12 -0
- package/lib/domains/models/generate/ClientLanguages.js +17 -0
- package/lib/domains/models/generate/Flags.d.ts +9 -0
- package/lib/domains/models/generate/Flags.js +2 -0
- package/lib/domains/services/generator.service.d.ts +1 -0
- package/lib/domains/services/generator.service.js +5 -2
- package/lib/utils/generate/flags.d.ts +2 -0
- package/lib/utils/generate/flags.js +14 -0
- package/lib/utils/generate/mapBaseUrl.d.ts +6 -0
- package/lib/utils/generate/mapBaseUrl.js +34 -0
- package/lib/utils/generate/parseParams.d.ts +3 -0
- package/lib/utils/generate/parseParams.js +58 -0
- package/lib/utils/generate/prompts.d.ts +4 -0
- package/lib/utils/generate/prompts.js +77 -0
- package/lib/utils/generate/registry.d.ts +2 -0
- package/lib/utils/generate/registry.js +30 -0
- package/lib/utils/{fileWatcher.d.ts → generate/watcher.d.ts} +3 -0
- package/lib/utils/{fileWatcher.js → generate/watcher.js} +75 -8
- package/oclif.manifest.json +167 -3
- package/package.json +7 -5
- package/scripts/generateTypesForGenerateCommand.js +40 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import Command from '../../internal/base';
|
|
2
|
+
import { Specification } from '../../../../domains/models/SpecificationFile';
|
|
3
|
+
import { Parser } from '@asyncapi/parser';
|
|
4
|
+
import { ParsedFlags } from '../../../../domains/models/generate/Flags';
|
|
5
|
+
import { GeneratorService } from '../../../../domains/services/generator.service';
|
|
6
|
+
export interface GeneratorOptions {
|
|
7
|
+
forceWrite: boolean;
|
|
8
|
+
install: boolean;
|
|
9
|
+
debug: boolean;
|
|
10
|
+
templateParams: any;
|
|
11
|
+
noOverwriteGlobs: string[];
|
|
12
|
+
mapBaseUrlToFolder: any;
|
|
13
|
+
disabledHooks: Record<string, string>;
|
|
14
|
+
registry: {
|
|
15
|
+
url?: string;
|
|
16
|
+
auth?: string;
|
|
17
|
+
token?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export declare abstract class BaseGeneratorCommand extends Command {
|
|
21
|
+
static readonly flags: {
|
|
22
|
+
proxyHost: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
23
|
+
proxyPort: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
24
|
+
};
|
|
25
|
+
static args: {
|
|
26
|
+
asyncapi: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
27
|
+
};
|
|
28
|
+
parser: Parser;
|
|
29
|
+
protected generatorService: GeneratorService;
|
|
30
|
+
protected buildGeneratorOptions(flags: any, parsedFlags: ParsedFlags): Promise<GeneratorOptions>;
|
|
31
|
+
protected applyProxyConfiguration(asyncapi: string, proxyHost?: string, proxyPort?: string): string;
|
|
32
|
+
protected handleWatchMode(asyncapi: string, template: string, output: string, options: GeneratorOptions, genOption: any, interactive: boolean): Promise<void>;
|
|
33
|
+
protected buildGenOption(flags: any, parsedFlags: ParsedFlags): any;
|
|
34
|
+
protected generate(asyncapi: string | undefined, template: string, output: string, options: GeneratorOptions, genOption: any, interactive?: boolean): Promise<void>;
|
|
35
|
+
protected parseCommonArgs(args: Record<string, any>, output?: string): Promise<{
|
|
36
|
+
asyncapi: string;
|
|
37
|
+
output: string;
|
|
38
|
+
}>;
|
|
39
|
+
protected loadAsyncAPIInput(asyncapi: string): Promise<Specification>;
|
|
40
|
+
protected handleCancellation(value: any): void;
|
|
41
|
+
protected loadSpecificationSafely(asyncapi: string | undefined): Promise<Specification>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseGeneratorCommand = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const base_1 = tslib_1.__importDefault(require("../../internal/base"));
|
|
6
|
+
// eslint-disable-next-line
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
const generator_1 = tslib_1.__importDefault(require("@asyncapi/generator"));
|
|
9
|
+
const SpecificationFile_1 = require("../../../../domains/models/SpecificationFile");
|
|
10
|
+
const validation_error_1 = require("../../../../errors/validation-error");
|
|
11
|
+
const generator_error_1 = require("../../../../errors/generator-error");
|
|
12
|
+
const parser_1 = require("@asyncapi/parser");
|
|
13
|
+
const prompts_1 = require("@clack/prompts");
|
|
14
|
+
const proxy_flags_1 = require("../../internal/flags/proxy.flags");
|
|
15
|
+
const generate_args_1 = require("../../internal/args/generate.args");
|
|
16
|
+
const watcher_1 = require("../../../../utils/generate/watcher");
|
|
17
|
+
const mapBaseUrl_1 = require("../../../../utils/generate/mapBaseUrl");
|
|
18
|
+
const prompts_2 = require("../../../../utils/generate/prompts");
|
|
19
|
+
const generator_service_1 = require("../../../../domains/services/generator.service");
|
|
20
|
+
class BaseGeneratorCommand extends base_1.default {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.parser = new parser_1.Parser();
|
|
24
|
+
this.generatorService = new generator_service_1.GeneratorService();
|
|
25
|
+
}
|
|
26
|
+
buildGeneratorOptions(flags, parsedFlags) {
|
|
27
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
return {
|
|
29
|
+
forceWrite: flags['force-write'],
|
|
30
|
+
install: flags.install,
|
|
31
|
+
debug: flags.debug,
|
|
32
|
+
templateParams: parsedFlags.params,
|
|
33
|
+
noOverwriteGlobs: flags['no-overwrite'],
|
|
34
|
+
mapBaseUrlToFolder: parsedFlags.mapBaseUrlToFolder,
|
|
35
|
+
disabledHooks: parsedFlags.disableHooks,
|
|
36
|
+
registry: {
|
|
37
|
+
url: flags['registry-url'],
|
|
38
|
+
auth: flags['registry-auth'],
|
|
39
|
+
token: flags['registry-token'],
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
applyProxyConfiguration(asyncapi, proxyHost, proxyPort) {
|
|
45
|
+
if (proxyHost && proxyPort) {
|
|
46
|
+
const proxyUrl = `http://${proxyHost}:${proxyPort}`;
|
|
47
|
+
return `${asyncapi}+${proxyUrl}`;
|
|
48
|
+
}
|
|
49
|
+
return asyncapi;
|
|
50
|
+
}
|
|
51
|
+
handleWatchMode(asyncapi, template, output, options, genOption, interactive) {
|
|
52
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
const watcher = (0, watcher_1.watcherHandler)(this, asyncapi, template, output, options, genOption, interactive);
|
|
54
|
+
yield (0, watcher_1.runWatchMode)(this, asyncapi, template, output, generator_1.default, watcher);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
buildGenOption(flags, parsedFlags) {
|
|
58
|
+
const genOption = {};
|
|
59
|
+
if (flags['map-base-url']) {
|
|
60
|
+
genOption.resolve = { resolve: (0, mapBaseUrl_1.getMapBaseUrlToFolderResolver)(parsedFlags.mapBaseUrlToFolder) };
|
|
61
|
+
}
|
|
62
|
+
return genOption;
|
|
63
|
+
}
|
|
64
|
+
generate(asyncapi_1, template_1, output_1, options_1, genOption_1) {
|
|
65
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* (asyncapi, template, output, options, genOption, interactive = true) {
|
|
66
|
+
const specification = yield this.loadSpecificationSafely(asyncapi);
|
|
67
|
+
const result = yield this.generatorService.generate(specification, template, output, options, // GeneratorService expects different options interface
|
|
68
|
+
genOption, interactive);
|
|
69
|
+
if (!result.success) {
|
|
70
|
+
throw new generator_error_1.GeneratorError(new Error(result.error));
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
parseCommonArgs(args, output) {
|
|
75
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
let asyncapi = args['asyncapi'];
|
|
77
|
+
const cancellationMessage = 'Operation cancelled';
|
|
78
|
+
if (!asyncapi) {
|
|
79
|
+
asyncapi = yield (0, prompts_2.promptForAsyncAPIPath)();
|
|
80
|
+
}
|
|
81
|
+
if ((0, prompts_1.isCancel)(asyncapi)) {
|
|
82
|
+
this.error(cancellationMessage, { exit: 1 });
|
|
83
|
+
}
|
|
84
|
+
if (!output) {
|
|
85
|
+
output = yield (0, prompts_2.promptForOutputDir)();
|
|
86
|
+
}
|
|
87
|
+
if ((0, prompts_1.isCancel)(output)) {
|
|
88
|
+
this.error(cancellationMessage, { exit: 1 });
|
|
89
|
+
}
|
|
90
|
+
return { asyncapi, output };
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
loadAsyncAPIInput(asyncapi) {
|
|
94
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
return (yield (0, SpecificationFile_1.load)(asyncapi)) || (yield (0, SpecificationFile_1.load)());
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
handleCancellation(value) {
|
|
99
|
+
if ((0, prompts_1.isCancel)(value)) {
|
|
100
|
+
this.error('Operation cancelled', { exit: 1 });
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
loadSpecificationSafely(asyncapi) {
|
|
104
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
try {
|
|
106
|
+
return yield (0, SpecificationFile_1.load)(asyncapi);
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
return this.error(new validation_error_1.ValidationError({
|
|
110
|
+
type: 'invalid-file',
|
|
111
|
+
filepath: asyncapi,
|
|
112
|
+
}), { exit: 1 });
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.BaseGeneratorCommand = BaseGeneratorCommand;
|
|
118
|
+
BaseGeneratorCommand.flags = Object.assign({}, (0, proxy_flags_1.proxyFlags)());
|
|
119
|
+
BaseGeneratorCommand.args = Object.assign({}, generate_args_1.generateArgs);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const clientsFlags: () => {
|
|
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,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clientsFlags = void 0;
|
|
4
|
+
const sharedFlags_1 = require("./sharedFlags");
|
|
5
|
+
const clientsFlags = () => {
|
|
6
|
+
return Object.assign({}, sharedFlags_1.sharedFlags);
|
|
7
|
+
};
|
|
8
|
+
exports.clientsFlags = clientsFlags;
|
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
export declare const fromTemplateFlags: () => {
|
|
2
|
+
'use-new-generator': {
|
|
3
|
+
name: string;
|
|
4
|
+
char?: import("@oclif/core/lib/interfaces").AlphabetLowercase | import("@oclif/core/lib/interfaces").AlphabetUppercase;
|
|
5
|
+
summary?: string;
|
|
6
|
+
description: string;
|
|
7
|
+
helpLabel?: string;
|
|
8
|
+
helpGroup?: string;
|
|
9
|
+
env?: string;
|
|
10
|
+
hidden?: boolean;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
dependsOn?: string[];
|
|
13
|
+
exclusive?: string[];
|
|
14
|
+
exactlyOne?: string[];
|
|
15
|
+
relationships?: import("@oclif/core/lib/interfaces/parser").Relationship[];
|
|
16
|
+
deprecated?: true | import("@oclif/core/lib/interfaces").Deprecation;
|
|
17
|
+
aliases?: string[];
|
|
18
|
+
charAliases?: (import("@oclif/core/lib/interfaces").AlphabetLowercase | import("@oclif/core/lib/interfaces").AlphabetUppercase)[];
|
|
19
|
+
deprecateAliases?: boolean;
|
|
20
|
+
noCacheDefault?: boolean;
|
|
21
|
+
atLeastOne?: string[];
|
|
22
|
+
type: "boolean";
|
|
23
|
+
allowNo: boolean;
|
|
24
|
+
default: import("@oclif/core/lib/interfaces/parser").FlagDefault<boolean>;
|
|
25
|
+
parse: (input: boolean, context: import("@oclif/core/lib/interfaces/parser").FlagParserContext, opts: import("@oclif/core/lib/interfaces/parser").FlagProps & import("@oclif/core/lib/interfaces/parser").BooleanFlagProps) => Promise<boolean>;
|
|
26
|
+
};
|
|
2
27
|
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
3
28
|
'disable-hook': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
4
29
|
'no-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
@@ -13,5 +38,4 @@ export declare const fromTemplateFlags: () => {
|
|
|
13
38
|
'registry-url': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
39
|
'registry-auth': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
40
|
'registry-token': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
-
'use-new-generator': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
41
|
};
|
|
@@ -1,65 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fromTemplateFlags = void 0;
|
|
4
|
+
const sharedFlags_1 = require("./sharedFlags");
|
|
4
5
|
const core_1 = require("@oclif/core");
|
|
5
|
-
const global_flags_1 = require("../global.flags");
|
|
6
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
|
-
'use-new-generator': core_1.Flags.boolean({
|
|
60
|
-
default: false,
|
|
61
|
-
description: 'Use v2 generator, for generating from newer templates',
|
|
62
|
-
}),
|
|
63
|
-
};
|
|
7
|
+
return Object.assign(Object.assign({}, sharedFlags_1.sharedFlags), { 'use-new-generator': Object.assign({ default: false, description: 'Use v2 generator, for generating from newer templates' }, core_1.Flags.boolean()) });
|
|
64
8
|
};
|
|
65
9
|
exports.fromTemplateFlags = fromTemplateFlags;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const sharedFlags: {
|
|
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,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sharedFlags = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const global_flags_1 = require("../global.flags");
|
|
6
|
+
exports.sharedFlags = {
|
|
7
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
8
|
+
'disable-hook': core_1.Flags.string({
|
|
9
|
+
char: 'd',
|
|
10
|
+
description: 'Disable a specific hook type or hooks from a given hook type',
|
|
11
|
+
multiple: true
|
|
12
|
+
}),
|
|
13
|
+
'no-interactive': core_1.Flags.boolean({
|
|
14
|
+
description: 'Disable interactive mode and run with the provided flags.',
|
|
15
|
+
default: false,
|
|
16
|
+
}),
|
|
17
|
+
install: core_1.Flags.boolean({
|
|
18
|
+
char: 'i',
|
|
19
|
+
default: false,
|
|
20
|
+
description: 'Installs the template and its dependencies (defaults to false)'
|
|
21
|
+
}),
|
|
22
|
+
debug: core_1.Flags.boolean({
|
|
23
|
+
description: 'Enable more specific errors in the console'
|
|
24
|
+
}),
|
|
25
|
+
'no-overwrite': core_1.Flags.string({
|
|
26
|
+
char: 'n',
|
|
27
|
+
multiple: true,
|
|
28
|
+
description: 'Glob or path of the file(s) to skip when regenerating'
|
|
29
|
+
}),
|
|
30
|
+
output: core_1.Flags.string({
|
|
31
|
+
char: 'o',
|
|
32
|
+
description: 'Directory where to put the generated files (defaults to current directory)',
|
|
33
|
+
}),
|
|
34
|
+
'force-write': core_1.Flags.boolean({
|
|
35
|
+
default: false,
|
|
36
|
+
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)'
|
|
37
|
+
}),
|
|
38
|
+
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.'),
|
|
39
|
+
param: core_1.Flags.string({
|
|
40
|
+
char: 'p',
|
|
41
|
+
description: 'Additional param to pass to templates',
|
|
42
|
+
multiple: true
|
|
43
|
+
}),
|
|
44
|
+
'map-base-url': core_1.Flags.string({
|
|
45
|
+
description: 'Maps all schema references from base url to local folder'
|
|
46
|
+
}),
|
|
47
|
+
'registry-url': core_1.Flags.string({
|
|
48
|
+
default: 'https://registry.npmjs.org',
|
|
49
|
+
description: 'Specifies the URL of the private registry for fetching templates and dependencies'
|
|
50
|
+
}),
|
|
51
|
+
'registry-auth': core_1.Flags.string({
|
|
52
|
+
description: 'The registry username and password encoded with base64, formatted as username:password'
|
|
53
|
+
}),
|
|
54
|
+
'registry-token': core_1.Flags.string({
|
|
55
|
+
description: 'The npm registry authentication token, that can be passed instead of base64 encoded username and password'
|
|
56
|
+
}),
|
|
57
|
+
};
|
|
@@ -5,4 +5,5 @@ export declare const previewFlags: () => {
|
|
|
5
5
|
baseDir: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
6
|
xOrigin: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
7
|
suppressLogs: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
noBrowser: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
9
|
};
|
|
@@ -26,6 +26,7 @@ const previewFlags = () => {
|
|
|
26
26
|
description: 'Pass this to suppress the detiled error logs.',
|
|
27
27
|
default: false,
|
|
28
28
|
}),
|
|
29
|
+
noBrowser: core_1.Flags.boolean({ char: 'B', description: 'Pass this to not open browser automatically upon running the command', default: false })
|
|
29
30
|
};
|
|
30
31
|
};
|
|
31
32
|
exports.previewFlags = previewFlags;
|
|
@@ -3,4 +3,5 @@ export declare const studioFlags: () => {
|
|
|
3
3
|
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
4
4
|
port: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
5
5
|
'no-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
noBrowser: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
6
7
|
};
|
|
@@ -19,6 +19,7 @@ const studioFlags = () => {
|
|
|
19
19
|
required: false,
|
|
20
20
|
default: false,
|
|
21
21
|
}),
|
|
22
|
+
noBrowser: core_1.Flags.boolean({ char: 'B', description: 'Pass this to not open browser automatically upon running the command', default: false })
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
25
|
exports.studioFlags = studioFlags;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const DEFAULT_PORT = 0;
|
|
2
|
-
export declare function startPreview(filePath: string, base: string | undefined, baseDirectory: string | undefined, xOrigin: boolean | undefined, suppressLogs: boolean | undefined, port?: number):
|
|
2
|
+
export declare function startPreview(filePath: string, base: string | undefined, baseDirectory: string | undefined, xOrigin: boolean | undefined, suppressLogs: boolean | undefined, port?: number, noBrowser?: boolean): void;
|