@thymian/core 0.0.1
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 +7 -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/index.d.ts +16 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +5 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/actions/load-format.action.d.ts +6 -0
- package/dist/actions/load-format.action.d.ts.map +1 -0
- package/dist/actions/load-format.action.js +62 -0
- package/dist/actions/load-format.action.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/run.action.d.ts +11 -0
- package/dist/actions/run.action.d.ts.map +1 -0
- package/dist/actions/run.action.js +16 -0
- package/dist/actions/run.action.js.map +1 -0
- package/dist/ajv.d.ts +5 -0
- package/dist/ajv.d.ts.map +1 -0
- package/dist/ajv.js +7 -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 +38 -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 +51 -0
- package/dist/emitter/thymian-emitter.d.ts.map +1 -0
- package/dist/emitter/thymian-emitter.js +306 -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 +28 -0
- package/dist/events/report.event.d.ts.map +1 -0
- package/dist/events/report.event.js +128 -0
- package/dist/events/report.event.js.map +1 -0
- package/dist/format/edges/edge.d.ts +8 -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/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 +8 -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 +85 -0
- package/dist/format/thymian-format.d.ts.map +1 -0
- package/dist/format/thymian-format.js +297 -0
- package/dist/format/thymian-format.js.map +1 -0
- package/dist/format/thymian-schema.d.ts +55 -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 +81 -0
- package/dist/format/utils.js.map +1 -0
- package/dist/http-filter-visitor.d.ts +73 -0
- package/dist/http-filter-visitor.d.ts.map +1 -0
- package/dist/http-filter-visitor.js +163 -0
- package/dist/http-filter-visitor.js.map +1 -0
- package/dist/http-filter.d.ts +135 -0
- package/dist/http-filter.d.ts.map +1 -0
- package/dist/http-filter.js +132 -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.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 +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/logger/logger.d.ts +12 -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 +14 -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 +15 -0
- package/dist/logger/text.logger.d.ts.map +1 -0
- package/dist/logger/text.logger.js +41 -0
- package/dist/logger/text.logger.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 +22 -0
- package/dist/thymian-plugin.js.map +1 -0
- package/dist/thymian.d.ts +33 -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 +148 -0
- package/dist/thymian.js.map +1 -0
- package/dist/utils.d.ts +34 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +115 -0
- package/dist/utils.js.map +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { informationalStatusCodes, } from './1xx/index.js';
|
|
2
|
+
import { successfulStatusCodes, } from './2xx/index.js';
|
|
3
|
+
import { redirectionStatusCodes, } from './3xx/index.js';
|
|
4
|
+
import { clientErrorStatusCodes, } from './4xx/index.js';
|
|
5
|
+
import { serverErrorStatusCodes, } from './5xx/index.js';
|
|
6
|
+
export const httpStatusCodes = [
|
|
7
|
+
...informationalStatusCodes,
|
|
8
|
+
...successfulStatusCodes,
|
|
9
|
+
...redirectionStatusCodes,
|
|
10
|
+
...clientErrorStatusCodes,
|
|
11
|
+
...serverErrorStatusCodes,
|
|
12
|
+
];
|
|
13
|
+
//# sourceMappingURL=http-status-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-status-code.js","sourceRoot":"","sources":["../../src/http-status-codes/http-status-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AASxB,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,GAAG,wBAAwB;IAC3B,GAAG,qBAAqB;IACxB,GAAG,sBAAsB;IACzB,GAAG,sBAAsB;IACzB,GAAG,sBAAsB;CACjB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type InformationalPhrase } from './1xx/index.js';
|
|
2
|
+
import { type SuccessfulPhrase } from './2xx/index.js';
|
|
3
|
+
import { type RedirectionPhrase } from './3xx/index.js';
|
|
4
|
+
import { type ClientErrorPhrase } from './4xx/index.js';
|
|
5
|
+
import { type ServerErrorPhrase } from './5xx/index.js';
|
|
6
|
+
export type HttpStatusPhrase = InformationalPhrase | SuccessfulPhrase | RedirectionPhrase | ClientErrorPhrase | ServerErrorPhrase;
|
|
7
|
+
export declare const httpPhrases: readonly ["continue", "switching protocols", "processing", "early hints", "ok", "created", "accepted", "non-authoritative information", "no content", "reset content", "partial content", "multi-status", "already reported", "multiple choices", "moved permanently", "found", "see other", "not modified", "temporary redirect", "permanent redirect", "bad request", "unauthorized", "payment required", "forbidden", "not found", "method not allowed", "not acceptable", "proxy authentication required", "request timeout", "conflict", "gone", "length required", "precondition failed", "payload too large", "uri too long", "unsupported media type", "range not satisfiable", "expectation failed", "misdirected request", "unprocessable entity", "locked", "failed dependency", "too early", "upgrade required", "precondition required", "too many requests", "request header fields too large", "unavailable for legal reasons", "internal server error", "not implemented", "bad gateway", "service unavailable", "gateway timeout", "http version not supported", "variant also negotiates", "insufficient storage", "loop detected", "not extended", "network authentication required"];
|
|
8
|
+
//# sourceMappingURL=http-status-phrase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-status-phrase.d.ts","sourceRoot":"","sources":["../../src/http-status-codes/http-status-phrase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAwB,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,KAAK,gBAAgB,EAAqB,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,KAAK,iBAAiB,EAAsB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,KAAK,iBAAiB,EAAsB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,KAAK,iBAAiB,EAAsB,MAAM,gBAAgB,CAAC;AAE5E,MAAM,MAAM,gBAAgB,GACxB,mBAAmB,GACnB,gBAAgB,GAChB,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,CAAC;AAEtB,eAAO,MAAM,WAAW,0oCAMd,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { informationalPhrases } from './1xx/index.js';
|
|
2
|
+
import { successfulPhrases } from './2xx/index.js';
|
|
3
|
+
import { redirectionPhrases } from './3xx/index.js';
|
|
4
|
+
import { clientErrorPhrases } from './4xx/index.js';
|
|
5
|
+
import { serverErrorPhrases } from './5xx/index.js';
|
|
6
|
+
export const httpPhrases = [
|
|
7
|
+
...informationalPhrases,
|
|
8
|
+
...successfulPhrases,
|
|
9
|
+
...redirectionPhrases,
|
|
10
|
+
...clientErrorPhrases,
|
|
11
|
+
...serverErrorPhrases,
|
|
12
|
+
];
|
|
13
|
+
//# sourceMappingURL=http-status-phrase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-status-phrase.js","sourceRoot":"","sources":["../../src/http-status-codes/http-status-phrase.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAyB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAA0B,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAA0B,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAA0B,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAS5E,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,GAAG,oBAAoB;IACvB,GAAG,iBAAiB;IACpB,GAAG,kBAAkB;IACrB,GAAG,kBAAkB;IACrB,GAAG,kBAAkB;CACb,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './1xx/index.js';
|
|
2
|
+
export * from './2xx/index.js';
|
|
3
|
+
export * from './3xx/index.js';
|
|
4
|
+
export * from './4xx/index.js';
|
|
5
|
+
export * from './5xx/index.js';
|
|
6
|
+
export * from './http-status-code.js';
|
|
7
|
+
export * from './http-status-code-ranges.js';
|
|
8
|
+
export * from './status-code-to-phrase.js';
|
|
9
|
+
export * from './validate.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/http-status-codes/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './1xx/index.js';
|
|
2
|
+
export * from './2xx/index.js';
|
|
3
|
+
export * from './3xx/index.js';
|
|
4
|
+
export * from './4xx/index.js';
|
|
5
|
+
export * from './5xx/index.js';
|
|
6
|
+
export * from './http-status-code.js';
|
|
7
|
+
export * from './http-status-code-ranges.js';
|
|
8
|
+
export * from './status-code-to-phrase.js';
|
|
9
|
+
export * from './validate.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/http-status-codes/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export declare const httpStatusPhraseToStatusCode: {
|
|
2
|
+
readonly "internal server error": 500;
|
|
3
|
+
readonly "not implemented": 501;
|
|
4
|
+
readonly "bad gateway": 502;
|
|
5
|
+
readonly "service unavailable": 503;
|
|
6
|
+
readonly "gateway timeout": 504;
|
|
7
|
+
readonly "http version not supported": 505;
|
|
8
|
+
readonly "variant also negotiates": 506;
|
|
9
|
+
readonly "insufficient storage": 507;
|
|
10
|
+
readonly "loop detected": 508;
|
|
11
|
+
readonly "not extended": 510;
|
|
12
|
+
readonly "network authentication required": 511;
|
|
13
|
+
readonly "bad request": 400;
|
|
14
|
+
readonly unauthorized: 401;
|
|
15
|
+
readonly "payment required": 402;
|
|
16
|
+
readonly forbidden: 403;
|
|
17
|
+
readonly "not found": 404;
|
|
18
|
+
readonly "method not allowed": 405;
|
|
19
|
+
readonly "not acceptable": 406;
|
|
20
|
+
readonly "proxy authentication required": 407;
|
|
21
|
+
readonly "request timeout": 408;
|
|
22
|
+
readonly conflict: 409;
|
|
23
|
+
readonly gone: 410;
|
|
24
|
+
readonly "length required": 411;
|
|
25
|
+
readonly "precondition failed": 412;
|
|
26
|
+
readonly "payload too large": 413;
|
|
27
|
+
readonly "uri too long": 414;
|
|
28
|
+
readonly "unsupported media type": 415;
|
|
29
|
+
readonly "range not satisfiable": 416;
|
|
30
|
+
readonly "expectation failed": 417;
|
|
31
|
+
readonly "misdirected request": 421;
|
|
32
|
+
readonly "unprocessable entity": 422;
|
|
33
|
+
readonly locked: 423;
|
|
34
|
+
readonly "failed dependency": 424;
|
|
35
|
+
readonly "too early": 425;
|
|
36
|
+
readonly "upgrade required": 426;
|
|
37
|
+
readonly "precondition required": 428;
|
|
38
|
+
readonly "too many requests": 429;
|
|
39
|
+
readonly "request header fields too large": 431;
|
|
40
|
+
readonly "unavailable for legal reasons": 451;
|
|
41
|
+
readonly "multiple choices": 300;
|
|
42
|
+
readonly "moved permanently": 301;
|
|
43
|
+
readonly found: 302;
|
|
44
|
+
readonly "see other": 303;
|
|
45
|
+
readonly "not modified": 304;
|
|
46
|
+
readonly "temporary redirect": 307;
|
|
47
|
+
readonly "permanent redirect": 308;
|
|
48
|
+
readonly ok: 200;
|
|
49
|
+
readonly created: 201;
|
|
50
|
+
readonly accepted: 202;
|
|
51
|
+
readonly "non-authoritative information": 203;
|
|
52
|
+
readonly "no content": 204;
|
|
53
|
+
readonly "reset content": 205;
|
|
54
|
+
readonly "partial content": 206;
|
|
55
|
+
readonly "multi-status": 207;
|
|
56
|
+
readonly "already reported": 208;
|
|
57
|
+
readonly continue: 100;
|
|
58
|
+
readonly "switching protocols": 101;
|
|
59
|
+
readonly processing: 102;
|
|
60
|
+
readonly 'early hints': 103;
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=phrase-to-status-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phrase-to-status-code.d.ts","sourceRoot":"","sources":["../../src/http-status-codes/phrase-to-status-code.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM/B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { informationalPhraseToStatusCode } from './1xx/index.js';
|
|
2
|
+
import { successfulPhraseToStatusCode } from './2xx/index.js';
|
|
3
|
+
import { redirectionPhraseToStatusCode } from './3xx/index.js';
|
|
4
|
+
import { clientErrorPhraseToStatusCOde } from './4xx/index.js';
|
|
5
|
+
import { serverErrorPhraseToStatusCode } from './5xx/index.js';
|
|
6
|
+
export const httpStatusPhraseToStatusCode = {
|
|
7
|
+
...informationalPhraseToStatusCode,
|
|
8
|
+
...successfulPhraseToStatusCode,
|
|
9
|
+
...redirectionPhraseToStatusCode,
|
|
10
|
+
...clientErrorPhraseToStatusCOde,
|
|
11
|
+
...serverErrorPhraseToStatusCode,
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=phrase-to-status-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phrase-to-status-code.js","sourceRoot":"","sources":["../../src/http-status-codes/phrase-to-status-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAE/D,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,GAAG,+BAA+B;IAClC,GAAG,4BAA4B;IAC/B,GAAG,6BAA6B;IAChC,GAAG,6BAA6B;IAChC,GAAG,6BAA6B;CACxB,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export declare const httpStatusCodeToPhrase: {
|
|
2
|
+
readonly 500: "internal server error";
|
|
3
|
+
readonly 501: "not implemented";
|
|
4
|
+
readonly 502: "bad gateway";
|
|
5
|
+
readonly 503: "service unavailable";
|
|
6
|
+
readonly 504: "gateway timeout";
|
|
7
|
+
readonly 505: "http version not supported";
|
|
8
|
+
readonly 506: "variant also negotiates";
|
|
9
|
+
readonly 507: "insufficient storage";
|
|
10
|
+
readonly 508: "loop detected";
|
|
11
|
+
readonly 510: "not extended";
|
|
12
|
+
readonly 511: "network authentication required";
|
|
13
|
+
readonly 400: "bad request";
|
|
14
|
+
readonly 401: "unauthorized";
|
|
15
|
+
readonly 402: "payment required";
|
|
16
|
+
readonly 403: "forbidden";
|
|
17
|
+
readonly 404: "not found";
|
|
18
|
+
readonly 405: "method not allowed";
|
|
19
|
+
readonly 406: "not acceptable";
|
|
20
|
+
readonly 407: "proxy authentication required";
|
|
21
|
+
readonly 408: "request timeout";
|
|
22
|
+
readonly 409: "conflict";
|
|
23
|
+
readonly 410: "gone";
|
|
24
|
+
readonly 411: "length required";
|
|
25
|
+
readonly 412: "precondition failed";
|
|
26
|
+
readonly 413: "payload too large";
|
|
27
|
+
readonly 414: "uri too long";
|
|
28
|
+
readonly 415: "unsupported media type";
|
|
29
|
+
readonly 416: "range not satisfiable";
|
|
30
|
+
readonly 417: "expectation failed";
|
|
31
|
+
readonly 421: "misdirected request";
|
|
32
|
+
readonly 422: "unprocessable entity";
|
|
33
|
+
readonly 423: "locked";
|
|
34
|
+
readonly 424: "failed dependency";
|
|
35
|
+
readonly 425: "too early";
|
|
36
|
+
readonly 426: "upgrade required";
|
|
37
|
+
readonly 428: "precondition required";
|
|
38
|
+
readonly 429: "too many requests";
|
|
39
|
+
readonly 431: "request header fields too large";
|
|
40
|
+
readonly 451: "unavailable for legal reasons";
|
|
41
|
+
readonly 300: "multiple choices";
|
|
42
|
+
readonly 301: "moved permanently";
|
|
43
|
+
readonly 302: "found";
|
|
44
|
+
readonly 303: "see other";
|
|
45
|
+
readonly 304: "not modified";
|
|
46
|
+
readonly 307: "temporary redirect";
|
|
47
|
+
readonly 308: "permanent redirect";
|
|
48
|
+
readonly 200: "ok";
|
|
49
|
+
readonly 201: "created";
|
|
50
|
+
readonly 202: "accepted";
|
|
51
|
+
readonly 203: "non-authoritative information";
|
|
52
|
+
readonly 204: "no content";
|
|
53
|
+
readonly 205: "reset content";
|
|
54
|
+
readonly 206: "partial content";
|
|
55
|
+
readonly 207: "multi-status";
|
|
56
|
+
readonly 208: "already reported";
|
|
57
|
+
readonly 100: "continue";
|
|
58
|
+
readonly 101: "switching protocols";
|
|
59
|
+
readonly 102: "processing";
|
|
60
|
+
readonly 103: "early hints";
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=status-code-to-phrase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-code-to-phrase.d.ts","sourceRoot":"","sources":["../../src/http-status-codes/status-code-to-phrase.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMzB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { informationalStatusCodeToPhrase } from './1xx/index.js';
|
|
2
|
+
import { successfulStatusCodeToPhrase } from './2xx/index.js';
|
|
3
|
+
import { redirectionStatusCodeToPhrase } from './3xx/index.js';
|
|
4
|
+
import { clientErrorStatusCodeToPhrase } from './4xx/index.js';
|
|
5
|
+
import { serverErrorStatusCodeToPhrase } from './5xx/index.js';
|
|
6
|
+
export const httpStatusCodeToPhrase = {
|
|
7
|
+
...informationalStatusCodeToPhrase,
|
|
8
|
+
...successfulStatusCodeToPhrase,
|
|
9
|
+
...redirectionStatusCodeToPhrase,
|
|
10
|
+
...clientErrorStatusCodeToPhrase,
|
|
11
|
+
...serverErrorStatusCodeToPhrase,
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=status-code-to-phrase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-code-to-phrase.js","sourceRoot":"","sources":["../../src/http-status-codes/status-code-to-phrase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAE/D,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,GAAG,+BAA+B;IAClC,GAAG,4BAA4B;IAC/B,GAAG,6BAA6B;IAChC,GAAG,6BAA6B;IAChC,GAAG,6BAA6B;CACxB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HttpStatusCode } from './http-status-code.js';
|
|
2
|
+
import type { HttpStatusPhrase } from './http-status-phrase.js';
|
|
3
|
+
export declare function isValidHttpStatusCode(code: unknown): code is HttpStatusCode;
|
|
4
|
+
export declare function isValidHttpStatusPhrase(phrase: string): phrase is HttpStatusPhrase;
|
|
5
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/http-status-codes/validate.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,cAAc,CAiB3E;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,GACb,MAAM,IAAI,gBAAgB,CAQ5B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { isValidInformationalPhrase, isValidInformationalStatusCode, } from './1xx/index.js';
|
|
2
|
+
import { isValidSuccessfulPhrase, isValidSuccessfulStatusCode, } from './2xx/index.js';
|
|
3
|
+
import { isValidRedirectionPhrase, isValidRedirectionStatusCode, } from './3xx/index.js';
|
|
4
|
+
import { isValidClientErrorPhrase, isValidClientErrorStatusCode, } from './4xx/index.js';
|
|
5
|
+
import { isValidServerErrorPhrase, isValidServerErrorStatusCode, } from './5xx/index.js';
|
|
6
|
+
export function isValidHttpStatusCode(code) {
|
|
7
|
+
let codeNum;
|
|
8
|
+
if (typeof code === 'number') {
|
|
9
|
+
codeNum = code;
|
|
10
|
+
}
|
|
11
|
+
else if (typeof code === 'string' && !isNaN(+code)) {
|
|
12
|
+
codeNum = +code;
|
|
13
|
+
}
|
|
14
|
+
return (typeof codeNum !== 'undefined' &&
|
|
15
|
+
(isValidInformationalStatusCode(codeNum) ||
|
|
16
|
+
isValidSuccessfulStatusCode(codeNum) ||
|
|
17
|
+
isValidRedirectionStatusCode(codeNum) ||
|
|
18
|
+
isValidClientErrorStatusCode(codeNum) ||
|
|
19
|
+
isValidServerErrorStatusCode(codeNum)));
|
|
20
|
+
}
|
|
21
|
+
export function isValidHttpStatusPhrase(phrase) {
|
|
22
|
+
return (isValidInformationalPhrase(phrase) ||
|
|
23
|
+
isValidSuccessfulPhrase(phrase) ||
|
|
24
|
+
isValidRedirectionPhrase(phrase) ||
|
|
25
|
+
isValidClientErrorPhrase(phrase) ||
|
|
26
|
+
isValidServerErrorPhrase(phrase));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/http-status-codes/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,GAC/B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,gBAAgB,CAAC;AAIxB,MAAM,UAAU,qBAAqB,CAAC,IAAa;IACjD,IAAI,OAA2B,CAAC;IAEhC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,GAAG,IAAI,CAAC;IACjB,CAAC;SAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QACrD,OAAO,GAAG,CAAC,IAAI,CAAC;IAClB,CAAC;IAED,OAAO,CACL,OAAO,OAAO,KAAK,WAAW;QAC9B,CAAC,8BAA8B,CAAC,OAAO,CAAC;YACtC,2BAA2B,CAAC,OAAO,CAAC;YACpC,4BAA4B,CAAC,OAAO,CAAC;YACrC,4BAA4B,CAAC,OAAO,CAAC;YACrC,4BAA4B,CAAC,OAAO,CAAC,CAAC,CACzC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,MAAc;IAEd,OAAO,CACL,0BAA0B,CAAC,MAAM,CAAC;QAClC,uBAAuB,CAAC,MAAM,CAAC;QAC/B,wBAAwB,CAAC,MAAM,CAAC;QAChC,wBAAwB,CAAC,MAAM,CAAC;QAChC,wBAAwB,CAAC,MAAM,CAAC,CACjC,CAAC;AACJ,CAAC"}
|
package/dist/http.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type HttpRequest = {
|
|
2
|
+
origin: string;
|
|
3
|
+
path: string;
|
|
4
|
+
method: string;
|
|
5
|
+
bodyEncoding?: string;
|
|
6
|
+
body?: string;
|
|
7
|
+
headers?: Record<string, string | string[] | undefined>;
|
|
8
|
+
};
|
|
9
|
+
export type HttpRequestTemplate = {
|
|
10
|
+
origin: string;
|
|
11
|
+
path: string;
|
|
12
|
+
pathParameters: Record<string, unknown>;
|
|
13
|
+
method: string;
|
|
14
|
+
query: Record<string, unknown>;
|
|
15
|
+
authorize: boolean;
|
|
16
|
+
bodyEncoding?: string;
|
|
17
|
+
body?: unknown;
|
|
18
|
+
headers: Record<string, unknown>;
|
|
19
|
+
cookies: Record<string, unknown>;
|
|
20
|
+
};
|
|
21
|
+
export type HttpResponse = {
|
|
22
|
+
statusCode: number;
|
|
23
|
+
headers: Record<string, string | string[] | undefined>;
|
|
24
|
+
body?: string;
|
|
25
|
+
bodyEncoding?: string;
|
|
26
|
+
trailers: Record<string, string>;
|
|
27
|
+
duration: number;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;CACzD,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
package/dist/http.js
ADDED
package/dist/http.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './actions/index.js';
|
|
2
|
+
export * from './ajv.js';
|
|
3
|
+
export * as chalk from './chalk.js';
|
|
4
|
+
export * from './constants.js';
|
|
5
|
+
export * from './emitter/index.js';
|
|
6
|
+
export * from './emitter/thymian-emitter.js';
|
|
7
|
+
export * from './events/index.js';
|
|
8
|
+
export * from './events/index.js';
|
|
9
|
+
export * from './format/index.js';
|
|
10
|
+
export * from './http.js';
|
|
11
|
+
export * from './http-filter.js';
|
|
12
|
+
export * from './http-filter-visitor.js';
|
|
13
|
+
export { httpStatusCodeRanges, isHttpStatusCodeRange, } from './http-status-codes/http-status-code-ranges.js';
|
|
14
|
+
export * from './http-status-codes/index.js';
|
|
15
|
+
export * from './logger/logger.js';
|
|
16
|
+
export * from './logger/noop.logger.js';
|
|
17
|
+
export * from './logger/text.logger.js';
|
|
18
|
+
export * from './thymian.error.js';
|
|
19
|
+
export * from './thymian.js';
|
|
20
|
+
export * from './thymian-plugin.js';
|
|
21
|
+
export * from './utils.js';
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,gDAAgD,CAAC;AACxD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './actions/index.js';
|
|
2
|
+
export * from './ajv.js';
|
|
3
|
+
export * as chalk from './chalk.js';
|
|
4
|
+
export * from './constants.js';
|
|
5
|
+
export * from './emitter/index.js';
|
|
6
|
+
export * from './emitter/thymian-emitter.js';
|
|
7
|
+
export * from './events/index.js';
|
|
8
|
+
export * from './events/index.js';
|
|
9
|
+
export * from './format/index.js';
|
|
10
|
+
export * from './http.js';
|
|
11
|
+
export * from './http-filter.js';
|
|
12
|
+
export * from './http-filter-visitor.js';
|
|
13
|
+
export { httpStatusCodeRanges, isHttpStatusCodeRange, } from './http-status-codes/http-status-code-ranges.js';
|
|
14
|
+
export * from './http-status-codes/index.js';
|
|
15
|
+
export * from './logger/logger.js';
|
|
16
|
+
export * from './logger/noop.logger.js';
|
|
17
|
+
export * from './logger/text.logger.js';
|
|
18
|
+
export * from './thymian.error.js';
|
|
19
|
+
export * from './thymian.js';
|
|
20
|
+
export * from './thymian-plugin.js';
|
|
21
|
+
export * from './utils.js';
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,gDAAgD,CAAC;AACxD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface Logger {
|
|
2
|
+
namespace: string;
|
|
3
|
+
verbose: boolean;
|
|
4
|
+
debug(formatter: unknown, ...args: unknown[]): void;
|
|
5
|
+
info(formatter: unknown, ...args: unknown[]): void;
|
|
6
|
+
error(formatter: unknown, ...args: unknown[]): void;
|
|
7
|
+
trace(formatter: unknown, ...args: unknown[]): void;
|
|
8
|
+
warn(formatter: unknown, ...args: unknown[]): void;
|
|
9
|
+
out(output: unknown): void;
|
|
10
|
+
child(name: string, verbose?: boolean): Logger;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger/logger.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACpD,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACnD,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACpD,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACpD,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACnD,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAChD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger/logger.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Logger } from './logger.js';
|
|
2
|
+
export declare class NoopLogger implements Logger {
|
|
3
|
+
readonly namespace: string;
|
|
4
|
+
verbose: boolean;
|
|
5
|
+
constructor(name?: string);
|
|
6
|
+
trace(): void;
|
|
7
|
+
warn(): void;
|
|
8
|
+
debug(): void;
|
|
9
|
+
info(): void;
|
|
10
|
+
error(): void;
|
|
11
|
+
out(): void;
|
|
12
|
+
child(): Logger;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=noop.logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noop.logger.d.ts","sourceRoot":"","sources":["../../src/logger/noop.logger.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAa,UAAW,YAAW,MAAM;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,OAAO,UAAS;gBAEJ,IAAI,SAAK;IAIrB,KAAK,IAAI,IAAI;IACb,IAAI,IAAI,IAAI;IACZ,KAAK,IAAI,IAAI;IACb,IAAI,IAAI,IAAI;IACZ,KAAK,IAAI,IAAI;IACb,GAAG,IAAI,IAAI;IACX,KAAK,IAAI,MAAM;CAGhB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* eslint @typescript-eslint/no-empty-function: 0 */
|
|
2
|
+
export class NoopLogger {
|
|
3
|
+
namespace;
|
|
4
|
+
verbose = false;
|
|
5
|
+
constructor(name = '') {
|
|
6
|
+
this.namespace = name;
|
|
7
|
+
}
|
|
8
|
+
trace() { }
|
|
9
|
+
warn() { }
|
|
10
|
+
debug() { }
|
|
11
|
+
info() { }
|
|
12
|
+
error() { }
|
|
13
|
+
out() { }
|
|
14
|
+
child() {
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=noop.logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noop.logger.js","sourceRoot":"","sources":["../../src/logger/noop.logger.ts"],"names":[],"mappings":"AAAA,oDAAoD;AAIpD,MAAM,OAAO,UAAU;IACZ,SAAS,CAAS;IAC3B,OAAO,GAAG,KAAK,CAAC;IAEhB,YAAY,IAAI,GAAG,EAAE;QACnB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,KAAK,KAAU,CAAC;IAChB,IAAI,KAAU,CAAC;IACf,KAAK,KAAU,CAAC;IAChB,IAAI,KAAU,CAAC;IACf,KAAK,KAAU,CAAC;IAChB,GAAG,KAAU,CAAC;IACd,KAAK;QACH,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Logger } from './logger.js';
|
|
2
|
+
export declare class TextLogger implements Logger {
|
|
3
|
+
readonly namespace: string;
|
|
4
|
+
readonly verbose: boolean;
|
|
5
|
+
constructor(name: string, verbose?: boolean);
|
|
6
|
+
trace(formatter: unknown, ...args: unknown[]): void;
|
|
7
|
+
warn(formatter: unknown, ...args: unknown[]): void;
|
|
8
|
+
debug(formatter: unknown, ...args: unknown[]): void;
|
|
9
|
+
info(formatter: unknown, ...args: unknown[]): void;
|
|
10
|
+
error(formatter: unknown, ...args: unknown[]): void;
|
|
11
|
+
out(output: unknown): void;
|
|
12
|
+
child(name: string, verbose?: boolean): Logger;
|
|
13
|
+
private now;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=text.logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.logger.d.ts","sourceRoot":"","sources":["../../src/logger/text.logger.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAa,UAAW,YAAW,MAAM;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;gBAEd,IAAI,EAAE,MAAM,EAAE,OAAO,UAAQ;IAKzC,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAUnD,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IASlD,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAUnD,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAQlD,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAQnD,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAK1B,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,UAAe,GAAG,MAAM;IAInD,OAAO,CAAC,GAAG;CAGZ"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { format } from 'node:util';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
export class TextLogger {
|
|
4
|
+
namespace;
|
|
5
|
+
verbose;
|
|
6
|
+
constructor(name, verbose = false) {
|
|
7
|
+
this.namespace = name;
|
|
8
|
+
this.verbose = verbose;
|
|
9
|
+
}
|
|
10
|
+
trace(formatter, ...args) {
|
|
11
|
+
if (this.verbose) {
|
|
12
|
+
console.log(`${chalk.grey(`TRACE`)} [${this.now()}] [${this.namespace}]: ${format(formatter, ...args)}`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
warn(formatter, ...args) {
|
|
16
|
+
console.log(`${chalk.yellow(`WARN`)} [${this.now()}] [${this.namespace}]: ${format(formatter, ...args)}`);
|
|
17
|
+
}
|
|
18
|
+
debug(formatter, ...args) {
|
|
19
|
+
if (this.verbose) {
|
|
20
|
+
console.log(`${chalk.blue(`DEBUG`)} [${this.now()}] [${this.namespace}]: ${format(formatter, ...args)}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
info(formatter, ...args) {
|
|
24
|
+
console.log(`${chalk.green(`INFO`)} [${this.now()}] [${this.namespace}]: ${format(formatter, ...args)}`);
|
|
25
|
+
}
|
|
26
|
+
error(formatter, ...args) {
|
|
27
|
+
console.log(`${chalk.red(`ERROR`)} [${this.now()}] [${this.namespace}]: ${format(formatter, ...args)}`);
|
|
28
|
+
}
|
|
29
|
+
out(output) {
|
|
30
|
+
if (typeof output !== 'undefined') {
|
|
31
|
+
console.log(output);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
child(name, verbose = this.verbose) {
|
|
35
|
+
return new TextLogger(name, verbose);
|
|
36
|
+
}
|
|
37
|
+
now() {
|
|
38
|
+
return new Date().toISOString().replace(/\.\d{3}Z$/, 'Z');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=text.logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.logger.js","sourceRoot":"","sources":["../../src/logger/text.logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,OAAO,UAAU;IACZ,SAAS,CAAS;IAClB,OAAO,CAAU;IAE1B,YAAY,IAAY,EAAE,OAAO,GAAG,KAAK;QACvC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,SAAkB,EAAE,GAAG,IAAe;QAC1C,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,CAAC,GAAG,CACT,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,MAAM,IAAI,CAAC,SAAS,MAAM,MAAM,CACnE,SAAS,EACT,GAAG,IAAI,CACR,EAAE,CACJ,CAAC;QACJ,CAAC;IACH,CAAC;IACD,IAAI,CAAC,SAAkB,EAAE,GAAG,IAAe;QACzC,OAAO,CAAC,GAAG,CACT,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,MAAM,IAAI,CAAC,SAAS,MAAM,MAAM,CACpE,SAAS,EACT,GAAG,IAAI,CACR,EAAE,CACJ,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,SAAkB,EAAE,GAAG,IAAe;QAC1C,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,CAAC,GAAG,CACT,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,MAAM,IAAI,CAAC,SAAS,MAAM,MAAM,CACnE,SAAS,EACT,GAAG,IAAI,CACR,EAAE,CACJ,CAAC;QACJ,CAAC;IACH,CAAC;IACD,IAAI,CAAC,SAAkB,EAAE,GAAG,IAAe;QACzC,OAAO,CAAC,GAAG,CACT,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,MAAM,IAAI,CAAC,SAAS,MAAM,MAAM,CACnE,SAAS,EACT,GAAG,IAAI,CACR,EAAE,CACJ,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,SAAkB,EAAE,GAAG,IAAe;QAC1C,OAAO,CAAC,GAAG,CACT,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,MAAM,IAAI,CAAC,SAAS,MAAM,MAAM,CAClE,SAAS,EACT,GAAG,IAAI,CACR,EAAE,CACJ,CAAC;IACJ,CAAC;IACD,GAAG,CAAC,MAAe;QACjB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IACD,KAAK,CAAC,IAAY,EAAE,OAAO,GAAG,IAAI,CAAC,OAAO;QACxC,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;IAEO,GAAG;QACT,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAC5D,CAAC;CACF"}
|
|
@@ -0,0 +1,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,CAqBjE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
const requiredKeys = ['plugin', 'name', 'version'];
|
|
7
|
+
for (const key of requiredKeys) {
|
|
8
|
+
if (!Object.hasOwn(plugin, key))
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
if (typeof plugin['plugin'] !== 'function') {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
if (typeof plugin['name'] !== 'string') {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
if (typeof plugin['version'] !== 'string') {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
//# 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;QAAE,OAAO,KAAK,CAAC;IAEpC,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;YAAE,OAAO,KAAK,CAAC;IAChD,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"}
|