@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,243 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ApiFetcher = void 0;
|
|
7
|
+
exports.normalizeHeaders = normalizeHeaders;
|
|
8
|
+
exports.isJsonContentType = isJsonContentType;
|
|
9
|
+
exports.isXmlContentType = isXmlContentType;
|
|
10
|
+
exports.trimTrailingSlash = trimTrailingSlash;
|
|
11
|
+
const undici_1 = require("undici");
|
|
12
|
+
const colorette_1 = require("colorette");
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
14
|
+
// @ts-ignore this works but some types are not working
|
|
15
|
+
const concat_stream_1 = __importDefault(require("concat-stream"));
|
|
16
|
+
const har_logs_1 = require("../utils/har-logs");
|
|
17
|
+
const is_empty_1 = require("./is-empty");
|
|
18
|
+
const config_parser_1 = require("../modules/config-parser");
|
|
19
|
+
const cli_output_1 = require("../modules/cli-output");
|
|
20
|
+
const description_parser_1 = require("../modules/description-parser");
|
|
21
|
+
const flow_runner_1 = require("../modules/flow-runner");
|
|
22
|
+
const create_mtls_client_1 = require("./mtls/create-mtls-client");
|
|
23
|
+
const logger_1 = require("./logger/logger");
|
|
24
|
+
const logger = logger_1.DefaultLogger.getInstance();
|
|
25
|
+
const MAX_FETCH_TIMEOUT = 20000;
|
|
26
|
+
function normalizeHeaders(headers) {
|
|
27
|
+
if (!headers) {
|
|
28
|
+
return {};
|
|
29
|
+
}
|
|
30
|
+
const headersToReturn = {};
|
|
31
|
+
for (const key in headers) {
|
|
32
|
+
const lowerCaseKey = key.toLowerCase();
|
|
33
|
+
// Only add the first occurrence of any header (case-insensitive)
|
|
34
|
+
if (!headersToReturn[lowerCaseKey]) {
|
|
35
|
+
headersToReturn[lowerCaseKey] = headers[key];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return headersToReturn;
|
|
39
|
+
}
|
|
40
|
+
function isJsonContentType(contentType) {
|
|
41
|
+
return /^application\/([a-z.-]+\+)?json$/.test(contentType);
|
|
42
|
+
}
|
|
43
|
+
function isXmlContentType(contentType) {
|
|
44
|
+
return /^application\/([a-z.-]+\+)?xml$/.test(contentType);
|
|
45
|
+
}
|
|
46
|
+
function trimTrailingSlash(str) {
|
|
47
|
+
return str.endsWith('/') ? str.slice(0, -1) : str;
|
|
48
|
+
}
|
|
49
|
+
class ApiFetcher {
|
|
50
|
+
verboseLogs;
|
|
51
|
+
verboseResponseLogs;
|
|
52
|
+
harLogs;
|
|
53
|
+
fetch;
|
|
54
|
+
constructor(params) {
|
|
55
|
+
this.harLogs = params.harLogs;
|
|
56
|
+
this.fetch = params.fetch || undici_1.fetch;
|
|
57
|
+
}
|
|
58
|
+
initVerboseLogs = ({ headerParams, host, path, method, body }) => {
|
|
59
|
+
this.verboseLogs = (0, cli_output_1.getVerboseLogs)({
|
|
60
|
+
headerParams,
|
|
61
|
+
host,
|
|
62
|
+
path,
|
|
63
|
+
method,
|
|
64
|
+
body: JSON.stringify(body),
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
getVerboseLogs = () => {
|
|
68
|
+
return this.verboseLogs;
|
|
69
|
+
};
|
|
70
|
+
initVerboseResponseLogs = ({ headerParams, host, path, method, body, statusCode, responseTime, }) => {
|
|
71
|
+
this.verboseResponseLogs = (0, cli_output_1.getVerboseLogs)({
|
|
72
|
+
headerParams,
|
|
73
|
+
host,
|
|
74
|
+
path,
|
|
75
|
+
method,
|
|
76
|
+
body,
|
|
77
|
+
statusCode,
|
|
78
|
+
responseTime,
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
getVerboseResponseLogs = () => {
|
|
82
|
+
return this.verboseResponseLogs;
|
|
83
|
+
};
|
|
84
|
+
fetchResult = async (ctx, requestData) => {
|
|
85
|
+
const { serverUrl, path, method, parameters, requestBody, openapiOperation } = requestData;
|
|
86
|
+
if (!serverUrl?.url) {
|
|
87
|
+
logger.error((0, colorette_1.bgRed)(` No server url provided `));
|
|
88
|
+
throw new Error('No server url provided');
|
|
89
|
+
}
|
|
90
|
+
const headers = {};
|
|
91
|
+
const searchParams = new URLSearchParams();
|
|
92
|
+
const pathParams = {};
|
|
93
|
+
const cookies = {};
|
|
94
|
+
for (const param of parameters) {
|
|
95
|
+
switch (param.in) {
|
|
96
|
+
case 'header':
|
|
97
|
+
headers[param.name.toLowerCase()] = String(param.value);
|
|
98
|
+
break;
|
|
99
|
+
case 'query':
|
|
100
|
+
searchParams.set(param.name, String(param.value));
|
|
101
|
+
break;
|
|
102
|
+
case 'path':
|
|
103
|
+
pathParams[param.name] = String(param.value);
|
|
104
|
+
break;
|
|
105
|
+
case 'cookie':
|
|
106
|
+
cookies[param.name] = String(param.value);
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (typeof requestBody === 'object' && !headers['content-type']) {
|
|
111
|
+
headers['content-type'] = 'application/json';
|
|
112
|
+
}
|
|
113
|
+
let resolvedPath = (0, config_parser_1.resolvePath)(path, pathParams) || '';
|
|
114
|
+
const pathWithSearchParams = `${resolvedPath}${searchParams.toString() ? '?' + searchParams.toString() : ''}`;
|
|
115
|
+
const pathToFetch = `${trimTrailingSlash(serverUrl.url)}${pathWithSearchParams}`;
|
|
116
|
+
if (pathToFetch.startsWith('/')) {
|
|
117
|
+
logger.error((0, colorette_1.bgRed)(` Wrong url: ${(0, colorette_1.inverse)(pathToFetch)} `) +
|
|
118
|
+
` Did you forget to provide a correct "serverUrl"?\n`);
|
|
119
|
+
}
|
|
120
|
+
const contentType = headers['content-type'] || '';
|
|
121
|
+
if (requestBody && !contentType) {
|
|
122
|
+
logger.error((0, colorette_1.bgRed)(` Incorrect request `) +
|
|
123
|
+
` Please provide a correct "content-type" header or specify the "content-type" field in the test case itself. \n`);
|
|
124
|
+
}
|
|
125
|
+
let encodedBody;
|
|
126
|
+
if (contentType === 'application/x-www-form-urlencoded') {
|
|
127
|
+
encodedBody = new URLSearchParams(requestBody).toString();
|
|
128
|
+
}
|
|
129
|
+
else if (isJsonContentType(contentType || '')) {
|
|
130
|
+
encodedBody = JSON.stringify(requestBody);
|
|
131
|
+
}
|
|
132
|
+
else if (isXmlContentType(contentType)) {
|
|
133
|
+
encodedBody = requestBody;
|
|
134
|
+
}
|
|
135
|
+
else if (contentType.includes('multipart/form-data')) {
|
|
136
|
+
// Get the form data buffer
|
|
137
|
+
encodedBody = await new Promise((resolve, reject) => {
|
|
138
|
+
requestBody.pipe((0, concat_stream_1.default)((data) => {
|
|
139
|
+
resolve(data);
|
|
140
|
+
}));
|
|
141
|
+
requestBody.on('error', reject);
|
|
142
|
+
});
|
|
143
|
+
// Ensure the content-type header includes the boundary
|
|
144
|
+
headers['content-type'] = `multipart/form-data; boundary=${requestBody._boundary}`;
|
|
145
|
+
}
|
|
146
|
+
else if (contentType === 'application/octet-stream') {
|
|
147
|
+
// Convert ReadStream to Blob for undici fetch
|
|
148
|
+
encodedBody = await new Promise((resolve, reject) => {
|
|
149
|
+
const chunks = [];
|
|
150
|
+
requestBody.on('data', (chunk) => {
|
|
151
|
+
chunks.push(new Uint8Array(chunk.buffer));
|
|
152
|
+
});
|
|
153
|
+
requestBody.on('end', () => resolve(Buffer.concat(chunks)));
|
|
154
|
+
requestBody.on('error', reject);
|
|
155
|
+
});
|
|
156
|
+
const fileName = requestBody.path.split('/').pop();
|
|
157
|
+
headers['content-disposition'] = `attachment; filename=${fileName}`;
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
encodedBody = requestBody;
|
|
161
|
+
}
|
|
162
|
+
// Mask the secrets in the header params and the body
|
|
163
|
+
const maskedHeaderParams = (0, cli_output_1.maskSecrets)(headers, ctx.secretFields || new Set());
|
|
164
|
+
const maskedBody = isJsonContentType(contentType) && encodedBody
|
|
165
|
+
? (0, cli_output_1.maskSecrets)(JSON.parse(encodedBody), ctx.secretFields || new Set())
|
|
166
|
+
: encodedBody;
|
|
167
|
+
const maskedPathParams = (0, cli_output_1.maskSecrets)(pathWithSearchParams, ctx.secretFields || new Set());
|
|
168
|
+
// Start of the verbose logs
|
|
169
|
+
this.initVerboseLogs({
|
|
170
|
+
headerParams: maskedHeaderParams,
|
|
171
|
+
host: serverUrl.url,
|
|
172
|
+
method: (method || 'get').toUpperCase(),
|
|
173
|
+
path: maskedPathParams || '',
|
|
174
|
+
body: maskedBody,
|
|
175
|
+
});
|
|
176
|
+
const wrappedFetch = this.harLogs ? (0, har_logs_1.withHar)(this.fetch, { har: this.harLogs }) : undici_1.fetch;
|
|
177
|
+
// Resolve pathToFetch with pathParams for the second time in order
|
|
178
|
+
// to handle described servers->variables in the OpenAPI spec.
|
|
179
|
+
// E.G.:
|
|
180
|
+
// servers:
|
|
181
|
+
// - url: 'https://api-sandbox.redocly.com/organizations/{organizationId}'
|
|
182
|
+
// TODO: remove/update after the support of the described servers->variables in the Arazzo spec.
|
|
183
|
+
resolvedPath = (0, config_parser_1.resolvePath)(pathToFetch, pathParams) || '';
|
|
184
|
+
if (!resolvedPath) {
|
|
185
|
+
throw new Error('Path to fetch is undefined');
|
|
186
|
+
}
|
|
187
|
+
const startTime = performance.now();
|
|
188
|
+
const result = await wrappedFetch(resolvedPath, {
|
|
189
|
+
method: (method || 'get').toUpperCase(),
|
|
190
|
+
headers,
|
|
191
|
+
...(!(0, is_empty_1.isEmpty)(requestBody) && {
|
|
192
|
+
body: encodedBody,
|
|
193
|
+
}),
|
|
194
|
+
redirect: 'follow',
|
|
195
|
+
signal: AbortSignal.timeout(MAX_FETCH_TIMEOUT),
|
|
196
|
+
// Required for application/octet-stream content type requests
|
|
197
|
+
...(headers['content-type'] === 'application/octet-stream' && {
|
|
198
|
+
duplex: 'half',
|
|
199
|
+
}),
|
|
200
|
+
dispatcher: ctx.mtlsCerts ? (0, create_mtls_client_1.createMtlsClient)(resolvedPath, ctx.mtlsCerts) : undefined,
|
|
201
|
+
});
|
|
202
|
+
const responseTime = Math.ceil(performance.now() - startTime);
|
|
203
|
+
const res = await result.text();
|
|
204
|
+
const [responseContentType] = result.headers.get('content-type')?.split(';') || [
|
|
205
|
+
'application/json',
|
|
206
|
+
];
|
|
207
|
+
const transformedBody = res
|
|
208
|
+
? isJsonContentType(responseContentType)
|
|
209
|
+
? JSON.parse(res)
|
|
210
|
+
: res
|
|
211
|
+
: {};
|
|
212
|
+
const responseSchema = (0, description_parser_1.getResponseSchema)({
|
|
213
|
+
statusCode: result.status,
|
|
214
|
+
contentType: responseContentType,
|
|
215
|
+
descriptionResponses: openapiOperation?.responses,
|
|
216
|
+
});
|
|
217
|
+
(0, flow_runner_1.collectSecretFields)(ctx, responseSchema, transformedBody);
|
|
218
|
+
const maskedResponseBody = isJsonContentType(responseContentType)
|
|
219
|
+
? (0, cli_output_1.maskSecrets)(transformedBody, ctx.secretFields || new Set())
|
|
220
|
+
: transformedBody;
|
|
221
|
+
this.initVerboseResponseLogs({
|
|
222
|
+
body: isJsonContentType(responseContentType)
|
|
223
|
+
? JSON.stringify(maskedResponseBody)
|
|
224
|
+
: maskedResponseBody,
|
|
225
|
+
method: (method || 'get'),
|
|
226
|
+
host: serverUrl.url,
|
|
227
|
+
path: pathWithSearchParams || '',
|
|
228
|
+
statusCode: result.status,
|
|
229
|
+
responseTime,
|
|
230
|
+
});
|
|
231
|
+
return {
|
|
232
|
+
body: transformedBody,
|
|
233
|
+
statusCode: result.status,
|
|
234
|
+
time: responseTime,
|
|
235
|
+
header: Object.fromEntries(result.headers?.entries() || []),
|
|
236
|
+
contentType: responseContentType,
|
|
237
|
+
query: Object.fromEntries(searchParams.entries()),
|
|
238
|
+
path: pathParams,
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
exports.ApiFetcher = ApiFetcher;
|
|
243
|
+
//# sourceMappingURL=api-fetcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-fetcher.js","sourceRoot":"","sources":["../../src/utils/api-fetcher.ts"],"names":[],"mappings":";;;;;;AAiCA,4CAiBC;AAED,8CAEC;AAED,4CAEC;AAED,8CAEC;AA9DD,mCAA+B;AAC/B,yCAA2C;AAC3C,6DAA6D;AAC7D,uDAAuD;AACvD,kEAAmC;AAOnC,gDAA4C;AAC5C,yCAAqC;AACrC,4DAAuD;AACvD,sDAAoE;AACpE,sEAAkE;AAClE,wDAA6D;AAC7D,kEAA6D;AAC7D,4CAAgD;AAIhD,MAAM,MAAM,GAAG,sBAAa,CAAC,WAAW,EAAE,CAAC;AAE3C,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAShC,SAAgB,gBAAgB,CAAC,OAA2C;IAC1E,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,eAAe,GAA2B,EAAE,CAAC;IAEnD,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;QAC1B,MAAM,YAAY,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;QAEvC,iEAAiE;QACjE,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE,CAAC;YACnC,eAAe,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,OAAO,eAAe,CAAC;A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|
+
{"version":3,"file":"check-circular-refs-in-schema.d.ts","sourceRoot":"","sources":["../../src/utils/check-circular-refs-in-schema.ts"],"names":[],"mappings":"AAAA,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAQ9D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkCircularRefsInSchema = checkCircularRefsInSchema;
|
|
4
|
+
function checkCircularRefsInSchema(schema) {
|
|
5
|
+
try {
|
|
6
|
+
JSON.stringify(schema);
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=check-circular-refs-in-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-circular-refs-in-schema.js","sourceRoot":"","sources":["../../src/utils/check-circular-refs-in-schema.ts"],"names":[],"mappings":";;AAAA,8DAQC;AARD,SAAgB,yBAAyB,CAAC,MAAW;IACnD,IAAI,CAAC;QACH,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean-colors.d.ts","sourceRoot":"","sources":["../../src/utils/clean-colors.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGjD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cleanColors = cleanColors;
|
|
4
|
+
function cleanColors(input) {
|
|
5
|
+
// eslint-disable-next-line no-control-regex
|
|
6
|
+
return input.replace(/\x1b\[\d+m/g, '');
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=clean-colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean-colors.js","sourceRoot":"","sources":["../../src/utils/clean-colors.ts"],"names":[],"mappings":";;AAAA,kCAGC;AAHD,SAAgB,WAAW,CAAC,KAAa;IACvC,4CAA4C;IAC5C,OAAO,KAAK,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Totals } from '@redocly/openapi-core';
|
|
2
|
+
import { type Check, type VerboseLog } from '../types';
|
|
3
|
+
export declare const RESET_ESCAPE_CODE = "\u001B[0m";
|
|
4
|
+
export declare function removeExtraIndentation(message: string | undefined): string;
|
|
5
|
+
export declare function indent(str: string, level: number): string;
|
|
6
|
+
export declare function printWorkflowSeparatorLine(): void;
|
|
7
|
+
export declare function printWorkflowSeparator(fileName: string, workflowName: string | undefined): void;
|
|
8
|
+
export declare function printDependentWorkflowSeparator(parentWorkflowId: string): void;
|
|
9
|
+
export declare function printStepWorkflowSeparator(parentStepId: string, parentWorkflowId: string): void;
|
|
10
|
+
export declare function printStepSeparatorLine(): void;
|
|
11
|
+
export declare function printConfigLintTotals(totals: Totals): void;
|
|
12
|
+
export declare function printStepDetails({ testNameToDisplay, checks, verboseLogs, verboseResponseLogs, }: {
|
|
13
|
+
testNameToDisplay: string;
|
|
14
|
+
checks: Check[];
|
|
15
|
+
verboseLogs?: VerboseLog;
|
|
16
|
+
verboseResponseLogs?: VerboseLog;
|
|
17
|
+
}): void;
|
|
18
|
+
//# sourceMappingURL=cli-outputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-outputs.d.ts","sourceRoot":"","sources":["../../src/utils/cli-outputs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAMvD,eAAO,MAAM,iBAAiB,cAAY,CAAC;AAE3C,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAY1E;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAKhD;AAED,wBAAgB,0BAA0B,SAIzC;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,SAAS,QAIxF;AAED,wBAAgB,+BAA+B,CAAC,gBAAgB,EAAE,MAAM,QAKvE;AAED,wBAAgB,0BAA0B,CAAC,YAAY,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,QAIxF;AAED,wBAAgB,sBAAsB,SAErC;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAoB1D;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,iBAAiB,EACjB,MAAM,EACN,WAAW,EACX,mBAAmB,GACpB,EAAE;IACD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,mBAAmB,CAAC,EAAE,UAAU,CAAC;CAClC,QAGA"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RESET_ESCAPE_CODE = void 0;
|
|
4
|
+
exports.removeExtraIndentation = removeExtraIndentation;
|
|
5
|
+
exports.indent = indent;
|
|
6
|
+
exports.printWorkflowSeparatorLine = printWorkflowSeparatorLine;
|
|
7
|
+
exports.printWorkflowSeparator = printWorkflowSeparator;
|
|
8
|
+
exports.printDependentWorkflowSeparator = printDependentWorkflowSeparator;
|
|
9
|
+
exports.printStepWorkflowSeparator = printStepWorkflowSeparator;
|
|
10
|
+
exports.printStepSeparatorLine = printStepSeparatorLine;
|
|
11
|
+
exports.printConfigLintTotals = printConfigLintTotals;
|
|
12
|
+
exports.printStepDetails = printStepDetails;
|
|
13
|
+
const jest_matcher_utils_1 = require("jest-matcher-utils");
|
|
14
|
+
const colorette_1 = require("colorette");
|
|
15
|
+
const cli_output_1 = require("../modules/cli-output");
|
|
16
|
+
const logger_1 = require("./logger/logger");
|
|
17
|
+
const logger = logger_1.DefaultLogger.getInstance();
|
|
18
|
+
exports.RESET_ESCAPE_CODE = '\x1B[0m';
|
|
19
|
+
function removeExtraIndentation(message) {
|
|
20
|
+
if (!message) {
|
|
21
|
+
return '';
|
|
22
|
+
}
|
|
23
|
+
// Split the message into individual lines
|
|
24
|
+
const lines = message.split('\n');
|
|
25
|
+
// Trim leading whitespace from each line
|
|
26
|
+
const trimmedLines = lines.map((line) => line.trimStart());
|
|
27
|
+
// Join the trimmed lines back into a single string
|
|
28
|
+
return trimmedLines.join('\n');
|
|
29
|
+
}
|
|
30
|
+
function indent(str, level) {
|
|
31
|
+
return str
|
|
32
|
+
.split('\n')
|
|
33
|
+
.map((line) => '\xa0'.repeat(level) + line)
|
|
34
|
+
.join('\n');
|
|
35
|
+
}
|
|
36
|
+
function printWorkflowSeparatorLine() {
|
|
37
|
+
logger.printSeparator('\u2500');
|
|
38
|
+
logger.printNewLine();
|
|
39
|
+
logger.printNewLine();
|
|
40
|
+
}
|
|
41
|
+
function printWorkflowSeparator(fileName, workflowName) {
|
|
42
|
+
printWorkflowSeparatorLine();
|
|
43
|
+
logger.log(` ${(0, colorette_1.bold)('Running workflow')} ${(0, colorette_1.blue)(`${fileName} / ${workflowName}`)}`);
|
|
44
|
+
logger.printNewLine();
|
|
45
|
+
}
|
|
46
|
+
function printDependentWorkflowSeparator(parentWorkflowId) {
|
|
47
|
+
logger.printNewLine();
|
|
48
|
+
logger.log(` ${(0, colorette_1.bold)('Running required')} workflows for ${(0, colorette_1.blue)(parentWorkflowId)} ${exports.RESET_ESCAPE_CODE}\n`);
|
|
49
|
+
}
|
|
50
|
+
function printStepWorkflowSeparator(parentStepId, parentWorkflowId) {
|
|
51
|
+
logger.printNewLine();
|
|
52
|
+
logger.log(` ${(0, colorette_1.bold)('Running step')} ${(0, colorette_1.blue)(parentStepId)} workflow ${(0, colorette_1.blue)(parentWorkflowId)}`);
|
|
53
|
+
logger.printNewLine();
|
|
54
|
+
}
|
|
55
|
+
function printStepSeparatorLine() {
|
|
56
|
+
logger.printNewLine();
|
|
57
|
+
}
|
|
58
|
+
function printConfigLintTotals(totals) {
|
|
59
|
+
if (totals.errors > 0) {
|
|
60
|
+
logger.error((0, colorette_1.red)(`❌ Your config has ${totals.errors} ${(0, jest_matcher_utils_1.pluralize)('error', totals.errors)}.${exports.RESET_ESCAPE_CODE}`));
|
|
61
|
+
}
|
|
62
|
+
else if (totals.warnings > 0) {
|
|
63
|
+
logger.error((0, colorette_1.yellow)(`⚠️ Your config has ${totals.warnings} ${(0, jest_matcher_utils_1.pluralize)('warning', totals.warnings)}.${exports.RESET_ESCAPE_CODE}`));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function printStepDetails({ testNameToDisplay, checks, verboseLogs, verboseResponseLogs, }) {
|
|
67
|
+
printStepSeparatorLine();
|
|
68
|
+
(0, cli_output_1.displayChecks)(testNameToDisplay, checks, verboseLogs, verboseResponseLogs);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=cli-outputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-outputs.js","sourceRoot":"","sources":["../../src/utils/cli-outputs.ts"],"names":[],"mappings":";;;AAWA,wDAYC;AAED,wBAKC;AAED,gEAIC;AAED,wDAIC;AAED,0EAKC;AAED,gEAIC;AAED,wDAEC;AAED,sDAoBC;AAED,4CAaC;AAhGD,2DAA+C;AAC/C,yCAAoD;AAGpD,sDAAsD;AACtD,4CAAgD;AAEhD,MAAM,MAAM,GAAG,sB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@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delay.d.ts","sourceRoot":"","sources":["../../src/utils/delay.ts"],"names":[],"mappings":"AACA,wBAAgB,KAAK,CAAC,EAAE,SAAI,oBAE3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delay.js","sourceRoot":"","sources":["../../src/utils/delay.ts"],"names":[],"mappings":";;AACA,sBAEC;AAHD,0BAA0B;AAC1B,SAAgB,KAAK,CAAC,EAAE,GAAG,CAAC;IAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/utils/env.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,YAMxB;AAED,wBAAgB,GAAG,sBAElB"}
|
package/lib/utils/env.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isBrowser = isBrowser;
|
|
4
|
+
exports.env = env;
|
|
5
|
+
function isBrowser() {
|
|
6
|
+
return (typeof window !== 'undefined' ||
|
|
7
|
+
typeof process === 'undefined' ||
|
|
8
|
+
process?.platform === 'browser'); // main and worker thread
|
|
9
|
+
}
|
|
10
|
+
function env() {
|
|
11
|
+
return isBrowser() ? {} : process.env || {};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/utils/env.ts"],"names":[],"mappings":";;AAAA,8BAMC;AAED,kBAEC;AAVD,SAAgB,SAAS;IACvB,OAAO,CACL,OAAO,MAAM,KAAK,WAAW;QAC7B,OAAO,OAAO,KAAK,WAAW;QAC7B,OAAO,EAAE,QAAgB,KAAK,SAAS,CACzC,CAAC,CAAC,yBAAyB;AAC9B,CAAC;AAED,SAAgB,GAAG;IACjB,OAAO,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/utils/file.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,WAExD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/utils/file.ts"],"names":[],"mappings":";;AAAA,gCAEC;AAFD,SAAgB,UAAU,CAAC,IAAY,EAAE,WAAgB;IACvD,OAAO,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-nested-value.d.ts","sourceRoot":"","sources":["../../src/utils/get-nested-value.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAU5D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getNestedValue = getNestedValue;
|
|
4
|
+
function getNestedValue(obj, path) {
|
|
5
|
+
let current = obj;
|
|
6
|
+
for (const key of path) {
|
|
7
|
+
if (current && current[key] !== undefined) {
|
|
8
|
+
current = current[key];
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return current;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=get-nested-value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-nested-value.js","sourceRoot":"","sources":["../../src/utils/get-nested-value.ts"],"names":[],"mappings":";;AAAA,wCAUC;AAVD,SAAgB,cAAc,CAAC,GAAQ,EAAE,IAAc;IACrD,IAAI,OAAO,GAAG,GAAG,CAAC;IAClB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;YAC1C,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QACzB,CAAC;aAAM,CAAC;YACN,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-reunite-url.d.ts","sourceRoot":"","sources":["../../src/utils/get-reunite-url.ts"],"names":[],"mappings":"AAKA,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE,MAAM,UAW/C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReuniteUrl = getReuniteUrl;
|
|
4
|
+
const reuniteUrls = {
|
|
5
|
+
us: 'https://app.cloud.redocly.com',
|
|
6
|
+
eu: 'https://app.cloud.eu.redocly.com',
|
|
7
|
+
};
|
|
8
|
+
function getReuniteUrl(residency) {
|
|
9
|
+
if (!residency)
|
|
10
|
+
residency = 'us';
|
|
11
|
+
let reuniteUrl = reuniteUrls[residency];
|
|
12
|
+
if (!reuniteUrl) {
|
|
13
|
+
reuniteUrl = residency;
|
|
14
|
+
}
|
|
15
|
+
const url = new URL('/api', reuniteUrl).toString();
|
|
16
|
+
return url;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=get-reunite-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-reunite-url.js","sourceRoot":"","sources":["../../src/utils/get-reunite-url.ts"],"names":[],"mappings":";;AAKA,sCAWC;AAhBD,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,+BAA+B;IACnC,EAAE,EAAE,kCAAkC;CAC9B,CAAC;AAEX,SAAgB,aAAa,CAAC,SAAkB;IAC9C,IAAI,CAAC,SAAS;QAAE,SAAS,GAAG,IAAI,CAAC;IAEjC,IAAI,UAAU,GAAW,WAAW,CAAC,SAAqC,CAAC,CAAC;IAE5E,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,UAAU,GAAG,SAAS,CAAC;IACzB,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC;IACnD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-har-log.d.ts","sourceRoot":"","sources":["../../../src/utils/har-logs/create-har-log.ts"],"names":[],"mappings":"AAEA,wBAAgB,YAAY,CAAC,OAAO,GAAE,GAAG,EAAO,EAAE,QAAQ,GAAE,GAAQ,GAAG,GAAG,CAyBzE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createHarLog = createHarLog;
|
|
4
|
+
const { name: packageName, version: packageVersion } = require('../../../package.json');
|
|
5
|
+
function createHarLog(entries = [], pageInfo = {}) {
|
|
6
|
+
return {
|
|
7
|
+
log: {
|
|
8
|
+
version: '1.2',
|
|
9
|
+
creator: {
|
|
10
|
+
name: packageName,
|
|
11
|
+
version: packageVersion,
|
|
12
|
+
},
|
|
13
|
+
pages: [
|
|
14
|
+
Object.assign({
|
|
15
|
+
startedDateTime: new Date().toISOString(),
|
|
16
|
+
id: 'page_1',
|
|
17
|
+
title: 'Page',
|
|
18
|
+
pageTimings: {
|
|
19
|
+
onContentLoad: -1,
|
|
20
|
+
onLoad: -1,
|
|
21
|
+
},
|
|
22
|
+
}, pageInfo),
|
|
23
|
+
],
|
|
24
|
+
entries,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=create-har-log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-har-log.js","sourceRoot":"","sources":["../../../src/utils/har-logs/create-har-log.ts"],"names":[],"mappings":";;AAEA,oCAyBC;AA3BD,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAExF,SAAgB,YAAY,CAAC,UAAiB,EAAE,EAAE,WAAgB,EAAE;IAClE,OAAO;QACL,GAAG,EAAE;YACH,OAAO,EAAE,KAAK;YACd,OAAO,EAAE;gBACP,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,cAAc;aACxB;YACD,KAAK,EAAE;gBACL,MAAM,CAAC,MAAM,CACX;oBACE,eAAe,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;oBACzC,EAAE,EAAE,QAAQ;oBACZ,KAAK,EAAE,MAAM;oBACb,WAAW,EAAE;wBACX,aAAa,EAAE,CAAC,CAAC;wBACjB,MAAM,EAAE,CAAC,CAAC;qBACX;iBACF,EACD,QAAQ,CACT;aACF;YACD,OAAO;SACR;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-headers.d.ts","sourceRoot":"","sources":["../../../../src/utils/har-logs/helpers/add-headers.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,GAAG,GAAG,CAahE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addHeaders = addHeaders;
|
|
4
|
+
function addHeaders(oldHeaders, newHeaders) {
|
|
5
|
+
if (!oldHeaders) {
|
|
6
|
+
return newHeaders;
|
|
7
|
+
}
|
|
8
|
+
else if (typeof oldHeaders.set === 'function' && typeof oldHeaders.constructor === 'function') {
|
|
9
|
+
const Headers = oldHeaders.constructor;
|
|
10
|
+
const headers = new Headers(oldHeaders);
|
|
11
|
+
for (const name in newHeaders) {
|
|
12
|
+
headers.set(name, newHeaders[name]);
|
|
13
|
+
}
|
|
14
|
+
return headers;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return Object.assign({}, oldHeaders, newHeaders);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=add-headers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-headers.js","sourceRoot":"","sources":["../../../../src/utils/har-logs/helpers/add-headers.ts"],"names":[],"mappings":";;AAAA,gCAaC;AAbD,SAAgB,UAAU,CAAC,UAAe,EAAE,UAAe;IACzD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,UAAU,CAAC;IACpB,CAAC;SAAM,IAAI,OAAO,UAAU,CAAC,GAAG,KAAK,UAAU,IAAI,OAAO,UAAU,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QAChG,MAAM,OAAO,GAAG,UAAU,CAAC,WAAW,CAAC;QACvC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;QACxC,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;YAC9B,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IACnD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Support the three possible header formats we'd get from a request or
|
|
3
|
+
* response:
|
|
4
|
+
*
|
|
5
|
+
* - A flat array with both names and values: [name, value, name, value, ...]
|
|
6
|
+
* - An object with array values: { name: [value, value] }
|
|
7
|
+
* - An object with string values: { name: value }
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildHeaders(headers: any): any[];
|
|
10
|
+
//# sourceMappingURL=build-headers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-headers.d.ts","sourceRoot":"","sources":["../../../../src/utils/har-logs/helpers/build-headers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,GAAG,GAAG,GAAG,EAAE,CAoBhD"}
|