@redocly/respect-core 1.32.0 → 1.32.2
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/modules/arazzo-description-generator/generate-arazzo-description.d.ts.map +1 -1
- package/lib/modules/arazzo-description-generator/generate-arazzo-description.js +13 -53
- package/lib/modules/arazzo-description-generator/generate-arazzo-description.js.map +1 -1
- package/lib/modules/arazzo-description-generator/generate-inputs-arazzo-components.d.ts +12 -0
- package/lib/modules/arazzo-description-generator/generate-inputs-arazzo-components.d.ts.map +1 -0
- package/lib/modules/arazzo-description-generator/generate-inputs-arazzo-components.js +49 -0
- package/lib/modules/arazzo-description-generator/generate-inputs-arazzo-components.js.map +1 -0
- package/lib/modules/arazzo-description-generator/generate-workflow-security-inputs.d.ts +4 -0
- package/lib/modules/arazzo-description-generator/generate-workflow-security-inputs.d.ts.map +1 -0
- package/lib/modules/arazzo-description-generator/generate-workflow-security-inputs.js +19 -0
- package/lib/modules/arazzo-description-generator/generate-workflow-security-inputs.js.map +1 -0
- package/lib/modules/arazzo-description-generator/generate-workflow-security-parameters.d.ts +7 -0
- package/lib/modules/arazzo-description-generator/generate-workflow-security-parameters.d.ts.map +1 -0
- package/lib/modules/arazzo-description-generator/generate-workflow-security-parameters.js +44 -0
- package/lib/modules/arazzo-description-generator/generate-workflow-security-parameters.js.map +1 -0
- package/lib/modules/arazzo-description-generator/generate-workflows-from-description.d.ts +17 -0
- package/lib/modules/arazzo-description-generator/generate-workflows-from-description.d.ts.map +1 -0
- package/lib/modules/arazzo-description-generator/generate-workflows-from-description.js +64 -0
- package/lib/modules/arazzo-description-generator/generate-workflows-from-description.js.map +1 -0
- package/lib/modules/arazzo-description-generator/index.d.ts +4 -0
- package/lib/modules/arazzo-description-generator/index.d.ts.map +1 -1
- package/lib/modules/arazzo-description-generator/index.js +4 -0
- package/lib/modules/arazzo-description-generator/index.js.map +1 -1
- package/lib/modules/description-parser/bundle-openapi.js +2 -2
- package/lib/modules/description-parser/bundle-openapi.js.map +1 -1
- package/lib/modules/flow-runner/call-api-and-analyze-results.d.ts +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 +3 -3
- package/lib/modules/flow-runner/call-api-and-analyze-results.js.map +1 -1
- package/lib/modules/flow-runner/get-test-description-from-file.d.ts +1 -1
- package/package.json +2 -2
|
@@ -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":"AAMA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEzE,eAAO,MAAM,cAAc;;;CAG1B,CAAC;AASF,wBAAsB,yBAAyB,CAAC,EAC9C,eAAe,EACf,aAAa,EAAE,UAAU,GAC1B,EAAE,yBAAyB,gBA0C3B"}
|
|
@@ -26,58 +26,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.infoSubstitute = void 0;
|
|
27
27
|
exports.generateArazzoDescription = generateArazzoDescription;
|
|
28
28
|
const path = __importStar(require("path"));
|
|
29
|
-
const sort_1 = require("../../utils/sort");
|
|
30
29
|
const description_parser_1 = require("../description-parser");
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (!responseCodesFromDescription.length) {
|
|
34
|
-
return [];
|
|
35
|
-
}
|
|
36
|
-
const firstResponseCode = responseCodesFromDescription?.[0];
|
|
37
|
-
return { successCriteria: [{ condition: `$statusCode == ${firstResponseCode}` }] };
|
|
38
|
-
}
|
|
39
|
-
function generateOperationId(path, method) {
|
|
40
|
-
return `${method}@${path}`;
|
|
41
|
-
}
|
|
42
|
-
function generateWorkflowsFromDescription({ descriptionPaths, sourceDescriptionName, }) {
|
|
43
|
-
const workflows = [];
|
|
44
|
-
for (const pathItemKey in descriptionPaths) {
|
|
45
|
-
for (const pathItemObjectKey of Object.keys(descriptionPaths[pathItemKey]).sort(sort_1.sortMethods)) {
|
|
46
|
-
const keyToCheck = pathItemObjectKey.toLocaleLowerCase();
|
|
47
|
-
if ([
|
|
48
|
-
'get',
|
|
49
|
-
'post',
|
|
50
|
-
'put',
|
|
51
|
-
'delete',
|
|
52
|
-
'patch',
|
|
53
|
-
'head',
|
|
54
|
-
'options',
|
|
55
|
-
'trace',
|
|
56
|
-
'connect',
|
|
57
|
-
'query',
|
|
58
|
-
].includes(keyToCheck.toLocaleLowerCase())) {
|
|
59
|
-
const method = keyToCheck;
|
|
60
|
-
const pathKey = pathItemKey
|
|
61
|
-
.replace(/^\/|\/$/g, '')
|
|
62
|
-
.split('/')
|
|
63
|
-
.join('-');
|
|
64
|
-
const resolvedOperationId = descriptionPaths[pathItemKey][method]?.operationId ||
|
|
65
|
-
generateOperationId(pathItemKey, method);
|
|
66
|
-
workflows.push({
|
|
67
|
-
workflowId: pathKey ? `${method}-${pathKey}-workflow` : `${method}-workflow`,
|
|
68
|
-
steps: [
|
|
69
|
-
{
|
|
70
|
-
stepId: pathKey ? `${method}-${pathKey}-step` : `${method}-step`,
|
|
71
|
-
operationId: `$sourceDescriptions.${sourceDescriptionName}.${resolvedOperationId}`,
|
|
72
|
-
...generateParametersWithSuccessCriteria(descriptionPaths[pathItemKey][method].responses),
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return workflows;
|
|
80
|
-
}
|
|
30
|
+
const generate_workflows_from_description_1 = require("./generate-workflows-from-description");
|
|
31
|
+
const generate_inputs_arazzo_components_1 = require("./generate-inputs-arazzo-components");
|
|
81
32
|
exports.infoSubstitute = {
|
|
82
33
|
title: '[REPLACE WITH API title]',
|
|
83
34
|
version: '[REPLACE WITH API version]',
|
|
@@ -89,11 +40,14 @@ function resolveDescriptionNameFromPath(descriptionPath) {
|
|
|
89
40
|
.replace(/[^A-Za-z0-9_-]/g, '');
|
|
90
41
|
}
|
|
91
42
|
async function generateArazzoDescription({ descriptionPath, 'output-file': outputFile, }) {
|
|
92
|
-
const { paths: pathsObject, info } = (await (0, description_parser_1.bundleOpenApi)(descriptionPath, '')) || {};
|
|
43
|
+
const { paths: pathsObject, info, security: rootSecurity, components, } = (await (0, description_parser_1.bundleOpenApi)(descriptionPath, '')) || {};
|
|
93
44
|
const sourceDescriptionName = resolveDescriptionNameFromPath(descriptionPath);
|
|
94
45
|
const resolvedDescriptionPath = outputFile
|
|
95
46
|
? path.relative(path.dirname(outputFile), path.resolve(descriptionPath))
|
|
96
47
|
: descriptionPath;
|
|
48
|
+
const inputsComponents = components?.securitySchemes
|
|
49
|
+
? (0, generate_inputs_arazzo_components_1.generateSecurityInputsArazzoComponents)(components?.securitySchemes)
|
|
50
|
+
: undefined;
|
|
97
51
|
const testDescription = {
|
|
98
52
|
arazzo: '1.0.1',
|
|
99
53
|
info: {
|
|
@@ -107,9 +61,15 @@ async function generateArazzoDescription({ descriptionPath, 'output-file': outpu
|
|
|
107
61
|
url: resolvedDescriptionPath,
|
|
108
62
|
},
|
|
109
63
|
],
|
|
110
|
-
workflows: generateWorkflowsFromDescription({
|
|
64
|
+
workflows: (0, generate_workflows_from_description_1.generateWorkflowsFromDescription)({
|
|
111
65
|
descriptionPaths: pathsObject,
|
|
112
66
|
sourceDescriptionName,
|
|
67
|
+
rootSecurity,
|
|
68
|
+
inputsComponents: inputsComponents || {},
|
|
69
|
+
securitySchemes: components?.securitySchemes,
|
|
70
|
+
}),
|
|
71
|
+
...(inputsComponents && {
|
|
72
|
+
components: inputsComponents,
|
|
113
73
|
}),
|
|
114
74
|
};
|
|
115
75
|
return JSON.parse(JSON.stringify(testDescription, null, 2));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-arazzo-description.js","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-arazzo-description.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"generate-arazzo-description.js","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-arazzo-description.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,8DA6CC;AAjED,2CAA6B;AAC7B,8DAAsD;AACtD,+FAAyF;AACzF,2FAA6F;AAKhF,QAAA,cAAc,GAAG;IAC5B,KAAK,EAAE,0BAA0B;IACjC,OAAO,EAAE,4BAA4B;CACtC,CAAC;AAEF,SAAS,8BAA8B,CAAC,eAAuB;IAC7D,OAAO,IAAI;SACR,KAAK,CAAC,eAAe,CAAC;SACtB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACxB,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;AACpC,CAAC;AAEM,KAAK,UAAU,yBAAyB,CAAC,EAC9C,eAAe,EACf,aAAa,EAAE,UAAU,GACC;IAC1B,MAAM,EACJ,KAAK,EAAE,WAAW,EAClB,IAAI,EACJ,QAAQ,EAAE,YAAY,EACtB,UAAU,GACX,GAAG,CAAC,MAAM,IAAA,kCAAa,EAAC,eAAe,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAErD,MAAM,qBAAqB,GAAG,8BAA8B,CAAC,eAAe,CAAC,CAAC;IAC9E,MAAM,uBAAuB,GAAG,UAAU;QACxC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QACxE,CAAC,CAAC,eAAe,CAAC;IACpB,MAAM,gBAAgB,GAAG,UAAU,EAAE,eAAe;QAClD,CAAC,CAAC,IAAA,0EAAsC,EAAC,UAAU,EAAE,eAAe,CAAC;QACrE,CAAC,CAAC,SAAS,CAAC;IAEd,MAAM,eAAe,GAAoB;QACvC,MAAM,EAAE,OAAO;QACf,IAAI,EAAE;YACJ,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,sBAAc,CAAC,KAAK;YAC1C,OAAO,EAAE,IAAI,EAAE,OAAO,IAAI,sBAAc,CAAC,OAAO;SACjD;QACD,kBAAkB,EAAE;YAClB;gBACE,IAAI,EAAE,qBAAqB;gBAC3B,IAAI,EAAE,SAAS;gBACf,GAAG,EAAE,uBAAuB;aAC7B;SACF;QACD,SAAS,EAAE,IAAA,sEAAgC,EAAC;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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Oas3SecurityScheme } from 'core/src/typings/openapi';
|
|
2
|
+
export declare function generateSecurityInputsArazzoComponents(securitySchemes: Record<string, Oas3SecurityScheme>): {
|
|
3
|
+
inputs: {
|
|
4
|
+
[key: string]: {
|
|
5
|
+
type: string;
|
|
6
|
+
properties?: {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=generate-inputs-arazzo-components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-inputs-arazzo-components.d.ts","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-inputs-arazzo-components.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,wBAAgB,sCAAsC,CACpD,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC;;;;;;;;;EA8CpD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateSecurityInputsArazzoComponents = generateSecurityInputsArazzoComponents;
|
|
4
|
+
function generateSecurityInputsArazzoComponents(securitySchemes) {
|
|
5
|
+
const inputs = {};
|
|
6
|
+
for (const [name, securityScheme] of Object.entries(securitySchemes)) {
|
|
7
|
+
if (securityScheme.type !== 'http' && securityScheme.type !== 'apiKey') {
|
|
8
|
+
continue;
|
|
9
|
+
}
|
|
10
|
+
if (securityScheme?.scheme?.toLowerCase() === 'basic') {
|
|
11
|
+
inputs[name] = {
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties: {
|
|
14
|
+
[name]: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
description: 'Basic authentication',
|
|
17
|
+
format: 'password',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
else if (securityScheme?.scheme?.toLowerCase() === 'bearer') {
|
|
23
|
+
inputs[name] = {
|
|
24
|
+
type: 'object',
|
|
25
|
+
properties: {
|
|
26
|
+
[name]: {
|
|
27
|
+
type: 'string',
|
|
28
|
+
description: 'JWT Authentication token for ${name}',
|
|
29
|
+
format: 'password',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
inputs[name] = {
|
|
36
|
+
type: 'object',
|
|
37
|
+
properties: {
|
|
38
|
+
[name]: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
description: securityScheme?.description || `Authentication token for ${name}`,
|
|
41
|
+
format: 'password',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return { inputs };
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=generate-inputs-arazzo-components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-inputs-arazzo-components.js","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-inputs-arazzo-components.ts"],"names":[],"mappings":";;AAGA,wFA+CC;AA/CD,SAAgB,sCAAsC,CACpD,eAAmD;IAEnD,MAAM,MAAM,GAA0D,EAAE,CAAC;IAEzE,KAAK,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;QACrE,IAAI,cAAc,CAAC,IAAI,KAAK,MAAM,IAAI,cAAc,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACvE,SAAS;QACX,CAAC;QAED,IAAI,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,OAAO,EAAE,CAAC;YACtD,MAAM,CAAC,IAAI,CAAC,GAAG;gBACb,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,CAAC,IAAI,CAAC,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,sBAAsB;wBACnC,MAAM,EAAE,UAAU;qBACnB;iBACF;aACF,CAAC;QACJ,CAAC;aAAM,IAAI,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,QAAQ,EAAE,CAAC;YAC9D,MAAM,CAAC,IAAI,CAAC,GAAG;gBACb,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,CAAC,IAAI,CAAC,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,sCAAsC;wBACnD,MAAM,EAAE,UAAU;qBACnB;iBACF;aACF,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,CAAC,GAAG;gBACb,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,CAAC,IAAI,CAAC,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,cAAc,EAAE,WAAW,IAAI,4BAA4B,IAAI,EAAE;wBAC9E,MAAM,EAAE,UAAU;qBACnB;iBACF;aACF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-workflow-security-inputs.d.ts","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-workflow-security-inputs.ts"],"names":[],"mappings":"AAAA,wBAAgB,8BAA8B,CAAC,gBAAgB,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE;;cAgBpF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateWorkflowSecurityInputs = generateWorkflowSecurityInputs;
|
|
4
|
+
function generateWorkflowSecurityInputs(inputsComponents, security) {
|
|
5
|
+
if (!security?.length) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
for (const securityRequirement of security) {
|
|
9
|
+
for (const securityName of Object.keys(securityRequirement)) {
|
|
10
|
+
if (inputsComponents?.inputs?.[securityName]) {
|
|
11
|
+
return {
|
|
12
|
+
$ref: `#/components/inputs/${securityName}`,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=generate-workflow-security-inputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-workflow-security-inputs.js","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-workflow-security-inputs.ts"],"names":[],"mappings":";;AAAA,wEAgBC;AAhBD,SAAgB,8BAA8B,CAAC,gBAAqB,EAAE,QAAe;IACnF,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QACtB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,KAAK,MAAM,mBAAmB,IAAI,QAAQ,EAAE,CAAC;QAC3C,KAAK,MAAM,YAAY,IAAI,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC;YAC5D,IAAI,gBAAgB,EAAE,MAAM,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC;gBAC7C,OAAO;oBACL,IAAI,EAAE,uBAAuB,YAAY,EAAE;iBAC5C,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Oas3SecurityRequirement, type Oas3SecurityScheme } from 'core/src/typings/openapi';
|
|
2
|
+
export declare function generateWorkflowSecurityParameters(inputsComponents: any, security: Oas3SecurityRequirement[], securitySchemes: Record<string, Oas3SecurityScheme>): {
|
|
3
|
+
name: string | undefined;
|
|
4
|
+
value: string;
|
|
5
|
+
in: "query" | "header" | "cookie";
|
|
6
|
+
}[];
|
|
7
|
+
//# sourceMappingURL=generate-workflow-security-parameters.d.ts.map
|
package/lib/modules/arazzo-description-generator/generate-workflow-security-parameters.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-workflow-security-parameters.d.ts","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-workflow-security-parameters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,uBAAuB,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEjG,wBAAgB,kCAAkC,CAChD,gBAAgB,EAAE,GAAG,EACrB,QAAQ,EAAE,uBAAuB,EAAE,EACnC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC;;;;IA8CpD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateWorkflowSecurityParameters = generateWorkflowSecurityParameters;
|
|
4
|
+
function generateWorkflowSecurityParameters(inputsComponents, security, securitySchemes) {
|
|
5
|
+
if (!security?.length) {
|
|
6
|
+
return [];
|
|
7
|
+
}
|
|
8
|
+
const parameters = [];
|
|
9
|
+
for (const securityRequirement of security) {
|
|
10
|
+
for (const securityName of Object.keys(securityRequirement)) {
|
|
11
|
+
if (!inputsComponents?.inputs?.[securityName]) {
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
const securityScheme = securitySchemes[securityName];
|
|
15
|
+
if (securityScheme?.type &&
|
|
16
|
+
!['apikey', 'http'].includes(securityScheme?.type?.toLowerCase())) {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
if (securityScheme?.type === 'apiKey') {
|
|
20
|
+
parameters.push({
|
|
21
|
+
name: securityScheme?.name,
|
|
22
|
+
value: `$inputs.${securityName}`,
|
|
23
|
+
in: securityScheme?.in || 'header',
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
else if (securityScheme?.scheme === 'bearer') {
|
|
27
|
+
parameters.push({
|
|
28
|
+
name: 'Authorization',
|
|
29
|
+
value: `Bearer {$inputs.${securityName}}`,
|
|
30
|
+
in: securityScheme?.in || 'header',
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
else if (securityScheme?.scheme === 'basic') {
|
|
34
|
+
parameters.push({
|
|
35
|
+
name: 'Authorization',
|
|
36
|
+
value: `Basic {$inputs.${securityName}}`,
|
|
37
|
+
in: securityScheme?.in || 'header',
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return parameters;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=generate-workflow-security-parameters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-workflow-security-parameters.js","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/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AAU,CAAC,IAAI,CAAC;oBACd,IAAI,EAAE,eAAe;oBACrB,KAAK,EAAE,kBAAkB,YAAY,GAAG;oBACxC,EAAE,EAAE,cAAc,EAAE,EAAE,IAAI,QAAQ;iBACnC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Oas3SecurityScheme, type Oas3SecurityRequirement, type Oas3PathItem, type Oas3_1Schema, type Oas3Operation } from 'core/src/typings/openapi';
|
|
2
|
+
import { type Workflow } from '../../types';
|
|
3
|
+
import { type ArazzoDefinition } from '@redocly/openapi-core/lib/typings/arazzo';
|
|
4
|
+
export type WorkflowsFromDescriptionInput = {
|
|
5
|
+
descriptionPaths: {
|
|
6
|
+
[name: string]: Oas3PathItem<Oas3_1Schema> & {
|
|
7
|
+
connect?: Oas3Operation<Oas3_1Schema>;
|
|
8
|
+
query?: Oas3Operation<Oas3_1Schema>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
sourceDescriptionName: string;
|
|
12
|
+
rootSecurity: Oas3SecurityRequirement[];
|
|
13
|
+
inputsComponents: NonNullable<ArazzoDefinition['components']>;
|
|
14
|
+
securitySchemes: Record<string, Oas3SecurityScheme>;
|
|
15
|
+
};
|
|
16
|
+
export declare function generateWorkflowsFromDescription({ descriptionPaths, sourceDescriptionName, rootSecurity, inputsComponents, securitySchemes, }: WorkflowsFromDescriptionInput): Workflow[];
|
|
17
|
+
//# sourceMappingURL=generate-workflows-from-description.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-workflows-from-description.d.ts","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-workflows-from-description.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAwB,KAAK,QAAQ,EAAa,MAAM,aAAa,CAAC;AAC7E,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,0CAA0C,CAAC;AAIlD,MAAM,MAAM,6BAA6B,GAAG;IAC1C,gBAAgB,EAAE;QAChB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC,YAAY,CAAC,GAAG;YAC3C,OAAO,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;YACtC,KAAK,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;SACrC,CAAC;KACH,CAAC;IACF,qBAAqB,EAAE,MAAM,CAAC;IAC9B,YAAY,EAAE,uBAAuB,EAAE,CAAC;IACxC,gBAAgB,EAAE,WAAW,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC;IAC9D,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;CACrD,CAAC;AAEF,wBAAgB,gCAAgC,CAAC,EAC/C,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,eAAe,GAChB,EAAE,6BAA6B,GAAG,QAAQ,EAAE,CA6D5C"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateWorkflowsFromDescription = generateWorkflowsFromDescription;
|
|
4
|
+
const sort_1 = require("../../utils/sort");
|
|
5
|
+
const generate_workflow_security_inputs_1 = require("./generate-workflow-security-inputs");
|
|
6
|
+
const generate_workflow_security_parameters_1 = require("./generate-workflow-security-parameters");
|
|
7
|
+
function generateWorkflowsFromDescription({ descriptionPaths, sourceDescriptionName, rootSecurity, inputsComponents, securitySchemes, }) {
|
|
8
|
+
const workflows = [];
|
|
9
|
+
for (const pathItemKey in descriptionPaths) {
|
|
10
|
+
for (const pathItemObjectKey of Object.keys(descriptionPaths[pathItemKey]).sort(sort_1.sortMethods)) {
|
|
11
|
+
const methodToCheck = pathItemObjectKey.toLocaleLowerCase();
|
|
12
|
+
if ([
|
|
13
|
+
'get',
|
|
14
|
+
'post',
|
|
15
|
+
'put',
|
|
16
|
+
'delete',
|
|
17
|
+
'patch',
|
|
18
|
+
'head',
|
|
19
|
+
'options',
|
|
20
|
+
'trace',
|
|
21
|
+
'connect',
|
|
22
|
+
'query',
|
|
23
|
+
].includes(methodToCheck.toLocaleLowerCase())) {
|
|
24
|
+
const method = methodToCheck;
|
|
25
|
+
const pathKey = pathItemKey
|
|
26
|
+
.replace(/^\/|\/$/g, '')
|
|
27
|
+
.split('/')
|
|
28
|
+
.join('-');
|
|
29
|
+
const operation = descriptionPaths[pathItemKey][methodToCheck.toLowerCase()];
|
|
30
|
+
const operationSecurity = operation?.security || undefined;
|
|
31
|
+
const operationId = operation?.operationId || generateOperationId(pathItemKey, method);
|
|
32
|
+
const workflowSecurityInputs = (0, generate_workflow_security_inputs_1.generateWorkflowSecurityInputs)(inputsComponents, operationSecurity || rootSecurity || []);
|
|
33
|
+
const workflowSecurityParameters = (0, generate_workflow_security_parameters_1.generateWorkflowSecurityParameters)(inputsComponents, operationSecurity || rootSecurity || [], securitySchemes);
|
|
34
|
+
workflows.push({
|
|
35
|
+
workflowId: pathKey ? `${method}-${pathKey}-workflow` : `${method}-workflow`,
|
|
36
|
+
...(workflowSecurityInputs && { inputs: workflowSecurityInputs }),
|
|
37
|
+
...(workflowSecurityParameters.length && {
|
|
38
|
+
parameters: workflowSecurityParameters,
|
|
39
|
+
}),
|
|
40
|
+
steps: [
|
|
41
|
+
{
|
|
42
|
+
stepId: pathKey ? `${method}-${pathKey}-step` : `${method}-step`,
|
|
43
|
+
operationId: `$sourceDescriptions.${sourceDescriptionName}.${operationId}`,
|
|
44
|
+
...generateParametersWithSuccessCriteria(descriptionPaths[pathItemKey][methodToCheck.toLowerCase()]?.responses),
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return workflows;
|
|
52
|
+
}
|
|
53
|
+
function generateParametersWithSuccessCriteria(responses) {
|
|
54
|
+
const responseCodesFromDescription = Object.keys(responses || {});
|
|
55
|
+
if (!responseCodesFromDescription.length) {
|
|
56
|
+
return [];
|
|
57
|
+
}
|
|
58
|
+
const firstResponseCode = responseCodesFromDescription?.[0];
|
|
59
|
+
return { successCriteria: [{ condition: `$statusCode == ${firstResponseCode}` }] };
|
|
60
|
+
}
|
|
61
|
+
function generateOperationId(path, method) {
|
|
62
|
+
return `${method}@${path}`;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=generate-workflows-from-description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-workflows-from-description.js","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/generate-workflows-from-description.ts"],"names":[],"mappings":";;AA+BA,4EAmEC;AAlGD,2CAA+C;AAC/C,2FAAqF;AACrF,mGAA6F;AA6B7F,SAAgB,gCAAgC,CAAC,EAC/C,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,eAAe,GACe;IAC9B,MAAM,SAAS,GAAG,EAAgB,CAAC;IAEnC,KAAK,MAAM,WAAW,IAAI,gBAAgB,EAAE,CAAC;QAC3C,KAAK,MAAM,iBAAiB,IAAI,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAW,CAAC,EAAE,CAAC;YAC7F,MAAM,aAAa,GAAG,iBAAiB,CAAC,iBAAiB,EAAgB,CAAC;YAE1E,IACE;gBACE,KAAK;gBACL,MAAM;gBACN,KAAK;gBACL,QAAQ;gBACR,OAAO;gBACP,MAAM;gBACN,SAAS;gBACT,OAAO;gBACP,SAAS;gBACT,OAAO;aACR,CAAC,QAAQ,CAAC,aAAa,CAAC,iBAAiB,EAAE,CAAC,EAC7C,CAAC;g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,CAAC,EAAE,SAAS,CACpF;yBACM;qBACV;iBACU,CAAC,CAAC;YACjB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,qCAAqC,CAC5C,SAAc;IAEd,MAAM,4BAA4B,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;IAElE,IAAI,CAAC,4BAA4B,CAAC,MAAM,EAAE,CAAC;QACzC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,iBAAiB,GAAG,4BAA4B,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5D,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,SAAS,EAAE,kBAAkB,iBAAiB,EAAE,EAAE,CAAC,EAAE,CAAC;AACrF,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAY,EAAE,MAAuB;IAChE,OAAO,GAAG,MAAM,IAAI,IAAI,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -2,4 +2,8 @@ export * from './generate-arazzo-description';
|
|
|
2
2
|
export * from './cleanup-test-description';
|
|
3
3
|
export * from './generate-test-data-from-json-schema';
|
|
4
4
|
export * from './generate-example-value';
|
|
5
|
+
export * from './generate-workflows-from-description';
|
|
6
|
+
export * from './generate-inputs-arazzo-components';
|
|
7
|
+
export * from './generate-workflow-security-inputs';
|
|
8
|
+
export * from './generate-workflow-security-parameters';
|
|
5
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,0BAA0B,CAAC;AACzC,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC"}
|
|
@@ -18,4 +18,8 @@ __exportStar(require("./generate-arazzo-description"), exports);
|
|
|
18
18
|
__exportStar(require("./cleanup-test-description"), exports);
|
|
19
19
|
__exportStar(require("./generate-test-data-from-json-schema"), exports);
|
|
20
20
|
__exportStar(require("./generate-example-value"), exports);
|
|
21
|
+
__exportStar(require("./generate-workflows-from-description"), exports);
|
|
22
|
+
__exportStar(require("./generate-inputs-arazzo-components"), exports);
|
|
23
|
+
__exportStar(require("./generate-workflow-security-inputs"), exports);
|
|
24
|
+
__exportStar(require("./generate-workflow-security-parameters"), exports);
|
|
21
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA8C;AAC9C,6DAA2C;AAC3C,wEAAsD;AACtD,2DAAyC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/arazzo-description-generator/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA8C;AAC9C,6DAA2C;AAC3C,wEAAsD;AACtD,2DAAyC;AACzC,wEAAsD;AACtD,sEAAoD;AACpD,sEAAoD;AACpD,0EAAwD"}
|
|
@@ -35,7 +35,7 @@ async function bundleOpenApi(path = '', workflowPath) {
|
|
|
35
35
|
}
|
|
36
36
|
if (!bundleDocument)
|
|
37
37
|
return;
|
|
38
|
-
const { bundle: { parsed: { paths, servers, info }, }, } = bundleDocument;
|
|
39
|
-
return { paths, servers, info };
|
|
38
|
+
const { bundle: { parsed: { paths, servers, info, security, components }, }, } = bundleDocument;
|
|
39
|
+
return { paths, servers, info, security, components };
|
|
40
40
|
}
|
|
41
41
|
//# sourceMappingURL=bundle-openapi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle-openapi.js","sourceRoot":"","sources":["../../../src/modules/description-parser/bundle-openapi.ts"],"names":[],"mappings":";;AAMA,sCA0CC;AAhDD,yCAA6C;AAC7C,qCAAqC;AACrC,wDAA6E;AAE7E,+CAA2C;AAEpC,KAAK,UAAU,aAAa,CAAC,OAAe,EAAE,EAAE,YAAoB;IACzE,MAAM,KAAK,GAAG,IAAA,cAAK,EAAC,IAAI,CAAC,CAAC;IAC1B,MAAM,MAAM,GAAG,MAAM,IAAA,yBAAU,GAAE,CAAC;IAClC,IAAI,cAA4B,CAAC;IAEjC,IAAI,KAAK,EAAE,CAAC;QACV,6BAA6B;QAC7B,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;QAEnC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,8CAA8C,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QACnF,CAAC;QAED,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC1C,cAAc,GAAG,MAAM,IAAA,+BAAgB,EAAC;YACtC,MAAM,EAAE,WAAW;YACnB,MAAM;YACN,WAAW,EAAE,IAAI;SAClB,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,MAAM,eAAe,GAAG,IAAI,IAAI,IAAA,mBAAO,EAAC,IAAA,mBAAO,EAAC,YAAY,CAAC,EAAE,IAAI,CAAC,CAAC;QAErE,IAAI,CAAC,IAAA,oBAAU,EAAC,eAAe,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,2CAA2C,IAAI,cAAc,YAAY,GAAG,CAAC,CAAC;QAChG,CAAC;QAED,cAAc,GAAG,MAAM,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,MAAM,IAAI,KAAK,CAAC,2CAA2C,IAAI,cAAc,YAAY,GAAG,CAAC,CAAC;QAChG,CAAC;QAED,cAAc,GAAG,MAAM,IAAA,qBAAM,EAAC;YAC5B,GAAG,EAAE,eAAe;YACpB,MAAM;YACN,WAAW,EAAE,IAAI;SAClB,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,cAAc;QAAE,OAAO;IAE5B,MAAM,EACJ,MAAM,EAAE,EACN,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,GACvD,GACF,GAAG,cAAc,CAAC;IAEnB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;AACxD,CAAC"}
|
|
@@ -7,7 +7,7 @@ export declare function callAPIAndAnalyzeResults({ ctx, workflowId, step, reques
|
|
|
7
7
|
requestData: RequestData;
|
|
8
8
|
}): Promise<{
|
|
9
9
|
successCriteriaCheck: boolean;
|
|
10
|
-
|
|
10
|
+
schemaCheck: boolean;
|
|
11
11
|
networkCheck: boolean;
|
|
12
12
|
}>;
|
|
13
13
|
//# sourceMappingURL=call-api-and-analyze-results.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call-api-and-analyze-results.d.ts","sourceRoot":"","sources":["../../../src/modules/flow-runner/call-api-and-analyze-results.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGrD,wBAAsB,wBAAwB,CAAC,EAC7C,GAAG,EACH,UAAU,EACV,IAAI,EACJ,WAAW,GACZ,EAAE;IACD,GAAG,EAAE,WAAW,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;IACX,WAAW,EAAE,WAAW,CAAC;CAC1B;;;;
|
|
1
|
+
{"version":3,"file":"call-api-and-analyze-results.d.ts","sourceRoot":"","sources":["../../../src/modules/flow-runner/call-api-and-analyze-results.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGrD,wBAAsB,wBAAwB,CAAC,EAC7C,GAAG,EACH,UAAU,EACV,IAAI,EACJ,WAAW,GACZ,EAAE;IACD,GAAG,EAAE,WAAW,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;IACX,WAAW,EAAE,WAAW,CAAC;CAC1B;;;;GAiGA"}
|
|
@@ -12,7 +12,7 @@ async function callAPIAndAnalyzeResults({ ctx, workflowId, step, requestData, })
|
|
|
12
12
|
step.checks = [];
|
|
13
13
|
const checksResult = {
|
|
14
14
|
successCriteriaCheck: true,
|
|
15
|
-
|
|
15
|
+
schemaCheck: true,
|
|
16
16
|
networkCheck: true,
|
|
17
17
|
};
|
|
18
18
|
try {
|
|
@@ -42,7 +42,7 @@ async function callAPIAndAnalyzeResults({ ctx, workflowId, step, requestData, })
|
|
|
42
42
|
$inputs: ctx.$workflows[workflowId].inputs,
|
|
43
43
|
},
|
|
44
44
|
});
|
|
45
|
-
checksResult.successCriteriaCheck = successCriteriaChecks.every((check) => check.passed);
|
|
45
|
+
checksResult.successCriteriaCheck = successCriteriaChecks.every((check) => check.passed || ['off', 'warn'].includes(check.severity));
|
|
46
46
|
step.checks.push(...successCriteriaChecks);
|
|
47
47
|
}
|
|
48
48
|
const schemaChecks = (0, schema_1.checkSchema)({
|
|
@@ -55,7 +55,7 @@ async function callAPIAndAnalyzeResults({ ctx, workflowId, step, requestData, })
|
|
|
55
55
|
ctx,
|
|
56
56
|
});
|
|
57
57
|
if (schemaChecks.length) {
|
|
58
|
-
checksResult.
|
|
58
|
+
checksResult.schemaCheck = schemaChecks.every((check) => check.passed || ['off', 'warn'].includes(check.severity));
|
|
59
59
|
step.checks.push(...schemaChecks);
|
|
60
60
|
}
|
|
61
61
|
// store step level outputs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call-api-and-analyze-results.js","sourceRoot":"","sources":["../../../src/modules/flow-runner/call-api-and-analyze-results.ts"],"names":[],"mappings":";;AAUA,
|
|
1
|
+
{"version":3,"file":"call-api-and-analyze-results.js","sourceRoot":"","sources":["../../../src/modules/flow-runner/call-api-and-analyze-results.ts"],"names":[],"mappings":";;AAUA,4DA2GC;AArHD,yDAAmD;AACnD,qCAAuC;AACvC,sCAAmC;AACnC,uCAAuD;AACvD,gEAA0E;AAK1E,iCAAiC;AAC1B,KAAK,UAAU,wBAAwB,CAAC,EAC7C,GAAG,EACH,UAAU,EACV,IAAI,EACJ,WAAW,GAMZ;IACC,gCAAgC;IAChC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IAEjB,MAAM,YAAY,GAAG;QACnB,oBAAoB,EAAE,IAAI;QAC1B,WAAW,EAAE,IAAI;QACjB,YAAY,EAAE,IAAI;KACnB,CAAC;IAEF,IAAI,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG,MAAM,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IACpE,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YACf,IAAI,EAAE,eAAM,CAAC,aAAa;YAC1B,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,eAAe,CAAC;SACxC,CAAC,CAAC;QACH,YAAY,CAAC,YAAY,GAAG,KAAK,CAAC;QAClC,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,KAAK,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ACtB,CAAC"}
|
|
@@ -18,5 +18,5 @@ export declare function bundleArazzo(filePath: string, collectSpecData?: Collect
|
|
|
18
18
|
caCert?: string;
|
|
19
19
|
};
|
|
20
20
|
apiClient: import("../../utils/api-fetcher").ApiFetcher;
|
|
21
|
-
} & import("../../types").WorkflowInnerContext & import("../../types").StepInnerContext, "arazzo" | "info" | "sourceDescriptions" | "workflows" | "
|
|
21
|
+
} & import("../../types").WorkflowInnerContext & import("../../types").StepInnerContext, "arazzo" | "info" | "sourceDescriptions" | "workflows" | "components" | "$outputs">>>;
|
|
22
22
|
//# sourceMappingURL=get-test-description-from-file.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/respect-core",
|
|
3
|
-
"version": "1.32.
|
|
3
|
+
"version": "1.32.2",
|
|
4
4
|
"description": "API testing framework core",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@faker-js/faker": "^7.6.0",
|
|
45
45
|
"@redocly/ajv": "8.11.2",
|
|
46
|
-
"@redocly/openapi-core": "1.32.
|
|
46
|
+
"@redocly/openapi-core": "1.32.2",
|
|
47
47
|
"better-ajv-errors": "^1.2.0",
|
|
48
48
|
"colorette": "^2.0.20",
|
|
49
49
|
"concat-stream": "^2.0.0",
|