@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,22 @@
|
|
|
1
|
+
import type { RuleSeverity } from './rule-severity.js';
|
|
2
|
+
export type RuleViolationLocation = {
|
|
3
|
+
elementType: 'node' | 'edge';
|
|
4
|
+
elementId: string;
|
|
5
|
+
pointer?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
} | string;
|
|
8
|
+
export type RuleViolation = {
|
|
9
|
+
location: RuleViolationLocation;
|
|
10
|
+
message?: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A rule violation enriched with the rule name and resolved severity
|
|
14
|
+
* from the rule runner. This is the type returned by `runRules()`.
|
|
15
|
+
*/
|
|
16
|
+
export type EvaluatedRuleViolation = {
|
|
17
|
+
ruleName: string;
|
|
18
|
+
severity: Exclude<RuleSeverity, 'off'>;
|
|
19
|
+
violation: Required<RuleViolation>;
|
|
20
|
+
};
|
|
21
|
+
export type RuleFnResult = undefined | RuleViolation | RuleViolation[];
|
|
22
|
+
//# sourceMappingURL=rule-violation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-violation.d.ts","sourceRoot":"","sources":["../../src/rules/rule-violation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,MAAM,qBAAqB,GAC7B;IACE,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACD,MAAM,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,qBAAqB,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IACvC,SAAS,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,aAAa,GAAG,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-violation.js","sourceRoot":"","sources":["../../src/rules/rule-violation.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AnalyzeContext, LintContext, TestContext } from './contexts.js';
|
|
2
|
+
import type { RuleFn } from './rule-fn.js';
|
|
3
|
+
import type { RuleMeta } from './rule-meta.js';
|
|
4
|
+
export type Rule<Options extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>> = {
|
|
5
|
+
lintRule?: RuleFn<LintContext, Options>;
|
|
6
|
+
analyzeRule?: RuleFn<AnalyzeContext, Options>;
|
|
7
|
+
testRule?: RuleFn<TestContext, Options>;
|
|
8
|
+
meta: RuleMeta<Options>;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule.d.ts","sourceRoot":"","sources":["../../src/rules/rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,MAAM,IAAI,CACd,OAAO,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,IACzE;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACxC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;CACzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule.js","sourceRoot":"","sources":["../../src/rules/rule.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { HttpRequest, HttpResponse } from '../http.js';
|
|
2
|
+
import type { HttpParticipantRole } from './rule-meta.js';
|
|
3
|
+
export type CapturedHttpRequest = {
|
|
4
|
+
data: HttpRequest;
|
|
5
|
+
meta: {
|
|
6
|
+
role?: HttpParticipantRole;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export type CapturedHttpResponse = {
|
|
10
|
+
data: HttpResponse;
|
|
11
|
+
meta: {
|
|
12
|
+
role?: HttpParticipantRole;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type CapturedTransaction = {
|
|
16
|
+
request: CapturedHttpRequest;
|
|
17
|
+
response: CapturedHttpResponse;
|
|
18
|
+
};
|
|
19
|
+
export type CapturedTrace = CapturedTransaction[];
|
|
20
|
+
export interface LoadedTraffic {
|
|
21
|
+
transactions?: CapturedTransaction[];
|
|
22
|
+
traces?: CapturedTrace[];
|
|
23
|
+
metadata?: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=traffic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traffic.d.ts","sourceRoot":"","sources":["../../src/rules/traffic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE;QACJ,IAAI,CAAC,EAAE,mBAAmB,CAAC;KAC5B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE;QACJ,IAAI,CAAC,EAAE,mBAAmB,CAAC;KAC5B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,QAAQ,EAAE,oBAAoB,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,mBAAmB,EAAE,CAAC;AAElD,MAAM,WAAW,aAAa;IAC5B,YAAY,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACrC,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traffic.js","sourceRoot":"","sources":["../../src/rules/traffic.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { JSONSchemaType } from 'ajv/dist/2020.js';
|
|
2
|
+
import type { ThymianActionName, ThymianActions } from './actions/index.js';
|
|
3
|
+
import { ThymianEmitter } from './emitter/index.js';
|
|
4
|
+
import type { ThymianEventName, ThymianEvents } from './events/index.js';
|
|
5
|
+
import type { Logger } from './logger/logger.js';
|
|
6
|
+
export type ThymianPluginFn<Options extends Record<PropertyKey, unknown> & {
|
|
7
|
+
cwd: string;
|
|
8
|
+
}> = (emitter: ThymianEmitter, logger: Logger, options: Options) => Promise<void>;
|
|
9
|
+
export type ThymianPluginEvents = {
|
|
10
|
+
provides?: {
|
|
11
|
+
[Name in ThymianEventName]?: JSONSchemaType<Name extends keyof ThymianEvents ? ThymianEvents[Name] : unknown>;
|
|
12
|
+
};
|
|
13
|
+
emits?: ThymianEventName[];
|
|
14
|
+
listensOn?: ThymianEventName[];
|
|
15
|
+
};
|
|
16
|
+
export type ThymianPluginActions = {
|
|
17
|
+
provides?: {
|
|
18
|
+
[Name in ThymianActionName]?: {
|
|
19
|
+
event: JSONSchemaType<Name extends keyof ThymianActions ? ThymianActions[Name]['event'] : unknown>;
|
|
20
|
+
response: JSONSchemaType<Name extends keyof ThymianActions ? ThymianActions[Name]['response'] : unknown>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
emits?: ThymianActionName[];
|
|
24
|
+
requires?: ThymianActionName[];
|
|
25
|
+
listensOn?: ThymianActionName[];
|
|
26
|
+
};
|
|
27
|
+
export type ThymianPlugin<Options extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>> = {
|
|
28
|
+
plugin: ThymianPluginFn<Options & {
|
|
29
|
+
cwd: string;
|
|
30
|
+
}>;
|
|
31
|
+
options?: JSONSchemaType<Options>;
|
|
32
|
+
name: string;
|
|
33
|
+
version: string;
|
|
34
|
+
events?: ThymianPluginEvents;
|
|
35
|
+
actions?: ThymianPluginActions;
|
|
36
|
+
};
|
|
37
|
+
export declare function isPlugin(plugin: unknown): plugin is ThymianPlugin;
|
|
38
|
+
//# sourceMappingURL=thymian-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thymian-plugin.d.ts","sourceRoot":"","sources":["../src/thymian-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,MAAM,eAAe,CACzB,OAAO,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,IAC5D,CACF,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,KACb,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnB,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,EAAE;SACR,IAAI,IAAI,gBAAgB,CAAC,CAAC,EAAE,cAAc,CACzC,IAAI,SAAS,MAAM,aAAa,GAAG,aAAa,CAAC,IAAI,CAAC,GAAG,OAAO,CACjE;KACF,CAAC;IACF,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC3B,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE;SACR,IAAI,IAAI,iBAAiB,CAAC,CAAC,EAAE;YAC5B,KAAK,EAAE,cAAc,CACnB,IAAI,SAAS,MAAM,cAAc,GAC7B,cAAc,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAC7B,OAAO,CACZ,CAAC;YACF,QAAQ,EAAE,cAAc,CACtB,IAAI,SAAS,MAAM,cAAc,GAC7B,cAAc,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,GAChC,OAAO,CACZ,CAAC;SACH;KACF,CAAC;IACF,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,aAAa,CACvB,OAAO,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,IACzE;IACF,MAAM,EAAE,eAAe,CAAC,OAAO,GAAG;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnD,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC,CAAC;AAEF,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,aAAa,CAyBjE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ThymianEmitter } from './emitter/index.js';
|
|
2
|
+
import { isRecord } from './utils.js';
|
|
3
|
+
export function isPlugin(plugin) {
|
|
4
|
+
if (!isRecord(plugin)) {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
const requiredKeys = ['plugin', 'name', 'version'];
|
|
8
|
+
for (const key of requiredKeys) {
|
|
9
|
+
if (!Object.hasOwn(plugin, key)) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
if (typeof plugin['plugin'] !== 'function') {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
if (typeof plugin['name'] !== 'string') {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
if (typeof plugin['version'] !== 'string') {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=thymian-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thymian-plugin.js","sourceRoot":"","sources":["../src/thymian-plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAmDtC,MAAM,UAAU,QAAQ,CAAC,MAAe;IACtC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IACnD,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;QAC/B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;YAChC,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,IAAI,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,UAAU,EAAE,CAAC;QAC3C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,QAAQ,EAAE,CAAC;QACvC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC1C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { CoreFormatLoadInput, CoreRequestDispatchInput, CoreRequestSampleInput, CoreTrafficLoadInput, SpecificationInput, TrafficInput, WorkflowOutcome } from './actions/index.js';
|
|
2
|
+
import { ThymianEmitter } from './emitter/index.js';
|
|
3
|
+
import { ThymianFormat } from './format/index.js';
|
|
4
|
+
import type { HttpRequestTemplate, HttpResponse } from './http.js';
|
|
5
|
+
import type { LogLevel } from './logger/log-level.js';
|
|
6
|
+
import type { Logger } from './logger/logger.js';
|
|
7
|
+
import { type ReportSortMode } from './report-sorter.js';
|
|
8
|
+
import { type LoadedTraffic, type RuleFilter, type RulesConfiguration } from './rules/index.js';
|
|
9
|
+
import { ThymianBaseError } from './thymian.error.js';
|
|
10
|
+
import type { ThymianPlugin } from './thymian-plugin.js';
|
|
11
|
+
export interface LintWorkflowInput {
|
|
12
|
+
specification: SpecificationInput[];
|
|
13
|
+
rules?: string[];
|
|
14
|
+
rulesConfig?: RulesConfiguration;
|
|
15
|
+
ruleFilter?: RuleFilter;
|
|
16
|
+
options?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
export interface TestWorkflowInput {
|
|
19
|
+
specification: SpecificationInput[];
|
|
20
|
+
rules?: string[];
|
|
21
|
+
rulesConfig?: RulesConfiguration;
|
|
22
|
+
ruleFilter?: RuleFilter;
|
|
23
|
+
options?: Record<string, unknown>;
|
|
24
|
+
targetUrl?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface AnalyzeWorkflowInput {
|
|
27
|
+
specification?: SpecificationInput[];
|
|
28
|
+
traffic: TrafficInput[];
|
|
29
|
+
rules?: string[];
|
|
30
|
+
rulesConfig?: RulesConfiguration;
|
|
31
|
+
ruleFilter?: RuleFilter;
|
|
32
|
+
options?: Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
export type RegisteredPlugin<T extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>> = {
|
|
35
|
+
plugin: ThymianPlugin<T>;
|
|
36
|
+
options: T;
|
|
37
|
+
};
|
|
38
|
+
export declare class PluginRegistrationError extends ThymianBaseError {
|
|
39
|
+
}
|
|
40
|
+
export type ThymianOptions = {
|
|
41
|
+
timeout: number;
|
|
42
|
+
idleTimeout: number;
|
|
43
|
+
traceEvents: boolean;
|
|
44
|
+
cwd: string;
|
|
45
|
+
logAllErrors: boolean;
|
|
46
|
+
logLevel?: LogLevel;
|
|
47
|
+
sortReportsBy?: ReportSortMode;
|
|
48
|
+
};
|
|
49
|
+
export declare class Thymian {
|
|
50
|
+
#private;
|
|
51
|
+
private readonly logger;
|
|
52
|
+
readonly plugins: RegisteredPlugin[];
|
|
53
|
+
readonly emitter: ThymianEmitter;
|
|
54
|
+
readonly options: ThymianOptions;
|
|
55
|
+
static readonly VERSION: string;
|
|
56
|
+
static readonly DEFAULT_IDLE_TIMEOUT = 500;
|
|
57
|
+
static readonly DEFAULT_TIMEOUT = 10000;
|
|
58
|
+
constructor(logger?: Logger, options?: Partial<ThymianOptions>);
|
|
59
|
+
register<T extends Record<PropertyKey, unknown>>(plugin: ThymianPlugin<T>, options?: T): this;
|
|
60
|
+
ready(): Promise<void>;
|
|
61
|
+
run<T>(fn: (emitter: ThymianEmitter, logger: Logger) => Promise<T> | T): Promise<T>;
|
|
62
|
+
close(): Promise<void>;
|
|
63
|
+
loadFormat(input: CoreFormatLoadInput, _options?: {
|
|
64
|
+
emitFormat?: boolean;
|
|
65
|
+
}): Promise<ThymianFormat>;
|
|
66
|
+
loadTraffic(input: CoreTrafficLoadInput): Promise<LoadedTraffic>;
|
|
67
|
+
/**
|
|
68
|
+
* Architectural note:
|
|
69
|
+
* Core owns the public validation entrypoints and input-loading contract.
|
|
70
|
+
* Plugins own the mode-specific execution semantics behind these entrypoints.
|
|
71
|
+
* This keeps the consumer-facing API stable while preserving plugin-based extensibility.
|
|
72
|
+
*/
|
|
73
|
+
lint(input: LintWorkflowInput): Promise<WorkflowOutcome>;
|
|
74
|
+
test(input: TestWorkflowInput): Promise<WorkflowOutcome>;
|
|
75
|
+
analyze(input: AnalyzeWorkflowInput): Promise<WorkflowOutcome>;
|
|
76
|
+
sample(input: CoreRequestSampleInput): Promise<HttpRequestTemplate>;
|
|
77
|
+
dispatch(input: CoreRequestDispatchInput): Promise<HttpResponse>;
|
|
78
|
+
private bridgeReports;
|
|
79
|
+
private classifyResults;
|
|
80
|
+
private flushReportText;
|
|
81
|
+
private createReportFromViolations;
|
|
82
|
+
private loadRegisteredPlugins;
|
|
83
|
+
private registerPlugin;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=thymian.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thymian.d.ts","sourceRoot":"","sources":["../src/thymian.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EAGZ,eAAe,EAChB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAOpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,KAAK,cAAc,EAAe,MAAM,oBAAoB,CAAC;AACtE,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,kBAAkB,EAAE,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,kBAAkB,EAAE,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,aAAa,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACrC,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,MAAM,gBAAgB,CAC1B,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,IACnE;IACF,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACzB,OAAO,EAAE,CAAC,CAAC;CACZ,CAAC;AAEF,qBAAa,uBAAwB,SAAQ,gBAAgB;CAAG;AAEhE,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,aAAa,CAAC,EAAE,cAAc,CAAC;CAChC,CAAC;AAEF,qBAAa,OAAO;;IAkBhB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAjBzB,QAAQ,CAAC,OAAO,EAAE,gBAAgB,EAAE,CAAM;IAE1C,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IAEjC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IAIjC,gBAAuB,OAAO,SAAuB;IAGrD,gBAAuB,oBAAoB,OAAO;IAGlD,gBAAuB,eAAe,SAAS;gBAG5B,MAAM,GAAE,MAAyB,EAClD,OAAO,GAAE,OAAO,CAAC,cAAc,CAAM;IA0BvC,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EAC7C,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,EACxB,OAAO,CAAC,EAAE,CAAC,GACV,IAAI;IAgCD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAgB5B,GAAG,CAAC,CAAC,EACH,EAAE,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAC9D,OAAO,CAAC,CAAC,CAAC;IAkDP,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAStB,UAAU,CACd,KAAK,EAAE,mBAAmB,EAC1B,QAAQ,GAAE;QAAE,UAAU,CAAC,EAAE,OAAO,CAAA;KAAO,GACtC,OAAO,CAAC,aAAa,CAAC;IAoCnB,WAAW,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,CAAC;IAyBtE;;;;;OAKG;IACG,IAAI,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC;IAgCxD,IAAI,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC;IA6BxD,OAAO,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC;IAmC9D,MAAM,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAMnE,QAAQ,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC;IAMtE,OAAO,CAAC,aAAa;IA4BrB,OAAO,CAAC,eAAe;YAYT,eAAe;IAU7B,OAAO,CAAC,0BAA0B;YAuDpB,qBAAqB;YAWrB,cAAc;CAgC7B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type PartialExceptFor } from './utils.js';
|
|
2
|
+
export type ThymianErrorSeverity = 'info' | 'warn' | 'error';
|
|
3
|
+
export type ThymianErrorOptions = {
|
|
4
|
+
exitCode: number;
|
|
5
|
+
suggestions: string[];
|
|
6
|
+
ref: string;
|
|
7
|
+
code: string;
|
|
8
|
+
name: string;
|
|
9
|
+
severity: ThymianErrorSeverity;
|
|
10
|
+
};
|
|
11
|
+
export interface ThymianError {
|
|
12
|
+
name: string;
|
|
13
|
+
message: string;
|
|
14
|
+
options: PartialExceptFor<ThymianErrorOptions, 'severity'>;
|
|
15
|
+
}
|
|
16
|
+
export declare function isThymianError(value: unknown): value is ThymianError;
|
|
17
|
+
export declare class ThymianBaseError extends Error implements ThymianError {
|
|
18
|
+
cause?: unknown;
|
|
19
|
+
readonly options: PartialExceptFor<ThymianErrorOptions, 'severity'>;
|
|
20
|
+
constructor(message: string, options?: Partial<ThymianErrorOptions> & {
|
|
21
|
+
cause?: unknown;
|
|
22
|
+
} & {
|
|
23
|
+
severity?: ThymianErrorSeverity;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=thymian.error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thymian.error.d.ts","sourceRoot":"","sources":["../src/thymian.error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE7D,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE7D,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,oBAAoB,CAAC;CAChC,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,gBAAgB,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC;CAC5D;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAYpE;AAED,qBAAa,gBAAiB,SAAQ,KAAM,YAAW,YAAY;IACxD,KAAK,CAAC,EAAE,OAAO,CAAC;IAEzB,SAAgB,OAAO,EAAE,gBAAgB,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC;gBAEzE,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG;QAC5D,QAAQ,CAAC,EAAE,oBAAoB,CAAC;KAC5B;CAoBT"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { isRecord } from './utils.js';
|
|
2
|
+
export function isThymianError(value) {
|
|
3
|
+
// Check if all the required properties exist and are of proper type
|
|
4
|
+
return (isRecord(value) &&
|
|
5
|
+
typeof value?.name === 'string' &&
|
|
6
|
+
typeof value?.message === 'string' &&
|
|
7
|
+
((Object.hasOwn(value, 'options') &&
|
|
8
|
+
isRecord(value.options) &&
|
|
9
|
+
(value.options.cause === undefined ||
|
|
10
|
+
value.options.cause instanceof Error)) ||
|
|
11
|
+
!Object.hasOwn(value, 'options')));
|
|
12
|
+
}
|
|
13
|
+
export class ThymianBaseError extends Error {
|
|
14
|
+
cause;
|
|
15
|
+
options;
|
|
16
|
+
constructor(message, options = {}) {
|
|
17
|
+
super(message);
|
|
18
|
+
if (options.cause) {
|
|
19
|
+
if (options.cause instanceof Error) {
|
|
20
|
+
this.cause = options.cause;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
this.options = {
|
|
24
|
+
severity: 'error',
|
|
25
|
+
...options,
|
|
26
|
+
};
|
|
27
|
+
this.name =
|
|
28
|
+
options.name ??
|
|
29
|
+
(this.constructor.name === 'ThymianBaseError'
|
|
30
|
+
? 'ThymianError'
|
|
31
|
+
: this.constructor.name);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=thymian.error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thymian.error.js","sourceRoot":"","sources":["../src/thymian.error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAyB,MAAM,YAAY,CAAC;AAmB7D,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,oEAAoE;IACpE,OAAO,CACL,QAAQ,CAAC,KAAK,CAAC;QACf,OAAO,KAAK,EAAE,IAAI,KAAK,QAAQ;QAC/B,OAAO,KAAK,EAAE,OAAO,KAAK,QAAQ;QAClC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC;YAC/B,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC;YACvB,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS;gBAChC,KAAK,CAAC,OAAO,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC;YACxC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CACpC,CAAC;AACJ,CAAC;AAED,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAChC,KAAK,CAAW;IAET,OAAO,CAAoD;IAC3E,YACE,OAAe,EACf,UAEI,EAAE;QAEN,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAClB,IAAI,OAAO,CAAC,KAAK,YAAY,KAAK,EAAE,CAAC;gBACnC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;YAC7B,CAAC;QACH,CAAC;QAED,IAAI,CAAC,OAAO,GAAG;YACb,QAAQ,EAAE,OAAO;YACjB,GAAG,OAAO;SACX,CAAC;QAEF,IAAI,CAAC,IAAI;YACP,OAAO,CAAC,IAAI;gBACZ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,kBAAkB;oBAC3C,CAAC,CAAC,cAAc;oBAChB,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF"}
|
package/dist/thymian.js
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import semver from 'semver';
|
|
2
|
+
import packageJson from '../package.json' with { type: 'json' };
|
|
3
|
+
import { validate } from './ajv.js';
|
|
4
|
+
import { corePlugin } from './core-plugin.js';
|
|
5
|
+
import { ThymianEmitter } from './emitter/index.js';
|
|
6
|
+
import { ThymianFormat } from './format/index.js';
|
|
7
|
+
import { shouldLog } from './logger/log-level.js';
|
|
8
|
+
import { NoopLogger } from './logger/noop.logger.js';
|
|
9
|
+
import { sortReports } from './report-sorter.js';
|
|
10
|
+
import { loadRules, } from './rules/index.js';
|
|
11
|
+
import { resolveViolationLocation } from './rules/rule-runner.js';
|
|
12
|
+
import { ThymianBaseError } from './thymian.error.js';
|
|
13
|
+
import { timeoutPromise } from './utils.js';
|
|
14
|
+
export class PluginRegistrationError extends ThymianBaseError {
|
|
15
|
+
}
|
|
16
|
+
export class Thymian {
|
|
17
|
+
logger;
|
|
18
|
+
plugins = [];
|
|
19
|
+
emitter;
|
|
20
|
+
options;
|
|
21
|
+
#ready = false;
|
|
22
|
+
static VERSION = packageJson.version;
|
|
23
|
+
// Number of milliseconds that is waited for new events and actions to be emitted before shutting down the emitter.
|
|
24
|
+
static DEFAULT_IDLE_TIMEOUT = 500;
|
|
25
|
+
// number of milliseconds that is waited for actions response and plugin registration
|
|
26
|
+
static DEFAULT_TIMEOUT = 10000;
|
|
27
|
+
constructor(logger = new NoopLogger(), options = {}) {
|
|
28
|
+
this.logger = logger;
|
|
29
|
+
const logLevel = options.logLevel ?? logger.level;
|
|
30
|
+
const traceEvents = options.traceEvents ?? shouldLog('trace', logLevel);
|
|
31
|
+
this.options = {
|
|
32
|
+
idleTimeout: Thymian.DEFAULT_IDLE_TIMEOUT,
|
|
33
|
+
timeout: Thymian.DEFAULT_TIMEOUT,
|
|
34
|
+
cwd: process.cwd(),
|
|
35
|
+
logAllErrors: false,
|
|
36
|
+
logLevel,
|
|
37
|
+
...options,
|
|
38
|
+
traceEvents,
|
|
39
|
+
};
|
|
40
|
+
const emitterLogger = logger.child('@thymian/core');
|
|
41
|
+
this.emitter = new ThymianEmitter(emitterLogger, ThymianEmitter.emptyEmitterState('@thymian/core'), {
|
|
42
|
+
traceEvents: this.options.traceEvents,
|
|
43
|
+
timeout: this.options.timeout,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
register(plugin, options) {
|
|
47
|
+
// we only consider stable versions for compatibility checks, so that pre-releases
|
|
48
|
+
// like 1.0.0-beta.1 are also compatible with 1.0.0
|
|
49
|
+
const thymianStableVersion = Thymian.VERSION.replace(/-.*$/, '');
|
|
50
|
+
if (!semver.satisfies(thymianStableVersion, plugin.version)) {
|
|
51
|
+
throw new PluginRegistrationError(`@thymian/core version ${thymianStableVersion} does not match plugin version constraints ${plugin.version} from plugin "${plugin.name}".`, {
|
|
52
|
+
suggestions: [
|
|
53
|
+
`Install the matching plugin version for thymian version ${thymianStableVersion}.`,
|
|
54
|
+
],
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
if (plugin.options && options) {
|
|
58
|
+
const validOptions = validate(plugin.options, options);
|
|
59
|
+
if (!validOptions) {
|
|
60
|
+
throw new PluginRegistrationError(`Invalid options for plugin "${plugin.name}".`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
64
|
+
// @ts-expect-error
|
|
65
|
+
this.plugins.push({ plugin: plugin, options: options ?? {} });
|
|
66
|
+
return this;
|
|
67
|
+
}
|
|
68
|
+
async ready() {
|
|
69
|
+
if (this.#ready) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
this.logger.info('Loading plugins...');
|
|
73
|
+
await this.loadRegisteredPlugins();
|
|
74
|
+
await this.emitter.emitAction('core.ready');
|
|
75
|
+
this.logger.info(`Thymian ready (${this.plugins.length} plugin(s) loaded).`);
|
|
76
|
+
this.#ready = true;
|
|
77
|
+
}
|
|
78
|
+
run(fn) {
|
|
79
|
+
return new Promise((resolve, reject) => {
|
|
80
|
+
let closed = false;
|
|
81
|
+
const tryCloseThymian = (err) => {
|
|
82
|
+
if (closed) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
closed = true;
|
|
86
|
+
this.logger.debug('Try closing Thymian...');
|
|
87
|
+
this.close()
|
|
88
|
+
.then(() => {
|
|
89
|
+
this.logger.debug('Thymian closed.');
|
|
90
|
+
reject(err);
|
|
91
|
+
})
|
|
92
|
+
.catch((e) => {
|
|
93
|
+
this.logger.error('Error while closing Thymian.', e);
|
|
94
|
+
reject(err);
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
this.emitter.onError((event) => {
|
|
98
|
+
if (closed && this.options.logAllErrors) {
|
|
99
|
+
this.logger
|
|
100
|
+
.child(event.source)[event.error.options.severity](event.error.message);
|
|
101
|
+
}
|
|
102
|
+
if (event.error.options.severity === 'error') {
|
|
103
|
+
tryCloseThymian(event.error);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
(async () => {
|
|
107
|
+
await this.ready();
|
|
108
|
+
const result = await fn(this.emitter, this.logger);
|
|
109
|
+
await this.close();
|
|
110
|
+
return result;
|
|
111
|
+
})()
|
|
112
|
+
.then(resolve)
|
|
113
|
+
.catch((err) => {
|
|
114
|
+
tryCloseThymian(err);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
async close() {
|
|
119
|
+
await this.emitter.emitAction('core.close');
|
|
120
|
+
// This let the ThymianEmitter wait 500 ms for the last events to be emitted before shutting down.
|
|
121
|
+
await this.emitter.shutdown(this.options.idleTimeout);
|
|
122
|
+
this.emitter.completeSubjects();
|
|
123
|
+
}
|
|
124
|
+
async loadFormat(input, _options = {}) {
|
|
125
|
+
const options = { emitFormat: true, ..._options };
|
|
126
|
+
this.logger.info(`Loading format from ${input.inputs?.length ?? 0} specification(s)...`);
|
|
127
|
+
const formats = await this.emitter.emitAction('core.format.load', input, {
|
|
128
|
+
strategy: 'collect',
|
|
129
|
+
});
|
|
130
|
+
const format = formats.length === 0
|
|
131
|
+
? new ThymianFormat()
|
|
132
|
+
: formats
|
|
133
|
+
.slice(1)
|
|
134
|
+
.reduce((acc, curr) => acc.merge(ThymianFormat.import(curr)), ThymianFormat.import(formats[0]));
|
|
135
|
+
this.logger.debug(`Merged Thymian format includes ${format.graph.order} nodes and ${format.graph.size} edges.`);
|
|
136
|
+
if (options.emitFormat) {
|
|
137
|
+
await this.emitter.emitAction('core.format', format.export());
|
|
138
|
+
}
|
|
139
|
+
if (format.graph.size === 0) {
|
|
140
|
+
this.logger.warn('No nodes found in Thymian format. Is this intended?');
|
|
141
|
+
}
|
|
142
|
+
return format;
|
|
143
|
+
}
|
|
144
|
+
async loadTraffic(input) {
|
|
145
|
+
const loadedTraffic = await this.emitter.emitAction('core.traffic.load', input, {
|
|
146
|
+
strategy: 'collect',
|
|
147
|
+
});
|
|
148
|
+
return loadedTraffic.reduce((acc, current) => ({
|
|
149
|
+
transactions: [
|
|
150
|
+
...(acc.transactions ?? []),
|
|
151
|
+
...(current.transactions ?? []),
|
|
152
|
+
],
|
|
153
|
+
traces: [...(acc.traces ?? []), ...(current.traces ?? [])],
|
|
154
|
+
metadata: {
|
|
155
|
+
...(acc.metadata ?? {}),
|
|
156
|
+
...(current.metadata ?? {}),
|
|
157
|
+
},
|
|
158
|
+
}), {});
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Architectural note:
|
|
162
|
+
* Core owns the public validation entrypoints and input-loading contract.
|
|
163
|
+
* Plugins own the mode-specific execution semantics behind these entrypoints.
|
|
164
|
+
* This keeps the consumer-facing API stable while preserving plugin-based extensibility.
|
|
165
|
+
*/
|
|
166
|
+
async lint(input) {
|
|
167
|
+
const { rulesConfig, ruleFilter } = input;
|
|
168
|
+
this.logger.info('Loading specification and rules...');
|
|
169
|
+
const [format, rules] = await Promise.all([
|
|
170
|
+
this.loadFormat({ inputs: input.specification }, { emitFormat: false }),
|
|
171
|
+
loadRules(input.rules ?? [], ruleFilter, rulesConfig, this.options.cwd),
|
|
172
|
+
]);
|
|
173
|
+
this.logger.info(`Loaded ${rules.length} rule(s). Running lint workflow...`);
|
|
174
|
+
const results = await this.emitter.emitAction('core.lint', { format: format.export(), rules, rulesConfig, options: input.options }, { strategy: 'collect' });
|
|
175
|
+
this.bridgeReports(results, format);
|
|
176
|
+
const classification = this.classifyResults(results);
|
|
177
|
+
this.logger.info(`Lint complete: ${classification}.`);
|
|
178
|
+
return {
|
|
179
|
+
classification,
|
|
180
|
+
text: await this.flushReportText(),
|
|
181
|
+
results,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
async test(input) {
|
|
185
|
+
const { rulesConfig, ruleFilter } = input;
|
|
186
|
+
const [format, rules] = await Promise.all([
|
|
187
|
+
this.loadFormat({ inputs: input.specification }),
|
|
188
|
+
loadRules(input.rules ?? [], ruleFilter, rulesConfig, this.options.cwd),
|
|
189
|
+
]);
|
|
190
|
+
const results = await this.emitter.emitAction('core.test', {
|
|
191
|
+
format: format.export(),
|
|
192
|
+
rules,
|
|
193
|
+
rulesConfig,
|
|
194
|
+
options: input.options,
|
|
195
|
+
targetUrl: input.targetUrl,
|
|
196
|
+
}, { strategy: 'collect' });
|
|
197
|
+
this.bridgeReports(results, format);
|
|
198
|
+
return {
|
|
199
|
+
classification: this.classifyResults(results),
|
|
200
|
+
text: await this.flushReportText(),
|
|
201
|
+
results,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
async analyze(input) {
|
|
205
|
+
const { rulesConfig, ruleFilter } = input;
|
|
206
|
+
const [traffic, rules, format] = await Promise.all([
|
|
207
|
+
this.loadTraffic({ inputs: input.traffic }),
|
|
208
|
+
loadRules(input.rules ?? [], ruleFilter, rulesConfig, this.options.cwd),
|
|
209
|
+
input.specification
|
|
210
|
+
? this.loadFormat({ inputs: input.specification }, { emitFormat: false })
|
|
211
|
+
: Promise.resolve(undefined),
|
|
212
|
+
]);
|
|
213
|
+
const results = await this.emitter.emitAction('core.analyze', {
|
|
214
|
+
traffic,
|
|
215
|
+
format: format?.export(),
|
|
216
|
+
rules,
|
|
217
|
+
rulesConfig,
|
|
218
|
+
options: input.options,
|
|
219
|
+
}, { strategy: 'collect' });
|
|
220
|
+
this.bridgeReports(results, format ?? new ThymianFormat());
|
|
221
|
+
return {
|
|
222
|
+
classification: this.classifyResults(results),
|
|
223
|
+
text: await this.flushReportText(),
|
|
224
|
+
results,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
async sample(input) {
|
|
228
|
+
return this.emitter.emitAction('core.request.sample', input, {
|
|
229
|
+
strategy: 'first',
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
async dispatch(input) {
|
|
233
|
+
return this.emitter.emitAction('core.request.dispatch', input, {
|
|
234
|
+
strategy: 'first',
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
bridgeReports(results, format) {
|
|
238
|
+
// Collect all reports first so sorting can operate across them
|
|
239
|
+
const reports = [];
|
|
240
|
+
for (const result of results) {
|
|
241
|
+
if (result.violations.length > 0) {
|
|
242
|
+
reports.push(this.createReportFromViolations(result.source, result.violations, format, result));
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
// Apply sort mode reshaping before emission
|
|
246
|
+
const sorted = sortReports(reports, this.options.sortReportsBy);
|
|
247
|
+
for (const report of sorted) {
|
|
248
|
+
this.emitter.emit('core.report', report);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
classifyResults(results) {
|
|
252
|
+
if (results.some((result) => result.status === 'error')) {
|
|
253
|
+
return 'tool-error';
|
|
254
|
+
}
|
|
255
|
+
if (results.some((result) => result.status === 'failed')) {
|
|
256
|
+
return 'findings';
|
|
257
|
+
}
|
|
258
|
+
return 'clean-run';
|
|
259
|
+
}
|
|
260
|
+
async flushReportText() {
|
|
261
|
+
const [flushResult] = await this.emitter.emitAction('core.report.flush', undefined, { strategy: 'collect' });
|
|
262
|
+
return flushResult?.text;
|
|
263
|
+
}
|
|
264
|
+
createReportFromViolations(source, violations, format, result) {
|
|
265
|
+
let message = '';
|
|
266
|
+
if (result.statistics) {
|
|
267
|
+
message = `${result.statistics.rulesRun} HTTP rules run successfully. ${result.statistics.rulesWithViolations} rules reported a violation.`;
|
|
268
|
+
}
|
|
269
|
+
// Group violations by their resolved location heading
|
|
270
|
+
const sectionMap = new Map();
|
|
271
|
+
for (const { ruleName, severity, violation } of violations) {
|
|
272
|
+
const { heading, location } = resolveViolationLocation(violation, format, ruleName);
|
|
273
|
+
let section = sectionMap.get(heading);
|
|
274
|
+
if (!section) {
|
|
275
|
+
section = { location, items: [] };
|
|
276
|
+
sectionMap.set(heading, section);
|
|
277
|
+
}
|
|
278
|
+
const item = {
|
|
279
|
+
severity,
|
|
280
|
+
message: violation.message,
|
|
281
|
+
ruleName,
|
|
282
|
+
location,
|
|
283
|
+
};
|
|
284
|
+
section.items.push(item);
|
|
285
|
+
}
|
|
286
|
+
const sections = [];
|
|
287
|
+
for (const [heading, { location, items }] of sectionMap) {
|
|
288
|
+
sections.push({ heading, items, location });
|
|
289
|
+
}
|
|
290
|
+
return {
|
|
291
|
+
source,
|
|
292
|
+
message,
|
|
293
|
+
sections,
|
|
294
|
+
metadata: result.metadata,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
async loadRegisteredPlugins() {
|
|
298
|
+
await this.registerPlugin({
|
|
299
|
+
plugin: corePlugin,
|
|
300
|
+
options: { cwd: this.options.cwd },
|
|
301
|
+
});
|
|
302
|
+
for (const plugin of this.plugins) {
|
|
303
|
+
await this.registerPlugin(plugin);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
async registerPlugin(registeredPlugin) {
|
|
307
|
+
this.logger.info(`Registering plugin: ${registeredPlugin.plugin.name}`);
|
|
308
|
+
this.logger.debug(`Register plugin ${registeredPlugin.plugin.name} with options ${JSON.stringify(registeredPlugin.options)}`);
|
|
309
|
+
this.emitter.emit('core.register', {
|
|
310
|
+
name: registeredPlugin.plugin.name,
|
|
311
|
+
events: registeredPlugin.plugin.events ?? {},
|
|
312
|
+
options: registeredPlugin.options,
|
|
313
|
+
});
|
|
314
|
+
await timeoutPromise(registeredPlugin.plugin.plugin(this.emitter.child(registeredPlugin.plugin.name), this.logger.child(registeredPlugin.plugin.name), { ...registeredPlugin.options, cwd: this.options.cwd }), this.options.timeout, new PluginRegistrationError(`Timeout while registering plugin "${registeredPlugin.plugin.name}".`, {
|
|
315
|
+
suggestions: [
|
|
316
|
+
'Increase plugin timeout duration. Using the Thymian CLI try using "--timeout" to set custom timeout (default 5000ms).',
|
|
317
|
+
'Check your plugin registration logic.',
|
|
318
|
+
],
|
|
319
|
+
}));
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
//# sourceMappingURL=thymian.js.map
|