@redocly/respect-core 0.0.0-snapshot.1739898268
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/LICENSE +18 -0
- package/README.md +25 -0
- package/lib/arazzo-schema.d.ts +2385 -0
- package/lib/arazzo-schema.d.ts.map +1 -0
- package/lib/arazzo-schema.js +372 -0
- package/lib/arazzo-schema.js.map +1 -0
- package/lib/handlers/generate.d.ts +3 -0
- package/lib/handlers/generate.d.ts.map +1 -0
- package/lib/handlers/generate.js +18 -0
- package/lib/handlers/generate.js.map +1 -0
- package/lib/handlers/index.d.ts +3 -0
- package/lib/handlers/index.d.ts.map +1 -0
- package/lib/handlers/index.js +19 -0
- package/lib/handlers/index.js.map +1 -0
- package/lib/handlers/run.d.ts +2 -0
- package/lib/handlers/run.d.ts.map +1 -0
- package/lib/handlers/run.js +67 -0
- package/lib/handlers/run.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -0
- package/lib/modules/checks/checks.d.ts +9 -0
- package/lib/modules/checks/checks.d.ts.map +1 -0
- package/lib/modules/checks/checks.js +12 -0
- package/lib/modules/checks/checks.js.map +1 -0
- package/lib/modules/checks/index.d.ts +3 -0
- package/lib/modules/checks/index.d.ts.map +1 -0
- package/lib/modules/checks/index.js +19 -0
- package/lib/modules/checks/index.js.map +1 -0
- package/lib/modules/checks/severity.d.ts +9 -0
- package/lib/modules/checks/severity.d.ts.map +1 -0
- package/lib/modules/checks/severity.js +29 -0
- package/lib/modules/checks/severity.js.map +1 -0
- package/lib/modules/cli-output/calculate-tests-passed.d.ts +3 -0
- package/lib/modules/cli-output/calculate-tests-passed.d.ts.map +1 -0
- package/lib/modules/cli-output/calculate-tests-passed.js +67 -0
- package/lib/modules/cli-output/calculate-tests-passed.js.map +1 -0
- package/lib/modules/cli-output/display-checks.d.ts +3 -0
- package/lib/modules/cli-output/display-checks.d.ts.map +1 -0
- package/lib/modules/cli-output/display-checks.js +86 -0
- package/lib/modules/cli-output/display-checks.js.map +1 -0
- package/lib/modules/cli-output/display-errors.d.ts +3 -0
- package/lib/modules/cli-output/display-errors.d.ts.map +1 -0
- package/lib/modules/cli-output/display-errors.js +45 -0
- package/lib/modules/cli-output/display-errors.js.map +1 -0
- package/lib/modules/cli-output/display-files-summary-table.d.ts +11 -0
- package/lib/modules/cli-output/display-files-summary-table.d.ts.map +1 -0
- package/lib/modules/cli-output/display-files-summary-table.js +100 -0
- package/lib/modules/cli-output/display-files-summary-table.js.map +1 -0
- package/lib/modules/cli-output/display-summary.d.ts +7 -0
- package/lib/modules/cli-output/display-summary.d.ts.map +1 -0
- package/lib/modules/cli-output/display-summary.js +75 -0
- package/lib/modules/cli-output/display-summary.js.map +1 -0
- package/lib/modules/cli-output/index.d.ts +9 -0
- package/lib/modules/cli-output/index.d.ts.map +1 -0
- package/lib/modules/cli-output/index.js +25 -0
- package/lib/modules/cli-output/index.js.map +1 -0
- package/lib/modules/cli-output/json-logs.d.ts +3 -0
- package/lib/modules/cli-output/json-logs.d.ts.map +1 -0
- package/lib/modules/cli-output/json-logs.js +27 -0
- package/lib/modules/cli-output/json-logs.js.map +1 -0
- package/lib/modules/cli-output/mask-secrets.d.ts +5 -0
- package/lib/modules/cli-output/mask-secrets.d.ts.map +1 -0
- package/lib/modules/cli-output/mask-secrets.js +34 -0
- package/lib/modules/cli-output/mask-secrets.js.map +1 -0
- package/lib/modules/cli-output/verbose-logs.d.ts +3 -0
- package/lib/modules/cli-output/verbose-logs.d.ts.map +1 -0
- package/lib/modules/cli-output/verbose-logs.js +24 -0
- package/lib/modules/cli-output/verbose-logs.js.map +1 -0
- package/lib/modules/config-parser/get-value-from-context.d.ts +12 -0
- package/lib/modules/config-parser/get-value-from-context.d.ts.map +1 -0
- package/lib/modules/config-parser/get-value-from-context.js +183 -0
- package/lib/modules/config-parser/get-value-from-context.js.map +1 -0
- package/lib/modules/config-parser/handle-request-body-replacements.d.ts +3 -0
- package/lib/modules/config-parser/handle-request-body-replacements.d.ts.map +1 -0
- package/lib/modules/config-parser/handle-request-body-replacements.js +24 -0
- package/lib/modules/config-parser/handle-request-body-replacements.js.map +1 -0
- package/lib/modules/config-parser/index.d.ts +8 -0
- package/lib/modules/config-parser/index.d.ts.map +1 -0
- package/lib/modules/config-parser/index.js +24 -0
- package/lib/modules/config-parser/index.js.map +1 -0
- package/lib/modules/config-parser/map-header-params-and-cookie-to-object.d.ts +6 -0
- package/lib/modules/config-parser/map-header-params-and-cookie-to-object.d.ts.map +1 -0
- package/lib/modules/config-parser/map-header-params-and-cookie-to-object.js +22 -0
- package/lib/modules/config-parser/map-header-params-and-cookie-to-object.js.map +1 -0
- package/lib/modules/config-parser/parse-parameters.d.ts +10 -0
- package/lib/modules/config-parser/parse-parameters.d.ts.map +1 -0
- package/lib/modules/config-parser/parse-parameters.js +48 -0
- package/lib/modules/config-parser/parse-parameters.js.map +1 -0
- package/lib/modules/config-parser/parse-request-body.d.ts +8 -0
- package/lib/modules/config-parser/parse-request-body.d.ts.map +1 -0
- package/lib/modules/config-parser/parse-request-body.js +149 -0
- package/lib/modules/config-parser/parse-request-body.js.map +1 -0
- package/lib/modules/config-parser/resolve-reusable-component.d.ts +3 -0
- package/lib/modules/config-parser/resolve-reusable-component.d.ts.map +1 -0
- package/lib/modules/config-parser/resolve-reusable-component.js +8 -0
- package/lib/modules/config-parser/resolve-reusable-component.js.map +1 -0
- package/lib/modules/config-parser/resolve-reusable-object-reference.d.ts +5 -0
- package/lib/modules/config-parser/resolve-reusable-object-reference.d.ts.map +1 -0
- package/lib/modules/config-parser/resolve-reusable-object-reference.js +20 -0
- package/lib/modules/config-parser/resolve-reusable-object-reference.js.map +1 -0
- package/lib/modules/description-parser/bundle-openapi.d.ts +2 -0
- package/lib/modules/description-parser/bundle-openapi.d.ts.map +1 -0
- package/lib/modules/description-parser/bundle-openapi.js +41 -0
- package/lib/modules/description-parser/bundle-openapi.js.map +1 -0
- package/lib/modules/description-parser/extract-first-example.d.ts +2 -0
- package/lib/modules/description-parser/extract-first-example.d.ts.map +1 -0
- package/lib/modules/description-parser/extract-first-example.js +10 -0
- package/lib/modules/description-parser/extract-first-example.js.map +1 -0
- package/lib/modules/description-parser/get-operation-by-id.d.ts +3 -0
- package/lib/modules/description-parser/get-operation-by-id.d.ts.map +1 -0
- package/lib/modules/description-parser/get-operation-by-id.js +56 -0
- package/lib/modules/description-parser/get-operation-by-id.js.map +1 -0
- package/lib/modules/description-parser/get-operation-by-path.d.ts +7 -0
- package/lib/modules/description-parser/get-operation-by-path.d.ts.map +1 -0
- package/lib/modules/description-parser/get-operation-by-path.js +44 -0
- package/lib/modules/description-parser/get-operation-by-path.js.map +1 -0
- package/lib/modules/description-parser/get-operation-from-description.d.ts +18 -0
- package/lib/modules/description-parser/get-operation-from-description.d.ts.map +1 -0
- package/lib/modules/description-parser/get-operation-from-description.js +26 -0
- package/lib/modules/description-parser/get-operation-from-description.js.map +1 -0
- package/lib/modules/description-parser/get-request-body-schema.d.ts +3 -0
- package/lib/modules/description-parser/get-request-body-schema.d.ts.map +1 -0
- package/lib/modules/description-parser/get-request-body-schema.js +12 -0
- package/lib/modules/description-parser/get-request-body-schema.js.map +1 -0
- package/lib/modules/description-parser/get-request-data-from-openapi.d.ts +9 -0
- package/lib/modules/description-parser/get-request-data-from-openapi.d.ts.map +1 -0
- package/lib/modules/description-parser/get-request-data-from-openapi.js +63 -0
- package/lib/modules/description-parser/get-request-data-from-openapi.js.map +1 -0
- package/lib/modules/description-parser/get-response-schema.d.ts +6 -0
- package/lib/modules/description-parser/get-response-schema.d.ts.map +1 -0
- package/lib/modules/description-parser/get-response-schema.js +10 -0
- package/lib/modules/description-parser/get-response-schema.js.map +1 -0
- package/lib/modules/description-parser/index.d.ts +10 -0
- package/lib/modules/description-parser/index.d.ts.map +1 -0
- package/lib/modules/description-parser/index.js +26 -0
- package/lib/modules/description-parser/index.js.map +1 -0
- package/lib/modules/description-parser/remove-write-only-properties.d.ts +3 -0
- package/lib/modules/description-parser/remove-write-only-properties.d.ts.map +1 -0
- package/lib/modules/description-parser/remove-write-only-properties.js +41 -0
- package/lib/modules/description-parser/remove-write-only-properties.js.map +1 -0
- package/lib/modules/faker.d.ts +42 -0
- package/lib/modules/faker.d.ts.map +1 -0
- package/lib/modules/faker.js +36 -0
- package/lib/modules/faker.js.map +1 -0
- package/lib/modules/flow-runner/call-api-and-analyze-results.d.ts +30 -0
- package/lib/modules/flow-runner/call-api-and-analyze-results.d.ts.map +1 -0
- package/lib/modules/flow-runner/call-api-and-analyze-results.js +100 -0
- package/lib/modules/flow-runner/call-api-and-analyze-results.js.map +1 -0
- package/lib/modules/flow-runner/context/create-runtime-expression-ctx.d.ts +7 -0
- package/lib/modules/flow-runner/context/create-runtime-expression-ctx.d.ts.map +1 -0
- package/lib/modules/flow-runner/context/create-runtime-expression-ctx.js +56 -0
- package/lib/modules/flow-runner/context/create-runtime-expression-ctx.js.map +1 -0
- package/lib/modules/flow-runner/context/create-test-context.d.ts +5 -0
- package/lib/modules/flow-runner/context/create-test-context.d.ts.map +1 -0
- package/lib/modules/flow-runner/context/create-test-context.js +88 -0
- package/lib/modules/flow-runner/context/create-test-context.js.map +1 -0
- package/lib/modules/flow-runner/context/index.d.ts +5 -0
- package/lib/modules/flow-runner/context/index.d.ts.map +1 -0
- package/lib/modules/flow-runner/context/index.js +21 -0
- package/lib/modules/flow-runner/context/index.js.map +1 -0
- package/lib/modules/flow-runner/context/set-public-steps.d.ts +3 -0
- package/lib/modules/flow-runner/context/set-public-steps.d.ts.map +1 -0
- package/lib/modules/flow-runner/context/set-public-steps.js +11 -0
- package/lib/modules/flow-runner/context/set-public-steps.js.map +1 -0
- package/lib/modules/flow-runner/context/set-public-workflows.d.ts +7 -0
- package/lib/modules/flow-runner/context/set-public-workflows.d.ts.map +1 -0
- package/lib/modules/flow-runner/context/set-public-workflows.js +29 -0
- package/lib/modules/flow-runner/context/set-public-workflows.js.map +1 -0
- package/lib/modules/flow-runner/error-message-matcher.d.ts +4 -0
- package/lib/modules/flow-runner/error-message-matcher.d.ts.map +1 -0
- package/lib/modules/flow-runner/error-message-matcher.js +11 -0
- package/lib/modules/flow-runner/error-message-matcher.js.map +1 -0
- package/lib/modules/flow-runner/get-server-url.d.ts +12 -0
- package/lib/modules/flow-runner/get-server-url.d.ts.map +1 -0
- package/lib/modules/flow-runner/get-server-url.js +67 -0
- package/lib/modules/flow-runner/get-server-url.js.map +1 -0
- package/lib/modules/flow-runner/get-test-description-from-file.d.ts +20 -0
- package/lib/modules/flow-runner/get-test-description-from-file.d.ts.map +1 -0
- package/lib/modules/flow-runner/get-test-description-from-file.js +75 -0
- package/lib/modules/flow-runner/get-test-description-from-file.js.map +1 -0
- package/lib/modules/flow-runner/get-workflows-to-run.d.ts +3 -0
- package/lib/modules/flow-runner/get-workflows-to-run.d.ts.map +1 -0
- package/lib/modules/flow-runner/get-workflows-to-run.js +50 -0
- package/lib/modules/flow-runner/get-workflows-to-run.js.map +1 -0
- package/lib/modules/flow-runner/index.d.ts +16 -0
- package/lib/modules/flow-runner/index.d.ts.map +1 -0
- package/lib/modules/flow-runner/index.js +32 -0
- package/lib/modules/flow-runner/index.js.map +1 -0
- package/lib/modules/flow-runner/inputs/format-cli-inputs.d.ts +2 -0
- package/lib/modules/flow-runner/inputs/format-cli-inputs.d.ts.map +1 -0
- package/lib/modules/flow-runner/inputs/format-cli-inputs.js +45 -0
- package/lib/modules/flow-runner/inputs/format-cli-inputs.js.map +1 -0
- package/lib/modules/flow-runner/inputs/index.d.ts +3 -0
- package/lib/modules/flow-runner/inputs/index.d.ts.map +1 -0
- package/lib/modules/flow-runner/inputs/index.js +19 -0
- package/lib/modules/flow-runner/inputs/index.js.map +1 -0
- package/lib/modules/flow-runner/inputs/map-input-values-to-schema.d.ts +7 -0
- package/lib/modules/flow-runner/inputs/map-input-values-to-schema.d.ts.map +1 -0
- package/lib/modules/flow-runner/inputs/map-input-values-to-schema.js +29 -0
- package/lib/modules/flow-runner/inputs/map-input-values-to-schema.js.map +1 -0
- package/lib/modules/flow-runner/outputs/index.d.ts +2 -0
- package/lib/modules/flow-runner/outputs/index.d.ts.map +1 -0
- package/lib/modules/flow-runner/outputs/index.js +18 -0
- package/lib/modules/flow-runner/outputs/index.js.map +1 -0
- package/lib/modules/flow-runner/outputs/print-message.d.ts +7 -0
- package/lib/modules/flow-runner/outputs/print-message.d.ts.map +1 -0
- package/lib/modules/flow-runner/outputs/print-message.js +17 -0
- package/lib/modules/flow-runner/outputs/print-message.js.map +1 -0
- package/lib/modules/flow-runner/prepare-request.d.ts +15 -0
- package/lib/modules/flow-runner/prepare-request.d.ts.map +1 -0
- package/lib/modules/flow-runner/prepare-request.js +166 -0
- package/lib/modules/flow-runner/prepare-request.js.map +1 -0
- package/lib/modules/flow-runner/read-env-variables.d.ts +2 -0
- package/lib/modules/flow-runner/read-env-variables.d.ts.map +1 -0
- package/lib/modules/flow-runner/read-env-variables.js +44 -0
- package/lib/modules/flow-runner/read-env-variables.js.map +1 -0
- package/lib/modules/flow-runner/resolve-running-workflows.d.ts +2 -0
- package/lib/modules/flow-runner/resolve-running-workflows.d.ts.map +1 -0
- package/lib/modules/flow-runner/resolve-running-workflows.js +25 -0
- package/lib/modules/flow-runner/resolve-running-workflows.js.map +1 -0
- package/lib/modules/flow-runner/run-step.d.ts +12 -0
- package/lib/modules/flow-runner/run-step.d.ts.map +1 -0
- package/lib/modules/flow-runner/run-step.js +250 -0
- package/lib/modules/flow-runner/run-step.js.map +1 -0
- package/lib/modules/flow-runner/runner.d.ts +11 -0
- package/lib/modules/flow-runner/runner.d.ts.map +1 -0
- package/lib/modules/flow-runner/runner.js +225 -0
- package/lib/modules/flow-runner/runner.js.map +1 -0
- package/lib/modules/flow-runner/schema/index.d.ts +2 -0
- package/lib/modules/flow-runner/schema/index.d.ts.map +1 -0
- package/lib/modules/flow-runner/schema/index.js +18 -0
- package/lib/modules/flow-runner/schema/index.js.map +1 -0
- package/lib/modules/flow-runner/schema/schema-checker.d.ts +7 -0
- package/lib/modules/flow-runner/schema/schema-checker.d.ts.map +1 -0
- package/lib/modules/flow-runner/schema/schema-checker.js +124 -0
- package/lib/modules/flow-runner/schema/schema-checker.js.map +1 -0
- package/lib/modules/flow-runner/success-criteria/check-success-criteria.d.ts +8 -0
- package/lib/modules/flow-runner/success-criteria/check-success-criteria.d.ts.map +1 -0
- package/lib/modules/flow-runner/success-criteria/check-success-criteria.js +97 -0
- package/lib/modules/flow-runner/success-criteria/check-success-criteria.js.map +1 -0
- package/lib/modules/flow-runner/success-criteria/index.d.ts +3 -0
- package/lib/modules/flow-runner/success-criteria/index.d.ts.map +1 -0
- package/lib/modules/flow-runner/success-criteria/index.js +19 -0
- package/lib/modules/flow-runner/success-criteria/index.js.map +1 -0
- package/lib/modules/flow-runner/success-criteria/validate-success-criteria.d.ts +6 -0
- package/lib/modules/flow-runner/success-criteria/validate-success-criteria.d.ts.map +1 -0
- package/lib/modules/flow-runner/success-criteria/validate-success-criteria.js +63 -0
- package/lib/modules/flow-runner/success-criteria/validate-success-criteria.js.map +1 -0
- package/lib/modules/runtime-expressions/abnf-parser.d.ts +15 -0
- package/lib/modules/runtime-expressions/abnf-parser.d.ts.map +1 -0
- package/lib/modules/runtime-expressions/abnf-parser.js +2012 -0
- package/lib/modules/runtime-expressions/abnf-parser.js.map +1 -0
- package/lib/modules/runtime-expressions/evaluate.d.ts +9 -0
- package/lib/modules/runtime-expressions/evaluate.d.ts.map +1 -0
- package/lib/modules/runtime-expressions/evaluate.js +169 -0
- package/lib/modules/runtime-expressions/evaluate.js.map +1 -0
- package/lib/modules/runtime-expressions/index.d.ts +2 -0
- package/lib/modules/runtime-expressions/index.d.ts.map +1 -0
- package/lib/modules/runtime-expressions/index.js +18 -0
- package/lib/modules/runtime-expressions/index.js.map +1 -0
- package/lib/modules/runtime-expressions/lint.d.ts +2 -0
- package/lib/modules/runtime-expressions/lint.d.ts.map +1 -0
- package/lib/modules/runtime-expressions/lint.js +13 -0
- package/lib/modules/runtime-expressions/lint.js.map +1 -0
- package/lib/modules/runtime-expressions/replace-json-pointers.d.ts +2 -0
- package/lib/modules/runtime-expressions/replace-json-pointers.d.ts.map +1 -0
- package/lib/modules/runtime-expressions/replace-json-pointers.js +62 -0
- package/lib/modules/runtime-expressions/replace-json-pointers.js.map +1 -0
- package/lib/modules/test-config-generator/cleanup-test-description.d.ts +16 -0
- package/lib/modules/test-config-generator/cleanup-test-description.d.ts.map +1 -0
- package/lib/modules/test-config-generator/cleanup-test-description.js +28 -0
- package/lib/modules/test-config-generator/cleanup-test-description.js.map +1 -0
- package/lib/modules/test-config-generator/generate-example-value.d.ts +3 -0
- package/lib/modules/test-config-generator/generate-example-value.d.ts.map +1 -0
- package/lib/modules/test-config-generator/generate-example-value.js +17 -0
- package/lib/modules/test-config-generator/generate-example-value.js.map +1 -0
- package/lib/modules/test-config-generator/generate-test-config.d.ts +7 -0
- package/lib/modules/test-config-generator/generate-test-config.d.ts.map +1 -0
- package/lib/modules/test-config-generator/generate-test-config.js +117 -0
- package/lib/modules/test-config-generator/generate-test-config.js.map +1 -0
- package/lib/modules/test-config-generator/generate-test-data-from-json-schema.d.ts +2 -0
- package/lib/modules/test-config-generator/generate-test-data-from-json-schema.d.ts.map +1 -0
- package/lib/modules/test-config-generator/generate-test-data-from-json-schema.js +42 -0
- package/lib/modules/test-config-generator/generate-test-data-from-json-schema.js.map +1 -0
- package/lib/modules/test-config-generator/index.d.ts +5 -0
- package/lib/modules/test-config-generator/index.d.ts.map +1 -0
- package/lib/modules/test-config-generator/index.js +21 -0
- package/lib/modules/test-config-generator/index.js.map +1 -0
- package/lib/types.d.ts +241 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +3 -0
- package/lib/types.js.map +1 -0
- package/lib/utils/ajv-errors.d.ts +3 -0
- package/lib/utils/ajv-errors.d.ts.map +1 -0
- package/lib/utils/ajv-errors.js +28 -0
- package/lib/utils/ajv-errors.js.map +1 -0
- package/lib/utils/api-fetcher.d.ts +27 -0
- package/lib/utils/api-fetcher.d.ts.map +1 -0
- package/lib/utils/api-fetcher.js +243 -0
- package/lib/utils/api-fetcher.js.map +1 -0
- package/lib/utils/check-circular-refs-in-schema.d.ts +2 -0
- package/lib/utils/check-circular-refs-in-schema.d.ts.map +1 -0
- package/lib/utils/check-circular-refs-in-schema.js +13 -0
- package/lib/utils/check-circular-refs-in-schema.js.map +1 -0
- package/lib/utils/clean-colors.d.ts +2 -0
- package/lib/utils/clean-colors.d.ts.map +1 -0
- package/lib/utils/clean-colors.js +8 -0
- package/lib/utils/clean-colors.js.map +1 -0
- package/lib/utils/cli-outputs.d.ts +18 -0
- package/lib/utils/cli-outputs.d.ts.map +1 -0
- package/lib/utils/cli-outputs.js +70 -0
- package/lib/utils/cli-outputs.js.map +1 -0
- package/lib/utils/delay.d.ts +2 -0
- package/lib/utils/delay.d.ts.map +1 -0
- package/lib/utils/delay.js +8 -0
- package/lib/utils/delay.js.map +1 -0
- package/lib/utils/env.d.ts +3 -0
- package/lib/utils/env.d.ts.map +1 -0
- package/lib/utils/env.js +13 -0
- package/lib/utils/env.js.map +1 -0
- package/lib/utils/file.d.ts +2 -0
- package/lib/utils/file.d.ts.map +1 -0
- package/lib/utils/file.js +7 -0
- package/lib/utils/file.js.map +1 -0
- package/lib/utils/get-nested-value.d.ts +2 -0
- package/lib/utils/get-nested-value.d.ts.map +1 -0
- package/lib/utils/get-nested-value.js +16 -0
- package/lib/utils/get-nested-value.js.map +1 -0
- package/lib/utils/get-reunite-url.d.ts +2 -0
- package/lib/utils/get-reunite-url.d.ts.map +1 -0
- package/lib/utils/get-reunite-url.js +18 -0
- package/lib/utils/get-reunite-url.js.map +1 -0
- package/lib/utils/har-logs/create-har-log.d.ts +2 -0
- package/lib/utils/har-logs/create-har-log.d.ts.map +1 -0
- package/lib/utils/har-logs/create-har-log.js +28 -0
- package/lib/utils/har-logs/create-har-log.js.map +1 -0
- package/lib/utils/har-logs/helpers/add-headers.d.ts +2 -0
- package/lib/utils/har-logs/helpers/add-headers.d.ts.map +1 -0
- package/lib/utils/har-logs/helpers/add-headers.js +20 -0
- package/lib/utils/har-logs/helpers/add-headers.js.map +1 -0
- package/lib/utils/har-logs/helpers/build-headers.d.ts +10 -0
- package/lib/utils/har-logs/helpers/build-headers.d.ts.map +1 -0
- package/lib/utils/har-logs/helpers/build-headers.js +35 -0
- package/lib/utils/har-logs/helpers/build-headers.js.map +1 -0
- package/lib/utils/har-logs/helpers/build-params.d.ts +2 -0
- package/lib/utils/har-logs/helpers/build-params.d.ts.map +1 -0
- package/lib/utils/har-logs/helpers/build-params.js +44 -0
- package/lib/utils/har-logs/helpers/build-params.js.map +1 -0
- package/lib/utils/har-logs/helpers/build-request-cookies.d.ts +2 -0
- package/lib/utils/har-logs/helpers/build-request-cookies.d.ts.map +1 -0
- package/lib/utils/har-logs/helpers/build-request-cookies.js +44 -0
- package/lib/utils/har-logs/helpers/build-request-cookies.js.map +1 -0
- package/lib/utils/har-logs/helpers/build-response-cookies.d.ts +2 -0
- package/lib/utils/har-logs/helpers/build-response-cookies.d.ts.map +1 -0
- package/lib/utils/har-logs/helpers/build-response-cookies.js +66 -0
- package/lib/utils/har-logs/helpers/build-response-cookies.js.map +1 -0
- package/lib/utils/har-logs/helpers/get-agent.d.ts +2 -0
- package/lib/utils/har-logs/helpers/get-agent.d.ts.map +1 -0
- package/lib/utils/har-logs/helpers/get-agent.js +115 -0
- package/lib/utils/har-logs/helpers/get-agent.js.map +1 -0
- package/lib/utils/har-logs/helpers/get-duration.d.ts +2 -0
- package/lib/utils/har-logs/helpers/get-duration.d.ts.map +1 -0
- package/lib/utils/har-logs/helpers/get-duration.js +9 -0
- package/lib/utils/har-logs/helpers/get-duration.js.map +1 -0
- package/lib/utils/har-logs/helpers/get-input-url.d.ts +2 -0
- package/lib/utils/har-logs/helpers/get-input-url.d.ts.map +1 -0
- package/lib/utils/har-logs/helpers/get-input-url.js +8 -0
- package/lib/utils/har-logs/helpers/get-input-url.js.map +1 -0
- package/lib/utils/har-logs/helpers/handle-request.d.ts +9 -0
- package/lib/utils/har-logs/helpers/handle-request.d.ts.map +1 -0
- package/lib/utils/har-logs/helpers/handle-request.js +202 -0
- package/lib/utils/har-logs/helpers/handle-request.js.map +1 -0
- package/lib/utils/har-logs/index.d.ts +3 -0
- package/lib/utils/har-logs/index.d.ts.map +1 -0
- package/lib/utils/har-logs/index.js +19 -0
- package/lib/utils/har-logs/index.js.map +1 -0
- package/lib/utils/har-logs/with-har.d.ts +6 -0
- package/lib/utils/har-logs/with-har.d.ts.map +1 -0
- package/lib/utils/har-logs/with-har.js +216 -0
- package/lib/utils/har-logs/with-har.js.map +1 -0
- package/lib/utils/is-empty.d.ts +2 -0
- package/lib/utils/is-empty.d.ts.map +1 -0
- package/lib/utils/is-empty.js +16 -0
- package/lib/utils/is-empty.js.map +1 -0
- package/lib/utils/is-json.d.ts +2 -0
- package/lib/utils/is-json.d.ts.map +1 -0
- package/lib/utils/is-json.js +13 -0
- package/lib/utils/is-json.js.map +1 -0
- package/lib/utils/is-url.d.ts +2 -0
- package/lib/utils/is-url.d.ts.map +1 -0
- package/lib/utils/is-url.js +16 -0
- package/lib/utils/is-url.js.map +1 -0
- package/lib/utils/logger/logger.d.ts +16 -0
- package/lib/utils/logger/logger.d.ts.map +1 -0
- package/lib/utils/logger/logger.js +33 -0
- package/lib/utils/logger/logger.js.map +1 -0
- package/lib/utils/mtls/create-mtls-client.d.ts +4 -0
- package/lib/utils/mtls/create-mtls-client.d.ts.map +1 -0
- package/lib/utils/mtls/create-mtls-client.js +22 -0
- package/lib/utils/mtls/create-mtls-client.js.map +1 -0
- package/lib/utils/mtls/resolve-mtls-certificates.d.ts +7 -0
- package/lib/utils/mtls/resolve-mtls-certificates.d.ts.map +1 -0
- package/lib/utils/mtls/resolve-mtls-certificates.js +69 -0
- package/lib/utils/mtls/resolve-mtls-certificates.js.map +1 -0
- package/lib/utils/sort.d.ts +2 -0
- package/lib/utils/sort.d.ts.map +1 -0
- package/lib/utils/sort.js +29 -0
- package/lib/utils/sort.js.map +1 -0
- package/lib/utils/time.d.ts +2 -0
- package/lib/utils/time.d.ts.map +1 -0
- package/lib/utils/time.js +10 -0
- package/lib/utils/time.js.map +1 -0
- package/lib/utils/url.d.ts +2 -0
- package/lib/utils/url.d.ts.map +1 -0
- package/lib/utils/url.js +9 -0
- package/lib/utils/url.js.map +1 -0
- package/lib/utils/yaml.d.ts +5 -0
- package/lib/utils/yaml.d.ts.map +1 -0
- package/lib/utils/yaml.js +23 -0
- package/lib/utils/yaml.js.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.prepareRequest = prepareRequest;
|
|
4
|
+
const description_parser_1 = require("../description-parser");
|
|
5
|
+
const config_parser_1 = require("../config-parser");
|
|
6
|
+
const get_server_url_1 = require("./get-server-url");
|
|
7
|
+
const context_1 = require("./context");
|
|
8
|
+
const runtime_expressions_1 = require("../runtime-expressions");
|
|
9
|
+
async function prepareRequest(ctx, step, workflowName) {
|
|
10
|
+
const { stepId, operationId, operationPath, 'x-operation': xOperation } = step;
|
|
11
|
+
const activeWorkflow = ctx.workflows.find((workflow) => workflow.workflowId === workflowName);
|
|
12
|
+
const workflowLevelParameters = (activeWorkflow && activeWorkflow.parameters) || [];
|
|
13
|
+
const openapiOperation = xOperation
|
|
14
|
+
? undefined
|
|
15
|
+
: (0, description_parser_1.getOperationFromDescriptionBySource)({
|
|
16
|
+
operationId,
|
|
17
|
+
operationPath,
|
|
18
|
+
}, ctx);
|
|
19
|
+
let path = '';
|
|
20
|
+
let method;
|
|
21
|
+
const serverUrl = (0, get_server_url_1.getServerUrl)({
|
|
22
|
+
ctx,
|
|
23
|
+
descriptionName: openapiOperation?.descriptionName,
|
|
24
|
+
openapiOperation,
|
|
25
|
+
xOperation,
|
|
26
|
+
});
|
|
27
|
+
if (xOperation) {
|
|
28
|
+
method = xOperation.method;
|
|
29
|
+
}
|
|
30
|
+
else if (openapiOperation) {
|
|
31
|
+
path = openapiOperation?.path;
|
|
32
|
+
method = openapiOperation?.method;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
// this should never happen, making typescript happy
|
|
36
|
+
throw new Error('No operation found');
|
|
37
|
+
}
|
|
38
|
+
if (!serverUrl && !path.includes('http')) {
|
|
39
|
+
throw new Error('No servers found in API description');
|
|
40
|
+
}
|
|
41
|
+
if (!method) {
|
|
42
|
+
throw new Error('"method" is required to make a request');
|
|
43
|
+
}
|
|
44
|
+
const requestDataFromOpenAPI = openapiOperation && (0, description_parser_1.getRequestDataFromOpenApi)(openapiOperation);
|
|
45
|
+
const { payload: stepRequestBodyPayload,
|
|
46
|
+
// encoding: stepRequestBodyEncoding,
|
|
47
|
+
contentType: stepRequestBodyContentType, } = await (0, config_parser_1.parseRequestBody)(step['requestBody']);
|
|
48
|
+
const requestBody = stepRequestBodyPayload || requestDataFromOpenAPI?.requestBody;
|
|
49
|
+
const contentType = stepRequestBodyContentType || requestDataFromOpenAPI?.contentType;
|
|
50
|
+
const parameters = joinParameters(
|
|
51
|
+
// order is important here, the last one wins
|
|
52
|
+
typeof requestBody === 'object'
|
|
53
|
+
? [{ in: 'header', name: 'content-type', value: 'application/json' }]
|
|
54
|
+
: [], requestDataFromOpenAPI?.parameters || [], resolveParameters(workflowLevelParameters, ctx), stepRequestBodyContentType
|
|
55
|
+
? [{ in: 'header', name: 'content-type', value: stepRequestBodyContentType }]
|
|
56
|
+
: [], resolveParameters(step.parameters || [], ctx));
|
|
57
|
+
// save local $steps context before evaluating runtime expressions
|
|
58
|
+
if (!ctx.$steps[stepId]) {
|
|
59
|
+
ctx.$steps[stepId] = {};
|
|
60
|
+
}
|
|
61
|
+
// save local $workflows context
|
|
62
|
+
if (!ctx.$workflows[workflowName].steps[stepId]) {
|
|
63
|
+
ctx.$workflows[workflowName].steps[stepId] = {};
|
|
64
|
+
}
|
|
65
|
+
ctx.$workflows[workflowName].steps[stepId].request = {
|
|
66
|
+
body: requestBody,
|
|
67
|
+
header: groupParametersValuesByName(parameters, 'header'),
|
|
68
|
+
path: groupParametersValuesByName(parameters, 'path'),
|
|
69
|
+
query: groupParametersValuesByName(parameters, 'query'),
|
|
70
|
+
url: serverUrl?.url && path ? `${serverUrl?.url}${path}` : serverUrl?.url,
|
|
71
|
+
method,
|
|
72
|
+
};
|
|
73
|
+
const ctxWithInputs = {
|
|
74
|
+
...ctx,
|
|
75
|
+
$inputs: {
|
|
76
|
+
...(ctx.$inputs || {}),
|
|
77
|
+
...(ctx.$workflows[workflowName]?.inputs || {}),
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
const expressionContext = (0, context_1.createRuntimeExpressionCtx)({
|
|
81
|
+
ctx: ctxWithInputs,
|
|
82
|
+
workflowId: workflowName,
|
|
83
|
+
step,
|
|
84
|
+
});
|
|
85
|
+
const evaluatedParameters = parameters.map((parameter) => {
|
|
86
|
+
return {
|
|
87
|
+
...parameter,
|
|
88
|
+
value: (0, runtime_expressions_1.evaluateRuntimeExpressionPayload)({
|
|
89
|
+
payload: parameter.value,
|
|
90
|
+
context: expressionContext,
|
|
91
|
+
// contentType,
|
|
92
|
+
}),
|
|
93
|
+
};
|
|
94
|
+
});
|
|
95
|
+
for (const param of openapiOperation?.parameters || []) {
|
|
96
|
+
const { schema, name } = param;
|
|
97
|
+
(0, context_1.collectSecretFields)(ctx, schema, groupParametersValuesByName(parameters, param.in), [name]);
|
|
98
|
+
}
|
|
99
|
+
const evaluatedBody = (0, runtime_expressions_1.evaluateRuntimeExpressionPayload)({
|
|
100
|
+
payload: requestBody,
|
|
101
|
+
context: expressionContext,
|
|
102
|
+
contentType,
|
|
103
|
+
});
|
|
104
|
+
if (contentType && openapiOperation?.requestBody) {
|
|
105
|
+
const requestBodySchema = (0, description_parser_1.getRequestBodySchema)(contentType, openapiOperation);
|
|
106
|
+
(0, context_1.collectSecretFields)(ctx, requestBodySchema, requestBody);
|
|
107
|
+
}
|
|
108
|
+
// Supporting temporal extension of query method https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html
|
|
109
|
+
if (method?.toLowerCase() === 'x-query') {
|
|
110
|
+
method = 'query';
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
serverUrl,
|
|
114
|
+
path,
|
|
115
|
+
method,
|
|
116
|
+
parameters: extractCookieParametersFromHeaderParameters(evaluatedParameters),
|
|
117
|
+
requestBody: evaluatedBody,
|
|
118
|
+
openapiOperation,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function joinParameters(...parameters) {
|
|
122
|
+
const parametersWithNames = parameters.flat().filter((param) => 'name' in param);
|
|
123
|
+
const parameterMap = parametersWithNames.reduce((map, param) => {
|
|
124
|
+
map[param.name] = param;
|
|
125
|
+
return map;
|
|
126
|
+
}, {});
|
|
127
|
+
return Object.values(parameterMap);
|
|
128
|
+
}
|
|
129
|
+
function groupParametersValuesByName(parameters, inValue) {
|
|
130
|
+
return parameters.reduce((acc, param) => {
|
|
131
|
+
if (param.in === inValue && 'name' in param) {
|
|
132
|
+
acc[param.in === 'header' ? param.name.toLowerCase() : param.name] = param.value;
|
|
133
|
+
}
|
|
134
|
+
return acc;
|
|
135
|
+
}, {});
|
|
136
|
+
}
|
|
137
|
+
function resolveParameters(parameters, ctx) {
|
|
138
|
+
return parameters
|
|
139
|
+
.map((parameter) => {
|
|
140
|
+
const resolvedParameter = (0, config_parser_1.resolveReusableComponentItem)(parameter, ctx);
|
|
141
|
+
if (!(0, config_parser_1.isParameterWithIn)(resolvedParameter)) {
|
|
142
|
+
return undefined;
|
|
143
|
+
}
|
|
144
|
+
return resolvedParameter;
|
|
145
|
+
})
|
|
146
|
+
.filter((parameter) => parameter !== undefined);
|
|
147
|
+
}
|
|
148
|
+
function extractCookieParametersFromHeaderParameters(parameters) {
|
|
149
|
+
const result = [];
|
|
150
|
+
for (const parameter of parameters) {
|
|
151
|
+
if (parameter.in === 'header' && parameter.name.toLowerCase() === 'cookie') {
|
|
152
|
+
const cookieParameters = String(parameter.value)
|
|
153
|
+
.split(';')
|
|
154
|
+
.map((cookie) => {
|
|
155
|
+
const [key, value] = cookie.split('=');
|
|
156
|
+
return { name: key, value, in: 'cookie' };
|
|
157
|
+
});
|
|
158
|
+
result.push(...cookieParameters);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
result.push(parameter);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return result;
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=prepare-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare-request.js","sourceRoot":"","sources":["../../../src/modules/flow-runner/prepare-request.ts"],"names":[],"mappings":";;AA8BA,wCA4IC;AA1KD,8DAI+B;AAC/B,oDAI0B;AAC1B,qDAAgD;AAChD,uCAA4E;AAC5E,gEAA0E;AAkBnE,KAAK,UAAU,cAAc,CAClC,GAAgB,EAChB,IAAU,EACV,YAAoB;IAEpB,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IAE/E,MAAM,cAAc,GAAG,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,UAAU,KAAK,YAAY,CAAC,CAAC;IAC9F,MAAM,uBAAuB,GAAG,CAAC,cAAc,IAAI,cAAc,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;IAEpF,MAAM,gBAAgB,GAAG,UAAU;QACjC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,IAAA,wDAAmC,EACjC;YACE,WAAW;YACX,aAAa;SACd,EACD,GAAG,CACJ,CAAC;IAEN,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,IAAI,MAAM,CAAC;IACX,MAAM,SAAS,GAA0D,IAAA,6BAAY,EAAC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MAAM,CAAC,CAC7C"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.readEnvVariables = readEnvVariables;
|
|
27
|
+
const dotenv = __importStar(require("dotenv"));
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
const fs = __importStar(require("fs"));
|
|
30
|
+
function readEnvVariables(executionFilePath) {
|
|
31
|
+
if (executionFilePath) {
|
|
32
|
+
let currentDir = path.dirname(executionFilePath);
|
|
33
|
+
while (currentDir !== path.resolve(currentDir, '..')) {
|
|
34
|
+
const envFilePath = path.join(currentDir, '.env');
|
|
35
|
+
if (fs.existsSync(envFilePath)) {
|
|
36
|
+
dotenv.config({ path: envFilePath });
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
currentDir = path.resolve(currentDir, '..');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return process.env;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=read-env-variables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-env-variables.js","sourceRoot":"","sources":["../../../src/modules/flow-runner/read-env-variables.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,4CAiBC;AArBD,+CAAiC;AACjC,2CAA6B;AAC7B,uCAAyB;AAEzB,SAAgB,gBAAgB,CAAC,iBAA0B;IACzD,IAAI,iBAAiB,EAAE,CAAC;QACtB,IAAI,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QAEjD,OAAO,UAAU,KAAK,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC;YACrD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;YAElD,IAAI,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;gBAC/B,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;gBACrC,MAAM;YACR,CAAC;YAED,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC,GAA6B,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-running-workflows.d.ts","sourceRoot":"","sources":["../../../src/modules/flow-runner/resolve-running-workflows.ts"],"names":[],"mappings":"AAAA,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GACvC,MAAM,EAAE,GAAG,SAAS,CAsBtB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveRunningWorkflows = resolveRunningWorkflows;
|
|
4
|
+
function resolveRunningWorkflows(workflows) {
|
|
5
|
+
if (!workflows) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
if (typeof workflows === 'string') {
|
|
9
|
+
return workflows.includes(',') ? workflows.split(',').map((w) => w.trim()) : [workflows];
|
|
10
|
+
}
|
|
11
|
+
if (Array.isArray(workflows)) {
|
|
12
|
+
const result = [];
|
|
13
|
+
for (const workflow of workflows) {
|
|
14
|
+
if (workflow.includes(',')) {
|
|
15
|
+
result.push(...workflow.split(',').map((w) => w.trim()));
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
result.push(workflow);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=resolve-running-workflows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-running-workflows.js","sourceRoot":"","sources":["../../../src/modules/flow-runner/resolve-running-workflows.ts"],"names":[],"mappings":";;AAAA,0DAwBC;AAxBD,SAAgB,uBAAuB,CACrC,SAAwC;IAExC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAClC,OAAO,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC3F,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YACjC,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC3B,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YAC3D,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACxB,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Step, TestContext } from '../../types';
|
|
2
|
+
export declare function runStep({ step, ctx, workflowName, parentStepId, parentWorkflowId, retriesLeft, }: {
|
|
3
|
+
step: Step;
|
|
4
|
+
ctx: TestContext;
|
|
5
|
+
workflowName: string | undefined;
|
|
6
|
+
parentStepId?: string;
|
|
7
|
+
parentWorkflowId?: string;
|
|
8
|
+
retriesLeft?: number;
|
|
9
|
+
}): Promise<{
|
|
10
|
+
shouldEnd: boolean;
|
|
11
|
+
} | void>;
|
|
12
|
+
//# sourceMappingURL=run-step.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-step.d.ts","sourceRoot":"","sources":["../../../src/modules/flow-runner/run-step.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAEV,IAAI,EACJ,WAAW,EAMZ,MAAM,aAAa,CAAC;AAKrB,wBAAsB,OAAO,CAAC,EAC5B,IAAI,EACJ,GAAG,EACH,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,WAAW,GACZ,EAAE;IACD,IAAI,EAAE,IAAI,CAAC;IACX,GAAG,EAAE,WAAW,CAAC;IACjB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC,CAyRzC"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runStep = runStep;
|
|
4
|
+
const colorette_1 = require("colorette");
|
|
5
|
+
const call_api_and_analyze_results_1 = require("./call-api-and-analyze-results");
|
|
6
|
+
const success_criteria_1 = require("./success-criteria");
|
|
7
|
+
const delay_1 = require("../../utils/delay");
|
|
8
|
+
const checks_1 = require("../checks");
|
|
9
|
+
const runner_1 = require("./runner");
|
|
10
|
+
const prepare_request_1 = require("./prepare-request");
|
|
11
|
+
const cli_outputs_1 = require("../../utils/cli-outputs");
|
|
12
|
+
const config_parser_1 = require("../config-parser");
|
|
13
|
+
const runtime_expressions_1 = require("../runtime-expressions");
|
|
14
|
+
const logger_1 = require("../../utils/logger/logger");
|
|
15
|
+
const logger = logger_1.DefaultLogger.getInstance();
|
|
16
|
+
async function runStep({ step, ctx, workflowName, parentStepId, parentWorkflowId, retriesLeft, }) {
|
|
17
|
+
const workflow = ctx.workflows.find((w) => w.workflowId === workflowName);
|
|
18
|
+
const { stepId, onFailure, onSuccess, workflowId, parameters } = step;
|
|
19
|
+
const failureActionsToRun = (onFailure || workflow?.failureActions || []).map((action) => (0, config_parser_1.resolveReusableComponentItem)(action, ctx));
|
|
20
|
+
const successActionsToRun = (onSuccess || workflow?.successActions || []).map((action) => (0, config_parser_1.resolveReusableComponentItem)(action, ctx));
|
|
21
|
+
const resolvedParameters = parameters?.map((parameter) => (0, config_parser_1.resolveReusableComponentItem)(parameter, ctx));
|
|
22
|
+
if (workflowId) {
|
|
23
|
+
const resolvedWorkflow = ctx.workflows.find((w) => w.workflowId === workflowId) ||
|
|
24
|
+
(0, config_parser_1.getValueFromContext)(workflowId, ctx);
|
|
25
|
+
if (!resolvedWorkflow) {
|
|
26
|
+
const failedCall = {
|
|
27
|
+
name: checks_1.CHECKS.UNEXPECTED_ERROR,
|
|
28
|
+
message: `Workflow ${(0, colorette_1.red)(workflowId)} not found.`,
|
|
29
|
+
pass: false,
|
|
30
|
+
severity: ctx.severity['UNEXPECTED_ERROR'],
|
|
31
|
+
};
|
|
32
|
+
step.checks.push(failedCall);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const workflowCtx = await (0, runner_1.resolveWorkflowContext)(workflowId, resolvedWorkflow, ctx);
|
|
36
|
+
if (resolvedParameters && resolvedParameters.length) {
|
|
37
|
+
// When the step in context specifies a workflowId, then all parameters without `in` maps to workflow inputs.
|
|
38
|
+
const workflowInputParameters = resolvedParameters
|
|
39
|
+
.filter(config_parser_1.isParameterWithoutIn)
|
|
40
|
+
.reduce((acc, parameter) => {
|
|
41
|
+
// Ensure parameter is of type ParameterWithoutIn
|
|
42
|
+
acc[parameter.name] = (0, config_parser_1.getValueFromContext)(parameter.value, ctx);
|
|
43
|
+
return acc;
|
|
44
|
+
}, {});
|
|
45
|
+
workflowCtx.$workflows[resolvedWorkflow.workflowId].inputs = workflowInputParameters;
|
|
46
|
+
}
|
|
47
|
+
const stepWorkflowResult = await (0, runner_1.runWorkflow)({
|
|
48
|
+
workflowInput: resolvedWorkflow,
|
|
49
|
+
ctx: workflowCtx,
|
|
50
|
+
parentWorkflowId: workflowId || parentWorkflowId,
|
|
51
|
+
parentStepId: parentStepId || stepId,
|
|
52
|
+
});
|
|
53
|
+
// FIXME
|
|
54
|
+
if (stepWorkflowResult?.steps) {
|
|
55
|
+
const innerSteps = stepWorkflowResult.steps;
|
|
56
|
+
// merge all checks from all steps in executed workflow
|
|
57
|
+
step.checks = innerSteps.flatMap(({ checks }) => checks);
|
|
58
|
+
}
|
|
59
|
+
if (step?.outputs && stepWorkflowResult?.outputs) {
|
|
60
|
+
try {
|
|
61
|
+
for (const [outputKey, outputValue] of Object.entries(step.outputs)) {
|
|
62
|
+
// need to partially emulate $outputs context
|
|
63
|
+
step.outputs[outputKey] = (0, runtime_expressions_1.evaluateRuntimeExpressionPayload)({
|
|
64
|
+
payload: outputValue,
|
|
65
|
+
context: {
|
|
66
|
+
$outputs: stepWorkflowResult.outputs,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
const failedCall = {
|
|
73
|
+
name: checks_1.CHECKS.UNEXPECTED_ERROR,
|
|
74
|
+
message: error.message,
|
|
75
|
+
pass: false,
|
|
76
|
+
severity: ctx.severity['UNEXPECTED_ERROR'],
|
|
77
|
+
};
|
|
78
|
+
step.checks.push(failedCall);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
// save local $steps context
|
|
82
|
+
ctx.$steps[stepId] = {
|
|
83
|
+
outputs: step?.outputs,
|
|
84
|
+
};
|
|
85
|
+
// save local $steps context to parent workflow
|
|
86
|
+
if (workflow?.workflowId) {
|
|
87
|
+
ctx.$workflows[workflow.workflowId].steps[stepId] = {
|
|
88
|
+
outputs: step?.outputs,
|
|
89
|
+
request: undefined,
|
|
90
|
+
response: undefined,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return { shouldEnd: false };
|
|
95
|
+
}
|
|
96
|
+
if (resolvedParameters && resolvedParameters.length) {
|
|
97
|
+
// When the step in context does not specify a workflowId the `in` field MUST be specified.
|
|
98
|
+
const parameterWithoutIn = resolvedParameters.find((parameter) => {
|
|
99
|
+
const resolvedParameter = (0, config_parser_1.resolveReusableComponentItem)(parameter, ctx);
|
|
100
|
+
return !('in' in resolvedParameter);
|
|
101
|
+
});
|
|
102
|
+
if (parameterWithoutIn) {
|
|
103
|
+
throw new Error(`Parameter "in" is required for ${stepId} step parameter ${parameterWithoutIn.name}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
let allChecksPassed = false;
|
|
107
|
+
let requestData;
|
|
108
|
+
try {
|
|
109
|
+
if (!workflowName) {
|
|
110
|
+
throw new Error('Workflow name is required to run a step');
|
|
111
|
+
}
|
|
112
|
+
requestData = await (0, prepare_request_1.prepareRequest)(ctx, step, workflowName);
|
|
113
|
+
const checksResult = await (0, call_api_and_analyze_results_1.callAPIAndAnalyzeResults)({
|
|
114
|
+
ctx,
|
|
115
|
+
workflowName,
|
|
116
|
+
step,
|
|
117
|
+
requestData,
|
|
118
|
+
});
|
|
119
|
+
allChecksPassed = Object.values(checksResult).every((check) => check);
|
|
120
|
+
// we need to handle retry action separatelly as it should replace the current step state and should not log
|
|
121
|
+
if (failureActionsToRun.length && !allChecksPassed) {
|
|
122
|
+
const result = await runActions(failureActionsToRun, ['retry']);
|
|
123
|
+
if (result?.retriesLeft && result.retriesLeft > 0) {
|
|
124
|
+
// if retriesLeft > 0, it means that the step was retried successfully and we need
|
|
125
|
+
// to stop output logs and return step result to the outer workflow
|
|
126
|
+
return result.stepResult;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
catch (e) {
|
|
131
|
+
step.verboseLog = ctx.apiClient.getVerboseResponseLogs();
|
|
132
|
+
const failedCall = {
|
|
133
|
+
name: checks_1.CHECKS.UNEXPECTED_ERROR,
|
|
134
|
+
message: e.message,
|
|
135
|
+
pass: false,
|
|
136
|
+
severity: ctx.severity['UNEXPECTED_ERROR'],
|
|
137
|
+
};
|
|
138
|
+
step.checks.push(failedCall);
|
|
139
|
+
}
|
|
140
|
+
const verboseLogs = ctx.options.verbose ? ctx.apiClient.getVerboseLogs() : undefined;
|
|
141
|
+
const verboseResponseLogs = ctx.options.verbose
|
|
142
|
+
? ctx.apiClient.getVerboseResponseLogs()
|
|
143
|
+
: undefined;
|
|
144
|
+
const requestUrl = requestData?.path || requestData?.serverUrl?.url;
|
|
145
|
+
if (requestUrl) {
|
|
146
|
+
(0, cli_outputs_1.printStepDetails)({
|
|
147
|
+
testNameToDisplay: `${requestData?.method.toUpperCase()} ${(0, colorette_1.white)(requestUrl)}${step.stepId ? ` ${(0, colorette_1.blue)('- step')} ${(0, colorette_1.white)((0, colorette_1.bold)(step.stepId))}` : ''}`,
|
|
148
|
+
checks: step.checks,
|
|
149
|
+
verboseLogs,
|
|
150
|
+
verboseResponseLogs,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
// onFailure handle 'goto' and 'end'.
|
|
154
|
+
if (failureActionsToRun.length && !allChecksPassed) {
|
|
155
|
+
const result = await runActions(failureActionsToRun, ['end', 'goto']); // retry is handled earlier
|
|
156
|
+
if (result?.shouldEnd) {
|
|
157
|
+
return { shouldEnd: true };
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (successActionsToRun.length && allChecksPassed) {
|
|
161
|
+
const result = await runActions(successActionsToRun, ['end', 'goto']);
|
|
162
|
+
if (result?.shouldEnd) {
|
|
163
|
+
return { shouldEnd: true };
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
// Internal function to run actions
|
|
167
|
+
async function runActions(actions, onlyTypes) {
|
|
168
|
+
for (const action of actions) {
|
|
169
|
+
const { type, criteria } = action;
|
|
170
|
+
if (action.workflowId && action.stepId) {
|
|
171
|
+
throw new Error(`Cannot use both workflowId: ${action.workflowId} and stepId: ${action.stepId} in ${action.type} action`);
|
|
172
|
+
}
|
|
173
|
+
const matchesCriteria = (0, success_criteria_1.checkCriteria)({
|
|
174
|
+
workflowId: workflowName,
|
|
175
|
+
step,
|
|
176
|
+
criteria,
|
|
177
|
+
ctx,
|
|
178
|
+
}).every((check) => check.pass);
|
|
179
|
+
if (matchesCriteria) {
|
|
180
|
+
if (onlyTypes && !onlyTypes.includes(type)) {
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
const targetWorkflow = action.workflowId
|
|
184
|
+
? (0, config_parser_1.getValueFromContext)(action.workflowId, ctx)
|
|
185
|
+
: undefined;
|
|
186
|
+
const targetCtx = action.workflowId
|
|
187
|
+
? await (0, runner_1.resolveWorkflowContext)(action.workflowId, targetWorkflow, ctx)
|
|
188
|
+
: ctx;
|
|
189
|
+
const targetStep = action.stepId ? step.stepId : undefined;
|
|
190
|
+
if (type === 'retry') {
|
|
191
|
+
const { retryAfter, retryLimit = 0 } = action;
|
|
192
|
+
retriesLeft = retriesLeft ?? retryLimit;
|
|
193
|
+
if (retriesLeft === 0) {
|
|
194
|
+
return { retriesLeft: 0, shouldEnd: false };
|
|
195
|
+
}
|
|
196
|
+
await (0, delay_1.delay)(retryAfter);
|
|
197
|
+
logger.log(`\n Retrying step ${(0, colorette_1.blue)(stepId)} attempt # ${retryLimit - retriesLeft + 1}\n`);
|
|
198
|
+
if (targetWorkflow) {
|
|
199
|
+
await (0, runner_1.runWorkflow)({
|
|
200
|
+
workflowInput: targetWorkflow,
|
|
201
|
+
ctx: targetCtx,
|
|
202
|
+
parentWorkflowId: workflowName,
|
|
203
|
+
fromStepId: targetStep,
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
else if (targetStep) {
|
|
207
|
+
const stepToRun = workflow?.steps.find((s) => s.stepId === targetStep);
|
|
208
|
+
if (!stepToRun) {
|
|
209
|
+
throw new Error(`Step ${targetStep} not found in workflow ${workflowName}`);
|
|
210
|
+
}
|
|
211
|
+
await runStep({
|
|
212
|
+
step: stepToRun,
|
|
213
|
+
ctx: targetCtx,
|
|
214
|
+
workflowName: workflowName,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
return {
|
|
218
|
+
stepResult: await runStep({
|
|
219
|
+
step,
|
|
220
|
+
ctx,
|
|
221
|
+
workflowName,
|
|
222
|
+
parentStepId: stepId,
|
|
223
|
+
parentWorkflowId: workflowName,
|
|
224
|
+
retriesLeft: retriesLeft - 1,
|
|
225
|
+
}),
|
|
226
|
+
retriesLeft,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
else if (type === 'end') {
|
|
230
|
+
return { shouldEnd: true };
|
|
231
|
+
}
|
|
232
|
+
else if (type === 'goto') {
|
|
233
|
+
if (!targetWorkflow && !targetStep) {
|
|
234
|
+
throw new Error('Either workflowId or stepId must be provided in goto action');
|
|
235
|
+
}
|
|
236
|
+
await (0, runner_1.runWorkflow)({
|
|
237
|
+
workflowInput: targetWorkflow || workflow,
|
|
238
|
+
ctx: targetCtx,
|
|
239
|
+
parentWorkflowId: workflowName,
|
|
240
|
+
fromStepId: targetStep,
|
|
241
|
+
});
|
|
242
|
+
return { shouldEnd: true };
|
|
243
|
+
}
|
|
244
|
+
// stop at first matching action
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=run-step.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-step.js","sourceRoot":"","sources":["../../../src/modules/flow-runner/run-step.ts"],"names":[],"mappings":";;AA8BA,0BAuSC;AArUD,yCAAmD;AACnD,iFAA0E;AAC1E,yDAAmD;AACnD,6CAA0C;AAC1C,sCAAmC;AACnC,qCAA+D;AAC/D,uDAAqE;AACrE,yDAA2D;AAC3D,oDAI0B;AAC1B,gEAA0E;AAC1E,sDAA0D;AAc1D,MAAM,MAAM,GAAG,sBAAa,CAAC,WAAW,EAAE,CAAC;AAEpC,KAAK,UAAU,OAAO,CAAC,EAC5B,IAAI,EACJ,GAAG,EACH,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,WAAW,GAQZ;IACC,MAAM,QAAQ,GAAG,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,YAAY,CAAC,CAAC;IAC1E,MAAM,EAAE,MAAM,EAAE,SAAS,EA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AAC;oBACL,CAAC;oBACD,OAAO;wBACL,UAAU,EAAE,MAAM,OAAO,CAAC;4BACxB,IAAI;4BACJ,GAAG;4BACH,YAAY;4BACZ,YAAY,EAAE,MAAM;4BACpB,gBAAgB,EAAE,YAAY;4BAC9B,WAAW,EAAE,WAAW,GAAG,CAAC;yBAC7B,CAAC;wBACF,WAAW;qBACZ,CAAC;gBACJ,CAAC;qBAAM,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;oBAC1B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;gBAC7B,CAAC;qBAAM,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;oBAC3B,IAAI,CAAC,cAAc,IAAI,CAAC,UAAU,EAAE,CAAC;wBACnC,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;oBACjF,CAAC;oBACD,MAAM,IAAA,oBAAW,EAAC;wBAChB,aAAa,EAAE,cAAc,IAAI,QAAQ;wBACzC,GAAG,EAAE,SAAS;wBACd,gBAAgB,EAAE,YAAY;wBAC9B,UAAU,EAAE,UAAU;qBACvB,CAAC,CAAC;oBACH,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;gBAC7B,CAAC;gBACD,gCAAgC;gBAChC,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TestContext, RunArgv, Workflow, RunWorkflowInput } from '../../types';
|
|
2
|
+
export declare function runTestFile(argv: RunArgv, output: {
|
|
3
|
+
harFile?: string;
|
|
4
|
+
jsonFile?: string;
|
|
5
|
+
}): Promise<{
|
|
6
|
+
workflows: Workflow[];
|
|
7
|
+
parsedYaml: any;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function runWorkflow({ workflowInput, ctx, parentStepId, parentWorkflowId, fromStepId, }: RunWorkflowInput): Promise<Workflow | void>;
|
|
10
|
+
export declare function resolveWorkflowContext(workflowId: string | undefined, resolvedWorkflow: Workflow, ctx: TestContext): Promise<TestContext>;
|
|
11
|
+
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/modules/flow-runner/runner.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAGV,WAAW,EACX,OAAO,EACP,QAAQ,EAGR,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAIrB,wBAAsB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;;;GAuD/F;AAiCD,wBAAsB,WAAW,CAAC,EAChC,aAAa,EACb,GAAG,EACH,YAAY,EACZ,gBAAgB,EAChB,UAAU,GACX,EAAE,gBAAgB,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAiG7C;AA8BD,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,gBAAgB,EAAE,QAAQ,EAC1B,GAAG,EAAE,WAAW,wBA+BjB"}
|