@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,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.infoSubstitute = void 0;
|
|
27
|
+
exports.generateTestConfig = generateTestConfig;
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
const sort_1 = require("../../utils/sort");
|
|
30
|
+
const description_parser_1 = require("../description-parser");
|
|
31
|
+
function generateParametersWithSuccessCriteria(responses) {
|
|
32
|
+
const responseCodesFromDescription = Object.keys(responses || {});
|
|
33
|
+
if (!responseCodesFromDescription.length) {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
const firstResponseCode = responseCodesFromDescription?.[0];
|
|
37
|
+
return { successCriteria: [{ condition: `$statusCode == ${firstResponseCode}` }] };
|
|
38
|
+
}
|
|
39
|
+
function generateOperationId(path, method) {
|
|
40
|
+
return `${method}@${path}`;
|
|
41
|
+
}
|
|
42
|
+
function generateWorkflowsFromDescription({ descriptionPaths, options, sourceDescriptionName, }) {
|
|
43
|
+
const { extended } = options;
|
|
44
|
+
const workflows = [];
|
|
45
|
+
for (const pathItemKey in descriptionPaths) {
|
|
46
|
+
for (const pathItemObjectKey of Object.keys(descriptionPaths[pathItemKey]).sort(sort_1.sortMethods)) {
|
|
47
|
+
const keyToCheck = pathItemObjectKey.toLocaleLowerCase();
|
|
48
|
+
if ([
|
|
49
|
+
'get',
|
|
50
|
+
'post',
|
|
51
|
+
'put',
|
|
52
|
+
'delete',
|
|
53
|
+
'patch',
|
|
54
|
+
'head',
|
|
55
|
+
'options',
|
|
56
|
+
'trace',
|
|
57
|
+
'connect',
|
|
58
|
+
'query',
|
|
59
|
+
].includes(keyToCheck.toLocaleLowerCase())) {
|
|
60
|
+
const method = keyToCheck;
|
|
61
|
+
const pathKey = pathItemKey
|
|
62
|
+
.replace(/^\/|\/$/g, '')
|
|
63
|
+
.split('/')
|
|
64
|
+
.join('-');
|
|
65
|
+
const resolvedOperationId = descriptionPaths[pathItemKey][method]?.operationId ||
|
|
66
|
+
generateOperationId(pathItemKey, method);
|
|
67
|
+
workflows.push({
|
|
68
|
+
workflowId: pathKey ? `${method}-${pathKey}-workflow` : `${method}-workflow`,
|
|
69
|
+
steps: [
|
|
70
|
+
{
|
|
71
|
+
stepId: pathKey ? `${method}-${pathKey}-step` : `${method}-step`,
|
|
72
|
+
operationId: `$sourceDescriptions.${sourceDescriptionName}.${resolvedOperationId}`,
|
|
73
|
+
...(extended &&
|
|
74
|
+
generateParametersWithSuccessCriteria(descriptionPaths[pathItemKey][method].responses)),
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return workflows;
|
|
82
|
+
}
|
|
83
|
+
exports.infoSubstitute = {
|
|
84
|
+
title: '[REPLACE WITH API title]',
|
|
85
|
+
version: '[REPLACE WITH API version]',
|
|
86
|
+
};
|
|
87
|
+
function resolveDescriptionNameFromPath(descriptionPath) {
|
|
88
|
+
return path.parse(descriptionPath).name;
|
|
89
|
+
}
|
|
90
|
+
async function generateTestConfig({ descriptionPath, outputFile, extended, }) {
|
|
91
|
+
const { paths: pathsObject, info } = (await (0, description_parser_1.bundleOpenApi)(descriptionPath, '')) || {};
|
|
92
|
+
const sourceDescriptionName = resolveDescriptionNameFromPath(descriptionPath);
|
|
93
|
+
const resolvedDescriptionPath = outputFile
|
|
94
|
+
? path.relative(path.dirname(outputFile), path.resolve(descriptionPath))
|
|
95
|
+
: descriptionPath;
|
|
96
|
+
const testDescription = {
|
|
97
|
+
arazzo: '1.0.1',
|
|
98
|
+
info: {
|
|
99
|
+
title: info?.title || exports.infoSubstitute.title,
|
|
100
|
+
version: info?.version || exports.infoSubstitute.version,
|
|
101
|
+
},
|
|
102
|
+
sourceDescriptions: [
|
|
103
|
+
{
|
|
104
|
+
name: sourceDescriptionName,
|
|
105
|
+
type: 'openapi',
|
|
106
|
+
url: resolvedDescriptionPath,
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
workflows: generateWorkflowsFromDescription({
|
|
110
|
+
descriptionPaths: pathsObject,
|
|
111
|
+
options: { extended },
|
|
112
|
+
sourceDescriptionName,
|
|
113
|
+
}),
|
|
114
|
+
};
|
|
115
|
+
return JSON.parse(JSON.stringify(testDescription, null, 2));
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=generate-test-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-test-config.js","sourceRoot":"","sources":["../../../src/modules/test-config-generator/generate-test-config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAsGA,gDAgCC;AAtID,2CAA6B;AAC7B,2CAA+C;AAC/C,8DAAsD;AAkBtD,SAAS,qCAAqC,CAC5C,SAAc;IAEd,MAAM,4BAA4B,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;IAElE,IAAI,CAAC,4BAA4B,CAAC,MAAM,EAAE,CAAC;QACzC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,iBAAiB,GAAG,4BAA4B,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5D,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,SAAS,EAAE,kBAAkB,iBAAiB,EAAE,EAAE,CAAC,EAAE,CAAC;AACrF,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAY,EAAE,MAAuB;IAChE,OAAO,GAAG,MAAM,IAAI,IAAI,EAAE,CAAC;AAC7B,CAAC;AAED,SAAS,gCAAgC,CAAC,EACxC,gBAAgB,EAChB,OAAO,EACP,qBAAqB,GACS;IAC9B,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAC7B,MAAM,SAAS,GAAG,EAAgB,CAAC;IAEnC,KAAK,MAAM,WAAW,IAAI,gBAAgB,EAAE,CAAC;QAC3C,KAAK,MAAM,iBAAiB,IAAI,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAA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sourceRoot":"","sources":["../../../src/modules/test-config-generator/generate-test-data-from-json-schema.ts"],"names":[],"mappings":"AAMA,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,GAAG,WAQzD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.generateTestDataFromJsonSchema = generateTestDataFromJsonSchema;
|
|
27
|
+
const Sampler = __importStar(require("openapi-sampler"));
|
|
28
|
+
const colorette_1 = require("colorette");
|
|
29
|
+
const logger_1 = require("../../utils/logger/logger");
|
|
30
|
+
const logger = logger_1.DefaultLogger.getInstance();
|
|
31
|
+
function generateTestDataFromJsonSchema(schema) {
|
|
32
|
+
if (!schema)
|
|
33
|
+
return;
|
|
34
|
+
try {
|
|
35
|
+
return Sampler.sample(schema, { skipReadOnly: true, skipNonRequired: false, quiet: true });
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
38
|
+
logger.error((0, colorette_1.bgRed)(` Error while generating test data from JSON Schema `) + '\n' + e);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=generate-test-data-from-json-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-test-data-from-json-schema.js","sourceRoot":"","sources":["../../../src/modules/test-config-generator/generate-test-data-from-json-schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wEAQC;AAdD,yDAA2C;AAC3C,yCAAkC;AAClC,sDAA0D;AAE1D,MAAM,MAAM,GAAG,sBAAa,CAAC,WAAW,EAAE,CAAC;AAE3C,SAAgB,8BAA8B,CAAC,MAAW;IACxD,IAAI,CAAC,MAAM;QAAE,OAAO;IACpB,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7F,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,CAAC,KAAK,CAAC,IAAA,iBAAK,EAAC,qDAAqD,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC;QACtF,OAAO;IACT,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/test-config-generator/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,0BAA0B,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("./generate-test-config"), exports);
|
|
18
|
+
__exportStar(require("./cleanup-test-description"), exports);
|
|
19
|
+
__exportStar(require("./generate-test-data-from-json-schema"), exports);
|
|
20
|
+
__exportStar(require("./generate-example-value"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/test-config-generator/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,6DAA2C;AAC3C,wEAAsD;AACtD,2DAAyC"}
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import type { FromSchema } from 'json-schema-to-ts';
|
|
2
|
+
import type { parameter, operationMethod, sourceDescriptionSchema, infoObject, requestBody, replacement, criteriaObject, step, workflow, reusableObject, onSuccessObject, onFailureObject, extendedOperation } from './arazzo-schema';
|
|
3
|
+
import type { Faker } from './modules/faker';
|
|
4
|
+
import type { OperationDetails } from './modules/description-parser';
|
|
5
|
+
import type { RuleSeverity } from '@redocly/openapi-core/lib/config/types';
|
|
6
|
+
import type { ApiFetcher } from './utils/api-fetcher';
|
|
7
|
+
export type OperationMethod = FromSchema<typeof operationMethod>;
|
|
8
|
+
export type ResponseContext = {
|
|
9
|
+
statusCode: number;
|
|
10
|
+
body: any;
|
|
11
|
+
header: Record<string, string>;
|
|
12
|
+
query?: Record<string, string | number | boolean>;
|
|
13
|
+
path?: Record<string, string | number | boolean>;
|
|
14
|
+
contentType?: string;
|
|
15
|
+
} & Record<string, any>;
|
|
16
|
+
export type SourceDescription = FromSchema<typeof sourceDescriptionSchema>;
|
|
17
|
+
type ArazzoParameter = FromSchema<typeof parameter>;
|
|
18
|
+
export type InfoObject = FromSchema<typeof infoObject>;
|
|
19
|
+
export type RequestBody = FromSchema<typeof requestBody>;
|
|
20
|
+
export type Replacement = FromSchema<typeof replacement>;
|
|
21
|
+
export type CriteriaObject = FromSchema<typeof criteriaObject>;
|
|
22
|
+
export type ReusableObject = FromSchema<typeof reusableObject>;
|
|
23
|
+
export type OnSuccessObject = FromSchema<typeof onSuccessObject>;
|
|
24
|
+
export type OnFailureObject = FromSchema<typeof onFailureObject>;
|
|
25
|
+
export type ExtendedOperation = FromSchema<typeof extendedOperation>;
|
|
26
|
+
type ArazzoStep = FromSchema<typeof step>;
|
|
27
|
+
type ArazzoWorkflow = FromSchema<typeof workflow> & {
|
|
28
|
+
steps: Step[];
|
|
29
|
+
};
|
|
30
|
+
export type AdditionalParameterProperties = {
|
|
31
|
+
style?: string;
|
|
32
|
+
target?: string;
|
|
33
|
+
required?: boolean;
|
|
34
|
+
schema?: Record<string, any>;
|
|
35
|
+
example?: unknown;
|
|
36
|
+
examples?: Record<string, any> | unknown;
|
|
37
|
+
};
|
|
38
|
+
type ExtendedParameter<T> = T & AdditionalParameterProperties;
|
|
39
|
+
export type Parameter = ExtendedParameter<ArazzoParameter>;
|
|
40
|
+
export type ResolvedParameter = Parameter & {
|
|
41
|
+
in?: 'header' | 'query' | 'path' | 'cookie';
|
|
42
|
+
name: string;
|
|
43
|
+
};
|
|
44
|
+
export type VerboseLog = {
|
|
45
|
+
method: OperationMethod;
|
|
46
|
+
path: string;
|
|
47
|
+
host: string;
|
|
48
|
+
body?: any;
|
|
49
|
+
headerParams?: Record<string, string>;
|
|
50
|
+
statusCode?: number;
|
|
51
|
+
responseTime?: number;
|
|
52
|
+
};
|
|
53
|
+
type AdditionalStepProps = {
|
|
54
|
+
verboseLog?: VerboseLog;
|
|
55
|
+
response: ResponseContext;
|
|
56
|
+
checks: Check[];
|
|
57
|
+
};
|
|
58
|
+
export type Step = ArazzoStep & AdditionalStepProps;
|
|
59
|
+
export type Workflow = Omit<ArazzoWorkflow, 'steps'> & {
|
|
60
|
+
steps: Step[];
|
|
61
|
+
time?: number;
|
|
62
|
+
};
|
|
63
|
+
export type RunArgv = {
|
|
64
|
+
file: string;
|
|
65
|
+
testDescription?: TestDescription;
|
|
66
|
+
workflow?: string[];
|
|
67
|
+
skip?: string[];
|
|
68
|
+
verbose?: boolean;
|
|
69
|
+
harOutput?: string;
|
|
70
|
+
jsonOutput?: string;
|
|
71
|
+
input?: string | string[];
|
|
72
|
+
server?: string | string[];
|
|
73
|
+
severity?: string | string[];
|
|
74
|
+
clientCert?: NonNullable<TestContext['mtlsCerts']>['clientCert'];
|
|
75
|
+
clientKey?: NonNullable<TestContext['mtlsCerts']>['clientKey'];
|
|
76
|
+
caCert?: NonNullable<TestContext['mtlsCerts']>['caCert'];
|
|
77
|
+
};
|
|
78
|
+
export interface RequestContext {
|
|
79
|
+
body: any;
|
|
80
|
+
header: Record<string, string | number | boolean>;
|
|
81
|
+
path?: Record<string, string | number | boolean>;
|
|
82
|
+
method?: string;
|
|
83
|
+
url?: string;
|
|
84
|
+
query?: Record<string, string | number | boolean>;
|
|
85
|
+
}
|
|
86
|
+
export type ParsedParameters = {
|
|
87
|
+
queryParams: Record<string, string>;
|
|
88
|
+
pathParams: Record<string, string | number>;
|
|
89
|
+
headerParams: Record<string, string>;
|
|
90
|
+
};
|
|
91
|
+
export type AppOptions = {
|
|
92
|
+
workflowPath: string;
|
|
93
|
+
workflow?: string | string[];
|
|
94
|
+
skip?: string | string[];
|
|
95
|
+
verbose?: boolean;
|
|
96
|
+
harLogsFile?: string;
|
|
97
|
+
jsonLogsFile?: string;
|
|
98
|
+
metadata?: Record<string, any>;
|
|
99
|
+
input?: string | string[];
|
|
100
|
+
server?: string | string[];
|
|
101
|
+
severity?: string | string[];
|
|
102
|
+
mutualTls?: Partial<TestContext['mtlsCerts']>;
|
|
103
|
+
};
|
|
104
|
+
export type RegexpSuccessCriteria = {
|
|
105
|
+
condition: string;
|
|
106
|
+
context: string;
|
|
107
|
+
type: 'regex';
|
|
108
|
+
};
|
|
109
|
+
export type JsonPathVerison = 'draft-goessner-dispatch-jsonpath-00';
|
|
110
|
+
export type JsonPathSuccessCriterionObject = {
|
|
111
|
+
type: 'jsonpath';
|
|
112
|
+
version: JsonPathVerison;
|
|
113
|
+
};
|
|
114
|
+
export type JsonPathSuccessCriteria = {
|
|
115
|
+
condition: string;
|
|
116
|
+
context: string;
|
|
117
|
+
type: 'jsonpath' | JsonPathSuccessCriterionObject;
|
|
118
|
+
};
|
|
119
|
+
export type Ref = {
|
|
120
|
+
$ref: string;
|
|
121
|
+
};
|
|
122
|
+
export type PublicWorkflow = {
|
|
123
|
+
outputs?: Record<string, any>;
|
|
124
|
+
inputs?: Record<string, any>;
|
|
125
|
+
steps: Record<string, PublicWorkflowStep>;
|
|
126
|
+
};
|
|
127
|
+
export type PublicStep = {
|
|
128
|
+
outputs?: Record<string, any>;
|
|
129
|
+
};
|
|
130
|
+
export type PublicWorkflowStep = {
|
|
131
|
+
outputs?: Record<string, any>;
|
|
132
|
+
request?: RequestContext;
|
|
133
|
+
response?: ResponseContext;
|
|
134
|
+
};
|
|
135
|
+
export interface InputSchema {
|
|
136
|
+
type: string;
|
|
137
|
+
properties?: {
|
|
138
|
+
[key: string]: any;
|
|
139
|
+
};
|
|
140
|
+
format?: string;
|
|
141
|
+
}
|
|
142
|
+
export type StepInnerContext = {
|
|
143
|
+
$response: ResponseContext | undefined;
|
|
144
|
+
$request: RequestContext | undefined;
|
|
145
|
+
$outputs: Record<string, any>;
|
|
146
|
+
};
|
|
147
|
+
export type WorkflowInnerContext = {
|
|
148
|
+
$steps: Record<string, PublicWorkflowStep>;
|
|
149
|
+
$outputs: Record<string, any>;
|
|
150
|
+
};
|
|
151
|
+
export type RuntimeExpressionContext = {
|
|
152
|
+
$workflows: Record<string, PublicWorkflow>;
|
|
153
|
+
$sourceDescriptions: Record<string, any>;
|
|
154
|
+
$faker: Faker;
|
|
155
|
+
$steps: Record<string, PublicStep>;
|
|
156
|
+
$response?: Partial<ResponseContext>;
|
|
157
|
+
$request?: Partial<RequestContext>;
|
|
158
|
+
$outputs?: Record<string, any>;
|
|
159
|
+
$inputs?: Record<string, any>;
|
|
160
|
+
$components?: Record<string, any>;
|
|
161
|
+
$url?: string;
|
|
162
|
+
$method?: string;
|
|
163
|
+
$statusCode?: number;
|
|
164
|
+
};
|
|
165
|
+
export type RunWorkflowInput = {
|
|
166
|
+
workflowInput: Workflow | string;
|
|
167
|
+
ctx: TestContext;
|
|
168
|
+
parentStepId?: string;
|
|
169
|
+
parentWorkflowId?: string;
|
|
170
|
+
fromStepId?: string;
|
|
171
|
+
};
|
|
172
|
+
export type TestContext = RuntimeExpressionContext & {
|
|
173
|
+
arazzo: string;
|
|
174
|
+
info: InfoObject & Record<string, any>;
|
|
175
|
+
sourceDescriptions?: SourceDescription[];
|
|
176
|
+
workflows: Workflow[];
|
|
177
|
+
options: AppOptions;
|
|
178
|
+
testDescription: TestDescription;
|
|
179
|
+
harLogs: any;
|
|
180
|
+
components?: Record<string, any>;
|
|
181
|
+
secretFields?: Set<string>;
|
|
182
|
+
severity: Record<string, RuleSeverity>;
|
|
183
|
+
mtlsCerts?: {
|
|
184
|
+
clientCert?: string;
|
|
185
|
+
clientKey?: string;
|
|
186
|
+
caCert?: string;
|
|
187
|
+
};
|
|
188
|
+
apiClient: ApiFetcher;
|
|
189
|
+
};
|
|
190
|
+
export type TestDescription = Partial<Pick<TestContext & WorkflowInnerContext & StepInnerContext, 'workflows' | 'arazzo' | 'info' | 'sourceDescriptions' | '$outputs' | 'components'>>;
|
|
191
|
+
export type CheckStepInfo = {
|
|
192
|
+
stepId: string;
|
|
193
|
+
workflowId?: string;
|
|
194
|
+
operationId?: string;
|
|
195
|
+
operationPath?: string;
|
|
196
|
+
};
|
|
197
|
+
export type Check = {
|
|
198
|
+
severity: RuleSeverity;
|
|
199
|
+
stepInfo?: CheckStepInfo;
|
|
200
|
+
pass: boolean;
|
|
201
|
+
name: string;
|
|
202
|
+
message?: string;
|
|
203
|
+
additionalMessage?: string;
|
|
204
|
+
};
|
|
205
|
+
export type GenerateConfigFileArgv = {
|
|
206
|
+
descriptionPath: string;
|
|
207
|
+
outputFile?: string;
|
|
208
|
+
extended?: boolean;
|
|
209
|
+
};
|
|
210
|
+
export interface ResultsOfTests {
|
|
211
|
+
passed: number;
|
|
212
|
+
failed: number;
|
|
213
|
+
total: number;
|
|
214
|
+
warnings: number;
|
|
215
|
+
skipped: number;
|
|
216
|
+
}
|
|
217
|
+
export type CalculatedResults = {
|
|
218
|
+
workflows: ResultsOfTests;
|
|
219
|
+
steps: ResultsOfTests;
|
|
220
|
+
checks: ResultsOfTests;
|
|
221
|
+
};
|
|
222
|
+
export type StepCallContext = {
|
|
223
|
+
$response?: ResponseContext;
|
|
224
|
+
$request?: RequestContext;
|
|
225
|
+
$inputs?: Record<string, any>;
|
|
226
|
+
};
|
|
227
|
+
type StepWithChecks = PublicStep & {
|
|
228
|
+
checks?: Check[];
|
|
229
|
+
};
|
|
230
|
+
type WorkflowWithChecks = PublicWorkflow & {
|
|
231
|
+
steps: Record<string, StepWithChecks>;
|
|
232
|
+
time?: number;
|
|
233
|
+
};
|
|
234
|
+
export type JsonLogs = Record<string, WorkflowWithChecks>;
|
|
235
|
+
export type DescriptionChecks = {
|
|
236
|
+
checks: Check[];
|
|
237
|
+
descriptionOperation: OperationDetails;
|
|
238
|
+
$response: ResponseContext;
|
|
239
|
+
};
|
|
240
|
+
export {};
|
|
241
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,uBAAuB,EACvB,UAAU,EACV,WAAW,EACX,WAAW,EACX,cAAc,EACd,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,eAAe,EACf,eAAe,EACf,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AACjE,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,GAAG,CAAC;IACV,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,MAAM,CAA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,CAAA;CAAE,CAAC;AACxD,KAAK,kBAAkB,GAAG,cAAc,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACpG,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAC1D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,oBAAoB,EAAE,gBAAgB,CAAC;IACvC,SAAS,EAAE,eAAe,CAAC;CAC5B,CAAC"}
|
package/lib/types.js
ADDED
package/lib/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ajv-errors.d.ts","sourceRoot":"","sources":["../../src/utils/ajv-errors.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,UAoBpF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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.printErrors = printErrors;
|
|
7
|
+
const better_ajv_errors_1 = __importDefault(require("better-ajv-errors"));
|
|
8
|
+
const cli_outputs_1 = require("./cli-outputs");
|
|
9
|
+
function printErrors(schema, data, errors) {
|
|
10
|
+
const updatedErrors = errors.map((error) => {
|
|
11
|
+
if (error.keyword === 'unevaluatedProperties' || error.keyword === 'additionalProperties') {
|
|
12
|
+
const failedProp = error.params.unevaluatedProperty || error.params.additionalProperty;
|
|
13
|
+
// Add a custom message with the unevaluated or the additional property information
|
|
14
|
+
return {
|
|
15
|
+
...error,
|
|
16
|
+
message: `${error.message}: "${failedProp}".`,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return error;
|
|
20
|
+
});
|
|
21
|
+
// Use betterAjvErrors with the modified errors
|
|
22
|
+
const output = (0, better_ajv_errors_1.default)(schema, data, updatedErrors, {
|
|
23
|
+
format: 'cli',
|
|
24
|
+
indent: 2,
|
|
25
|
+
});
|
|
26
|
+
return `${cli_outputs_1.RESET_ESCAPE_CODE}\n${output}${cli_outputs_1.RESET_ESCAPE_CODE}\n`;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=ajv-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ajv-errors.js","sourceRoot":"","sources":["../../src/utils/ajv-errors.ts"],"names":[],"mappings":";;;;;AAKA,kCAoBC;AAzBD,0EAAgD;AAChD,+CAAkD;AAIlD,SAAgB,WAAW,CAAC,MAA+B,EAAE,IAAS,EAAE,MAAa;IACnF,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAU,EAAE,EAAE;QAC9C,IAAI,KAAK,CAAC,OAAO,KAAK,uBAAuB,IAAI,KAAK,CAAC,OAAO,KAAK,sBAAsB,EAAE,CAAC;YAC1F,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,mBAAmB,IAAI,KAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC;YACvF,mFAAmF;YACnF,OAAO;gBACL,GAAG,KAAK;gBACR,OAAO,EAAE,GAAG,KAAK,CAAC,OAAO,MAAM,UAAU,IAAI;aAC9C,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IAEH,+CAA+C;IAC/C,MAAM,MAAM,GAAG,IAAA,2BAAe,EAAC,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE;QAC1D,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,CAAC;KACV,CAAC,CAAC;IAEH,OAAO,GAAG,+BAAiB,KAAK,MAAM,GAAG,+BAAiB,IAAI,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { fetch } from 'undici';
|
|
2
|
+
import { type VerboseLog, type TestContext, type ResponseContext } from '../types';
|
|
3
|
+
import type { RequestData } from '../modules/flow-runner';
|
|
4
|
+
interface IFetcher {
|
|
5
|
+
verboseLogs?: VerboseLog;
|
|
6
|
+
verboseResponseLogs?: VerboseLog;
|
|
7
|
+
harLogs?: any;
|
|
8
|
+
fetch?: typeof fetch;
|
|
9
|
+
}
|
|
10
|
+
export declare function normalizeHeaders(headers: Record<string, string> | undefined): Record<string, string>;
|
|
11
|
+
export declare function isJsonContentType(contentType: string): boolean;
|
|
12
|
+
export declare function isXmlContentType(contentType: string): boolean;
|
|
13
|
+
export declare function trimTrailingSlash(str: string): string;
|
|
14
|
+
export declare class ApiFetcher implements IFetcher {
|
|
15
|
+
verboseLogs?: VerboseLog;
|
|
16
|
+
verboseResponseLogs?: VerboseLog;
|
|
17
|
+
harLogs?: any;
|
|
18
|
+
fetch?: typeof fetch;
|
|
19
|
+
constructor(params: IFetcher);
|
|
20
|
+
initVerboseLogs: ({ headerParams, host, path, method, body }: VerboseLog) => void;
|
|
21
|
+
getVerboseLogs: () => VerboseLog | undefined;
|
|
22
|
+
initVerboseResponseLogs: ({ headerParams, host, path, method, body, statusCode, responseTime, }: VerboseLog) => void;
|
|
23
|
+
getVerboseResponseLogs: () => VerboseLog | undefined;
|
|
24
|
+
fetchResult: (ctx: TestContext, requestData: RequestData) => Promise<ResponseContext | never>;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=api-fetcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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