@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,51 @@
|
|
|
1
|
+
import { format } from 'node:util';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { shouldLog } from './log-level.js';
|
|
4
|
+
export class TextLogger {
|
|
5
|
+
namespace;
|
|
6
|
+
level;
|
|
7
|
+
constructor(name, level = 'warn') {
|
|
8
|
+
this.namespace = name;
|
|
9
|
+
this.level = level;
|
|
10
|
+
}
|
|
11
|
+
trace(formatter, ...args) {
|
|
12
|
+
if (shouldLog('trace', this.level)) {
|
|
13
|
+
console.error(`${chalk.grey(`TRACE`)} [${this.now()}] [${this.namespace}]: ${format(formatter, ...args)}`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
warn(formatter, ...args) {
|
|
17
|
+
if (shouldLog('warn', this.level)) {
|
|
18
|
+
console.error(`${chalk.yellow(`WARN`)} [${this.now()}] [${this.namespace}]: ${format(formatter, ...args)}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
debug(formatter, ...args) {
|
|
22
|
+
if (shouldLog('debug', this.level)) {
|
|
23
|
+
console.error(`${chalk.blue(`DEBUG`)} [${this.now()}] [${this.namespace}]: ${format(formatter, ...args)}`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
info(formatter, ...args) {
|
|
27
|
+
if (shouldLog('info', this.level)) {
|
|
28
|
+
console.error(`${chalk.green(`INFO`)} [${this.now()}] [${this.namespace}]: ${format(formatter, ...args)}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
error(formatter, ...args) {
|
|
32
|
+
if (shouldLog('error', this.level)) {
|
|
33
|
+
console.error(`${chalk.red(`ERROR`)} [${this.now()}] [${this.namespace}]: ${format(formatter, ...args)}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
out(output) {
|
|
37
|
+
if (this.level === 'silent') {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (typeof output !== 'undefined') {
|
|
41
|
+
console.log(output);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
child(name) {
|
|
45
|
+
return new TextLogger(name, this.level);
|
|
46
|
+
}
|
|
47
|
+
now() {
|
|
48
|
+
return new Date().toISOString().replace(/\.\d{3}Z$/, 'Z');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=text.logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.logger.js","sourceRoot":"","sources":["../../src/logger/text.logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,MAAM,OAAO,UAAU;IACZ,SAAS,CAAS;IAClB,KAAK,CAAW;IAEzB,YAAY,IAAY,EAAE,QAAkB,MAAM;QAChD,IAAI,CAAC,SAAS,G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AAC,KAAK,IAAI,CAAC,GAAG,EAAE,MAAM,IAAI,CAAC,SAAS,MAAM,MAAM,CACnE,SAAS,EACT,GAAG,IAAI,CACR,EAAE,CACJ,CAAC;QACJ,CAAC;IACH,CAAC;IACD,KAAK,CAAC,SAAkB,EAAE,GAAG,IAAe;QAC1C,IAAI,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO,CAAC,KAAK,CACX,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,MAAM,IAAI,CAAC,SAAS,MAAM,MAAM,CAClE,SAAS,EACT,GAAG,IAAI,CACR,EAAE,CACJ,CAAC;QACJ,CAAC;IACH,CAAC;IACD,GAAG,CAAC,MAAe;QACjB,IAAI,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC5B,OAAO;QACT,CAAC;QAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IACD,KAAK,CAAC,IAAY;QAChB,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IAEO,GAAG;QACT,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAC5D,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ThymianReport } from './events/report.event.js';
|
|
2
|
+
/**
|
|
3
|
+
* Supported sort modes for reshaping reports before presentation.
|
|
4
|
+
*/
|
|
5
|
+
export type ReportSortMode = 'rule' | 'endpoint' | 'severity';
|
|
6
|
+
/**
|
|
7
|
+
* Reshape reports according to the selected sort mode.
|
|
8
|
+
*
|
|
9
|
+
* - `rule`: Group by rule name, each section heading is the rule name
|
|
10
|
+
* - `endpoint`: Group by endpoint/location heading (closest to natural insertion order)
|
|
11
|
+
* - `severity`: Group by severity level in order error → warn → hint → info
|
|
12
|
+
*
|
|
13
|
+
* When no sort mode is specified or reports are empty, returns the original reports unchanged.
|
|
14
|
+
*/
|
|
15
|
+
export declare function sortReports(reports: ThymianReport[], mode: ReportSortMode | undefined): ThymianReport[];
|
|
16
|
+
//# sourceMappingURL=report-sorter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-sorter.d.ts","sourceRoot":"","sources":["../src/report-sorter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAId,MAAM,0BAA0B,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;AAyN9D;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,aAAa,EAAE,EACxB,IAAI,EAAE,cAAc,GAAG,SAAS,GAC/B,aAAa,EAAE,CAajB"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Severity sort order: error → warn → hint → info.
|
|
3
|
+
*/
|
|
4
|
+
const severityOrder = {
|
|
5
|
+
error: 0,
|
|
6
|
+
warn: 1,
|
|
7
|
+
hint: 2,
|
|
8
|
+
info: 3,
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Human-friendly labels for severity-grouped section headings.
|
|
12
|
+
* Used by `sortBySeverity` to produce readable headings like "Errors (3)".
|
|
13
|
+
*/
|
|
14
|
+
const severityLabel = {
|
|
15
|
+
error: 'Errors',
|
|
16
|
+
warn: 'Warnings',
|
|
17
|
+
hint: 'Hints',
|
|
18
|
+
info: 'Info',
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Flatten all items from all reports into a single attributed list.
|
|
22
|
+
*/
|
|
23
|
+
function flattenReports(reports) {
|
|
24
|
+
const items = [];
|
|
25
|
+
for (const report of reports) {
|
|
26
|
+
for (const section of report.sections ?? []) {
|
|
27
|
+
for (const item of section.items) {
|
|
28
|
+
items.push({
|
|
29
|
+
item,
|
|
30
|
+
sectionHeading: section.heading,
|
|
31
|
+
source: report.source,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return items;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Build a combined message from the original reports.
|
|
40
|
+
*/
|
|
41
|
+
function combineMessages(reports) {
|
|
42
|
+
const messages = reports.map((r) => r.message).filter(Boolean);
|
|
43
|
+
return messages.join(' ');
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Build a combined source from the original reports.
|
|
47
|
+
*/
|
|
48
|
+
function combineSources(reports) {
|
|
49
|
+
const sources = [...new Set(reports.map((r) => r.source))];
|
|
50
|
+
return sources.join(', ');
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Create a shallow copy of an item with the message replaced by the original
|
|
54
|
+
* section heading (endpoint / location context).
|
|
55
|
+
*
|
|
56
|
+
* When items are regrouped by rule or severity the original section heading
|
|
57
|
+
* that carried the endpoint context (e.g. "GET /users → 200 OK") is no
|
|
58
|
+
* longer visible. Replacing the message with the heading makes the endpoint
|
|
59
|
+
* the primary information shown under each rule / severity group.
|
|
60
|
+
*/
|
|
61
|
+
function withEndpointAsMessage(item, sectionHeading) {
|
|
62
|
+
return {
|
|
63
|
+
...item,
|
|
64
|
+
message: sectionHeading,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Sort by rule name (default): flatten all items, group by `ruleName`,
|
|
69
|
+
* each section heading is the rule name with affected endpoints listed as items.
|
|
70
|
+
*/
|
|
71
|
+
function sortByRule(reports) {
|
|
72
|
+
const items = flattenReports(reports);
|
|
73
|
+
const groups = new Map();
|
|
74
|
+
for (const { item, sectionHeading } of items) {
|
|
75
|
+
const key = item.ruleName ?? '(no rule)';
|
|
76
|
+
let group = groups.get(key);
|
|
77
|
+
if (!group) {
|
|
78
|
+
group = { items: [] };
|
|
79
|
+
groups.set(key, group);
|
|
80
|
+
}
|
|
81
|
+
group.items.push(withEndpointAsMessage(item, sectionHeading));
|
|
82
|
+
}
|
|
83
|
+
const sections = [];
|
|
84
|
+
for (const [ruleName, group] of groups) {
|
|
85
|
+
sections.push({
|
|
86
|
+
heading: ruleName,
|
|
87
|
+
items: group.items,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return [
|
|
91
|
+
{
|
|
92
|
+
source: combineSources(reports),
|
|
93
|
+
message: combineMessages(reports),
|
|
94
|
+
sections,
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Sort by endpoint: group by section heading (location/endpoint).
|
|
100
|
+
* This is closest to the current insertion-order rendering.
|
|
101
|
+
*/
|
|
102
|
+
function sortByEndpoint(reports) {
|
|
103
|
+
const items = flattenReports(reports);
|
|
104
|
+
const groups = new Map();
|
|
105
|
+
// Preserve original section locations from the reports
|
|
106
|
+
const sectionLocations = new Map();
|
|
107
|
+
for (const report of reports) {
|
|
108
|
+
for (const section of report.sections ?? []) {
|
|
109
|
+
if (section.location && !sectionLocations.has(section.heading)) {
|
|
110
|
+
sectionLocations.set(section.heading, section.location);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
for (const { item, sectionHeading } of items) {
|
|
115
|
+
let group = groups.get(sectionHeading);
|
|
116
|
+
if (!group) {
|
|
117
|
+
group = { items: [], location: sectionLocations.get(sectionHeading) };
|
|
118
|
+
groups.set(sectionHeading, group);
|
|
119
|
+
}
|
|
120
|
+
group.items.push(item);
|
|
121
|
+
}
|
|
122
|
+
const sections = [];
|
|
123
|
+
for (const [heading, group] of groups) {
|
|
124
|
+
sections.push({
|
|
125
|
+
heading,
|
|
126
|
+
items: group.items,
|
|
127
|
+
location: group.location,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
return [
|
|
131
|
+
{
|
|
132
|
+
source: combineSources(reports),
|
|
133
|
+
message: combineMessages(reports),
|
|
134
|
+
sections,
|
|
135
|
+
},
|
|
136
|
+
];
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Sort by severity: flatten all items, group by severity level
|
|
140
|
+
* in order error → warn → hint → info.
|
|
141
|
+
*/
|
|
142
|
+
function sortBySeverity(reports) {
|
|
143
|
+
const items = flattenReports(reports);
|
|
144
|
+
const groups = new Map();
|
|
145
|
+
for (const { item, sectionHeading } of items) {
|
|
146
|
+
let group = groups.get(item.severity);
|
|
147
|
+
if (!group) {
|
|
148
|
+
group = [];
|
|
149
|
+
groups.set(item.severity, group);
|
|
150
|
+
}
|
|
151
|
+
group.push(withEndpointAsMessage(item, sectionHeading));
|
|
152
|
+
}
|
|
153
|
+
// Sort groups by severity order
|
|
154
|
+
const sortedEntries = [...groups.entries()].sort(([a], [b]) => severityOrder[a] - severityOrder[b]);
|
|
155
|
+
const sections = [];
|
|
156
|
+
for (const [severity, groupItems] of sortedEntries) {
|
|
157
|
+
const label = severityLabel[severity];
|
|
158
|
+
sections.push({
|
|
159
|
+
heading: `${label} (${groupItems.length})`,
|
|
160
|
+
items: groupItems,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return [
|
|
164
|
+
{
|
|
165
|
+
source: combineSources(reports),
|
|
166
|
+
message: combineMessages(reports),
|
|
167
|
+
sections,
|
|
168
|
+
},
|
|
169
|
+
];
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Reshape reports according to the selected sort mode.
|
|
173
|
+
*
|
|
174
|
+
* - `rule`: Group by rule name, each section heading is the rule name
|
|
175
|
+
* - `endpoint`: Group by endpoint/location heading (closest to natural insertion order)
|
|
176
|
+
* - `severity`: Group by severity level in order error → warn → hint → info
|
|
177
|
+
*
|
|
178
|
+
* When no sort mode is specified or reports are empty, returns the original reports unchanged.
|
|
179
|
+
*/
|
|
180
|
+
export function sortReports(reports, mode) {
|
|
181
|
+
if (!mode || reports.length === 0) {
|
|
182
|
+
return reports;
|
|
183
|
+
}
|
|
184
|
+
switch (mode) {
|
|
185
|
+
case 'rule':
|
|
186
|
+
return sortByRule(reports);
|
|
187
|
+
case 'endpoint':
|
|
188
|
+
return sortByEndpoint(reports);
|
|
189
|
+
case 'severity':
|
|
190
|
+
return sortBySeverity(reports);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=report-sorter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-sorter.js","sourceRoot":"","sources":["../src/report-sorter.ts"],"names":[],"mappings":"AAqBA;;GAEG;AACH,MAAM,aAAa,GAA0C;IAC3D,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;CACR,CAAC;AAEF;;;GAGG;AACH,MAAM,aAAa,GAA0C;IAC3D,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,MAAM;CACb,CAAC;AAEF;;GAEG;AACH,SAAS,cAAc,CAAC,OAAwB;IAC9C,MAAM,KAAK,GAAqB,EAAE,CAAC;IAEnC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ,IAAI,EAAE,EAAE,CAAC;YAC5C,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;gBACjC,KAAK,CAAC,IAAI,CAAC;oBACT,IAAI;oBACJ,cAAc,EAAE,OAAO,CAAC,OAAO;oBAC/B,MAAM,EAAE,MAAM,CAAC,MAAM;iBACtB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,OAAwB;IAC/C,MAAM,QAAQ,GAAG,O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C,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAClD,CAAC;IAEF,MAAM,QAAQ,GAA2B,EAAE,CAAC;IAE5C,KAAK,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,IAAI,aAAa,EAAE,CAAC;QACnD,MAAM,KAAK,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;QACtC,QAAQ,CAAC,IAAI,CAAC;YACZ,OAAO,EAAE,GAAG,KAAK,KAAK,UAAU,CAAC,MAAM,GAAG;YAC1C,KAAK,EAAE,UAAU;SAClB,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL;YACE,MAAM,EAAE,cAAc,CAAC,OAAO,CAAC;YAC/B,OAAO,EAAE,eAAe,CAAC,OAAO,CAAC;YACjC,QAAQ;SACT;KACF,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CACzB,OAAwB,EACxB,IAAgC;IAEhC,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,MAAM;YACT,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC;QAC7B,KAAK,UAAU;YACb,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;QACjC,KAAK,UAAU;YACb,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ajv-validate.d.ts","sourceRoot":"","sources":["../../src/rules/ajv-validate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ajv-validate.js","sourceRoot":"","sources":["../../src/rules/ajv-validate.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,6FAA6F;AAC7F,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captured-trace-to-string.d.ts","sourceRoot":"","sources":["../../src/rules/captured-trace-to-string.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAuB,MAAM,cAAc,CAAC;AAEvE,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAmClE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { httpRequestToLabel, httpResponseToLabel, httpTransactionToLabel, } from '../utils.js';
|
|
2
|
+
export function capturedTraceToString(trace) {
|
|
3
|
+
const firstTransaction = trace[0];
|
|
4
|
+
// This check prevents lastTransaction from being equal to firstTransaction when the array has only one element.
|
|
5
|
+
const lastTransaction = trace[trace.length - 1] === trace[0] ? undefined : trace[trace.length - 1];
|
|
6
|
+
// length === 1
|
|
7
|
+
if (!lastTransaction && !!firstTransaction) {
|
|
8
|
+
return httpTransactionToLabel(firstTransaction.request.data, firstTransaction.response.data);
|
|
9
|
+
}
|
|
10
|
+
// Handle empty trace case.
|
|
11
|
+
if (!firstTransaction || !lastTransaction) {
|
|
12
|
+
return '';
|
|
13
|
+
}
|
|
14
|
+
const formatReq = (t) => httpRequestToLabel(t.request.data);
|
|
15
|
+
const formatRes = (t) => httpResponseToLabel(t.response.data);
|
|
16
|
+
if (trace.length === 2) {
|
|
17
|
+
const requests = trace.map(formatReq);
|
|
18
|
+
const responses = trace.map(formatRes).reverse();
|
|
19
|
+
return [...requests, ...responses].join(' -> ');
|
|
20
|
+
}
|
|
21
|
+
const firstReq = formatReq(firstTransaction);
|
|
22
|
+
const lastReq = formatReq(lastTransaction);
|
|
23
|
+
const lastRes = formatRes(lastTransaction);
|
|
24
|
+
const firstRes = formatRes(firstTransaction);
|
|
25
|
+
return `${firstReq} -> ${lastReq} -> ...${trace.length - 2}x more -> ${lastRes} -> ${firstRes}`;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=captured-trace-to-string.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captured-trace-to-string.js","sourceRoot":"","sources":["../../src/rules/captured-trace-to-string.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAGrB,MAAM,UAAU,qBAAqB,CAAC,KAAoB;IACxD,MAAM,gBAAgB,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAClC,gHAAgH;IAChH,MAAM,eAAe,GACnB,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAE7E,eAAe;IACf,IAAI,CAAC,eAAe,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;QAC3C,OAAO,sBAAsB,CAC3B,gBAAgB,CAAC,OAAO,CAAC,IAAI,EAC7B,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAC/B,CAAC;IACJ,CAAC;IAED,2BAA2B;IAC3B,IAAI,CAAC,gBAAgB,IAAI,CAAC,eAAe,EAAE,CAAC;QAC1C,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,SAAS,GAAG,CAAC,CAAsB,EAAE,EAAE,CAC3C,kBAAkB,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,SAAS,GAAG,CAAC,CAAsB,EAAE,EAAE,CAC3C,mBAAmB,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEvC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACtC,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC;QACjD,OAAO,CAAC,GAAG,QAAQ,EAAE,GAAG,SAAS,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,QAAQ,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,SAAS,CAAC,eAAe,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,SAAS,CAAC,eAAe,CAAC,CAAC;IAC3C,MAAM,QAAQ,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC7C,OAAO,GAAG,QAAQ,OAAO,OAAO,UAAU,KAAK,CAAC,MAAM,GAAG,CAAC,aAAa,OAAO,OAAO,QAAQ,EAAE,CAAC;AAClG,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ThymianHttpRequest, ThymianHttpResponse } from '../format/index.js';
|
|
2
|
+
import type { HttpRequest, HttpResponse } from '../http.js';
|
|
3
|
+
import type { CommonHttpRequest, CommonHttpResponse } from './contexts.js';
|
|
4
|
+
export declare function thymianToCommonHttpRequest(node: ThymianHttpRequest, _id: string): CommonHttpRequest;
|
|
5
|
+
export declare function thymianToCommonHttpResponse(node: ThymianHttpResponse, _id: string): CommonHttpResponse;
|
|
6
|
+
export declare function httpRequestToCommonHttpRequest(request: HttpRequest, _id?: string): CommonHttpRequest;
|
|
7
|
+
export declare function httpResponseToCommonHttpResponse(response: HttpResponse, _id?: string): CommonHttpResponse;
|
|
8
|
+
//# sourceMappingURL=common-http-converters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-http-converters.d.ts","sourceRoot":"","sources":["../../src/rules/common-http-converters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAE3E,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,kBAAkB,EACxB,GAAG,EAAE,MAAM,GACV,iBAAiB,CAanB;AAED,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,mBAAmB,EACzB,GAAG,EAAE,MAAM,GACV,kBAAkB,CAUpB;AAgBD,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,WAAW,EACpB,GAAG,CAAC,EAAE,MAAM,GACX,iBAAiB,CAenB;AAED,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,YAAY,EACtB,GAAG,CAAC,EAAE,MAAM,GACX,kBAAkB,CAUpB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { getHeader } from '../utils.js';
|
|
2
|
+
export function thymianToCommonHttpRequest(node, _id) {
|
|
3
|
+
void _id;
|
|
4
|
+
return {
|
|
5
|
+
origin: `${node.protocol}://${node.host}:${node.port}`,
|
|
6
|
+
path: node.path,
|
|
7
|
+
method: node.method,
|
|
8
|
+
headers: Object.keys(node.headers),
|
|
9
|
+
queryParameters: Object.keys(node.queryParameters),
|
|
10
|
+
cookies: Object.keys(node.cookies),
|
|
11
|
+
mediaType: node.mediaType,
|
|
12
|
+
body: node.bodyRequired ?? false,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function thymianToCommonHttpResponse(node, _id) {
|
|
16
|
+
void _id;
|
|
17
|
+
return {
|
|
18
|
+
body: !!node.schema,
|
|
19
|
+
headers: Object.keys(node.headers),
|
|
20
|
+
mediaType: node.mediaType,
|
|
21
|
+
statusCode: node.statusCode,
|
|
22
|
+
trailers: [],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function extractMediaType(req) {
|
|
26
|
+
if (!req.headers) {
|
|
27
|
+
return '';
|
|
28
|
+
}
|
|
29
|
+
const ct = getHeader(req.headers, 'content-type');
|
|
30
|
+
if (Array.isArray(ct)) {
|
|
31
|
+
throw new Error('Content-type is a single valued field.');
|
|
32
|
+
}
|
|
33
|
+
return ct ?? '';
|
|
34
|
+
}
|
|
35
|
+
export function httpRequestToCommonHttpRequest(request, _id) {
|
|
36
|
+
void _id;
|
|
37
|
+
return {
|
|
38
|
+
origin: request.origin,
|
|
39
|
+
path: request.path,
|
|
40
|
+
method: request.method,
|
|
41
|
+
headers: Object.keys(request.headers ?? {}),
|
|
42
|
+
queryParameters: Array.from(new URLSearchParams(request.path.split('?')[1] ?? '').keys()),
|
|
43
|
+
cookies: [],
|
|
44
|
+
mediaType: extractMediaType(request),
|
|
45
|
+
body: !!request.body,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export function httpResponseToCommonHttpResponse(response, _id) {
|
|
49
|
+
void _id;
|
|
50
|
+
return {
|
|
51
|
+
body: !!response.body,
|
|
52
|
+
headers: Object.keys(response.headers),
|
|
53
|
+
mediaType: getHeader(response.headers, 'content-type')?.at(0) ?? '',
|
|
54
|
+
statusCode: response.statusCode,
|
|
55
|
+
trailers: Object.keys(response.trailers),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=common-http-converters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-http-converters.js","sourceRoot":"","sources":["../../src/rules/common-http-converters.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,UAAU,0BAA0B,CACxC,IAAwB,EACxB,GAAW;IAEX,KAAK,GAAG,CAAC;IAET,OAAO;QACL,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,MAAM,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE;QACtD,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CA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,KAAK,CAAC,IAAI,CACzB,IAAI,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAC7D;QACD,OAAO,EAAE,EAAE;QACX,SAAS,EAAE,gBAAgB,CAAC,OAAO,CAAC;QACpC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI;KACrB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gCAAgC,CAC9C,QAAsB,EACtB,GAAY;IAEZ,KAAK,GAAG,CAAC;IAET,OAAO;QACL,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI;QACrB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;QACtC,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE;QACnE,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;KACzC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ReportFn } from '../events/report.event.js';
|
|
2
|
+
import type { ThymianHttpRequest } from '../format/nodes/http-request.node.js';
|
|
3
|
+
import type { ThymianHttpResponse } from '../format/nodes/http-response.node.js';
|
|
4
|
+
import type { ThymianFormat } from '../format/thymian-format.js';
|
|
5
|
+
import type { HttpRequest, HttpResponse } from '../http.js';
|
|
6
|
+
import type { HttpFilterExpression } from '../http-filter.js';
|
|
7
|
+
import type { HttpTestResult } from '../http-testing/http-test/http-test.js';
|
|
8
|
+
import type { HttpTestContextLocals } from '../http-testing/http-test/http-test-context.js';
|
|
9
|
+
import type { HttpTestPipeline } from '../http-testing/http-test/http-test-pipeline.js';
|
|
10
|
+
import type { PartialBy } from '../utils.js';
|
|
11
|
+
import type { RuleFnResult, RuleViolation, RuleViolationLocation } from './rule-violation.js';
|
|
12
|
+
import type { CapturedTrace, CapturedTransaction } from './traffic.js';
|
|
13
|
+
export type CommonHttpRequest = {
|
|
14
|
+
origin: string;
|
|
15
|
+
path: string;
|
|
16
|
+
method: string;
|
|
17
|
+
headers: string[];
|
|
18
|
+
queryParameters: string[];
|
|
19
|
+
cookies: string[];
|
|
20
|
+
mediaType: string;
|
|
21
|
+
body: boolean;
|
|
22
|
+
};
|
|
23
|
+
export type CommonHttpResponse = {
|
|
24
|
+
statusCode: number;
|
|
25
|
+
mediaType: string;
|
|
26
|
+
headers: string[];
|
|
27
|
+
body: boolean;
|
|
28
|
+
trailers: string[];
|
|
29
|
+
};
|
|
30
|
+
export type ValidationFn<Args extends unknown[], R = Omit<RuleViolation, 'location' | 'rule' | 'severity'> | boolean | undefined> = (...args: Args) => R;
|
|
31
|
+
export interface ApiContext {
|
|
32
|
+
readonly format: ThymianFormat;
|
|
33
|
+
readonly report: ReportFn;
|
|
34
|
+
reportViolation(violation: RuleViolation): void;
|
|
35
|
+
validateCommonHttpTransactions(filter: HttpFilterExpression, validationFn?: ValidationFn<[
|
|
36
|
+
CommonHttpRequest,
|
|
37
|
+
CommonHttpResponse,
|
|
38
|
+
RuleViolationLocation
|
|
39
|
+
]> | HttpFilterExpression): Promise<RuleFnResult> | RuleFnResult;
|
|
40
|
+
validateGroupedCommonHttpTransactions(filter: HttpFilterExpression, groupBy: HttpFilterExpression, validationFn: ValidationFn<[
|
|
41
|
+
string,
|
|
42
|
+
[
|
|
43
|
+
CommonHttpRequest,
|
|
44
|
+
CommonHttpResponse,
|
|
45
|
+
RuleViolationLocation
|
|
46
|
+
][]
|
|
47
|
+
], RuleViolation | undefined>): Promise<RuleFnResult> | RuleFnResult;
|
|
48
|
+
}
|
|
49
|
+
export interface LiveApiContext extends ApiContext {
|
|
50
|
+
validateHttpTransactions(filter: HttpFilterExpression, validation?: ValidationFn<[HttpRequest, HttpResponse, RuleViolationLocation]> | HttpFilterExpression): Promise<RuleFnResult> | RuleFnResult;
|
|
51
|
+
}
|
|
52
|
+
export interface LintContext extends ApiContext {
|
|
53
|
+
validateHttpTransactions(filterFn: (req: ThymianHttpRequest, res: ThymianHttpResponse, responses: ThymianHttpResponse[]) => boolean, validationFn?: (req: ThymianHttpRequest, res: ThymianHttpResponse, responses: ThymianHttpResponse[]) => PartialBy<RuleViolation, 'location'> | boolean): Promise<RuleFnResult> | RuleFnResult;
|
|
54
|
+
}
|
|
55
|
+
export interface TestContext extends LiveApiContext {
|
|
56
|
+
httpTest(pipeline: HttpTestPipeline<HttpTestContextLocals>): Promise<RuleFnResult> | RuleFnResult;
|
|
57
|
+
runHttpTest(pipeline: HttpTestPipeline<HttpTestContextLocals>): Promise<HttpTestResult>;
|
|
58
|
+
}
|
|
59
|
+
export interface AnalyzeContext extends LiveApiContext {
|
|
60
|
+
validateCapturedHttpTransactions(filter: HttpFilterExpression, validate: ValidationFn<[CapturedTransaction, string]>): Promise<RuleFnResult> | RuleFnResult;
|
|
61
|
+
validateCapturedHttpTraces(validate: ValidationFn<[CapturedTrace, string]>): Promise<RuleFnResult> | RuleFnResult;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=contexts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contexts.d.ts","sourceRoot":"","sources":["../../src/rules/contexts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,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O,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC;IACxC,WAAW,CACT,QAAQ,EAAE,gBAAgB,CAAC,qBAAqB,CAAC,GAChD,OAAO,CAAC,cAAc,CAAC,CAAC;CAC5B;AAED,MAAM,WAAW,cAAe,SAAQ,cAAc;IACpD,gCAAgC,CAC9B,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,YAAY,CAAC,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC,GACpD,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC;IACxC,0BAA0B,CACxB,QAAQ,EAAE,YAAY,CAAC,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,GAC9C,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contexts.js","sourceRoot":"","sources":["../../src/rules/contexts.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './captured-trace-to-string.js';
|
|
2
|
+
export * from './common-http-converters.js';
|
|
3
|
+
export * from './contexts.js';
|
|
4
|
+
export * from './rule.js';
|
|
5
|
+
export * from './rule-builder.js';
|
|
6
|
+
export * from './rule-configuration.js';
|
|
7
|
+
export * from './rule-filter.js';
|
|
8
|
+
export * from './rule-fn.js';
|
|
9
|
+
export * from './rule-loader.js';
|
|
10
|
+
export * from './rule-meta.js';
|
|
11
|
+
export * from './rule-runner.js';
|
|
12
|
+
export * from './rule-set.js';
|
|
13
|
+
export * from './rule-severity.js';
|
|
14
|
+
export * from './rule-violation.js';
|
|
15
|
+
export * from './traffic.js';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './captured-trace-to-string.js';
|
|
2
|
+
export * from './common-http-converters.js';
|
|
3
|
+
export * from './contexts.js';
|
|
4
|
+
export * from './rule.js';
|
|
5
|
+
export * from './rule-builder.js';
|
|
6
|
+
export * from './rule-configuration.js';
|
|
7
|
+
export * from './rule-filter.js';
|
|
8
|
+
export * from './rule-fn.js';
|
|
9
|
+
export * from './rule-loader.js';
|
|
10
|
+
export * from './rule-meta.js';
|
|
11
|
+
export * from './rule-runner.js';
|
|
12
|
+
export * from './rule-set.js';
|
|
13
|
+
export * from './rule-severity.js';
|
|
14
|
+
export * from './rule-violation.js';
|
|
15
|
+
export * from './traffic.js';
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { JSONSchemaType } from 'ajv';
|
|
2
|
+
import type { AnalyzeContext, ApiContext, LintContext, LiveApiContext, TestContext } from './contexts.js';
|
|
3
|
+
import type { Rule } from './rule.js';
|
|
4
|
+
import type { RuleFn } from './rule-fn.js';
|
|
5
|
+
import type { HttpParticipantRole, RuleType } from './rule-meta.js';
|
|
6
|
+
import { type RuleSeverity } from './rule-severity.js';
|
|
7
|
+
type ApiContextType<RuleTypes extends [RuleType, ...RuleType[]]> = RuleTypes[number] extends 'static' ? LintContext : RuleTypes[number] extends 'analytics' ? AnalyzeContext : RuleTypes[number] extends 'test' ? TestContext : RuleTypes[number] extends 'analytics' | 'test' ? LiveApiContext : ApiContext;
|
|
8
|
+
interface DefineRuleSeverity {
|
|
9
|
+
severity(severity: RuleSeverity): DefineRuleType;
|
|
10
|
+
}
|
|
11
|
+
interface DefineRuleType {
|
|
12
|
+
type<Types extends [RuleType, ...RuleType[]]>(...types: Types): DefineOptionalRuleMetaProperties<Types>;
|
|
13
|
+
}
|
|
14
|
+
interface Done<Options extends Record<PropertyKey, unknown>> {
|
|
15
|
+
done(): Rule<Options>;
|
|
16
|
+
}
|
|
17
|
+
interface DefineRules<RuleTypes extends [RuleType, ...RuleType[]], Options extends Record<PropertyKey, unknown>> extends Done<Options> {
|
|
18
|
+
rule(fn: RuleTypes extends ['informational'] ? never : RuleFn<ApiContextType<RuleTypes>, Options>): DefineRules<RuleTypes, Options>;
|
|
19
|
+
overrideAnalyticsRule(ffn: RuleTypes extends ['informational'] ? never : RuleFn<AnalyzeContext, Options>): DefineRules<RuleTypes, Options>;
|
|
20
|
+
overrideStaticRule(fn: RuleTypes extends ['informational'] ? never : RuleFn<LintContext, Options>): DefineRules<RuleTypes, Options>;
|
|
21
|
+
overrideTest(fn: RuleTypes extends ['informational'] ? never : RuleFn<TestContext, Options>): DefineRules<RuleTypes, Options>;
|
|
22
|
+
}
|
|
23
|
+
interface DefineOptionalRuleMetaProperties<RuleTypes extends [RuleType, ...RuleType[]], Options extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>> extends DefineRules<RuleTypes, Options> {
|
|
24
|
+
appliesTo(...participants: [HttpParticipantRole, ...HttpParticipantRole[]]): this;
|
|
25
|
+
description(description: string): DefineOptionalRuleMetaProperties<RuleTypes, Options>;
|
|
26
|
+
summary(summary: string): DefineOptionalRuleMetaProperties<RuleTypes, Options>;
|
|
27
|
+
url(url: string): this;
|
|
28
|
+
tags(...tags: string[]): DefineOptionalRuleMetaProperties<RuleTypes, Options>;
|
|
29
|
+
explanation(explanation: string): DefineOptionalRuleMetaProperties<RuleTypes, Options>;
|
|
30
|
+
options<Options extends Record<PropertyKey, unknown>>(schema: JSONSchemaType<Options>): DefineOptionalRuleMetaProperties<RuleTypes, Options>;
|
|
31
|
+
}
|
|
32
|
+
export declare function httpRule(name: string): DefineRuleSeverity;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=rule-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-builder.d.ts","sourceRoot":"","sources":["../../src/rules/rule-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAE1C,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACX,cAAc,EACd,WAAW,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE5E,KAAK,cAAc,CAAC,SAAS,SAAS,CAAC,QAAQ,EAA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