@asyncapi/cli 1.17.0 → 1.18.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 +1 -16
- package/lib/commands/generate/models.js +5 -120
- 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 +43 -0
- package/lib/core/flags/generate/models.flags.js +125 -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 +2 -2
- package/package.json +1 -1
- /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
|
@@ -4,11 +4,12 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const modelina_1 = require("@asyncapi/modelina");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
6
|
const multi_parser_1 = require("@smoya/multi-parser");
|
|
7
|
-
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
8
|
-
const SpecificationFile_1 = require("../../models/SpecificationFile");
|
|
9
|
-
const parser_1 = require("../../parser");
|
|
7
|
+
const base_1 = tslib_1.__importDefault(require("../../core/base"));
|
|
8
|
+
const SpecificationFile_1 = require("../../core/models/SpecificationFile");
|
|
9
|
+
const parser_1 = require("../../core/parser");
|
|
10
10
|
const prompts_1 = require("@clack/prompts");
|
|
11
11
|
const picocolors_1 = require("picocolors");
|
|
12
|
+
const models_flags_1 = require("../../core/flags/generate/models.flags");
|
|
12
13
|
var Languages;
|
|
13
14
|
(function (Languages) {
|
|
14
15
|
Languages["typescript"] = "typescript";
|
|
@@ -281,120 +282,4 @@ Models.args = {
|
|
|
281
282
|
language: core_1.Args.string({ description: 'The language you want the typed models generated for.', options: Object.keys(Languages), required: true }),
|
|
282
283
|
file: core_1.Args.string({ description: 'Path or URL to the AsyncAPI document, or context-name', required: true }),
|
|
283
284
|
};
|
|
284
|
-
Models.flags =
|
|
285
|
-
description: 'Disable interactive mode and run with the provided flags.',
|
|
286
|
-
required: false,
|
|
287
|
-
default: false,
|
|
288
|
-
}), output: core_1.Flags.string({
|
|
289
|
-
char: 'o',
|
|
290
|
-
description: 'The output directory where the models should be written to. Omitting this flag will write the models to `stdout`.',
|
|
291
|
-
required: false
|
|
292
|
-
}),
|
|
293
|
-
/**
|
|
294
|
-
* TypeScript specific options
|
|
295
|
-
*/
|
|
296
|
-
tsModelType: core_1.Flags.string({
|
|
297
|
-
type: 'option',
|
|
298
|
-
options: ['class', 'interface'],
|
|
299
|
-
description: 'TypeScript specific, define which type of model needs to be generated.',
|
|
300
|
-
required: false,
|
|
301
|
-
default: 'class',
|
|
302
|
-
}), tsEnumType: core_1.Flags.string({
|
|
303
|
-
type: 'option',
|
|
304
|
-
options: ['enum', 'union'],
|
|
305
|
-
description: 'TypeScript specific, define which type of enums needs to be generated.',
|
|
306
|
-
required: false,
|
|
307
|
-
default: 'enum',
|
|
308
|
-
}), tsModuleSystem: core_1.Flags.string({
|
|
309
|
-
type: 'option',
|
|
310
|
-
options: ['ESM', 'CJS'],
|
|
311
|
-
description: 'TypeScript specific, define the module system to be used.',
|
|
312
|
-
required: false,
|
|
313
|
-
default: 'ESM',
|
|
314
|
-
}), tsIncludeComments: core_1.Flags.boolean({
|
|
315
|
-
description: 'TypeScript specific, if enabled add comments while generating models.',
|
|
316
|
-
required: false,
|
|
317
|
-
default: false,
|
|
318
|
-
}), tsExportType: core_1.Flags.string({
|
|
319
|
-
type: 'option',
|
|
320
|
-
options: ['default', 'named'],
|
|
321
|
-
description: 'TypeScript specific, define which type of export needs to be generated.',
|
|
322
|
-
required: false,
|
|
323
|
-
default: 'default',
|
|
324
|
-
}), tsJsonBinPack: core_1.Flags.boolean({
|
|
325
|
-
description: 'TypeScript specific, define basic support for serializing to and from binary with jsonbinpack.',
|
|
326
|
-
required: false,
|
|
327
|
-
default: false,
|
|
328
|
-
}), tsMarshalling: core_1.Flags.boolean({
|
|
329
|
-
description: 'TypeScript specific, generate the models with marshalling functions.',
|
|
330
|
-
required: false,
|
|
331
|
-
default: false,
|
|
332
|
-
}), tsExampleInstance: core_1.Flags.boolean({
|
|
333
|
-
description: 'Typescript specific, generate example of the model',
|
|
334
|
-
required: false,
|
|
335
|
-
default: false,
|
|
336
|
-
}), tsRawPropertyNames: core_1.Flags.boolean({
|
|
337
|
-
description: 'Typescript specific, generate the models using raw property names.',
|
|
338
|
-
required: false,
|
|
339
|
-
default: false,
|
|
340
|
-
}),
|
|
341
|
-
/**
|
|
342
|
-
* Go and Java specific package name to use for the generated models
|
|
343
|
-
*/
|
|
344
|
-
packageName: core_1.Flags.string({
|
|
345
|
-
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`.',
|
|
346
|
-
required: false
|
|
347
|
-
}),
|
|
348
|
-
/**
|
|
349
|
-
* Java specific options
|
|
350
|
-
*/
|
|
351
|
-
javaIncludeComments: core_1.Flags.boolean({
|
|
352
|
-
description: 'Java specific, if enabled add comments while generating models.',
|
|
353
|
-
required: false,
|
|
354
|
-
default: false
|
|
355
|
-
}), javaJackson: core_1.Flags.boolean({
|
|
356
|
-
description: 'Java specific, generate the models with Jackson serialization support',
|
|
357
|
-
required: false,
|
|
358
|
-
default: false
|
|
359
|
-
}), javaConstraints: core_1.Flags.boolean({
|
|
360
|
-
description: 'Java specific, generate the models with constraints',
|
|
361
|
-
required: false,
|
|
362
|
-
default: false
|
|
363
|
-
}),
|
|
364
|
-
/**
|
|
365
|
-
* C++ and C# and PHP specific namespace to use for the generated models
|
|
366
|
-
*/
|
|
367
|
-
namespace: core_1.Flags.string({
|
|
368
|
-
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`.',
|
|
369
|
-
required: false
|
|
370
|
-
}),
|
|
371
|
-
/**
|
|
372
|
-
* C# specific options
|
|
373
|
-
*/
|
|
374
|
-
csharpAutoImplement: core_1.Flags.boolean({
|
|
375
|
-
description: 'C# specific, define whether to generate auto-implemented properties or not.',
|
|
376
|
-
required: false,
|
|
377
|
-
default: false
|
|
378
|
-
}), csharpNewtonsoft: core_1.Flags.boolean({
|
|
379
|
-
description: 'C# specific, generate the models with newtonsoft serialization support',
|
|
380
|
-
required: false,
|
|
381
|
-
default: false
|
|
382
|
-
}), csharpArrayType: core_1.Flags.string({
|
|
383
|
-
type: 'option',
|
|
384
|
-
description: 'C# specific, define which type of array needs to be generated.',
|
|
385
|
-
options: ['Array', 'List'],
|
|
386
|
-
required: false,
|
|
387
|
-
default: 'Array'
|
|
388
|
-
}), csharpHashcode: core_1.Flags.boolean({
|
|
389
|
-
description: 'C# specific, generate the models with the GetHashCode method overwritten',
|
|
390
|
-
required: false,
|
|
391
|
-
default: false
|
|
392
|
-
}), csharpEqual: core_1.Flags.boolean({
|
|
393
|
-
description: 'C# specific, generate the models with the Equal method overwritten',
|
|
394
|
-
required: false,
|
|
395
|
-
default: false
|
|
396
|
-
}), csharpSystemJson: core_1.Flags.boolean({
|
|
397
|
-
description: 'C# specific, generate the models with System.Text.Json serialization support',
|
|
398
|
-
required: false,
|
|
399
|
-
default: false
|
|
400
|
-
}) }, (0, parser_1.validationFlags)({ logDiagnostics: false }));
|
|
285
|
+
Models.flags = (0, models_flags_1.modelsFlags)();
|
package/lib/commands/new/file.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const core_1 = require("@oclif/core");
|
|
5
4
|
const fs_1 = require("fs");
|
|
6
|
-
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
|
+
const base_1 = tslib_1.__importDefault(require("../../core/base"));
|
|
7
6
|
const inquirer = tslib_1.__importStar(require("inquirer"));
|
|
8
|
-
const Studio_1 = require("../../models/Studio");
|
|
7
|
+
const Studio_1 = require("../../core/models/Studio");
|
|
9
8
|
const path_1 = require("path");
|
|
10
|
-
const SpecificationFile_1 = require("../../models/SpecificationFile");
|
|
9
|
+
const SpecificationFile_1 = require("../../core/models/SpecificationFile");
|
|
11
10
|
const picocolors_1 = require("picocolors");
|
|
11
|
+
const file_flags_1 = require("../../core/flags/new/file.flags");
|
|
12
12
|
const { writeFile, readFile } = fs_1.promises;
|
|
13
13
|
const DEFAULT_ASYNCAPI_FILE_NAME = 'asyncapi.yaml';
|
|
14
14
|
const DEFAULT_ASYNCAPI_TEMPLATE = 'default-example.yaml';
|
|
@@ -152,14 +152,7 @@ class NewFile extends base_1.default {
|
|
|
152
152
|
}
|
|
153
153
|
exports.default = NewFile;
|
|
154
154
|
NewFile.description = 'Creates a new asyncapi file';
|
|
155
|
-
NewFile.flags =
|
|
156
|
-
help: core_1.Flags.help({ char: 'h' }),
|
|
157
|
-
'file-name': core_1.Flags.string({ char: 'n', description: 'name of the file' }),
|
|
158
|
-
example: core_1.Flags.string({ char: 'e', description: getExamplesFlagDescription() }),
|
|
159
|
-
studio: core_1.Flags.boolean({ char: 's', description: 'open in Studio' }),
|
|
160
|
-
port: core_1.Flags.integer({ char: 'p', description: 'port in which to start Studio' }),
|
|
161
|
-
'no-tty': core_1.Flags.boolean({ description: 'do not use an interactive terminal' }),
|
|
162
|
-
};
|
|
155
|
+
NewFile.flags = (0, file_flags_1.fileFlags)(getExamplesFlagDescription());
|
|
163
156
|
NewFile.examples = [
|
|
164
157
|
'asyncapi new\t - start creation of a file in interactive mode',
|
|
165
158
|
'asyncapi new --file-name=my-asyncapi.yml --example=default-example.yml --no-tty\t - create a new file with a specific name, using one of the examples and without interactive mode'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Command from '../../base';
|
|
2
|
-
import { Specification } from '../../models/SpecificationFile';
|
|
1
|
+
import Command from '../../core/base';
|
|
2
|
+
import { Specification } from '../../core/models/SpecificationFile';
|
|
3
3
|
export declare const successMessage: (projectName: string) => string;
|
|
4
4
|
export default class NewGlee extends Command {
|
|
5
5
|
static description: string;
|
package/lib/commands/new/glee.js
CHANGED
|
@@ -2,30 +2,30 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.successMessage = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const core_1 = require("@oclif/core");
|
|
6
5
|
const fs_1 = require("fs");
|
|
7
|
-
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
6
|
+
const base_1 = tslib_1.__importDefault(require("../../core/base"));
|
|
8
7
|
const path_1 = tslib_1.__importStar(require("path"));
|
|
9
8
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
10
|
-
const SpecificationFile_1 = require("../../models/SpecificationFile");
|
|
9
|
+
const SpecificationFile_1 = require("../../core/models/SpecificationFile");
|
|
11
10
|
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
|
|
12
11
|
const inquirer_1 = require("inquirer");
|
|
13
12
|
// eslint-disable-next-line
|
|
14
13
|
// @ts-ignore
|
|
15
14
|
const generator_1 = tslib_1.__importDefault(require("@asyncapi/generator"));
|
|
16
15
|
const picocolors_1 = require("picocolors");
|
|
16
|
+
const glee_flags_1 = require("../../core/flags/new/glee.flags");
|
|
17
17
|
const successMessage = (projectName) => `🎉 Your Glee project has been successfully created!
|
|
18
18
|
⏩ Next steps: follow the instructions ${(0, picocolors_1.cyan)('below')} to manage your project:
|
|
19
19
|
|
|
20
20
|
cd ${projectName}\t\t ${(0, picocolors_1.gray)('# Navigate to the project directory')}
|
|
21
21
|
npm install\t\t ${(0, picocolors_1.gray)('# Install the project dependencies')}
|
|
22
|
-
npm run dev\t\t ${(0, picocolors_1.gray)('# Start the project in development mode')}
|
|
22
|
+
npm run dev\t\t ${(0, picocolors_1.gray)('# Start the project in development mode')}
|
|
23
23
|
|
|
24
24
|
You can also open the project in your favourite editor and start tweaking it.
|
|
25
25
|
`;
|
|
26
26
|
exports.successMessage = successMessage;
|
|
27
27
|
const errorMessages = {
|
|
28
|
-
alreadyExists: (projectName) => `Unable to create the project because the directory "${(0, picocolors_1.cyan)(projectName)}" already exists at "${process.cwd()}/${projectName}".
|
|
28
|
+
alreadyExists: (projectName) => `Unable to create the project because the directory "${(0, picocolors_1.cyan)(projectName)}" already exists at "${process.cwd()}/${projectName}".
|
|
29
29
|
To specify a different name for the new project, please run the command below with a unique project name:
|
|
30
30
|
|
|
31
31
|
${(0, picocolors_1.gray)('asyncapi new glee --name ') + (0, picocolors_1.gray)(projectName) + (0, picocolors_1.gray)('-1')}`,
|
|
@@ -174,24 +174,4 @@ exports.default = NewGlee;
|
|
|
174
174
|
NewGlee.description = 'Creates a new Glee project';
|
|
175
175
|
NewGlee.successMessage = exports.successMessage;
|
|
176
176
|
NewGlee.errorMessages = errorMessages;
|
|
177
|
-
NewGlee.flags =
|
|
178
|
-
help: core_1.Flags.help({ char: 'h' }),
|
|
179
|
-
name: core_1.Flags.string({
|
|
180
|
-
char: 'n',
|
|
181
|
-
description: 'Name of the Project',
|
|
182
|
-
default: 'project',
|
|
183
|
-
}),
|
|
184
|
-
template: core_1.Flags.string({
|
|
185
|
-
char: 't',
|
|
186
|
-
description: 'Name of the Template',
|
|
187
|
-
default: 'default',
|
|
188
|
-
}),
|
|
189
|
-
file: core_1.Flags.string({
|
|
190
|
-
char: 'f',
|
|
191
|
-
description: 'The path to the AsyncAPI file for generating a Glee project.',
|
|
192
|
-
}),
|
|
193
|
-
'force-write': core_1.Flags.boolean({
|
|
194
|
-
default: false,
|
|
195
|
-
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)',
|
|
196
|
-
}),
|
|
197
|
-
};
|
|
177
|
+
NewGlee.flags = (0, glee_flags_1.gleeFlags)();
|
package/lib/commands/optimize.js
CHANGED
|
@@ -4,13 +4,14 @@ exports.Outputs = exports.Optimizations = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
6
|
const optimizer_1 = require("@asyncapi/optimizer");
|
|
7
|
-
const base_1 = tslib_1.__importDefault(require("../base"));
|
|
8
|
-
const validation_error_1 = require("../errors/validation-error");
|
|
9
|
-
const SpecificationFile_1 = require("../models/SpecificationFile");
|
|
7
|
+
const base_1 = tslib_1.__importDefault(require("../core/base"));
|
|
8
|
+
const validation_error_1 = require("../core/errors/validation-error");
|
|
9
|
+
const SpecificationFile_1 = require("../core/models/SpecificationFile");
|
|
10
10
|
const inquirer = tslib_1.__importStar(require("inquirer"));
|
|
11
11
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
12
12
|
const fs_1 = require("fs");
|
|
13
13
|
const parser_1 = require("@asyncapi/parser");
|
|
14
|
+
const optimize_flags_1 = require("../core/flags/optimize.flags");
|
|
14
15
|
const { writeFile } = fs_1.promises;
|
|
15
16
|
var Optimizations;
|
|
16
17
|
(function (Optimizations) {
|
|
@@ -195,12 +196,7 @@ Optimize.examples = [
|
|
|
195
196
|
'asyncapi optimize ./asyncapi.yaml --optimization=remove-components --optimization=reuse-components --optimization=move-all-to-components --no-tty',
|
|
196
197
|
'asyncapi optimize ./asyncapi.yaml --optimization=remove-components --output=terminal --no-tty',
|
|
197
198
|
];
|
|
198
|
-
Optimize.flags =
|
|
199
|
-
help: core_1.Flags.help({ char: 'h' }),
|
|
200
|
-
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.' }),
|
|
201
|
-
output: core_1.Flags.string({ char: 'o', default: Outputs.TERMINAL, options: Object.values(Outputs), description: 'select where you want the output.' }),
|
|
202
|
-
'no-tty': core_1.Flags.boolean({ description: 'do not use an interactive terminal', default: false }),
|
|
203
|
-
};
|
|
199
|
+
Optimize.flags = (0, optimize_flags_1.optimizeFlags)();
|
|
204
200
|
Optimize.args = {
|
|
205
201
|
'spec-file': core_1.Args.string({ description: 'spec path, url, or context-name', required: false }),
|
|
206
202
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../core/base"));
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
6
|
class Start extends base_1.default {
|
|
7
7
|
run() {
|
|
@@ -12,4 +12,4 @@ class Start extends base_1.default {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
exports.default = Start;
|
|
15
|
-
Start.description = '
|
|
15
|
+
Start.description = '';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../core/base"));
|
|
5
|
+
const Studio_1 = require("../../core/models/Studio");
|
|
6
|
+
const SpecificationFile_1 = require("../../core/models/SpecificationFile");
|
|
7
|
+
const studio_flags_1 = require("../../core/flags/start/studio.flags");
|
|
8
8
|
class StartStudio extends base_1.default {
|
|
9
9
|
run() {
|
|
10
10
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -19,8 +19,4 @@ class StartStudio extends base_1.default {
|
|
|
19
19
|
}
|
|
20
20
|
exports.default = StartStudio;
|
|
21
21
|
StartStudio.description = 'starts a new local instance of Studio';
|
|
22
|
-
StartStudio.flags =
|
|
23
|
-
help: core_1.Flags.help({ char: 'h' }),
|
|
24
|
-
file: core_1.Flags.string({ char: 'f', description: 'path to the AsyncAPI file to link with Studio' }),
|
|
25
|
-
port: core_1.Flags.integer({ char: 'p', description: 'port in which to start Studio' }),
|
|
26
|
-
};
|
|
22
|
+
StartStudio.flags = (0, studio_flags_1.studioFlags)();
|
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;
|