@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,371 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import deepmerge from '@fastify/deepmerge';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { debounceTime, filter, firstValueFrom, map, merge, race, startWith, Subject, take, takeUntil, timer, toArray, } from 'rxjs';
|
|
5
|
+
import { NoopLogger } from '../logger/noop.logger.js';
|
|
6
|
+
import { isThymianError, ThymianBaseError, } from '../thymian.error.js';
|
|
7
|
+
import { isActionEventWithName, isEventWithName, isResponseOf, } from './utils.js';
|
|
8
|
+
const dm = deepmerge({ all: true });
|
|
9
|
+
export class ThymianEmitter {
|
|
10
|
+
logger;
|
|
11
|
+
static #hasBeenInitialized = false;
|
|
12
|
+
options;
|
|
13
|
+
source;
|
|
14
|
+
#events = new Subject();
|
|
15
|
+
#responses;
|
|
16
|
+
#errors;
|
|
17
|
+
#listeners;
|
|
18
|
+
// TODO: this is a problem
|
|
19
|
+
#completed;
|
|
20
|
+
/**
|
|
21
|
+
* Multiplier for the hard timeout limit relative to the idle debounce time.
|
|
22
|
+
*/
|
|
23
|
+
static MAX_WAIT_MULTIPLIER = 5;
|
|
24
|
+
constructor(logger = new NoopLogger(), state = ThymianEmitter.emptyEmitterState(), options = {}) {
|
|
25
|
+
this.logger = logger;
|
|
26
|
+
this.options = {
|
|
27
|
+
timeout: 1000,
|
|
28
|
+
traceEvents: false,
|
|
29
|
+
...options,
|
|
30
|
+
};
|
|
31
|
+
this.source = state.source;
|
|
32
|
+
this.#responses = state.responses;
|
|
33
|
+
this.#events = state.events;
|
|
34
|
+
this.#errors = state.errors;
|
|
35
|
+
this.#listeners = state.listeners;
|
|
36
|
+
this.#completed = state.completed;
|
|
37
|
+
if (!ThymianEmitter.#hasBeenInitialized) {
|
|
38
|
+
this.#events.subscribe(this.logEvent('event'));
|
|
39
|
+
this.#responses.subscribe(this.logEvent('response event'));
|
|
40
|
+
ThymianEmitter.#hasBeenInitialized = true;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
static emptyEmitterState(source = '') {
|
|
44
|
+
return {
|
|
45
|
+
source,
|
|
46
|
+
events: new Subject(),
|
|
47
|
+
responses: new Subject(),
|
|
48
|
+
errors: new Subject(),
|
|
49
|
+
listeners: new Map(),
|
|
50
|
+
completed: new Set(),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
async shutdown(idleTimeMs = this.options.timeout) {
|
|
54
|
+
await Promise.all([
|
|
55
|
+
this.shutdownSubject(this.#events, idleTimeMs, 'events'),
|
|
56
|
+
this.shutdownSubject(this.#responses, idleTimeMs, 'responses'),
|
|
57
|
+
this.shutdownSubject(this.#errors, idleTimeMs, 'errors'),
|
|
58
|
+
]);
|
|
59
|
+
}
|
|
60
|
+
async shutdownSubject(subject, waitFor, name = '', timeout = waitFor * ThymianEmitter.MAX_WAIT_MULTIPLIER) {
|
|
61
|
+
return new Promise((resolve) => {
|
|
62
|
+
race([
|
|
63
|
+
subject.pipe(startWith(null), debounceTime(waitFor), take(1), map(() => 'idle')),
|
|
64
|
+
timer(timeout).pipe(map(() => 'timeout')),
|
|
65
|
+
]).subscribe((reason) => {
|
|
66
|
+
this.logger.debug(`Complete subject${name ? ' ' + name : name} due to ${reason}.`);
|
|
67
|
+
resolve();
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
completeSubjects() {
|
|
72
|
+
this.#events.complete();
|
|
73
|
+
this.#responses.complete();
|
|
74
|
+
this.#errors.complete();
|
|
75
|
+
}
|
|
76
|
+
on(name, handler) {
|
|
77
|
+
this.#events
|
|
78
|
+
.pipe(filter(isEventWithName(name)))
|
|
79
|
+
.subscribe(async (event) => {
|
|
80
|
+
try {
|
|
81
|
+
await handler(event.payload);
|
|
82
|
+
}
|
|
83
|
+
catch (e) {
|
|
84
|
+
if (e instanceof ThymianBaseError) {
|
|
85
|
+
this.#errors.next({
|
|
86
|
+
id: randomUUID(),
|
|
87
|
+
error: e,
|
|
88
|
+
name,
|
|
89
|
+
timestamp: Date.now(),
|
|
90
|
+
source: this.source,
|
|
91
|
+
correlationId: event.id,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
else if (isThymianError(e)) {
|
|
95
|
+
const error = new ThymianBaseError(e.message, {
|
|
96
|
+
...e.options,
|
|
97
|
+
name: e.name,
|
|
98
|
+
});
|
|
99
|
+
this.#errors.next({
|
|
100
|
+
error,
|
|
101
|
+
name,
|
|
102
|
+
timestamp: Date.now(),
|
|
103
|
+
source: this.source,
|
|
104
|
+
correlationId: event.id,
|
|
105
|
+
id: randomUUID(),
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
this.#errors.next({
|
|
110
|
+
error: new ThymianBaseError(`Error while calling event handler for event "${event.name}" from "${event.source}".`, {
|
|
111
|
+
name: 'EventHandlerError',
|
|
112
|
+
ref: 'https://thymian.dev/references/errors/event-handler-error/',
|
|
113
|
+
cause: e,
|
|
114
|
+
}),
|
|
115
|
+
name,
|
|
116
|
+
timestamp: Date.now(),
|
|
117
|
+
source: this.source,
|
|
118
|
+
correlationId: event.id,
|
|
119
|
+
id: randomUUID(),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
emit(name, payload) {
|
|
126
|
+
this.#events.next({
|
|
127
|
+
id: randomUUID(),
|
|
128
|
+
name,
|
|
129
|
+
payload,
|
|
130
|
+
timestamp: Date.now(),
|
|
131
|
+
source: this.source,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
emitError(err, name = '') {
|
|
135
|
+
let error;
|
|
136
|
+
if (err instanceof ThymianBaseError) {
|
|
137
|
+
error = err;
|
|
138
|
+
}
|
|
139
|
+
else if (isThymianError(err)) {
|
|
140
|
+
error = new ThymianBaseError(err.message, {
|
|
141
|
+
...err.options,
|
|
142
|
+
name: err.name,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
error = new ThymianBaseError(`Error while emitting error event from "${this.source}".`, {
|
|
147
|
+
cause: err,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
this.#errors.next({
|
|
151
|
+
error,
|
|
152
|
+
id: randomUUID(),
|
|
153
|
+
name: name,
|
|
154
|
+
source: this.source,
|
|
155
|
+
timestamp: Date.now(),
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
onAction(name, handler) {
|
|
159
|
+
this.#listeners.set(name, (this.#listeners.get(name) ?? 0) + 1);
|
|
160
|
+
this.#events
|
|
161
|
+
.pipe(filter(isActionEventWithName(name)))
|
|
162
|
+
.subscribe(async (event) => {
|
|
163
|
+
const ctx = this.createActionContext(name, event.id);
|
|
164
|
+
try {
|
|
165
|
+
await handler(event.payload, ctx);
|
|
166
|
+
}
|
|
167
|
+
catch (e) {
|
|
168
|
+
if (e instanceof ThymianBaseError) {
|
|
169
|
+
this.#errors.next({
|
|
170
|
+
correlationId: event.id,
|
|
171
|
+
id: randomUUID(),
|
|
172
|
+
error: e,
|
|
173
|
+
name,
|
|
174
|
+
timestamp: Date.now(),
|
|
175
|
+
source: this.source,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
else if (isThymianError(e)) {
|
|
179
|
+
const error = new ThymianBaseError(e.message, {
|
|
180
|
+
...e.options,
|
|
181
|
+
name: e.name,
|
|
182
|
+
});
|
|
183
|
+
this.#errors.next({
|
|
184
|
+
error,
|
|
185
|
+
name,
|
|
186
|
+
correlationId: event.id,
|
|
187
|
+
timestamp: Date.now(),
|
|
188
|
+
source: this.source,
|
|
189
|
+
id: randomUUID(),
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
this.#errors.next({
|
|
194
|
+
error: new ThymianBaseError(`Error while calling action handler for action "${event.name}" from "${event.source}".`, {
|
|
195
|
+
name: 'ActionHandlerError',
|
|
196
|
+
ref: 'https://thymian.dev/references/errors/action-handler-error/',
|
|
197
|
+
cause: e,
|
|
198
|
+
}),
|
|
199
|
+
name,
|
|
200
|
+
correlationId: event.id,
|
|
201
|
+
id: randomUUID(),
|
|
202
|
+
timestamp: Date.now(),
|
|
203
|
+
source: this.source,
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
async emitAction(...args) {
|
|
210
|
+
const [name, payload, options] = args;
|
|
211
|
+
const opts = {
|
|
212
|
+
timeout: this.options.timeout,
|
|
213
|
+
strategy: 'collect',
|
|
214
|
+
strict: true,
|
|
215
|
+
...(options ?? {}),
|
|
216
|
+
};
|
|
217
|
+
if (!this.#listeners.has(name) && !name.startsWith('core.')) {
|
|
218
|
+
if (opts.strict) {
|
|
219
|
+
this.emitError(new ThymianBaseError(`No listener for action "${name}" registered.`, {
|
|
220
|
+
suggestions: [
|
|
221
|
+
'Did you forget to call register handler via "onAction" for it?',
|
|
222
|
+
],
|
|
223
|
+
name: 'NoHandlerRegisteredError',
|
|
224
|
+
}));
|
|
225
|
+
}
|
|
226
|
+
return undefined;
|
|
227
|
+
}
|
|
228
|
+
const start = performance.now();
|
|
229
|
+
const event = {
|
|
230
|
+
id: randomUUID(),
|
|
231
|
+
name,
|
|
232
|
+
payload,
|
|
233
|
+
timestamp: Date.now(),
|
|
234
|
+
source: this.source,
|
|
235
|
+
};
|
|
236
|
+
const numOfListeners = this.#listeners.get(name) ?? 0;
|
|
237
|
+
const takeNum = opts.strategy === 'first' ? 1 : numOfListeners;
|
|
238
|
+
const responsesAndErrors = merge(this.#responses.pipe(filter(isResponseOf(name, event.id))),
|
|
239
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
240
|
+
// @ts-expect-error
|
|
241
|
+
this.#errors.pipe(filter(isResponseOf(name, event.id)))).pipe(takeUntil(timer(opts.timeout)), take(takeNum), toArray());
|
|
242
|
+
const resultsPromise = firstValueFrom(responsesAndErrors);
|
|
243
|
+
// Yield execution to the event loop.
|
|
244
|
+
// This forces the event emission into the next microtask, ensuring that:
|
|
245
|
+
// 1. The 'resultsPromise' subscription is fully active.
|
|
246
|
+
// 2. The event emission does not run synchronously within the current stack frame.
|
|
247
|
+
await Promise.resolve();
|
|
248
|
+
this.#events.next(event);
|
|
249
|
+
const results = (await resultsPromise);
|
|
250
|
+
if (results.length === 0) {
|
|
251
|
+
this.logger.debug(`No response event received for action "${name}" within ${opts.timeout}ms.`);
|
|
252
|
+
}
|
|
253
|
+
const errors = results.filter((r) => Object.hasOwn(r, 'error'));
|
|
254
|
+
if (errors.length > 0 && typeof errors[0] !== 'undefined') {
|
|
255
|
+
this.logger.debug(`Received ${errors.length} error event${errors.length > 1 ? 's' : ''} from ${errors
|
|
256
|
+
.map((err) => `"${err.source}"`)
|
|
257
|
+
.join(', ')} while waiting for response event(s) for event "${name}".`);
|
|
258
|
+
const { error } = errors[0];
|
|
259
|
+
if (error instanceof ThymianBaseError) {
|
|
260
|
+
throw error;
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
throw new ThymianBaseError(error.message, error.options);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (opts.strategy !== 'first' && results.length !== numOfListeners) {
|
|
267
|
+
this.logger.warn(`Expected ${numOfListeners} response events for event "${name}" but got ${results.length}.`);
|
|
268
|
+
}
|
|
269
|
+
const payloads = results.map((msg) => msg.payload);
|
|
270
|
+
this.#completed.add(event.id);
|
|
271
|
+
const duration = performance.now() - start;
|
|
272
|
+
if (duration > opts.timeout) {
|
|
273
|
+
this.logger.warn(`Action "${name}" took ${duration}ms but timeout was set to ${opts.timeout}. Increase the timeout to avoid this warning.`);
|
|
274
|
+
}
|
|
275
|
+
this.logger.debug(`Action "${name}" was emitted and processed in ${performance.now() - start}ms.`);
|
|
276
|
+
switch (opts.strategy) {
|
|
277
|
+
case 'first':
|
|
278
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
279
|
+
// @ts-expect-error
|
|
280
|
+
return payloads[0];
|
|
281
|
+
case 'collect':
|
|
282
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
283
|
+
// @ts-expect-error
|
|
284
|
+
return payloads;
|
|
285
|
+
case 'deep-merge':
|
|
286
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
287
|
+
// @ts-expect-error
|
|
288
|
+
return dm(...payloads);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
child(source) {
|
|
292
|
+
return new ThymianEmitter(this.logger.child(source), {
|
|
293
|
+
completed: this.#completed,
|
|
294
|
+
errors: this.#errors,
|
|
295
|
+
events: this.#events,
|
|
296
|
+
listeners: this.#listeners,
|
|
297
|
+
responses: this.#responses,
|
|
298
|
+
source,
|
|
299
|
+
}, {
|
|
300
|
+
...this.options,
|
|
301
|
+
// we only have to listen to all events once
|
|
302
|
+
traceEvents: false,
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
createActionContext(name, correlationId) {
|
|
306
|
+
return {
|
|
307
|
+
error: (error) => {
|
|
308
|
+
if (error instanceof ThymianBaseError) {
|
|
309
|
+
this.#errors.next({
|
|
310
|
+
correlationId,
|
|
311
|
+
id: randomUUID(),
|
|
312
|
+
error: error,
|
|
313
|
+
name,
|
|
314
|
+
timestamp: Date.now(),
|
|
315
|
+
source: this.source,
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
else if (isThymianError(error)) {
|
|
319
|
+
const thymianError = new ThymianBaseError(error.message, {
|
|
320
|
+
...error.options,
|
|
321
|
+
name: error.name,
|
|
322
|
+
});
|
|
323
|
+
this.#errors.next({
|
|
324
|
+
error: thymianError,
|
|
325
|
+
name,
|
|
326
|
+
correlationId,
|
|
327
|
+
id: randomUUID(),
|
|
328
|
+
timestamp: Date.now(),
|
|
329
|
+
source: this.source,
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
this.#errors.next({
|
|
334
|
+
error: new ThymianBaseError(`Error while calling action handler for action "${name}".`, {
|
|
335
|
+
name: 'ActionHandlerError',
|
|
336
|
+
ref: 'https://thymian.dev/references/errors/action-handler-error/',
|
|
337
|
+
cause: error,
|
|
338
|
+
}),
|
|
339
|
+
name,
|
|
340
|
+
correlationId,
|
|
341
|
+
id: randomUUID(),
|
|
342
|
+
timestamp: Date.now(),
|
|
343
|
+
source: this.source,
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
reply: (payload) => {
|
|
348
|
+
this.#responses.next({
|
|
349
|
+
correlationId,
|
|
350
|
+
name,
|
|
351
|
+
payload,
|
|
352
|
+
timestamp: Date.now(),
|
|
353
|
+
source: this.source,
|
|
354
|
+
id: randomUUID(),
|
|
355
|
+
});
|
|
356
|
+
},
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
onError(fn) {
|
|
360
|
+
this.#errors.subscribe(fn);
|
|
361
|
+
}
|
|
362
|
+
logEvent(type) {
|
|
363
|
+
return (event) => {
|
|
364
|
+
this.logger.trace(`${chalk.bold(event.source)} with ${type} ${chalk.bold(event.name)} at ${new Date(event.timestamp)
|
|
365
|
+
.toISOString()
|
|
366
|
+
.replace('T', ' ')
|
|
367
|
+
.replace('Z', '')}`);
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
//# sourceMappingURL=thymian-emitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thymian-emitter.js","sourceRoot":"","sources":["../../src/emitter/thymian-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,YAAY,EACZ,MAAM,EACN,cAAc,EACd,GAAG,EACH,KAAK,EACL,IAAI,EACJ,SAAS,EACT,OAAO,EACP,IAAI,EACJ,SAAS,EACT,KAAK,EACL,OAAO,GACR,MAAM,MAAM,CAAC;AAKd,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EACL,cAAc,EACd,gBAAgB,GAEjB,MAAM,qBAAqB,CAAC;AAS7B,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,YAAY,GACb,MAAM,YAAY,CAAC;AAEpB,MAAM,EAAE,GAAG,SAAS,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;AAwDpC,MAAM,OAAO,cAAc;IA0BN;IAzBnB,MAAM,CAAC,mBAAmB,GAAG,KAAK,CAAC;IAElB,OAAO,CAAwB;IAEvC,MAAM,CAAS;IAEf,OAAO,GAAG,IAAI,OAAO,EAE3B,CAAC;IAEK,UAAU,CAAmD;IAE7D,OAAO,CAAwC;IAE/C,UAAU,CAAiC;IAEpD,0BAA0B;IACjB,UAAU,CAAc;IAEjC;;OAEG;IACK,MAAM,CAAC,mBAAmB,GAAG,CAAC,CAAC;I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AC,IAAI,CAAC;oBACnB,aAAa;oBACb,IAAI;oBACJ,OAAO;oBACP,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;oBACrB,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,EAAE,EAAE,UAAU,EAAE;iBACjB,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,EAAiD;QACvD,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;IAEO,QAAQ,CAAC,IAAgC;QAC/C,OAAO,CACL,KAIgC,EAChC,EAAE;YACF,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,IAAI,IAAI,KAAK,CAAC,IAAI,CACpD,KAAK,CAAC,IAAI,CACX,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;iBAC9B,WAAW,EAAE;iBACb,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;iBACjB,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CACtB,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ThymianActionName } from '../actions/index.js';
|
|
2
|
+
import type { ThymianEventName } from '../events/index.js';
|
|
3
|
+
import type { ThymianActionEvent, ThymianResponseEvent } from './action-event.js';
|
|
4
|
+
import type { ThymianEvent } from './events.js';
|
|
5
|
+
export declare function isEventWithName<Name extends ThymianEventName>(name: Name): (event: ThymianEvent<ThymianEventName> | ThymianActionEvent<ThymianActionName>) => event is ThymianEvent<Name>;
|
|
6
|
+
export declare function isActionEventWithName<Name extends ThymianActionName>(name: Name): (event: ThymianEvent<ThymianEventName> | ThymianActionEvent<ThymianActionName>) => event is ThymianActionEvent<Name>;
|
|
7
|
+
export declare function isResponseOf<Name extends ThymianActionName>(name: Name, cid: string): (event: ThymianResponseEvent<ThymianActionName>) => event is ThymianResponseEvent<Name>;
|
|
8
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/emitter/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,wBAAgB,eAAe,CAAC,IAAI,SAAS,gBAAgB,EAC3D,IAAI,EAAE,IAAI,GACT,CACD,KAAK,EAAE,YAAY,CAAC,gBAAgB,CAAC,GAAG,kBAAkB,CAAC,iBAAiB,CAAC,KAC1E,KAAK,IAAI,YAAY,CAAC,IAAI,CAAC,CAQ/B;AAED,wBAAgB,qBAAqB,CAAC,IAAI,SAAS,iBAAiB,EAClE,IAAI,EAAE,IAAI,GACT,CACD,KAAK,EAAE,YAAY,CAAC,gBAAgB,CAAC,GAAG,kBAAkB,CAAC,iBAAiB,CAAC,KAC1E,KAAK,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAQrC;AAED,wBAAgB,YAAY,CAAC,IAAI,SAAS,iBAAiB,EACzD,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,MAAM,GACV,CACD,KAAK,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,KAC3C,KAAK,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAMvC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function isEventWithName(name) {
|
|
2
|
+
return function (event) {
|
|
3
|
+
return event.name === name; // && !Object.hasOwn(event, 'correlationId'); TODO: is the correlationId needed?
|
|
4
|
+
};
|
|
5
|
+
}
|
|
6
|
+
export function isActionEventWithName(name) {
|
|
7
|
+
return function (event) {
|
|
8
|
+
return event.name === name;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export function isResponseOf(name, cid) {
|
|
12
|
+
return function (event) {
|
|
13
|
+
return event.name === name && event.correlationId === cid;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/emitter/utils.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,eAAe,CAC7B,IAAU;IAIV,OAAO,UACL,KAEyC;QAEzC,OAAO,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,gFAAgF;IAC9G,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,IAAU;IAIV,OAAO,UACL,KAEyC;QAEzC,OAAO,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;IAC7B,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,IAAU,EACV,GAAW;IAIX,OAAO,UACL,KAA8C;QAE9C,OAAO,KAAK,CAAC,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,aAAa,KAAK,GAAG,CAAC;IAC5D,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JSONSchemaType } from 'ajv/dist/2020.js';
|
|
2
|
+
import type { ThymianBaseError } from '../thymian.error.js';
|
|
3
|
+
export type ErrorEvent = ThymianBaseError;
|
|
4
|
+
export declare const errorEventSchema: JSONSchemaType<ThymianBaseError>;
|
|
5
|
+
//# sourceMappingURL=error.event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.event.d.ts","sourceRoot":"","sources":["../../src/events/error.event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAE1C,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,gBAAgB,CA+C7D,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export const errorEventSchema = {
|
|
2
|
+
// TODO
|
|
3
|
+
anyOf: [],
|
|
4
|
+
oneOf: [],
|
|
5
|
+
type: 'object',
|
|
6
|
+
required: ['name', 'message', 'exitCode', 'options'],
|
|
7
|
+
properties: {
|
|
8
|
+
exitCode: { type: 'number' },
|
|
9
|
+
message: { type: 'string', nullable: false },
|
|
10
|
+
causingError: { type: 'object', required: [], nullable: true },
|
|
11
|
+
stack: { type: 'string', nullable: true },
|
|
12
|
+
name: { type: 'string', nullable: false },
|
|
13
|
+
cause: { type: 'object', nullable: true },
|
|
14
|
+
options: {
|
|
15
|
+
nullable: false,
|
|
16
|
+
type: 'object',
|
|
17
|
+
properties: {
|
|
18
|
+
exitCode: {
|
|
19
|
+
type: 'number',
|
|
20
|
+
nullable: true,
|
|
21
|
+
},
|
|
22
|
+
suggestions: {
|
|
23
|
+
type: 'array',
|
|
24
|
+
items: { type: 'string' },
|
|
25
|
+
nullable: true,
|
|
26
|
+
},
|
|
27
|
+
ref: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
nullable: true,
|
|
30
|
+
},
|
|
31
|
+
code: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
nullable: true,
|
|
34
|
+
},
|
|
35
|
+
name: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
nullable: true,
|
|
38
|
+
},
|
|
39
|
+
severity: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
enum: ['info', 'warn', 'error'],
|
|
42
|
+
nullable: false,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
required: ['severity'],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=error.event.js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EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACf;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;oBAC/B,QAAQ,EAAE,KAAK;iBAChB;aACF;YACD,QAAQ,EAAE,CAAC,UAAU,CAAC;SACvB;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type ExitEvent = {
|
|
2
|
+
code?: number;
|
|
3
|
+
};
|
|
4
|
+
export declare const ExitEventSchema: {
|
|
5
|
+
readonly type: "object";
|
|
6
|
+
readonly required: readonly ["code"];
|
|
7
|
+
readonly properties: {
|
|
8
|
+
readonly code: {
|
|
9
|
+
readonly type: "integer";
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
readonly additionalProperties: false;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=exit.event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exit.event.d.ts","sourceRoot":"","sources":["../../src/events/exit.event.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;CAOlB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exit.event.js","sourceRoot":"","sources":["../../src/events/exit.event.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,UAAU,EAAE;QACV,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC1B;IACD,oBAAoB,EAAE,KAAK;CACnB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ThymianError } from '../thymian.error.js';
|
|
2
|
+
import type { ExitEvent } from './exit.event.js';
|
|
3
|
+
import type { RegisterPluginEvent } from './register-plugin.event.js';
|
|
4
|
+
import type { ReportEvent } from './report.event.js';
|
|
5
|
+
export interface ThymianEvents {
|
|
6
|
+
'core.error': ThymianError;
|
|
7
|
+
'core.register': RegisterPluginEvent;
|
|
8
|
+
'core.report': ReportEvent;
|
|
9
|
+
'core.exit': ExitEvent;
|
|
10
|
+
}
|
|
11
|
+
export type ThymianEventName = keyof ThymianEvents;
|
|
12
|
+
export * from './error.event.js';
|
|
13
|
+
export * from './register-plugin.event.js';
|
|
14
|
+
export * from './report.event.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,YAAY,CAAC;IAC3B,eAAe,EAAE,mBAAmB,CAAC;IACrC,aAAa,EAAE,WAAW,CAAC;IAC3B,WAAW,EAAE,SAAS,CAAC;CACxB;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,aAAa,CAAC;AAEnD,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAcA,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ThymianPluginEvents } from '../thymian-plugin.js';
|
|
2
|
+
export type RegisterPluginEvent = {
|
|
3
|
+
name: string;
|
|
4
|
+
options: unknown;
|
|
5
|
+
events: ThymianPluginEvents;
|
|
6
|
+
};
|
|
7
|
+
export declare const RegisterPluginEventSchema: {
|
|
8
|
+
readonly type: "object";
|
|
9
|
+
readonly required: readonly ["name", "options", "events", "hooks"];
|
|
10
|
+
readonly properties: {
|
|
11
|
+
readonly name: {
|
|
12
|
+
readonly type: "string";
|
|
13
|
+
};
|
|
14
|
+
readonly options: {};
|
|
15
|
+
readonly events: {
|
|
16
|
+
readonly type: "object";
|
|
17
|
+
readonly properties: {
|
|
18
|
+
readonly emits: {
|
|
19
|
+
readonly type: "object";
|
|
20
|
+
readonly additionalProperties: true;
|
|
21
|
+
};
|
|
22
|
+
readonly listens: {
|
|
23
|
+
readonly type: "array";
|
|
24
|
+
readonly items: {
|
|
25
|
+
readonly type: "string";
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
readonly additionalProperties: false;
|
|
30
|
+
};
|
|
31
|
+
readonly hooks: {
|
|
32
|
+
readonly type: "object";
|
|
33
|
+
readonly additionalProperties: {
|
|
34
|
+
readonly type: "object";
|
|
35
|
+
readonly properties: {
|
|
36
|
+
readonly input: {
|
|
37
|
+
readonly type: "object";
|
|
38
|
+
readonly additionalProperties: true;
|
|
39
|
+
};
|
|
40
|
+
readonly output: {
|
|
41
|
+
readonly type: "object";
|
|
42
|
+
readonly additionalProperties: true;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
readonly additionalProperties: false;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
readonly additionalProperties: false;
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=register-plugin.event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-plugin.event.d.ts","sourceRoot":"","sources":["../../src/events/register-plugin.event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2B5B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const RegisterPluginEventSchema = {
|
|
2
|
+
type: 'object',
|
|
3
|
+
required: ['name', 'options', 'events', 'hooks'],
|
|
4
|
+
properties: {
|
|
5
|
+
name: { type: 'string' },
|
|
6
|
+
options: {},
|
|
7
|
+
events: {
|
|
8
|
+
type: 'object',
|
|
9
|
+
properties: {
|
|
10
|
+
emits: { type: 'object', additionalProperties: true },
|
|
11
|
+
listens: { type: 'array', items: { type: 'string' } },
|
|
12
|
+
},
|
|
13
|
+
additionalProperties: false,
|
|
14
|
+
},
|
|
15
|
+
hooks: {
|
|
16
|
+
type: 'object',
|
|
17
|
+
additionalProperties: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
properties: {
|
|
20
|
+
input: { type: 'object', additionalProperties: true },
|
|
21
|
+
output: { type: 'object', additionalProperties: true },
|
|
22
|
+
},
|
|
23
|
+
additionalProperties: false,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
additionalProperties: false,
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=register-plugin.event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-plugin.event.js","sourceRoot":"","sources":["../../src/events/register-plugin.event.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC;IAChD,UAAU,EAAE;QACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,OAAO,EAAE,EAAE;QACX,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAE;gBACrD,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;aACtD;YACD,oBAAoB,EAAE,KAAK;SAC5B;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,oBAAoB,EAAE;gBACpB,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAE;oBACrD,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAE;iBACvD;gBACD,oBAAoB,EAAE,KAAK;aAC5B;SACF;KACF;IACD,oBAAoB,EAAE,KAAK;CACnB,CAAC"}
|