@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,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getResponseSchema = getResponseSchema;
|
|
4
|
+
function getResponseSchema({ statusCode, contentType, descriptionResponses, }) {
|
|
5
|
+
if (!descriptionResponses)
|
|
6
|
+
return undefined;
|
|
7
|
+
const response = descriptionResponses[statusCode] || descriptionResponses.default;
|
|
8
|
+
return response?.content?.[contentType]?.schema;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=get-response-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-response-schema.js","sourceRoot":"","sources":["../../../src/modules/description-parser/get-response-schema.ts"],"names":[],"mappings":";;AAAA,8CAcC;AAdD,SAAgB,iBAAiB,CAAC,EAChC,UAAU,EACV,WAAW,EACX,oBAAoB,GAKrB;IACC,IAAI,CAAC,oBAAoB;QAAE,OAAO,SAAS,CAAC;IAE5C,MAAM,QAAQ,GAAG,oBAAoB,CAAC,UAAU,CAAC,IAAI,oBAAoB,CAAC,OAAO,CAAC;IAElF,OAAO,QAAQ,EAAE,OAAO,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './bundle-openapi';
|
|
2
|
+
export * from './get-request-data-from-openapi';
|
|
3
|
+
export * from './get-operation-from-description';
|
|
4
|
+
export * from './extract-first-example';
|
|
5
|
+
export * from './get-operation-by-id';
|
|
6
|
+
export * from './get-operation-by-path';
|
|
7
|
+
export * from './remove-write-only-properties';
|
|
8
|
+
export * from './get-response-schema';
|
|
9
|
+
export * from './get-request-body-schema';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/description-parser/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./bundle-openapi"), exports);
|
|
18
|
+
__exportStar(require("./get-request-data-from-openapi"), exports);
|
|
19
|
+
__exportStar(require("./get-operation-from-description"), exports);
|
|
20
|
+
__exportStar(require("./extract-first-example"), exports);
|
|
21
|
+
__exportStar(require("./get-operation-by-id"), exports);
|
|
22
|
+
__exportStar(require("./get-operation-by-path"), exports);
|
|
23
|
+
__exportStar(require("./remove-write-only-properties"), exports);
|
|
24
|
+
__exportStar(require("./get-response-schema"), exports);
|
|
25
|
+
__exportStar(require("./get-request-body-schema"), exports);
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/description-parser/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,kEAAgD;AAChD,mEAAiD;AACjD,0DAAwC;AACxC,wDAAsC;AACtC,0DAAwC;AACxC,iEAA+C;AAC/C,wDAAsC;AACtC,4DAA0C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-write-only-properties.d.ts","sourceRoot":"","sources":["../../../src/modules/description-parser/remove-write-only-properties.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CA2CzF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeWriteOnlyProperties = removeWriteOnlyProperties;
|
|
4
|
+
function removeWriteOnlyProperties(schema) {
|
|
5
|
+
const schemaCopy = JSON.parse(JSON.stringify(schema));
|
|
6
|
+
function filterWriteOnlyProps(schema) {
|
|
7
|
+
if (schema.type === 'object') {
|
|
8
|
+
if (schema.properties) {
|
|
9
|
+
for (const key in schema.properties) {
|
|
10
|
+
if (schema.properties[key].writeOnly) {
|
|
11
|
+
delete schema.properties[key];
|
|
12
|
+
if (schema.required) {
|
|
13
|
+
schema.required = schema.required.filter((prop) => prop !== key);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
filterWriteOnlyProps(schema.properties[key]);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (schema.additionalProperties && typeof schema.additionalProperties === 'object') {
|
|
22
|
+
filterWriteOnlyProps(schema.additionalProperties);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else if (schema.type === 'array' && schema.items) {
|
|
26
|
+
filterWriteOnlyProps(schema.items);
|
|
27
|
+
}
|
|
28
|
+
if (schema.oneOf) {
|
|
29
|
+
schema.oneOf = schema.oneOf.map((subSchema) => filterWriteOnlyProps(subSchema));
|
|
30
|
+
}
|
|
31
|
+
if (schema.allOf) {
|
|
32
|
+
schema.allOf = schema.allOf.map((subSchema) => filterWriteOnlyProps(subSchema));
|
|
33
|
+
}
|
|
34
|
+
if (schema.anyOf) {
|
|
35
|
+
schema.anyOf = schema.anyOf.map((subSchema) => filterWriteOnlyProps(subSchema));
|
|
36
|
+
}
|
|
37
|
+
return schema;
|
|
38
|
+
}
|
|
39
|
+
return filterWriteOnlyProps(schemaCopy);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=remove-write-only-properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-write-only-properties.js","sourceRoot":"","sources":["../../../src/modules/description-parser/remove-write-only-properties.ts"],"names":[],"mappings":";;AAEA,8DA2CC;AA3CD,SAAgB,yBAAyB,CAAI,MAAyB;IACpE,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAEtD,SAAS,oBAAoB,CAAC,MAAyB;QACrD,IAAI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CAC/D,oBAAoB,CAAC,SAA8B,CAAC,CACrD,CAAC;QACJ,CAAC;QACD,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,SAA4B,EAAE,EAAE,CAC/D,oBAAoB,CAAC,SAA8B,CAAC,CACrD,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
interface NumberOptions {
|
|
2
|
+
min?: number;
|
|
3
|
+
max?: number;
|
|
4
|
+
precision?: number;
|
|
5
|
+
}
|
|
6
|
+
interface FakeString {
|
|
7
|
+
email(options?: {
|
|
8
|
+
provider?: string;
|
|
9
|
+
domain?: string;
|
|
10
|
+
}): string;
|
|
11
|
+
userName(): string;
|
|
12
|
+
firstName(): string;
|
|
13
|
+
lastName(): string;
|
|
14
|
+
fullName(): string;
|
|
15
|
+
uuid(): string;
|
|
16
|
+
string(options?: {
|
|
17
|
+
length?: number;
|
|
18
|
+
}): string;
|
|
19
|
+
}
|
|
20
|
+
interface FakeDate {
|
|
21
|
+
past(): Date;
|
|
22
|
+
future(): Date;
|
|
23
|
+
}
|
|
24
|
+
interface FakeAddress {
|
|
25
|
+
city(): string;
|
|
26
|
+
country(): string;
|
|
27
|
+
zipCode(): string;
|
|
28
|
+
street(): string;
|
|
29
|
+
}
|
|
30
|
+
interface FakeNumber {
|
|
31
|
+
integer(options?: Omit<NumberOptions, 'precision'>): number;
|
|
32
|
+
float(options: NumberOptions): number;
|
|
33
|
+
}
|
|
34
|
+
export interface Faker {
|
|
35
|
+
address: FakeAddress;
|
|
36
|
+
date: FakeDate;
|
|
37
|
+
number: FakeNumber;
|
|
38
|
+
string: FakeString;
|
|
39
|
+
}
|
|
40
|
+
export declare function createFaker(): Faker;
|
|
41
|
+
export {};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AED,wBAAgB,WAAW,IAAI,KAAK,CAoCnC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createFaker = createFaker;
|
|
4
|
+
const faker_1 = require("@faker-js/faker");
|
|
5
|
+
function createFaker() {
|
|
6
|
+
const fakeString = {
|
|
7
|
+
email: ({ provider, domain = 'com' } = {}) => faker_1.faker.internet.email(undefined, undefined, `${provider}.${domain}`),
|
|
8
|
+
userName: () => faker_1.faker.internet.userName(),
|
|
9
|
+
firstName: () => faker_1.faker.name.firstName(),
|
|
10
|
+
lastName: () => faker_1.faker.name.lastName(),
|
|
11
|
+
fullName: () => faker_1.faker.name.fullName(),
|
|
12
|
+
uuid: () => faker_1.faker.datatype.uuid(),
|
|
13
|
+
string: ({ length } = {}) => faker_1.faker.datatype.string(length),
|
|
14
|
+
};
|
|
15
|
+
const fakeDate = {
|
|
16
|
+
past: () => faker_1.faker.date.past(),
|
|
17
|
+
future: () => faker_1.faker.date.future(),
|
|
18
|
+
};
|
|
19
|
+
const fakeAddress = {
|
|
20
|
+
city: () => faker_1.faker.address.city(),
|
|
21
|
+
country: () => faker_1.faker.address.country(),
|
|
22
|
+
zipCode: () => faker_1.faker.address.zipCode(),
|
|
23
|
+
street: () => faker_1.faker.address.street(),
|
|
24
|
+
};
|
|
25
|
+
const fakeNumber = {
|
|
26
|
+
integer: ({ min, max } = {}) => faker_1.faker.datatype.number({ min, max, precision: 1 }),
|
|
27
|
+
float: (options) => faker_1.faker.datatype.float(options),
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
address: fakeAddress,
|
|
31
|
+
date: fakeDate,
|
|
32
|
+
number: fakeNumber,
|
|
33
|
+
string: fakeString,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=faker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faker.js","sourceRoot":"","s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tC,MAAM,EAAE,GAAG,EAAE,CAAC,aAAK,CAAC,OAAO,CAAC,MAAM,EAAE;KACrC,CAAC;IAEF,MAAM,UAAU,GAAe;QAC7B,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,KAAuC,EAAE,EAAE,EAAE,CAC/D,aAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;QACnD,KAAK,EAAE,CAAC,OAAsB,EAAE,EAAE,CAAC,aAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC;KACjE,CAAC;IAEF,OAAO;QACL,OAAO,EAAE,WAAW;QACpB,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE,UAAU;KACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { RequestData } from './prepare-request';
|
|
2
|
+
import type { TestContext, Step } from '../../types';
|
|
3
|
+
import type { OperationDetails } from '../description-parser';
|
|
4
|
+
import type { ParameterWithIn } from '../config-parser';
|
|
5
|
+
export type ResultObject = {
|
|
6
|
+
ctx: TestContext;
|
|
7
|
+
workflowName: string;
|
|
8
|
+
step: Step;
|
|
9
|
+
requestData: {
|
|
10
|
+
serverUrl?: {
|
|
11
|
+
url: string;
|
|
12
|
+
};
|
|
13
|
+
path: string;
|
|
14
|
+
method: string;
|
|
15
|
+
parameters: ParameterWithIn[];
|
|
16
|
+
requestBody: any;
|
|
17
|
+
openapiOperation?: OperationDetails & Record<string, string>;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare function callAPIAndAnalyzeResults({ ctx, workflowName, step, requestData, }: {
|
|
21
|
+
ctx: TestContext;
|
|
22
|
+
workflowName: string;
|
|
23
|
+
step: Step;
|
|
24
|
+
requestData: RequestData;
|
|
25
|
+
}): Promise<{
|
|
26
|
+
successCriteriaCheck: boolean;
|
|
27
|
+
expectCheck: boolean;
|
|
28
|
+
networkCheck: boolean;
|
|
29
|
+
}>;
|
|
30
|
+
//# sourceMappingURL=call-api-and-analyze-results.d.ts.map
|
|
@@ -0,0 +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;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxD,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,WAAW,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,IAAI,CAAC;IACX,WAAW,EAAE;QACX,SAAS,CAAC,EAAE;YACV,GAAG,EAAE,MAAM,CAAC;SAEb,CAAC;QACF,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,eAAe,EAAE,CAAC;QAC9B,WAAW,EAAE,GAAG,CAAC;QACjB,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC9D,CAAC;CACH,CAAC;AAGF,wBAAsB,wBAAwB,CAAC,EAC7C,GAAG,EACH,YAAY,EACZ,IAAI,EACJ,WAAW,GACZ,EAAE;IACD,GAAG,EAAE,WAAW,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,IAAI,CAAC;IACX,WAAW,EAAE,WAAW,CAAC;CAC1B;;;;GAoGA"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.callAPIAndAnalyzeResults = callAPIAndAnalyzeResults;
|
|
4
|
+
const success_criteria_1 = require("./success-criteria");
|
|
5
|
+
const schema_1 = require("./schema");
|
|
6
|
+
const checks_1 = require("../checks");
|
|
7
|
+
const context_1 = require("./context");
|
|
8
|
+
const runtime_expressions_1 = require("../runtime-expressions");
|
|
9
|
+
// TODO: split into two functions
|
|
10
|
+
async function callAPIAndAnalyzeResults({ ctx, workflowName, step, requestData, }) {
|
|
11
|
+
// clear checks in case of retry
|
|
12
|
+
step.checks = [];
|
|
13
|
+
const checksResult = {
|
|
14
|
+
successCriteriaCheck: true,
|
|
15
|
+
expectCheck: true,
|
|
16
|
+
networkCheck: true,
|
|
17
|
+
};
|
|
18
|
+
try {
|
|
19
|
+
step.response = await ctx.apiClient.fetchResult(ctx, requestData);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
step.checks.push({
|
|
23
|
+
name: checks_1.CHECKS.NETWORK_ERROR,
|
|
24
|
+
pass: false,
|
|
25
|
+
message: error.message,
|
|
26
|
+
severity: ctx.severity['NETWORK_ERROR'],
|
|
27
|
+
});
|
|
28
|
+
checksResult.networkCheck = false;
|
|
29
|
+
return checksResult;
|
|
30
|
+
}
|
|
31
|
+
const request = ctx.$workflows[workflowName].steps[step.stepId].request;
|
|
32
|
+
// store step level outputs
|
|
33
|
+
if (step.outputs) {
|
|
34
|
+
const runtimeExpressionContext = (0, context_1.createRuntimeExpressionCtx)({
|
|
35
|
+
ctx: {
|
|
36
|
+
...ctx,
|
|
37
|
+
...{
|
|
38
|
+
$request: request,
|
|
39
|
+
$response: step.response,
|
|
40
|
+
$inputs: ctx.$workflows[workflowName].inputs,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
workflowId: workflowName,
|
|
44
|
+
step,
|
|
45
|
+
});
|
|
46
|
+
if (step.outputs) {
|
|
47
|
+
for (const outputKey of Object.keys(step.outputs)) {
|
|
48
|
+
step.outputs[outputKey] = (0, runtime_expressions_1.evaluateRuntimeExpressionPayload)({
|
|
49
|
+
payload: step.outputs[outputKey],
|
|
50
|
+
context: runtimeExpressionContext,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
step.verboseLog = ctx.apiClient.getVerboseResponseLogs();
|
|
56
|
+
if (step.successCriteria) {
|
|
57
|
+
const successCriteriaChecks = (0, success_criteria_1.checkCriteria)({
|
|
58
|
+
workflowId: workflowName,
|
|
59
|
+
step,
|
|
60
|
+
criteria: step.successCriteria,
|
|
61
|
+
ctx: {
|
|
62
|
+
...ctx,
|
|
63
|
+
...{
|
|
64
|
+
$request: request,
|
|
65
|
+
$response: step.response,
|
|
66
|
+
$inputs: ctx.$workflows[workflowName].inputs,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
checksResult.successCriteriaCheck = successCriteriaChecks.every((check) => check.pass);
|
|
71
|
+
step.checks.push(...successCriteriaChecks);
|
|
72
|
+
}
|
|
73
|
+
const schemaChecks = (0, schema_1.checkSchema)({
|
|
74
|
+
stepCallCtx: {
|
|
75
|
+
$request: request,
|
|
76
|
+
$response: step.response,
|
|
77
|
+
$inputs: ctx.$workflows[workflowName].inputs,
|
|
78
|
+
},
|
|
79
|
+
descriptionOperation: requestData.openapiOperation,
|
|
80
|
+
ctx,
|
|
81
|
+
});
|
|
82
|
+
if (schemaChecks.length) {
|
|
83
|
+
checksResult.expectCheck = schemaChecks.every((check) => check.pass);
|
|
84
|
+
step.checks.push(...schemaChecks);
|
|
85
|
+
}
|
|
86
|
+
// save local $steps context
|
|
87
|
+
ctx.$steps[step.stepId] = {
|
|
88
|
+
outputs: ctx.$steps[step.stepId].outputs
|
|
89
|
+
? { ...ctx.$steps[step.stepId].outputs, ...step.outputs }
|
|
90
|
+
: step.outputs,
|
|
91
|
+
};
|
|
92
|
+
// save $workflows context
|
|
93
|
+
ctx.$workflows[workflowName].steps[step.stepId] = {
|
|
94
|
+
outputs: ctx.$steps[step.stepId].outputs,
|
|
95
|
+
request,
|
|
96
|
+
response: step.response,
|
|
97
|
+
};
|
|
98
|
+
return checksResult;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=call-api-and-analyze-results.js.map
|
|
@@ -0,0 +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":";;AA8BA,4DA8GC;AA5ID,yDAAmD;AACnD,qCAAuC;AACvC,sCAAmC;AACnC,uCAAuD;AACvD,gEAA0E;AAyB1E,iCAAiC;AAC1B,KAAK,UAAU,wBAAwB,CAAC,EAC7C,GAAG,EACH,YAAY,EACZ,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,IAAI,EAAE,KAAK;YACX,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,YAAY,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;IAExE,2BAA2B;IAC3B,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type { RuntimeExpressionContext, Step, TestContext } from '../../../types';
|
|
2
|
+
export declare function createRuntimeExpressionCtx({ ctx, workflowId, step, }: {
|
|
3
|
+
ctx: TestContext;
|
|
4
|
+
workflowId?: string;
|
|
5
|
+
step?: Step;
|
|
6
|
+
}): RuntimeExpressionContext;
|
|
7
|
+
//# sourceMappingURL=create-runtime-expression-ctx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-runtime-expression-ctx.d.ts","sourceRoot":"","sources":["../../../../src/modules/flow-runner/context/create-runtime-expression-ctx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlF,wBAAgB,0BAA0B,CAAC,EACzC,GAAG,EACH,UAAU,EACV,IAAI,GACL,EAAE;IACD,GAAG,EAAE,WAAW,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,GAAG,wBAAwB,CAqD3B"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createRuntimeExpressionCtx = createRuntimeExpressionCtx;
|
|
4
|
+
// import type { OperationDetails } from '../../description-parser';
|
|
5
|
+
function createRuntimeExpressionCtx({ ctx, workflowId, step, }) {
|
|
6
|
+
if (!step || !workflowId) {
|
|
7
|
+
return {
|
|
8
|
+
$statusCode: undefined,
|
|
9
|
+
$method: '',
|
|
10
|
+
$response: undefined,
|
|
11
|
+
$url: '',
|
|
12
|
+
$request: undefined,
|
|
13
|
+
$outputs: ctx.$outputs,
|
|
14
|
+
$steps: ctx.$steps,
|
|
15
|
+
$workflows: ctx.$workflows,
|
|
16
|
+
$inputs: ctx.$inputs,
|
|
17
|
+
$sourceDescriptions: ctx.$sourceDescriptions,
|
|
18
|
+
$components: ctx.$components,
|
|
19
|
+
$faker: ctx.$faker,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const request = ctx.$workflows[workflowId].steps[step.stepId].request;
|
|
23
|
+
const requestPathParameters = request?.path;
|
|
24
|
+
const requestQueryParameters = request?.query;
|
|
25
|
+
const requestBody = request?.body || {};
|
|
26
|
+
const requestHeaders = request?.header;
|
|
27
|
+
const method = request?.method;
|
|
28
|
+
const resultStatusCode = step.response?.statusCode;
|
|
29
|
+
const responseHeaders = step.response?.header || {};
|
|
30
|
+
const responseBody = step.response?.body || {};
|
|
31
|
+
return {
|
|
32
|
+
$statusCode: resultStatusCode,
|
|
33
|
+
$method: method,
|
|
34
|
+
$response: {
|
|
35
|
+
header: responseHeaders,
|
|
36
|
+
body: responseBody,
|
|
37
|
+
path: requestPathParameters,
|
|
38
|
+
query: requestQueryParameters,
|
|
39
|
+
},
|
|
40
|
+
$url: request && request.url,
|
|
41
|
+
$request: {
|
|
42
|
+
header: requestHeaders,
|
|
43
|
+
body: requestBody,
|
|
44
|
+
path: requestPathParameters,
|
|
45
|
+
query: requestQueryParameters,
|
|
46
|
+
},
|
|
47
|
+
$outputs: ctx.$outputs,
|
|
48
|
+
$steps: ctx.$steps,
|
|
49
|
+
$workflows: ctx.$workflows,
|
|
50
|
+
$inputs: ctx.$inputs,
|
|
51
|
+
$sourceDescriptions: ctx.$sourceDescriptions,
|
|
52
|
+
$components: ctx.$components,
|
|
53
|
+
$faker: ctx.$faker,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=create-runtime-expression-ctx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-runtime-expression-ctx.js","sourceRoot":"","sources":["../../../../src/modules/flow-runner/context/create-runtime-expression-ctx.ts"],"names":[],"mappings":";;AAGA,gEA6DC;AA/DD,oEAAoE;AAEpE,SAAgB,0BAA0B,CAAC,EACzC,GAAG,EACH,UAAU,EACV,IAAI,GAKL;IACC,IAAI,CAAC,IAAI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D,IAAI,EAAE,OAAO,IAAI,OAAO,CAAC,GAAG;QAC5B,QAAQ,EAAE;YACR,MAAM,EAAE,cAAc;YACtB,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,qBAAqB;YAC3B,KAAK,EAAE,sBAAsB;SAC9B;QACD,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,mBAAmB,EAAE,GAAG,CAAC,mBAAmB;QAC5C,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,MAAM,EAAE,GAAG,CAAC,MAAM;KACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type TestDescription, type AppOptions, type TestContext, type InputSchema } from '../../../types';
|
|
2
|
+
import { type ApiFetcher } from '../../../utils/api-fetcher';
|
|
3
|
+
export declare function createTestContext(testDescription: TestDescription, options: AppOptions, apiClient: ApiFetcher): Promise<TestContext>;
|
|
4
|
+
export declare function collectSecretFields(ctx: TestContext, schema: InputSchema | undefined, inputs: Record<string, any> | undefined, path?: string[]): void;
|
|
5
|
+
//# sourceMappingURL=create-test-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-test-context.d.ts","sourceRoot":"","sources":["../../../../src/modules/flow-runner/context/create-test-context.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAkB7D,wBAAsB,iBAAiB,CACrC,eAAe,EAAE,eAAe,EAChC,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,UAAU,GACpB,OAAO,CAAC,WAAW,CAAC,CAqEtB;AAED,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,EACvC,IAAI,GAAE,MAAM,EAAO,QAgBpB"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTestContext = createTestContext;
|
|
4
|
+
exports.collectSecretFields = collectSecretFields;
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const description_parser_1 = require("../../description-parser");
|
|
7
|
+
const faker_1 = require("../../faker");
|
|
8
|
+
const test_config_generator_1 = require("../../test-config-generator");
|
|
9
|
+
const inputs_1 = require("../inputs");
|
|
10
|
+
const get_test_description_from_file_1 = require("../get-test-description-from-file");
|
|
11
|
+
const read_env_variables_1 = require("../read-env-variables");
|
|
12
|
+
const get_nested_value_1 = require("../../../utils/get-nested-value");
|
|
13
|
+
const set_public_workflows_1 = require("./set-public-workflows");
|
|
14
|
+
const resolve_mtls_certificates_1 = require("../../../utils/mtls/resolve-mtls-certificates");
|
|
15
|
+
const checks_1 = require("../../checks");
|
|
16
|
+
const faker = (0, faker_1.createFaker)();
|
|
17
|
+
async function createTestContext(testDescription, options, apiClient) {
|
|
18
|
+
const sourceDescriptions = testDescription?.sourceDescriptions;
|
|
19
|
+
const bundledDescriptions = {};
|
|
20
|
+
if (sourceDescriptions) {
|
|
21
|
+
await Promise.all(sourceDescriptions.map(async (sourceDescription) => {
|
|
22
|
+
if (sourceDescription.type === 'openapi') {
|
|
23
|
+
bundledDescriptions[sourceDescription.name] = await (0, description_parser_1.bundleOpenApi)(sourceDescription.url, options.workflowPath);
|
|
24
|
+
}
|
|
25
|
+
else if (sourceDescription.type === 'arazzo') {
|
|
26
|
+
const { url: sourceDescriptionPath, name } = sourceDescription;
|
|
27
|
+
const filePath = (0, node_path_1.resolve)((0, node_path_1.dirname)(options.workflowPath), sourceDescriptionPath);
|
|
28
|
+
const bundledTestDescription = await (0, get_test_description_from_file_1.bundleArazzo)(filePath);
|
|
29
|
+
bundledDescriptions[name] = bundledTestDescription;
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
for (const workflow of testDescription.workflows || []) {
|
|
34
|
+
for (const step of workflow.steps) {
|
|
35
|
+
step.checks = []; // we are mutating the copy of the arazzo file
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const ctx = {
|
|
39
|
+
$response: undefined,
|
|
40
|
+
$request: undefined,
|
|
41
|
+
$inputs: { env: {} },
|
|
42
|
+
$faker: faker,
|
|
43
|
+
$sourceDescriptions: bundledDescriptions,
|
|
44
|
+
$workflows: (0, set_public_workflows_1.getPublicWorkflows)({
|
|
45
|
+
workflows: testDescription.workflows || [],
|
|
46
|
+
inputs: (0, inputs_1.formatCliInputs)(options?.input),
|
|
47
|
+
env: (0, read_env_variables_1.readEnvVariables)(options.workflowPath) || {},
|
|
48
|
+
}),
|
|
49
|
+
$steps: {},
|
|
50
|
+
$components: testDescription.components || {},
|
|
51
|
+
$outputs: {},
|
|
52
|
+
workflows: testDescription.workflows || [],
|
|
53
|
+
harLogs: {},
|
|
54
|
+
options,
|
|
55
|
+
testDescription,
|
|
56
|
+
info: testDescription.info || test_config_generator_1.infoSubstitute,
|
|
57
|
+
arazzo: testDescription.arazzo || '',
|
|
58
|
+
sourceDescriptions: testDescription.sourceDescriptions || [],
|
|
59
|
+
secretFields: new Set(),
|
|
60
|
+
mtlsCerts: options.mutualTls?.clientCert || options.mutualTls?.clientKey || options.mutualTls?.caCert
|
|
61
|
+
? (0, resolve_mtls_certificates_1.resolveMtlsCertificates)(options.mutualTls)
|
|
62
|
+
: undefined,
|
|
63
|
+
severity: (0, checks_1.resolveSeverityConfiguration)(options.severity),
|
|
64
|
+
apiClient,
|
|
65
|
+
};
|
|
66
|
+
// Collect all secret fields from the input schema and the workflow inputs
|
|
67
|
+
for (const workflow of testDescription.workflows || []) {
|
|
68
|
+
if (workflow.inputs) {
|
|
69
|
+
collectSecretFields(ctx, workflow.inputs, ctx.$workflows[workflow.workflowId].inputs);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return ctx;
|
|
73
|
+
}
|
|
74
|
+
function collectSecretFields(ctx, schema, inputs, path = []) {
|
|
75
|
+
if (!schema || !inputs)
|
|
76
|
+
return;
|
|
77
|
+
const inputValue = (0, get_nested_value_1.getNestedValue)(inputs, path);
|
|
78
|
+
if (schema.format === 'password' && inputValue) {
|
|
79
|
+
ctx.secretFields?.add(inputValue);
|
|
80
|
+
}
|
|
81
|
+
if (schema.properties) {
|
|
82
|
+
Object.entries(schema.properties).forEach(([key, value]) => {
|
|
83
|
+
const currentPath = [...path, key];
|
|
84
|
+
collectSecretFields(ctx, value, inputs, currentPath);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=create-test-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-test-context.js","sourceRoot":"","sources":["../../../../src/modules/flow-runner/context/create-test-context.ts"],"names":[],"mappings":";;AAyBA,8CAyEC;AAED,kDAoBC;AAxHD,yCAA6C;AAQ7C,iEAAyD;AACzD,uCAA0C;AAC1C,uEAA6D;AAC7D,sCAA4C;AAC5C,sFAAiE;AACjE,8DAAyD;AACzD,sEAAiE;AACjE,iEAA4D;AAC5D,6FAAwF;AACxF,yCAA4D;AAE5D,MAAM,KAAK,GAAG,IAAA,mBAAW,GAAE,CAAC;AAMrB,KAAK,UAAU,iBAAiB,CACrC,eAAgC,EAChC,OAAmB,EACnB,SAAqB;IAErB,MAAM,kBAAkB,GAAG,eAAe,EAAE,kBAAkB,CAAC;IAE/D,MAAM,mBAAmB,GAAG,EAAkB,CAAC;IAE/C,IAAI,kBAAkB,EAAE,CAAC;QACvB,MAAM,OAAO,CAAC,GAAG,CACf,kBAAkB,CAAC,GAA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AA,iCAAc,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAEhD,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU,IAAI,UAAU,EAAE,CAAC;QAC/C,GAAG,CAAC,YAAY,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QACtB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAgB,EAAE,EAAE;YACxE,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC,CAAC;YACnC,mBAAmB,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/flow-runner/context/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./create-test-context"), exports);
|
|
18
|
+
__exportStar(require("./set-public-steps"), exports);
|
|
19
|
+
__exportStar(require("./set-public-workflows"), exports);
|
|
20
|
+
__exportStar(require("./create-runtime-expression-ctx"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/flow-runner/context/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,qDAAmC;AACnC,yDAAuC;AACvC,kEAAgD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-public-steps.d.ts","sourceRoot":"","sources":["../../../../src/modules/flow-runner/context/set-public-steps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,wBAAgB,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAQjE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPublicSteps = getPublicSteps;
|
|
4
|
+
function getPublicSteps(steps) {
|
|
5
|
+
const publicSteps = {};
|
|
6
|
+
for (const step of steps) {
|
|
7
|
+
publicSteps[step.stepId] = {};
|
|
8
|
+
}
|
|
9
|
+
return publicSteps;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=set-public-steps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-public-steps.js","sourceRoot":"","sources":["../../../../src/modules/flow-runner/context/set-public-steps.ts"],"names":[],"mappings":";;AAEA,wCAQC;AARD,SAAgB,cAAc,CAAC,KAAa;IAC1C,MAAM,WAAW,GAAG,EAAyB,CAAC;IAE9C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;IAChC,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Workflow, PublicWorkflow } from '../../../types';
|
|
2
|
+
export declare function getPublicWorkflows({ workflows, inputs, env, }: {
|
|
3
|
+
workflows: Workflow[];
|
|
4
|
+
inputs: Record<string, string>;
|
|
5
|
+
env: Record<string, string>;
|
|
6
|
+
}): Record<string, PublicWorkflow>;
|
|
7
|
+
//# sourceMappingURL=set-public-workflows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-public-workflows.d.ts","sourceRoot":"","sources":["../../../../src/modules/flow-runner/context/set-public-workflows.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAe,MAAM,gBAAgB,CAAC;AAE5E,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,MAAM,EACN,GAAQ,GACT,EAAE;IACD,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAiCjC"}
|