@redocly/respect-core 0.0.0-snapshot.1752491489 → 0.0.0-snapshot.1752515643
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/handlers/generate.d.ts +8 -5
- package/lib/handlers/generate.d.ts.map +1 -1
- package/lib/handlers/generate.js +2 -19
- package/lib/handlers/generate.js.map +1 -1
- package/lib/handlers/run.d.ts +15 -11
- package/lib/handlers/run.d.ts.map +1 -1
- package/lib/handlers/run.js +22 -66
- package/lib/handlers/run.js.map +1 -1
- package/lib/index.d.ts +6 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -1
- package/lib/index.js.map +1 -1
- package/lib/modules/arazzo-description-generator/generate-arazzo-description.d.ts +2 -2
- package/lib/modules/arazzo-description-generator/generate-arazzo-description.d.ts.map +1 -1
- package/lib/modules/arazzo-description-generator/generate-arazzo-description.js +5 -2
- package/lib/modules/arazzo-description-generator/generate-arazzo-description.js.map +1 -1
- package/lib/modules/arazzo-description-generator/generate-example-value.d.ts +2 -1
- package/lib/modules/arazzo-description-generator/generate-example-value.d.ts.map +1 -1
- package/lib/modules/arazzo-description-generator/generate-example-value.js +2 -2
- package/lib/modules/arazzo-description-generator/generate-example-value.js.map +1 -1
- package/lib/modules/arazzo-description-generator/generate-test-data-from-json-schema.d.ts +2 -1
- package/lib/modules/arazzo-description-generator/generate-test-data-from-json-schema.d.ts.map +1 -1
- package/lib/modules/arazzo-description-generator/generate-test-data-from-json-schema.js +1 -3
- package/lib/modules/arazzo-description-generator/generate-test-data-from-json-schema.js.map +1 -1
- package/lib/modules/cli-output/display-checks.d.ts +8 -1
- package/lib/modules/cli-output/display-checks.d.ts.map +1 -1
- package/lib/modules/cli-output/display-checks.js +7 -8
- package/lib/modules/cli-output/display-checks.js.map +1 -1
- package/lib/modules/cli-output/display-errors.d.ts +2 -1
- package/lib/modules/cli-output/display-errors.d.ts.map +1 -1
- package/lib/modules/cli-output/display-errors.js +8 -10
- package/lib/modules/cli-output/display-errors.js.map +1 -1
- package/lib/modules/cli-output/display-summary.d.ts +5 -5
- package/lib/modules/cli-output/display-summary.d.ts.map +1 -1
- package/lib/modules/cli-output/display-summary.js +6 -7
- package/lib/modules/cli-output/display-summary.js.map +1 -1
- package/lib/modules/cli-output/index.d.ts +0 -2
- package/lib/modules/cli-output/index.d.ts.map +1 -1
- package/lib/modules/cli-output/index.js +0 -2
- package/lib/modules/cli-output/index.js.map +1 -1
- package/lib/modules/context-parser/get-value-from-context.d.ts +13 -4
- package/lib/modules/context-parser/get-value-from-context.d.ts.map +1 -1
- package/lib/modules/context-parser/get-value-from-context.js +26 -24
- package/lib/modules/context-parser/get-value-from-context.js.map +1 -1
- package/lib/modules/context-parser/handle-request-body-replacements.d.ts +7 -1
- package/lib/modules/context-parser/handle-request-body-replacements.d.ts.map +1 -1
- package/lib/modules/context-parser/handle-request-body-replacements.js +2 -1
- package/lib/modules/context-parser/handle-request-body-replacements.js.map +1 -1
- package/lib/modules/context-parser/parse-request-body.d.ts +1 -3
- package/lib/modules/context-parser/parse-request-body.d.ts.map +1 -1
- package/lib/modules/context-parser/parse-request-body.js +18 -45
- package/lib/modules/context-parser/parse-request-body.js.map +1 -1
- package/lib/modules/context-parser/resolve-reusable-object-reference.js +1 -1
- package/lib/modules/context-parser/resolve-reusable-object-reference.js.map +1 -1
- package/lib/modules/description-parser/bundle-openapi.d.ts +9 -1
- package/lib/modules/description-parser/bundle-openapi.d.ts.map +1 -1
- package/lib/modules/description-parser/bundle-openapi.js +13 -35
- package/lib/modules/description-parser/bundle-openapi.js.map +1 -1
- package/lib/modules/description-parser/get-request-data-from-openapi.d.ts +2 -1
- package/lib/modules/description-parser/get-request-data-from-openapi.d.ts.map +1 -1
- package/lib/modules/description-parser/get-request-data-from-openapi.js +6 -6
- package/lib/modules/description-parser/get-request-data-from-openapi.js.map +1 -1
- package/lib/modules/flow-runner/call-api-and-analyze-results.d.ts.map +1 -1
- package/lib/modules/flow-runner/call-api-and-analyze-results.js +1 -0
- package/lib/modules/flow-runner/call-api-and-analyze-results.js.map +1 -1
- package/lib/modules/flow-runner/context/create-test-context.d.ts.map +1 -1
- package/lib/modules/flow-runner/context/create-test-context.js +21 -9
- package/lib/modules/flow-runner/context/create-test-context.js.map +1 -1
- package/lib/modules/flow-runner/get-server-url.d.ts.map +1 -1
- package/lib/modules/flow-runner/get-server-url.js +5 -1
- package/lib/modules/flow-runner/get-server-url.js.map +1 -1
- package/lib/modules/flow-runner/get-test-description-from-file.d.ts +11 -2
- package/lib/modules/flow-runner/get-test-description-from-file.d.ts.map +1 -1
- package/lib/modules/flow-runner/get-test-description-from-file.js +12 -14
- package/lib/modules/flow-runner/get-test-description-from-file.js.map +1 -1
- package/lib/modules/flow-runner/get-workflows-to-run.d.ts +7 -1
- package/lib/modules/flow-runner/get-workflows-to-run.d.ts.map +1 -1
- package/lib/modules/flow-runner/get-workflows-to-run.js +8 -10
- package/lib/modules/flow-runner/get-workflows-to-run.js.map +1 -1
- package/lib/modules/flow-runner/index.d.ts +0 -1
- package/lib/modules/flow-runner/index.d.ts.map +1 -1
- package/lib/modules/flow-runner/index.js +0 -1
- package/lib/modules/flow-runner/index.js.map +1 -1
- package/lib/modules/flow-runner/prepare-request.d.ts.map +1 -1
- package/lib/modules/flow-runner/prepare-request.js +9 -2
- package/lib/modules/flow-runner/prepare-request.js.map +1 -1
- package/lib/modules/flow-runner/resolve-x-security-parameters.d.ts.map +1 -1
- package/lib/modules/flow-runner/resolve-x-security-parameters.js +1 -0
- package/lib/modules/flow-runner/resolve-x-security-parameters.js.map +1 -1
- package/lib/modules/flow-runner/run-step.d.ts.map +1 -1
- package/lib/modules/flow-runner/run-step.js +26 -12
- package/lib/modules/flow-runner/run-step.js.map +1 -1
- package/lib/modules/flow-runner/runner.d.ts +4 -8
- package/lib/modules/flow-runner/runner.d.ts.map +1 -1
- package/lib/modules/flow-runner/runner.js +46 -48
- package/lib/modules/flow-runner/runner.js.map +1 -1
- package/lib/modules/flow-runner/schema/schema-checker.d.ts.map +1 -1
- package/lib/modules/flow-runner/schema/schema-checker.js +2 -4
- package/lib/modules/flow-runner/schema/schema-checker.js.map +1 -1
- package/lib/modules/flow-runner/success-criteria/check-success-criteria.d.ts.map +1 -1
- package/lib/modules/flow-runner/success-criteria/check-success-criteria.js +3 -3
- package/lib/modules/flow-runner/success-criteria/check-success-criteria.js.map +1 -1
- package/lib/modules/runtime-expressions/evaluate.d.ts +4 -2
- package/lib/modules/runtime-expressions/evaluate.d.ts.map +1 -1
- package/lib/modules/runtime-expressions/evaluate.js +15 -15
- package/lib/modules/runtime-expressions/evaluate.js.map +1 -1
- package/lib/types.d.ts +24 -11
- package/lib/types.d.ts.map +1 -1
- package/lib/utils/api-fetcher.d.ts +0 -3
- package/lib/utils/api-fetcher.d.ts.map +1 -1
- package/lib/utils/api-fetcher.js +23 -37
- package/lib/utils/api-fetcher.js.map +1 -1
- package/lib/utils/cli-outputs.d.ts +21 -10
- package/lib/utils/cli-outputs.d.ts.map +1 -1
- package/lib/utils/cli-outputs.js +18 -20
- package/lib/utils/cli-outputs.js.map +1 -1
- package/lib/utils/digest-auth/generate-digest-auth-header.d.ts.map +1 -1
- package/lib/utils/digest-auth/generate-digest-auth-header.js +10 -15
- package/lib/utils/digest-auth/generate-digest-auth-header.js.map +1 -1
- package/lib/utils/is-empty.d.ts.map +1 -1
- package/lib/utils/is-empty.js +3 -0
- package/lib/utils/is-empty.js.map +1 -1
- package/package.json +4 -16
- package/lib/modules/cli-output/display-files-summary-table.d.ts +0 -11
- package/lib/modules/cli-output/display-files-summary-table.d.ts.map +0 -1
- package/lib/modules/cli-output/display-files-summary-table.js +0 -68
- package/lib/modules/cli-output/display-files-summary-table.js.map +0 -1
- package/lib/modules/cli-output/json-logs.d.ts +0 -10
- package/lib/modules/cli-output/json-logs.d.ts.map +0 -1
- package/lib/modules/cli-output/json-logs.js +0 -81
- package/lib/modules/cli-output/json-logs.js.map +0 -1
- package/lib/modules/flow-runner/read-env-variables.d.ts +0 -2
- package/lib/modules/flow-runner/read-env-variables.d.ts.map +0 -1
- package/lib/modules/flow-runner/read-env-variables.js +0 -18
- package/lib/modules/flow-runner/read-env-variables.js.map +0 -1
- package/lib/utils/env.d.ts +0 -3
- package/lib/utils/env.d.ts.map +0 -1
- package/lib/utils/env.js +0 -9
- package/lib/utils/env.js.map +0 -1
- package/lib/utils/exit-with-error.d.ts +0 -2
- package/lib/utils/exit-with-error.d.ts.map +0 -1
- package/lib/utils/exit-with-error.js +0 -5
- package/lib/utils/exit-with-error.js.map +0 -1
- package/lib/utils/har-logs/create-har-log.d.ts +0 -2
- package/lib/utils/har-logs/create-har-log.d.ts.map +0 -1
- package/lib/utils/har-logs/create-har-log.js +0 -25
- package/lib/utils/har-logs/create-har-log.js.map +0 -1
- package/lib/utils/har-logs/helpers/add-headers.d.ts +0 -2
- package/lib/utils/har-logs/helpers/add-headers.d.ts.map +0 -1
- package/lib/utils/har-logs/helpers/add-headers.js +0 -17
- package/lib/utils/har-logs/helpers/add-headers.js.map +0 -1
- package/lib/utils/har-logs/helpers/build-headers.d.ts +0 -10
- package/lib/utils/har-logs/helpers/build-headers.d.ts.map +0 -1
- package/lib/utils/har-logs/helpers/build-headers.js +0 -32
- package/lib/utils/har-logs/helpers/build-headers.js.map +0 -1
- package/lib/utils/har-logs/helpers/build-params.d.ts +0 -2
- package/lib/utils/har-logs/helpers/build-params.d.ts.map +0 -1
- package/lib/utils/har-logs/helpers/build-params.js +0 -18
- package/lib/utils/har-logs/helpers/build-params.js.map +0 -1
- package/lib/utils/har-logs/helpers/build-request-cookies.d.ts +0 -2
- package/lib/utils/har-logs/helpers/build-request-cookies.d.ts.map +0 -1
- package/lib/utils/har-logs/helpers/build-request-cookies.js +0 -18
- package/lib/utils/har-logs/helpers/build-request-cookies.js.map +0 -1
- package/lib/utils/har-logs/helpers/build-response-cookies.d.ts +0 -2
- package/lib/utils/har-logs/helpers/build-response-cookies.d.ts.map +0 -1
- package/lib/utils/har-logs/helpers/build-response-cookies.js +0 -40
- package/lib/utils/har-logs/helpers/build-response-cookies.js.map +0 -1
- package/lib/utils/har-logs/helpers/get-agent.d.ts +0 -2
- package/lib/utils/har-logs/helpers/get-agent.d.ts.map +0 -1
- package/lib/utils/har-logs/helpers/get-agent.js +0 -89
- package/lib/utils/har-logs/helpers/get-agent.js.map +0 -1
- package/lib/utils/har-logs/helpers/get-duration.d.ts +0 -2
- package/lib/utils/har-logs/helpers/get-duration.d.ts.map +0 -1
- package/lib/utils/har-logs/helpers/get-duration.js +0 -6
- package/lib/utils/har-logs/helpers/get-duration.js.map +0 -1
- package/lib/utils/har-logs/helpers/get-input-url.d.ts +0 -2
- package/lib/utils/har-logs/helpers/get-input-url.d.ts.map +0 -1
- package/lib/utils/har-logs/helpers/get-input-url.js +0 -5
- package/lib/utils/har-logs/helpers/get-input-url.js.map +0 -1
- package/lib/utils/har-logs/helpers/handle-request.d.ts +0 -9
- package/lib/utils/har-logs/helpers/handle-request.d.ts.map +0 -1
- package/lib/utils/har-logs/helpers/handle-request.js +0 -199
- package/lib/utils/har-logs/helpers/handle-request.js.map +0 -1
- package/lib/utils/har-logs/index.d.ts +0 -3
- package/lib/utils/har-logs/index.d.ts.map +0 -1
- package/lib/utils/har-logs/index.js +0 -3
- package/lib/utils/har-logs/index.js.map +0 -1
- package/lib/utils/har-logs/with-har.d.ts +0 -6
- package/lib/utils/har-logs/with-har.d.ts.map +0 -1
- package/lib/utils/har-logs/with-har.js +0 -189
- package/lib/utils/har-logs/with-har.js.map +0 -1
- package/lib/utils/is-url.d.ts +0 -2
- package/lib/utils/is-url.d.ts.map +0 -1
- package/lib/utils/is-url.js +0 -13
- package/lib/utils/is-url.js.map +0 -1
- package/lib/utils/logger/logger.d.ts +0 -16
- package/lib/utils/logger/logger.d.ts.map +0 -1
- package/lib/utils/logger/logger.js +0 -28
- package/lib/utils/logger/logger.js.map +0 -1
- package/lib/utils/mtls/create-mtls-client.d.ts +0 -4
- package/lib/utils/mtls/create-mtls-client.d.ts.map +0 -1
- package/lib/utils/mtls/create-mtls-client.js +0 -19
- package/lib/utils/mtls/create-mtls-client.js.map +0 -1
- package/lib/utils/mtls/resolve-mtls-certificates.d.ts +0 -7
- package/lib/utils/mtls/resolve-mtls-certificates.d.ts.map +0 -1
- package/lib/utils/mtls/resolve-mtls-certificates.js +0 -46
- package/lib/utils/mtls/resolve-mtls-certificates.js.map +0 -1
- package/lib/utils/package.d.ts +0 -2
- package/lib/utils/package.d.ts.map +0 -1
- package/lib/utils/package.js +0 -4
- package/lib/utils/package.js.map +0 -1
- package/lib/utils/yaml.d.ts +0 -5
- package/lib/utils/yaml.d.ts.map +0 -1
- package/lib/utils/yaml.js +0 -18
- package/lib/utils/yaml.js.map +0 -1
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export type
|
|
1
|
+
import { type BaseResolver, type CollectFn, type Config } from '@redocly/openapi-core';
|
|
2
|
+
export type GenerateArazzoOptions = {
|
|
3
3
|
descriptionPath: string;
|
|
4
|
-
|
|
5
|
-
config
|
|
4
|
+
outputFile?: string;
|
|
5
|
+
config: Config;
|
|
6
|
+
version: string;
|
|
7
|
+
collectSpecData?: CollectFn;
|
|
8
|
+
externalRefResolver?: BaseResolver;
|
|
6
9
|
};
|
|
7
|
-
export declare function
|
|
10
|
+
export declare function generateArazzo(options: GenerateArazzoOptions): Promise<string>;
|
|
8
11
|
//# sourceMappingURL=generate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/handlers/generate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/handlers/generate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEvF,MAAM,MAAM,qBAAqB,GAAG;IAClC,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,mBAAmB,CAAC,EAAE,YAAY,CAAC;CACpC,CAAC;AAEF,wBAAsB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpF"}
|
package/lib/handlers/generate.js
CHANGED
|
@@ -1,22 +1,5 @@
|
|
|
1
|
-
import { blue, yellow, gray } from 'colorette';
|
|
2
|
-
import { writeFileSync } from 'node:fs';
|
|
3
|
-
import { stringifyYaml } from '../utils/yaml.js';
|
|
4
1
|
import { generateArazzoDescription } from '../modules/arazzo-description-generator/index.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const logger = DefaultLogger.getInstance();
|
|
8
|
-
export async function handleGenerate({ argv }) {
|
|
9
|
-
try {
|
|
10
|
-
logger.log(gray('\n Generating Arazzo description... \n'));
|
|
11
|
-
const generatedConfig = await generateArazzoDescription(argv);
|
|
12
|
-
const content = stringifyYaml(generatedConfig);
|
|
13
|
-
const fileName = argv['output-file'] || 'auto-generated.arazzo.yaml';
|
|
14
|
-
writeFileSync(fileName, content);
|
|
15
|
-
logger.log('\n' + blue(`Arazzo description ${yellow(fileName)} successfully generated.`) + '\n');
|
|
16
|
-
}
|
|
17
|
-
catch (_err) {
|
|
18
|
-
exitWithError('\n' +
|
|
19
|
-
'❌ Failed to generate Arazzo description. Check the output file path you provided, or the OpenAPI file content.');
|
|
20
|
-
}
|
|
2
|
+
export async function generateArazzo(options) {
|
|
3
|
+
return await generateArazzoDescription(options);
|
|
21
4
|
}
|
|
22
5
|
//# sourceMappingURL=generate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/handlers/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/handlers/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAY7F,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAA8B;IACjE,OAAO,MAAM,yBAAyB,CAAC,OAAO,CAAC,CAAC;AAClD,CAAC"}
|
package/lib/handlers/run.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Config, type CollectFn, type LoggerInterface } from '@redocly/openapi-core';
|
|
2
|
+
import { type RunFileResult } from '../types.js';
|
|
2
3
|
export type RespectOptions = {
|
|
3
4
|
files: string[];
|
|
4
5
|
input?: string;
|
|
@@ -6,16 +7,19 @@ export type RespectOptions = {
|
|
|
6
7
|
workflow?: string[];
|
|
7
8
|
skip?: string[];
|
|
8
9
|
verbose?: boolean;
|
|
9
|
-
'har-output'?: string;
|
|
10
|
-
'json-output'?: string;
|
|
11
|
-
'client-cert'?: string;
|
|
12
|
-
'client-key'?: string;
|
|
13
|
-
'ca-cert'?: string;
|
|
14
|
-
'max-steps': number;
|
|
15
10
|
severity?: string;
|
|
16
|
-
config
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
config: Config;
|
|
12
|
+
maxSteps: number;
|
|
13
|
+
maxFetchTimeout: number;
|
|
14
|
+
executionTimeout: number;
|
|
15
|
+
collectSpecData?: CollectFn;
|
|
16
|
+
requestFileLoader: {
|
|
17
|
+
getFileBody: (filePath: string) => Promise<Blob>;
|
|
18
|
+
};
|
|
19
|
+
envVariables: Record<string, string>;
|
|
20
|
+
version?: string;
|
|
21
|
+
logger: LoggerInterface;
|
|
22
|
+
fetch: typeof fetch;
|
|
19
23
|
};
|
|
20
|
-
export declare function handleRun(
|
|
24
|
+
export declare function handleRun(options: RespectOptions): Promise<RunFileResult[]>;
|
|
21
25
|
//# sourceMappingURL=run.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/handlers/run.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/handlers/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI1F,OAAO,EAAE,KAAK,aAAa,EAAmB,MAAM,aAAa,CAAC;AAElE,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,iBAAiB,EAAE;QAAE,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,CAAC;IACxE,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,OAAO,KAAK,CAAC;CACrB,CAAC;AAEF,wBAAsB,SAAS,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAoBjF"}
|
package/lib/handlers/run.js
CHANGED
|
@@ -1,83 +1,39 @@
|
|
|
1
|
-
import { blue, green, red } from 'colorette';
|
|
2
1
|
import { runTestFile } from '../modules/flow-runner/index.js';
|
|
3
|
-
import { displayErrors, displaySummary,
|
|
4
|
-
import { DefaultLogger } from '../utils/logger/logger.js';
|
|
5
|
-
import { exitWithError } from '../utils/exit-with-error.js';
|
|
6
|
-
import { writeFileSync } from 'node:fs';
|
|
7
|
-
import { indent } from '../utils/cli-outputs.js';
|
|
2
|
+
import { displayErrors, displaySummary, calculateTotals } from '../modules/cli-output/index.js';
|
|
8
3
|
import { Timer } from '../modules/timeout-timer/timer.js';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
logger.log(red(`Cannot use both --skip and --workflow flags at the same time.`));
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
try {
|
|
26
|
-
Timer.getInstance(argv['execution-timeout']);
|
|
27
|
-
const startedAt = performance.now();
|
|
28
|
-
const testsRunProblemsStatus = [];
|
|
29
|
-
const { files } = argv;
|
|
30
|
-
const runAllFilesResult = [];
|
|
31
|
-
if (files.length > 1 && harOutputFile) {
|
|
32
|
-
// TODO: implement multiple run files HAR output
|
|
33
|
-
throw new Error('Currently only a single file can be run with --har-output. Please run a single file at a time.');
|
|
34
|
-
}
|
|
35
|
-
for (const path of files) {
|
|
36
|
-
const result = await runFile({ ...argv, file: path }, performance.now(), {
|
|
37
|
-
harFile: harOutputFile,
|
|
38
|
-
}, collectSpecData);
|
|
39
|
-
testsRunProblemsStatus.push(result.hasProblems);
|
|
40
|
-
runAllFilesResult.push(result);
|
|
41
|
-
}
|
|
42
|
-
const hasProblems = runAllFilesResult.some((result) => result.hasProblems);
|
|
43
|
-
const hasWarnings = runAllFilesResult.some((result) => result.hasWarnings);
|
|
44
|
-
logger.printNewLine();
|
|
45
|
-
displayFilesSummaryTable(runAllFilesResult);
|
|
46
|
-
logger.printNewLine();
|
|
47
|
-
if (jsonOutputFile) {
|
|
48
|
-
writeFileSync(jsonOutputFile, JSON.stringify({
|
|
49
|
-
files: composeJsonLogsFiles(runAllFilesResult),
|
|
50
|
-
status: hasProblems ? 'error' : hasWarnings ? 'warn' : 'success',
|
|
51
|
-
totalTime: performance.now() - startedAt,
|
|
52
|
-
}, null, 2), 'utf-8');
|
|
53
|
-
logger.log(blue(indent(`JSON logs saved in ${green(jsonOutputFile)}`, 2)));
|
|
54
|
-
logger.printNewLine();
|
|
55
|
-
logger.printNewLine();
|
|
56
|
-
}
|
|
57
|
-
if (hasProblems) {
|
|
58
|
-
throw new Error(' Tests exited with error ');
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
catch (err) {
|
|
62
|
-
exitWithError(err?.message ?? err);
|
|
4
|
+
export async function handleRun(options) {
|
|
5
|
+
const { files, executionTimeout, collectSpecData } = options;
|
|
6
|
+
Timer.getInstance(executionTimeout);
|
|
7
|
+
const testsRunProblemsStatus = [];
|
|
8
|
+
const runAllFilesResult = [];
|
|
9
|
+
for (const path of files) {
|
|
10
|
+
const result = await runFile({
|
|
11
|
+
options: { ...options, file: path },
|
|
12
|
+
startedAt: performance.now(),
|
|
13
|
+
collectSpecData,
|
|
14
|
+
});
|
|
15
|
+
testsRunProblemsStatus.push(result.hasProblems);
|
|
16
|
+
runAllFilesResult.push(result);
|
|
63
17
|
}
|
|
18
|
+
return runAllFilesResult;
|
|
64
19
|
}
|
|
65
|
-
async function runFile(
|
|
66
|
-
const
|
|
20
|
+
async function runFile({ options, startedAt, collectSpecData, }) {
|
|
21
|
+
const result = await runTestFile(options, collectSpecData);
|
|
22
|
+
const { executedWorkflows, ctx } = result;
|
|
67
23
|
const totals = calculateTotals(executedWorkflows);
|
|
68
24
|
const hasProblems = totals.workflows.failed > 0;
|
|
69
25
|
const hasWarnings = totals.workflows.warnings > 0;
|
|
70
26
|
const hasGlobalTimeoutError = executedWorkflows.some((workflow) => workflow.globalTimeoutError);
|
|
71
27
|
if (totals.steps.failed > 0 || totals.steps.warnings > 0 || totals.steps.skipped > 0) {
|
|
72
|
-
displayErrors(executedWorkflows);
|
|
28
|
+
displayErrors(executedWorkflows, options.logger);
|
|
73
29
|
}
|
|
74
|
-
displaySummary(startedAt, executedWorkflows,
|
|
30
|
+
displaySummary({ startedAt, workflows: executedWorkflows, options });
|
|
75
31
|
return {
|
|
76
32
|
hasProblems,
|
|
77
33
|
hasWarnings,
|
|
78
|
-
file:
|
|
34
|
+
file: options.file,
|
|
79
35
|
executedWorkflows,
|
|
80
|
-
|
|
36
|
+
options,
|
|
81
37
|
ctx,
|
|
82
38
|
totalTimeMs: performance.now() - startedAt,
|
|
83
39
|
totalRequests: totals.totalRequests,
|
package/lib/handlers/run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/handlers/run.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/handlers/run.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAChG,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAuB1D,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAuB;IACrD,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IAE7D,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAEpC,MAAM,sBAAsB,GAAc,EAAE,CAAC;IAC7C,MAAM,iBAAiB,GAAG,EAAE,CAAC;IAE7B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC;YAC3B,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,IAAI,EAA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AAE,GAAG,SAAS;QAC1C,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,kBAAkB,EAAE,qBAAqB;KAC1C,CAAC;AACJ,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type {
|
|
1
|
+
export { generateArazzo, handleRun } from './handlers/index.js';
|
|
2
|
+
export type { GenerateArazzoOptions } from './handlers/generate.js';
|
|
3
3
|
export type { RespectOptions } from './handlers/run.js';
|
|
4
|
-
export
|
|
4
|
+
export * from './types.js';
|
|
5
|
+
export { maskSecrets } from './modules/cli-output/mask-secrets.js';
|
|
6
|
+
export { calculateTotals } from './modules/cli-output/calculate-tests-passed.js';
|
|
7
|
+
export { RESET_ESCAPE_CODE } from './utils/cli-outputs.js';
|
|
5
8
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,YAAY,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { generateArazzo, handleRun } from './handlers/index.js';
|
|
2
|
+
export * from './types.js';
|
|
3
|
+
export { maskSecrets } from './modules/cli-output/mask-secrets.js';
|
|
4
|
+
export { calculateTotals } from './modules/cli-output/calculate-tests-passed.js';
|
|
5
|
+
export { RESET_ESCAPE_CODE } from './utils/cli-outputs.js';
|
|
2
6
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhE,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type GenerateArazzoOptions } from '../../handlers/generate.js';
|
|
2
2
|
export declare const infoSubstitute: {
|
|
3
3
|
title: string;
|
|
4
4
|
version: string;
|
|
5
5
|
};
|
|
6
|
-
export declare function generateArazzoDescription(
|
|
6
|
+
export declare function generateArazzoDescription(opts: GenerateArazzoOptions): Promise<any>;
|
|
7
7
|
//# sourceMappingURL=generate-arazzo-description.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-arazzo-description.d.ts","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-arazzo-description.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-arazzo-description.d.ts","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-arazzo-description.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE,eAAO,MAAM,cAAc;;;CAG1B,CAAC;AASF,wBAAsB,yBAAyB,CAAC,IAAI,EAAE,qBAAqB,gBAwC1E"}
|
|
@@ -12,8 +12,11 @@ function resolveDescriptionNameFromPath(descriptionPath) {
|
|
|
12
12
|
.name.replace(/\./g, '-')
|
|
13
13
|
.replace(/[^A-Za-z0-9_-]/g, '');
|
|
14
14
|
}
|
|
15
|
-
export async function generateArazzoDescription(
|
|
16
|
-
const {
|
|
15
|
+
export async function generateArazzoDescription(opts) {
|
|
16
|
+
const { descriptionPath, outputFile, collectSpecData } = opts;
|
|
17
|
+
const document = (await bundleOpenApi(opts)) || {};
|
|
18
|
+
collectSpecData?.(document);
|
|
19
|
+
const { paths: pathsObject, info, security: rootSecurity, components } = document;
|
|
17
20
|
const sourceDescriptionName = resolveDescriptionNameFromPath(descriptionPath);
|
|
18
21
|
const resolvedDescriptionPath = outputFile
|
|
19
22
|
? path.relative(path.dirname(outputFile), path.resolve(descriptionPath))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-arazzo-description.js","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-arazzo-description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,gCAAgC,EAAE,MAAM,0CAA0C,CAAC;AAC5F,OAAO,EAAE,sCAAsC,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"generate-arazzo-description.js","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-arazzo-description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC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AAE,IAAI,EAAE,KAAK,IAAI,cAAc,CAAC,KAAK;YAC1C,OAAO,EAAE,IAAI,EAAE,OAAO,IAAI,cAAc,CAAC,OAAO;SACjD;QACD,kBAAkB,EAAE;YAClB;gBACE,IAAI,EAAE,qBAAqB;gBAC3B,IAAI,EAAE,SAAS;gBACf,GAAG,EAAE,uBAAuB;aAC7B;SACF;QACD,SAAS,EAAE,gCAAgC,CAAC;YAC1C,gBAAgB,EAAE,WAAW;YAC7B,qBAAqB;YACrB,YAAY;YACZ,gBAAgB,EAAE,gBAAgB,IAAI,EAAE;YACxC,eAAe,EAAE,UAAU,EAAE,eAAe;SAC7C,CAAC;QACF,GAAG,CAAC,gBAAgB,IAAI;YACtB,UAAU,EAAE,gBAAgB;SAC7B,CAAC;KACH,CAAC;IAEF,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { Parameter } from '../../types.js';
|
|
2
|
-
|
|
2
|
+
import type { LoggerInterface } from '@redocly/openapi-core';
|
|
3
|
+
export declare function generateExampleValue(parameter: Parameter, logger: LoggerInterface): any;
|
|
3
4
|
//# sourceMappingURL=generate-example-value.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-example-value.d.ts","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-example-value.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"generate-example-value.d.ts","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-example-value.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,OAQjF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { generateTestDataFromJsonSchema } from './generate-test-data-from-json-schema.js';
|
|
2
2
|
import { extractFirstExample } from '../description-parser/index.js';
|
|
3
|
-
export function generateExampleValue(parameter) {
|
|
3
|
+
export function generateExampleValue(parameter, logger) {
|
|
4
4
|
if (parameter?.example) {
|
|
5
5
|
return parameter.example;
|
|
6
6
|
}
|
|
@@ -8,7 +8,7 @@ export function generateExampleValue(parameter) {
|
|
|
8
8
|
return extractFirstExample(parameter.examples);
|
|
9
9
|
}
|
|
10
10
|
else if (parameter?.schema) {
|
|
11
|
-
return generateTestDataFromJsonSchema(parameter.schema);
|
|
11
|
+
return generateTestDataFromJsonSchema(parameter.schema, logger);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=generate-example-value.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-example-value.js","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-example-value.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"generate-example-value.js","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-example-value.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAKrE,MAAM,UAAU,oBAAoB,CAAC,SAAoB,EAAE,MAAuB;IAChF,IAAI,SAAS,EAAE,OAAO,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC,OAAO,CAAC;IAC3B,CAAC;SAAM,IAAI,SAAS,EAAE,QAAQ,EAAE,CAAC;QAC/B,OAAO,mBAAmB,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC;SAAM,IAAI,SAAS,EAAE,MAAM,EAAE,CAAC;QAC7B,OAAO,8BAA8B,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;AACH,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { type LoggerInterface } from '@redocly/openapi-core';
|
|
2
|
+
export declare function generateTestDataFromJsonSchema(schema: any, logger: LoggerInterface): unknown;
|
|
2
3
|
//# sourceMappingURL=generate-test-data-from-json-schema.d.ts.map
|
package/lib/modules/arazzo-description-generator/generate-test-data-from-json-schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-test-data-from-json-schema.d.ts","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-test-data-from-json-schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-test-data-from-json-schema.d.ts","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-test-data-from-json-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,eAAe,WAQlF"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as Sampler from 'openapi-sampler';
|
|
2
2
|
import { bgRed } from 'colorette';
|
|
3
|
-
|
|
4
|
-
const logger = DefaultLogger.getInstance();
|
|
5
|
-
export function generateTestDataFromJsonSchema(schema) {
|
|
3
|
+
export function generateTestDataFromJsonSchema(schema, logger) {
|
|
6
4
|
if (!schema)
|
|
7
5
|
return;
|
|
8
6
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-test-data-from-json-schema.js","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-test-data-from-json-schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-test-data-from-json-schema.js","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-test-data-from-json-schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,MAAM,UAAU,8BAA8B,CAAC,MAAW,EAAE,MAAuB;IACjF,IAAI,CAAC,MAAM;QAAE,OAAO;IACpB,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7F,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,qDAAqD,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC;QACtF,OAAO;IACT,CAAC;AACH,CAAC"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import type { LoggerInterface } from '@redocly/openapi-core';
|
|
1
2
|
import type { Check, VerboseLog } from '../../types.js';
|
|
2
|
-
export declare function displayChecks(testNameToDisplay
|
|
3
|
+
export declare function displayChecks({ testNameToDisplay, checks, verboseLogs, verboseResponseLogs, logger, }: {
|
|
4
|
+
testNameToDisplay: string;
|
|
5
|
+
checks: Check[];
|
|
6
|
+
verboseLogs?: VerboseLog;
|
|
7
|
+
verboseResponseLogs?: VerboseLog;
|
|
8
|
+
logger: LoggerInterface;
|
|
9
|
+
}): void;
|
|
3
10
|
//# sourceMappingURL=display-checks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display-checks.d.ts","sourceRoot":"","sources":["../../../src/modules/cli-output/display-checks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"display-checks.d.ts","sourceRoot":"","sources":["../../../src/modules/cli-output/display-checks.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIxD,wBAAgB,aAAa,CAAC,EAC5B,iBAAiB,EACjB,MAAM,EACN,WAAW,EACX,mBAAmB,EACnB,MAAM,GACP,EAAE;IACD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,mBAAmB,CAAC,EAAE,UAAU,CAAC;IACjC,MAAM,EAAE,eAAe,CAAC;CACzB,QAsBA"}
|
|
@@ -3,23 +3,22 @@ import { outdent } from 'outdent';
|
|
|
3
3
|
import { combineUrl } from '../../utils/url.js';
|
|
4
4
|
import { isJSON } from '../../utils/is-json.js';
|
|
5
5
|
import { indent, RESET_ESCAPE_CODE } from '../../utils/cli-outputs.js';
|
|
6
|
-
import { DefaultLogger } from '../../utils/logger/logger.js';
|
|
7
|
-
const logger = DefaultLogger.getInstance();
|
|
8
6
|
const MAX_CRITERIA_CONDITION_DISPLAY_LENGTH = 50;
|
|
9
|
-
export function displayChecks(testNameToDisplay, checks, verboseLogs, verboseResponseLogs) {
|
|
7
|
+
export function displayChecks({ testNameToDisplay, checks, verboseLogs, verboseResponseLogs, logger, }) {
|
|
10
8
|
const allChecksPassed = checks.every(({ passed }) => passed);
|
|
11
|
-
logger.
|
|
9
|
+
logger.output(` ${allChecksPassed ? green('✓') : red('✗')} ${blue(testNameToDisplay)}`);
|
|
12
10
|
if (verboseLogs) {
|
|
13
|
-
logger.
|
|
11
|
+
logger.output(`${RESET_ESCAPE_CODE}\n` + (displayVerboseLogs({ logs: verboseLogs, logger }) || ''));
|
|
14
12
|
logger.printNewLine();
|
|
15
13
|
}
|
|
16
14
|
if (verboseResponseLogs) {
|
|
17
|
-
logger.
|
|
15
|
+
logger.output(`${RESET_ESCAPE_CODE}\n` +
|
|
16
|
+
(displayVerboseLogs({ logs: verboseResponseLogs, type: 'response', logger }) || ''));
|
|
18
17
|
logger.printNewLine();
|
|
19
18
|
}
|
|
20
19
|
logger.printNewLine();
|
|
21
20
|
for (const check of checks) {
|
|
22
|
-
logger.
|
|
21
|
+
logger.output(`${indent(displayCheckInfo(check, check.severity), 4)}\n`);
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
function displayCheckInfo(check, severity) {
|
|
@@ -32,7 +31,7 @@ function displayCheckInfo(check, severity) {
|
|
|
32
31
|
: condition)}`
|
|
33
32
|
: ''}`;
|
|
34
33
|
}
|
|
35
|
-
function displayVerboseLogs(logs, type = 'request') {
|
|
34
|
+
function displayVerboseLogs({ logs, type = 'request', logger, }) {
|
|
36
35
|
const { path, host, headerParams, body, statusCode } = logs;
|
|
37
36
|
const responseTime = process.env.NODE_ENV === 'test' ? '<test>' : logs.responseTime;
|
|
38
37
|
const urlString = indent(`Request URL: ${blue(combineUrl(host, path))}`, 4);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display-checks.js","sourceRoot":"","sources":["../../../src/modules/cli-output/display-checks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"display-checks.js","sourceRoot":"","sources":["../../../src/modules/cli-output/display-checks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAAW,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-1,3 +1,4 @@
|
|
|
1
1
|
import type { WorkflowExecutionResult } from '../../types.js';
|
|
2
|
-
|
|
2
|
+
import type { LoggerInterface } from '@redocly/openapi-core';
|
|
3
|
+
export declare function displayErrors(workflows: WorkflowExecutionResult[], logger: LoggerInterface): void;
|
|
3
4
|
//# sourceMappingURL=display-errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display-errors.d.ts","sourceRoot":"","sources":["../../../src/modules/cli-output/display-errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"display-errors.d.ts","sourceRoot":"","sources":["../../../src/modules/cli-output/display-errors.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAQ,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAW7D,wBAAgB,aAAa,CAAC,SAAS,EAAE,uBAAuB,EAAE,EAAE,MAAM,EAAE,eAAe,QAuD1F"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { red, gray, underline, blue, yellow } from 'colorette';
|
|
2
2
|
import { CHECKS } from '../checks/index.js';
|
|
3
3
|
import { indent, removeExtraIndentation, RESET_ESCAPE_CODE } from '../../utils/cli-outputs.js';
|
|
4
|
-
import { DefaultLogger } from '../../utils/logger/logger.js';
|
|
5
|
-
const logger = DefaultLogger.getInstance();
|
|
6
4
|
function flattenNestedSteps(steps) {
|
|
7
5
|
return steps.flatMap((step) => {
|
|
8
6
|
if ('executedSteps' in step) {
|
|
@@ -11,14 +9,14 @@ function flattenNestedSteps(steps) {
|
|
|
11
9
|
return [step];
|
|
12
10
|
});
|
|
13
11
|
}
|
|
14
|
-
export function displayErrors(workflows) {
|
|
15
|
-
logger.
|
|
12
|
+
export function displayErrors(workflows, logger) {
|
|
13
|
+
logger.output(`${RESET_ESCAPE_CODE}\n${indent(red('Failed tests info:'), 2)}\n`);
|
|
16
14
|
for (const workflow of workflows) {
|
|
17
15
|
const steps = flattenNestedSteps(workflow.executedSteps);
|
|
18
16
|
const hasProblems = steps.some((step) => step.checks.some((check) => !check.passed) && (!step.retriesLeft || step.retriesLeft === 0));
|
|
19
17
|
if (!hasProblems)
|
|
20
18
|
continue;
|
|
21
|
-
logger.
|
|
19
|
+
logger.output(`${RESET_ESCAPE_CODE}\n${indent(gray('Workflow name:'), 2)} ${underline(workflow.workflowId)}${RESET_ESCAPE_CODE}\n`);
|
|
22
20
|
for (const step of steps) {
|
|
23
21
|
const failedStepChecks = step.checks.filter((check) => !check.passed);
|
|
24
22
|
if (!failedStepChecks.length)
|
|
@@ -26,7 +24,7 @@ export function displayErrors(workflows) {
|
|
|
26
24
|
if (step.retriesLeft && step.retriesLeft !== 0)
|
|
27
25
|
continue;
|
|
28
26
|
logger.printNewLine();
|
|
29
|
-
logger.
|
|
27
|
+
logger.output(indent(`${blue('stepId - ')}`, 4) +
|
|
30
28
|
(step?.stepId ? red(step.stepId) : red(step?.operationId || step?.operationPath || '')));
|
|
31
29
|
for (const failedCheckIndex in failedStepChecks) {
|
|
32
30
|
const { name, message, severity } = failedStepChecks[failedCheckIndex];
|
|
@@ -40,16 +38,16 @@ export function displayErrors(workflows) {
|
|
|
40
38
|
: indent(`${removeExtraIndentation(message)}${RESET_ESCAPE_CODE}\n`, 6);
|
|
41
39
|
logger.printNewLine();
|
|
42
40
|
if (severity === 'error') {
|
|
43
|
-
logger.
|
|
41
|
+
logger.output(indent(`${red('✗')} ${gray(name.toLowerCase())}`, 4));
|
|
44
42
|
}
|
|
45
43
|
else if (severity === 'off') {
|
|
46
|
-
logger.
|
|
44
|
+
logger.output(indent(`${gray('○')} ${gray(name.toLowerCase())} ${gray('(skipped)')}`, 4));
|
|
47
45
|
}
|
|
48
46
|
else {
|
|
49
|
-
logger.
|
|
47
|
+
logger.output(indent(`${yellow('⚠')} ${gray(name.toLowerCase())}`, 4));
|
|
50
48
|
}
|
|
51
49
|
logger.printNewLine();
|
|
52
|
-
logger.
|
|
50
|
+
logger.output(`${messageToDisplay}`);
|
|
53
51
|
}
|
|
54
52
|
}
|
|
55
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display-errors.js","sourceRoot":"","sources":["../../../src/modules/cli-output/display-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"display-errors.js","sourceRoot":"","sources":["../../../src/modules/cli-output/display-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAK/F,SAAS,kBAAkB,CAAC,KAAyC;IACnE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC5B,IAAI,eAAe,IAAI,IAAI,EAAE,CAAC;YAC5B,OAAO,kBAAkB,CAAE,IAAgC,CAAC,aAAa,CAAC,CAAC;QAC7E,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,SAAoC,EAAE,MAAuB;IACzF,MAAM,CAAC,MAAM,CAAC,GAAG,iBAAiB,KAAK,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAEjF,KAAK,MAAM,QAAQ,IAAI,SAAS,EA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MAAM,CAAC,GAAG,gBAAgB,EAAE,CAAC,CAAC;YACvC,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { WorkflowExecutionResult } from '../../types.js';
|
|
2
|
-
export declare function displaySummary(startedAt
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { RunOptions, WorkflowExecutionResult } from '../../types.js';
|
|
2
|
+
export declare function displaySummary({ startedAt, workflows, options, }: {
|
|
3
|
+
startedAt: number;
|
|
4
|
+
workflows: WorkflowExecutionResult[];
|
|
5
|
+
options: RunOptions;
|
|
6
6
|
}): void;
|
|
7
7
|
//# sourceMappingURL=display-summary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display-summary.d.ts","sourceRoot":"","sources":["../../../src/modules/cli-output/display-summary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"display-summary.d.ts","sourceRoot":"","sources":["../../../src/modules/cli-output/display-summary.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAkB,UAAU,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAE1F,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,SAAS,EACT,OAAO,GACR,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,uBAAuB,EAAE,CAAC;IACrC,OAAO,EAAE,UAAU,CAAC;CACrB,QAgCA"}
|
|
@@ -5,12 +5,11 @@ import { getExecutionTime } from '../../utils/time.js';
|
|
|
5
5
|
import { calculateTotals } from './calculate-tests-passed.js';
|
|
6
6
|
import { indent } from '../../utils/cli-outputs.js';
|
|
7
7
|
import { resolveRunningWorkflows } from '../flow-runner/index.js';
|
|
8
|
-
|
|
9
|
-
const logger =
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const skippedWorkflowArgv = resolveRunningWorkflows(argv?.skip) || [];
|
|
8
|
+
export function displaySummary({ startedAt, workflows, options, }) {
|
|
9
|
+
const { logger } = options;
|
|
10
|
+
const fileName = path.basename(options?.file || '');
|
|
11
|
+
const workflowArgv = resolveRunningWorkflows(options?.workflow) || [];
|
|
12
|
+
const skippedWorkflowArgv = resolveRunningWorkflows(options?.skip) || [];
|
|
14
13
|
let executedWorkflows = workflowArgv && workflowArgv.length
|
|
15
14
|
? workflows.filter(({ workflowId }) => workflowArgv.includes(workflowId))
|
|
16
15
|
: workflows;
|
|
@@ -21,7 +20,7 @@ export function displaySummary(startedAt, workflows, argv) {
|
|
|
21
20
|
const totals = calculateTotals(executedWorkflows);
|
|
22
21
|
const executionTime = getExecutionTime(startedAt);
|
|
23
22
|
logger.printNewLine();
|
|
24
|
-
logger.
|
|
23
|
+
logger.output(outdent `
|
|
25
24
|
${yellow(indent(`Summary for ${blue(fileName)}`, 2))}
|
|
26
25
|
${indent('', 2)}
|
|
27
26
|
${indent(formatWorkflowsTotals('Workflows:', totals.workflows), 2)}
|