@redocly/cli 0.0.0-snapshot.1740061304 → 0.0.0-snapshot.1740404057
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/index.js +16 -20
- package/lib/types.d.ts +2 -1
- package/lib/utils/miscellaneous.js +5 -5
- package/package.json +4 -3
package/lib/index.js
CHANGED
|
@@ -729,10 +729,10 @@ yargs
|
|
|
729
729
|
process.env.REDOCLY_CLI_COMMAND = 'eject';
|
|
730
730
|
(0, wrapper_1.commandWrapper)(eject_1.handleEject)(argv);
|
|
731
731
|
})
|
|
732
|
-
.command('respect [files
|
|
732
|
+
.command('respect [files...]', 'Run Arazzo tests.', (yargs) => {
|
|
733
733
|
return yargs
|
|
734
734
|
.positional('files', {
|
|
735
|
-
describe: 'Test files or glob pattern',
|
|
735
|
+
describe: 'Test files or glob pattern.',
|
|
736
736
|
type: 'string',
|
|
737
737
|
array: true,
|
|
738
738
|
default: [],
|
|
@@ -741,53 +741,53 @@ yargs
|
|
|
741
741
|
.options({
|
|
742
742
|
input: {
|
|
743
743
|
alias: 'i',
|
|
744
|
-
describe: 'Input parameters',
|
|
744
|
+
describe: 'Input parameters.',
|
|
745
745
|
type: 'string',
|
|
746
746
|
},
|
|
747
747
|
server: {
|
|
748
748
|
alias: 'S',
|
|
749
|
-
describe: 'Server parameters',
|
|
749
|
+
describe: 'Server parameters.',
|
|
750
750
|
type: 'string',
|
|
751
751
|
},
|
|
752
752
|
workflow: {
|
|
753
753
|
alias: 'w',
|
|
754
|
-
describe: 'Workflow name',
|
|
754
|
+
describe: 'Workflow name.',
|
|
755
755
|
type: 'string',
|
|
756
756
|
array: true,
|
|
757
757
|
},
|
|
758
758
|
skip: {
|
|
759
759
|
alias: 's',
|
|
760
|
-
describe: 'Workflow to skip',
|
|
760
|
+
describe: 'Workflow to skip.',
|
|
761
761
|
type: 'string',
|
|
762
762
|
array: true,
|
|
763
763
|
},
|
|
764
764
|
verbose: {
|
|
765
765
|
alias: 'v',
|
|
766
|
-
describe: 'Apply verbose mode',
|
|
766
|
+
describe: 'Apply verbose mode.',
|
|
767
767
|
type: 'boolean',
|
|
768
768
|
},
|
|
769
769
|
'har-output': {
|
|
770
|
-
describe: 'Har file output name',
|
|
770
|
+
describe: 'Har file output name.',
|
|
771
771
|
type: 'string',
|
|
772
772
|
},
|
|
773
773
|
'json-output': {
|
|
774
|
-
describe: 'JSON file output name',
|
|
774
|
+
describe: 'JSON file output name.',
|
|
775
775
|
type: 'string',
|
|
776
776
|
},
|
|
777
777
|
'client-cert': {
|
|
778
|
-
describe: 'Mutual TLS client certificate',
|
|
778
|
+
describe: 'Mutual TLS client certificate.',
|
|
779
779
|
type: 'string',
|
|
780
780
|
},
|
|
781
781
|
'client-key': {
|
|
782
|
-
describe: 'Mutual TLS client key',
|
|
782
|
+
describe: 'Mutual TLS client key.',
|
|
783
783
|
type: 'string',
|
|
784
784
|
},
|
|
785
785
|
'ca-cert': {
|
|
786
|
-
describe: 'Mutual TLS CA certificate',
|
|
786
|
+
describe: 'Mutual TLS CA certificate.',
|
|
787
787
|
type: 'string',
|
|
788
788
|
},
|
|
789
789
|
severity: {
|
|
790
|
-
describe: 'Severity of the check',
|
|
790
|
+
describe: 'Severity of the check.',
|
|
791
791
|
type: 'string',
|
|
792
792
|
},
|
|
793
793
|
});
|
|
@@ -796,23 +796,19 @@ yargs
|
|
|
796
796
|
const { handleRun } = await Promise.resolve().then(() => require('@redocly/respect-core'));
|
|
797
797
|
(0, wrapper_1.commandWrapper)(handleRun)(argv);
|
|
798
798
|
})
|
|
799
|
-
.command('generate-arazzo <descriptionPath>', 'Auto-generate
|
|
799
|
+
.command('generate-arazzo <descriptionPath>', 'Auto-generate arazzo description file from an API description.', (yargs) => {
|
|
800
800
|
return yargs
|
|
801
801
|
.positional('descriptionPath', {
|
|
802
|
-
describe: 'Description file path',
|
|
802
|
+
describe: 'Description file path.',
|
|
803
803
|
type: 'string',
|
|
804
804
|
})
|
|
805
805
|
.env('REDOCLY_CLI_RESPECT')
|
|
806
806
|
.options({
|
|
807
807
|
'output-file': {
|
|
808
808
|
alias: 'o',
|
|
809
|
-
describe: 'Output File name',
|
|
809
|
+
describe: 'Output File name.',
|
|
810
810
|
type: 'string',
|
|
811
811
|
},
|
|
812
|
-
extended: {
|
|
813
|
-
describe: 'Generate config with populated values from description using success criteria',
|
|
814
|
-
type: 'boolean',
|
|
815
|
-
},
|
|
816
812
|
});
|
|
817
813
|
}, async (argv) => {
|
|
818
814
|
process.env.REDOCLY_CLI_COMMAND = 'generate-arazzo';
|
package/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BundleOutputFormat, Region, Config, RuleSeverity } from '@redocly/openapi-core';
|
|
2
|
+
import type { RespectOptions, GenerateArazzoFileOptions } from '@redocly/respect-core';
|
|
2
3
|
import type { ArgumentsCamelCase } from 'yargs';
|
|
3
4
|
import type { LintOptions } from './commands/lint';
|
|
4
5
|
import type { BundleOptions } from './commands/bundle';
|
|
@@ -27,7 +28,7 @@ export type Entrypoint = {
|
|
|
27
28
|
export declare const outputExtensions: ReadonlyArray<BundleOutputFormat>;
|
|
28
29
|
export type OutputExtensions = 'json' | 'yaml' | 'yml' | undefined;
|
|
29
30
|
export declare const regionChoices: ReadonlyArray<Region>;
|
|
30
|
-
export type CommandOptions = StatsOptions | SplitOptions | JoinOptions | PushOptions | CMSPushOptions | LintOptions | BundleOptions | LoginOptions | LogoutOptions | PreviewDocsOptions | BuildDocsArgv | PushStatusOptions | PreviewProjectOptions | TranslationsOptions | EjectOptions;
|
|
31
|
+
export type CommandOptions = StatsOptions | SplitOptions | JoinOptions | PushOptions | CMSPushOptions | LintOptions | BundleOptions | LoginOptions | LogoutOptions | PreviewDocsOptions | BuildDocsArgv | PushStatusOptions | PreviewProjectOptions | TranslationsOptions | EjectOptions | RespectOptions | GenerateArazzoFileOptions;
|
|
31
32
|
export type VerifyConfigOptions = {
|
|
32
33
|
config?: string;
|
|
33
34
|
'lint-config'?: RuleSeverity;
|
|
@@ -49,9 +49,7 @@ const reference_docs_config_schema_1 = require("@redocly/config/lib/reference-do
|
|
|
49
49
|
const types_1 = require("../types");
|
|
50
50
|
const update_version_notifier_1 = require("./update-version-notifier");
|
|
51
51
|
const push_1 = require("../commands/push");
|
|
52
|
-
const oauth_client_1 = require("../auth/oauth-client");
|
|
53
52
|
const api_1 = require("../reunite/api");
|
|
54
|
-
const otel_1 = require("../otel");
|
|
55
53
|
async function getFallbackApisOrExit(argsApis, config) {
|
|
56
54
|
const { apis } = config;
|
|
57
55
|
const shouldFallbackToAllDefinitions = !(0, utils_1.isNotEmptyArray)(argsApis) && (0, utils_1.isNotEmptyObject)(apis);
|
|
@@ -443,7 +441,6 @@ function cleanColors(input) {
|
|
|
443
441
|
// eslint-disable-next-line no-control-regex
|
|
444
442
|
return input.replace(/\x1b\[\d+m/g, '');
|
|
445
443
|
}
|
|
446
|
-
otel_1.otelTelemetry.init();
|
|
447
444
|
async function sendTelemetry(argv, exit_code, has_config, spec_version, spec_keyword, spec_full_version) {
|
|
448
445
|
try {
|
|
449
446
|
if (!argv) {
|
|
@@ -452,7 +449,8 @@ async function sendTelemetry(argv, exit_code, has_config, spec_version, spec_key
|
|
|
452
449
|
const { _: [command], $0: _, ...args } = argv;
|
|
453
450
|
const event_time = new Date().toISOString();
|
|
454
451
|
const redoclyClient = new openapi_core_1.RedoclyClient();
|
|
455
|
-
const
|
|
452
|
+
const { RedoclyOAuthClient } = await Promise.resolve().then(() => require('../auth/oauth-client'));
|
|
453
|
+
const oauthClient = new RedoclyOAuthClient('redocly-cli', update_version_notifier_1.version);
|
|
456
454
|
const reuniteUrl = (0, api_1.getReuniteUrl)(argv.residency);
|
|
457
455
|
const logged_in = redoclyClient.hasTokens() || (await oauthClient.isAuthorized(reuniteUrl));
|
|
458
456
|
const data = {
|
|
@@ -474,7 +472,9 @@ async function sendTelemetry(argv, exit_code, has_config, spec_version, spec_key
|
|
|
474
472
|
spec_keyword,
|
|
475
473
|
spec_full_version,
|
|
476
474
|
};
|
|
477
|
-
|
|
475
|
+
const { otelTelemetry } = await Promise.resolve().then(() => require('../otel'));
|
|
476
|
+
otelTelemetry.init();
|
|
477
|
+
otelTelemetry.send(data.command, data);
|
|
478
478
|
}
|
|
479
479
|
catch (err) {
|
|
480
480
|
// Do nothing.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/cli",
|
|
3
|
-
"version": "0.0.0-snapshot.
|
|
3
|
+
"version": "0.0.0-snapshot.1740404057",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -30,13 +30,14 @@
|
|
|
30
30
|
"OpenAPI linter",
|
|
31
31
|
"Swagger linter",
|
|
32
32
|
"AsyncAPI linter",
|
|
33
|
+
"Arazzo linter",
|
|
33
34
|
"oas"
|
|
34
35
|
],
|
|
35
36
|
"contributors": [
|
|
36
37
|
"Roman Hotsiy <roman@redocly.com> (https://redocly.com/)"
|
|
37
38
|
],
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@redocly/openapi-core": "0.0.0-snapshot.
|
|
40
|
+
"@redocly/openapi-core": "0.0.0-snapshot.1740404057",
|
|
40
41
|
"abort-controller": "^3.0.0",
|
|
41
42
|
"chokidar": "^3.5.1",
|
|
42
43
|
"colorette": "^1.2.0",
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
"simple-websocket": "^9.0.0",
|
|
61
62
|
"styled-components": "^6.0.7",
|
|
62
63
|
"yargs": "17.0.1",
|
|
63
|
-
"@redocly/respect-core": "0.0.0-snapshot.
|
|
64
|
+
"@redocly/respect-core": "0.0.0-snapshot.1740404057"
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
67
|
"@types/configstore": "^5.0.1",
|