@thymian/core 0.0.0-PLACEHOLDER
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/README.md +59 -0
- package/dist/actions/action.d.ts +5 -0
- package/dist/actions/action.d.ts.map +1 -0
- package/dist/actions/action.js +2 -0
- package/dist/actions/action.js.map +1 -0
- package/dist/actions/close.action.d.ts +3 -0
- package/dist/actions/close.action.d.ts.map +1 -0
- package/dist/actions/close.action.js +2 -0
- package/dist/actions/close.action.js.map +1 -0
- package/dist/actions/core-analyze.action.d.ts +11 -0
- package/dist/actions/core-analyze.action.d.ts.map +1 -0
- package/dist/actions/core-analyze.action.js +2 -0
- package/dist/actions/core-analyze.action.js.map +1 -0
- package/dist/actions/core-lint.action.d.ts +9 -0
- package/dist/actions/core-lint.action.d.ts.map +1 -0
- package/dist/actions/core-lint.action.js +2 -0
- package/dist/actions/core-lint.action.js.map +1 -0
- package/dist/actions/core-request-sample.action.d.ts +9 -0
- package/dist/actions/core-request-sample.action.d.ts.map +1 -0
- package/dist/actions/core-request-sample.action.js +2 -0
- package/dist/actions/core-request-sample.action.js.map +1 -0
- package/dist/actions/core-test.action.d.ts +10 -0
- package/dist/actions/core-test.action.d.ts.map +1 -0
- package/dist/actions/core-test.action.js +2 -0
- package/dist/actions/core-test.action.js.map +1 -0
- package/dist/actions/core-validation-input.d.ts +6 -0
- package/dist/actions/core-validation-input.d.ts.map +1 -0
- package/dist/actions/core-validation-input.js +2 -0
- package/dist/actions/core-validation-input.js.map +1 -0
- package/dist/actions/format-load.action.d.ts +16 -0
- package/dist/actions/format-load.action.d.ts.map +1 -0
- package/dist/actions/format-load.action.js +36 -0
- package/dist/actions/format-load.action.js.map +1 -0
- package/dist/actions/format.action.d.ts +4 -0
- package/dist/actions/format.action.d.ts.map +1 -0
- package/dist/actions/format.action.js +2 -0
- package/dist/actions/format.action.js.map +1 -0
- package/dist/actions/index.d.ts +39 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +14 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/actions/ready.action.d.ts +3 -0
- package/dist/actions/ready.action.d.ts.map +1 -0
- package/dist/actions/ready.action.js +2 -0
- package/dist/actions/ready.action.js.map +1 -0
- package/dist/actions/report-flush.action.d.ts +6 -0
- package/dist/actions/report-flush.action.d.ts.map +1 -0
- package/dist/actions/report-flush.action.js +2 -0
- package/dist/actions/report-flush.action.js.map +1 -0
- package/dist/actions/request-dispatch.action.d.ts +13 -0
- package/dist/actions/request-dispatch.action.d.ts.map +1 -0
- package/dist/actions/request-dispatch.action.js +45 -0
- package/dist/actions/request-dispatch.action.js.map +1 -0
- package/dist/actions/traffic-load.action.d.ts +16 -0
- package/dist/actions/traffic-load.action.d.ts.map +1 -0
- package/dist/actions/traffic-load.action.js +36 -0
- package/dist/actions/traffic-load.action.js.map +1 -0
- package/dist/actions/validation-result.d.ts +18 -0
- package/dist/actions/validation-result.d.ts.map +1 -0
- package/dist/actions/validation-result.js +81 -0
- package/dist/actions/validation-result.js.map +1 -0
- package/dist/ajv.d.ts +5 -0
- package/dist/ajv.d.ts.map +1 -0
- package/dist/ajv.js +9 -0
- package/dist/ajv.js.map +1 -0
- package/dist/chalk.d.ts +2 -0
- package/dist/chalk.d.ts.map +1 -0
- package/dist/chalk.js +2 -0
- package/dist/chalk.js.map +1 -0
- package/dist/constants.d.ts +5 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +6 -0
- package/dist/constants.js.map +1 -0
- package/dist/core-plugin.d.ts +5 -0
- package/dist/core-plugin.d.ts.map +1 -0
- package/dist/core-plugin.js +62 -0
- package/dist/core-plugin.js.map +1 -0
- package/dist/emitter/action-event.d.ts +19 -0
- package/dist/emitter/action-event.d.ts.map +1 -0
- package/dist/emitter/action-event.js +2 -0
- package/dist/emitter/action-event.js.map +1 -0
- package/dist/emitter/error-event.d.ts +13 -0
- package/dist/emitter/error-event.d.ts.map +1 -0
- package/dist/emitter/error-event.js +2 -0
- package/dist/emitter/error-event.js.map +1 -0
- package/dist/emitter/events.d.ts +10 -0
- package/dist/emitter/events.d.ts.map +1 -0
- package/dist/emitter/events.js +2 -0
- package/dist/emitter/events.js.map +1 -0
- package/dist/emitter/index.d.ts +6 -0
- package/dist/emitter/index.d.ts.map +1 -0
- package/dist/emitter/index.js +6 -0
- package/dist/emitter/index.js.map +1 -0
- package/dist/emitter/thymian-emitter.d.ts +61 -0
- package/dist/emitter/thymian-emitter.d.ts.map +1 -0
- package/dist/emitter/thymian-emitter.js +371 -0
- package/dist/emitter/thymian-emitter.js.map +1 -0
- package/dist/emitter/utils.d.ts +8 -0
- package/dist/emitter/utils.d.ts.map +1 -0
- package/dist/emitter/utils.js +16 -0
- package/dist/emitter/utils.js.map +1 -0
- package/dist/events/error.event.d.ts +5 -0
- package/dist/events/error.event.d.ts.map +1 -0
- package/dist/events/error.event.js +49 -0
- package/dist/events/error.event.js.map +1 -0
- package/dist/events/exit.event.d.ts +14 -0
- package/dist/events/exit.event.d.ts.map +1 -0
- package/dist/events/exit.event.js +9 -0
- package/dist/events/exit.event.js.map +1 -0
- package/dist/events/index.d.ts +15 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +4 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/register-plugin.event.d.ts +51 -0
- package/dist/events/register-plugin.event.d.ts.map +1 -0
- package/dist/events/register-plugin.event.js +29 -0
- package/dist/events/register-plugin.event.js.map +1 -0
- package/dist/events/report.event.d.ts +104 -0
- package/dist/events/report.event.d.ts.map +1 -0
- package/dist/events/report.event.js +109 -0
- package/dist/events/report.event.js.map +1 -0
- package/dist/format/circular-references.d.ts +3 -0
- package/dist/format/circular-references.d.ts.map +1 -0
- package/dist/format/circular-references.js +71 -0
- package/dist/format/circular-references.js.map +1 -0
- package/dist/format/edges/edge.d.ts +9 -0
- package/dist/format/edges/edge.d.ts.map +1 -0
- package/dist/format/edges/edge.js +2 -0
- package/dist/format/edges/edge.js.map +1 -0
- package/dist/format/edges/has-sample.edge.d.ts +5 -0
- package/dist/format/edges/has-sample.edge.d.ts.map +1 -0
- package/dist/format/edges/has-sample.edge.js +2 -0
- package/dist/format/edges/has-sample.edge.js.map +1 -0
- package/dist/format/edges/http-link.edge.d.ts +10 -0
- package/dist/format/edges/http-link.edge.d.ts.map +1 -0
- package/dist/format/edges/http-link.edge.js +2 -0
- package/dist/format/edges/http-link.edge.js.map +1 -0
- package/dist/format/edges/http-transaction.edge.d.ts +5 -0
- package/dist/format/edges/http-transaction.edge.d.ts.map +1 -0
- package/dist/format/edges/http-transaction.edge.js +2 -0
- package/dist/format/edges/http-transaction.edge.js.map +1 -0
- package/dist/format/edges/is-secured-with.edge.d.ts +5 -0
- package/dist/format/edges/is-secured-with.edge.d.ts.map +1 -0
- package/dist/format/edges/is-secured-with.edge.js +2 -0
- package/dist/format/edges/is-secured-with.edge.js.map +1 -0
- package/dist/format/edges/sample-http-transaction.edge.d.ts +5 -0
- package/dist/format/edges/sample-http-transaction.edge.d.ts.map +1 -0
- package/dist/format/edges/sample-http-transaction.edge.js +2 -0
- package/dist/format/edges/sample-http-transaction.edge.js.map +1 -0
- package/dist/format/format-location.d.ts +13 -0
- package/dist/format/format-location.d.ts.map +1 -0
- package/dist/format/format-location.js +2 -0
- package/dist/format/format-location.js.map +1 -0
- package/dist/format/http-filter-expression-to-transaction-filter.d.ts +5 -0
- package/dist/format/http-filter-expression-to-transaction-filter.d.ts.map +1 -0
- package/dist/format/http-filter-expression-to-transaction-filter.js +88 -0
- package/dist/format/http-filter-expression-to-transaction-filter.js.map +1 -0
- package/dist/format/index.d.ts +14 -0
- package/dist/format/index.d.ts.map +1 -0
- package/dist/format/index.js +14 -0
- package/dist/format/index.js.map +1 -0
- package/dist/format/nodes/http-request.node.d.ts +29 -0
- package/dist/format/nodes/http-request.node.d.ts.map +1 -0
- package/dist/format/nodes/http-request.node.js +2 -0
- package/dist/format/nodes/http-request.node.js.map +1 -0
- package/dist/format/nodes/http-response.node.d.ts +12 -0
- package/dist/format/nodes/http-response.node.d.ts.map +1 -0
- package/dist/format/nodes/http-response.node.js +2 -0
- package/dist/format/nodes/http-response.node.js.map +1 -0
- package/dist/format/nodes/node.d.ts +9 -0
- package/dist/format/nodes/node.d.ts.map +1 -0
- package/dist/format/nodes/node.js +2 -0
- package/dist/format/nodes/node.js.map +1 -0
- package/dist/format/nodes/sample-http-request.node.d.ts +7 -0
- package/dist/format/nodes/sample-http-request.node.d.ts.map +1 -0
- package/dist/format/nodes/sample-http-request.node.js +2 -0
- package/dist/format/nodes/sample-http-request.node.js.map +1 -0
- package/dist/format/nodes/sample-http-response.node.d.ts +7 -0
- package/dist/format/nodes/sample-http-response.node.d.ts.map +1 -0
- package/dist/format/nodes/sample-http-response.node.js +2 -0
- package/dist/format/nodes/sample-http-response.node.js.map +1 -0
- package/dist/format/nodes/security-scheme.node.d.ts +17 -0
- package/dist/format/nodes/security-scheme.node.d.ts.map +1 -0
- package/dist/format/nodes/security-scheme.node.js +2 -0
- package/dist/format/nodes/security-scheme.node.js.map +1 -0
- package/dist/format/parameter.d.ts +10 -0
- package/dist/format/parameter.d.ts.map +1 -0
- package/dist/format/parameter.js +2 -0
- package/dist/format/parameter.js.map +1 -0
- package/dist/format/serialization-style/cookie.serialization-style.d.ts +5 -0
- package/dist/format/serialization-style/cookie.serialization-style.d.ts.map +1 -0
- package/dist/format/serialization-style/cookie.serialization-style.js +7 -0
- package/dist/format/serialization-style/cookie.serialization-style.js.map +1 -0
- package/dist/format/serialization-style/header.serialization-style.d.ts +5 -0
- package/dist/format/serialization-style/header.serialization-style.d.ts.map +1 -0
- package/dist/format/serialization-style/header.serialization-style.js +7 -0
- package/dist/format/serialization-style/header.serialization-style.js.map +1 -0
- package/dist/format/serialization-style/index.d.ts +6 -0
- package/dist/format/serialization-style/index.d.ts.map +1 -0
- package/dist/format/serialization-style/index.js +6 -0
- package/dist/format/serialization-style/index.js.map +1 -0
- package/dist/format/serialization-style/path.serialization-style.d.ts +5 -0
- package/dist/format/serialization-style/path.serialization-style.d.ts.map +1 -0
- package/dist/format/serialization-style/path.serialization-style.js +7 -0
- package/dist/format/serialization-style/path.serialization-style.js.map +1 -0
- package/dist/format/serialization-style/query.serialization-style.d.ts +5 -0
- package/dist/format/serialization-style/query.serialization-style.d.ts.map +1 -0
- package/dist/format/serialization-style/query.serialization-style.js +7 -0
- package/dist/format/serialization-style/query.serialization-style.js.map +1 -0
- package/dist/format/serialization-style/serialization-style.d.ts +13 -0
- package/dist/format/serialization-style/serialization-style.d.ts.map +1 -0
- package/dist/format/serialization-style/serialization-style.js +25 -0
- package/dist/format/serialization-style/serialization-style.js.map +1 -0
- package/dist/format/thymian-format.d.ts +109 -0
- package/dist/format/thymian-format.d.ts.map +1 -0
- package/dist/format/thymian-format.js +437 -0
- package/dist/format/thymian-format.js.map +1 -0
- package/dist/format/thymian-schema.d.ts +56 -0
- package/dist/format/thymian-schema.d.ts.map +1 -0
- package/dist/format/thymian-schema.js +2 -0
- package/dist/format/thymian-schema.js.map +1 -0
- package/dist/format/utils.d.ts +12 -0
- package/dist/format/utils.d.ts.map +1 -0
- package/dist/format/utils.js +85 -0
- package/dist/format/utils.js.map +1 -0
- package/dist/http-filter-visitor.d.ts +76 -0
- package/dist/http-filter-visitor.d.ts.map +1 -0
- package/dist/http-filter-visitor.js +168 -0
- package/dist/http-filter-visitor.js.map +1 -0
- package/dist/http-filter.d.ts +140 -0
- package/dist/http-filter.d.ts.map +1 -0
- package/dist/http-filter.js +137 -0
- package/dist/http-filter.js.map +1 -0
- package/dist/http-status-codes/1xx/index.d.ts +15 -0
- package/dist/http-status-codes/1xx/index.d.ts.map +1 -0
- package/dist/http-status-codes/1xx/index.js +15 -0
- package/dist/http-status-codes/1xx/index.js.map +1 -0
- package/dist/http-status-codes/1xx/informational.phrases.d.ts +4 -0
- package/dist/http-status-codes/1xx/informational.phrases.d.ts.map +1 -0
- package/dist/http-status-codes/1xx/informational.phrases.js +10 -0
- package/dist/http-status-codes/1xx/informational.phrases.js.map +1 -0
- package/dist/http-status-codes/1xx/informational.status-codes.d.ts +4 -0
- package/dist/http-status-codes/1xx/informational.status-codes.d.ts.map +1 -0
- package/dist/http-status-codes/1xx/informational.status-codes.js +5 -0
- package/dist/http-status-codes/1xx/informational.status-codes.js.map +1 -0
- package/dist/http-status-codes/2xx/index.d.ts +25 -0
- package/dist/http-status-codes/2xx/index.d.ts.map +1 -0
- package/dist/http-status-codes/2xx/index.js +25 -0
- package/dist/http-status-codes/2xx/index.js.map +1 -0
- package/dist/http-status-codes/2xx/successful.phrases.d.ts +4 -0
- package/dist/http-status-codes/2xx/successful.phrases.d.ts.map +1 -0
- package/dist/http-status-codes/2xx/successful.phrases.js +15 -0
- package/dist/http-status-codes/2xx/successful.phrases.js.map +1 -0
- package/dist/http-status-codes/2xx/successful.status-codes.d.ts +4 -0
- package/dist/http-status-codes/2xx/successful.status-codes.d.ts.map +1 -0
- package/dist/http-status-codes/2xx/successful.status-codes.js +7 -0
- package/dist/http-status-codes/2xx/successful.status-codes.js.map +1 -0
- package/dist/http-status-codes/3xx/index.d.ts +21 -0
- package/dist/http-status-codes/3xx/index.d.ts.map +1 -0
- package/dist/http-status-codes/3xx/index.js +21 -0
- package/dist/http-status-codes/3xx/index.js.map +1 -0
- package/dist/http-status-codes/3xx/redirection.phrases.d.ts +4 -0
- package/dist/http-status-codes/3xx/redirection.phrases.d.ts.map +1 -0
- package/dist/http-status-codes/3xx/redirection.phrases.js +13 -0
- package/dist/http-status-codes/3xx/redirection.phrases.js.map +1 -0
- package/dist/http-status-codes/3xx/redirection.status-codes.d.ts +4 -0
- package/dist/http-status-codes/3xx/redirection.status-codes.d.ts.map +1 -0
- package/dist/http-status-codes/3xx/redirection.status-codes.js +7 -0
- package/dist/http-status-codes/3xx/redirection.status-codes.js.map +1 -0
- package/dist/http-status-codes/4xx/client-error.phrases.d.ts +4 -0
- package/dist/http-status-codes/4xx/client-error.phrases.d.ts.map +1 -0
- package/dist/http-status-codes/4xx/client-error.phrases.js +34 -0
- package/dist/http-status-codes/4xx/client-error.phrases.js.map +1 -0
- package/dist/http-status-codes/4xx/client-error.status-codes.d.ts +4 -0
- package/dist/http-status-codes/4xx/client-error.status-codes.d.ts.map +1 -0
- package/dist/http-status-codes/4xx/client-error.status-codes.js +8 -0
- package/dist/http-status-codes/4xx/client-error.status-codes.js.map +1 -0
- package/dist/http-status-codes/4xx/index.d.ts +63 -0
- package/dist/http-status-codes/4xx/index.d.ts.map +1 -0
- package/dist/http-status-codes/4xx/index.js +63 -0
- package/dist/http-status-codes/4xx/index.js.map +1 -0
- package/dist/http-status-codes/5xx/index.d.ts +29 -0
- package/dist/http-status-codes/5xx/index.d.ts.map +1 -0
- package/dist/http-status-codes/5xx/index.js +29 -0
- package/dist/http-status-codes/5xx/index.js.map +1 -0
- package/dist/http-status-codes/5xx/server-error.phrases.d.ts +4 -0
- package/dist/http-status-codes/5xx/server-error.phrases.d.ts.map +1 -0
- package/dist/http-status-codes/5xx/server-error.phrases.js +17 -0
- package/dist/http-status-codes/5xx/server-error.phrases.js.map +1 -0
- package/dist/http-status-codes/5xx/server-error.status-codes.d.ts +4 -0
- package/dist/http-status-codes/5xx/server-error.status-codes.d.ts.map +1 -0
- package/dist/http-status-codes/5xx/server-error.status-codes.js +7 -0
- package/dist/http-status-codes/5xx/server-error.status-codes.js.map +1 -0
- package/dist/http-status-codes/http-status-code-ranges.d.ts +11 -0
- package/dist/http-status-codes/http-status-code-ranges.d.ts.map +1 -0
- package/dist/http-status-codes/http-status-code-ranges.js +19 -0
- package/dist/http-status-codes/http-status-code-ranges.js.map +1 -0
- package/dist/http-status-codes/http-status-code.d.ts +8 -0
- package/dist/http-status-codes/http-status-code.d.ts.map +1 -0
- package/dist/http-status-codes/http-status-code.js +13 -0
- package/dist/http-status-codes/http-status-code.js.map +1 -0
- package/dist/http-status-codes/http-status-phrase.d.ts +8 -0
- package/dist/http-status-codes/http-status-phrase.d.ts.map +1 -0
- package/dist/http-status-codes/http-status-phrase.js +13 -0
- package/dist/http-status-codes/http-status-phrase.js.map +1 -0
- package/dist/http-status-codes/index.d.ts +10 -0
- package/dist/http-status-codes/index.d.ts.map +1 -0
- package/dist/http-status-codes/index.js +10 -0
- package/dist/http-status-codes/index.js.map +1 -0
- package/dist/http-status-codes/phrase-to-status-code.d.ts +62 -0
- package/dist/http-status-codes/phrase-to-status-code.d.ts.map +1 -0
- package/dist/http-status-codes/phrase-to-status-code.js +13 -0
- package/dist/http-status-codes/phrase-to-status-code.js.map +1 -0
- package/dist/http-status-codes/status-code-to-phrase.d.ts +62 -0
- package/dist/http-status-codes/status-code-to-phrase.d.ts.map +1 -0
- package/dist/http-status-codes/status-code-to-phrase.js +13 -0
- package/dist/http-status-codes/status-code-to-phrase.js.map +1 -0
- package/dist/http-status-codes/validate.d.ts +5 -0
- package/dist/http-status-codes/validate.d.ts.map +1 -0
- package/dist/http-status-codes/validate.js +28 -0
- package/dist/http-status-codes/validate.js.map +1 -0
- package/dist/http-testing/http-test/create-hook-runner.d.ts +21 -0
- package/dist/http-testing/http-test/create-hook-runner.d.ts.map +1 -0
- package/dist/http-testing/http-test/create-hook-runner.js +17 -0
- package/dist/http-testing/http-test/create-hook-runner.js.map +1 -0
- package/dist/http-testing/http-test/create-http-test-context.d.ts +3 -0
- package/dist/http-testing/http-test/create-http-test-context.d.ts.map +1 -0
- package/dist/http-testing/http-test/create-http-test-context.js +24 -0
- package/dist/http-testing/http-test/create-http-test-context.js.map +1 -0
- package/dist/http-testing/http-test/http-test-case-result.d.ts +46 -0
- package/dist/http-testing/http-test/http-test-case-result.d.ts.map +1 -0
- package/dist/http-testing/http-test/http-test-case-result.js +2 -0
- package/dist/http-testing/http-test/http-test-case-result.js.map +1 -0
- package/dist/http-testing/http-test/http-test-case.d.ts +36 -0
- package/dist/http-testing/http-test/http-test-case.d.ts.map +1 -0
- package/dist/http-testing/http-test/http-test-case.js +2 -0
- package/dist/http-testing/http-test/http-test-case.js.map +1 -0
- package/dist/http-testing/http-test/http-test-context.d.ts +20 -0
- package/dist/http-testing/http-test/http-test-context.d.ts.map +1 -0
- package/dist/http-testing/http-test/http-test-context.js +2 -0
- package/dist/http-testing/http-test/http-test-context.js.map +1 -0
- package/dist/http-testing/http-test/http-test-hooks.d.ts +26 -0
- package/dist/http-testing/http-test/http-test-hooks.d.ts.map +1 -0
- package/dist/http-testing/http-test/http-test-hooks.js +2 -0
- package/dist/http-testing/http-test/http-test-hooks.js.map +1 -0
- package/dist/http-testing/http-test/http-test-pipeline.d.ts +10 -0
- package/dist/http-testing/http-test/http-test-pipeline.d.ts.map +1 -0
- package/dist/http-testing/http-test/http-test-pipeline.js +2 -0
- package/dist/http-testing/http-test/http-test-pipeline.js.map +1 -0
- package/dist/http-testing/http-test/http-test.d.ts +11 -0
- package/dist/http-testing/http-test/http-test.d.ts.map +1 -0
- package/dist/http-testing/http-test/http-test.js +35 -0
- package/dist/http-testing/http-test/http-test.js.map +1 -0
- package/dist/http-testing/http-test/index.d.ts +10 -0
- package/dist/http-testing/http-test/index.d.ts.map +1 -0
- package/dist/http-testing/http-test/index.js +10 -0
- package/dist/http-testing/http-test/index.js.map +1 -0
- package/dist/http-testing/http-test/utils.d.ts +11 -0
- package/dist/http-testing/http-test/utils.d.ts.map +1 -0
- package/dist/http-testing/http-test/utils.js +16 -0
- package/dist/http-testing/http-test/utils.js.map +1 -0
- package/dist/http-testing/index.d.ts +7 -0
- package/dist/http-testing/index.d.ts.map +1 -0
- package/dist/http-testing/index.js +7 -0
- package/dist/http-testing/index.js.map +1 -0
- package/dist/http-testing/operators/expect-for-transaction.operator.d.ts +5 -0
- package/dist/http-testing/operators/expect-for-transaction.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/expect-for-transaction.operator.js +39 -0
- package/dist/http-testing/operators/expect-for-transaction.operator.js.map +1 -0
- package/dist/http-testing/operators/expect-headers.operator.d.ts +4 -0
- package/dist/http-testing/operators/expect-headers.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/expect-headers.operator.js +37 -0
- package/dist/http-testing/operators/expect-headers.operator.js.map +1 -0
- package/dist/http-testing/operators/expect-status-code.operator.d.ts +5 -0
- package/dist/http-testing/operators/expect-status-code.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/expect-status-code.operator.js +55 -0
- package/dist/http-testing/operators/expect-status-code.operator.js.map +1 -0
- package/dist/http-testing/operators/expect.operator.d.ts +4 -0
- package/dist/http-testing/operators/expect.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/expect.operator.js +31 -0
- package/dist/http-testing/operators/expect.operator.js.map +1 -0
- package/dist/http-testing/operators/fail.operator.d.ts +4 -0
- package/dist/http-testing/operators/fail.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/fail.operator.js +8 -0
- package/dist/http-testing/operators/fail.operator.js.map +1 -0
- package/dist/http-testing/operators/filter-http-transactions.operator.d.ts +10 -0
- package/dist/http-testing/operators/filter-http-transactions.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/filter-http-transactions.operator.js +18 -0
- package/dist/http-testing/operators/filter-http-transactions.operator.js.map +1 -0
- package/dist/http-testing/operators/generate-requests.operator.d.ts +10 -0
- package/dist/http-testing/operators/generate-requests.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/generate-requests.operator.js +44 -0
- package/dist/http-testing/operators/generate-requests.operator.js.map +1 -0
- package/dist/http-testing/operators/index.d.ts +21 -0
- package/dist/http-testing/operators/index.d.ts.map +1 -0
- package/dist/http-testing/operators/index.js +21 -0
- package/dist/http-testing/operators/index.js.map +1 -0
- package/dist/http-testing/operators/map-to-grouped-test-case.operator.d.ts +7 -0
- package/dist/http-testing/operators/map-to-grouped-test-case.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/map-to-grouped-test-case.operator.js +32 -0
- package/dist/http-testing/operators/map-to-grouped-test-case.operator.js.map +1 -0
- package/dist/http-testing/operators/map-to-test-case.operator.d.ts +7 -0
- package/dist/http-testing/operators/map-to-test-case.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/map-to-test-case.operator.js +21 -0
- package/dist/http-testing/operators/map-to-test-case.operator.js.map +1 -0
- package/dist/http-testing/operators/override-headers.operator.d.ts +5 -0
- package/dist/http-testing/operators/override-headers.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/override-headers.operator.js +18 -0
- package/dist/http-testing/operators/override-headers.operator.js.map +1 -0
- package/dist/http-testing/operators/override-with-previous.operator.d.ts +5 -0
- package/dist/http-testing/operators/override-with-previous.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/override-with-previous.operator.js +23 -0
- package/dist/http-testing/operators/override-with-previous.operator.js.map +1 -0
- package/dist/http-testing/operators/replay-previous-step.operator.d.ts +5 -0
- package/dist/http-testing/operators/replay-previous-step.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/replay-previous-step.operator.js +27 -0
- package/dist/http-testing/operators/replay-previous-step.operator.js.map +1 -0
- package/dist/http-testing/operators/reply-previous-but-expect-response.operator.d.ts +7 -0
- package/dist/http-testing/operators/reply-previous-but-expect-response.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/reply-previous-but-expect-response.operator.js +61 -0
- package/dist/http-testing/operators/reply-previous-but-expect-response.operator.js.map +1 -0
- package/dist/http-testing/operators/requires-authorization.operator.d.ts +5 -0
- package/dist/http-testing/operators/requires-authorization.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/requires-authorization.operator.js +9 -0
- package/dist/http-testing/operators/requires-authorization.operator.js.map +1 -0
- package/dist/http-testing/operators/run-requests.operator.d.ts +14 -0
- package/dist/http-testing/operators/run-requests.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/run-requests.operator.js +139 -0
- package/dist/http-testing/operators/run-requests.operator.js.map +1 -0
- package/dist/http-testing/operators/single-step-for-transaction.operator.d.ts +5 -0
- package/dist/http-testing/operators/single-step-for-transaction.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/single-step-for-transaction.operator.js +43 -0
- package/dist/http-testing/operators/single-step-for-transaction.operator.js.map +1 -0
- package/dist/http-testing/operators/skip.operator.d.ts +5 -0
- package/dist/http-testing/operators/skip.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/skip.operator.js +11 -0
- package/dist/http-testing/operators/skip.operator.js.map +1 -0
- package/dist/http-testing/operators/step.operator.d.ts +5 -0
- package/dist/http-testing/operators/step.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/step.operator.js +20 -0
- package/dist/http-testing/operators/step.operator.js.map +1 -0
- package/dist/http-testing/operators/utils.d.ts +10 -0
- package/dist/http-testing/operators/utils.d.ts.map +1 -0
- package/dist/http-testing/operators/utils.js +17 -0
- package/dist/http-testing/operators/utils.js.map +1 -0
- package/dist/http-testing/operators/validate-responses.operator.d.ts +4 -0
- package/dist/http-testing/operators/validate-responses.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/validate-responses.operator.js +33 -0
- package/dist/http-testing/operators/validate-responses.operator.js.map +1 -0
- package/dist/http-testing/serialize-parameter.d.ts +6 -0
- package/dist/http-testing/serialize-parameter.d.ts.map +1 -0
- package/dist/http-testing/serialize-parameter.js +51 -0
- package/dist/http-testing/serialize-parameter.js.map +1 -0
- package/dist/http-testing/serialize-request.d.ts +7 -0
- package/dist/http-testing/serialize-request.d.ts.map +1 -0
- package/dist/http-testing/serialize-request.js +112 -0
- package/dist/http-testing/serialize-request.js.map +1 -0
- package/dist/http-testing/test-builder/builder-pipeline.d.ts +4 -0
- package/dist/http-testing/test-builder/builder-pipeline.d.ts.map +1 -0
- package/dist/http-testing/test-builder/builder-pipeline.js +2 -0
- package/dist/http-testing/test-builder/builder-pipeline.js.map +1 -0
- package/dist/http-testing/test-builder/compilers/http-filter-to-transaction-filter.d.ts +9 -0
- package/dist/http-testing/test-builder/compilers/http-filter-to-transaction-filter.d.ts.map +1 -0
- package/dist/http-testing/test-builder/compilers/http-filter-to-transaction-filter.js +114 -0
- package/dist/http-testing/test-builder/compilers/http-filter-to-transaction-filter.js.map +1 -0
- package/dist/http-testing/test-builder/compilers/response-scoped-to-response-checker.d.ts +4 -0
- package/dist/http-testing/test-builder/compilers/response-scoped-to-response-checker.d.ts.map +1 -0
- package/dist/http-testing/test-builder/compilers/response-scoped-to-response-checker.js +36 -0
- package/dist/http-testing/test-builder/compilers/response-scoped-to-response-checker.js.map +1 -0
- package/dist/http-testing/test-builder/compilers/response-scoped-to-transaction-validator.d.ts +4 -0
- package/dist/http-testing/test-builder/compilers/response-scoped-to-transaction-validator.d.ts.map +1 -0
- package/dist/http-testing/test-builder/compilers/response-scoped-to-transaction-validator.js +65 -0
- package/dist/http-testing/test-builder/compilers/response-scoped-to-transaction-validator.js.map +1 -0
- package/dist/http-testing/test-builder/extract-value-from-response.d.ts +4 -0
- package/dist/http-testing/test-builder/extract-value-from-response.d.ts.map +1 -0
- package/dist/http-testing/test-builder/extract-value-from-response.js +16 -0
- package/dist/http-testing/test-builder/extract-value-from-response.js.map +1 -0
- package/dist/http-testing/test-builder/override-request-template.d.ts +4 -0
- package/dist/http-testing/test-builder/override-request-template.d.ts.map +1 -0
- package/dist/http-testing/test-builder/override-request-template.js +33 -0
- package/dist/http-testing/test-builder/override-request-template.js.map +1 -0
- package/dist/http-testing/test-builder/reply-step-builder.d.ts +10 -0
- package/dist/http-testing/test-builder/reply-step-builder.d.ts.map +1 -0
- package/dist/http-testing/test-builder/reply-step-builder.js +39 -0
- package/dist/http-testing/test-builder/reply-step-builder.js.map +1 -0
- package/dist/http-testing/test-builder/single-step-test-builder.d.ts +42 -0
- package/dist/http-testing/test-builder/single-step-test-builder.d.ts.map +1 -0
- package/dist/http-testing/test-builder/single-step-test-builder.js +112 -0
- package/dist/http-testing/test-builder/single-step-test-builder.js.map +1 -0
- package/dist/http-testing/validate/ajv.d.ts +3 -0
- package/dist/http-testing/validate/ajv.d.ts.map +1 -0
- package/dist/http-testing/validate/ajv.js +7 -0
- package/dist/http-testing/validate/ajv.js.map +1 -0
- package/dist/http-testing/validate/index.d.ts +9 -0
- package/dist/http-testing/validate/index.d.ts.map +1 -0
- package/dist/http-testing/validate/index.js +9 -0
- package/dist/http-testing/validate/index.js.map +1 -0
- package/dist/http-testing/validate/validate-body.d.ts +5 -0
- package/dist/http-testing/validate/validate-body.d.ts.map +1 -0
- package/dist/http-testing/validate/validate-body.js +62 -0
- package/dist/http-testing/validate/validate-body.js.map +1 -0
- package/dist/http-testing/validate/validate-headers.d.ts +8 -0
- package/dist/http-testing/validate/validate-headers.d.ts.map +1 -0
- package/dist/http-testing/validate/validate-headers.js +101 -0
- package/dist/http-testing/validate/validate-headers.js.map +1 -0
- package/dist/http-testing/validate/validate-request-body.d.ts +5 -0
- package/dist/http-testing/validate/validate-request-body.d.ts.map +1 -0
- package/dist/http-testing/validate/validate-request-body.js +71 -0
- package/dist/http-testing/validate/validate-request-body.js.map +1 -0
- package/dist/http-testing/validate/validate-request-headers.d.ts +8 -0
- package/dist/http-testing/validate/validate-request-headers.d.ts.map +1 -0
- package/dist/http-testing/validate/validate-request-headers.js +93 -0
- package/dist/http-testing/validate/validate-request-headers.js.map +1 -0
- package/dist/http-testing/validate/validate-request-path-parameters.d.ts +6 -0
- package/dist/http-testing/validate/validate-request-path-parameters.d.ts.map +1 -0
- package/dist/http-testing/validate/validate-request-path-parameters.js +69 -0
- package/dist/http-testing/validate/validate-request-path-parameters.js.map +1 -0
- package/dist/http-testing/validate/validate-request-query-parameters.d.ts +7 -0
- package/dist/http-testing/validate/validate-request-query-parameters.d.ts.map +1 -0
- package/dist/http-testing/validate/validate-request-query-parameters.js +91 -0
- package/dist/http-testing/validate/validate-request-query-parameters.js.map +1 -0
- package/dist/http-testing/validate/validate-response.d.ts +7 -0
- package/dist/http-testing/validate/validate-response.d.ts.map +1 -0
- package/dist/http-testing/validate/validate-response.js +15 -0
- package/dist/http-testing/validate/validate-response.js.map +1 -0
- package/dist/http-testing/validate/validate-status-code.d.ts +3 -0
- package/dist/http-testing/validate/validate-status-code.d.ts.map +1 -0
- package/dist/http-testing/validate/validate-status-code.js +25 -0
- package/dist/http-testing/validate/validate-status-code.js.map +1 -0
- package/dist/http.d.ts +29 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +2 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/logger/log-level.d.ts +5 -0
- package/dist/logger/log-level.d.ts.map +1 -0
- package/dist/logger/log-level.js +24 -0
- package/dist/logger/log-level.js.map +1 -0
- package/dist/logger/logger.d.ts +13 -0
- package/dist/logger/logger.d.ts.map +1 -0
- package/dist/logger/logger.js +2 -0
- package/dist/logger/logger.js.map +1 -0
- package/dist/logger/noop.logger.d.ts +15 -0
- package/dist/logger/noop.logger.d.ts.map +1 -0
- package/dist/logger/noop.logger.js +18 -0
- package/dist/logger/noop.logger.js.map +1 -0
- package/dist/logger/text.logger.d.ts +16 -0
- package/dist/logger/text.logger.d.ts.map +1 -0
- package/dist/logger/text.logger.js +51 -0
- package/dist/logger/text.logger.js.map +1 -0
- package/dist/report-sorter.d.ts +16 -0
- package/dist/report-sorter.d.ts.map +1 -0
- package/dist/report-sorter.js +193 -0
- package/dist/report-sorter.js.map +1 -0
- package/dist/rules/ajv-validate.d.ts +2 -0
- package/dist/rules/ajv-validate.d.ts.map +1 -0
- package/dist/rules/ajv-validate.js +4 -0
- package/dist/rules/ajv-validate.js.map +1 -0
- package/dist/rules/captured-trace-to-string.d.ts +3 -0
- package/dist/rules/captured-trace-to-string.d.ts.map +1 -0
- package/dist/rules/captured-trace-to-string.js +27 -0
- package/dist/rules/captured-trace-to-string.js.map +1 -0
- package/dist/rules/common-http-converters.d.ts +8 -0
- package/dist/rules/common-http-converters.d.ts.map +1 -0
- package/dist/rules/common-http-converters.js +58 -0
- package/dist/rules/common-http-converters.js.map +1 -0
- package/dist/rules/contexts.d.ts +63 -0
- package/dist/rules/contexts.d.ts.map +1 -0
- package/dist/rules/contexts.js +2 -0
- package/dist/rules/contexts.js.map +1 -0
- package/dist/rules/index.d.ts +16 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +16 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/rule-builder.d.ts +34 -0
- package/dist/rules/rule-builder.d.ts.map +1 -0
- package/dist/rules/rule-builder.js +112 -0
- package/dist/rules/rule-builder.js.map +1 -0
- package/dist/rules/rule-configuration.d.ts +10 -0
- package/dist/rules/rule-configuration.d.ts.map +1 -0
- package/dist/rules/rule-configuration.js +2 -0
- package/dist/rules/rule-configuration.js.map +1 -0
- package/dist/rules/rule-filter.d.ts +9 -0
- package/dist/rules/rule-filter.d.ts.map +1 -0
- package/dist/rules/rule-filter.js +12 -0
- package/dist/rules/rule-filter.js.map +1 -0
- package/dist/rules/rule-fn.d.ts +7 -0
- package/dist/rules/rule-fn.d.ts.map +1 -0
- package/dist/rules/rule-fn.js +2 -0
- package/dist/rules/rule-fn.js.map +1 -0
- package/dist/rules/rule-loader.d.ts +8 -0
- package/dist/rules/rule-loader.d.ts.map +1 -0
- package/dist/rules/rule-loader.js +124 -0
- package/dist/rules/rule-loader.js.map +1 -0
- package/dist/rules/rule-meta.d.ts +20 -0
- package/dist/rules/rule-meta.d.ts.map +1 -0
- package/dist/rules/rule-meta.js +18 -0
- package/dist/rules/rule-meta.js.map +1 -0
- package/dist/rules/rule-runner.d.ts +30 -0
- package/dist/rules/rule-runner.d.ts.map +1 -0
- package/dist/rules/rule-runner.js +129 -0
- package/dist/rules/rule-runner.js.map +1 -0
- package/dist/rules/rule-set.d.ts +9 -0
- package/dist/rules/rule-set.d.ts.map +1 -0
- package/dist/rules/rule-set.js +2 -0
- package/dist/rules/rule-set.js.map +1 -0
- package/dist/rules/rule-severity.d.ts +10 -0
- package/dist/rules/rule-severity.d.ts.map +1 -0
- package/dist/rules/rule-severity.js +12 -0
- package/dist/rules/rule-severity.js.map +1 -0
- package/dist/rules/rule-violation.d.ts +22 -0
- package/dist/rules/rule-violation.d.ts.map +1 -0
- package/dist/rules/rule-violation.js +2 -0
- package/dist/rules/rule-violation.js.map +1 -0
- package/dist/rules/rule.d.ts +10 -0
- package/dist/rules/rule.d.ts.map +1 -0
- package/dist/rules/rule.js +2 -0
- package/dist/rules/rule.js.map +1 -0
- package/dist/rules/traffic.d.ts +25 -0
- package/dist/rules/traffic.d.ts.map +1 -0
- package/dist/rules/traffic.js +2 -0
- package/dist/rules/traffic.js.map +1 -0
- package/dist/thymian-plugin.d.ts +38 -0
- package/dist/thymian-plugin.d.ts.map +1 -0
- package/dist/thymian-plugin.js +24 -0
- package/dist/thymian-plugin.js.map +1 -0
- package/dist/thymian.d.ts +85 -0
- package/dist/thymian.d.ts.map +1 -0
- package/dist/thymian.error.d.ts +26 -0
- package/dist/thymian.error.d.ts.map +1 -0
- package/dist/thymian.error.js +34 -0
- package/dist/thymian.error.js.map +1 -0
- package/dist/thymian.js +322 -0
- package/dist/thymian.js.map +1 -0
- package/dist/utils.d.ts +40 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +139 -0
- package/dist/utils.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/http-testing/operators/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAM1C,MAAM,UAAU,cAAc,CAG5B,GAAM,EAAE,GAAM;IACd,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,KAAc;IAEd,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,cAAc,IAAI,KAAK,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,KAAc;IAEd,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,cAAc,IAAI,KAAK,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,QAA6B;IAI7B,OAAO;IACP,6DAA6D;IAC7D,mBAAmB;IACnB,OAAO,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type MonoTypeOperatorFunction } from 'rxjs';
|
|
2
|
+
import { type HttpTestCase, type HttpTestCaseStep, type PipelineItem } from '../http-test/index.js';
|
|
3
|
+
export declare function validateResponses<Steps extends HttpTestCaseStep[]>(): MonoTypeOperatorFunction<PipelineItem<HttpTestCase<Steps>>>;
|
|
4
|
+
//# sourceMappingURL=validate-responses.operator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-responses.operator.d.ts","sourceRoot":"","sources":["../../../src/http-testing/operators/validate-responses.operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,wBAAwB,EAAE,MAAM,MAAM,CAAC;AAG/D,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EAGrB,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAI/B,wBAAgB,iBAAiB,CAC/B,KAAK,SAAS,gBAAgB,EAAE,KAC7B,wBAAwB,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CA0C/D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { mergeMap } from 'rxjs';
|
|
2
|
+
import { isFailedTestCase, isSkippedTestCase, } from '../http-test/index.js';
|
|
3
|
+
import { validateResponse } from '../validate/index.js';
|
|
4
|
+
import { hasThymianResId } from './utils.js';
|
|
5
|
+
export function validateResponses() {
|
|
6
|
+
return mergeMap(async ({ current, ctx }) => {
|
|
7
|
+
if (isSkippedTestCase(current) || isFailedTestCase(current)) {
|
|
8
|
+
return { current, ctx };
|
|
9
|
+
}
|
|
10
|
+
const step = current.steps.at(-1);
|
|
11
|
+
if (!step) {
|
|
12
|
+
return { current, ctx };
|
|
13
|
+
}
|
|
14
|
+
for (const transaction of step.transactions) {
|
|
15
|
+
if (!(transaction.response && hasThymianResId(transaction.source))) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
const response = ctx.format.getNode(transaction.source.thymianResId);
|
|
19
|
+
if (!response) {
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
const result = validateResponse(transaction.source.thymianRes, transaction.response, ctx.format
|
|
23
|
+
.getHttpResponsesOf(transaction.source.thymianReqId)
|
|
24
|
+
.map(([, response]) => response));
|
|
25
|
+
current.results.push(...result.results);
|
|
26
|
+
if (!result.valid) {
|
|
27
|
+
ctx.fail(current, 'Invalid response.');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return { current, ctx };
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=validate-responses.operator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-responses.operator.js","sourceRoot":"","sources":["../../../src/http-testing/operators/validate-responses.operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAiC,MAAM,MAAM,CAAC;AAG/D,OAAO,EAGL,gBAAgB,EAChB,iBAAiB,GAElB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,UAAU,iBAAiB;IAG/B,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE;QACzC,IAAI,iBAAiB,CAAC,OAAO,CAAC,IAAI,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5D,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;QAC1B,CAAC;QAED,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAElC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;QAC1B,CAAC;QAED,KAAK,MAAM,WAAW,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YAC5C,IAAI,CAAC,CAAC,WAAW,CAAC,QAAQ,IAAI,eAAe,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;gBACnE,SAAS;YACX,CAAC;YAED,MAAM,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CACjC,WAAW,CAAC,MAAM,CAAC,YAAY,CAChC,CAAC;YAEF,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,SAAS;YACX,CAAC;YAED,MAAM,MAAM,GAAG,gBAAgB,CAC7B,WAAW,CAAC,MAAM,CAAC,UAAU,EAC7B,WAAW,CAAC,QAAQ,EACpB,GAAG,CAAC,MAAM;iBACP,kBAAkB,CAAC,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC;iBACnD,GAAG,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CACnC,CAAC;YAEF,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;YAExC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;gBAClB,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;YACzC,CAAC;QACH,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SerializationStyle } from '../index.js';
|
|
2
|
+
export declare function serializePathParameter(name: string, content: unknown, serializationStyle: SerializationStyle): string;
|
|
3
|
+
export declare function serializeHeaderParameter(name: string, content: unknown, serializationStyle: SerializationStyle): string;
|
|
4
|
+
export declare function serializeCookieParameter(name: string, content: unknown): string;
|
|
5
|
+
export declare function serializeQueryParameter(name: string, content: unknown, serializationStyle: SerializationStyle): string;
|
|
6
|
+
//# sourceMappingURL=serialize-parameter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize-parameter.d.ts","sourceRoot":"","sources":["../../src/http-testing/serialize-parameter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,kBAAkB,GACrC,MAAM,CAcR;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,kBAAkB,GACrC,MAAM,CAMR;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,GACf,MAAM,CAIR;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,kBAAkB,GACrC,MAAM,CAmCR"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { parseTemplate } from 'url-template';
|
|
2
|
+
export function serializePathParameter(name, content, serializationStyle) {
|
|
3
|
+
let prefix = '';
|
|
4
|
+
if (serializationStyle.style === 'label') {
|
|
5
|
+
prefix = '.';
|
|
6
|
+
}
|
|
7
|
+
else if (serializationStyle.style === 'matrix') {
|
|
8
|
+
prefix = ';';
|
|
9
|
+
}
|
|
10
|
+
const postfix = serializationStyle.explode ? '*' : '';
|
|
11
|
+
const template = `{${prefix}${name}${postfix}}`;
|
|
12
|
+
return parseTemplate(template).expand({ [name]: content });
|
|
13
|
+
}
|
|
14
|
+
export function serializeHeaderParameter(name, content, serializationStyle) {
|
|
15
|
+
const postfix = serializationStyle.explode ? '*' : '';
|
|
16
|
+
const template = `{${name}${postfix}}`;
|
|
17
|
+
return parseTemplate(template).expand({ [name]: content });
|
|
18
|
+
}
|
|
19
|
+
export function serializeCookieParameter(name, content) {
|
|
20
|
+
return parseTemplate(`{${name}}`).expand({
|
|
21
|
+
[name]: content,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export function serializeQueryParameter(name, content, serializationStyle) {
|
|
25
|
+
// See matrix https://swagger.io/docs/specification/v3_0/serialization/#query-parameters
|
|
26
|
+
const queryParameterTemplates = {
|
|
27
|
+
label: {},
|
|
28
|
+
matrix: {},
|
|
29
|
+
simple: {},
|
|
30
|
+
form: {
|
|
31
|
+
true: `{?${name}*}`,
|
|
32
|
+
false: `{?${name}}`,
|
|
33
|
+
},
|
|
34
|
+
spaceDelimited: {
|
|
35
|
+
true: `{?${name}*}`,
|
|
36
|
+
},
|
|
37
|
+
pipeDelimited: {
|
|
38
|
+
true: `{?${name}*}`,
|
|
39
|
+
},
|
|
40
|
+
deepObject: {},
|
|
41
|
+
};
|
|
42
|
+
const { style, explode } = serializationStyle;
|
|
43
|
+
const template = queryParameterTemplates[style]?.[String(explode)];
|
|
44
|
+
if (typeof template === 'undefined') {
|
|
45
|
+
throw new Error(`Serialization with style "${style}" and explode "${explode}" is currently not supported.`);
|
|
46
|
+
}
|
|
47
|
+
return parseTemplate(template)
|
|
48
|
+
.expand({ [name]: content })
|
|
49
|
+
.replace('?', '');
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=serialize-parameter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize-parameter.js","sourceRoot":"","sources":["../../src/http-testing/serialize-parameter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAuB,MAAM,cAAc,CAAC;AAIlE,MAAM,UAAU,sBAAsB,CACpC,IAAY,EACZ,OAAgB,EAChB,kBAAsC;IAEtC,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,IAAI,kBAAkB,CAAC,KAAK,KAAK,OAAO,EAAE,CAAC;QACzC,MAAM,GAAG,GAAG,CAAC;IACf,C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AAI,EAAE,KAAK,IAAI,IAAI;SACpB;QACD,aAAa,EAAE;YACb,IAAI,EAAE,KAAK,IAAI,IAAI;SACpB;QACD,UAAU,EAAE,EAAE;KACf,CAAC;IAEF,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,kBAAkB,CAAC;IAC9C,MAAM,QAAQ,GACZ,uBAAuB,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAqB,CAAC,CAAC;IAExE,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CACb,6BAA6B,KAAK,kBAAkB,OAAO,+BAA+B,CAC3F,CAAC;IACJ,CAAC;IAED,OAAO,aAAa,CAAC,QAAQ,CAAC;SAC3B,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAyB,EAAE,CAAC;SAC7C,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type HttpRequest } from '../index.js';
|
|
2
|
+
import type { HttpTestCaseStepTransaction } from './http-test/http-test-case.js';
|
|
3
|
+
export declare function serializePath(transaction: HttpTestCaseStepTransaction): string;
|
|
4
|
+
export declare function serializeHeaders(transaction: HttpTestCaseStepTransaction): Record<string, string>;
|
|
5
|
+
export declare function serializeBody(body: unknown): string | undefined;
|
|
6
|
+
export declare function serializeRequest(transaction: HttpTestCaseStepTransaction): HttpRequest;
|
|
7
|
+
//# sourceMappingURL=serialize-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize-request.d.ts","sourceRoot":"","sources":["../../src/http-testing/serialize-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAkC,MAAM,aAAa,CAAC;AAC/E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAyFjF,wBAAgB,aAAa,CAC3B,WAAW,EAAE,2BAA2B,GACvC,MAAM,CAMR;AAED,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,2BAA2B,GACvC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAqBxB;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAyB/D;AAED,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,2BAA2B,GACvC,WAAW,CAgBb"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { thymianHttpTransactionToString } from '../index.js';
|
|
2
|
+
import { serializeHeaderParameter, serializePathParameter, serializeQueryParameter, } from './serialize-parameter.js';
|
|
3
|
+
function serializeBasePath(transaction) {
|
|
4
|
+
return transaction.requestTemplate.path.replace(
|
|
5
|
+
// from https://github.com/scalar/scalar/blob/8165b3b1487ef38a1e97571032b0bd8c32cd9d91/packages/helpers/src/regex/regex-helpers.ts#L8
|
|
6
|
+
/{{\s*([^}\s]+?)\s*}}|{\s*([^}\s]+?)\s*}|:\b[\w.]+\b/g, (_, __, parameterName) => {
|
|
7
|
+
if (transaction.requestTemplate.pathParameters[parameterName] !== undefined) {
|
|
8
|
+
if (transaction.source?.thymianReq.pathParameters[parameterName]) {
|
|
9
|
+
return serializePathParameter(parameterName, transaction.requestTemplate.pathParameters[parameterName], transaction.source.thymianReq.pathParameters[parameterName].style);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
const type = typeof transaction.requestTemplate.pathParameters[parameterName];
|
|
13
|
+
if (type === 'string' ||
|
|
14
|
+
type === 'number' ||
|
|
15
|
+
type === 'boolean' ||
|
|
16
|
+
type === 'bigint' ||
|
|
17
|
+
type === 'symbol') {
|
|
18
|
+
return String(transaction.requestTemplate.pathParameters[parameterName]);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
throw new Error(`Value of path parameter "${parameterName}" must be of type string but got "${type}".`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
const transactionName = transaction.source
|
|
27
|
+
? thymianHttpTransactionToString(transaction.source.thymianReq, transaction.source.thymianRes)
|
|
28
|
+
: `${transaction.requestTemplate.method.toUpperCase()} ${transaction.requestTemplate.origin}${transaction.requestTemplate.path}`;
|
|
29
|
+
throw new Error(`Missing value for path parameter "${parameterName}" of transaction "${transactionName}".`);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function serializeQuery(transaction) {
|
|
34
|
+
return Object.entries(transaction.requestTemplate.query)
|
|
35
|
+
.map(([name, value]) => {
|
|
36
|
+
if (transaction.source?.thymianReq.queryParameters[name]) {
|
|
37
|
+
return serializeQueryParameter(name, value, transaction.source?.thymianReq.queryParameters[name].style);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
const type = typeof value;
|
|
41
|
+
if (type === 'string' ||
|
|
42
|
+
type === 'number' ||
|
|
43
|
+
type === 'boolean' ||
|
|
44
|
+
type === 'bigint' ||
|
|
45
|
+
type === 'symbol') {
|
|
46
|
+
return encodeURIComponent(String(value));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
throw new Error(`Invalid type for query parameter. Got type: ${type}.`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
.join('&');
|
|
54
|
+
}
|
|
55
|
+
export function serializePath(transaction) {
|
|
56
|
+
const path = serializeBasePath(transaction);
|
|
57
|
+
const query = serializeQuery(transaction);
|
|
58
|
+
return query ? `${path}?${query}` : path;
|
|
59
|
+
}
|
|
60
|
+
export function serializeHeaders(transaction) {
|
|
61
|
+
const headers = transaction.source?.thymianReq.headers ?? {};
|
|
62
|
+
return Object.entries(transaction.requestTemplate.headers).reduce((acc, [key, value]) => {
|
|
63
|
+
if (typeof value === 'string') {
|
|
64
|
+
acc[key] = value;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
if (headers[key]) {
|
|
68
|
+
acc[key] = serializeHeaderParameter(key, value, headers[key].style);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
throw new Error(`Header value must be of type "string" but got "${typeof value}".`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return acc;
|
|
75
|
+
}, {});
|
|
76
|
+
}
|
|
77
|
+
export function serializeBody(body) {
|
|
78
|
+
const type = typeof body;
|
|
79
|
+
if (type === 'boolean' ||
|
|
80
|
+
type === 'number' ||
|
|
81
|
+
type === 'symbol' ||
|
|
82
|
+
type === 'bigint') {
|
|
83
|
+
return String(body);
|
|
84
|
+
}
|
|
85
|
+
if (type === 'object') {
|
|
86
|
+
try {
|
|
87
|
+
return JSON.stringify(body);
|
|
88
|
+
}
|
|
89
|
+
catch (e) {
|
|
90
|
+
throw new Error(`Cannot stringify request body. Error: ${e}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (type === 'function') {
|
|
94
|
+
throw new Error('Cannot serialize body with type "function".');
|
|
95
|
+
}
|
|
96
|
+
return body;
|
|
97
|
+
}
|
|
98
|
+
export function serializeRequest(transaction) {
|
|
99
|
+
if (!transaction.requestTemplate) {
|
|
100
|
+
throw new Error('Missing request template for transaction ' +
|
|
101
|
+
transaction.source?.transactionId);
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
body: serializeBody(transaction.requestTemplate.body),
|
|
105
|
+
bodyEncoding: transaction.requestTemplate.bodyEncoding,
|
|
106
|
+
headers: serializeHeaders(transaction),
|
|
107
|
+
method: transaction.requestTemplate.method,
|
|
108
|
+
origin: transaction.requestTemplate.origin,
|
|
109
|
+
path: serializePath(transaction),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=serialize-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize-request.js","sourceRoot":"","sources":["../../src/http-testing/serialize-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAE/E,OAA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SAAS,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,EAAE,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;IAED,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACjE,CAAC;IAED,OAAO,IAA0B,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,WAAwC;IAExC,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CACb,2CAA2C;YACzC,WAAW,CAAC,MAAM,EAAE,aAAa,CACpC,CAAC;IACJ,CAAC;IAED,OAAO;QACL,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC;QACrD,YAAY,EAAE,WAAW,CAAC,eAAe,CAAC,YAAY;QACtD,OAAO,EAAE,gBAAgB,CAAC,WAAW,CAAC;QACtC,MAAM,EAAE,WAAW,CAAC,eAAe,CAAC,MAAM;QAC1C,MAAM,EAAE,WAAW,CAAC,eAAe,CAAC,MAAM;QAC1C,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC;KACjC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder-pipeline.d.ts","sourceRoot":"","sources":["../../../src/http-testing/test-builder/builder-pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAE7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,MAAM,eAAe,GAAG,gBAAgB,CAE5C,YAAY,CAAC,GAAG,CAAC,EAEjB,YAAY,CAAC,GAAG,CAAC,CAClB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder-pipeline.js","sourceRoot":"","sources":["../../../src/http-testing/test-builder/builder-pipeline.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type RequestFilterExpression } from '../../../index.js';
|
|
2
|
+
import { type ThymianFormat, type ThymianHttpRequest, type ThymianHttpResponse } from '../../../index.js';
|
|
3
|
+
import { type HttpFilterExpression, type ResponseFilterExpression } from '../../../index.js';
|
|
4
|
+
export type TransactionFilterFn = (req: ThymianHttpRequest, reqId: string, res: ThymianHttpResponse, resId: string, responses: [string, ThymianHttpResponse][]) => boolean;
|
|
5
|
+
export declare function httpFilterToTransactionFilter(filterExpression: HttpFilterExpression, format: ThymianFormat): TransactionFilterFn;
|
|
6
|
+
export declare function responseScopeHttpFilterToTransactionFilter(expression: ResponseFilterExpression): TransactionFilterFn;
|
|
7
|
+
export declare function requestScopedHttpFilterToTransactionFilter(filterExpression: RequestFilterExpression, format: ThymianFormat): TransactionFilterFn;
|
|
8
|
+
export declare function createRegExpFromOriginWildcard(pattern: string): RegExp;
|
|
9
|
+
//# sourceMappingURL=http-filter-to-transaction-filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-filter-to-transaction-filter.d.ts","sourceRoot":"","sources":["../../../../src/http-testing/test-builder/compilers/http-filter-to-transaction-filter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC9B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,mBAAmB,GAAG,CAChC,GAAG,EAAE,kBAAkB,EACvB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,mBAAmB,EACxB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,CAAC,MAAM,EAAE,mBAAmB,CAAC,EAAE,KACvC,OAAO,CAAC;AAEb,wBAAgB,6BAA6B,CAC3C,gBAAgB,EAAE,oBAAoB,EACtC,MAAM,EAAE,aAAa,GACpB,mBAAmB,CAmFrB;AAED,wBAAgB,0CAA0C,CACxD,UAAU,EAAE,wBAAwB,GACnC,mBAAmB,CA6CrB;AAED,wBAAgB,0CAA0C,CACxD,gBAAgB,EAAE,uBAAuB,EACzC,MAAM,EAAE,aAAa,GACpB,mBAAmB,CAoFrB;AAED,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGtE"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { thymianRequestToOrigin, } from '../../../index.js';
|
|
2
|
+
import { equalsIgnoreCase, } from '../../../index.js';
|
|
3
|
+
import {} from '../../../index.js';
|
|
4
|
+
export function httpFilterToTransactionFilter(filterExpression, format) {
|
|
5
|
+
switch (filterExpression.kind) {
|
|
6
|
+
case 'request':
|
|
7
|
+
return requestScopedHttpFilterToTransactionFilter(filterExpression, format);
|
|
8
|
+
case 'response':
|
|
9
|
+
return responseScopeHttpFilterToTransactionFilter(filterExpression);
|
|
10
|
+
case 'logic': {
|
|
11
|
+
if (filterExpression.type === 'and') {
|
|
12
|
+
return (req, reqId, res, resId, responses) => filterExpression.filters.every((expr) => httpFilterToTransactionFilter(expr, format)(req, reqId, res, resId, responses));
|
|
13
|
+
}
|
|
14
|
+
else if (filterExpression.type === 'or') {
|
|
15
|
+
return (req, reqId, res, resId, responses) => filterExpression.filters.some((expr) => httpFilterToTransactionFilter(expr, format)(req, reqId, res, resId, responses));
|
|
16
|
+
}
|
|
17
|
+
else if (filterExpression.type === 'xor') {
|
|
18
|
+
return (req, reqId, res, resId, responses) => filterExpression.filters
|
|
19
|
+
.map((expr) => httpFilterToTransactionFilter(expr, format)(req, reqId, res, resId, responses))
|
|
20
|
+
.reduce((acc, curr) => acc !== curr);
|
|
21
|
+
}
|
|
22
|
+
else if (filterExpression.type === 'not') {
|
|
23
|
+
return (req, reqId, res, resId, responses) => !httpFilterToTransactionFilter(filterExpression.filter, format)(req, reqId, res, resId, responses);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
return () => Boolean(filterExpression.value);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export function responseScopeHttpFilterToTransactionFilter(expression) {
|
|
32
|
+
switch (expression.type) {
|
|
33
|
+
case 'responseMediaType':
|
|
34
|
+
return (req, reqId, res) => res.mediaType === expression.mediaType;
|
|
35
|
+
case 'responseTrailer':
|
|
36
|
+
// TODO
|
|
37
|
+
throw new Error('Currently response trailers are not supported.');
|
|
38
|
+
case 'statusCode':
|
|
39
|
+
return (req, reqId, res) => res.statusCode === expression.code;
|
|
40
|
+
case 'hasResponseBody':
|
|
41
|
+
return (req, reqId, res) => !!res.schema;
|
|
42
|
+
case 'responseHeader': {
|
|
43
|
+
if (typeof expression.header === 'undefined') {
|
|
44
|
+
return () => false;
|
|
45
|
+
}
|
|
46
|
+
return (req, reqId, res) => equalsIgnoreCase(expression.header, ...Object.keys(res.headers));
|
|
47
|
+
}
|
|
48
|
+
case 'statusCodeRange':
|
|
49
|
+
return (req, reqId, res) => Number.isInteger(res.statusCode) &&
|
|
50
|
+
res.statusCode >= expression.start &&
|
|
51
|
+
res.statusCode <= expression.end;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export function requestScopedHttpFilterToTransactionFilter(filterExpression, format) {
|
|
55
|
+
switch (filterExpression.type) {
|
|
56
|
+
case 'origin':
|
|
57
|
+
return (req) => `${req.protocol}://${req.host}:${req.port}` === filterExpression.origin;
|
|
58
|
+
case 'hasBody':
|
|
59
|
+
return (req) => !!req.bodyRequired;
|
|
60
|
+
case 'url':
|
|
61
|
+
return (req) => `${req.protocol}://${req.host}:${req.port}${req.path.startsWith('/') ? req.path : '/' + req.path}` === filterExpression.url;
|
|
62
|
+
case 'port':
|
|
63
|
+
return (req) => req.port === filterExpression.port;
|
|
64
|
+
case 'requestMediaType':
|
|
65
|
+
return (req) => req.mediaType === filterExpression.mediaType;
|
|
66
|
+
case 'method': {
|
|
67
|
+
if (typeof filterExpression.method === 'undefined') {
|
|
68
|
+
return () => false;
|
|
69
|
+
}
|
|
70
|
+
return (req) =>
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
72
|
+
equalsIgnoreCase(req.method, filterExpression.method);
|
|
73
|
+
}
|
|
74
|
+
case 'requestHeader': {
|
|
75
|
+
if (typeof filterExpression.header === 'undefined') {
|
|
76
|
+
return () => false;
|
|
77
|
+
}
|
|
78
|
+
return (req) =>
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
80
|
+
equalsIgnoreCase(filterExpression.header, ...Object.keys(req.headers));
|
|
81
|
+
}
|
|
82
|
+
case 'queryParam': {
|
|
83
|
+
if (typeof filterExpression.param === 'undefined') {
|
|
84
|
+
return () => false;
|
|
85
|
+
}
|
|
86
|
+
return (req) => equalsIgnoreCase(
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
88
|
+
filterExpression.param, ...Object.keys(req.queryParameters));
|
|
89
|
+
}
|
|
90
|
+
case 'path':
|
|
91
|
+
return (req) => req.path === filterExpression.path;
|
|
92
|
+
case 'hasResponse':
|
|
93
|
+
return (req, reqId, res, resId, responses) => {
|
|
94
|
+
const fn = httpFilterToTransactionFilter(filterExpression.filter, format);
|
|
95
|
+
return responses.some(([resId, res]) => fn(req, reqId, res, resId, responses));
|
|
96
|
+
};
|
|
97
|
+
case 'isAuthorized':
|
|
98
|
+
return (_, reqId) => format.requestIsSecured(reqId) === filterExpression.isAuthorized;
|
|
99
|
+
case 'matches-origin': {
|
|
100
|
+
if (typeof filterExpression.origin === 'undefined') {
|
|
101
|
+
return () => false;
|
|
102
|
+
}
|
|
103
|
+
const regExp = createRegExpFromOriginWildcard(filterExpression.origin);
|
|
104
|
+
return (req) => regExp.test(thymianRequestToOrigin(req));
|
|
105
|
+
}
|
|
106
|
+
default:
|
|
107
|
+
throw new Error(`Invalid expression: ${JSON.stringify(filterExpression, null, 2)}.`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
export function createRegExpFromOriginWildcard(pattern) {
|
|
111
|
+
const regexString = `${pattern.replace(/\./g, '\\.').replace(/\*/g, '.*')}/?(:\\d{1,5})?$`;
|
|
112
|
+
return new RegExp(regexString);
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=http-filter-to-transaction-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-filter-to-transaction-filter.js","sourceRoot":"","sources":["../../../../src/http-testing/test-builder/compilers/http-filter-to-transaction-filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,gBAAgB,GAIjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAGN,MAAM,mBAAmB,CAAC;AAU3B,MAAM,UAAU,6BAA6B,CAC3C,gBAAsC,EACtC,MAAqB;IAErB,QAAQ,gBAAgB,CAAC,IAAI,EAAE,CAAC;QAC9B,KAAK,SAAS;YACZ,OAAO,0CAA0C,CAC/C,gBAAgB,EAChB,MAAM,CACP,CAAC;QACJ,KAAK,UAAU;YACb,OAAO,0CAA0C,CAAC,gBAAgB,CAAC,CAAC;QACtE,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,IAAI,gBAAgB,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;gBACpC,OAAO,CACL,GAAuB,EACvB,KAAa,EACb,GAAwB,EACxB,KAAa,EACb,SAA0C,EAC1C,EAAE,CACF,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CACtC,6BAA6B,CAAC,IAAI,EAAE,MAAM,CAAC,CACzC,GAAG,EACH,KAAK,EACL,GAAG,EACH,K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O,gBAAgB,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;gBACnD,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC;YACrB,CAAC;YAED,MAAM,MAAM,GAAG,8BAA8B,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;YAEvE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3D,CAAC;QAED;YACE,MAAM,IAAI,KAAK,CACb,uBAAuB,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,CACpE,CAAC;IACN,CAAC;AACH,CAAC;AAED,MAAM,UAAU,8BAA8B,CAAC,OAAe;IAC5D,MAAM,WAAW,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,CAAC;IAC3F,OAAO,IAAI,MAAM,CAAC,WAAW,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { HttpFilterExpression } from '../../../index.js';
|
|
2
|
+
import { type HttpResponse } from '../../../index.js';
|
|
3
|
+
export declare function compileResponseScopedToResponseChecker(expression: HttpFilterExpression, response: HttpResponse): boolean;
|
|
4
|
+
//# sourceMappingURL=response-scoped-to-response-checker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-scoped-to-response-checker.d.ts","sourceRoot":"","sources":["../../../../src/http-testing/test-builder/compilers/response-scoped-to-response-checker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAE3B,wBAAgB,sCAAsC,CACpD,UAAU,EAAE,oBAAoB,EAChC,QAAQ,EAAE,YAAY,GACrB,OAAO,CA4CT"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { equalsIgnoreCase, getHeader, } from '../../../index.js';
|
|
2
|
+
export function compileResponseScopedToResponseChecker(expression, response) {
|
|
3
|
+
if (expression.kind === 'request') {
|
|
4
|
+
throw new Error();
|
|
5
|
+
}
|
|
6
|
+
switch (expression.type) {
|
|
7
|
+
case 'statusCode':
|
|
8
|
+
return expression.code === response.statusCode;
|
|
9
|
+
case 'hasResponseBody':
|
|
10
|
+
return expression.hasBody === !!response.body;
|
|
11
|
+
case 'responseHeader': {
|
|
12
|
+
if (typeof expression.header === 'undefined') {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
return expression.value
|
|
16
|
+
? getHeader(response.headers, expression.header) === expression.value
|
|
17
|
+
: equalsIgnoreCase(expression.header, ...Object.keys(response.headers));
|
|
18
|
+
}
|
|
19
|
+
case 'statusCodeRange':
|
|
20
|
+
return (response.statusCode <= expression.end &&
|
|
21
|
+
response.statusCode >= expression.start);
|
|
22
|
+
case 'and':
|
|
23
|
+
return expression.filters.every((expr) => compileResponseScopedToResponseChecker(expr, response));
|
|
24
|
+
case 'or':
|
|
25
|
+
return expression.filters.some((expr) => compileResponseScopedToResponseChecker(expr, response));
|
|
26
|
+
case 'not':
|
|
27
|
+
return !compileResponseScopedToResponseChecker(expression.filter, response);
|
|
28
|
+
case 'xor':
|
|
29
|
+
return expression.filters
|
|
30
|
+
.map((expr) => compileResponseScopedToResponseChecker(expr, response))
|
|
31
|
+
.reduce((acc, curr) => acc !== curr);
|
|
32
|
+
default:
|
|
33
|
+
throw new Error();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=response-scoped-to-response-checker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-scoped-to-response-checker.js","sourceRoot":"","sources":["../../../../src/http-testing/test-builder/compilers/response-scoped-to-response-checker.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gB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E,QAAQ,CAAC,CACvD,CAAC;QACJ,KAAK,KAAK;YACR,OAAO,CAAC,sCAAsC,CAC5C,UAAU,CAAC,MAAM,EACjB,QAAQ,CACT,CAAC;QACJ,KAAK,KAAK;YACR,OAAO,UAAU,CAAC,OAAO;iBACtB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,sCAAsC,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;iBACrE,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC;QACzC;YACE,MAAM,IAAI,KAAK,EAAE,CAAC;IACtB,CAAC;AACH,CAAC"}
|
package/dist/http-testing/test-builder/compilers/response-scoped-to-transaction-validator.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { HttpFilterExpression } from '../../../index.js';
|
|
2
|
+
import type { HttpTestCaseTransactionValidationFn } from '../../operators/index.js';
|
|
3
|
+
export declare function compileResponseScopedExpressionToTransactionValidationFn(expression: HttpFilterExpression): HttpTestCaseTransactionValidationFn;
|
|
4
|
+
//# sourceMappingURL=response-scoped-to-transaction-validator.d.ts.map
|
package/dist/http-testing/test-builder/compilers/response-scoped-to-transaction-validator.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-scoped-to-transaction-validator.d.ts","sourceRoot":"","sources":["../../../../src/http-testing/test-builder/compilers/response-scoped-to-transaction-validator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,0BAA0B,CAAC;AAEpF,wBAAgB,wDAAwD,CACtE,UAAU,EAAE,oBAAoB,GAC/B,mCAAmC,CA6FrC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import assert from 'node:assert';
|
|
2
|
+
import { equalsIgnoreCase } from '../../../index.js';
|
|
3
|
+
export function compileResponseScopedExpressionToTransactionValidationFn(expression) {
|
|
4
|
+
if (expression.kind === 'request') {
|
|
5
|
+
throw new Error('Cannot used an request-based HTTP filter in a response-based context.');
|
|
6
|
+
}
|
|
7
|
+
switch (expression.type) {
|
|
8
|
+
case 'responseMediaType':
|
|
9
|
+
return (transaction) => assert.strictEqual(transaction.response?.headers['content-type'], expression.mediaType);
|
|
10
|
+
case 'responseTrailer':
|
|
11
|
+
if (typeof expression.trailer === 'undefined') {
|
|
12
|
+
return () => true;
|
|
13
|
+
}
|
|
14
|
+
return (transaction) => {
|
|
15
|
+
if (expression.value) {
|
|
16
|
+
assert.strictEqual(transaction.response?.trailers[expression.trailer], expression.value);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
assert.ok(transaction.response?.trailers[expression.trailer]);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
case 'constant':
|
|
23
|
+
return () => Boolean(expression.value);
|
|
24
|
+
case 'statusCode':
|
|
25
|
+
return (transaction) => assert.strictEqual(transaction.response?.statusCode, expression.code);
|
|
26
|
+
case 'hasResponseBody':
|
|
27
|
+
return (transaction) => assert.ok(transaction.response?.body);
|
|
28
|
+
case 'responseHeader': {
|
|
29
|
+
if (typeof expression.header === 'undefined') {
|
|
30
|
+
return () => true;
|
|
31
|
+
}
|
|
32
|
+
return (transaction) => assert.ok(equalsIgnoreCase(
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
34
|
+
expression.header, ...Object.keys(transaction.response?.headers ?? {})));
|
|
35
|
+
}
|
|
36
|
+
case 'statusCodeRange':
|
|
37
|
+
return (transaction) => {
|
|
38
|
+
assert.ok(transaction.response?.statusCode);
|
|
39
|
+
assert.ok(Number.isInteger(transaction.response?.statusCode));
|
|
40
|
+
assert.ok(transaction.response.statusCode >= expression.start);
|
|
41
|
+
assert.ok(transaction.response.statusCode <= expression.end);
|
|
42
|
+
};
|
|
43
|
+
case 'and':
|
|
44
|
+
return (transaction) => expression.filters.every((expr) => compileResponseScopedExpressionToTransactionValidationFn(expr)(transaction));
|
|
45
|
+
case 'or':
|
|
46
|
+
return (transaction) => expression.filters.some((expr) => {
|
|
47
|
+
compileResponseScopedExpressionToTransactionValidationFn(expr)(transaction);
|
|
48
|
+
});
|
|
49
|
+
case 'xor':
|
|
50
|
+
return (transaction) => expression.filters.every((expr) => compileResponseScopedExpressionToTransactionValidationFn(expr)(transaction));
|
|
51
|
+
case 'not':
|
|
52
|
+
return (transaction) => {
|
|
53
|
+
try {
|
|
54
|
+
compileResponseScopedExpressionToTransactionValidationFn(expression.filter)(transaction);
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
throw new assert.AssertionError({
|
|
60
|
+
message: 'Expression did not fail.',
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=response-scoped-to-transaction-validator.js.map
|
package/dist/http-testing/test-builder/compilers/response-scoped-to-transaction-validator.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-scoped-to-transaction-validator.js","sourceRoot":"","sources":["../../../../src/http-testing/test-builder/compilers/response-scoped-to-transaction-validator.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AAGjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGrD,MAAM,UAAU,wDAAwD,CACtE,UAAgC;IAEhC,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CACb,uEAAuE,CACxE,CAAC;IACJ,CAAC;IAED,QAAQ,UAAU,CAAC,IAAI,EAAE,CAAC;QACxB,KAAK,mBAAmB;YACtB,OAAO,CAAC,WAAW,EAAE,EAAE,CACrB,MAAM,CAAC,WAAW,CAChB,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,cAAc,CAAC,EAC7C,U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MAAM,CAAC;oBACP,OAAO;gBACT,CAAC;gBAED,MAAM,IAAI,MAAM,CAAC,cAAc,CAAC;oBAC9B,OAAO,EAAE,0BAA0B;iBACpC,CAAC,CAAC;YACL,CAAC,CAAC;IACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ResponseFilterExpression } from '../../index.js';
|
|
2
|
+
import { type HttpResponse } from '../../index.js';
|
|
3
|
+
export declare function extractValueFromResponse(response: HttpResponse, filter: ResponseFilterExpression): unknown;
|
|
4
|
+
//# sourceMappingURL=extract-value-from-response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-value-from-response.d.ts","sourceRoot":"","sources":["../../../src/http-testing/test-builder/extract-value-from-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9D,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAaT"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getHeader } from '../../index.js';
|
|
2
|
+
export function extractValueFromResponse(response, filter) {
|
|
3
|
+
switch (filter.type) {
|
|
4
|
+
case 'statusCode':
|
|
5
|
+
return response.statusCode;
|
|
6
|
+
case 'responseHeader':
|
|
7
|
+
return response.headers[filter.header ?? ''];
|
|
8
|
+
case 'responseMediaType':
|
|
9
|
+
return getHeader(response.headers, 'content-type');
|
|
10
|
+
case 'responseTrailer':
|
|
11
|
+
return getHeader(response.trailers, filter.trailer ?? ''); // TODO How should we handle undefined values?
|
|
12
|
+
default:
|
|
13
|
+
throw new Error(`Invalid expression type "${filter.type}".`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=extract-value-from-response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-value-from-response.js","sourceRoot":"","sources":["../../../src/http-testing/test-builder/extract-value-from-response.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAqB,MAAM,gBAAgB,CAAC;AAE9D,MAAM,UAAU,wBAAwB,CACtC,QAAsB,EACtB,MAAgC;IAEhC,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,YAAY;YACf,OAAO,QAAQ,CAAC,UAAU,CAAC;QAC7B,KAAK,gBAAgB;YACnB,OAAO,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;QAC/C,KAAK,mBAAmB;YACtB,OAAO,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QACrD,KAAK,iBAAiB;YACpB,OAAO,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,8CAA8C;QAC3G;YACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC;IACjE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RequestFilterExpression } from '../../index.js';
|
|
2
|
+
import { type HttpRequestTemplate } from '../../index.js';
|
|
3
|
+
export declare function overrideTemplate(template: HttpRequestTemplate, toRequest: RequestFilterExpression, value: unknown): HttpRequestTemplate;
|
|
4
|
+
//# sourceMappingURL=override-request-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"override-request-template.d.ts","sourceRoot":"","sources":["../../../src/http-testing/test-builder/override-request-template.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,KAAK,mBAAmB,EAAa,MAAM,gBAAgB,CAAC;AAErE,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,mBAAmB,EAC7B,SAAS,EAAE,uBAAuB,EAClC,KAAK,EAAE,OAAO,GACb,mBAAmB,CAiCrB"}
|