From 59eba1fa579e94aa4966c05ecbf08575d9691023 Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Wed, 14 Oct 2026 02:38:26 +0900 Subject: [PATCH 01/26] refactor: drop the @ts-ignore from ValidationError (#650) Signed-off-by: kahirokunn --- src/event/validation.ts | 16 +++++-------- test/integration/utilities_test.ts | 38 +++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 11 deletions(-) diff --git a/src/event/validation.ts b/src/event/validation.ts index c5e81864..663e034d 100644 --- a/src/event/validation.ts +++ b/src/event/validation.ts @@ -30,17 +30,13 @@ export class ValidationError extends TypeError { errors?: string[] | ErrorObject[] | null; constructor(message: string, errors?: string[] | ErrorObject[] | null) { - const messageString = - errors instanceof Array - ? // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - errors?.reduce( - (accum: string, err: Record) => - accum.concat(` + const validationErrors: Array = errors instanceof Array ? errors : []; + const messageString = validationErrors.reduce( + (accum, err) => + accum.concat(` ${err instanceof Object ? JSON.stringify(err) : err}`), - message, - ) - : message; + message, + ); super(messageString); this.errors = errors ? errors : []; } diff --git a/test/integration/utilities_test.ts b/test/integration/utilities_test.ts index a0b8a2ec..d7fe12e8 100644 --- a/test/integration/utilities_test.ts +++ b/test/integration/utilities_test.ts @@ -5,7 +5,43 @@ import "mocha"; import { expect } from "chai"; -import { isStringOrThrow, equalsOrThrow, isBase64, asData } from "../../src/event/validation"; +import { ValidationError, isStringOrThrow, equalsOrThrow, isBase64, asData } from "../../src/event/validation"; + +describe("ValidationError", () => { + it("includes string errors in its message", () => { + const errors = ["source is required", "type is required"]; + + const error = new ValidationError("invalid payload", errors); + + expect(error.message).to.equal(`invalid payload + source is required + type is required`); + expect(error.errors).to.equal(errors); + }); + + it("includes AJV errors as JSON in its message", () => { + const errors = [ + { + instancePath: "/source", + schemaPath: "#/properties/source/minLength", + keyword: "minLength", + params: { limit: 1 }, + message: "must NOT have fewer than 1 characters", + }, + ]; + + const error = new ValidationError("invalid payload", errors); + + expect(error.message).to.equal(`invalid payload + ${JSON.stringify(errors[0])}`); + expect(error.errors).to.equal(errors); + }); + + it("keeps the original message when no errors are provided", () => { + expect(new ValidationError("invalid payload").message).to.equal("invalid payload"); + expect(new ValidationError("invalid payload", null).message).to.equal("invalid payload"); + }); +}); describe("Utilities", () => { describe("isStringOrThrow", () => { From e96e8f63e4a2664b786bad0c4a87043dbdb5f66d Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Wed, 14 Oct 2026 02:41:32 +0900 Subject: [PATCH 02/26] docs: return the transport promise from the custom emitter examples (#651) Signed-off-by: kahirokunn --- API_TRANSITION_GUIDE.md | 10 ++++++---- README.md | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/API_TRANSITION_GUIDE.md b/API_TRANSITION_GUIDE.md index 4370a732..f968e902 100644 --- a/API_TRANSITION_GUIDE.md +++ b/API_TRANSITION_GUIDE.md @@ -59,8 +59,9 @@ const { emitterFor, Mode } = require("cloudevents"); function sendWithAxios(message) { // Do what you need with the message headers // and body in this function, then send the - // event - axios({ + // event. Return the promise so that `await emit(event)` + // waits for the send and rejects if it fails. + return axios({ method: 'post', url: '...', data: message.body, @@ -81,8 +82,9 @@ const { emitterFor, Mode, CloudEvent, Emitter } = require("cloudevents"); function sendWithAxios(message) { // Do what you need with the message headers // and body in this function, then send the - // event - axios({ + // event. Return the promise so that `await emit(event)` + // waits for the send and rejects if it fails. + return axios({ method: "post", url: "...", data: message.body, diff --git a/README.md b/README.md index b40b8de3..abac1560 100644 --- a/README.md +++ b/README.md @@ -91,8 +91,9 @@ const { emitterFor, Mode, CloudEvent } = require("cloudevents"); function sendWithAxios(message) { // Do what you need with the message headers // and body in this function, then send the - // event - axios({ + // event. Return the promise so that `await emit(event)` + // waits for the send and rejects if it fails. + return axios({ method: "post", url: "...", data: message.body, From 23aaa91b12078aba4cc8681bbb7264b154511b3d Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Sat, 17 Oct 2026 22:44:31 +0900 Subject: [PATCH 03/26] chore: update TypeScript, TypeDoc and Node.js declarations (#656) * chore: upgrade typescript to 4.9 and typedoc Signed-off-by: kahirokunn * chore: upgrade @types/node to match the supported Node.js versions Signed-off-by: kahirokunn --------- Signed-off-by: kahirokunn --- package-lock.json | 109 +++++++++++++++++++++++----------------------- package.json | 6 +-- 2 files changed, 57 insertions(+), 58 deletions(-) diff --git a/package-lock.json b/package-lock.json index bbffeea7..9fcdac6d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "@types/got": "^9.6.11", "@types/json-bigint": "^1.0.1", "@types/mocha": "^7.0.2", - "@types/node": "^14.14.10", + "@types/node": "~22.0.0", "@types/superagent": "^4.1.10", "@types/uuid": "^8.3.4", "@typescript-eslint/eslint-plugin": "^4.29.0", @@ -49,8 +49,8 @@ "remark-preset-lint-recommended": "^5.0.0", "superagent": "^7.1.1", "ts-node": "^10.8.1", - "typedoc": "^0.22.11", - "typescript": "^4.3.5", + "typedoc": "^0.23.28", + "typescript": "^4.9.5", "webpack": "^5.76.0", "webpack-cli": "^4.10.0" }, @@ -1295,11 +1295,14 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "14.18.63", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", - "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==", + "version": "22.0.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.0.3.tgz", + "integrity": "sha512-/e0NZtK2gs6Vk2DoyrXSZZ4AlamqTkx0CcKx1Aq8/P4ITlRgU9OtVf5fl+LXkWWJce1M89pkSlH6lJJEnK7bQA==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "undici-types": "~6.11.1" + } }, "node_modules/@types/responselike": { "version": "1.0.3", @@ -1891,6 +1894,13 @@ "node": ">=6" } }, + "node_modules/ansi-sequence-parser": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.3.tgz", + "integrity": "sha512-+fksAx9eG3Ab6LDnLs3ZqZa8KVJ/jYnX+D4Qe1azX+LFGFAXqynCQLOdLpNYN/l9e7l6hMWwZbrnctqr6eSQSw==", + "dev": true, + "license": "MIT" + }, "node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -8863,15 +8873,16 @@ } }, "node_modules/shiki": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.10.1.tgz", - "integrity": "sha512-VsY7QJVzU51j5o1+DguUd+6vmCmZ5v/6gYu4vyYAhzjuNQU6P/vmSy4uQaOhvje031qQMiW0d2BwgMH52vqMng==", + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.7.tgz", + "integrity": "sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==", "dev": true, "license": "MIT", "dependencies": { - "jsonc-parser": "^3.0.0", - "vscode-oniguruma": "^1.6.1", - "vscode-textmate": "5.2.0" + "ansi-sequence-parser": "^1.1.0", + "jsonc-parser": "^3.2.0", + "vscode-oniguruma": "^1.7.0", + "vscode-textmate": "^8.0.0" } }, "node_modules/side-channel": { @@ -9725,76 +9736,57 @@ } }, "node_modules/typedoc": { - "version": "0.22.18", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.18.tgz", - "integrity": "sha512-NK9RlLhRUGMvc6Rw5USEYgT4DVAUFk7IF7Q6MYfpJ88KnTZP7EneEa4RcP+tX1auAcz7QT1Iy0bUSZBYYHdoyA==", + "version": "0.23.28", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.23.28.tgz", + "integrity": "sha512-9x1+hZWTHEQcGoP7qFmlo4unUoVJLB0H/8vfO/7wqTnZxg4kPuji9y3uRzEu0ZKez63OJAUmiGhUrtukC6Uj3w==", "dev": true, "license": "Apache-2.0", "dependencies": { - "glob": "^8.0.3", "lunr": "^2.3.9", - "marked": "^4.0.16", - "minimatch": "^5.1.0", - "shiki": "^0.10.1" + "marked": "^4.2.12", + "minimatch": "^7.1.3", + "shiki": "^0.14.1" }, "bin": { "typedoc": "bin/typedoc" }, "engines": { - "node": ">= 12.10.0" + "node": ">= 14.14" }, "peerDependencies": { - "typescript": "4.0.x || 4.1.x || 4.2.x || 4.3.x || 4.4.x || 4.5.x || 4.6.x || 4.7.x" + "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x" } }, "node_modules/typedoc/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz", + "integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==", "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, - "node_modules/typedoc/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "node_modules/typedoc/node_modules/minimatch": { + "version": "7.4.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.9.tgz", + "integrity": "sha512-Brg/fp/iAVDOQoHxkuN5bEYhyQlZhxddI78yWsCbeEwTHXQjlNLtiJDUsp1GIptVqMI7/gkJMz4vVAc01mpoBw==", "dev": true, "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "brace-expansion": "^2.0.2" }, "engines": { - "node": ">=12" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/typedoc/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, "license": "Apache-2.0", "bin": { @@ -9824,6 +9816,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici-types": { + "version": "6.11.1", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.11.1.tgz", + "integrity": "sha512-mIDEX2ek50x0OlRgxryxsenE5XaQD4on5U2inY7RApK3SOJpofyw7uW2AyfMKkhAxXIceo2DeWGVGwyvng1GNQ==", + "dev": true, + "license": "MIT" + }, "node_modules/unified": { "version": "10.1.2", "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", @@ -10402,9 +10401,9 @@ "license": "MIT" }, "node_modules/vscode-textmate": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz", - "integrity": "sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz", + "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==", "dev": true, "license": "MIT" }, diff --git a/package.json b/package.json index 214d34a5..17b31a16 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "@types/got": "^9.6.11", "@types/json-bigint": "^1.0.1", "@types/mocha": "^7.0.2", - "@types/node": "^14.14.10", + "@types/node": "~22.0.0", "@types/superagent": "^4.1.10", "@types/uuid": "^8.3.4", "@typescript-eslint/eslint-plugin": "^4.29.0", @@ -150,8 +150,8 @@ "remark-preset-lint-recommended": "^5.0.0", "superagent": "^7.1.1", "ts-node": "^10.8.1", - "typedoc": "^0.22.11", - "typescript": "^4.3.5", + "typedoc": "^0.23.28", + "typescript": "^4.9.5", "webpack": "^5.76.0", "webpack-cli": "^4.10.0" }, From 5ba5f876284cdb82fff02ebdfdbc7511a6fb3fa1 Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Sun, 18 Oct 2026 07:26:03 +0900 Subject: [PATCH 04/26] feat!: remove Node.js 20 support (#653) Signed-off-by: kahirokunn --- .github/workflows/nodejs-ci-action.yml | 2 +- README.md | 2 +- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nodejs-ci-action.yml b/.github/workflows/nodejs-ci-action.yml index 0b1bbddd..4adff11f 100644 --- a/.github/workflows/nodejs-ci-action.yml +++ b/.github/workflows/nodejs-ci-action.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [20.x, 22.x, 24.x] + node-version: [22.x, 24.x] steps: - uses: actions/checkout@v4 diff --git a/README.md b/README.md index abac1560..f0256adb 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ _Note:_ Supports CloudEvent version 1.0 ## Installation The CloudEvents SDK requires a current LTS version of Node.js. At the moment -those are Node.js 16.x, and Node.js 18.x. To install in your Node.js project: +those are Node.js 22.x, and Node.js 24.x. To install in your Node.js project: ```console npm install cloudevents diff --git a/package-lock.json b/package-lock.json index 9fcdac6d..21a1003c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,7 +55,7 @@ "webpack-cli": "^4.10.0" }, "engines": { - "node": ">=20 <=24" + "node": ">=22 <=24" } }, "node_modules/@ampproject/remapping": { diff --git a/package.json b/package.json index 17b31a16..1f3e4d1d 100644 --- a/package.json +++ b/package.json @@ -160,6 +160,6 @@ }, "types": "./dist/index.d.ts", "engines": { - "node": ">=20 <=24" + "node": ">=22 <=24" } } From 26d2dcd27f571f32b38cac70583df87d7fdee3cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Oct 2026 11:43:55 -0400 Subject: [PATCH 05/26] build(deps): bump form-data (#627) Bumps and [form-data](https://github.com/form-data/form-data). These dependencies needed to be updated together. Updates `form-data` from 2.5.3 to 2.5.5 - [Release notes](https://github.com/form-data/form-data/releases) - [Changelog](https://github.com/form-data/form-data/blob/v2.5.5/CHANGELOG.md) - [Commits](https://github.com/form-data/form-data/compare/v2.5.3...v2.5.5) Updates `form-data` from 4.0.2 to 4.0.4 - [Release notes](https://github.com/form-data/form-data/releases) - [Changelog](https://github.com/form-data/form-data/blob/v2.5.5/CHANGELOG.md) - [Commits](https://github.com/form-data/form-data/compare/v2.5.3...v2.5.5) --- updated-dependencies: - dependency-name: form-data dependency-version: 2.5.5 dependency-type: indirect - dependency-name: form-data dependency-version: 4.0.4 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 21a1003c..b6340f77 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4213,15 +4213,16 @@ } }, "node_modules/form-data": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.3.tgz", - "integrity": "sha512-XHIrMD0NpDrNM/Ckf7XJiBbLl57KEhT3+i3yY+eWm+cqYZJQTZrKo8Y8AWKnuV5GT4scfuUGt9LzNoIx3dU1nQ==", + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.5.tgz", + "integrity": "sha512-jqdObeR2rxZZbPSGL+3VckHMYtu+f9//KXBsVny6JSX/pa38Fy+bGjuG8eW/H6USNQWhLi8Num++cU2yOCNz4A==", "dev": true, "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", "mime-types": "^2.1.35", "safe-buffer": "^5.2.1" }, @@ -9235,15 +9236,16 @@ } }, "node_modules/superagent/node_modules/form-data": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", - "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", + "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", "dev": true, "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", "mime-types": "^2.1.12" }, "engines": { From 6da6d135b0f3c9125db9e043bb98d9403ce97f34 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Oct 2026 11:45:38 -0400 Subject: [PATCH 06/26] build(deps): bump js-yaml (#630) Bumps and [js-yaml](https://github.com/nodeca/js-yaml). These dependencies needed to be updated together. Updates `js-yaml` from 3.14.1 to 3.14.2 - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](https://github.com/nodeca/js-yaml/compare/3.14.1...3.14.2) Updates `js-yaml` from 4.1.0 to 4.1.1 - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](https://github.com/nodeca/js-yaml/compare/3.14.1...3.14.2) --- updated-dependencies: - dependency-name: js-yaml dependency-version: 3.14.2 dependency-type: indirect - dependency-name: js-yaml dependency-version: 4.1.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index b6340f77..78cbf34c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5682,9 +5682,9 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", + "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", "dev": true, "license": "MIT", "dependencies": { @@ -6930,9 +6930,9 @@ } }, "node_modules/mocha/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "dev": true, "license": "MIT", "dependencies": { @@ -9931,9 +9931,9 @@ "license": "Python-2.0" }, "node_modules/unified-engine/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "dev": true, "license": "MIT", "dependencies": { From 0ca14b86f39b513b0ace9c094bb8f8f2d5cc9aa9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Oct 2026 11:47:30 -0400 Subject: [PATCH 07/26] build(deps-dev): bump lodash-es from 4.17.21 to 4.17.23 (#635) Bumps [lodash-es](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23) --- updated-dependencies: - dependency-name: lodash-es dependency-version: 4.17.23 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 78cbf34c..2753cc6e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5980,9 +5980,9 @@ "license": "MIT" }, "node_modules/lodash-es": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", - "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "version": "4.17.23", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.23.tgz", + "integrity": "sha512-kVI48u3PZr38HdYz98UmfPnXl2DXrpdctLrFLCd3kOx1xUkOmpFPx7gCWWM5MPkL/fD8zb+Ph0QzjGFs4+hHWg==", "dev": true, "license": "MIT" }, From b52a07a779db497d0abdd33ecfab85aa653151ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Jan 2026 23:45:10 +0000 Subject: [PATCH 08/26] build(deps): bump lodash from 4.17.21 to 4.17.23 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23) --- updated-dependencies: - dependency-name: lodash dependency-version: 4.17.23 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2753cc6e..d1f38e7f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5973,9 +5973,9 @@ } }, "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "version": "4.17.23", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", + "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", "dev": true, "license": "MIT" }, From 37d9f1b1a3dba4329d6754ff2bb3a287af85ad87 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 7 Feb 2026 15:11:32 +0000 Subject: [PATCH 09/26] build(deps-dev): bump webpack from 5.99.9 to 5.105.0 Bumps [webpack](https://github.com/webpack/webpack) from 5.99.9 to 5.105.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Changelog](https://github.com/webpack/webpack/blob/main/CHANGELOG.md) - [Commits](https://github.com/webpack/webpack/compare/v5.99.9...v5.105.0) --- updated-dependencies: - dependency-name: webpack dependency-version: 5.105.0 dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- package-lock.json | 181 +++++++++++++++++++++++++++------------------- 1 file changed, 107 insertions(+), 74 deletions(-) diff --git a/package-lock.json b/package-lock.json index d1f38e7f..629c0179 100644 --- a/package-lock.json +++ b/package-lock.json @@ -956,9 +956,9 @@ } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", - "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", + "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", "dev": true, "license": "MIT", "dependencies": { @@ -1193,9 +1193,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", - "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", "dev": true, "license": "MIT" }, @@ -2216,6 +2216,16 @@ "dev": true, "license": "MIT" }, + "node_modules/baseline-browser-mapping": { + "version": "2.9.19", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.19.tgz", + "integrity": "sha512-ipDqC8FrAl/76p2SSWKSI+H9tFwm7vYqXQrItCuiVPt26Km0jS+NzSsBWAaBusvSbQcfJG+JitdMm+wZAgTYqg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.js" + } + }, "node_modules/bignumber.js": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.0.tgz", @@ -2270,9 +2280,9 @@ "license": "ISC" }, "node_modules/browserslist": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.0.tgz", - "integrity": "sha512-PJ8gYKeS5e/whHBh8xrwYK+dAvEj7JXtz6uTucnMRB8OiGTsKccFekoRrjajPBHV8oOY+2tI4uxeceSimKwMFA==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz", + "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==", "dev": true, "funding": [ { @@ -2290,10 +2300,11 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001718", - "electron-to-chromium": "^1.5.160", - "node-releases": "^2.0.19", - "update-browserslist-db": "^1.1.3" + "baseline-browser-mapping": "^2.9.0", + "caniuse-lite": "^1.0.30001759", + "electron-to-chromium": "^1.5.263", + "node-releases": "^2.0.27", + "update-browserslist-db": "^1.2.0" }, "bin": { "browserslist": "cli.js" @@ -2432,9 +2443,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001721", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001721.tgz", - "integrity": "sha512-cOuvmUVtKrtEaoKiO0rSc29jcjwMwX5tOHDy4MgVFEWiUXj4uBMJkwI8MDySkgXidpMiHUcviogAvFi4pA2hDQ==", + "version": "1.0.30001769", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001769.tgz", + "integrity": "sha512-BCfFL1sHijQlBGWBMuJyhZUhzo7wer5sVj9hqekB/7xn0Ypy+pER/edCYQm4exbXj4WiySGp40P8UuTh6w1srg==", "dev": true, "funding": [ { @@ -3090,9 +3101,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.165", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.165.tgz", - "integrity": "sha512-naiMx1Z6Nb2TxPU6fiFrUrDTjyPMLdTtaOd2oLmG8zVSg2hCWGkhPyxwk+qRmZ1ytwVqUv0u7ZcDA5+ALhaUtw==", + "version": "1.5.286", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.286.tgz", + "integrity": "sha512-9tfDXhJ4RKFNerfjdCcZfufu49vg620741MNs26a9+bhLThdB+plgMeou98CAaHu/WATj2iHOOHTp1hWtABj2A==", "dev": true, "license": "ISC" }, @@ -3114,14 +3125,14 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.18.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz", - "integrity": "sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==", + "version": "5.19.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.19.0.tgz", + "integrity": "sha512-phv3E1Xl4tQOShqSte26C7Fl84EwUdZsyOuSSk9qtAGyyQs2s3jJzComh+Abf4g187lUUAvH+H26omrqia2aGg==", "dev": true, "license": "MIT", "dependencies": { "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" + "tapable": "^2.3.0" }, "engines": { "node": ">=10.13.0" @@ -3262,9 +3273,9 @@ } }, "node_modules/es-module-lexer": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", - "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.0.0.tgz", + "integrity": "sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==", "dev": true, "license": "MIT" }, @@ -5947,13 +5958,17 @@ } }, "node_modules/loader-runner": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", - "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.1.tgz", + "integrity": "sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==", "dev": true, "license": "MIT", "engines": { "node": ">=6.11.5" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" } }, "node_modules/locate-path": { @@ -7046,9 +7061,9 @@ } }, "node_modules/node-releases": { - "version": "2.0.19", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", - "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "version": "2.0.27", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", + "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", "dev": true, "license": "MIT" }, @@ -8710,9 +8725,9 @@ } }, "node_modules/schema-utils": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.2.tgz", - "integrity": "sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz", + "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==", "dev": true, "license": "MIT", "dependencies": { @@ -9299,24 +9314,28 @@ } }, "node_modules/tapable": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.2.tgz", - "integrity": "sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz", + "integrity": "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==", "dev": true, "license": "MIT", "engines": { "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" } }, "node_modules/terser": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.41.0.tgz", - "integrity": "sha512-H406eLPXpZbAX14+B8psIuvIr8+3c+2hkuYzpMkoE0ij+NdsVATbA78vb8neA/eqrj7rywa2pIkdmWRsXW6wmw==", + "version": "5.46.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.46.0.tgz", + "integrity": "sha512-jTwoImyr/QbOWFFso3YoU3ik0jBBDJ6JTOQiy/J2YxVJdZCc+5u7skhNwiOR3FQIygFqVUPHl7qbbxtjW2K3Qg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.14.0", + "acorn": "^8.15.0", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, @@ -9328,9 +9347,9 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.14", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.14.tgz", - "integrity": "sha512-vkZjpUjb6OMS7dhV+tILUW6BhpDR7P2L/aQSAv+Uwk+m8KATX9EccViHTJR2qDtACKPIYndLGCyl3FMo+r2LMw==", + "version": "5.3.16", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.16.tgz", + "integrity": "sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==", "dev": true, "license": "MIT", "dependencies": { @@ -9363,9 +9382,9 @@ } }, "node_modules/terser/node_modules/acorn": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", - "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", "bin": { @@ -10090,9 +10109,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", - "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", "dev": true, "funding": [ { @@ -10410,9 +10429,9 @@ "license": "MIT" }, "node_modules/watchpack": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.4.tgz", - "integrity": "sha512-c5EGNOiyxxV5qmTtAB7rbiXxi1ooX1pQKMLX/MIabJjRA0SJBQOjKF+KSVfHkr9U1cADPon0mRiVe/riyaiDUA==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.5.1.tgz", + "integrity": "sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg==", "dev": true, "license": "MIT", "dependencies": { @@ -10424,36 +10443,37 @@ } }, "node_modules/webpack": { - "version": "5.99.9", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.99.9.tgz", - "integrity": "sha512-brOPwM3JnmOa+7kd3NsmOUOwbDAj8FT9xDsG3IW0MgbN9yZV7Oi/s/+MNQ/EcSMqw7qfoRyXPoeEWT8zLVdVGg==", + "version": "5.105.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.105.0.tgz", + "integrity": "sha512-gX/dMkRQc7QOMzgTe6KsYFM7DxeIONQSui1s0n/0xht36HvrgbxtM1xBlgx596NbpHuQU8P7QpKwrZYwUX48nw==", "dev": true, "license": "MIT", "dependencies": { "@types/eslint-scope": "^3.7.7", - "@types/estree": "^1.0.6", + "@types/estree": "^1.0.8", "@types/json-schema": "^7.0.15", "@webassemblyjs/ast": "^1.14.1", "@webassemblyjs/wasm-edit": "^1.14.1", "@webassemblyjs/wasm-parser": "^1.14.1", - "acorn": "^8.14.0", - "browserslist": "^4.24.0", + "acorn": "^8.15.0", + "acorn-import-phases": "^1.0.3", + "browserslist": "^4.28.1", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.17.1", - "es-module-lexer": "^1.2.1", + "enhanced-resolve": "^5.19.0", + "es-module-lexer": "^2.0.0", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", - "loader-runner": "^4.2.0", + "loader-runner": "^4.3.1", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^4.3.2", - "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.11", - "watchpack": "^2.4.1", - "webpack-sources": "^3.2.3" + "schema-utils": "^4.3.3", + "tapable": "^2.3.0", + "terser-webpack-plugin": "^5.3.16", + "watchpack": "^2.5.1", + "webpack-sources": "^3.3.3" }, "bin": { "webpack": "bin/webpack.js" @@ -10545,9 +10565,9 @@ } }, "node_modules/webpack-sources": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.3.2.tgz", - "integrity": "sha512-ykKKus8lqlgXX/1WjudpIEjqsafjOTcOJqxnAbMLAu/KCsDCJ6GBtvscewvTkrn24HsnvFwrSCbenFrhtcCsAA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.3.3.tgz", + "integrity": "sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==", "dev": true, "license": "MIT", "engines": { @@ -10555,9 +10575,9 @@ } }, "node_modules/webpack/node_modules/acorn": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", - "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", "bin": { @@ -10567,6 +10587,19 @@ "node": ">=0.4.0" } }, + "node_modules/webpack/node_modules/acorn-import-phases": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/acorn-import-phases/-/acorn-import-phases-1.0.4.tgz", + "integrity": "sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.13.0" + }, + "peerDependencies": { + "acorn": "^8.14.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", From 83cd32ba4929a0e02d51e21a62664c6c63f1e60d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 14 Feb 2026 10:07:37 +0000 Subject: [PATCH 10/26] build(deps-dev): bump qs from 6.14.0 to 6.14.2 Bumps [qs](https://github.com/ljharb/qs) from 6.14.0 to 6.14.2. - [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md) - [Commits](https://github.com/ljharb/qs/compare/v6.14.0...v6.14.2) --- updated-dependencies: - dependency-name: qs dependency-version: 6.14.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 629c0179..eb3402fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7824,9 +7824,9 @@ } }, "node_modules/qs": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", - "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "version": "6.14.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.2.tgz", + "integrity": "sha512-V/yCWTTF7VJ9hIh18Ugr2zhJMP01MY7c5kh4J870L7imm6/DIzBsNLTXzMwUA3yZ5b/KBqLx8Kp3uRvd7xSe3Q==", "dev": true, "license": "BSD-3-Clause", "dependencies": { From 6db7c96c9bed6d6176bd73b966f8df3d36b10346 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 17:09:28 +0000 Subject: [PATCH 11/26] build(deps-dev): bump tmp from 0.2.3 to 0.2.4 Bumps [tmp](https://github.com/raszi/node-tmp) from 0.2.3 to 0.2.4. - [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md) - [Commits](https://github.com/raszi/node-tmp/compare/v0.2.3...v0.2.4) --- updated-dependencies: - dependency-name: tmp dependency-version: 0.2.4 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index eb3402fc..56e28fd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9447,9 +9447,9 @@ } }, "node_modules/tmp": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", - "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.4.tgz", + "integrity": "sha512-UdiSoX6ypifLmrfQ/XfiawN6hkjSBpCjhKxxZcWlUUmoXLaCKQU0bx4HF/tdDK2uzRuchf1txGvrWBzYREssoQ==", "dev": true, "license": "MIT", "engines": { From c80252e70e5b22eb533d9c2f08b66b73a3d41fe9 Mon Sep 17 00:00:00 2001 From: Shiva Date: Sun, 25 Oct 2026 15:12:18 -0700 Subject: [PATCH 12/26] chore(deps): refresh dev dependencies and clear npm audit findings (#661) Bring the test and build tooling that the open Snyk PRs targeted up to date in one change against current main, and fix everything npm audit reports: 33 findings, 18 high, all in dev dependencies except ajv and uuid. - axios 1.x, superagent 10, mocha 12, @cucumber/cucumber 13, nyc 18 - TypeScript 5.9 with typedoc 0.28 and @types/node 22.20; uuid 11 ships type declarations that need TypeScript 5 - ajv ^8.18 and uuid ^11.1.1 at runtime; both are non-breaking, the SDK only calls uuid v4() - override fast-json-patch for ajv-cli, which has no fixed release - drop @types/uuid and @types/cucumber; both packages ship their own types - JSONParser.parse is typed as returning unknown, which is what it already returned; the class is not exported - the axios test helper serializes the object-valued extension header, since axios 1.x coerces every header value to a string - examples/typescript-ex: cloudevents ^10, gts 7 with an eslint flat config in place of tslint, TypeScript 5.9 Supersedes #612, #613, #617, #618, #619, #622, #629, #632, #633, #637, #638, #640, #642 and the dependency bumps in #645. Signed-off-by: Shiva --- .gitignore | 3 + examples/typescript-ex/.prettierrc.js | 3 + examples/typescript-ex/eslint.config.js | 16 + examples/typescript-ex/package.json | 8 +- examples/typescript-ex/src/index.ts | 56 +- examples/typescript-ex/tslint.json | 8 - package-lock.json | 2934 +++++++++++++--------- package.json | 29 +- src/parsers.ts | 6 +- test/integration/emitter_factory_test.ts | 16 +- 10 files changed, 1785 insertions(+), 1294 deletions(-) create mode 100644 examples/typescript-ex/.prettierrc.js create mode 100644 examples/typescript-ex/eslint.config.js delete mode 100644 examples/typescript-ex/tslint.json diff --git a/.gitignore b/.gitignore index d6d896dc..1a661d33 100644 --- a/.gitignore +++ b/.gitignore @@ -94,3 +94,6 @@ package-lock.json # Jetbrains IDE directories .idea + +# TypeScript incremental build info +*.tsbuildinfo diff --git a/examples/typescript-ex/.prettierrc.js b/examples/typescript-ex/.prettierrc.js new file mode 100644 index 00000000..c5166c2a --- /dev/null +++ b/examples/typescript-ex/.prettierrc.js @@ -0,0 +1,3 @@ +module.exports = { + ...require('gts/.prettierrc.json'), +}; diff --git a/examples/typescript-ex/eslint.config.js b/examples/typescript-ex/eslint.config.js new file mode 100644 index 00000000..ac21af90 --- /dev/null +++ b/examples/typescript-ex/eslint.config.js @@ -0,0 +1,16 @@ +module.exports = [ + { + ignores: ['build/'], + }, + ...require('gts'), + { + languageOptions: { + globals: { + console: 'readonly', + module: 'writable', + exports: 'writable', + require: 'readonly', + }, + }, + }, +]; diff --git a/examples/typescript-ex/package.json b/examples/typescript-ex/package.json index 7a62f8df..de15a101 100644 --- a/examples/typescript-ex/package.json +++ b/examples/typescript-ex/package.json @@ -23,11 +23,11 @@ "posttest": "npm run check" }, "devDependencies": { - "@types/node": "^14.14.10", - "gts": "^3.0.3", - "typescript": "~4.1.3" + "@types/node": "^22.0.0", + "gts": "^7.0.0", + "typescript": "~5.9.0" }, "dependencies": { - "cloudevents": "~4.0.0" + "cloudevents": "^10.0.0" } } diff --git a/examples/typescript-ex/src/index.ts b/examples/typescript-ex/src/index.ts index a6daa694..5065e4d3 100644 --- a/examples/typescript-ex/src/index.ts +++ b/examples/typescript-ex/src/index.ts @@ -1,46 +1,54 @@ -/* eslint-disable no-console */ -import { CloudEvent, HTTP } from "cloudevents"; +import {CloudEvent, HTTP} from 'cloudevents'; export function doSomeStuff(): void { - const myevent: CloudEvent = new CloudEvent({ - source: "/source", - type: "type", - datacontenttype: "text/plain", - dataschema: "https://d.schema.com/my.json", - subject: "cha.json", - data: "my-data", - extension1: "some extension data", + const myevent = new CloudEvent({ + source: '/source', + type: 'type', + datacontenttype: 'text/plain', + dataschema: 'https://d.schema.com/my.json', + subject: 'cha.json', + data: 'my-data', + extension1: 'some extension data', }); - console.log("My structured event:", myevent); + console.log('My structured event:', myevent); // ------ receiver structured // The header names should be standarized to use lowercase const headers = { - "content-type": "application/cloudevents+json", + 'content-type': 'application/cloudevents+json', }; // Typically used with an incoming HTTP request where myevent.format() is the actual // body of the HTTP - console.log("Received structured event:", HTTP.toEvent({ headers, body: myevent })); + console.log( + 'Received structured event:', + HTTP.toEvent({headers, body: myevent}), + ); // ------ receiver binary const data = { - data: "dataString", + data: 'dataString', }; const attributes = { - "ce-type": "type", - "ce-specversion": "1.0", - "ce-source": "source", - "ce-id": "id", - "ce-time": "2019-06-16T11:42:00Z", - "ce-dataschema": "http://schema.registry/v1", - "Content-Type": "application/json", - "ce-extension1": "extension1", + 'ce-type': 'type', + 'ce-specversion': '1.0', + 'ce-source': 'source', + 'ce-id': 'id', + 'ce-time': '2019-06-16T11:42:00Z', + 'ce-dataschema': 'http://schema.registry/v1', + 'Content-Type': 'application/json', + 'ce-extension1': 'extension1', }; - console.log("My binary event:", HTTP.toEvent({ headers: attributes, body: data })); - console.log("My binary event extensions:", HTTP.toEvent({ headers: attributes, body: data })); + console.log( + 'My binary event:', + HTTP.toEvent({headers: attributes, body: data}), + ); + console.log( + 'My binary event extensions:', + HTTP.toEvent({headers: attributes, body: data}), + ); } doSomeStuff(); diff --git a/examples/typescript-ex/tslint.json b/examples/typescript-ex/tslint.json deleted file mode 100644 index 27872a13..00000000 --- a/examples/typescript-ex/tslint.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "gts/tslint.json", - "linterOptions": { - "exclude": [ - "**/*.json" - ] - } -} diff --git a/package-lock.json b/package-lock.json index 56e28fd0..673f8a81 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,27 +9,25 @@ "version": "10.0.0", "license": "Apache-2.0", "dependencies": { - "ajv": "^8.11.0", + "ajv": "^8.18.0", "ajv-formats": "^2.1.1", "json-bigint": "^1.0.0", "process": "^0.11.10", "util": "^0.12.4", - "uuid": "^8.3.2" + "uuid": "^11.1.1" }, "devDependencies": { - "@cucumber/cucumber": "^8.0.0", + "@cucumber/cucumber": "^13.3.0", "@types/chai": "^4.2.11", - "@types/cucumber": "^6.0.1", "@types/got": "^9.6.11", "@types/json-bigint": "^1.0.1", - "@types/mocha": "^7.0.2", - "@types/node": "~22.0.0", - "@types/superagent": "^4.1.10", - "@types/uuid": "^8.3.4", + "@types/mocha": "^10.0.10", + "@types/node": "^22.20.5", + "@types/superagent": "^8.1.11", "@typescript-eslint/eslint-plugin": "^4.29.0", "@typescript-eslint/parser": "^4.29.0", "ajv-cli": "^5.0.0", - "axios": "^0.26.1", + "axios": "^1.20.0", "chai": "~4.2.0", "eslint": "^7.32.0", "eslint-config-standard": "^16.0.3", @@ -39,18 +37,18 @@ "eslint-plugin-promise": "^5.1.0", "got": "^11.8.5", "http-parser-js": "^0.5.2", - "mocha": "^10.1.0", + "mocha": "^12.0.3", "nock": "~12.0.3", - "nyc": "~15.0.0", + "nyc": "^18.0.0", "prettier": "^2.0.5", "remark-cli": "^10.0.0", "remark-lint": "^8.0.0", "remark-lint-list-item-indent": "^2.0.1", "remark-preset-lint-recommended": "^5.0.0", - "superagent": "^7.1.1", + "superagent": "^10.4.1", "ts-node": "^10.8.1", - "typedoc": "^0.23.28", - "typescript": "^4.9.5", + "typedoc": "^0.28.20", + "typescript": "^5.9.3", "webpack": "^5.76.0", "webpack-cli": "^4.10.0" }, @@ -58,20 +56,6 @@ "node": ">=22 <=24" } }, - "node_modules/@ampproject/remapping": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", - "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@babel/code-frame": { "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", @@ -83,9 +67,9 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.27.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.27.5.tgz", - "integrity": "sha512-KiRAp/VoJaWkkte84TvUd9qjdbZAdiqyvMxrGl1N6vzFogKmaLgoM3L1kgtLicp2HP5fBJS8JrZKLVIZGVJAVg==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", "dev": true, "license": "MIT", "engines": { @@ -93,22 +77,22 @@ } }, "node_modules/@babel/core": { - "version": "7.27.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.27.4.tgz", - "integrity": "sha512-bXYxrXFubeYdvB0NhD/NBB3Qi6aZeV20GOWVI47t2dkecCEoneR4NPVcb7abpXDEvejgrUfFtG6vG/zxAKmg+g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.27.1", - "@babel/generator": "^7.27.3", - "@babel/helper-compilation-targets": "^7.27.2", - "@babel/helper-module-transforms": "^7.27.3", - "@babel/helpers": "^7.27.4", - "@babel/parser": "^7.27.4", - "@babel/template": "^7.27.2", - "@babel/traverse": "^7.27.4", - "@babel/types": "^7.27.3", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -124,13 +108,13 @@ } }, "node_modules/@babel/core/node_modules/@babel/code-frame": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", - "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.27.1", + "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" }, @@ -156,16 +140,16 @@ } }, "node_modules/@babel/generator": { - "version": "7.27.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.5.tgz", - "integrity": "sha512-ZGhA37l0e/g2s1Cnzdix0O3aLYm66eF8aufiVteOgnwxgnRP8GoyMj7VWsgWnQbVKXyge7hqrFh2K2TQM6t1Hw==", + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.8.tgz", + "integrity": "sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^7.27.5", - "@babel/types": "^7.27.3", - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25", + "@babel/parser": "^7.29.8", + "@babel/types": "^7.29.8", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" }, "engines": { @@ -173,14 +157,14 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.27.2", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz", - "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", "dev": true, "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.27.2", - "@babel/helper-validator-option": "^7.27.1", + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" @@ -199,30 +183,40 @@ "semver": "bin/semver.js" } }, + "node_modules/@babel/helper-globals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-module-imports": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", - "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", "dev": true, "license": "MIT", "dependencies": { - "@babel/traverse": "^7.27.1", - "@babel/types": "^7.27.1" + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.27.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.27.3.tgz", - "integrity": "sha512-dSOvYwvyLsWBeIRyOeHXp5vPj5l1I011r52FM1+r1jCERv+aFXYk4whgQccYEGYxK2H3ZAIA8nuPkQ0HaUo3qg==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.27.1", - "@babel/helper-validator-identifier": "^7.27.1", - "@babel/traverse": "^7.27.3" + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -232,9 +226,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", - "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "version": "7.29.11", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.11.tgz", + "integrity": "sha512-snZbO7MEDOof+hvNa97EjEY7qD7h2kwvQr5AJC3ZhQudKW5dnej6k3kP9NQV88hJwaS8vDqRLFo9rivLEhle2g==", "dev": true, "license": "MIT", "engines": { @@ -242,9 +236,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", - "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", "dev": true, "license": "MIT", "engines": { @@ -252,9 +246,9 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", - "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", "dev": true, "license": "MIT", "engines": { @@ -262,14 +256,14 @@ } }, "node_modules/@babel/helpers": { - "version": "7.27.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.6.tgz", - "integrity": "sha512-muE8Tt8M22638HU31A3CgfSUciwz1fhATfoVai05aPXGor//CdWDCbnlY1yvBPo07njuVOCNGCSp/GTt12lIug==", + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.10.tgz", + "integrity": "sha512-EMCx3AGZ3WfAl6ht7AyQoPm2Lh+BGYEMdc4Q6Hf7uSCDOZFuLq44qNwL+iaim8VlyYhRAo4X43+weadK8ZB4Yg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/template": "^7.27.2", - "@babel/types": "^7.27.6" + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.8" }, "engines": { "node": ">=6.9.0" @@ -370,13 +364,13 @@ } }, "node_modules/@babel/parser": { - "version": "7.27.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.5.tgz", - "integrity": "sha512-OsQd175SxWkGlzbny8J3K8TnnDD0N3lrIUtB92xwyRpzaenGZhxDvxN/JgU00U3CDZNj9tPuDJ5H0WS4Nt3vKg==", + "version": "7.29.11", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.11.tgz", + "integrity": "sha512-OZ6+oaK7GMyg3IfCpj8JOmn8n+w2rJbDT0LLfVDTLb1ZFeKDh3AiNELgCMUw175IJHSkLl74hG0M0VLsvx+gag==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.27.3" + "@babel/types": "^7.29.11" }, "bin": { "parser": "bin/babel-parser.js" @@ -385,39 +379,29 @@ "node": ">=6.0.0" } }, - "node_modules/@babel/runtime": { - "version": "7.27.6", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.6.tgz", - "integrity": "sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/template": { - "version": "7.27.2", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", - "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.27.1", - "@babel/parser": "^7.27.2", - "@babel/types": "^7.27.1" + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/template/node_modules/@babel/code-frame": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", - "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.27.1", + "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" }, @@ -426,32 +410,32 @@ } }, "node_modules/@babel/traverse": { - "version": "7.27.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.4.tgz", - "integrity": "sha512-oNcu2QbHqts9BtOWJosOVJapWjBDSxGCpFvikNR5TGDYDQf3JwpIoMzIKrvfoti93cLfPJEG4tH9SPVeyCGgdA==", + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.10.tgz", + "integrity": "sha512-B3lYAs2nkKskbgQ1nfy8Ma9ao9Q1rntTAQHrzzyDuj+TSO+X3le6PfWwqDvodsb+OumE10eMFfuMCTQSQ5iuIQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.27.1", - "@babel/generator": "^7.27.3", - "@babel/parser": "^7.27.4", - "@babel/template": "^7.27.2", - "@babel/types": "^7.27.3", - "debug": "^4.3.1", - "globals": "^11.1.0" + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.8", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.9", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.8", + "debug": "^4.3.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse/node_modules/@babel/code-frame": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", - "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.27.1", + "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" }, @@ -459,25 +443,15 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/traverse/node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/types": { - "version": "7.27.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.6.tgz", - "integrity": "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q==", + "version": "7.29.11", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.11.tgz", + "integrity": "sha512-WCsemW40Cpc6gouC1SrY6PBaZ+oLRlEVY9XBvZBI7il/HyUrb2nJ505wE1MHEFyDZNnrWDEuy4jL50WVHfTTSQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.27.1", - "@babel/helper-validator-identifier": "^7.27.1" + "@babel/helper-string-parser": "^7.29.11", + "@babel/helper-validator-identifier": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -519,94 +493,119 @@ } }, "node_modules/@cucumber/ci-environment": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/@cucumber/ci-environment/-/ci-environment-9.1.0.tgz", - "integrity": "sha512-jdnF6APXP3GawMue8kdMxhu6TBhyRUO4KDRxTowf06NtclLjIw2Ybpo9IcIOMvE8kHukvJyM00uxWX+CfS7JgQ==", + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/@cucumber/ci-environment/-/ci-environment-15.0.0.tgz", + "integrity": "sha512-9zIy0YIn7Tkws4pNJElf/kOnPy/6yxWZPWH6eMNW8s/BsV3d10+Xs1yjp2HwEMPElnrFEVHQlUs4XGQ1M3q2Nw==", "dev": true, "license": "MIT" }, "node_modules/@cucumber/cucumber": { - "version": "8.11.1", - "resolved": "https://registry.npmjs.org/@cucumber/cucumber/-/cucumber-8.11.1.tgz", - "integrity": "sha512-C+wdypoSzHA48GCRorJCAZYuxXo1RSESukAmoz/JhGV7KB4pIlg9Y2aWeZKx6bJQkq8yq4+S4jg9f8FGCdc3jQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@cucumber/ci-environment": "9.1.0", - "@cucumber/cucumber-expressions": "16.1.1", - "@cucumber/gherkin": "26.0.3", - "@cucumber/gherkin-streams": "5.0.1", - "@cucumber/gherkin-utils": "8.0.2", - "@cucumber/html-formatter": "20.2.1", - "@cucumber/message-streams": "4.0.1", - "@cucumber/messages": "21.0.1", - "@cucumber/tag-expressions": "5.0.1", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/@cucumber/cucumber/-/cucumber-13.3.0.tgz", + "integrity": "sha512-6OSoj/SQogJwEjoNrPZ5gtyTDwbmtCDuzJ/hc81nOVhwEBAO6ypgdWd+qCScOdyZxgtQvUWG534LBWb5h9/Y8Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cucumber/ci-environment": "15.0.0", + "@cucumber/cucumber-expressions": "20.1.0", + "@cucumber/gherkin": "42.0.1", + "@cucumber/gherkin-streams": "7.0.1", + "@cucumber/gherkin-utils": "12.0.2", + "@cucumber/html-formatter": "24.2.0", + "@cucumber/junit-xml-formatter": "0.15.0", + "@cucumber/message-streams": "5.0.1", + "@cucumber/messages": "34.2.1", + "@cucumber/pretty-formatter": "4.1.0", + "@cucumber/tag-expressions": "11.0.1", "assertion-error-formatter": "^3.0.0", - "capital-case": "^1.0.4", - "chalk": "^4.1.2", - "cli-table3": "0.6.3", - "commander": "^9.0.0", + "cli-table3": "0.6.5", + "commander": "^15.0.0", "debug": "^4.3.4", "error-stack-parser": "^2.1.4", - "figures": "^3.2.0", - "glob": "^7.1.6", - "has-ansi": "^4.0.1", - "indent-string": "^4.0.0", - "is-installed-globally": "^0.4.0", - "is-stream": "^2.0.0", + "figures": "^6.0.0", + "has-ansi": "^6.0.0", + "indent-string": "^5.0.0", + "is-installed-globally": "^1.0.0", "knuth-shuffle-seeded": "^1.0.6", "lodash.merge": "^4.6.2", "lodash.mergewith": "^4.6.2", - "luxon": "3.2.1", - "mz": "^2.7.0", - "progress": "^2.0.3", - "resolve-pkg": "^2.0.0", - "semver": "7.3.8", - "string-argv": "^0.3.1", - "strip-ansi": "6.0.1", - "supports-color": "^8.1.1", - "tmp": "^0.2.1", + "luxon": "3.7.2", + "read-package-up": "^12.0.0", + "semver": "7.8.5", + "string-argv": "0.3.2", + "supports-color": "^11.0.0", + "type-fest": "^5.0.0", "util-arity": "^1.1.0", - "verror": "^1.10.0", - "xmlbuilder": "^15.1.1", - "yaml": "1.10.2", - "yup": "^0.32.11" + "yaml": "^2.2.2", + "yup": "1.7.1" }, "bin": { "cucumber-js": "bin/cucumber.js" }, "engines": { - "node": "12 || 14 || >=16" + "node": "22 || 24 || >=26" + }, + "funding": { + "url": "https://opencollective.com/cucumber" } }, "node_modules/@cucumber/cucumber-expressions": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/@cucumber/cucumber-expressions/-/cucumber-expressions-16.1.1.tgz", - "integrity": "sha512-Ugsb9qxfgrgfUKsGvbx0awVk+69NIFjWfxNT+dnm62YrF2gdTHYxAOzOLuPgvE0yqYTh+3otrFLDDfkHGThM1g==", + "version": "20.1.0", + "resolved": "https://registry.npmjs.org/@cucumber/cucumber-expressions/-/cucumber-expressions-20.1.0.tgz", + "integrity": "sha512-KXQJChHTyHdg6HI7fHy3zpjfoS205vV1B/aJQKB82VFgMGbdVdiaSy7sTtap/5Q787anLmZt25Tg0FqQ2n4fqw==", "dev": true, "license": "MIT", "dependencies": { "regexp-match-indices": "1.0.2" } }, + "node_modules/@cucumber/cucumber/node_modules/supports-color": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-11.0.0.tgz", + "integrity": "sha512-/zyImLdxhdygBIaVX0xTlQhKaCDLCrm665aqHk8xqK/Pa6k61fL6gwQGQq1k31yNyz6x55PppQgF2DMyPQa5xw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=22" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/@cucumber/cucumber/node_modules/type-fest": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.10.0.tgz", + "integrity": "sha512-NoSdpq/WEiAg5sjmBkmV/hfxv6HJH4NqPNrqjtSO5CwRmpsDfaf4begxW34KdJykH/l1yHtwBWQkCRdoXO8mPA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "dependencies": { + "tagged-tag": "^1.0.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@cucumber/gherkin": { - "version": "26.0.3", - "resolved": "https://registry.npmjs.org/@cucumber/gherkin/-/gherkin-26.0.3.tgz", - "integrity": "sha512-xwJHi//bLFEU1drIyw2yswwUHnnVWO4XcyVBbCTDs6DkSh262GkogFI/IWwChZqJfOXnPglzLGxR1DibcZsILA==", + "version": "42.0.1", + "resolved": "https://registry.npmjs.org/@cucumber/gherkin/-/gherkin-42.0.1.tgz", + "integrity": "sha512-Kqg0ULhWqbXp/a1c04ND4sS4KTlIL831tQ0NhZLXWdEhT6LiNsZ5LFRzy/lBy7QQpcKhroKp/i3C2WdEnRBKNg==", "dev": true, "license": "MIT", "dependencies": { - "@cucumber/messages": "19.1.4 - 21" + "@cucumber/messages": ">=34.0.0 <35" } }, "node_modules/@cucumber/gherkin-streams": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@cucumber/gherkin-streams/-/gherkin-streams-5.0.1.tgz", - "integrity": "sha512-/7VkIE/ASxIP/jd4Crlp4JHXqdNFxPGQokqWqsaCCiqBiu5qHoKMxcWNlp9njVL/n9yN4S08OmY3ZR8uC5x74Q==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@cucumber/gherkin-streams/-/gherkin-streams-7.0.1.tgz", + "integrity": "sha512-8W1lmof0hbQ1HgOEpPCkz1KCFaM6MfA7n7rr6vX/7ffgUQ0saOAwapKSVj7P68Aht0K9XqHaw8BDLtqaK/jRIg==", "dev": true, "license": "MIT", "dependencies": { - "commander": "9.1.0", + "commander": "15.0.0", "source-map-support": "0.5.21" }, "bin": { @@ -618,123 +617,117 @@ "@cucumber/messages": ">=17.1.1" } }, - "node_modules/@cucumber/gherkin-streams/node_modules/commander": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.1.0.tgz", - "integrity": "sha512-i0/MaqBtdbnJ4XQs4Pmyb+oFQl+q0lsAmokVUH92SlSw4fkeAcG3bVon+Qt7hmtF+u3Het6o4VgrcY3qAoEB6w==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || >=14" - } - }, "node_modules/@cucumber/gherkin-utils": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@cucumber/gherkin-utils/-/gherkin-utils-8.0.2.tgz", - "integrity": "sha512-aQlziN3r3cTwprEDbLEcFoMRQajb9DTOu2OZZp5xkuNz6bjSTowSY90lHUD2pWT7jhEEckZRIREnk7MAwC2d1A==", + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/@cucumber/gherkin-utils/-/gherkin-utils-12.0.2.tgz", + "integrity": "sha512-e678WQqU3zJnZ3GW4D7O4/mrD3vku0iUYJPz7cuLNw3jcK81dvbt5iYa5l3tfT9z2rxE5ObFPUbTkDN7zFwqjw==", "dev": true, "license": "MIT", "dependencies": { - "@cucumber/gherkin": "^25.0.0", - "@cucumber/messages": "^19.1.4", - "@teppeis/multimaps": "2.0.0", - "commander": "9.4.1", + "@cucumber/gherkin": "^42.0.0", + "@cucumber/messages": "^34.0.0", + "@teppeis/multimaps": "3.0.0", + "commander": "15.0.0", "source-map-support": "^0.5.21" }, "bin": { "gherkin-utils": "bin/gherkin-utils" } }, - "node_modules/@cucumber/gherkin-utils/node_modules/@cucumber/gherkin": { - "version": "25.0.2", - "resolved": "https://registry.npmjs.org/@cucumber/gherkin/-/gherkin-25.0.2.tgz", - "integrity": "sha512-EdsrR33Y5GjuOoe2Kq5Y9DYwgNRtUD32H4y2hCrT6+AWo7ibUQu7H+oiWTgfVhwbkHsZmksxHSxXz/AwqqyCRQ==", + "node_modules/@cucumber/html-formatter": { + "version": "24.2.0", + "resolved": "https://registry.npmjs.org/@cucumber/html-formatter/-/html-formatter-24.2.0.tgz", + "integrity": "sha512-6Y5ijKyFeNiaMdcYna/fo1Bluzebm8L+vSAyuymIt7Dxu5Fq1sDYMGqR1rYeuNdJmXyu/YRtGLOsrZdCJCQGIg==", "dev": true, "license": "MIT", - "dependencies": { - "@cucumber/messages": "^19.1.4" + "peerDependencies": { + "@cucumber/messages": ">=18" } }, - "node_modules/@cucumber/gherkin-utils/node_modules/@cucumber/messages": { - "version": "19.1.4", - "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-19.1.4.tgz", - "integrity": "sha512-Pksl0pnDz2l1+L5Ug85NlG6LWrrklN9qkMxN5Mv+1XZ3T6u580dnE6mVaxjJRdcOq4tR17Pc0RqIDZMyVY1FlA==", + "node_modules/@cucumber/junit-xml-formatter": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@cucumber/junit-xml-formatter/-/junit-xml-formatter-0.15.0.tgz", + "integrity": "sha512-371k/g1p+UVkxCtRmqPFiVNosV7noV93qH6BbUtN9lXrF22QEbb+YoV0gphhWol0fggVHzfObuk4qJ3YQvDsrg==", "dev": true, "license": "MIT", "dependencies": { - "@types/uuid": "8.3.4", - "class-transformer": "0.5.1", - "reflect-metadata": "0.1.13", - "uuid": "9.0.0" + "@cucumber/query": "^16.0.0", + "@teppeis/multimaps": "^3.0.0", + "luxon": "^3.5.0", + "xmlbuilder": "^15.1.1" + }, + "peerDependencies": { + "@cucumber/messages": "*" } }, - "node_modules/@cucumber/gherkin-utils/node_modules/commander": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.4.1.tgz", - "integrity": "sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==", + "node_modules/@cucumber/message-streams": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@cucumber/message-streams/-/message-streams-5.0.1.tgz", + "integrity": "sha512-MXsD7ZAWWAiWMrn3Lzq2nwu9DJpPbbvdqXj2ot1BSM2gXnoSvg8d0pc6PzS9pI02swMSn/KN11mTdF5ScE7X0Q==", "dev": true, "license": "MIT", - "engines": { - "node": "^12.20.0 || >=14" + "dependencies": { + "mime": "^4.0.0" + }, + "peerDependencies": { + "@cucumber/messages": ">=17.1.1" } }, - "node_modules/@cucumber/gherkin-utils/node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "node_modules/@cucumber/message-streams/node_modules/mime": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-4.1.1.tgz", + "integrity": "sha512-YAApRsTpM2+gnUFHhRNGfkX8NK0V5xj1nyQLufGlwEI+eX4xRsTcel2IXDuMEGSGjBvzykNW4VuoEACgwYe7BQ==", "dev": true, + "funding": [ + "https://github.com/sponsors/broofa" + ], "license": "MIT", "bin": { - "uuid": "dist/bin/uuid" + "mime": "bin/cli.js" + }, + "engines": { + "node": ">=16" } }, - "node_modules/@cucumber/html-formatter": { - "version": "20.2.1", - "resolved": "https://registry.npmjs.org/@cucumber/html-formatter/-/html-formatter-20.2.1.tgz", - "integrity": "sha512-bwwyr1WjlOJ5dEFOLGbtYWbUprloB2eymqXBmmTC10s0xapZXkFn4VfHgMshaH91XiCIY/MoabWNAau3AeMHkQ==", + "node_modules/@cucumber/messages": { + "version": "34.2.1", + "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-34.2.1.tgz", + "integrity": "sha512-aj2iCAG9ZOpMVcMxcgShifv5fbR96b7SMgdWcPXXh2QbFp7OEcAnQ5MC5YfWUDSDasmw7FU5NJEsOrXdTQOU1A==", "dev": true, - "license": "MIT", - "peerDependencies": { - "@cucumber/messages": ">=18" - } + "license": "MIT" }, - "node_modules/@cucumber/message-streams": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@cucumber/message-streams/-/message-streams-4.0.1.tgz", - "integrity": "sha512-Kxap9uP5jD8tHUZVjTWgzxemi/0uOsbGjd4LBOSxcJoOCRbESFwemUzilJuzNTB8pcTQUh8D5oudUyxfkJOKmA==", + "node_modules/@cucumber/pretty-formatter": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@cucumber/pretty-formatter/-/pretty-formatter-4.1.0.tgz", + "integrity": "sha512-cbdb494+X3nHxvP34sbyia7CeVIkqs0K3+LWpsF8szCSUVYOxhmbP66H/Yd7f6yr2BhKLmkDokyEX24VAyOstA==", "dev": true, "license": "MIT", + "dependencies": { + "@cucumber/query": "16.1.1", + "luxon": "^3.7.2" + }, "peerDependencies": { - "@cucumber/messages": ">=17.1.1" + "@cucumber/messages": "*" } }, - "node_modules/@cucumber/messages": { - "version": "21.0.1", - "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-21.0.1.tgz", - "integrity": "sha512-pGR7iURM4SF9Qp1IIpNiVQ77J9kfxMkPOEbyy+zRmGABnWWCsqMpJdfHeh9Mb3VskemVw85++e15JT0PYdcR3g==", + "node_modules/@cucumber/query": { + "version": "16.1.1", + "resolved": "https://registry.npmjs.org/@cucumber/query/-/query-16.1.1.tgz", + "integrity": "sha512-SBaP4Lc7xv55jY78Q8raoxvbBIPGhQKrui/Tq+l6jYBl1alV0TG1sW8TRtk9W7RQl27nVJo9DyyvASp374L9Tg==", "dev": true, "license": "MIT", "dependencies": { - "@types/uuid": "8.3.4", - "class-transformer": "0.5.1", - "reflect-metadata": "0.1.13", - "uuid": "9.0.0" - } - }, - "node_modules/@cucumber/messages/node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", - "dev": true, - "license": "MIT", - "bin": { - "uuid": "dist/bin/uuid" + "@teppeis/multimaps": "3.0.0", + "lodash.sortby": "^4.7.0" + }, + "peerDependencies": { + "@cucumber/messages": "*" } }, "node_modules/@cucumber/tag-expressions": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@cucumber/tag-expressions/-/tag-expressions-5.0.1.tgz", - "integrity": "sha512-N43uWud8ZXuVjza423T9ZCIJsaZhFekmakt7S9bvogTxqdVGbRobjR663s0+uW0Rz9e+Pa8I6jUuWtoBLQD2Mw==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@cucumber/tag-expressions/-/tag-expressions-11.0.1.tgz", + "integrity": "sha512-x0AssM2HKLoxw8gSeAsYo0QK9wImODYBNDO423/K1Pfk2vwA/MdecRS1ky5i3Rl84kohaG0uUXhIBR+HTu/Qjg==", "dev": true, "license": "MIT" }, @@ -770,9 +763,9 @@ } }, "node_modules/@eslint/eslintrc/node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", "dev": true, "license": "MIT", "dependencies": { @@ -803,6 +796,20 @@ "dev": true, "license": "MIT" }, + "node_modules/@gerrit0/mini-shiki": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-3.23.0.tgz", + "integrity": "sha512-bEMORlG0cqdjVyCEuU0cDQbORWX+kYCeo0kV1lbxF5bt4r7SID2l9bqsxJEM0zndaxpOUT7riCyIVEuqq/Ynxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/engine-oniguruma": "^3.23.0", + "@shikijs/langs": "^3.23.0", + "@shikijs/themes": "^3.23.0", + "@shikijs/types": "^3.23.0", + "@shikijs/vscode-textmate": "^10.0.2" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", @@ -911,9 +918,9 @@ } }, "node_modules/@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.6.tgz", + "integrity": "sha512-+Sg6GCR/wy1oSmQDFq4LQDAhm3ETKnorxN+y5nbLULOR3P0c14f2Wurzj3/xqPXtasLFfHd5iRFQ7AJt4KH2cw==", "dev": true, "license": "MIT", "engines": { @@ -921,34 +928,31 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", - "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", "dev": true, "license": "MIT", "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", "dev": true, "license": "MIT", - "engines": { - "node": ">=6.0.0" + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" } }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, "license": "MIT", "engines": { @@ -974,9 +978,9 @@ "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", "dev": true, "license": "MIT", "dependencies": { @@ -1036,9 +1040,9 @@ } }, "node_modules/@paralleldrive/cuid2": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.2.2.tgz", - "integrity": "sha512-ZOBkgDwEdoYVlSeRbYYXs0S9MejQofiVYoTbKzy/6GQa39/q5tQU2IX46+shYnUkpEl3wc+J6wRlar7r2EK2xA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.3.1.tgz", + "integrity": "sha512-XO7cAxhnTZl0Yggq6jOgjiOHhbgcO4NqFqwSmQpjK3b6TEE6Uj/jfSk6wzYyemh3+I0sHirKSetjQwn5cZktFw==", "dev": true, "license": "MIT", "dependencies": { @@ -1052,6 +1056,55 @@ "dev": true, "license": "MIT" }, + "node_modules/@shikijs/engine-oniguruma": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.23.0.tgz", + "integrity": "sha512-1nWINwKXxKKLqPibT5f4pAFLej9oZzQTsby8942OTlsJzOBZ0MWKiwzMsd+jhzu8YPCHAswGnnN1YtQfirL35g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.23.0", + "@shikijs/vscode-textmate": "^10.0.2" + } + }, + "node_modules/@shikijs/langs": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-3.23.0.tgz", + "integrity": "sha512-2Ep4W3Re5aB1/62RSYQInK9mM3HsLeB91cHqznAJMuylqjzNVAVCMnNWRHFtcNHXsoNRayP9z1qj4Sq3nMqYXg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.23.0" + } + }, + "node_modules/@shikijs/themes": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.23.0.tgz", + "integrity": "sha512-5qySYa1ZgAT18HR/ypENL9cUSGOeI2x+4IvYJu4JgVJdizn6kG4ia5Q1jDEOi7gTbN4RbuYtmHh0W3eccOrjMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.23.0" + } + }, + "node_modules/@shikijs/types": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.23.0.tgz", + "integrity": "sha512-3JZ5HXOZfYjsYSk0yPwBrkupyYSLpAE26Qc0HLghhZNGTZg/SKxXIIgoxOpmmeQP0RRSDJTk1/vPfw9tbw+jSQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4" + } + }, + "node_modules/@shikijs/vscode-textmate": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.1.0.tgz", + "integrity": "sha512-cVBuhDQjBZaNMTwBquYfPydrUP+E3hE6oYGasx8h6ZrODIM7/r+gxLDXdd66oszbrggZHEntdE6j+5gYIVyMWQ==", + "dev": true, + "license": "MIT" + }, "node_modules/@sindresorhus/is": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", @@ -1079,13 +1132,13 @@ } }, "node_modules/@teppeis/multimaps": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@teppeis/multimaps/-/multimaps-2.0.0.tgz", - "integrity": "sha512-TL1adzq1HdxUf9WYduLcQ/DNGYiz71U31QRgbnr0Ef1cPyOUOsBojxHVWpFeOSUucB6Lrs0LxFRA14ntgtkc9w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@teppeis/multimaps/-/multimaps-3.0.0.tgz", + "integrity": "sha512-ID7fosbc50TbT0MK0EG12O+gAP3W3Aa/Pz4DaTtQtEvlc9Odaqi0de+xuZ7Li2GtK4HzEX7IuRWS/JmZLksR3Q==", "dev": true, "license": "MIT", "engines": { - "node": ">=10.17" + "node": ">=14" } }, "node_modules/@tsconfig/node10": { @@ -1153,13 +1206,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/cucumber": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@types/cucumber/-/cucumber-6.0.1.tgz", - "integrity": "sha512-+GZV6xfN0MeN9shDCdny8GbC8N0+U6uca8cjyaJndcwmrUhwS6qOU2vmYn0d71EOwJF568/v3SxJ8VKxuZNYRw==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/debug": { "version": "4.1.12", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", @@ -1211,6 +1257,16 @@ "form-data": "^2.5.0" } }, + "node_modules/@types/hast": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.5.tgz", + "integrity": "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, "node_modules/@types/http-cache-semantics": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", @@ -1263,13 +1319,6 @@ "@types/node": "*" } }, - "node_modules/@types/lodash": { - "version": "4.17.17", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.17.tgz", - "integrity": "sha512-RRVJ+J3J+WmyOTqnz3PiBLA501eKwXl2noseKOrNo/6+XEHjTAxO4xHvxQB6QuNm+s4WRbn6rSiap8+EA+ykFQ==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/mdast": { "version": "3.0.15", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", @@ -1280,10 +1329,17 @@ "@types/unist": "^2" } }, + "node_modules/@types/methods": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@types/methods/-/methods-1.1.4.tgz", + "integrity": "sha512-ymXWVrDiCxTBE3+RIrrP533E70eA+9qu7zdWoHuOmGujkYtzf4HQF96b8nwHLqhuf4ykX61IGRIB38CC6/sImQ==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/mocha": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-7.0.2.tgz", - "integrity": "sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w==", + "version": "10.0.10", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", + "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", "dev": true, "license": "MIT" }, @@ -1295,15 +1351,22 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.0.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.0.3.tgz", - "integrity": "sha512-/e0NZtK2gs6Vk2DoyrXSZZ4AlamqTkx0CcKx1Aq8/P4ITlRgU9OtVf5fl+LXkWWJce1M89pkSlH6lJJEnK7bQA==", + "version": "22.20.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.5.tgz", + "integrity": "sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~6.11.1" + "undici-types": "~6.21.0" } }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/responselike": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", @@ -1315,14 +1378,33 @@ } }, "node_modules/@types/superagent": { - "version": "4.1.24", - "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.24.tgz", - "integrity": "sha512-mEafCgyKiMFin24SDzWN7yAADt4gt6YawFiNMp0QS5ZPboORfyxFt0s3VzJKhTaKg9py/4FUmrHLTNfJKt9Rbw==", + "version": "8.1.11", + "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-8.1.11.tgz", + "integrity": "sha512-KA7srSW/HENDtOw9DOqaFLgWuMqN9WgjEw62lh9dpvRaZDkhdOkazASd7X7i2eMUYLHa1U37ZttnePsH5zTDHw==", "dev": true, "license": "MIT", "dependencies": { - "@types/cookiejar": "*", - "@types/node": "*" + "@types/cookiejar": "^2.1.5", + "@types/methods": "^1.1.4", + "@types/node": "*", + "form-data": "^4.0.0" + } + }, + "node_modules/@types/superagent/node_modules/form-data": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", + "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.4", + "mime-types": "^2.1.35" + }, + "engines": { + "node": ">= 6" } }, "node_modules/@types/supports-color": { @@ -1353,13 +1435,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/uuid": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", - "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==", - "dev": true, - "license": "MIT" - }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "4.33.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz", @@ -1787,6 +1862,19 @@ "node": ">=0.4.0" } }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/aggregate-error": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", @@ -1801,10 +1889,20 @@ "node": ">=8" } }, + "node_modules/aggregate-error/node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", @@ -1885,22 +1983,18 @@ } }, "node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.4.0.tgz", + "integrity": "sha512-KzTVk2tCWAHtYrvvvaP8bJKJq2pVinhLcGEQdtLIYPbmNGNyYe8QwNaTUYQp2J7/vIsUKt5QCqAfUkYyG9DkOw==", "dev": true, "license": "MIT", "engines": { - "node": ">=6" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/ansi-sequence-parser": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.3.tgz", - "integrity": "sha512-+fksAx9eG3Ab6LDnLs3ZqZa8KVJ/jYnX+D4Qe1azX+LFGFAXqynCQLOdLpNYN/l9e7l6hMWwZbrnctqr6eSQSw==", - "dev": true, - "license": "MIT" - }, "node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -1917,13 +2011,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", - "dev": true, - "license": "MIT" - }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -2114,16 +2201,6 @@ "dev": true, "license": "MIT" }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8" - } - }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -2189,22 +2266,42 @@ } }, "node_modules/axios": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", - "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.20.0.tgz", + "integrity": "sha512-r8aOh8j9cGKpgQAqpzrUHnSIc6a59Y3Xf/cv8sy1DrHCkZHzQGEuoq1tARk6qSyDdtQGSDgpb9kFlruzPvrgwg==", "dev": true, "license": "MIT", "dependencies": { - "follow-redirects": "^1.14.8" + "follow-redirects": "^1.16.0", + "form-data": "^4.0.6", + "https-proxy-agent": "^5.0.1", + "proxy-from-env": "^2.1.0" } }, - "node_modules/bail": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", - "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "node_modules/axios/node_modules/form-data": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", + "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", "dev": true, "license": "MIT", - "funding": { + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.4", + "mime-types": "^2.1.35" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/bail": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "dev": true, + "license": "MIT", + "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } @@ -2217,13 +2314,16 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.9.19", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.19.tgz", - "integrity": "sha512-ipDqC8FrAl/76p2SSWKSI+H9tFwm7vYqXQrItCuiVPt26Km0jS+NzSsBWAaBusvSbQcfJG+JitdMm+wZAgTYqg==", + "version": "2.11.33", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.33.tgz", + "integrity": "sha512-yiVKDX+qCMRKBE084lXvq9EcwFUhKZ2nU8TK1EQQuOgPNR/lmbGxXOeDdlGUqC2Zz11Cs9rk1d/8NfgBmlkt0w==", "dev": true, "license": "Apache-2.0", "bin": { - "baseline-browser-mapping": "dist/cli.js" + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" } }, "node_modules/bignumber.js": { @@ -2249,9 +2349,9 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.21.tgz", + "integrity": "sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==", "dev": true, "license": "MIT", "dependencies": { @@ -2280,9 +2380,9 @@ "license": "ISC" }, "node_modules/browserslist": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz", - "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==", + "version": "4.29.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.4.tgz", + "integrity": "sha512-2TcbbiwXEq+N0kD36tykpCfyyQigUXmuwNQbnPp4Xk4PX9JOqVIKjJlIDjpH7uY6tmRGoAd+apeT1p60T8wsdA==", "dev": true, "funding": [ { @@ -2300,11 +2400,11 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.9.0", - "caniuse-lite": "^1.0.30001759", - "electron-to-chromium": "^1.5.263", - "node-releases": "^2.0.27", - "update-browserslist-db": "^1.2.0" + "baseline-browser-mapping": "^2.11.29", + "caniuse-lite": "^1.0.30001816", + "electron-to-chromium": "^1.5.459", + "node-releases": "^2.0.59", + "update-browserslist-db": "^1.3.4" }, "bin": { "browserslist": "cli.js" @@ -2443,9 +2543,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001769", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001769.tgz", - "integrity": "sha512-BCfFL1sHijQlBGWBMuJyhZUhzo7wer5sVj9hqekB/7xn0Ypy+pER/edCYQm4exbXj4WiySGp40P8UuTh6w1srg==", + "version": "1.0.30001819", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001819.tgz", + "integrity": "sha512-LFUqIIAwpzsIuevnKnsR9qnStBcgzPShTX61lBwN9uFkkf8o8zLiebEjbW8AYtZiF+1YKDWfdt/pWDtMuG8Xwg==", "dev": true, "funding": [ { @@ -2463,18 +2563,6 @@ ], "license": "CC-BY-4.0" }, - "node_modules/capital-case": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", - "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", - "dev": true, - "license": "MIT", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case-first": "^2.0.2" - } - }, "node_modules/chai": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", @@ -2582,13 +2670,6 @@ "node": ">=6.0" } }, - "node_modules/class-transformer": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/class-transformer/-/class-transformer-0.5.1.tgz", - "integrity": "sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==", - "dev": true, - "license": "MIT" - }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -2600,9 +2681,9 @@ } }, "node_modules/cli-table3": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", - "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", + "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2615,18 +2696,6 @@ "@colors/colors": "1.5.0" } }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, "node_modules/clone-deep": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", @@ -2714,13 +2783,13 @@ } }, "node_modules/commander": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", - "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-15.0.0.tgz", + "integrity": "sha512-z67u4ZhzCL/Tydu1lJARtEZYWbWaN7oYLHbsuzocr6y4N6WZAagG3RQ4FW61V1/0+jImpj293XfrcYnd1qxtPg==", "dev": true, "license": "MIT", "engines": { - "node": "^12.20.0 || >=14" + "node": ">=22.12.0" } }, "node_modules/commondir": { @@ -2777,13 +2846,6 @@ "dev": true, "license": "MIT" }, - "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true, - "license": "MIT" - }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -3044,9 +3106,9 @@ } }, "node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.4.tgz", + "integrity": "sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -3101,9 +3163,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.286", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.286.tgz", - "integrity": "sha512-9tfDXhJ4RKFNerfjdCcZfufu49vg620741MNs26a9+bhLThdB+plgMeou98CAaHu/WATj2iHOOHTp1hWtABj2A==", + "version": "1.5.464", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.464.tgz", + "integrity": "sha512-nRa65aFge40viPAKxMKULIY8tcXKwKboJWNn4RoKwyWXJ6SP7BnrDGKUTzc64818jIciH0PK7LSF8QzZes19GA==", "dev": true, "license": "ISC" }, @@ -3152,6 +3214,19 @@ "node": ">=8.6" } }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/envinfo": { "version": "7.14.0", "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.14.0.tgz", @@ -3741,9 +3816,9 @@ } }, "node_modules/eslint/node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", "dev": true, "license": "MIT", "dependencies": { @@ -3922,16 +3997,6 @@ "dev": true, "license": "MIT" }, - "node_modules/extsprintf": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.1.tgz", - "integrity": "sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA==", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "license": "MIT" - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -3956,22 +4021,9 @@ } }, "node_modules/fast-json-patch": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-2.2.1.tgz", - "integrity": "sha512-4j5uBaTnsYAV5ebkidvxiLUYOwjQ+JSFljeqfTxCrH9bDmlCQaOJFS84oDJ2rAXZq2yskmk3ORfoP9DCwqFNig==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^2.0.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/fast-json-patch/node_modules/fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha512-bCK/2Z4zLidyB4ReuIsvALH6w31YfAQDmXMqMx6FyfHqvBxtjC0eRumeSu4Bs3XtXwpyIywtSTrVT99BxY1f9w==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-3.1.1.tgz", + "integrity": "sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ==", "dev": true, "license": "MIT" }, @@ -3997,9 +4049,9 @@ "license": "MIT" }, "node_modules/fast-uri": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", - "integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==", + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz", + "integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==", "funding": [ { "type": "github", @@ -4055,31 +4107,21 @@ "license": "ISC" }, "node_modules/figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz", + "integrity": "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==", "dev": true, "license": "MIT", "dependencies": { - "escape-string-regexp": "^1.0.5" + "is-unicode-supported": "^2.0.0" }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/figures/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -4124,18 +4166,14 @@ "url": "https://github.com/avajs/find-cache-dir?sponsor=1" } }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "node_modules/find-up-simple": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.1.tgz", + "integrity": "sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==", "dev": true, "license": "MIT", - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -4167,16 +4205,16 @@ } }, "node_modules/flatted": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", - "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.4.tgz", + "integrity": "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==", "dev": true, "license": "ISC" }, "node_modules/follow-redirects": { - "version": "1.15.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", - "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.1.tgz", + "integrity": "sha512-FNvFGzoMLWmE6Yj9spb/zjd7yiNCHiAW9/Tg9CXrQ8wuu32HtlJOwWO11OJafl5FfY3DxTdQ0vj42zU1kvv5jg==", "dev": true, "funding": [ { @@ -4210,30 +4248,46 @@ } }, "node_modules/foreground-child": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", "dev": true, "license": "ISC", "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^3.0.2" + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" }, "engines": { - "node": ">=8.0.0" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/form-data": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.5.tgz", - "integrity": "sha512-jqdObeR2rxZZbPSGL+3VckHMYtu+f9//KXBsVny6JSX/pa38Fy+bGjuG8eW/H6USNQWhLi8Num++cU2yOCNz4A==", + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.6.tgz", + "integrity": "sha512-Ogz/E85h9tlfJzpI6TuFpGcHZFhLrb9Gw8wq9v40CxSCPnv7ahKr6Xgtkn0KYCDQJ8DNn5VoMO8EXr9V5PadyA==", "dev": true, "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.2", + "hasown": "^2.0.4", "mime-types": "^2.1.35", "safe-buffer": "^5.2.1" }, @@ -4251,16 +4305,18 @@ } }, "node_modules/formidable": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.5.tgz", - "integrity": "sha512-Oz5Hwvwak/DCaXVVUtPn4oLMLLy1CdclLKO1LFgU7XzDpVMUU5UjlSLpGMocyQNNk8F6IJW9M/YdooSn2MRI+Q==", + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-3.5.4.tgz", + "integrity": "sha512-YikH+7CUTOtP44ZTnUhR7Ic2UASBPOqmaRkRKxRbywPTe5VxF7RRCck4af9wutiZ/QKM5nME9Bie2fFaPz5Gug==", "dev": true, "license": "MIT", "dependencies": { "@paralleldrive/cuid2": "^2.2.2", "dezalgo": "^1.0.4", - "once": "^1.4.0", - "qs": "^6.11.0" + "once": "^1.4.0" + }, + "engines": { + "node": ">=14.0.0" }, "funding": { "url": "https://ko-fi.com/tunnckoCore/commissions" @@ -4509,17 +4565,17 @@ "dev": true, "license": "BSD-2-Clause" }, - "node_modules/global-dirs": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", - "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", + "node_modules/global-directory": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz", + "integrity": "sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==", "dev": true, "license": "MIT", "dependencies": { - "ini": "2.0.0" + "ini": "4.1.1" }, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -4625,16 +4681,19 @@ "license": "ISC" }, "node_modules/has-ansi": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-4.0.1.tgz", - "integrity": "sha512-Qr4RtTm30xvEdqUXbSBVWDu+PrTokJOwe/FU+VdfJPk+MXAPoeOzKpRyrDTnZIJwAkQ4oBLTU53nu0HrkF/Z2A==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-6.0.2.tgz", + "integrity": "sha512-vAyM+6+jAYwSwz0/M0jYKfU9AvAMCz0kH791RsUhvMKGUHXled/3FjcQB3YiQ4Astj5srHdb6B2FHGIfZkOQNg==", "dev": true, "license": "MIT", "dependencies": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^6.0.1" }, "engines": { - "node": ">=8" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/has-ansi?sponsor=1" } }, "node_modules/has-bigints": { @@ -4743,9 +4802,9 @@ } }, "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", "license": "MIT", "dependencies": { "function-bind": "^1.1.2" @@ -4754,14 +4813,27 @@ "node": ">= 0.4" } }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "node_modules/hosted-git-info": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-9.0.3.tgz", + "integrity": "sha512-Hc+ghLoSt6QaYZUv0WBiIvmMDZuZZ7oaDvdH8MbfOO4lOsxdXLEvuC6ePoGs9H1X9oCLyq6+NVN0MKqD+ydxyg==", "dev": true, - "license": "MIT", - "bin": { - "he": "bin/he" + "license": "ISC", + "dependencies": { + "lru-cache": "^11.1.0" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + } + }, + "node_modules/hosted-git-info/node_modules/lru-cache": { + "version": "11.5.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz", + "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" } }, "node_modules/html-escaper": { @@ -4772,9 +4844,9 @@ "license": "MIT" }, "node_modules/http-cache-semantics": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz", - "integrity": "sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.3.0.tgz", + "integrity": "sha512-M5t5LlJpS1UHMjvwRQVdFHvPISGeLAxNcrWuJkeGh0KxsqCHZ1O3NXZU/8x7cD0BDcGW8kapxMKTvwlqrNkHkA==", "dev": true, "license": "BSD-2-Clause" }, @@ -4799,6 +4871,20 @@ "node": ">=10.19.0" } }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -4871,13 +4957,29 @@ } }, "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/index-to-position": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-1.2.0.tgz", + "integrity": "sha512-Yg7+ztRkqslMAS2iFaU+Oa4KTSidr63OsFGlOrJoW981kIYO3CGCS3wA95P1mUi/IVSJkn0D479KTJpVpvFNuw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/inflight": { @@ -4899,13 +5001,13 @@ "license": "ISC" }, "node_modules/ini": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", + "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", "dev": true, "license": "ISC", "engines": { - "node": ">=10" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/internal-slot": { @@ -5202,17 +5304,17 @@ } }, "node_modules/is-installed-globally": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", - "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-1.0.1.tgz", + "integrity": "sha512-li88H4QGRoNMX27jEmY8nR515oJVspAgC/WFMlhHfFV8RJ4QyGpHhXnwAe9gH5RIgKmdYRUmrOhQobcgEjIdSw==", "dev": true, "license": "MIT", "dependencies": { - "global-dirs": "^3.0.0", - "is-path-inside": "^3.0.2" + "global-directory": "^4.0.1", + "is-path-inside": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -5272,13 +5374,16 @@ } }, "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", + "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-plain-obj": { @@ -5425,13 +5530,13 @@ "license": "MIT" }, "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", + "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -5541,35 +5646,26 @@ } }, "node_modules/istanbul-lib-instrument": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", - "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "@babel/core": "^7.7.5", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.0.0", - "semver": "^6.3.0" + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" }, "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" + "node": ">=10" } }, "node_modules/istanbul-lib-processinfo": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", - "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-3.0.1.tgz", + "integrity": "sha512-s3mX05h5wGZeScG6XnOanygPh4SJu5ujMc9YbvpnLGXWy1cRiGbp0NdVcjHxgoZt3WfQppfBsa0y+gWdYJ2pGQ==", "dev": true, "license": "ISC", "dependencies": { @@ -5577,11 +5673,87 @@ "cross-spawn": "^7.0.3", "istanbul-lib-coverage": "^3.2.0", "p-map": "^3.0.0", - "rimraf": "^3.0.0", - "uuid": "^8.3.2" + "rimraf": "^6.1.3" }, "engines": { - "node": ">=8" + "node": "20 || >=22" + } + }, + "node_modules/istanbul-lib-processinfo/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/istanbul-lib-processinfo/node_modules/brace-expansion": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/istanbul-lib-processinfo/node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/istanbul-lib-processinfo/node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/istanbul-lib-processinfo/node_modules/rimraf": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.1.3.tgz", + "integrity": "sha512-LKg+Cr2ZF61fkcaK1UdkH2yEBBKnYjTyWzTJT6KNPcSPaiT7HSdhtMXQuN5wkTX0Xu72KQ1l8S42rlmexS2hSA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "glob": "^13.0.3", + "package-json-from-dist": "^1.0.1" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/istanbul-lib-report": { @@ -5615,19 +5787,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/istanbul-lib-report/node_modules/semver": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", - "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/istanbul-lib-report/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -5693,9 +5852,9 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", - "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", + "version": "3.15.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.2.tgz", + "integrity": "sha512-6EuL879VkRA+1Cz578mKMiKvjPNEuk6+r1JaFzoSWejZmtf7xWbIyw1e3KkxlkzTIt9Taw6JBhEppG7utc1P+w==", "dev": true, "license": "MIT", "dependencies": { @@ -5785,13 +5944,6 @@ "node": ">=6" } }, - "node_modules/jsonc-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", - "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", - "dev": true, - "license": "MIT" - }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -5942,10 +6094,30 @@ "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/load-plugin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/load-plugin/-/load-plugin-4.0.1.tgz", - "integrity": "sha512-4kMi+mOSn/TR51pDo4tgxROHfBHXsrcyEYSGHcJ1o6TtRaP2PsRM5EwmYbj1uiLDvbfA/ohwuSWZJzqGiai8Dw==", + "node_modules/linkify-it": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.2.tgz", + "integrity": "sha512-ONTm2jCMAVZjgQa/Fy1kScXsuOoF5NPTsoFBdE1KVIZ2vAh/r9+Bqo+0jINCBYnavTPQZz38QzFTme79ENoN3Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/markdown-it" + } + ], + "license": "MIT", + "dependencies": { + "uc.micro": "^2.0.0" + } + }, + "node_modules/load-plugin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/load-plugin/-/load-plugin-4.0.1.tgz", + "integrity": "sha512-4kMi+mOSn/TR51pDo4tgxROHfBHXsrcyEYSGHcJ1o6TtRaP2PsRM5EwmYbj1uiLDvbfA/ohwuSWZJzqGiai8Dw==", "dev": true, "license": "MIT", "dependencies": { @@ -5971,33 +6143,10 @@ "url": "https://opencollective.com/webpack" } }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/lodash": { - "version": "4.17.23", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", - "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", - "dev": true, - "license": "MIT" - }, - "node_modules/lodash-es": { - "version": "4.17.23", - "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.23.tgz", - "integrity": "sha512-kVI48u3PZr38HdYz98UmfPnXl2DXrpdctLrFLCd3kOx1xUkOmpFPx7gCWWM5MPkL/fD8zb+Ph0QzjGFs4+hHWg==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", "dev": true, "license": "MIT" }, @@ -6022,6 +6171,13 @@ "dev": true, "license": "MIT" }, + "node_modules/lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", + "dev": true, + "license": "MIT" + }, "node_modules/lodash.truncate": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", @@ -6029,23 +6185,6 @@ "dev": true, "license": "MIT" }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/longest-streak": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", @@ -6057,16 +6196,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/lower-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", - "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", - "dev": true, - "license": "MIT", - "dependencies": { - "tslib": "^2.0.3" - } - }, "node_modules/lowercase-keys": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", @@ -6095,9 +6224,9 @@ "license": "MIT" }, "node_modules/luxon": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.2.1.tgz", - "integrity": "sha512-QrwPArQCNLAKGO/C+ZIilgIuDnEnKx5QYODdDtbFaxzsbZcc/a7WFq7MhsVYgRlwawLtvOUESTlfJ+hc/USqPg==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.7.2.tgz", + "integrity": "sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew==", "dev": true, "license": "MIT", "engines": { @@ -6137,19 +6266,41 @@ "dev": true, "license": "ISC" }, - "node_modules/marked": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", - "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", + "node_modules/markdown-it": { + "version": "14.3.3", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.3.3.tgz", + "integrity": "sha512-L//tDAkjTjJCU6pBUSBTgs3Kg4InVaZuUZog/b6V12UKhcDQ7S78877ibbCanRExwPuYP1CZD7Gd2dxSy1GXRg==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/markdown-it" + } + ], "license": "MIT", - "bin": { - "marked": "bin/marked.js" + "dependencies": { + "argparse": "^2.0.1", + "entities": "^4.5.0", + "linkify-it": "^5.0.2", + "mdurl": "^2.0.0", + "punycode.js": "^2.3.1", + "uc.micro": "^2.1.0" }, - "engines": { - "node": ">= 12" + "bin": { + "markdown-it": "bin/markdown-it.mjs" } }, + "node_modules/markdown-it/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", @@ -6287,6 +6438,13 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdurl": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.1.0.tgz", + "integrity": "sha512-1+HBaOx0zi/dQWht8rNv9MYf9qqpqL/kxI0hXImU6Y547zM6Sni8BQibt7ifgMcYtQg41ao3Ivd6cnSM86inpg==", + "dev": true, + "license": "MIT" + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -6838,9 +6996,9 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -6860,63 +7018,107 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/mocha": { - "version": "10.8.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", - "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", + "version": "12.0.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-12.0.3.tgz", + "integrity": "sha512-beammieDdiWdkjANWeWPpkxUROYGi5FN88fPOkLiticz7HTg3Y+Pho3EYE6SUdcuWnZ3h2WD8EXCA55JF4o6wg==", "dev": true, "license": "MIT", "dependencies": { - "ansi-colors": "^4.1.3", "browser-stdout": "^1.3.1", - "chokidar": "^3.5.3", + "chokidar": "^5.0.0", "debug": "^4.3.5", - "diff": "^5.2.0", - "escape-string-regexp": "^4.0.0", - "find-up": "^5.0.0", - "glob": "^8.1.0", - "he": "^1.2.0", - "js-yaml": "^4.1.0", - "log-symbols": "^4.1.0", - "minimatch": "^5.1.6", + "diff": "^9.0.0", + "find-up-simple": "^1.0.1", + "glob": "^13.0.0", + "is-path-inside": "^4.0.0", + "is-unicode-supported": "^0.1.0", + "js-yaml": "^5.0.0", + "minimatch": "^10.2.2", "ms": "^2.1.3", - "serialize-javascript": "^6.0.2", - "strip-json-comments": "^3.1.1", + "picocolors": "^1.1.1", + "serialize-javascript": "^7.1.1", + "strip-json-comments": "^5.0.3", "supports-color": "^8.1.1", - "workerpool": "^6.5.1", - "yargs": "^16.2.0", - "yargs-parser": "^20.2.9", - "yargs-unparser": "^2.0.0" + "workerpool": "^10.0.0" }, "bin": { - "_mocha": "bin/_mocha", "mocha": "bin/mocha.js" }, "engines": { - "node": ">= 14.0.0" + "node": "^20.19.0 || >=22.12.0" } }, "node_modules/mocha/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-3.0.4.tgz", + "integrity": "sha512-fwWK3Zq22l4XJJjx5mcBHGikIk+hJqO+32dPm0Jur7+rtG5x1scOjSfdT9ZKeWHPpsya/l0HHK4tDImBkTrtvA==", "dev": true, - "license": "Python-2.0" + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "PSF-2.0" + }, + "node_modules/mocha/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } }, "node_modules/mocha/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", "dev": true, "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0" + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/mocha/node_modules/chokidar": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz", + "integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^5.0.0" + }, + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" } }, "node_modules/mocha/node_modules/diff": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", - "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-9.0.0.tgz", + "integrity": "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -6924,50 +7126,110 @@ } }, "node_modules/mocha/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", "dev": true, - "license": "ISC", + "license": "BlueOak-1.0.0", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" }, "engines": { - "node": ">=12" + "node": "18 || 20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/mocha/node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/mocha/node_modules/js-yaml": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", - "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.5.0.tgz", + "integrity": "sha512-paNr4LFIFPjeeSmwNYdrb8FafLLG/Cr2Af3GjbsHJ5CxIjH4r0c2emlmRdAtpPAieP1gRVzk6buBbVP5gBMGAg==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], "license": "MIT", "dependencies": { - "argparse": "^2.0.1" + "argparse": "^3.0.3" }, "bin": { - "js-yaml": "bin/js-yaml.js" + "js-yaml": "bin/js-yaml.mjs" } }, "node_modules/mocha/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", "dev": true, - "license": "ISC", + "license": "BlueOak-1.0.0", "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^5.0.8" }, "engines": { - "node": ">=10" + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha/node_modules/readdirp": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.1.1.tgz", + "integrity": "sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/mocha/node_modules/serialize-javascript": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.1.4.tgz", + "integrity": "sha512-FqlEuoTq/zRmA4Lg6aOqyH3lCHbUtCB0bmHCeFniX2GBdDqMJM3FwdvEhlE5Pim1dlt2FfBdVPmUNNiGhhKqpw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/mocha/node_modules/strip-json-comments": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.3.tgz", + "integrity": "sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mri": { @@ -6987,25 +7249,6 @@ "dev": true, "license": "MIT" }, - "node_modules/mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, - "node_modules/nanoclone": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/nanoclone/-/nanoclone-0.2.1.tgz", - "integrity": "sha512-wynEP02LmIbLpcYw8uBKpcfF6dmg2vcpKqxeH5UcoKEYdExslsdUA4ugFauuaeYdTB76ez6gJW8XAZ6CgkXYxA==", - "dev": true, - "license": "MIT" - }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -7020,17 +7263,6 @@ "dev": true, "license": "MIT" }, - "node_modules/no-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", - "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", - "dev": true, - "license": "MIT", - "dependencies": { - "lower-case": "^2.0.2", - "tslib": "^2.0.3" - } - }, "node_modules/nock": { "version": "12.0.3", "resolved": "https://registry.npmjs.org/nock/-/nock-12.0.3.tgz", @@ -7061,11 +7293,29 @@ } }, "node_modules/node-releases": { - "version": "2.0.27", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", - "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", + "version": "2.0.60", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.60.tgz", + "integrity": "sha512-OmO8+GM1JUZqXET720VrJCwkjUCXmCMQm0Z3UDDRbfNLHS4NEAvY60j5jiFv0tkKw2PNNlqOLhahVmwJIOLDIQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/normalize-package-data": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-8.0.0.tgz", + "integrity": "sha512-RWk+PI433eESQ7ounYxIp67CYuVsS1uYSonX3kA6ps/3LWfjVQa/ptEg6Y3T6uAMq1mWpX9PQ+qx+QaHpsc7gQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^9.0.0", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + } }, "node_modules/normalize-path": { "version": "3.0.0", @@ -7091,9 +7341,9 @@ } }, "node_modules/nyc": { - "version": "15.0.1", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.0.1.tgz", - "integrity": "sha512-n0MBXYBYRqa67IVt62qW1r/d9UH/Qtr7SF1w/nQLJ9KxvWF6b2xCHImRAixHN9tnMMYHC2P14uo6KddNGwMgGg==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-18.0.0.tgz", + "integrity": "sha512-G5UyHinFkB1BxqGTrmZdB6uIYH0+v7ZnVssuflUDi+J+RhKWyAhRT1RCehBSI6jLFLuUUgFDyLt49mUtdO1XeQ==", "dev": true, "license": "ISC", "dependencies": { @@ -7104,12 +7354,13 @@ "decamelize": "^1.2.0", "find-cache-dir": "^3.2.0", "find-up": "^4.1.0", - "foreground-child": "^2.0.0", - "glob": "^7.1.6", + "foreground-child": "^3.3.0", + "get-package-type": "^0.1.0", + "glob": "^13.0.6", "istanbul-lib-coverage": "^3.0.0", "istanbul-lib-hook": "^3.0.0", - "istanbul-lib-instrument": "^4.0.0", - "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-instrument": "^6.0.2", + "istanbul-lib-processinfo": "^3.0.0", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.0.2", @@ -7118,17 +7369,40 @@ "p-map": "^3.0.0", "process-on-spawn": "^1.0.0", "resolve-from": "^5.0.0", - "rimraf": "^3.0.0", + "rimraf": "^6.1.3", "signal-exit": "^3.0.2", - "spawn-wrap": "^2.0.0", - "test-exclude": "^6.0.0", + "spawn-wrap": "^3.0.0", + "test-exclude": "^8.0.0", "yargs": "^15.0.2" }, "bin": { "nyc": "bin/nyc.js" }, "engines": { - "node": ">=8.9" + "node": "20 || >=22" + } + }, + "node_modules/nyc/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/nyc/node_modules/brace-expansion": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" } }, "node_modules/nyc/node_modules/cliui": { @@ -7157,6 +7431,24 @@ "node": ">=8" } }, + "node_modules/nyc/node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/nyc/node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -7170,6 +7462,22 @@ "node": ">=8" } }, + "node_modules/nyc/node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/nyc/node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -7209,6 +7517,26 @@ "node": ">=8" } }, + "node_modules/nyc/node_modules/rimraf": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.1.3.tgz", + "integrity": "sha512-LKg+Cr2ZF61fkcaK1UdkH2yEBBKnYjTyWzTJT6KNPcSPaiT7HSdhtMXQuN5wkTX0Xu72KQ1l8S42rlmexS2hSA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "glob": "^13.0.3", + "package-json-from-dist": "^1.0.1" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/nyc/node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -7268,16 +7596,6 @@ "node": ">=6" } }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/object-inspect": { "version": "1.13.4", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", @@ -7415,52 +7733,20 @@ "safe-push-apply": "^1.0.0" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/p-cancelable": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", - "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "node_modules/p-cancelable": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", + "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", "dev": true, "license": "MIT", - "dependencies": { - "p-limit": "^3.0.2" - }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/p-map": { @@ -7502,6 +7788,13 @@ "node": ">=8" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, "node_modules/pad-right": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/pad-right/-/pad-right-0.2.2.tgz", @@ -7599,6 +7892,33 @@ "dev": true, "license": "MIT" }, + "node_modules/path-scurry": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "11.5.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz", + "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -7627,9 +7947,9 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, "license": "MIT", "engines": { @@ -7802,6 +8122,16 @@ "dev": true, "license": "MIT" }, + "node_modules/proxy-from-env": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz", + "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/pump": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", @@ -7823,14 +8153,25 @@ "node": ">=6" } }, + "node_modules/punycode.js": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", + "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/qs": { - "version": "6.14.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.2.tgz", - "integrity": "sha512-V/yCWTTF7VJ9hIh18Ugr2zhJMP01MY7c5kh4J870L7imm6/DIzBsNLTXzMwUA3yZ5b/KBqLx8Kp3uRvd7xSe3Q==", + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.1.tgz", + "integrity": "sha512-5Px6J7rfHBAGUhNQ3es4YzcOdBBw0SDcVtThJml4RdnKw4tKs2epA0kPZ+K8X+WiHktT93RHVcQ/3ym5aTCgtg==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.1.0" + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" }, "engines": { "node": ">=0.6" @@ -7873,14 +8214,120 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "node_modules/read-package-up": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/read-package-up/-/read-package-up-12.0.0.tgz", + "integrity": "sha512-Q5hMVBYur/eQNWDdbF4/Wqqr9Bjvtrw2kjGxxBbKLbx8bVCL8gcArjTy8zDUuLGQicftpMuU0riQNcAsbtOVsw==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up-simple": "^1.0.1", + "read-pkg": "^10.0.0", + "type-fest": "^5.2.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-package-up/node_modules/type-fest": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.10.0.tgz", + "integrity": "sha512-NoSdpq/WEiAg5sjmBkmV/hfxv6HJH4NqPNrqjtSO5CwRmpsDfaf4begxW34KdJykH/l1yHtwBWQkCRdoXO8mPA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "dependencies": { + "tagged-tag": "^1.0.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-10.1.0.tgz", + "integrity": "sha512-I8g2lArQiP78ll51UeMZojewtYgIRCKCWqZEgOO8c/uefTI+XDXvCSXu3+YNUaTNvZzobrL5+SqHjBrByRRTdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/normalize-package-data": "^2.4.4", + "normalize-package-data": "^8.0.0", + "parse-json": "^8.3.0", + "type-fest": "^5.4.4", + "unicorn-magic": "^0.4.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg/node_modules/@babel/code-frame": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/read-pkg/node_modules/parse-json": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.3.0.tgz", + "integrity": "sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==", "dev": true, "license": "MIT", "dependencies": { - "safe-buffer": "^5.1.0" + "@babel/code-frame": "^7.26.2", + "index-to-position": "^1.1.0", + "type-fest": "^4.39.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg/node_modules/parse-json/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.10.0.tgz", + "integrity": "sha512-NoSdpq/WEiAg5sjmBkmV/hfxv6HJH4NqPNrqjtSO5CwRmpsDfaf4begxW34KdJykH/l1yHtwBWQkCRdoXO8mPA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "dependencies": { + "tagged-tag": "^1.0.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/readable-stream": { @@ -7924,13 +8371,6 @@ "node": ">= 0.10" } }, - "node_modules/reflect-metadata": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", - "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", - "dev": true, - "license": "Apache-2.0" - }, "node_modules/reflect.getprototypeof": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", @@ -8548,29 +8988,6 @@ "node": ">=4" } }, - "node_modules/resolve-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-pkg/-/resolve-pkg-2.0.0.tgz", - "integrity": "sha512-+1lzwXehGCXSeryaISr6WujZzowloigEofRB+dj75y9RRa/obVcYgbHJd53tdYw8pvZj8GojXaaENws8Ktw/hQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/resolve-pkg/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/responselike": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", @@ -8752,14 +9169,11 @@ "license": "MIT" }, "node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", "dev": true, "license": "ISC", - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -8767,36 +9181,6 @@ "node": ">=10" } }, - "node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true, - "license": "ISC" - }, - "node_modules/serialize-javascript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "randombytes": "^2.1.0" - } - }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -8888,29 +9272,16 @@ "node": ">=8" } }, - "node_modules/shiki": { - "version": "0.14.7", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.7.tgz", - "integrity": "sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-sequence-parser": "^1.1.0", - "jsonc-parser": "^3.2.0", - "vscode-oniguruma": "^1.7.0", - "vscode-textmate": "^8.0.0" - } - }, "node_modules/side-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" }, @@ -8922,14 +9293,14 @@ } }, "node_modules/side-channel-list": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", - "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", - "object-inspect": "^1.13.3" + "object-inspect": "^1.13.4" }, "engines": { "node": ">= 0.4" @@ -9029,34 +9400,162 @@ "node": ">=0.10.0" } }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/spawn-wrap": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-3.0.0.tgz", + "integrity": "sha512-z+s5vv4KzFPJVddGab0xX2n7kQPGMdNUX5l9T8EJqsXdKTWpcxmAqWHpsgHEXoC1taGBCc7b79bi62M5kdbrxQ==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "cross-spawn": "^7.0.6", + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^6.1.3", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/spawn-wrap/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/spawn-wrap/node_modules/brace-expansion": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/spawn-wrap/node_modules/foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/spawn-wrap/node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/spawn-wrap/node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/spawn-wrap/node_modules/rimraf": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.1.3.tgz", + "integrity": "sha512-LKg+Cr2ZF61fkcaK1UdkH2yEBBKnYjTyWzTJT6KNPcSPaiT7HSdhtMXQuN5wkTX0Xu72KQ1l8S42rlmexS2hSA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "glob": "^13.0.3", + "package-json-from-dist": "^1.0.1" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true, + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, "license": "MIT", "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, - "node_modules/spawn-wrap": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", - "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "node_modules/spdx-license-ids": { + "version": "3.0.24", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.24.tgz", + "integrity": "sha512-cLS9TtWkIQFyLkJ3/5aFQAOHOSKTlOs/7WDut/XPSdjom1fJhUdkepeJAKXa9Y05+FabHd0sti+Et559vDtkpQ==", "dev": true, - "license": "ISC", - "dependencies": { - "foreground-child": "^2.0.0", - "is-windows": "^1.0.2", - "make-dir": "^3.0.0", - "rimraf": "^3.0.0", - "signal-exit": "^3.0.2", - "which": "^2.0.1" - }, - "engines": { - "node": ">=8" - } + "license": "CC0-1.0" }, "node_modules/sprintf-js": { "version": "1.0.3", @@ -9227,41 +9726,38 @@ } }, "node_modules/superagent": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-7.1.6.tgz", - "integrity": "sha512-gZkVCQR1gy/oUXr+kxJMLDjla434KmSOKbx5iGD30Ql+AkJQ/YlPKECJy2nhqOsHLjGHzoDTXNSjhnvWhzKk7g==", - "deprecated": "Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net", + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-10.4.1.tgz", + "integrity": "sha512-PVMkMrhKrSTtFhUU8jiWuGh/gyRMKiyCTCmm0+qVzRNxlfntmRKJkDhlEXN62x3HIb33sQ4kmL8lcSdccWAchQ==", "dev": true, "license": "MIT", "dependencies": { - "component-emitter": "^1.3.0", - "cookiejar": "^2.1.3", - "debug": "^4.3.4", + "component-emitter": "^1.3.1", + "cookiejar": "^2.1.4", + "debug": "^4.3.7", "fast-safe-stringify": "^2.1.1", - "form-data": "^4.0.0", - "formidable": "^2.0.1", + "form-data": "^4.0.5", + "formidable": "^3.5.4", "methods": "^1.1.2", "mime": "2.6.0", - "qs": "^6.10.3", - "readable-stream": "^3.6.0", - "semver": "^7.3.7" + "qs": "^6.14.1" }, "engines": { - "node": ">=6.4.0 <13 || >=14" + "node": ">=14.18.0" } }, "node_modules/superagent/node_modules/form-data": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", - "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", + "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", "dev": true, "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.2", - "mime-types": "^2.1.12" + "hasown": "^2.0.4", + "mime-types": "^2.1.35" }, "engines": { "node": ">= 6" @@ -9313,6 +9809,19 @@ "node": ">=10.0.0" } }, + "node_modules/tagged-tag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tagged-tag/-/tagged-tag-1.0.0.tgz", + "integrity": "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/tapable": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz", @@ -9347,16 +9856,15 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.16", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.16.tgz", - "integrity": "sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.6.1.tgz", + "integrity": "sha512-201R5j+sJpK8nFWwKVyNfZot8FaJbLZDq5evriVzbV1wDtSXDjRUDRfJzHpAaxFDMEhsZL1QkeqM61wgsS3KaQ==", "dev": true, "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "^0.3.25", "jest-worker": "^27.4.5", "schema-utils": "^4.3.0", - "serialize-javascript": "^6.0.2", "terser": "^5.31.1" }, "engines": { @@ -9370,12 +9878,39 @@ "webpack": "^5.1.0" }, "peerDependenciesMeta": { + "@minify-html/node": { + "optional": true + }, "@swc/core": { "optional": true }, + "@swc/css": { + "optional": true + }, + "@swc/html": { + "optional": true + }, + "clean-css": { + "optional": true + }, + "cssnano": { + "optional": true + }, + "csso": { + "optional": true + }, "esbuild": { "optional": true }, + "html-minifier-terser": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "postcss": { + "optional": true + }, "uglify-js": { "optional": true } @@ -9402,60 +9937,91 @@ "license": "MIT" }, "node_modules/test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-8.0.0.tgz", + "integrity": "sha512-ZOffsNrXYggvU1mDGHk54I96r26P8SyMjO5slMKSc7+IWmtB/MQKnEC2fP51imB3/pT6YK5cT5E8f+Dd9KdyOQ==", "dev": true, "license": "ISC", "dependencies": { "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" + "glob": "^13.0.6", + "minimatch": "^10.2.2" }, "engines": { - "node": ">=8" + "node": "20 || >=22" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "node_modules/test-exclude/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", "dev": true, - "license": "MIT" + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } }, - "node_modules/thenify": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", "dev": true, "license": "MIT", "dependencies": { - "any-promise": "^1.0.0" + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" } }, - "node_modules/thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "node_modules/test-exclude/node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", "dev": true, - "license": "MIT", + "license": "BlueOak-1.0.0", "dependencies": { - "thenify": ">= 3.1.0 < 4" + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" }, "engines": { - "node": ">=0.8" + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/tmp": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.4.tgz", - "integrity": "sha512-UdiSoX6ypifLmrfQ/XfiawN6hkjSBpCjhKxxZcWlUUmoXLaCKQU0bx4HF/tdDK2uzRuchf1txGvrWBzYREssoQ==", + "node_modules/test-exclude/node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", "dev": true, - "license": "MIT", + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, "engines": { - "node": ">=14.14" + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true, + "license": "MIT" + }, + "node_modules/tiny-case": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-case/-/tiny-case-1.0.3.tgz", + "integrity": "sha512-Eet/eeMhkO6TX8mnUteS9zgPbUMQa4I6Kkp5ORiBD5476/m+PIRiumP5tmh5ioJpH7k51Kehawy2UDfsnxxY8Q==", + "dev": true, + "license": "MIT" + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -9595,13 +10161,6 @@ "node": ">=4" } }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "dev": true, - "license": "0BSD" - }, "node_modules/tsutils": { "version": "3.21.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", @@ -9757,57 +10316,72 @@ } }, "node_modules/typedoc": { - "version": "0.23.28", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.23.28.tgz", - "integrity": "sha512-9x1+hZWTHEQcGoP7qFmlo4unUoVJLB0H/8vfO/7wqTnZxg4kPuji9y3uRzEu0ZKez63OJAUmiGhUrtukC6Uj3w==", + "version": "0.28.20", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.28.20.tgz", + "integrity": "sha512-uSKqkh8Cr48vllnEy+jdaAgOeR6Y+QCBW7usgUsKj7gJEfR7stw9U/fE49LBnj2tPRKPY0c0EBJSWe9Appmplg==", "dev": true, "license": "Apache-2.0", "dependencies": { + "@gerrit0/mini-shiki": "^3.23.0", "lunr": "^2.3.9", - "marked": "^4.2.12", - "minimatch": "^7.1.3", - "shiki": "^0.14.1" + "markdown-it": "^14.3.0", + "minimatch": "^10.2.5", + "yaml": "^2.9.0" }, "bin": { "typedoc": "bin/typedoc" }, "engines": { - "node": ">= 14.14" + "node": ">= 18", + "pnpm": ">= 10" }, "peerDependencies": { - "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x" + "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x || 5.9.x || 6.0.x" + } + }, + "node_modules/typedoc/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" } }, "node_modules/typedoc/node_modules/brace-expansion": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz", - "integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", "dev": true, "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0" + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" } }, "node_modules/typedoc/node_modules/minimatch": { - "version": "7.4.9", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.9.tgz", - "integrity": "sha512-Brg/fp/iAVDOQoHxkuN5bEYhyQlZhxddI78yWsCbeEwTHXQjlNLtiJDUsp1GIptVqMI7/gkJMz4vVAc01mpoBw==", + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", "dev": true, - "license": "ISC", + "license": "BlueOak-1.0.0", "dependencies": { - "brace-expansion": "^2.0.2" + "brace-expansion": "^5.0.8" }, "engines": { - "node": ">=10" + "node": "18 || 20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", "bin": { @@ -9815,9 +10389,16 @@ "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, + "node_modules/uc.micro": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", + "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", + "dev": true, + "license": "MIT" + }, "node_modules/unbox-primitive": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", @@ -9838,12 +10419,25 @@ } }, "node_modules/undici-types": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.11.1.tgz", - "integrity": "sha512-mIDEX2ek50x0OlRgxryxsenE5XaQD4on5U2inY7RApK3SOJpofyw7uW2AyfMKkhAxXIceo2DeWGVGwyvng1GNQ==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", "dev": true, "license": "MIT" }, + "node_modules/unicorn-magic": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.4.1.tgz", + "integrity": "sha512-lzlXPoVB0Uy/FvTaUgX39RbixYiSKoc3JSoSf01+0c2B6FR3qdYIPN7Qjo/AV7n6sqLCk0509cT3LRj1oSZ1+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/unified": { "version": "10.1.2", "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", @@ -9950,10 +10544,20 @@ "license": "Python-2.0" }, "node_modules/unified-engine/node_modules/js-yaml": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", - "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz", + "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -10109,9 +10713,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", - "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", + "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", "dev": true, "funding": [ { @@ -10139,16 +10743,6 @@ "browserslist": ">= 4.21.0" } }, - "node_modules/upper-case-first": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", - "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", - "dev": true, - "license": "MIT", - "dependencies": { - "tslib": "^2.0.3" - } - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -10187,12 +10781,16 @@ "license": "MIT" }, "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.1.tgz", + "integrity": "sha512-vIYxrBCC/N/K+Js3qSN88go7kIfNPssr/hHCesKCQNAjmgvYS2oqr69kIufEG+O4+PfezOH4EbIeHCfFov8ZgQ==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "license": "MIT", "bin": { - "uuid": "dist/bin/uuid" + "uuid": "dist/esm/bin/uuid" } }, "node_modules/uvu": { @@ -10215,9 +10813,9 @@ } }, "node_modules/uvu/node_modules/diff": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", - "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.2.tgz", + "integrity": "sha512-vtcDfH3TOjP8UekytvnHH1o1P4FcUdt4eQ1Y+Abap1tk/OB2MWQvcwS2ClCd1zuIhc3JKOx6p3kod8Vfys3E+A==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -10238,19 +10836,15 @@ "dev": true, "license": "MIT" }, - "node_modules/verror": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.1.tgz", - "integrity": "sha512-veufcmxri4e3XSrT0xwfUR7kguIkaxBeosDg00yDWhk49wdwkSUrvvsm7nc75e1PUyvIeZj6nS8VQRYz2/S4Xg==", + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - }, - "engines": { - "node": ">=0.6.0" + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" } }, "node_modules/vfile": { @@ -10317,19 +10911,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/vfile-reporter/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, "node_modules/vfile-reporter/node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -10414,20 +10995,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/vscode-oniguruma": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", - "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", - "dev": true, - "license": "MIT" - }, - "node_modules/vscode-textmate": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz", - "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==", - "dev": true, - "license": "MIT" - }, "node_modules/watchpack": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.5.1.tgz", @@ -10729,30 +11296,12 @@ } }, "node_modules/workerpool": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", - "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-10.0.3.tgz", + "integrity": "sha512-6z2Iis68Wqth93/G/wJP9u+R3O+d2XTlgWChGCwuT1qLbBsOYueGRZuJ++v3mtDP5KjYdy+WzvWC+VWETSVXJA==", "dev": true, "license": "Apache-2.0" }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/wrapped": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wrapped/-/wrapped-1.0.1.tgz", @@ -10794,16 +11343,6 @@ "node": ">=8.0" } }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } - }, "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", @@ -10812,94 +11351,19 @@ "license": "ISC" }, "node_modules/yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">= 6" - } - }, - "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz", + "integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==", "dev": true, "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, - "license": "MIT", - "dependencies": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-unparser/node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" + "bin": { + "yaml": "bin.mjs" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/yargs-unparser/node_modules/decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true, - "license": "MIT", "engines": { - "node": ">=10" + "node": ">= 14.6" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/yargs-unparser/node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" + "url": "https://github.com/sponsors/eemeli" } }, "node_modules/yn": { @@ -10912,36 +11376,30 @@ "node": ">=6" } }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "node_modules/yup": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/yup/-/yup-1.7.1.tgz", + "integrity": "sha512-GKHFX2nXul2/4Dtfxhozv701jLQHdf6J34YDh2cEkpqoo8le5Mg6/LrdseVLrFarmFygZTlfIhHx/QKfb/QWXw==", "dev": true, "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "dependencies": { + "property-expr": "^2.0.5", + "tiny-case": "^1.0.3", + "toposort": "^2.0.2", + "type-fest": "^2.19.0" } }, - "node_modules/yup": { - "version": "0.32.11", - "resolved": "https://registry.npmjs.org/yup/-/yup-0.32.11.tgz", - "integrity": "sha512-Z2Fe1bn+eLstG8DRR6FTavGD+MeAwyfmouhHsIUgaADz8jvFKbO/fXc2trJKZg+5EBjh4gGm3iU/t3onKlXHIg==", + "node_modules/yup/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "dev": true, - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.15.4", - "@types/lodash": "^4.14.175", - "lodash": "^4.17.21", - "lodash-es": "^4.17.21", - "nanoclone": "^0.2.1", - "property-expr": "^2.0.4", - "toposort": "^2.0.2" - }, + "license": "(MIT OR CC0-1.0)", "engines": { - "node": ">=10" + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/zwitch": { diff --git a/package.json b/package.json index 1f3e4d1d..afa40fac 100644 --- a/package.json +++ b/package.json @@ -110,27 +110,25 @@ }, "homepage": "https://github.com/cloudevents/sdk-javascript#readme", "dependencies": { - "ajv": "^8.11.0", + "ajv": "^8.18.0", "ajv-formats": "^2.1.1", "process": "^0.11.10", "json-bigint": "^1.0.0", "util": "^0.12.4", - "uuid": "^8.3.2" + "uuid": "^11.1.1" }, "devDependencies": { - "@cucumber/cucumber": "^8.0.0", + "@cucumber/cucumber": "^13.3.0", "@types/chai": "^4.2.11", - "@types/cucumber": "^6.0.1", "@types/got": "^9.6.11", "@types/json-bigint": "^1.0.1", - "@types/mocha": "^7.0.2", - "@types/node": "~22.0.0", - "@types/superagent": "^4.1.10", - "@types/uuid": "^8.3.4", + "@types/mocha": "^10.0.10", + "@types/node": "^22.20.5", + "@types/superagent": "^8.1.11", "@typescript-eslint/eslint-plugin": "^4.29.0", "@typescript-eslint/parser": "^4.29.0", "ajv-cli": "^5.0.0", - "axios": "^0.26.1", + "axios": "^1.20.0", "chai": "~4.2.0", "eslint": "^7.32.0", "eslint-config-standard": "^16.0.3", @@ -140,21 +138,24 @@ "eslint-plugin-promise": "^5.1.0", "got": "^11.8.5", "http-parser-js": "^0.5.2", - "mocha": "^10.1.0", + "mocha": "^12.0.3", "nock": "~12.0.3", - "nyc": "~15.0.0", + "nyc": "^18.0.0", "prettier": "^2.0.5", "remark-cli": "^10.0.0", "remark-lint": "^8.0.0", "remark-lint-list-item-indent": "^2.0.1", "remark-preset-lint-recommended": "^5.0.0", - "superagent": "^7.1.1", + "superagent": "^10.4.1", "ts-node": "^10.8.1", - "typedoc": "^0.23.28", - "typescript": "^4.9.5", + "typedoc": "^0.28.20", + "typescript": "^5.9.3", "webpack": "^5.76.0", "webpack-cli": "^4.10.0" }, + "overrides": { + "fast-json-patch": "^3.1.1" + }, "publishConfig": { "access": "public" }, diff --git a/src/parsers.ts b/src/parsers.ts index 4613a1ce..7a050672 100644 --- a/src/parsers.ts +++ b/src/parsers.ts @@ -21,9 +21,9 @@ export class JSONParser implements Parser { /** * Parses the payload with an optional decorator * @param {object|string} payload the JSON payload - * @return {object} the parsed JSON payload. + * @return {unknown} the parsed JSON payload. */ - parse(payload: Record | string): string { + parse(payload: Record | string): unknown { if (typeof payload === "string") { // This is kind of a hack, but the payload data could be JSON in the form of a single // string, such as "some data". But without the quotes in the string, JSON.parse blows @@ -45,7 +45,7 @@ export class JSONParser implements Parser { JSON = __JSON; } - const parseJSON = (v: Record | string): string => (isString(v) ? JSON.parse(v as string) : v); + const parseJSON = (v: Record | string): unknown => (isString(v) ? JSON.parse(v as string) : v); return parseJSON(payload); } } diff --git a/test/integration/emitter_factory_test.ts b/test/integration/emitter_factory_test.ts index 568f6ccc..03b21832 100644 --- a/test/integration/emitter_factory_test.ts +++ b/test/integration/emitter_factory_test.ts @@ -6,7 +6,7 @@ import "mocha"; import { expect } from "chai"; import nock from "nock"; -import axios, { AxiosRequestHeaders } from "axios"; +import axios from "axios"; import request from "superagent"; import got from "got"; @@ -39,7 +39,14 @@ export const fixture = new CloudEvent({ }); function axiosEmitter(message: Message, options?: Options): Promise { - return axios.post(sink, message.body, { headers: message.headers as AxiosRequestHeaders, ...options }); + // axios 1.x coerces every header value to a string. The fixture carries an + // object-valued extension, which the binary binding passes through untouched, + // so serialize it as JSON here to keep it readable on the receiving side. + const headers: Record = {}; + for (const [name, value] of Object.entries(message.headers)) { + headers[name] = typeof value === "string" ? value : JSON.stringify(value); + } + return axios.post(sink, message.body, { headers, ...options }); } function superagentEmitter(message: Message, options?: Options): Promise { @@ -180,7 +187,10 @@ export function assertBinary(response: Record): void { expect(response["ce-source"]).to.equal(source); expect(response[`ce-${ext1Name}`]).to.deep.equal(ext1Value); expect(response[`ce-${ext2Name}`]).to.deep.equal(ext2Value); - expect(response[`ce-${ext3Name}`]).to.deep.equal(ext3Value); + // nock hands object-valued headers back untouched; a client that serializes + // headers (axios 1.x) delivers the JSON form instead + const ext3 = response[`ce-${ext3Name}`]; + expect(typeof ext3 === "string" ? JSON.parse(ext3) : ext3).to.deep.equal(ext3Value); } /** From a358af23e7dba07388cbc488135ca4bdba979517 Mon Sep 17 00:00:00 2001 From: Shiva Date: Mon, 26 Oct 2026 15:58:36 -0700 Subject: [PATCH 13/26] fix: decode data_base64 as Uint8Array instead of Uint32Array (#662) The CloudEvent constructor, MQTT and Kafka structured mode already decode through base64AsBinary() into a Uint8Array; the HTTP structured path now does the same. The Kafka structured round-trip test is re-enabled. Also added myself to the contributors list. Fixes #643 Supersedes #644 Signed-off-by: Shiva Co-authored-by: Sascha Bratton --- package.json | 5 +++++ src/message/http/index.ts | 4 ++-- test/integration/cloud_event_test.ts | 2 +- test/integration/kafka_tests.ts | 12 ++++++------ test/integration/message_test.ts | 28 ++++++++++++++++++++-------- 5 files changed, 34 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index afa40fac..c68e61a0 100644 --- a/package.json +++ b/package.json @@ -102,6 +102,11 @@ { "name": "Matej Vasek", "url": "https://github.com/matejvasek" + }, + { + "name": "Shiva", + "email": "shiv@shiv.me", + "url": "https://github.com/shiva" } ], "license": "Apache-2.0", diff --git a/src/message/http/index.ts b/src/message/http/index.ts index cdba2629..ad9fd701 100644 --- a/src/message/http/index.ts +++ b/src/message/http/index.ts @@ -16,7 +16,7 @@ import { v1binaryParsers, v1structuredParsers, } from "./headers"; -import { isStringOrObjectOrThrow, ValidationError } from "../../event/validation"; +import { base64AsBinary, isStringOrObjectOrThrow, ValidationError } from "../../event/validation"; import { JSONParser, MappedParser, Parser, parserByContentType } from "../../parsers"; /** @@ -248,7 +248,7 @@ function parseStructured(message: Message, version: string): CloudEvent { // itself will be encoded as base64 if (eventObj.data_base64 || eventObj.datacontentencoding === CONSTANTS.ENCODING_BASE64) { const data = eventObj.data_base64 || eventObj.data; - eventObj.data = new Uint32Array(Buffer.from(data as string, "base64")); + eventObj.data = base64AsBinary(data as string); delete eventObj.data_base64; delete eventObj.datacontentencoding; } diff --git a/test/integration/cloud_event_test.ts b/test/integration/cloud_event_test.ts index 84472070..1e9fc530 100644 --- a/test/integration/cloud_event_test.ts +++ b/test/integration/cloud_event_test.ts @@ -22,7 +22,7 @@ const fixture = Object.freeze({ data: `"some data"` }); -const imageData = new Uint32Array(fs.readFileSync(path.join(process.cwd(), "test", "integration", "ce.png"))); +const imageData = new Uint8Array(fs.readFileSync(path.join(process.cwd(), "test", "integration", "ce.png"))); const image_base64 = asBase64(imageData); // Do not replace this with the assignment of a class instance diff --git a/test/integration/kafka_tests.ts b/test/integration/kafka_tests.ts index cb858f49..943f7713 100644 --- a/test/integration/kafka_tests.ts +++ b/test/integration/kafka_tests.ts @@ -34,12 +34,12 @@ const ext2Name = "extension2"; const ext2Value = "acme"; // Binary data as base64 -const dataBinary = Uint32Array.from(JSON.stringify(data), (c) => c.codePointAt(0) as number); +const dataBinary = Uint8Array.from(JSON.stringify(data), (c) => c.codePointAt(0) as number); const data_base64 = asBase64(dataBinary); // Since the above is a special case (string as binary), let's test // with a real binary file one is likely to encounter in the wild -const imageData = new Uint32Array(fs.readFileSync(path.join(process.cwd(), "test", "integration", "ce.png"))); +const imageData = new Uint8Array(fs.readFileSync(path.join(process.cwd(), "test", "integration", "ce.png"))); const image_base64 = asBase64(imageData); const fixture = new CloudEvent({ @@ -287,16 +287,16 @@ describe("Kafka transport", () => { expect(messageBody.data_base64).to.equal(image_base64); }); - it.skip("Converts base64 encoded data to binary when deserializing structured messages", () => { + it("Converts base64 encoded data to binary when deserializing structured messages", () => { const message = Kafka.structured(fixture.cloneWith({ data: imageData, datacontenttype: "image/png" })); - const eventDeserialized = Kafka.toEvent(message) as CloudEvent; + const eventDeserialized = Kafka.toEvent(message) as CloudEvent; expect(eventDeserialized.data).to.deep.equal(imageData); expect(eventDeserialized.data_base64).to.equal(image_base64); }); it("Converts base64 encoded data to binary when deserializing binary messages", () => { const message = Kafka.binary(fixture.cloneWith({ data: imageData, datacontenttype: "image/png" })); - const eventDeserialized = Kafka.toEvent(message) as CloudEvent; + const eventDeserialized = Kafka.toEvent(message) as CloudEvent; expect(eventDeserialized.data).to.deep.equal(imageData); expect(eventDeserialized.data_base64).to.equal(image_base64); }); @@ -310,7 +310,7 @@ describe("Kafka transport", () => { it("Does not parse binary data from binary messages with content type application/json", () => { const message = Kafka.binary(fixture.cloneWith({ data: dataBinary })); - const eventDeserialized = Kafka.toEvent(message) as CloudEvent; + const eventDeserialized = Kafka.toEvent(message) as CloudEvent; expect(eventDeserialized.data).to.deep.equal(dataBinary); expect(eventDeserialized.data_base64).to.equal(data_base64); }); diff --git a/test/integration/message_test.ts b/test/integration/message_test.ts index 93699c61..9ddb292d 100644 --- a/test/integration/message_test.ts +++ b/test/integration/message_test.ts @@ -32,12 +32,12 @@ const ext2Name = "extension2"; const ext2Value = "acme"; // Binary data as base64 -const dataBinary = Uint32Array.from(JSON.stringify(data), (c) => c.codePointAt(0) as number); +const dataBinary = Uint8Array.from(JSON.stringify(data), (c) => c.codePointAt(0) as number); const data_base64 = asBase64(dataBinary); // Since the above is a special case (string as binary), let's test // with a real binary file one is likely to encounter in the wild -const imageData = new Uint32Array(fs.readFileSync(path.join(process.cwd(), "test", "integration", "ce.png"))); +const imageData = new Uint8Array(fs.readFileSync(path.join(process.cwd(), "test", "integration", "ce.png"))); const image_base64 = asBase64(imageData); describe("HTTP transport", () => { @@ -317,21 +317,33 @@ describe("HTTP transport", () => { it("Converts base64 encoded data to binary when deserializing structured messages", () => { const message = HTTP.structured(fixture.cloneWith({ data: imageData, datacontenttype: "image/png" })); - const eventDeserialized = HTTP.toEvent(message) as CloudEvent; + const eventDeserialized = HTTP.toEvent(message) as CloudEvent; expect(eventDeserialized.data).to.deep.equal(imageData); expect(eventDeserialized.data_base64).to.equal(image_base64); }); it("Does not parse binary data from structured messages with content type application/json", () => { const message = HTTP.structured(fixture.cloneWith({ data: dataBinary })); - const eventDeserialized = HTTP.toEvent(message) as CloudEvent; + const eventDeserialized = HTTP.toEvent(message) as CloudEvent; expect(eventDeserialized.data).to.deep.equal(dataBinary); expect(eventDeserialized.data_base64).to.equal(data_base64); }); + it("Deserializes data_base64 as Uint8Array with correct byte length", () => { + const original = new Uint8Array([0x00, 0x01, 0x02, 0xff]); + const event = fixture.cloneWith({ data: original, datacontenttype: "application/octet-stream" }); + const message = HTTP.structured(event); + const deserialized = HTTP.toEvent(message) as CloudEvent; + const bytes = deserialized.data as Uint8Array; + expect(bytes).to.be.instanceOf(Uint8Array); + expect(bytes.length).to.equal(4); + expect(bytes.buffer.byteLength).to.equal(4); + expect(Array.from(bytes)).to.deep.equal([0x00, 0x01, 0x02, 0xff]); + }); + it("Converts base64 encoded data to binary when deserializing binary messages", () => { const message = HTTP.binary(fixture.cloneWith({ data: imageData, datacontenttype: "image/png" })); - const eventDeserialized = HTTP.toEvent(message) as CloudEvent; + const eventDeserialized = HTTP.toEvent(message) as CloudEvent; expect(eventDeserialized.data).to.deep.equal(imageData); expect(eventDeserialized.data_base64).to.equal(image_base64); }); @@ -345,7 +357,7 @@ describe("HTTP transport", () => { it("Does not parse binary data from binary messages with content type application/json", () => { const message = HTTP.binary(fixture.cloneWith({ data: dataBinary })); - const eventDeserialized = HTTP.toEvent(message) as CloudEvent; + const eventDeserialized = HTTP.toEvent(message) as CloudEvent; expect(eventDeserialized.data).to.deep.equal(dataBinary); expect(eventDeserialized.data_base64).to.equal(data_base64); }); @@ -422,14 +434,14 @@ describe("HTTP transport", () => { // Creating an event with binary data automatically produces base64 encoded data // which is then set as the 'data' attribute on the message body const message = HTTP.structured(fixture.cloneWith({ data: imageData, datacontenttype: "image/png" })); - const eventDeserialized = HTTP.toEvent(message) as CloudEvent; + const eventDeserialized = HTTP.toEvent(message) as CloudEvent; expect(eventDeserialized.data).to.deep.equal(imageData); expect(eventDeserialized.data_base64).to.equal(image_base64); }); it("Converts base64 encoded data to binary when deserializing binary messages", () => { const message = HTTP.binary(fixture.cloneWith({ data: imageData, datacontenttype: "image/png" })); - const eventDeserialized = HTTP.toEvent(message) as CloudEvent; + const eventDeserialized = HTTP.toEvent(message) as CloudEvent; expect(eventDeserialized.data).to.deep.equal(imageData); expect(eventDeserialized.data_base64).to.equal(image_base64); }); From 70ddfb9486738049c7e16ce27f698df447cc55e1 Mon Sep 17 00:00:00 2001 From: Shiva Date: Fri, 6 Nov 2026 11:23:49 -0700 Subject: [PATCH 14/26] fix: serialize object-valued extension attributes in binary HTTP headers (#666) * fix: serialize object-valued extension attributes in binary HTTP headers The current implementation copies binary object and values into the header map as-is. This would produce incorrectly encoded HTTP headers, and the current behaviour relies on object coercion in axios. Instead we are explicitly serializing incompatible types to String. The CloudEvents type system has no object type, so accepting objects as extension values is an SDK convenience rather than spec behavior. In the long run, we should pivot to a spec compliant option, and throw an error for this case, and instead as the client to correctly set headers. Split from #646. Signed-off-by: Shiva Co-authored-by: Kevin Mathew Sunny * fix: enhance plain object detection for binary-mode serialization Signed-off-by: Shiva * fix: rename extensionHeaderValue to stringifyExtensionValue and update documentation for clarity Signed-off-by: Shiva --------- Signed-off-by: Shiva Co-authored-by: Kevin Mathew Sunny --- README.md | 26 ++++++++++++++++ src/event/interfaces.ts | 14 ++++++++- src/message/http/headers.ts | 52 +++++++++++++++++++++++++++++++- test/integration/message_test.ts | 48 +++++++++++++++++++++++++++++ 4 files changed, 138 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f0256adb..2a2979d8 100644 --- a/README.md +++ b/README.md @@ -163,6 +163,32 @@ const event3 = new CloudEvent({ }); ``` +### Extension Attributes + +Any property passed to the `CloudEvent` constructor that is not a core attribute becomes an +[extension attribute](https://github.com/cloudevents/spec/blob/v1.0/spec.md#extension-context-attributes). +In binary mode each extension is sent as its own header, named after the attribute with the +transport's prefix: an extension `traceid` becomes the `ce-traceid` HTTP header. Extension names +must be lowercase letters and digits only. + +Extension values should be one of the CloudEvents types: string, boolean, integer, binary, URI or +timestamp. The spec has no object type, so encode structured data as a string yourself: + +```js +const ce = new CloudEvent({ + source: "/orders", + type: "order.placed", + traceinfo: JSON.stringify({ span: "abc", sampled: true }), +}); +``` + +`Date` values are sent as RFC 3339 timestamps and binary values (`Buffer`, typed arrays) as base64, which +are the string forms the spec requires. + +As a convenience the SDK also accepts a plain object or array as an extension value and serializes it as JSON +when the event is sent in binary mode. This is not spec-conformant: a receiver gets a plain string +and has to know to parse it, and other SDKs may reject the event. Prefer the explicit form above. + ### A Note About Big Integers When parsing JSON data, if a JSON field value is a number, and that number diff --git a/src/event/interfaces.ts b/src/event/interfaces.ts index f73c6d8f..72d3843b 100644 --- a/src/event/interfaces.ts +++ b/src/event/interfaces.ts @@ -136,7 +136,19 @@ export interface CloudEventV1OptionalAttributes { data_base64?: string; /** - * [OPTIONAL] CloudEvents extension attributes. + * [OPTIONAL] CloudEvents extension attributes. Any property that is not a + * core attribute is treated as an extension. Values should be one of the + * CloudEvents types: string, boolean, integer, binary, URI or timestamp. + * In binary mode a Date is sent as RFC 3339 and binary values as base64. + * + * Object values are accepted as a convenience and for compatibility reasons. + * They are serialized as JSON in binary mode, but this is not spec-conformant; + * prefer encoding the value as a string yourself. + * + * @deprecated automatic serialization of object values is not spec-conformant + * and may be removed in future versions of the SDK. + * + * @see https://github.com/cloudevents/spec/blob/v1.0/spec.md#extension-context-attributes */ [key: string]: unknown; } diff --git a/src/message/http/headers.ts b/src/message/http/headers.ts index b0cc519b..15fb15e4 100644 --- a/src/message/http/headers.ts +++ b/src/message/http/headers.ts @@ -8,6 +8,7 @@ import { CloudEventV1 } from "../.."; import { Headers } from "../"; import { V1 } from "../../event/cloudevent"; import CONSTANTS from "../../constants"; +import { asBase64, isBinary, isDate, TypeArray } from "../../event/validation"; export const allowedContentTypes = [CONSTANTS.DEFAULT_CONTENT_TYPE, CONSTANTS.MIME_JSON, CONSTANTS.MIME_OCTET_STREAM]; export const requiredHeaders = [ @@ -41,7 +42,7 @@ export function headersFor(event: CloudEventV1): Headers { if (map) { headers[map.name] = map.parser.parse(value as string) as string; } else if (property !== CONSTANTS.DATA_ATTRIBUTE && property !== `${CONSTANTS.DATA_ATTRIBUTE}_base64`) { - headers[`${CONSTANTS.EXTENSIONS_PREFIX}${property}`] = value as string; + headers[`${CONSTANTS.EXTENSIONS_PREFIX}${property}`] = stringifyExtensionValue(value); } } }); @@ -52,6 +53,55 @@ export function headersFor(event: CloudEventV1): Headers { return headers; } +/** + * True for objects created by a literal, `new Object()` or `Object.create(null)`. + * The check looks at the prototype, so it is not fooled by a shadowed `constructor` + * property and it does not depend on `Object.prototype.toString`, which a + * Symbol.toStringTag can spoof. Class instances (Error, Map, Date, ...) are not plain. + * @param {unknown} value the value to test + * @returns {boolean} true if the value is a plain object + */ +const isPlainObject = (value: unknown): value is Record => + value !== null && + typeof value === "object" && + (Object.getPrototypeOf(value) === Object.prototype || + (Object.getPrototypeOf(value) === null && Object.prototype.toString.call(value) === "[object Object]")); + +/** + * Converts an extension attribute value to its binary-mode header value. + * + * The CloudEvents type system has no object type: extension values are strings, + * booleans, integers, binary, URIs or timestamps. Values that are not already + * strings are converted as follows; the branches are disjoint, so their order + * does not matter. The last column is what the HTTP client's String() coercion + * used to put on the wire. + * + * | value | header value | before | + * |--------------------------|-------------------------|---------------------------------| + * | Date | RFC 3339 (toISOString) | local-time string | + * | Buffer, typed array | base64 | UTF-8 text, or "104,105" | + * | plain object, array | JSON (convenience) | "[object Object]", or "1,2" | + * | anything else | unchanged | unchanged | + * + * JSON for plain objects and arrays is an SDK convenience, not spec behavior; + * prefer encoding such values as strings yourself. Anything else (Error, Map, + * null, ...) is not a CloudEvents type and is left for the HTTP client, as before. + * @param {unknown} value the extension attribute value + * @returns {string} the header value + */ +function stringifyExtensionValue(value: unknown): string { + if (isDate(value)) { + return value.toISOString(); + } + if (isBinary(value)) { + return asBase64(value as TypeArray); + } + if (isPlainObject(value) || Array.isArray(value)) { + return JSON.stringify(value); + } + return value as string; +} + /** * Sanitizes incoming headers by lowercasing them and potentially removing * encoding from the content-type header. diff --git a/test/integration/message_test.ts b/test/integration/message_test.ts index 9ddb292d..8ac2200f 100644 --- a/test/integration/message_test.ts +++ b/test/integration/message_test.ts @@ -65,6 +65,54 @@ describe("HTTP transport", () => { expect(message.headers["ce-extboolean"]).to.equal(false); }); + it("Serializes object-valued extensions as JSON in binary mode", () => { + const extobject = { some: "object", nested: { answer: 42 } }; + const evt = new CloudEvent({ source: "test", type: "test", extobject }); + const message = HTTP.binary(evt); + // HTTP headers can only carry strings; a raw object reaches the wire as "[object Object]" + expect(message.headers["ce-extobject"]).to.equal(JSON.stringify(extobject)); + }); + + it("Round-trips an object-valued extension through binary mode as a JSON string", () => { + const extobject = { some: "object", nested: { answer: 42 } }; + const evt = new CloudEvent({ source: "test", type: "test", extobject }); + const received = HTTP.toEvent(HTTP.binary(evt)) as CloudEvent; + // the receiver sees the serialized form and is responsible for parsing it + expect(received.extobject).to.equal(JSON.stringify(extobject)); + expect(JSON.parse(received.extobject as string)).to.deep.equal(extobject); + }); + + it("Serializes Date-valued extensions as RFC 3339 timestamps in binary mode", () => { + const extdate = new Date("2018-04-05T03:56:24Z"); + const message = HTTP.binary(new CloudEvent({ source: "test", type: "test", extdate })); + expect(message.headers["ce-extdate"]).to.equal("2018-04-05T03:56:24.000Z"); + }); + + it("Serializes binary extensions as base64 in binary mode", () => { + const extbytes = new Uint8Array([104, 105]); + const extbuffer = Buffer.from("hi"); + const message = HTTP.binary(new CloudEvent({ source: "test", type: "test", extbytes, extbuffer })); + expect(message.headers["ce-extbytes"]).to.equal("aGk="); + expect(message.headers["ce-extbuffer"]).to.equal("aGk="); + }); + + it("Serializes plain objects without an Object constructor as JSON in binary mode", () => { + // a shadowed `constructor` property or a null prototype must not defeat plain-object detection + const extshadowed = { constructor: "shadowed", some: "object" }; + const extnullproto = Object.assign(Object.create(null), { some: "object" }); + const message = HTTP.binary(new CloudEvent({ source: "test", type: "test", extshadowed, extnullproto })); + expect(message.headers["ce-extshadowed"]).to.equal(JSON.stringify(extshadowed)); + expect(message.headers["ce-extnullproto"]).to.equal(JSON.stringify(extnullproto)); + }); + + it("Leaves non-CloudEvents values in binary-mode extensions untouched", () => { + const exterror = new Error("useful message"); + const message = HTTP.binary(new CloudEvent({ source: "test", type: "test", exterror })); + // JSON.stringify would turn the Error into "{}"; the HTTP client's String() keeps the message + expect(message.headers["ce-exterror"]).to.equal(exterror); + expect(String(message.headers["ce-exterror"])).to.equal("Error: useful message"); + }); + it("Includes extensions in structured when type is 'boolean' with a false value", () => { const evt = new CloudEvent({ source: "test", type: "test", extboolean: false }); expect(evt.hasOwnProperty("extboolean")).to.equal(true); From 6c62ac8842381859f3c5d93fd82ee19e081bc0e0 Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Sat, 7 Nov 2026 06:02:51 +0900 Subject: [PATCH 15/26] docs: use ECMAScript modules in README examples (#652) Signed-off-by: kahirokunn --- README.md | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 2a2979d8..587f9089 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,9 @@ those are Node.js 22.x, and Node.js 24.x. To install in your Node.js project: npm install cloudevents ``` +The examples below use ECMAScript modules; CommonJS applications can use +`require("cloudevents")` instead. + ### Receiving and Emitting Events #### Receiving Events @@ -34,8 +37,10 @@ object can be created by simply providing the `HTTP` protocol binding the incoming headers and request body. ```js -const app = require("express")(); -const { HTTP } = require("cloudevents"); +import express from "express"; +import { HTTP } from "cloudevents"; + +const app = express(); app.post("/", (req, res) => { // body and headers come from an incoming HTTP request, e.g. express.js @@ -49,7 +54,7 @@ app.post("/", (req, res) => { The easiest way to send events is to use the built-in HTTP emitter. ```js -const { httpTransport, emitterFor, CloudEvent } = require("cloudevents"); +import { CloudEvent, emitterFor, httpTransport } from "cloudevents"; // Create an emitter to send events to a receiver const emit = emitterFor(httpTransport("https://my.receiver.com/endpoint")); @@ -68,8 +73,8 @@ and customization. For example, the `axios` module is used here to send a CloudEvent. ```js -const axios = require("axios").default; -const { HTTP, CloudEvent } = require("cloudevents"); +import axios from "axios"; +import { CloudEvent, HTTP } from "cloudevents"; const ce = new CloudEvent({ type, source, data }); const message = HTTP.binary(ce); // Or HTTP.structured(ce) @@ -85,8 +90,8 @@ axios({ You may also use the `emitterFor()` function as a convenience. ```js -const axios = require("axios").default; -const { emitterFor, Mode, CloudEvent } = require("cloudevents"); +import axios from "axios"; +import { CloudEvent, emitterFor, Mode } from "cloudevents"; function sendWithAxios(message) { // Do what you need with the message headers @@ -108,7 +113,13 @@ emit(new CloudEvent({ type, source, data })); You may also use the `Emitter` singleton to send your `CloudEvents`. ```js -const { emitterFor, httpTransport, Mode, CloudEvent, Emitter } = require("cloudevents"); +import { + CloudEvent, + Emitter, + emitterFor, + httpTransport, + Mode, +} from "cloudevents"; // Create a CloudEvent emitter function to send events to our receiver const emit = emitterFor(httpTransport("https://example.com/receiver")); @@ -129,9 +140,7 @@ new CloudEvent({ type, source, data }).emit(); All created `CloudEvent` objects are read-only. If you need to update a property or add a new extension to an existing cloud event object, you can use the `cloneWith` method. This will return a new `CloudEvent` with any update or new properties. For example: ```js -const { - CloudEvent, -} = require("cloudevents"); +import { CloudEvent } from "cloudevents"; // Create a new CloudEvent const ce = new CloudEvent({...}); From 48b174545e791b9efc122b9beef6e26deb065b97 Mon Sep 17 00:00:00 2001 From: Raphael Fakhri Date: Fri, 6 Nov 2026 23:03:10 +0200 Subject: [PATCH 16/26] fix: read binary extension headers regardless of prefix case (#664) Fixes: https://github.com/cloudevents/sdk-javascript/issues/566 Signed-off-by: Raphael Fakhri <153192858+RaphaelFakhri@users.noreply.github.com> --- src/message/http/index.ts | 4 +++- test/integration/message_test.ts | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/message/http/index.ts b/src/message/http/index.ts index ad9fd701..71a6642f 100644 --- a/src/message/http/index.ts +++ b/src/message/http/index.ts @@ -181,8 +181,10 @@ function parseBinary(message: Message, version: string): CloudEvent { } // Every unprocessed header can be an extension + // Header names are case-insensitive, so match the prefix and known attributes in any case for (const header in headers) { - if (header.startsWith(CONSTANTS.EXTENSIONS_PREFIX)) { + const lowerCaseHeader = header.toLowerCase(); + if (lowerCaseHeader.startsWith(CONSTANTS.EXTENSIONS_PREFIX) && !parserMap[lowerCaseHeader]) { eventObj[header.substring(CONSTANTS.EXTENSIONS_PREFIX.length)] = headers[header]; } } diff --git a/test/integration/message_test.ts b/test/integration/message_test.ts index 8ac2200f..56146d0c 100644 --- a/test/integration/message_test.ts +++ b/test/integration/message_test.ts @@ -214,6 +214,27 @@ describe("HTTP transport", () => { }).to.throw("invalid attribute name: \"LUNCH\""); }); + it("Includes extensions in binary mode when the header prefix is not lower case", () => { + const message = { + body: `{ "greeting": "hello" }`, + headers: { + "Ce-Id": "1234", + "Ce-Source": "test", + "Ce-Type": "test.event", + "Ce-Specversion": V1, + "Ce-myext": "val", + "CE-otherext": "other", + }, + }; + const event = HTTP.toEvent(message) as CloudEvent; + expect(event.myext).to.equal("val"); + expect(event.otherext).to.equal("other"); + expect(event.id).to.equal("1234"); + expect(event).not.to.have.property("Id"); + expect(event).not.to.have.property("Specversion"); + expect(() => event.validate()).not.to.throw(); + }); + it("Can detect CloudEvent binary Messages with weird versions", () => { // Now create a message that is an event const message = { From 85e68cd955349e2efe6e8e2f6bf0edab03acf48b Mon Sep 17 00:00:00 2001 From: Fair Bear Labs Date: Fri, 6 Nov 2026 16:05:32 -0500 Subject: [PATCH 17/26] docs: fix broken CloudEvents community links in README (#667) The cloudevents/spec repo renamed its default branch from master to main and moved the community/ directory to docs/, so the links to the community directory, SDK governance, maintainer guidelines and Code of Conduct all 404. Point them at the current locations and update the link text to the new directory name. Signed-off-by: Adam Boulware --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 587f9089..3238155a 100644 --- a/README.md +++ b/README.md @@ -286,13 +286,13 @@ for information on how to get involved. Each SDK may have its own unique processes, tooling and guidelines, common governance related material can be found in the -[CloudEvents `community`](https://github.com/cloudevents/spec/tree/master/community) +[CloudEvents `docs`](https://github.com/cloudevents/spec/tree/main/docs) directory. In particular, in there you will find information concerning how SDK projects are -[managed](https://github.com/cloudevents/spec/blob/master/community/SDK-GOVERNANCE.md), -[guidelines](https://github.com/cloudevents/spec/blob/master/community/SDK-maintainer-guidelines.md) +[managed](https://github.com/cloudevents/spec/blob/main/docs/SDK-GOVERNANCE.md), +[guidelines](https://github.com/cloudevents/spec/blob/main/docs/SDK-maintainer-guidelines.md) for how PR reviews and approval, and our -[Code of Conduct](https://github.com/cloudevents/spec/blob/master/community/GOVERNANCE.md#additional-information) +[Code of Conduct](https://github.com/cloudevents/spec/blob/main/docs/GOVERNANCE.md#additional-information) information. If there is a security concern with one of the CloudEvents specifications, or From 4b177635a2b45ad95bf0ecd566f459bef195a9ac Mon Sep 17 00:00:00 2001 From: Fair Bear Labs Date: Fri, 6 Nov 2026 16:05:42 -0500 Subject: [PATCH 18/26] docs: fix broken CloudEvents spec link in source comment (#668) The cloudevents/spec repository renamed its default branch from master to main and moved spec.md under cloudevents/. Update the code comment in CloudEvent validation that still pointed at the old, now 404, location. Signed-off-by: Adam Boulware --- src/event/cloudevent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/event/cloudevent.ts b/src/event/cloudevent.ts index 16c722b8..25de580e 100644 --- a/src/event/cloudevent.ts +++ b/src/event/cloudevent.ts @@ -119,7 +119,7 @@ be descriptive and terse and SHOULD NOT exceed 20 characters in length.`); } // Value should be spec compliant - // https://github.com/cloudevents/spec/blob/master/spec.md#type-system + // https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md#type-system if (!isValidType(value) && strict) { throw new ValidationError(`invalid extension value: ${value} Extension values must conform to the CloudEvent type system. From eb02b2f7c7deb33c72808cbf63833a9e28f5f9b2 Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Tue, 13 Oct 2026 13:19:18 +0900 Subject: [PATCH 19/26] feat!: use Fetch API for HTTP transport Signed-off-by: kahirokunn --- API_TRANSITION_GUIDE.md | 65 ++++ README.md | 25 +- src/index.ts | 17 +- src/message/index.ts | 2 +- src/transport/emitter.ts | 27 +- src/transport/http/index.ts | 247 ++++++++++--- test/integration/emitter_factory_test.ts | 19 +- test/integration/http_transport_test.ts | 423 +++++++++++++++++++++++ webpack.config.js | 4 +- 9 files changed, 742 insertions(+), 87 deletions(-) create mode 100644 test/integration/http_transport_test.ts diff --git a/API_TRANSITION_GUIDE.md b/API_TRANSITION_GUIDE.md index f968e902..7e98e83e 100644 --- a/API_TRANSITION_GUIDE.md +++ b/API_TRANSITION_GUIDE.md @@ -102,3 +102,68 @@ new CloudEvent({ type, source, data }).emit(); // You can also have several listener to send the event to several endpoint ``` + +### Upgrading From 10.x to 11.0 + +#### HTTP Transport + +`httpTransport()` uses Fetch and resolves with `{ response, body }`, where +`response` is the native Fetch `Response` and `body` is its text, instead of +`{ body, headers }`. Access headers through `response.headers.get(name)` and +the status through `response.status`. + +```js +const { response, body } = await emit(event); +console.log(response.status, response.headers.get("x-request-id"), body); +``` + +#### Proxies, Custom CAs, mTLS and Connection Pooling + +The old transport went through Node.js `http.request()` or `https.request()`, so a proxy +library or connection options set on `http.globalAgent` or `https.globalAgent` reached +the corresponding requests. Fetch does not use those agents; on Node.js the equivalent +is a dispatcher from [undici](https://www.npmjs.com/package/undici), which `fetchOptions` +passes through: + +```js +import { emitterFor, httpTransport } from "cloudevents"; +import { ProxyAgent } from "undici"; + +const emit = emitterFor(httpTransport("https://my.receiver.com/endpoint", { + fetchOptions: { dispatcher: new ProxyAgent("http://proxy.example.com:3128") }, +})); +``` + +For example, an order service that presents a client certificate to an events receiver +and trusts the receiver's private CA can use an `Agent`: + +```js +import { readFileSync } from "node:fs"; +import { emitterFor, httpTransport } from "cloudevents"; +import { Agent } from "undici"; + +const dispatcher = new Agent({ + connect: { + cert: readFileSync("./certs/order-service-client.pem"), + key: readFileSync("./certs/order-service-client-key.pem"), + ca: readFileSync("./certs/events-receiver-ca.pem"), + }, +}); + +const emit = emitterFor(httpTransport("https://events.example.com/orders", { + fetchOptions: { dispatcher }, +})); +``` + +The `cert` and `key` identify the client when the receiver requires mTLS. The `ca` +controls which server certificates the client trusts, so it is needed here because the +receiver uses a private CA; it is separate from client authentication. An `Agent` also +tunes connection pooling, and `undici.setGlobalDispatcher()` applies to every send rather +than one transport. In the browser the platform handles proxies, certificates and trust, +so `dispatcher` is a Node.js-only option. + +`fetchOptions` takes the Fetch options of whichever declarations type `fetch` in your +project, so TypeScript accepts `dispatcher` only where those are undici's. Against the +DOM `RequestInit` most projects compile with, pass it as +`fetchOptions: { dispatcher } as FetchRequestInit` or reach for +`setGlobalDispatcher()` instead. diff --git a/README.md b/README.md index 3238155a..bdfaa6bf 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,8 @@ app.post("/", (req, res) => { #### Emitting Events -The easiest way to send events is to use the built-in HTTP emitter. +The easiest way to send events is to use the built-in HTTP emitter, which sends +them with the Fetch API. ```js import { CloudEvent, emitterFor, httpTransport } from "cloudevents"; @@ -62,10 +63,28 @@ const emit = emitterFor(httpTransport("https://my.receiver.com/endpoint")); // Create a new CloudEvent const ce = new CloudEvent({ type, source, data }); -// Send it to the endpoint - encoded as HTTP binary by default -emit(ce); +async function main() { + // Send it to the endpoint - encoded as HTTP binary by default + const { response, body } = await emit(ce); + console.log(response.status, body); +} + +main().catch(console.error); ``` +The transport resolves with the native Fetch `Response` and its body as text +for every HTTP status. It sends each event once. Redirects are not followed +unless `fetchOptions: { redirect: "follow" }` enables them; Fetch preserves the +CloudEvent POST and its body only for `307` and `308`. + +`httpTransport()` accepts transport-wide `headers` and other Fetch options under +`fetchOptions`. Headers passed to `emit()` apply to that event only and take +precedence over transport and CloudEvent headers. URL credentials become an +authorization header unless the caller overrides it. + +See the [API transition guide](./API_TRANSITION_GUIDE.md) for response access and +Node.js proxy, certificate and connection settings. + If you prefer to use another transport mechanism for sending events over HTTP, you can use the `HTTP` binding to create a `Message` which has properties for `headers` and `body`, allowing greater flexibility diff --git a/src/index.ts b/src/index.ts index ab0148db..3c3d5bcd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,8 +7,13 @@ import { CloudEvent, V1, V03 } from "./event/cloudevent"; import { ValidationError } from "./event/validation"; import { CloudEventV1, CloudEventV1Attributes } from "./event/interfaces"; -import { Options, TransportFunction, EmitterFunction, emitterFor, Emitter } from "./transport/emitter"; -import { httpTransport } from "./transport/http"; +import { + Options, TransportFunction, EmitterFunction, emitterFor, Emitter, +} from "./transport/emitter"; +import { + FetchHeadersInit, FetchRequestInit, HTTPTransportFunction, HTTPTransportOptions, + HTTPTransportResponse, httpTransport, +} from "./transport/http"; import { Headers, Mode, Binding, HTTP, Kafka, KafkaEvent, KafkaMessage, Message, MQTT, MQTTMessage, MQTTMessageFactory, Serializer, Deserializer } from "./message"; @@ -26,6 +31,7 @@ export { Kafka, MQTT, MQTTMessageFactory, + // From transport emitterFor, httpTransport, Emitter, @@ -48,5 +54,10 @@ export type { // From transport TransportFunction, EmitterFunction, - Options + Options, + FetchHeadersInit, + FetchRequestInit, + HTTPTransportFunction, + HTTPTransportOptions, + HTTPTransportResponse }; diff --git a/src/message/index.ts b/src/message/index.ts index 4eda7320..bee6ab06 100644 --- a/src/message/index.ts +++ b/src/message/index.ts @@ -3,7 +3,7 @@ SPDX-License-Identifier: Apache-2.0 */ -import { IncomingHttpHeaders } from "http"; +import type { IncomingHttpHeaders } from "http"; import { CloudEventV1 } from ".."; // reexport the protocol bindings diff --git a/src/transport/emitter.ts b/src/transport/emitter.ts index 2a8b604c..7ddaf7d3 100644 --- a/src/transport/emitter.ts +++ b/src/transport/emitter.ts @@ -20,20 +20,22 @@ export interface Options { * EmitterFunction is an invokable interface returned by {@linkcode emitterFor}. * Invoke an EmitterFunction with a CloudEvent and optional transport * options to send the event as a Message across supported transports. + * TResult is whatever the underlying {@linkcode TransportFunction} resolves with. * @interface */ -export interface EmitterFunction { - (event: CloudEvent, options?: Options): Promise; +export interface EmitterFunction { + (event: CloudEvent, options?: TOptions): Promise; } /** * TransportFunction is an invokable interface provided to the emitterFactory. * A TransportFunction's responsiblity is to send a JSON encoded event Message - * across the wire. + * across the wire. TResult is the value it resolves with, e.g. an HTTP client's + * response, or void for a transport that has nothing to hand back. * @interface */ -export interface TransportFunction { - (message: Message, options?: Options): Promise; +export interface TransportFunction { + (message: Message, options?: TOptions): Promise; } const emitterDefaults: Options = { binding: HTTP, mode: Mode.BINARY }; @@ -51,19 +53,24 @@ const emitterDefaults: Options = { binding: HTTP, mode: Mode.BINARY }; * @param {Mode} options.mode the encoding mode (Mode.BINARY or Mode.STRUCTURED) * @returns {EmitterFunction} an EmitterFunction to send events with */ -export function emitterFor(fn: TransportFunction, options = emitterDefaults): EmitterFunction { +export function emitterFor( + fn: TransportFunction, options?: Options, +): EmitterFunction; +export function emitterFor( + fn: TransportFunction, options: Options = emitterDefaults, +): EmitterFunction { if (!fn) { throw new TypeError("A TransportFunction is required"); } const { binding, mode }: any = { ...emitterDefaults, ...options }; - return function emit(event: CloudEvent, opts?: Options): Promise { - opts = opts || {}; + return function emit(event: CloudEvent, opts?: TOptions): Promise { + const transportOptions = opts ?? {} as TOptions; switch (mode) { case Mode.BINARY: - return fn(binding.binary(event), opts); + return fn(binding.binary(event), transportOptions); case Mode.STRUCTURED: - return fn(binding.structured(event), opts); + return fn(binding.structured(event), transportOptions); default: throw new TypeError(`Unexpected transport mode: ${mode}`); } diff --git a/src/transport/http/index.ts b/src/transport/http/index.ts index 2ac2062c..1b5e9604 100644 --- a/src/transport/http/index.ts +++ b/src/transport/http/index.ts @@ -3,61 +3,204 @@ SPDX-License-Identifier: Apache-2.0 */ -import { Socket } from "net"; -import http, { OutgoingHttpHeaders } from "http"; -import https, { RequestOptions } from "https"; - -import { Message, Options } from "../.."; -import { TransportFunction } from "../emitter"; - -/** - * httpTransport provides a simple HTTP Transport function, which can send a CloudEvent, - * encoded as a Message to the endpoint. The returned function can be used with emitterFor() - * to provide an event emitter, for example: - * - * const emitter = emitterFor(httpTransport("http://example.com")); - * emitter.emit(myCloudEvent) - * .then(resp => console.log(resp)); - * +import { Headers as CloudEventHeaders, Message } from "../../message"; +import { Options, TransportFunction } from "../emitter"; + +/** The request options accepted by the Fetch implementation in the current environment */ +export type FetchRequestInit = NonNullable[1]>; + +/** The header forms accepted by the Fetch implementation in the current environment */ +export type FetchHeadersInit = NonNullable; + +/** Options applied to every request sent by an HTTP transport */ +export interface HTTPTransportOptions { + /** HTTP headers applied to every request, per-send headers take precedence */ + headers?: FetchHeadersInit; + /** Fetch options applied to every request, apart from the ones this transport controls */ + fetchOptions?: Omit; +} + +/** The native Fetch response and its body, read as text */ +export interface HTTPTransportResponse { + response: Response; + body: string; +} + +/** A transport that returns an HTTP response */ +export type HTTPTransportFunction = TransportFunction; + +/** + * Send an HTTP-bound CloudEvent with Fetch. The transport sends once and resolves with + * the native response and its body as text, for every HTTP status. Redirects are not + * followed unless fetchOptions.redirect enables them. Credentials in the sink URL become + * an authorization header, overridden by transport or per-send headers. + * + * @param {string|URL} sink the destination endpoint for the event + * @param {HTTPTransportOptions} options headers and Fetch request options + * @returns {HTTPTransportFunction} a function that sends CloudEvents to the sink + */ +export function httpTransport( + sink: string | URL, options: HTTPTransportOptions = {}, +): HTTPTransportFunction { + const url = validateHTTPURL(sink); + // fetch refuses a URL with credentials + const sinkHeaders = credentialsFrom(url); + const transportHeaders = headersFrom(options.headers); + const fetchOptions: FetchRequestInit = { + ...options.fetchOptions, + // fetch reads an explicitly undefined redirect as absent, so the default comes last + redirect: options.fetchOptions?.redirect ?? "manual", + method: "POST", + }; + + return async (message: Message, sendOptions?: Options): Promise => { + const headers = requestHeaders( + sinkHeaders, message.headers, transportHeaders, headersFrom(sendOptions?.headers), + ); + const response = await fetch(url, { + ...fetchOptions, + headers, + body: message.body as BodyInit, + }); + return { response, body: await response.text() }; + }; +} + +/** + * Check that the sink is a URL this transport knows how to POST to + * * @param {string|URL} sink the destination endpoint for the event - * @returns {TransportFunction} a function which can be used to send CloudEvents to _sink_ + * @returns {URL} the parsed sink */ -export function httpTransport(sink: string | URL): TransportFunction { +function validateHTTPURL(sink: string | URL): URL { const url = new URL(sink); - let base: any; - if (url.protocol === "https:") { - base = https; - } else if (url.protocol === "http:") { - base = http; - } else { + if (url.protocol !== "http:" && url.protocol !== "https:") { throw new TypeError(`unsupported protocol ${url.protocol}`); } - return function(message: Message, options?: Options): Promise { - return new Promise((resolve, reject) => { - options = { ...options }; - - // TODO: Callers should be able to set any Node.js RequestOptions - const opts: RequestOptions = { - method: "POST", - headers: {...message.headers, ...options.headers as OutgoingHttpHeaders}, - }; - try { - const response = { - body: "", - headers: {}, - }; - const req = base.request(url, opts, (res: Socket) => { - res.setEncoding("utf-8"); - response.headers = (res as any).headers; - res.on("data", (chunk) => response.body += chunk); - res.on("end", () => { resolve(response); }); - }); - req.on("error", reject); - req.write(message.body); - req.end(); - } catch (err) { - reject(err); - } - }); - }; + return url; +} + +/** + * Merge the headers for a single request + * + * @param {Headers} sinkHeaders the headers built from the sink URL, if it carried credentials + * @param {CloudEventHeaders} messageHeaders the headers of the event Message + * @param {Headers} transportHeaders the headers configured on this transport, if any + * @param {Headers} sendHeaders the headers supplied with this send, if any + * @returns {Headers} the headers to send + */ +function requestHeaders( + sinkHeaders: Headers | undefined, messageHeaders: CloudEventHeaders, + transportHeaders?: Headers, sendHeaders?: Headers, +): Headers { + const headers = new Headers(); + // lowest precedence first: sink credentials, binding, transport, this send + setHeaders(headers, sinkHeaders); + setHeaders(headers, messageHeaders); + setHeaders(headers, transportHeaders); + setHeaders(headers, sendHeaders); + return headers; +} + +/** + * Move the credentials of a sink URL into the header the old Node.js transport built, since + * Fetch refuses a URL that carries them + * + * @param {URL} url the sink URL, whose credentials are removed + * @returns {Headers|undefined} the authorization header, or undefined for a URL without credentials + */ +function credentialsFrom(url: URL): Headers | undefined { + if (url.username === "" && url.password === "") { + return undefined; + } + const userinfo = `${decodeCredential(url.username)}:${decodeCredential(url.password)}`; + url.username = ""; + url.password = ""; + return new Headers({ authorization: `Basic ${base64(userinfo)}` }); +} + +/** + * Read one percent-encoded credential of a sink URL, as urlToHttpOptions() did for the old + * transport + * + * @param {string} value the credential as the URL holds it + * @returns {string} the decoded credential + */ +function decodeCredential(value: string): string { + try { + return decodeURIComponent(value); + } catch { + throw new TypeError("sink credentials must be percent-encoded values"); + } +} + +/** + * Encode credentials as UTF-8 bytes, the way RFC 7617 and the old transport did, with APIs the + * browser bundle can use as well + * + * @param {string} value the credentials to encode + * @returns {string} the base64 form + */ +function base64(value: string): string { + const utf8 = new TextEncoder().encode(value); + return btoa(Array.from(utf8, (byte) => String.fromCharCode(byte)).join("")); +} + +/** + * Check the headers a caller supplied, either for this transport or for a single send + * + * Fetch does the conversion, so every form its `HeadersInit` accepts arrives intact, a + * `Headers` from another realm included. That leaves an untyped value to Fetch's own coercion, + * which is why a caller's array joins on "," while the array of a Message, normalized by + * {@linkcode headerValueFrom}, joins on ", " + * + * @param {unknown} source the headers supplied by the caller, if any + * @returns {Headers|undefined} the headers, or undefined when none were supplied + */ +function headersFrom(source: unknown): Headers | undefined { + if (source === undefined || source === null) { + return undefined; + } + return new Headers(source as FetchHeadersInit); +} + +/** + * Copy headers onto a target, replacing any that are already there + * + * @param {Headers} target the headers being built + * @param {CloudEventHeaders|Headers} source the headers to copy, undefined ones are ignored + * @returns {void} + */ +function setHeaders(target: Headers, source?: CloudEventHeaders | Headers): void { + if (source === undefined) { + return; + } + if (source instanceof Headers) { + source.forEach((value, name) => target.set(name, value)); + return; + } + for (const [name, value] of Object.entries(source as Record)) { + const headerValue = headerValueFrom(value); + if (headerValue !== undefined) { + target.set(name, headerValue); + } + } +} + +/** + * Read a header value, whatever form it arrived in + * + * @param {unknown} value the value to read + * @returns {string|undefined} the value to send, undefined for a header which is not to be sent + */ +function headerValueFrom(value: unknown): string | undefined { + if (value === undefined || value === null) { + return undefined; + } + // several values join; an absent one is skipped + if (Array.isArray(value)) { + const values = value.filter((item) => item !== undefined && item !== null); + return values.length > 0 ? values.join(", ") : undefined; + } + return String(value); } diff --git a/test/integration/emitter_factory_test.ts b/test/integration/emitter_factory_test.ts index 03b21832..50add810 100644 --- a/test/integration/emitter_factory_test.ts +++ b/test/integration/emitter_factory_test.ts @@ -11,7 +11,7 @@ import request from "superagent"; import got from "got"; import CONSTANTS from "../../src/constants"; -import { CloudEvent, HTTP, Message, Mode, Options, TransportFunction, emitterFor, httpTransport } +import { CloudEvent, HTTP, Message, Mode, Options, TransportFunction, emitterFor } from "../../src"; const DEFAULT_CE_CONTENT_TYPE = CONSTANTS.DEFAULT_CE_CONTENT_TYPE; @@ -108,8 +108,8 @@ describe("emitterFor() defaults", () => { }); }); -function setupMock(uri: string) { - nock(uri) +function setupMock() { + nock(sink) .post("/") .reply(function (uri: string, body: nock.Body) { // return the request body and the headers so they can be @@ -123,18 +123,7 @@ function setupMock(uri: string) { } describe("HTTP Transport Binding for emitterFactory", () => { - beforeEach(() => { setupMock(sink); }); - - describe("HTTPS builtin", () => { - testEmitterBinary(httpTransport(sink), "body"); - }); - - describe("HTTP builtin", () => { - setupMock("http://cloudevents.io"); - testEmitterBinary(httpTransport("http://cloudevents.io"), "body"); - setupMock("http://cloudevents.io"); - testEmitterStructured(httpTransport("http://cloudevents.io"), "body"); - }); + beforeEach(() => { setupMock(); }); describe("Axios", () => { testEmitterBinary(axiosEmitter, "data"); diff --git a/test/integration/http_transport_test.ts b/test/integration/http_transport_test.ts new file mode 100644 index 00000000..bdfb3b2e --- /dev/null +++ b/test/integration/http_transport_test.ts @@ -0,0 +1,423 @@ +/* + Copyright 2021 The CloudEvents Authors + SPDX-License-Identifier: Apache-2.0 +*/ + +import "mocha"; +import { rejects } from "assert"; +import { expect } from "chai"; +import { createServer, IncomingMessage, ServerResponse } from "http"; +import { AddressInfo } from "net"; +import { json, text } from "stream/consumers"; +import { runInNewContext } from "vm"; + +import { + CONSTANTS, FetchHeadersInit, FetchRequestInit, Headers as CloudEventHeaders, + Message, Mode, emitterFor, httpTransport, +} from "../../src"; +import { assertStructured, fixture } from "./emitter_factory_test"; + +type Handler = (request: IncomingMessage, response: ServerResponse) => void | Promise; + +// nock cannot intercept fetch, so these tests use a local server + +// a reserved port nothing serves +const UNREACHABLE_URL = "http://127.0.0.1:1"; + +// a sink which accepts every event, for tests that assert on the request rather than the response +const acceptEvent: Handler = (_request, response) => { + response.writeHead(204); + response.end(); +}; + +describe("Built-in HTTP transport", () => { + it("Sends a binary event and resolves with the response for 2xx", async () => { + let receivedBody: Record | undefined; + let receivedHeaders: IncomingMessage["headers"] | undefined; + + await withServer(async (request, response) => { + receivedHeaders = request.headers; + receivedBody = await json(request) as Record; + response.writeHead(202, { "x-request-id": "receipt-7" }); + response.end("accepted"); + }, async (url) => { + const emit = emitterFor(httpTransport(`${url}/events`)); + const { response, body } = await emit(fixture, { headers: { "x-request-id": "order-123" } }); + + expect(response.status).to.equal(202); + expect(response.headers.get("x-request-id")).to.equal("receipt-7"); + expect(response.bodyUsed).to.equal(true); + expect(body).to.equal("accepted"); + expect(receivedHeaders?.["x-request-id"]).to.equal("order-123"); + expect(receivedHeaders?.["content-type"]).to.equal(CONSTANTS.DEFAULT_CONTENT_TYPE); + expect(receivedHeaders?.["ce-id"]).to.equal(fixture.id); + expect(receivedHeaders?.["ce-specversion"]).to.equal(fixture.specversion); + expect(receivedHeaders?.["ce-type"]).to.equal(fixture.type); + expect(receivedHeaders?.["ce-source"]).to.equal(fixture.source); + // the extensions of the fixture become ce-* headers + expect(receivedHeaders?.["ce-lunch"]).to.equal(fixture.lunch); + expect(receivedHeaders?.["ce-supper"]).to.equal(fixture.supper); + // the binary binding serializes an extension holding a plain object as JSON + expect(receivedHeaders?.["ce-snack"]).to.equal(JSON.stringify(fixture.snack)); + expect(receivedBody?.lunchBreak).to.equal("noon"); + }); + }); + + it("Resolves with an empty body when the sink sends none", async () => { + await withServer(acceptEvent, async (url) => { + const emit = emitterFor(httpTransport(url)); + const { response, body } = await emit(fixture); + + expect(response.status).to.equal(204); + expect(body).to.equal(""); + }); + }); + + it("Sends to a sink given as a URL", async () => { + let receivedPath: string | undefined; + + await withServer((request, response) => { + receivedPath = request.url; + acceptEvent(request, response); + }, async (url) => { + const emit = emitterFor(httpTransport(new URL(`${url}/events`))); + const { response, body } = await emit(fixture); + + expect(response.status).to.equal(204); + expect(body).to.equal(""); + expect(receivedPath).to.equal("/events"); + }); + }); + + it("Sends a structured event", async () => { + let received: Record | undefined; + + await withServer(async (request, response) => { + received = { + ...await json(request) as Record, + ...request.headers, + }; + acceptEvent(request, response); + }, async (url) => { + const emit = emitterFor(httpTransport(url), { mode: Mode.STRUCTURED }); + await emit(fixture); + assertStructured(received as Record>); + }); + }); + + it("Keeps every value of a repeated response header", async () => { + await withServer((_request, response) => { + response.writeHead(202, { + "set-cookie": ["session=abc; Path=/", "tenant=store-42; Path=/"], + }); + response.end(); + }, async (url) => { + const emit = emitterFor(httpTransport(url)); + const { response } = await emit(fixture); + const headers = response.headers as Headers & { getSetCookie(): string[] }; + + expect(headers.getSetCookie()).to.deep.equal([ + "session=abc; Path=/", + "tenant=store-42; Path=/", + ]); + }); + }); + + it("Applies transport headers and lets per-send headers override them", async () => { + const { received: receivedHeaders, handler } = headerCollector(); + + await withServer(handler, async (url) => { + const emit = emitterFor(httpTransport(url, { + headers: new Headers({ + authorization: "Bearer transport-token", + "x-tenant-id": "store-42", + }), + })); + + await emit(fixture); + await emit(fixture, { + headers: { "x-tenant-id": "store-99", "x-request-id": "order-123" }, + }); + + expect(receivedHeaders[0]?.authorization).to.equal("Bearer transport-token"); + expect(receivedHeaders[0]?.["x-tenant-id"]).to.equal("store-42"); + expect(receivedHeaders[1]?.authorization).to.equal("Bearer transport-token"); + expect(receivedHeaders[1]?.["x-tenant-id"]).to.equal("store-99"); + expect(receivedHeaders[1]?.["x-request-id"]).to.equal("order-123"); + // a header neither layer set keeps the value the binding produced + expect(receivedHeaders[1]?.["ce-type"]).to.equal(fixture.type); + }); + }); + + it("Sends credentials from the sink URL as an authorization header", async () => { + const { received: receivedHeaders, handler } = headerCollector(); + + await withServer(handler, async (url) => { + const { host } = new URL(url); + const sendAs = (credentials: string) => emitterFor(httpTransport(`http://${credentials}@${host}`))(fixture); + + await sendAs("us%40er:p%40ss"); + await sendAs("user:p%C3%A4ss"); + await sendAs("user"); + // anything the caller sets wins + await emitterFor(httpTransport(`http://user:pass@${host}`, { + headers: { authorization: "Bearer transport-token" }, + }))(fixture); + await emitterFor(httpTransport(`http://user:pass@${host}`))(fixture, { + headers: { authorization: "Bearer per-send-token" }, + }); + + // the credentials are percent-decoded, as the old transport decoded them + expect(receivedHeaders[0]?.authorization).to.equal("Basic dXNAZXI6cEBzcw=="); + // non-ASCII credentials are encoded as UTF-8 + expect(receivedHeaders[1]?.authorization).to.equal("Basic dXNlcjpww6Rzcw=="); + // a URL may carry a user without a password + expect(receivedHeaders[2]?.authorization).to.equal("Basic dXNlcjo="); + expect(receivedHeaders[3]?.authorization).to.equal("Bearer transport-token"); + expect(receivedHeaders[4]?.authorization).to.equal("Bearer per-send-token"); + }); + }); + + it("Accepts Fetch header forms without losing their contents", async () => { + const { received: receivedHeaders, handler } = headerCollector(); + const foreignHeaders = withForeignInterfacePrototype(new Headers({ "x-realm": "foreign" })); + expect(foreignHeaders).not.to.be.instanceOf(Headers); + const headerForms: Array<{ headers: FetchHeadersInit; name: string; value: string }> = [ + { headers: new Headers({ "x-headers": "native" }), name: "x-headers", value: "native" }, + { + headers: [["x-tuple", "store-42"], ["x-tuple", "store-99"]], + name: "x-tuple", + value: "store-42, store-99", + }, + { + headers: runInNewContext("({ 'x-record': 'another-realm' })") as FetchHeadersInit, + name: "x-record", + value: "another-realm", + }, + { headers: foreignHeaders, name: "x-realm", value: "foreign" }, + { + // Map is accepted by native Headers at runtime, although it is not in TypeScript's HeadersInit + headers: new Map([["x-map", "native"]]) as unknown as FetchHeadersInit, + name: "x-map", + value: "native", + }, + ]; + + await withServer(handler, async (url) => { + const emit = emitterFor(httpTransport(url)); + + for (const { headers } of headerForms) { + await emit(fixture, { headers }); + } + + headerForms.forEach(({ name, value }, index) => { + expect(receivedHeaders[index]?.[name]).to.equal(value); + }); + }); + }); + + it("Reads Message headers the same way as caller headers", async () => { + const { received: receivedHeaders, handler } = headerCollector(); + + await withServer(handler, async (url) => { + const send = httpTransport(url); + const message: Message = { + headers: { + "content-type": "application/json", + "x-tenant-id": null as unknown as string, + "x-request-id": ["order-123", "order-456"], + }, + body: `{"lunchBreak":"noon"}`, + }; + + await send(message); + await send({ + headers: new Headers({ "x-request-id": "native-headers" }) as unknown as CloudEventHeaders, + body: "event", + }); + + // a null value is skipped rather than sent as the string "null" + expect(receivedHeaders[0]?.["x-tenant-id"]).to.equal(undefined); + expect(receivedHeaders[0]?.["x-request-id"]).to.equal("order-123, order-456"); + expect(receivedHeaders[1]?.["x-request-id"]).to.equal("native-headers"); + }); + }); + + it("Passes standard Fetch options to fetch", async () => { + let receivedOptions: FetchRequestInit | undefined; + + await withFetch(async (_input, options) => { + receivedOptions = options; + return new Response(null, { status: 204 }); + }, async () => { + const emit = emitterFor(httpTransport("https://events.example.com/orders", { + fetchOptions: { + cache: "no-store", + credentials: "include", + redirect: "error", + }, + })); + await emit(fixture); + }); + + expect(receivedOptions?.cache).to.equal("no-store"); + expect(receivedOptions?.credentials).to.equal("include"); + expect(receivedOptions?.redirect).to.equal("error"); + expect(receivedOptions?.method).to.equal("POST"); + }); + + it("Keeps the manual redirect when fetchOptions leaves redirect undefined", async () => { + let receivedOptions: FetchRequestInit | undefined; + + await withFetch(async (_input, options) => { + receivedOptions = options; + return new Response(null, { status: 204 }); + }, async () => { + const emit = emitterFor(httpTransport("https://events.example.com/orders", { + // fetch reads an explicitly undefined redirect as absent, which would follow redirects + fetchOptions: { redirect: undefined }, + })); + await emit(fixture); + }); + + expect(receivedOptions?.redirect).to.equal("manual"); + }); + + // Fetch keeps POST only for 307 and 308, the others become a bodyless GET + for (const { statusCode, method, keepsBody } of [ + { statusCode: 301, method: "GET", keepsBody: false }, + { statusCode: 302, method: "GET", keepsBody: false }, + { statusCode: 303, method: "GET", keepsBody: false }, + { statusCode: 307, method: "POST", keepsBody: true }, + { statusCode: 308, method: "POST", keepsBody: true }, + ]) { + it(`Follows ${statusCode} with Fetch semantics when redirect is "follow"`, async () => { + let originalBody = ""; + let redirectedBody = "not received"; + let redirectedMethod: string | undefined; + + await withServer(async (request, response) => { + if (request.url === "/target") { + redirectedMethod = request.method; + redirectedBody = await text(request); + response.writeHead(204); + } else { + originalBody = await text(request); + response.writeHead(statusCode, { location: "/target" }); + } + response.end(); + }, async (url) => { + const emit = emitterFor(httpTransport(`${url}/start`, { + fetchOptions: { redirect: "follow" }, + })); + const { response, body } = await emit(fixture); + + expect(redirectedMethod).to.equal(method); + expect(redirectedBody).to.equal(keepsBody ? originalBody : ""); + expect(response.url).to.equal(`${url}/target`); + expect(body).to.equal(""); + }); + }); + } + + for (const statusCode of [400, 503]) { + it(`Resolves a ${statusCode} response without retrying it`, async () => { + let requestCount = 0; + await withServer((_request, response) => { + requestCount++; + response.writeHead(statusCode); + response.end("rejected"); + }, async (url) => { + const result = await emitterFor(httpTransport(url))(fixture); + expect(result.response.status).to.equal(statusCode); + expect(result.body).to.equal("rejected"); + expect(requestCount).to.equal(1); + }); + }); + } + + it("Rejects a per-send header that is not a valid header", async () => { + const emit = emitterFor(httpTransport(UNREACHABLE_URL)); + // a TypeError, since nothing was sent + await rejects(emit(fixture, { headers: { "invalid header": "value" } }), TypeError); + }); + + it("Uses native Fetch coercion for untyped header values", async () => { + const legacyHeaders: CloudEventHeaders = { "x-tenant-id": ["store-42", "store-99"] }; + + await withServer((request, response) => { + expect(request.headers["x-tenant-id"]).to.equal("store-42,store-99"); + acceptEvent(request, response); + }, async (url) => { + const emit = emitterFor(httpTransport(url)); + await emit(fixture, { + + headers: legacyHeaders, + }); + }); + }); + + it("Validates the sink and transport options when the transport is created", () => { + expect(() => httpTransport("not a URL")).to.throw(TypeError); + expect(() => httpTransport("ftp://events.example.com")).to.throw(TypeError, "unsupported protocol ftp:"); + expect(() => httpTransport("https://a%zz@events.example.com")) + .to.throw(TypeError, "sink credentials must be percent-encoded values"); + expect(() => httpTransport("https://events.example.com", { + headers: { "invalid header": "value" }, + })).to.throw(TypeError); + expect(() => httpTransport("https://events.example.com", { + headers: new Headers({ "x-tenant-id": "store-42" }), + })).not.to.throw(); + }); +}); + +// Model a platform object from another realm: same behavior, different instanceof chain. +function withForeignInterfacePrototype(value: T): T { + const interfacePrototype = Object.getPrototypeOf(value); + const foreignPrototype = Object.create(Object.getPrototypeOf(interfacePrototype)); + Object.defineProperties(foreignPrototype, Object.getOwnPropertyDescriptors(interfacePrototype)); + Object.setPrototypeOf(value, foreignPrototype); + return value; +} + +// A sink which records the headers of every event it accepts. +function headerCollector(): { received: IncomingMessage["headers"][]; handler: Handler } { + const received: IncomingMessage["headers"][] = []; + return { + received, + handler: (request, response) => { + received.push(request.headers); + acceptEvent(request, response); + }, + }; +} + +async function withFetch(stub: typeof globalThis.fetch, run: () => Promise): Promise { + const originalFetch = globalThis.fetch; + globalThis.fetch = stub; + + try { + await run(); + } finally { + globalThis.fetch = originalFetch; + } +} + +export async function withServer(handler: Handler, run: (url: string) => Promise): Promise { + const server = createServer((request, response) => { + Promise.resolve(handler(request, response)).catch((error) => { + response.destroy(error); + }); + }); + await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve)); + const { port } = server.address() as AddressInfo; + + try { + await run(`http://127.0.0.1:${port}`); + } finally { + await new Promise((resolve, reject) => { + server.close((error) => error ? reject(error) : resolve()); + server.closeAllConnections(); + }); + } +} diff --git a/webpack.config.js b/webpack.config.js index 1894ee50..d35f024b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -7,9 +7,7 @@ module.exports = { }, resolve: { fallback: { - util: require.resolve("util/"), - http: false, - https: false + util: require.resolve("util/") }, }, plugins: [ From c360009efbdc8dabf6d170f442a93368fcd1f8ca Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Tue, 13 Oct 2026 13:21:26 +0900 Subject: [PATCH 20/26] feat!: report HTTP delivery failures and typed response bodies Signed-off-by: kahirokunn --- API_TRANSITION_GUIDE.md | 107 +++++++++- README.md | 109 ++++++++-- src/index.ts | 19 +- src/transport/emitter.ts | 34 +++- src/transport/http/index.ts | 240 ++++++++++++++++++++--- test/integration/emitter_factory_test.ts | 16 +- test/integration/http_transport_test.ts | 214 ++++++++++++++++++-- 7 files changed, 661 insertions(+), 78 deletions(-) diff --git a/API_TRANSITION_GUIDE.md b/API_TRANSITION_GUIDE.md index 7e98e83e..78ab76b5 100644 --- a/API_TRANSITION_GUIDE.md +++ b/API_TRANSITION_GUIDE.md @@ -105,16 +105,81 @@ new CloudEvent({ type, source, data }).emit(); ### Upgrading From 10.x to 11.0 +In the 11.0.0 release, the built-in HTTP transport was rewritten on top of the Fetch API. + #### HTTP Transport -`httpTransport()` uses Fetch and resolves with `{ response, body }`, where -`response` is the native Fetch `Response` and `body` is its text, instead of -`{ body, headers }`. Access headers through `response.headers.get(name)` and -the status through `response.status`. +`httpTransport()` used to resolve with the response for every status code, so a receiver +that rejected an event looked just like one that accepted it. + +```js +import { CloudEvent, emitterFor, httpTransport } from "cloudevents"; + +const emit = emitterFor(httpTransport("https://my.receiver.com/endpoint")); + +// resolved with { body, headers } whether the receiver returned 202 or 503 +const response = await emit(new CloudEvent({ type, source, data })); +``` + +A 2xx response now resolves with the native Fetch `Response` and its body as text, and +anything else rejects with an `HTTPTransportError`. + +```js +import { + CloudEvent, + emitterFor, + HTTPTransportError, + httpTransport, +} from "cloudevents"; + +const emit = emitterFor(httpTransport("https://my.receiver.com/endpoint")); + +try { + const { response, body } = await emit(new CloudEvent({ type, source, data })); + console.log(response.status, body); +} catch (error) { + if (error instanceof HTTPTransportError) { + console.error(error.kind, error.response?.status); + } + throw error; +} +``` + +The transport takes a second argument now, for headers, how the response body +is read and, under `fetchOptions`, the other Fetch options. Its headers are Fetch header +forms, so a `string[]` value becomes a `Headers` you `append()` to. A redirect is a +failed send unless `fetchOptions: { redirect: "follow" }` says otherwise, and a body +that cannot be read after a 2xx resolves with `bodyError` in place of `body`. +```js +const headers = new Headers(); +headers.append("accept", "application/cloudevents+json"); +headers.append("accept", "application/json"); +await emit(new CloudEvent({ type, source, data }), { headers }); +``` + +#### The Emitter Singleton + +A listener registered with `Emitter.on("cloudevent", emit)` now returns a promise which +rejects for a receiver that did not accept the event. `emitEvent()` awaits those promises +by default, so the rejection reaches whoever called `emit()` on the event: ```js -const { response, body } = await emit(event); -console.log(response.status, response.headers.get("x-request-id"), body); +try { + await new CloudEvent({ type, source, data }).emit(); +} catch (error) { + console.error(error.kind, error.response?.status); +} +``` + +With `ensureDelivery` turned off, the listeners run through `EventEmitter`, which discards +what they return. A rejection there becomes an unhandled promise rejection, which a `503` +could not produce before. Leave `ensureDelivery` alone, or catch inside the listener: + +```js +Emitter.on("cloudevent", (event) => emit(event).catch(reportFailedDelivery)); + +// listeners are not awaited, so nothing else can catch what they reject with +new CloudEvent({ type, source, data }).emit(false); ``` #### Proxies, Custom CAs, mTLS and Connection Pooling @@ -167,3 +232,33 @@ project, so TypeScript accepts `dispatcher` only where those are undici's. Again DOM `RequestInit` most projects compile with, pass it as `fetchOptions: { dispatcher } as FetchRequestInit` or reach for `setGlobalDispatcher()` instead. + +#### Emitter Options + +`Options` now declares `headers` instead of leaving it to an index +signature that resolved to `unknown`. Its default header type remains the +CloudEvent header record used by custom transports. The emitter returned from +`httpTransport()` specializes it to `FetchHeadersInit`. + +TypeScript now rejects spreading custom transport options into a client +configuration that types its own `headers`: + +```ts +// merge the headers of one send over the ones the binding produced +function sendWithAxios(message: Message, options?: Options) { + const { headers, ...rest } = options ?? {}; + return axios.post(url, message.body, { + headers: { ...message.headers, ...headers } as AxiosRequestHeaders, + ...rest, + }); +} +``` + +It also rejects the generic types as annotations for the built-in transport, whose +options are narrower. Use `HTTPTransportFunction` and `HTTPEmitterFunction`, or leave +the types to inference: + +```ts +const transport: HTTPTransportFunction = httpTransport(sink); +const emit: HTTPEmitterFunction = emitterFor(transport); +``` diff --git a/README.md b/README.md index bdfaa6bf..9f6eba48 100644 --- a/README.md +++ b/README.md @@ -72,18 +72,74 @@ async function main() { main().catch(console.error); ``` -The transport resolves with the native Fetch `Response` and its body as text -for every HTTP status. It sends each event once. Redirects are not followed -unless `fetchOptions: { redirect: "follow" }` enables them; Fetch preserves the -CloudEvent POST and its body only for `307` and `308`. +A 2xx response resolves with the native Fetch `Response` and its body, read as +text by default. Anything else rejects with an `HTTPTransportError`, whose +`kind` separates a response that was not 2xx from a request that never reached +a response. -`httpTransport()` accepts transport-wide `headers` and other Fetch options under -`fetchOptions`. Headers passed to `emit()` apply to that event only and take -precedence over transport and CloudEvent headers. URL credentials become an -authorization header unless the caller overrides it. +The body of a response that was not 2xx is on the error as `error.body`. +`error.response` cannot be read a second time. If reading the body failed, +`error.body` is absent and the error carries a `cause`. -See the [API transition guide](./API_TRANSITION_GUIDE.md) for response access and -Node.js proxy, certificate and connection settings. +```js +import { HTTPTransportError } from "cloudevents"; + +async function main() { + try { + await emit(ce); + } catch (error) { + if (error instanceof HTTPTransportError) { + console.error(error.kind, error.response?.status, error.body); + } + throw error; + } +} + +main().catch(console.error); +``` + +`httpTransport()` also takes headers for every event, a `responseHandler` to read +the body another way (or `httpDiscardResponseHandler` to skip it), and the other +Fetch options under `fetchOptions`. Headers passed to `emit()` apply to that +event only. A response handler passed with an event overrides the transport's +handler, and its return value determines the response body type. + +```js +const emit = emitterFor(httpTransport("https://my.receiver.com/endpoint", { + headers: { authorization: `Bearer ${process.env.RECEIVER_TOKEN}` }, + responseHandler: (response) => response.json(), +})); +``` + +A 2xx response means the receiver accepted the event, so a body that cannot be +read resolves with `{ response, bodyError }` in place of `{ response, body }`. +Only one of the two is present. Check which property the result has before using +it: + +```js +async function main() { + const result = await emit(ce); + if ("body" in result) { + console.log(result.body); + } else { + console.error(result.bodyError); + } +} + +main().catch(console.error); +``` + +Redirects are not followed by default, so each one is reported as a failed send. +On Node.js the `HTTPTransportError` carries the 3xx response; a browser returns +an opaque redirect instead, so `error.response.status` is `0` and the `location` +header cannot be read. Set `fetchOptions: { redirect: "follow" }` to follow +them, keeping in mind that Fetch preserves the CloudEvent POST and its body only +for `307` and `308` - it turns a `301`, `302` or `303` into a bodyless `GET`, +which drops the event. + +The [API transition guide](./API_TRANSITION_GUIDE.md) covers the header forms +the transport accepts and where a proxy or a custom CA goes now that +`http.globalAgent` no longer applies. If you prefer to use another transport mechanism for sending events over HTTP, you can use the `HTTP` binding to create a `Message` which @@ -140,20 +196,31 @@ import { Mode, } from "cloudevents"; -// Create a CloudEvent emitter function to send events to our receiver -const emit = emitterFor(httpTransport("https://example.com/receiver")); - -// Use the emit() function to send a CloudEvent to its endpoint when a "cloudevent" event is emitted -// (see: https://nodejs.org/api/events.html#class-eventemitter) -Emitter.on("cloudevent", emit); - -... -// In any part of the code, calling `emit()` on a `CloudEvent` instance will send the event -new CloudEvent({ type, source, data }).emit(); +async function main() { + // Create a CloudEvent emitter function to send events to our receiver + const emit = emitterFor(httpTransport("https://example.com/receiver")); + + // Use the emit() function to send a CloudEvent to its endpoint when a + // "cloudevent" event is emitted + // (see: https://nodejs.org/api/events.html#class-eventemitter) + Emitter.on("cloudevent", emit); + + // Calling emit() on a CloudEvent instance sends it through every listener + await new CloudEvent({ + type: "com.example.order.created", + source: "/stores/store-42", + data: { orderId: "order-123" }, + }).emit(); +} -// You can also have several listeners to send the event to several endpoints +main().catch(console.error); ``` +You can also have several listeners to send the event to several endpoints. +`emit()` waits for all of them, and an endpoint which refuses the event fails +the whole call. See the [API transition guide](./API_TRANSITION_GUIDE.md) for +the details. + ## CloudEvent Objects All created `CloudEvent` objects are read-only. If you need to update a property or add a new extension to an existing cloud event object, you can use the `cloneWith` method. This will return a new `CloudEvent` with any update or new properties. For example: diff --git a/src/index.ts b/src/index.ts index 3c3d5bcd..df586fc3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,12 +8,13 @@ import { ValidationError } from "./event/validation"; import { CloudEventV1, CloudEventV1Attributes } from "./event/interfaces"; import { - Options, TransportFunction, EmitterFunction, emitterFor, Emitter, + Options, TransportFunction, EmitterFunction, HTTPEmitterFunction, emitterFor, Emitter, } from "./transport/emitter"; import { - FetchHeadersInit, FetchRequestInit, HTTPTransportFunction, HTTPTransportOptions, - HTTPTransportResponse, httpTransport, -} from "./transport/http"; + FetchHeadersInit, FetchRequestInit, HTTPResponseHandler, HTTPTransportError, + HTTPTransportErrorDetails, HTTPTransportErrorKind, + HTTPTransportFunction, HTTPTransportOptions, HTTPTransportResponse, HTTPTransportSendOptions, + httpDiscardResponseHandler, httpTextResponseHandler, httpTransport } from "./transport/http"; import { Headers, Mode, Binding, HTTP, Kafka, KafkaEvent, KafkaMessage, Message, MQTT, MQTTMessage, MQTTMessageFactory, Serializer, Deserializer } from "./message"; @@ -34,6 +35,9 @@ export { // From transport emitterFor, httpTransport, + httpTextResponseHandler, + httpDiscardResponseHandler, + HTTPTransportError, Emitter, // From Constants CONSTANTS @@ -54,10 +58,15 @@ export type { // From transport TransportFunction, EmitterFunction, + HTTPEmitterFunction, Options, FetchHeadersInit, FetchRequestInit, + HTTPResponseHandler, + HTTPTransportErrorDetails, + HTTPTransportErrorKind, HTTPTransportFunction, HTTPTransportOptions, - HTTPTransportResponse + HTTPTransportResponse, + HTTPTransportSendOptions }; diff --git a/src/transport/emitter.ts b/src/transport/emitter.ts index 7ddaf7d3..f2c854a0 100644 --- a/src/transport/emitter.ts +++ b/src/transport/emitter.ts @@ -4,15 +4,20 @@ */ import { CloudEvent } from "../event/cloudevent"; -import { HTTP, Message, Mode } from "../message"; +import { Headers as CloudEventHeaders, HTTP, Message, Mode } from "../message"; import { EventEmitter } from "events"; +import type { + FetchHeadersInit, HTTPTransportFunction, HTTPTransportResponse, HTTPTransportSendOptions, +} from "./http"; /** * Options is an additional, optional dictionary of options that may * be passed to an EmitterFunction and TransportFunction * @interface */ -export interface Options { +export interface Options { + /** Headers for this send, taking precedence over the ones the binding produced */ + headers?: THeaders; [key: string]: string | Record | unknown; } @@ -27,6 +32,17 @@ export interface EmitterFunction { (event: CloudEvent, options?: TOptions): Promise; } +/** + * An emitter backed by the built-in HTTP transport. A response handler passed with one event + * determines the body type for that call; otherwise the transport's default body type is used. + */ +export interface HTTPEmitterFunction + extends EmitterFunction, Options> { + ( + event: CloudEvent, options: HTTPTransportSendOptions, + ): Promise>; +} + /** * TransportFunction is an invokable interface provided to the emitterFactory. * A TransportFunction's responsiblity is to send a JSON encoded event Message @@ -39,6 +55,20 @@ export interface TransportFunction { } const emitterDefaults: Options = { binding: HTTP, mode: Mode.BINARY }; +/** + * Creates and returns an {@linkcode HTTPEmitterFunction} using the built-in HTTP + * transport returned by `httpTransport()`. The returned function converts a + * {@linkcode CloudEvent} into a {@linkcode Message} the same way the generic overload + * below does, and resolves with what the sink sent back, or rejects with an + * `HTTPTransportError`. + * + * @param {HTTPTransportFunction} fn the built-in HTTP transport to send events with + * @param { {Binding, Mode} } options network binding and message serialization options + * @returns {HTTPEmitterFunction} an emitter which resolves with the sink's response + */ +export function emitterFor( + fn: HTTPTransportFunction, options?: Options, +): HTTPEmitterFunction; /** * Creates and returns an {@linkcode EmitterFunction} using the supplied * {@linkcode TransportFunction}. The returned {@linkcode EmitterFunction} diff --git a/src/transport/http/index.ts b/src/transport/http/index.ts index 1b5e9604..404e9427 100644 --- a/src/transport/http/index.ts +++ b/src/transport/http/index.ts @@ -12,40 +12,152 @@ export type FetchRequestInit = NonNullable[1 /** The header forms accepted by the Fetch implementation in the current environment */ export type FetchHeadersInit = NonNullable; -/** Options applied to every request sent by an HTTP transport */ -export interface HTTPTransportOptions { +/** Turns a Fetch response into the body value handed back by the HTTP transport */ +export type HTTPResponseHandler = (response: Response) => Promise; + +/** + * Read a response body as text, the default behavior of the HTTP transport + * + * @param {Response} response the response whose body should be read + * @returns {Promise} the response body as text + */ +export function httpTextResponseHandler(response: Response): Promise { + return response.text(); +} + +/** + * Discard a response body when the caller only needs the response metadata + * + * @param {Response} response the response whose body should be discarded + * @returns {Promise} completion after the body has been cancelled + */ +export async function httpDiscardResponseHandler(response: Response): Promise { + await response.body?.cancel(); +} + +/** + * Options applied to every request sent by an HTTP transport + */ +export interface HTTPTransportOptions { /** HTTP headers applied to every request, per-send headers take precedence */ headers?: FetchHeadersInit; /** Fetch options applied to every request, apart from the ones this transport controls */ fetchOptions?: Omit; + /** Reads every response body; defaults to {@linkcode httpTextResponseHandler} */ + responseHandler?: HTTPResponseHandler; } -/** The native Fetch response and its body, read as text */ -export interface HTTPTransportResponse { - response: Response; - body: string; +/** + * Options which replace the response handler for one send + */ +export interface HTTPTransportSendOptions extends Options { + /** Reads this response body instead of the handler configured for the transport */ + responseHandler: HTTPResponseHandler; } -/** A transport that returns an HTTP response */ -export type HTTPTransportFunction = TransportFunction; +/** What the built-in HTTP transport hands back for a send the sink accepted */ +export type HTTPTransportResponse = + | { + /** The native Fetch response, whose body has been handled */ + response: Response; + /** What the configured response handler returned */ + body: TBody; + bodyError?: never; + } + | { + /** The native Fetch response, whose status is still a successful 2xx */ + response: Response; + body?: never; + /** What the response handler threw after the sink accepted the event */ + bodyError: unknown; + }; /** - * Send an HTTP-bound CloudEvent with Fetch. The transport sends once and resolves with - * the native response and its body as text, for every HTTP status. Redirects are not - * followed unless fetchOptions.redirect enables them. Credentials in the sink URL become - * an authorization header, overridden by transport or per-send headers. + * An HTTP transport whose default response body type can be replaced for one send + */ +export interface HTTPTransportFunction + extends TransportFunction, Options> { + (message: Message, options: HTTPTransportSendOptions): Promise>; +} + +/** The result of attempting to handle a response body */ +type HandledResponse = + | { handled: true; body: unknown } + | { handled: false; error: unknown }; + +/** + * The failure category reported by {@linkcode HTTPTransportError} + * + * - `http-status`: the sink returned a response that was not 2xx + * - `network`: the request never produced a response, e.g. DNS, connection, or TLS failure + */ +export type HTTPTransportErrorKind = "http-status" | "network"; + +/** + * What an {@linkcode HTTPTransportError} reports alongside its {@linkcode HTTPTransportErrorKind} + */ +export type HTTPTransportErrorDetails = Pick; + +/** + * A request failure reported by the built-in HTTP transport + */ +export class HTTPTransportError extends Error { + /** The failure category */ + readonly kind: HTTPTransportErrorKind; + /** The response the sink sent, present only for `http-status` */ + readonly response?: Response; + /** What the response handler returned, present when it succeeded for `http-status` */ + readonly body?: unknown; + /** The underlying Fetch or response handler failure */ + readonly cause?: unknown; + + constructor(kind: HTTPTransportErrorKind, details: HTTPTransportErrorDetails = {}) { + super(errorMessage(kind, details)); + this.name = "HTTPTransportError"; + this.kind = kind; + this.response = details.response; + this.body = details.body; + this.cause = details.cause; + } +} + +/** + * httpTransport provides a simple HTTP Transport function, which can send a CloudEvent, + * encoded as a Message to the endpoint. The returned function can be used with emitterFor() + * to provide an event emitter, for example: + * + * ```js + * const emit = emitterFor(httpTransport("http://example.com")); + * emit(myCloudEvent) + * .then(({ response, body }) => console.log(response.status, body)) + * .catch(err => console.error(err.kind, err.response?.status)); + * ``` + * + * The event is sent once, without retries. A response that is not 2xx rejects with an + * {@linkcode HTTPTransportError} holding the response the sink sent back. Redirects are + * reported as errors unless `fetchOptions.redirect` says otherwise, since Fetch keeps the + * CloudEvent POST only for 307 and 308 - see the README for the details. + * + * Every response body is passed to the configured response handler. It is read as text by + * default; a handler passed with one send takes precedence over the transport's handler. + * A handler may also return `response.body` to hand the stream to the caller, who then + * has to cancel it if it is not read to the end. + * + * Credentials in _sink_ are sent as an `authorization` header, which the `headers` option + * and the headers of one send override. * * @param {string|URL} sink the destination endpoint for the event - * @param {HTTPTransportOptions} options headers and Fetch request options - * @returns {HTTPTransportFunction} a function that sends CloudEvents to the sink + * @param {HTTPTransportOptions} options headers, Fetch options and response behavior + * @returns {HTTPTransportFunction} a function that sends CloudEvents to _sink_ */ -export function httpTransport( - sink: string | URL, options: HTTPTransportOptions = {}, -): HTTPTransportFunction { +export function httpTransport( + sink: string | URL, options: HTTPTransportOptions = {}, +): HTTPTransportFunction { const url = validateHTTPURL(sink); // fetch refuses a URL with credentials const sinkHeaders = credentialsFrom(url); const transportHeaders = headersFrom(options.headers); + const transportResponseHandler = responseHandlerFrom(options.responseHandler, httpTextResponseHandler); const fetchOptions: FetchRequestInit = { ...options.fetchOptions, // fetch reads an explicitly undefined redirect as absent, so the default comes last @@ -53,17 +165,81 @@ export function httpTransport( method: "POST", }; - return async (message: Message, sendOptions?: Options): Promise => { + const send = async ( + message: Message, sendOptions?: Options, + ): Promise> => { const headers = requestHeaders( sinkHeaders, message.headers, transportHeaders, headersFrom(sendOptions?.headers), ); - const response = await fetch(url, { - ...fetchOptions, - headers, - body: message.body as BodyInit, - }); - return { response, body: await response.text() }; + const responseHandler = responseHandlerFrom(sendOptions?.responseHandler, transportResponseHandler); + let response: Response; + try { + response = await fetch(url, { + ...fetchOptions, + headers, + body: message.body as BodyInit, + }); + } catch (cause) { + throw new HTTPTransportError("network", { cause }); + } + + const handled = await handleResponse(response, responseHandler); + if (!response.ok) { + // the status is the failure; the handler result or error goes alongside it + throw new HTTPTransportError("http-status", handled.handled + ? { response, body: handled.body } + : { response, cause: handled.error }); + } + return handled.handled + ? { response, body: handled.body } + : { response, bodyError: handled.error }; }; + + // the overloads type the per-send handler this implementation cannot + return send as HTTPTransportFunction; +} + +/** + * Check a response handler and fall back to the handler from the enclosing transport + * + * @param {unknown} value the handler supplied at this layer, if any + * @param {HTTPResponseHandler} fallback the handler inherited from the transport or default + * @returns {HTTPResponseHandler} the handler to run + */ +function responseHandlerFrom( + value: unknown, fallback: HTTPResponseHandler, +): HTTPResponseHandler { + if (value === undefined || value === null) { + return fallback; + } + if (typeof value !== "function") { + throw new TypeError("options.responseHandler must be a function"); + } + return value as HTTPResponseHandler; +} + +/** + * Run the caller's response handler. A handler that resolves may leave its body unread on + * purpose; one that throws has the rest of its body cancelled, so a failed send does not + * hold a connection open. + * + * @param {Response} response the response to handle + * @param {HTTPResponseHandler} handler the selected handler + * @returns {HandledResponse} the handler's body value or thrown error + */ +async function handleResponse( + response: Response, handler: HTTPResponseHandler, +): Promise { + try { + return { handled: true, body: await handler(response) }; + } catch (error) { + try { + await httpDiscardResponseHandler(response); + } catch { + // best effort cleanup + } + return { handled: false, error }; + } } /** @@ -204,3 +380,19 @@ function headerValueFrom(value: unknown): string | undefined { } return String(value); } + +/** + * Build the message for an {@linkcode HTTPTransportError} + * + * @param {HTTPTransportErrorKind} kind the failure category + * @param {HTTPTransportErrorDetails} details what is known about the failure + * @returns {string} the error message + */ +function errorMessage(kind: HTTPTransportErrorKind, details: HTTPTransportErrorDetails): string { + switch (kind) { + case "http-status": + return `HTTP transport received a non-2xx response: ${details.response?.status}`; + default: + return "HTTP transport request failed"; + } +} diff --git a/test/integration/emitter_factory_test.ts b/test/integration/emitter_factory_test.ts index 50add810..24802734 100644 --- a/test/integration/emitter_factory_test.ts +++ b/test/integration/emitter_factory_test.ts @@ -11,8 +11,7 @@ import request from "superagent"; import got from "got"; import CONSTANTS from "../../src/constants"; -import { CloudEvent, HTTP, Message, Mode, Options, TransportFunction, emitterFor } - from "../../src"; +import { CloudEvent, HTTP, Message, Mode, Options, TransportFunction, emitterFor } from "../../src"; const DEFAULT_CE_CONTENT_TYPE = CONSTANTS.DEFAULT_CE_CONTENT_TYPE; const sink = "https://cloudevents.io/"; @@ -46,7 +45,9 @@ function axiosEmitter(message: Message, options?: Options): Promise { for (const [name, value] of Object.entries(message.headers)) { headers[name] = typeof value === "string" ? value : JSON.stringify(value); } - return axios.post(sink, message.body, { headers, ...options }); + // per-send headers are merged over the ones the binding produced + const { headers: sendHeaders, ...rest } = options ?? {}; + return axios.post(sink, message.body, { headers: { ...headers, ...sendHeaders }, ...rest }); } function superagentEmitter(message: Message, options?: Options): Promise { @@ -73,6 +74,15 @@ function gotEmitter(message: Message, options?: Options): Promise { } describe("emitterFor() defaults", () => { + it("Keeps CloudEvent header arrays in custom transport options", async () => { + const transport: TransportFunction = async (_message, options) => { + expect(options?.headers?.["x-tenant-id"]).to.deep.equal(["store-42", "store-99"]); + }; + const emit = emitterFor(transport); + + await emit(fixture, { headers: { "x-tenant-id": ["store-42", "store-99"] } }); + }); + it("Defaults to HTTP binding, binary mode", () => { function transport(message: Message): Promise { // A binary message will have the source attribute as a header diff --git a/test/integration/http_transport_test.ts b/test/integration/http_transport_test.ts index bdfb3b2e..e86213ae 100644 --- a/test/integration/http_transport_test.ts +++ b/test/integration/http_transport_test.ts @@ -12,8 +12,8 @@ import { json, text } from "stream/consumers"; import { runInNewContext } from "vm"; import { - CONSTANTS, FetchHeadersInit, FetchRequestInit, Headers as CloudEventHeaders, - Message, Mode, emitterFor, httpTransport, + CONSTANTS, FetchHeadersInit, FetchRequestInit, Headers as CloudEventHeaders, HTTPTransportError, + Message, Mode, emitterFor, httpDiscardResponseHandler, httpTextResponseHandler, httpTransport, } from "../../src"; import { assertStructured, fixture } from "./emitter_factory_test"; @@ -123,6 +123,79 @@ describe("Built-in HTTP transport", () => { }); }); + it("Reports an unreadable body without failing an accepted event", async () => { + // the sink accepts the event, then closes the connection before finishing its body + await withServer((_request, response) => { + response.writeHead(202); + response.write("partial", () => response.socket?.end()); + }, async (url) => { + const emit = emitterFor(httpTransport(url)); + const result = await emit(fixture); + + expect(result.response.status).to.equal(202); + expect("body" in result).to.equal(false); + expect("bodyError" in result).to.equal(true); + expect(result.bodyError).not.to.equal(undefined); + }); + }); + + it("Infers bodies from transport and per-send response handlers", async () => { + await withServer((_request, response) => { + response.writeHead(202); + response.end("42"); + }, async (url) => { + const emit = emitterFor(httpTransport(url, { + responseHandler: async (response) => ({ receipt: Number(await response.text()) }), + })); + + const configured = await emit(fixture); + expectType<{ receipt: number } | undefined>(configured.body); + // @ts-expect-error the transport handler determines the default body type + expectType(configured.body); + expect(configured.body).to.deep.equal({ receipt: 42 }); + + const overridden = await emit(fixture, { responseHandler: httpTextResponseHandler }); + expectType(overridden.body); + // @ts-expect-error the per-send handler replaces the transport body type for this call + expectType<{ receipt: number } | undefined>(overridden.body); + expect(overridden.body).to.equal("42"); + }); + }); + + it("Discards a body with the exported response handler", async () => { + await withServer((_request, response) => { + response.writeHead(202); + response.end("not needed"); + }, async (url) => { + const emit = emitterFor(httpTransport(url)); + const result = await emit(fixture, { responseHandler: httpDiscardResponseHandler }); + + expectType(result.body); + expect(result.body).to.equal(undefined); + expect(result.response.bodyUsed).to.equal(true); + expect("bodyError" in result).to.equal(false); + }); + }); + + it("Returns what a custom response handler throws as bodyError for 2xx", async () => { + const handlerError = new Error("receipt was malformed"); + + await withServer((_request, response) => { + response.writeHead(202); + response.end("not a receipt"); + }, async (url) => { + const emit = emitterFor(httpTransport(url)); + const result = await emit(fixture, { + responseHandler: async () => { throw handlerError; }, + }); + + expect(result.response.status).to.equal(202); + expect(result.response.bodyUsed).to.equal(true); + expect("body" in result).to.equal(false); + expect(result.bodyError).to.equal(handlerError); + }); + }); + it("Applies transport headers and lets per-send headers override them", async () => { const { received: receivedHeaders, handler } = headerCollector(); @@ -283,6 +356,72 @@ describe("Built-in HTTP transport", () => { expect(receivedOptions?.redirect).to.equal("manual"); }); + for (const statusCode of [400, 503]) { + it(`Reports a ${statusCode} response without retrying it`, async () => { + let requestCount = 0; + + await withServer((_request, response) => { + requestCount++; + response.writeHead(statusCode, { "x-request-id": `request-${statusCode}` }); + response.end(`status ${statusCode}`); + }, async (url) => { + const emit = emitterFor(httpTransport(url)); + const error = await transportErrorFrom(emit(fixture)); + + expect(error.kind).to.equal("http-status"); + expect(error.response?.status).to.equal(statusCode); + expect(error.response?.headers.get("x-request-id")).to.equal(`request-${statusCode}`); + expect(error.body).to.equal(`status ${statusCode}`); + expect(error.response?.bodyUsed).to.equal(true); + expect(error.cause).to.equal(undefined); + expect(requestCount).to.equal(1); + }); + }); + } + + it("Applies a custom response handler to a non-2xx body", async () => { + await withServer((_request, response) => { + response.writeHead(422, { "content-type": "application/json" }); + response.end(`{"message":"invalid event"}`); + }, async (url) => { + const emit = emitterFor(httpTransport(url, { + responseHandler: async (response) => JSON.parse(await response.text()) as { message: string }, + })); + const error = await transportErrorFrom(emit(fixture)); + + expect(error.kind).to.equal("http-status"); + expect(error.response?.status).to.equal(422); + expect(error.body).to.deep.equal({ message: "invalid event" }); + expect(error.cause).to.equal(undefined); + }); + }); + + for (const statusCode of [301, 302, 303]) { + it(`Returns ${statusCode} as an error by default instead of following it`, async () => { + let requestCount = 0; + let targetRequestCount = 0; + + await withServer((request, response) => { + requestCount++; + if (request.url === "/target") { + targetRequestCount++; + response.writeHead(204); + } else { + response.writeHead(statusCode, { location: "/target" }); + } + response.end(); + }, async (url) => { + const emit = emitterFor(httpTransport(`${url}/start`)); + const error = await transportErrorFrom(emit(fixture)); + + expect(error.kind).to.equal("http-status"); + expect(error.response?.status).to.equal(statusCode); + expect(requestCount).to.equal(1); + expect(targetRequestCount).to.equal(0); + }); + }); + } + // Fetch keeps POST only for 307 and 308, the others become a bodyless GET for (const { statusCode, method, keepsBody } of [ { statusCode: 301, method: "GET", keepsBody: false }, @@ -320,21 +459,26 @@ describe("Built-in HTTP transport", () => { }); } - for (const statusCode of [400, 503]) { - it(`Resolves a ${statusCode} response without retrying it`, async () => { - let requestCount = 0; - await withServer((_request, response) => { - requestCount++; - response.writeHead(statusCode); - response.end("rejected"); - }, async (url) => { - const result = await emitterFor(httpTransport(url))(fixture); - expect(result.response.status).to.equal(statusCode); - expect(result.body).to.equal("rejected"); - expect(requestCount).to.equal(1); - }); + it("Reports a non-2xx status whose body cannot be read", async () => { + // the sink starts an error body, then closes the connection before finishing it + await withServer((_request, response) => { + response.writeHead(503); + response.write("partial", () => response.socket?.end()); + }, async (url) => { + const emit = emitterFor(httpTransport(url)); + const error = await transportErrorFrom(emit(fixture)); + + expect(error.kind).to.equal("http-status"); + expect(error.response?.status).to.equal(503); + expect(error.body).to.equal(undefined); + expect(error.cause).not.to.equal(undefined); }); - } + }); + + it("Rejects a per-send response handler that is not a function", async () => { + const emit = emitterFor(httpTransport(UNREACHABLE_URL)); + await rejects(emit(fixture, { responseHandler: "text" }), TypeError); + }); it("Rejects a per-send header that is not a valid header", async () => { const emit = emitterFor(httpTransport(UNREACHABLE_URL)); @@ -351,12 +495,34 @@ describe("Built-in HTTP transport", () => { }, async (url) => { const emit = emitterFor(httpTransport(url)); await emit(fixture, { - + // @ts-expect-error built-in HTTP accepts FetchHeadersInit, not CloudEventHeaders arrays headers: legacyHeaders, }); }); }); + it("Reports a network failure with its cause", async () => { + const emit = emitterFor(httpTransport(UNREACHABLE_URL)); + const error = await transportErrorFrom(emit(fixture)); + + expect(error.kind).to.equal("network"); + expect(error.response).to.equal(undefined); + expect(error.cause).not.to.equal(undefined); + }); + + it("Reports a synchronous Fetch failure with its cause", async () => { + const cause = new Error("Fetch failed before returning a promise"); + + await withFetch(() => { throw cause; }, async () => { + const emit = emitterFor(httpTransport("https://events.example.com")); + const error = await transportErrorFrom(emit(fixture)); + + expect(error.kind).to.equal("network"); + expect(error.response).to.equal(undefined); + expect(error.cause).to.equal(cause); + }); + }); + it("Validates the sink and transport options when the transport is created", () => { expect(() => httpTransport("not a URL")).to.throw(TypeError); expect(() => httpTransport("ftp://events.example.com")).to.throw(TypeError, "unsupported protocol ftp:"); @@ -368,9 +534,23 @@ describe("Built-in HTTP transport", () => { expect(() => httpTransport("https://events.example.com", { headers: new Headers({ "x-tenant-id": "store-42" }), })).not.to.throw(); + expect(() => httpTransport("https://events.example.com", { + responseHandler: "text" as never, + })).to.throw(TypeError, "options.responseHandler must be a function"); }); }); +async function transportErrorFrom(emitted: Promise): Promise { + const error = await emitted.then(() => undefined, (reason: unknown) => reason); + expect(error).to.be.instanceOf(HTTPTransportError); + return error as HTTPTransportError; +} + +// Compile-time assertion. +function expectType(value: T): void { + void value; +} + // Model a platform object from another realm: same behavior, different instanceof chain. function withForeignInterfacePrototype(value: T): T { const interfacePrototype = Object.getPrototypeOf(value); From a3dce528772ed312314d82e7db9173084beb7f44 Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Tue, 13 Oct 2026 13:22:25 +0900 Subject: [PATCH 21/26] feat!: add abort signals to HTTP transport Signed-off-by: kahirokunn --- API_TRANSITION_GUIDE.md | 9 +- README.md | 20 +- src/transport/emitter.ts | 2 + src/transport/http/index.ts | 62 +++--- src/transport/signal.ts | 161 ++++++++++++++++ test/integration/http_transport_test.ts | 240 ++++++++++++++++++++++++ 6 files changed, 463 insertions(+), 31 deletions(-) create mode 100644 src/transport/signal.ts diff --git a/API_TRANSITION_GUIDE.md b/API_TRANSITION_GUIDE.md index 78ab76b5..80222fea 100644 --- a/API_TRANSITION_GUIDE.md +++ b/API_TRANSITION_GUIDE.md @@ -145,11 +145,14 @@ try { } ``` -The transport takes a second argument now, for headers, how the response body +The transport takes a second argument now, for headers, a signal, how the response body is read and, under `fetchOptions`, the other Fetch options. Its headers are Fetch header forms, so a `string[]` value becomes a `Headers` you `append()` to. A redirect is a failed send unless `fetchOptions: { redirect: "follow" }` says otherwise, and a body -that cannot be read after a 2xx resolves with `bodyError` in place of `body`. +that cannot be read after a 2xx resolves with `bodyError` in place of `body`. The +signal given to `httpTransport()` lasts as long as the transport, so a per-request +deadline belongs on the signal passed with the event. + ```js const headers = new Headers(); headers.append("accept", "application/cloudevents+json"); @@ -235,7 +238,7 @@ DOM `RequestInit` most projects compile with, pass it as #### Emitter Options -`Options` now declares `headers` instead of leaving it to an index +`Options` now declares `headers` and `signal` instead of leaving them to an index signature that resolved to `unknown`. Its default header type remains the CloudEvent header record used by custom transports. The emitter returned from `httpTransport()` specializes it to `FetchHeadersInit`. diff --git a/README.md b/README.md index 9f6eba48..74a978b8 100644 --- a/README.md +++ b/README.md @@ -74,8 +74,8 @@ main().catch(console.error); A 2xx response resolves with the native Fetch `Response` and its body, read as text by default. Anything else rejects with an `HTTPTransportError`, whose -`kind` separates a response that was not 2xx from a request that never reached -a response. +`kind` separates a response that was not 2xx from an abort and from a request +that never reached a response. The body of a response that was not 2xx is on the error as `error.body`. `error.response` cannot be read a second time. If reading the body failed, @@ -98,17 +98,23 @@ async function main() { main().catch(console.error); ``` -`httpTransport()` also takes headers for every event, a `responseHandler` to read -the body another way (or `httpDiscardResponseHandler` to skip it), and the other -Fetch options under `fetchOptions`. Headers passed to `emit()` apply to that -event only. A response handler passed with an event overrides the transport's -handler, and its return value determines the response body type. +`httpTransport()` also takes the headers for every event, an `AbortSignal`, a +`responseHandler` to read the body another way (or `httpDiscardResponseHandler` +to skip it), and the remaining Fetch options under `fetchOptions`. Headers +passed to `emit()` apply to that event only, and there is no timeout option: a +deadline is an `AbortSignal`. ```js const emit = emitterFor(httpTransport("https://my.receiver.com/endpoint", { headers: { authorization: `Bearer ${process.env.RECEIVER_TOKEN}` }, responseHandler: (response) => response.json(), })); + +async function main() { + await emit(ce, { signal: AbortSignal.timeout(10000) }); +} + +main().catch(console.error); ``` A 2xx response means the receiver accepted the event, so a body that cannot be diff --git a/src/transport/emitter.ts b/src/transport/emitter.ts index f2c854a0..601e7880 100644 --- a/src/transport/emitter.ts +++ b/src/transport/emitter.ts @@ -16,6 +16,8 @@ import type { * @interface */ export interface Options { + /** Aborts the send, for transports that support cancellation */ + signal?: AbortSignal; /** Headers for this send, taking precedence over the ones the binding produced */ headers?: THeaders; [key: string]: string | Record | unknown; diff --git a/src/transport/http/index.ts b/src/transport/http/index.ts index 404e9427..0d490646 100644 --- a/src/transport/http/index.ts +++ b/src/transport/http/index.ts @@ -5,6 +5,7 @@ import { Headers as CloudEventHeaders, Message } from "../../message"; import { Options, TransportFunction } from "../emitter"; +import { combineSignals, signalFrom } from "../signal"; /** The request options accepted by the Fetch implementation in the current environment */ export type FetchRequestInit = NonNullable[1]>; @@ -41,6 +42,11 @@ export async function httpDiscardResponseHandler(response: Response): Promise { /** HTTP headers applied to every request, per-send headers take precedence */ headers?: FetchHeadersInit; + /** + * Aborts every request sent by this transport, combined with the per-send signal. It lasts + * as long as the transport does, so set a per-request deadline on the per-send signal + */ + signal?: AbortSignal; /** Fetch options applied to every request, apart from the ones this transport controls */ fetchOptions?: Omit; /** Reads every response body; defaults to {@linkcode httpTextResponseHandler} */ @@ -89,9 +95,10 @@ type HandledResponse = * The failure category reported by {@linkcode HTTPTransportError} * * - `http-status`: the sink returned a response that was not 2xx + * - `aborted`: a signal supplied by the caller aborted the request * - `network`: the request never produced a response, e.g. DNS, connection, or TLS failure */ -export type HTTPTransportErrorKind = "http-status" | "network"; +export type HTTPTransportErrorKind = "http-status" | "aborted" | "network"; /** * What an {@linkcode HTTPTransportError} reports alongside its {@linkcode HTTPTransportErrorKind} @@ -108,7 +115,7 @@ export class HTTPTransportError extends Error { readonly response?: Response; /** What the response handler returned, present when it succeeded for `http-status` */ readonly body?: unknown; - /** The underlying Fetch or response handler failure */ + /** The underlying failure, e.g. what fetch threw or the reason carried by a signal */ readonly cause?: unknown; constructor(kind: HTTPTransportErrorKind, details: HTTPTransportErrorDetails = {}) { @@ -141,13 +148,14 @@ export class HTTPTransportError extends Error { * Every response body is passed to the configured response handler. It is read as text by * default; a handler passed with one send takes precedence over the transport's handler. * A handler may also return `response.body` to hand the stream to the caller, who then - * has to cancel it if it is not read to the end. + * has to cancel it if it is not read to the end, since the abort signals no longer apply + * once the handler has resolved. * * Credentials in _sink_ are sent as an `authorization` header, which the `headers` option * and the headers of one send override. * * @param {string|URL} sink the destination endpoint for the event - * @param {HTTPTransportOptions} options headers, Fetch options and response behavior + * @param {HTTPTransportOptions} options headers, Fetch options, abort and response behavior * @returns {HTTPTransportFunction} a function that sends CloudEvents to _sink_ */ export function httpTransport( @@ -156,6 +164,7 @@ export function httpTransport( const url = validateHTTPURL(sink); // fetch refuses a URL with credentials const sinkHeaders = credentialsFrom(url); + const transportSignal = signalFrom(options.signal); const transportHeaders = headersFrom(options.headers); const transportResponseHandler = responseHandlerFrom(options.responseHandler, httpTextResponseHandler); const fetchOptions: FetchRequestInit = { @@ -168,31 +177,40 @@ export function httpTransport( const send = async ( message: Message, sendOptions?: Options, ): Promise> => { + const sendSignal = signalFrom(sendOptions?.signal); const headers = requestHeaders( sinkHeaders, message.headers, transportHeaders, headersFrom(sendOptions?.headers), ); const responseHandler = responseHandlerFrom(sendOptions?.responseHandler, transportResponseHandler); - let response: Response; + const combinedSignal = combineSignals(transportSignal, sendSignal); try { - response = await fetch(url, { - ...fetchOptions, - headers, - body: message.body as BodyInit, - }); - } catch (cause) { - throw new HTTPTransportError("network", { cause }); - } + let response: Response; + try { + response = await fetch(url, { + ...fetchOptions, + headers, + body: message.body as BodyInit, + signal: combinedSignal.signal, + }); + } catch (cause) { + throw combinedSignal.signal?.aborted + ? new HTTPTransportError("aborted", { cause: combinedSignal.signal.reason ?? cause }) + : new HTTPTransportError("network", { cause }); + } - const handled = await handleResponse(response, responseHandler); - if (!response.ok) { - // the status is the failure; the handler result or error goes alongside it - throw new HTTPTransportError("http-status", handled.handled + const handled = await handleResponse(response, responseHandler); + if (!response.ok) { + // the status is the failure; the handler result or error goes alongside it + throw new HTTPTransportError("http-status", handled.handled + ? { response, body: handled.body } + : { response, cause: handled.error }); + } + return handled.handled ? { response, body: handled.body } - : { response, cause: handled.error }); + : { response, bodyError: handled.error }; + } finally { + combinedSignal.dispose(); } - return handled.handled - ? { response, body: handled.body } - : { response, bodyError: handled.error }; }; // the overloads type the per-send handler this implementation cannot @@ -392,6 +410,8 @@ function errorMessage(kind: HTTPTransportErrorKind, details: HTTPTransportErrorD switch (kind) { case "http-status": return `HTTP transport received a non-2xx response: ${details.response?.status}`; + case "aborted": + return "HTTP transport request was aborted"; default: return "HTTP transport request failed"; } diff --git a/src/transport/signal.ts b/src/transport/signal.ts new file mode 100644 index 00000000..14dd50a2 --- /dev/null +++ b/src/transport/signal.ts @@ -0,0 +1,161 @@ +/* + Copyright 2021 The CloudEvents Authors + SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * Check a signal supplied by a caller, whether it was given to a transport, to a single send, + * or to an emitter wrapper, by its platform brand rather than the interface prototype of this + * realm + * + * @param {unknown} value the signal supplied by the caller, if any + * @returns {AbortSignal|undefined} the signal, or undefined when none was supplied + */ +export function signalFrom(value: unknown): AbortSignal | undefined { + if (value === undefined || value === null) { + return undefined; + } + try { + // the getter checks the AbortSignal platform brand and accepts signals from another realm + Reflect.get(AbortSignal.prototype, "aborted", value); + } catch { + throw new TypeError("options.signal must be an AbortSignal"); + } + return value as AbortSignal; +} + +/** + * Read the conventional signal from otherwise transport-specific send options + * + * @param {unknown} options the options passed to one emitter invocation + * @returns {AbortSignal|undefined} the validated signal, when one was supplied + */ +export function signalFromOptions(options: unknown): AbortSignal | undefined { + if (typeof options !== "object" || options === null) { + return undefined; + } + return signalFrom((options as { signal?: unknown }).signal); +} + +/** An abort signal scoped to one operation, and the cleanup which ends that scope */ +export interface CombinedSignal { + signal?: AbortSignal; + dispose: () => void; +} + +/** Subscribers sharing the one platform listener attached to an abort signal */ +interface AbortFanout { + subscribers: Set<() => void>; + listener: () => void; + listening: boolean; +} + +/** Active fan-outs, weakly keyed so an otherwise unused signal can still be collected */ +const abortFanouts = new WeakMap(); + +/** The relay for an operation which has no signal to relay */ +const NO_ABORT: CombinedSignal = { signal: undefined, dispose: () => undefined }; + +/** + * Create and attach the shared platform listener for one signal + * + * @param {AbortSignal} source the signal which owns the listener + * @returns {AbortFanout} the shared subscriber collection + */ +function createAbortFanout(source: AbortSignal): AbortFanout { + const subscribers = new Set<() => void>(); + const fanout: AbortFanout = { + subscribers, + listening: true, + listener: () => { + const current = Array.from(subscribers); + subscribers.clear(); + fanout.listening = false; + abortFanouts.delete(source); + current.forEach((callback) => callback()); + }, + }; + + abortFanouts.set(source, fanout); + source.addEventListener("abort", fanout.listener, { once: true }); + return fanout; +} + +/** + * Subscribe to a signal through one shared platform listener, however many operations use it + * + * @param {AbortSignal} source the signal whose abort should be relayed + * @param {Function} subscriber one operation's abort callback + * @returns {Function} an idempotent function which removes this subscription + */ +function subscribeAbort(source: AbortSignal, subscriber: () => void): () => void { + const fanout = abortFanouts.get(source) ?? createAbortFanout(source); + + fanout.subscribers.add(subscriber); + let disposed = false; + + return (): void => { + if (disposed) { + return; + } + disposed = true; + fanout.subscribers.delete(subscriber); + + if (fanout.listening && fanout.subscribers.size === 0) { + fanout.listening = false; + source.removeEventListener("abort", fanout.listener); + abortFanouts.delete(source); + } + }; +} + +/** + * Combine abort signals behind a disposable relay, so they apply only while an operation is + * running and do not retain a long-lived source after that work ends. + * + * `AbortSignal.any()` is not used here. Node.js 24 validates its arguments with `instanceof`, + * so it rejects the signals from another realm that {@linkcode signalFrom} accepts, with + * `The "signals[0]" argument must be an instance of AbortSignal`. `addEventListener()` works + * across realms on every supported version, so the sources are relayed through + * {@linkcode subscribeAbort}, which also keeps one listener per source however many operations + * share it. + * + * @param {Array} candidates the signals which can abort the operation + * @returns {CombinedSignal} the combined signal and an idempotent cleanup function + */ +export function combineSignals(...candidates: Array): CombinedSignal { + const sources = Array.from(new Set(candidates)) + .filter((signal): signal is AbortSignal => signal !== undefined); + if (sources.length === 0) { + return NO_ABORT; + } + + const controller = new AbortController(); + const unsubscribe: Array<() => void> = []; + let disposed = false; + + const dispose = (): void => { + if (disposed) { + return; + } + disposed = true; + unsubscribe.forEach((remove) => remove()); + unsubscribe.length = 0; + }; + + const abortFrom = (source: AbortSignal): void => { + controller.abort(source.reason); + dispose(); + }; + + const alreadyAborted = sources.find((source) => source.aborted); + if (alreadyAborted) { + abortFrom(alreadyAborted); + return { signal: controller.signal, dispose }; + } + + sources.forEach((source) => { + unsubscribe.push(subscribeAbort(source, () => abortFrom(source))); + }); + return { signal: controller.signal, dispose }; +} diff --git a/test/integration/http_transport_test.ts b/test/integration/http_transport_test.ts index e86213ae..021ea72e 100644 --- a/test/integration/http_transport_test.ts +++ b/test/integration/http_transport_test.ts @@ -6,6 +6,7 @@ import "mocha"; import { rejects } from "assert"; import { expect } from "chai"; +import { getEventListeners } from "events"; import { createServer, IncomingMessage, ServerResponse } from "http"; import { AddressInfo } from "net"; import { json, text } from "stream/consumers"; @@ -30,6 +31,13 @@ const acceptEvent: Handler = (_request, response) => { response.end(); }; +// a sink which accepts the event, then finishes its body a moment later +const streamEvent: Handler = (_request, response) => { + response.writeHead(202); + response.write("stream"); + setTimeout(() => response.end("ed"), 50); +}; + describe("Built-in HTTP transport", () => { it("Sends a binary event and resolves with the response for 2xx", async () => { let receivedBody: Record | undefined; @@ -177,6 +185,23 @@ describe("Built-in HTTP transport", () => { }); }); + it("Lets a custom response handler hand its stream to the caller", async () => { + await withServer(streamEvent, async (url) => { + const controller = new AbortController(); + const emit = emitterFor(httpTransport(url)); + const result = await emit(fixture, { + signal: controller.signal, + responseHandler: async (response) => response.body, + }); + + expectType | null | undefined>(result.body); + expect(result.response.bodyUsed).to.equal(false); + // after the handler returns the stream, cancelling it is up to the caller + controller.abort(); + expect(await new Response(result.body).text()).to.equal("streamed"); + }); + }); + it("Returns what a custom response handler throws as bodyError for 2xx", async () => { const handlerError = new Error("receipt was malformed"); @@ -459,6 +484,47 @@ describe("Built-in HTTP transport", () => { }); } + it("Reports a caller timeout as an abort, with the reason it carries", async () => { + await withServer(() => undefined, async (url) => { + const emit = emitterFor(httpTransport(url)); + const error = await transportErrorFrom(emit(fixture, { signal: AbortSignal.timeout(50) })); + + expect(error.kind).to.equal("aborted"); + expect(error.response).to.equal(undefined); + expect((error.cause as Error)?.name).to.equal("TimeoutError"); + }); + }); + + it("Returns an abort during a 2xx body as bodyError", async () => { + const controller = new AbortController(); + let markHandlerStarted = (): void => undefined; + const handlerStarted = new Promise((resolve) => { + markHandlerStarted = resolve; + }); + + await withServer((_request, response) => { + response.writeHead(202); + response.write("partial"); + }, async (url) => { + const emit = emitterFor(httpTransport(url)); + const emitted = emit(fixture, { + signal: controller.signal, + responseHandler: async (response) => { + markHandlerStarted(); + return response.text(); + }, + }); + + await handlerStarted; + controller.abort(new DOMException("deadline exceeded", "TimeoutError")); + const result = await emitted; + + expect(result.response.status).to.equal(202); + expect("body" in result).to.equal(false); + expect((result.bodyError as Error).name).to.equal("TimeoutError"); + }); + }); + it("Reports a non-2xx status whose body cannot be read", async () => { // the sink starts an error body, then closes the connection before finishing it await withServer((_request, response) => { @@ -475,6 +541,177 @@ describe("Built-in HTTP transport", () => { }); }); + it("Reports an abort from the transport signal", async () => { + const controller = new AbortController(); + + await withServer(() => controller.abort(new Error("shutting down")), async (url) => { + const emit = emitterFor(httpTransport(url, { signal: controller.signal })); + const error = await transportErrorFrom(emit(fixture)); + + expect(error.kind).to.equal("aborted"); + expect(error.response).to.equal(undefined); + expect((error.cause as Error).message).to.equal("shutting down"); + }); + }); + + it("Reports an abort from a per-send signal", async () => { + const controller = new AbortController(); + + await withServer(() => controller.abort(), async (url) => { + const emit = emitterFor(httpTransport(url)); + const error = await transportErrorFrom(emit(fixture, { signal: controller.signal })); + + expect(error.kind).to.equal("aborted"); + expect(error.cause).not.to.equal(undefined); + }); + }); + + it("Accepts an AbortSignal whose interface prototype comes from another realm", async () => { + const controller = new AbortController(); + const signal = withForeignInterfacePrototype(controller.signal); + expect(signal).not.to.be.instanceOf(AbortSignal); + + await withServer(() => controller.abort(new Error("foreign signal gave up")), async (url) => { + const emit = emitterFor(httpTransport(url)); + const error = await transportErrorFrom(emit(fixture, { signal })); + + expect(error.kind).to.equal("aborted"); + expect((error.cause as Error).message).to.equal("foreign signal gave up"); + }); + }); + + it("Does not send when the signal is already aborted", async () => { + let requestCount = 0; + const controller = new AbortController(); + controller.abort(); + + await withServer(() => { requestCount++; }, async (url) => { + const emit = emitterFor(httpTransport(url, { signal: controller.signal })); + const error = await transportErrorFrom(emit(fixture)); + + expect(error.kind).to.equal("aborted"); + expect(requestCount).to.equal(0); + }); + }); + + it("Uses the first reason when both signals are already aborted", async () => { + const transport = new AbortController(); + const send = new AbortController(); + transport.abort(new Error("transport stopped first")); + send.abort(new Error("send stopped second")); + + const emit = emitterFor(httpTransport(UNREACHABLE_URL, { signal: transport.signal })); + const error = await transportErrorFrom(emit(fixture, { signal: send.signal })); + + expect(error.kind).to.equal("aborted"); + expect((error.cause as Error).message).to.equal("transport stopped first"); + }); + + it("Sends with a transport signal and a per-send signal set at once", async () => { + const transport = new AbortController(); + + await withServer(acceptEvent, async (url) => { + const emit = emitterFor(httpTransport(url, { signal: transport.signal })); + const { response } = await emit(fixture, { signal: new AbortController().signal }); + + expect(response.status).to.equal(204); + expect(transport.signal.aborted).to.equal(false); + }); + }); + + it("Reports an abort from either signal when both are set", async () => { + for (const abortedSignal of ["transport", "per-send"]) { + const transport = new AbortController(); + const send = new AbortController(); + const aborting = abortedSignal === "transport" ? transport : send; + + await withServer(() => aborting.abort(new Error(`${abortedSignal} gave up`)), async (url) => { + const emit = emitterFor(httpTransport(url, { signal: transport.signal })); + const error = await transportErrorFrom(emit(fixture, { signal: send.signal })); + + expect(error.kind).to.equal("aborted"); + expect((error.cause as Error).message).to.equal(`${abortedSignal} gave up`); + }); + } + }); + + it("Shares one source listener between concurrent sends and removes it afterward", async () => { + const controller = new AbortController(); + let releaseRequests = (): void => undefined; + const requestsMayComplete = new Promise((resolve) => { + releaseRequests = resolve; + }); + + await withFetch(async () => { + await requestsMayComplete; + return new Response(null, { status: 204 }); + }, async () => { + const emit = emitterFor(httpTransport("https://events.example.com", { signal: controller.signal })); + const emitted = Array.from({ length: 20 }, () => emit(fixture)); + + try { + expect(getEventListeners(controller.signal, "abort")).to.have.length(1); + releaseRequests(); + await Promise.all(emitted); + expect(getEventListeners(controller.signal, "abort")).to.have.length(0); + } finally { + releaseRequests(); + await Promise.allSettled(emitted); + } + }); + }); + + it("Fans a shared transport abort out to every concurrent send", async () => { + const controller = new AbortController(); + const reason = new Error("transport shutting down"); + + await withFetch(async (_input, options) => new Promise((_resolve, reject) => { + const signal = options?.signal; + if (!signal) { + reject(new Error("expected a combined abort signal")); + return; + } + signal.addEventListener("abort", () => reject(signal.reason), { once: true }); + }), async () => { + const emit = emitterFor(httpTransport("https://events.example.com", { signal: controller.signal })); + const emitted = Array.from({ length: 20 }, () => transportErrorFrom(emit(fixture))); + + try { + expect(getEventListeners(controller.signal, "abort")).to.have.length(1); + controller.abort(reason); + const errors = await Promise.all(emitted); + errors.forEach((error) => { + expect(error.kind).to.equal("aborted"); + expect(error.cause).to.equal(reason); + }); + expect(getEventListeners(controller.signal, "abort")).to.have.length(0); + } finally { + controller.abort(reason); + await Promise.allSettled(emitted); + } + }); + }); + + it("Stops applying a transport signal once the send has resolved", async () => { + const transport = new AbortController(); + + await withServer(streamEvent, async (url) => { + const emit = emitterFor(httpTransport(url, { signal: transport.signal })); + const result = await emit(fixture, { + responseHandler: async (response) => response.body, + }); + + // the transport signal no longer reaches a body the handler handed to the caller + transport.abort(); + expect(await new Response(result.body).text()).to.equal("streamed"); + }); + }); + + it("Rejects a per-send signal that is not an AbortSignal", async () => { + const emit = emitterFor(httpTransport(UNREACHABLE_URL)); + await rejects(emit(fixture, { signal: "not a signal" as unknown as AbortSignal }), TypeError); + }); + it("Rejects a per-send response handler that is not a function", async () => { const emit = emitterFor(httpTransport(UNREACHABLE_URL)); await rejects(emit(fixture, { responseHandler: "text" }), TypeError); @@ -534,6 +771,9 @@ describe("Built-in HTTP transport", () => { expect(() => httpTransport("https://events.example.com", { headers: new Headers({ "x-tenant-id": "store-42" }), })).not.to.throw(); + expect(() => httpTransport("https://events.example.com", { + signal: "not a signal" as unknown as AbortSignal, + })).to.throw(TypeError, "options.signal must be an AbortSignal"); expect(() => httpTransport("https://events.example.com", { responseHandler: "text" as never, })).to.throw(TypeError, "options.responseHandler must be a function"); From 4da9ee5ff5011270758533486be7b8975c0f93cc Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Sun, 18 Oct 2026 12:20:11 +0900 Subject: [PATCH 22/26] refactor: keep HTTP response helpers private Signed-off-by: kahirokunn --- README.md | 8 ++++---- src/index.ts | 4 +--- src/transport/http/index.ts | 26 +++---------------------- test/integration/http_transport_test.ts | 10 ++++++---- 4 files changed, 14 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 74a978b8..f80efb8e 100644 --- a/README.md +++ b/README.md @@ -99,10 +99,10 @@ main().catch(console.error); ``` `httpTransport()` also takes the headers for every event, an `AbortSignal`, a -`responseHandler` to read the body another way (or `httpDiscardResponseHandler` -to skip it), and the remaining Fetch options under `fetchOptions`. Headers -passed to `emit()` apply to that event only, and there is no timeout option: a -deadline is an `AbortSignal`. +`responseHandler` to read the body another way, and the remaining Fetch options +under `fetchOptions`. Headers passed to `emit()` apply to that event only, and +there is no timeout option: a deadline is an `AbortSignal`. To discard a response +body, use `responseHandler: async (response) => { await response.body?.cancel(); }`. ```js const emit = emitterFor(httpTransport("https://my.receiver.com/endpoint", { diff --git a/src/index.ts b/src/index.ts index df586fc3..c7a6af45 100644 --- a/src/index.ts +++ b/src/index.ts @@ -14,7 +14,7 @@ import { FetchHeadersInit, FetchRequestInit, HTTPResponseHandler, HTTPTransportError, HTTPTransportErrorDetails, HTTPTransportErrorKind, HTTPTransportFunction, HTTPTransportOptions, HTTPTransportResponse, HTTPTransportSendOptions, - httpDiscardResponseHandler, httpTextResponseHandler, httpTransport } from "./transport/http"; + httpTransport } from "./transport/http"; import { Headers, Mode, Binding, HTTP, Kafka, KafkaEvent, KafkaMessage, Message, MQTT, MQTTMessage, MQTTMessageFactory, Serializer, Deserializer } from "./message"; @@ -35,8 +35,6 @@ export { // From transport emitterFor, httpTransport, - httpTextResponseHandler, - httpDiscardResponseHandler, HTTPTransportError, Emitter, // From Constants diff --git a/src/transport/http/index.ts b/src/transport/http/index.ts index 0d490646..84fbdffe 100644 --- a/src/transport/http/index.ts +++ b/src/transport/http/index.ts @@ -16,26 +16,6 @@ export type FetchHeadersInit = NonNullable; /** Turns a Fetch response into the body value handed back by the HTTP transport */ export type HTTPResponseHandler = (response: Response) => Promise; -/** - * Read a response body as text, the default behavior of the HTTP transport - * - * @param {Response} response the response whose body should be read - * @returns {Promise} the response body as text - */ -export function httpTextResponseHandler(response: Response): Promise { - return response.text(); -} - -/** - * Discard a response body when the caller only needs the response metadata - * - * @param {Response} response the response whose body should be discarded - * @returns {Promise} completion after the body has been cancelled - */ -export async function httpDiscardResponseHandler(response: Response): Promise { - await response.body?.cancel(); -} - /** * Options applied to every request sent by an HTTP transport */ @@ -49,7 +29,7 @@ export interface HTTPTransportOptions { signal?: AbortSignal; /** Fetch options applied to every request, apart from the ones this transport controls */ fetchOptions?: Omit; - /** Reads every response body; defaults to {@linkcode httpTextResponseHandler} */ + /** Reads every response body; defaults to reading it as text */ responseHandler?: HTTPResponseHandler; } @@ -166,7 +146,7 @@ export function httpTransport( const sinkHeaders = credentialsFrom(url); const transportSignal = signalFrom(options.signal); const transportHeaders = headersFrom(options.headers); - const transportResponseHandler = responseHandlerFrom(options.responseHandler, httpTextResponseHandler); + const transportResponseHandler = responseHandlerFrom(options.responseHandler, (response) => response.text()); const fetchOptions: FetchRequestInit = { ...options.fetchOptions, // fetch reads an explicitly undefined redirect as absent, so the default comes last @@ -252,7 +232,7 @@ async function handleResponse( return { handled: true, body: await handler(response) }; } catch (error) { try { - await httpDiscardResponseHandler(response); + await response.body?.cancel(); } catch { // best effort cleanup } diff --git a/test/integration/http_transport_test.ts b/test/integration/http_transport_test.ts index 021ea72e..0799f5e8 100644 --- a/test/integration/http_transport_test.ts +++ b/test/integration/http_transport_test.ts @@ -14,7 +14,7 @@ import { runInNewContext } from "vm"; import { CONSTANTS, FetchHeadersInit, FetchRequestInit, Headers as CloudEventHeaders, HTTPTransportError, - Message, Mode, emitterFor, httpDiscardResponseHandler, httpTextResponseHandler, httpTransport, + Message, Mode, emitterFor, httpTransport, } from "../../src"; import { assertStructured, fixture } from "./emitter_factory_test"; @@ -162,7 +162,7 @@ describe("Built-in HTTP transport", () => { expectType(configured.body); expect(configured.body).to.deep.equal({ receipt: 42 }); - const overridden = await emit(fixture, { responseHandler: httpTextResponseHandler }); + const overridden = await emit(fixture, { responseHandler: (response) => response.text() }); expectType(overridden.body); // @ts-expect-error the per-send handler replaces the transport body type for this call expectType<{ receipt: number } | undefined>(overridden.body); @@ -170,13 +170,15 @@ describe("Built-in HTTP transport", () => { }); }); - it("Discards a body with the exported response handler", async () => { + it("Discards a body with a caller's response handler", async () => { await withServer((_request, response) => { response.writeHead(202); response.end("not needed"); }, async (url) => { const emit = emitterFor(httpTransport(url)); - const result = await emit(fixture, { responseHandler: httpDiscardResponseHandler }); + const result = await emit(fixture, { + responseHandler: async (response) => { await response.body?.cancel(); }, + }); expectType(result.body); expect(result.body).to.equal(undefined); From aa874104c1c8fd4d14d0d7fc1b1ccacaeb8d8a22 Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Sun, 18 Oct 2026 17:39:05 +0900 Subject: [PATCH 23/26] refactor!: narrow HTTP transport options Signed-off-by: kahirokunn --- API_TRANSITION_GUIDE.md | 20 +-- README.md | 12 +- src/index.ts | 14 +- src/transport/emitter.ts | 31 ---- src/transport/http/index.ts | 91 +++++----- src/transport/signal.ts | 5 +- test/integration/emitter_factory_test.ts | 9 + test/integration/http_transport_test.ts | 211 ++++++++++++----------- 8 files changed, 180 insertions(+), 213 deletions(-) diff --git a/API_TRANSITION_GUIDE.md b/API_TRANSITION_GUIDE.md index 80222fea..337f2b77 100644 --- a/API_TRANSITION_GUIDE.md +++ b/API_TRANSITION_GUIDE.md @@ -145,13 +145,12 @@ try { } ``` -The transport takes a second argument now, for headers, a signal, how the response body +The transport takes a second argument now, for headers, how the response body is read and, under `fetchOptions`, the other Fetch options. Its headers are Fetch header forms, so a `string[]` value becomes a `Headers` you `append()` to. A redirect is a failed send unless `fetchOptions: { redirect: "follow" }` says otherwise, and a body -that cannot be read after a 2xx resolves with `bodyError` in place of `body`. The -signal given to `httpTransport()` lasts as long as the transport, so a per-request -deadline belongs on the signal passed with the event. +that cannot be read after a 2xx resolves with `bodyError` in place of `body`. Pass +`headers` and `signal` with the event for settings that apply to one message. ```js const headers = new Headers(); @@ -233,7 +232,7 @@ so `dispatcher` is a Node.js-only option. `fetchOptions` takes the Fetch options of whichever declarations type `fetch` in your project, so TypeScript accepts `dispatcher` only where those are undici's. Against the DOM `RequestInit` most projects compile with, pass it as -`fetchOptions: { dispatcher } as FetchRequestInit` or reach for +`fetchOptions: { dispatcher } as RequestInit` or reach for `setGlobalDispatcher()` instead. #### Emitter Options @@ -241,7 +240,7 @@ DOM `RequestInit` most projects compile with, pass it as `Options` now declares `headers` and `signal` instead of leaving them to an index signature that resolved to `unknown`. Its default header type remains the CloudEvent header record used by custom transports. The emitter returned from -`httpTransport()` specializes it to `FetchHeadersInit`. +`httpTransport()` accepts Fetch header forms instead. TypeScript now rejects spreading custom transport options into a client configuration that types its own `headers`: @@ -257,11 +256,10 @@ function sendWithAxios(message: Message, options?: Options) { } ``` -It also rejects the generic types as annotations for the built-in transport, whose -options are narrower. Use `HTTPTransportFunction` and `HTTPEmitterFunction`, or leave -the types to inference: +Leave the built-in transport and emitter types to inference so their message +options and response body types are preserved: ```ts -const transport: HTTPTransportFunction = httpTransport(sink); -const emit: HTTPEmitterFunction = emitterFor(transport); +const transport = httpTransport(sink); +const emit = emitterFor(transport); ``` diff --git a/README.md b/README.md index f80efb8e..8f8b0fbe 100644 --- a/README.md +++ b/README.md @@ -98,11 +98,15 @@ async function main() { main().catch(console.error); ``` -`httpTransport()` also takes the headers for every event, an `AbortSignal`, a +`httpTransport()` also takes the headers for every event, a `responseHandler` to read the body another way, and the remaining Fetch options -under `fetchOptions`. Headers passed to `emit()` apply to that event only, and -there is no timeout option: a deadline is an `AbortSignal`. To discard a response -body, use `responseHandler: async (response) => { await response.body?.cancel(); }`. +under `fetchOptions`. The options passed to `emit()` apply to that Message only: +`headers` and `signal`. Unsupported transport or message options reject with a +`TypeError`. To discard a response body, use +`responseHandler: async (response) => { await response.body?.cancel(); }`. + +There is no timeout option: a deadline is an `AbortSignal` passed with the +message. ```js const emit = emitterFor(httpTransport("https://my.receiver.com/endpoint", { diff --git a/src/index.ts b/src/index.ts index c7a6af45..945d198e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,12 +8,10 @@ import { ValidationError } from "./event/validation"; import { CloudEventV1, CloudEventV1Attributes } from "./event/interfaces"; import { - Options, TransportFunction, EmitterFunction, HTTPEmitterFunction, emitterFor, Emitter, + Options, TransportFunction, EmitterFunction, emitterFor, Emitter, } from "./transport/emitter"; import { - FetchHeadersInit, FetchRequestInit, HTTPResponseHandler, HTTPTransportError, - HTTPTransportErrorDetails, HTTPTransportErrorKind, - HTTPTransportFunction, HTTPTransportOptions, HTTPTransportResponse, HTTPTransportSendOptions, + HTTPResponseHandler, HTTPTransportError, HTTPTransportErrorKind, HTTPTransportOptions, HTTPTransportResponse, httpTransport } from "./transport/http"; import { Headers, Mode, Binding, HTTP, Kafka, KafkaEvent, KafkaMessage, Message, MQTT, MQTTMessage, MQTTMessageFactory, @@ -56,15 +54,9 @@ export type { // From transport TransportFunction, EmitterFunction, - HTTPEmitterFunction, Options, - FetchHeadersInit, - FetchRequestInit, HTTPResponseHandler, - HTTPTransportErrorDetails, HTTPTransportErrorKind, - HTTPTransportFunction, HTTPTransportOptions, - HTTPTransportResponse, - HTTPTransportSendOptions + HTTPTransportResponse }; diff --git a/src/transport/emitter.ts b/src/transport/emitter.ts index 601e7880..813564ff 100644 --- a/src/transport/emitter.ts +++ b/src/transport/emitter.ts @@ -6,9 +6,6 @@ import { CloudEvent } from "../event/cloudevent"; import { Headers as CloudEventHeaders, HTTP, Message, Mode } from "../message"; import { EventEmitter } from "events"; -import type { - FetchHeadersInit, HTTPTransportFunction, HTTPTransportResponse, HTTPTransportSendOptions, -} from "./http"; /** * Options is an additional, optional dictionary of options that may @@ -34,17 +31,6 @@ export interface EmitterFunction { (event: CloudEvent, options?: TOptions): Promise; } -/** - * An emitter backed by the built-in HTTP transport. A response handler passed with one event - * determines the body type for that call; otherwise the transport's default body type is used. - */ -export interface HTTPEmitterFunction - extends EmitterFunction, Options> { - ( - event: CloudEvent, options: HTTPTransportSendOptions, - ): Promise>; -} - /** * TransportFunction is an invokable interface provided to the emitterFactory. * A TransportFunction's responsiblity is to send a JSON encoded event Message @@ -57,20 +43,6 @@ export interface TransportFunction { } const emitterDefaults: Options = { binding: HTTP, mode: Mode.BINARY }; -/** - * Creates and returns an {@linkcode HTTPEmitterFunction} using the built-in HTTP - * transport returned by `httpTransport()`. The returned function converts a - * {@linkcode CloudEvent} into a {@linkcode Message} the same way the generic overload - * below does, and resolves with what the sink sent back, or rejects with an - * `HTTPTransportError`. - * - * @param {HTTPTransportFunction} fn the built-in HTTP transport to send events with - * @param { {Binding, Mode} } options network binding and message serialization options - * @returns {HTTPEmitterFunction} an emitter which resolves with the sink's response - */ -export function emitterFor( - fn: HTTPTransportFunction, options?: Options, -): HTTPEmitterFunction; /** * Creates and returns an {@linkcode EmitterFunction} using the supplied * {@linkcode TransportFunction}. The returned {@linkcode EmitterFunction} @@ -85,9 +57,6 @@ export function emitterFor( * @param {Mode} options.mode the encoding mode (Mode.BINARY or Mode.STRUCTURED) * @returns {EmitterFunction} an EmitterFunction to send events with */ -export function emitterFor( - fn: TransportFunction, options?: Options, -): EmitterFunction; export function emitterFor( fn: TransportFunction, options: Options = emitterDefaults, ): EmitterFunction { diff --git a/src/transport/http/index.ts b/src/transport/http/index.ts index 84fbdffe..529f8e01 100644 --- a/src/transport/http/index.ts +++ b/src/transport/http/index.ts @@ -8,10 +8,10 @@ import { Options, TransportFunction } from "../emitter"; import { combineSignals, signalFrom } from "../signal"; /** The request options accepted by the Fetch implementation in the current environment */ -export type FetchRequestInit = NonNullable[1]>; +type FetchRequestInit = NonNullable[1]>; /** The header forms accepted by the Fetch implementation in the current environment */ -export type FetchHeadersInit = NonNullable; +type FetchHeadersInit = NonNullable; /** Turns a Fetch response into the body value handed back by the HTTP transport */ export type HTTPResponseHandler = (response: Response) => Promise; @@ -22,24 +22,21 @@ export type HTTPResponseHandler = (response: Response) => Promise; export interface HTTPTransportOptions { /** HTTP headers applied to every request, per-send headers take precedence */ headers?: FetchHeadersInit; - /** - * Aborts every request sent by this transport, combined with the per-send signal. It lasts - * as long as the transport does, so set a per-request deadline on the per-send signal - */ - signal?: AbortSignal; /** Fetch options applied to every request, apart from the ones this transport controls */ fetchOptions?: Omit; /** Reads every response body; defaults to reading it as text */ responseHandler?: HTTPResponseHandler; } -/** - * Options which replace the response handler for one send - */ -export interface HTTPTransportSendOptions extends Options { - /** Reads this response body instead of the handler configured for the transport */ - responseHandler: HTTPResponseHandler; -} +type HTTPMessageOptions = Pick, "headers" | "signal">; + +const supportedTransportOptions: Record, true> = { + headers: true, fetchOptions: true, responseHandler: true, +}; + +const supportedSendOptions: Record = { + headers: true, signal: true, +}; /** What the built-in HTTP transport hands back for a send the sink accepted */ export type HTTPTransportResponse = @@ -58,14 +55,6 @@ export type HTTPTransportResponse = bodyError: unknown; }; -/** - * An HTTP transport whose default response body type can be replaced for one send - */ -export interface HTTPTransportFunction - extends TransportFunction, Options> { - (message: Message, options: HTTPTransportSendOptions): Promise>; -} - /** The result of attempting to handle a response body */ type HandledResponse = | { handled: true; body: unknown } @@ -83,7 +72,7 @@ export type HTTPTransportErrorKind = "http-status" | "aborted" | "network"; /** * What an {@linkcode HTTPTransportError} reports alongside its {@linkcode HTTPTransportErrorKind} */ -export type HTTPTransportErrorDetails = Pick; +type HTTPTransportErrorDetails = Pick; /** * A request failure reported by the built-in HTTP transport @@ -125,28 +114,34 @@ export class HTTPTransportError extends Error { * reported as errors unless `fetchOptions.redirect` says otherwise, since Fetch keeps the * CloudEvent POST only for 307 and 308 - see the README for the details. * - * Every response body is passed to the configured response handler. It is read as text by - * default; a handler passed with one send takes precedence over the transport's handler. - * A handler may also return `response.body` to hand the stream to the caller, who then - * has to cancel it if it is not read to the end, since the abort signals no longer apply + * Every response body is passed to the configured response handler, or read as text by + * default. A handler may return `response.body` to hand the stream to the caller, who must + * cancel it if it is not read to the end. The message's abort signal no longer applies * once the handler has resolved. * * Credentials in _sink_ are sent as an `authorization` header, which the `headers` option * and the headers of one send override. * * @param {string|URL} sink the destination endpoint for the event - * @param {HTTPTransportOptions} options headers, Fetch options, abort and response behavior - * @returns {HTTPTransportFunction} a function that sends CloudEvents to _sink_ + * @param {HTTPTransportOptions} options headers, Fetch options and response behavior + * @returns {TransportFunction} a function that sends CloudEvents to _sink_ */ export function httpTransport( - sink: string | URL, options: HTTPTransportOptions = {}, -): HTTPTransportFunction { + sink: string | URL, options?: HTTPTransportOptions, +): TransportFunction, HTTPMessageOptions>; +export function httpTransport( + sink: string | URL, options: HTTPTransportOptions = {}, +): TransportFunction, HTTPMessageOptions> { + for (const name of Object.keys(options)) { + if (!Object.prototype.hasOwnProperty.call(supportedTransportOptions, name)) { + throw new TypeError(`unsupported HTTP transport option: ${name}`); + } + } const url = validateHTTPURL(sink); // fetch refuses a URL with credentials const sinkHeaders = credentialsFrom(url); - const transportSignal = signalFrom(options.signal); const transportHeaders = headersFrom(options.headers); - const transportResponseHandler = responseHandlerFrom(options.responseHandler, (response) => response.text()); + const responseHandler = responseHandlerFrom(options.responseHandler); const fetchOptions: FetchRequestInit = { ...options.fetchOptions, // fetch reads an explicitly undefined redirect as absent, so the default comes last @@ -154,15 +149,19 @@ export function httpTransport( method: "POST", }; - const send = async ( - message: Message, sendOptions?: Options, - ): Promise> => { + async function send( + message: Message, sendOptions?: HTTPMessageOptions, + ): Promise> { + for (const name of Object.keys(sendOptions ?? {})) { + if (!Object.prototype.hasOwnProperty.call(supportedSendOptions, name)) { + throw new TypeError(`unsupported HTTP send option: ${name}`); + } + } const sendSignal = signalFrom(sendOptions?.signal); const headers = requestHeaders( sinkHeaders, message.headers, transportHeaders, headersFrom(sendOptions?.headers), ); - const responseHandler = responseHandlerFrom(sendOptions?.responseHandler, transportResponseHandler); - const combinedSignal = combineSignals(transportSignal, sendSignal); + const combinedSignal = combineSignals(sendSignal); try { let response: Response; try { @@ -191,24 +190,20 @@ export function httpTransport( } finally { combinedSignal.dispose(); } - }; + } - // the overloads type the per-send handler this implementation cannot - return send as HTTPTransportFunction; + return send; } /** - * Check a response handler and fall back to the handler from the enclosing transport + * Check a response handler and fall back to reading the body as text * - * @param {unknown} value the handler supplied at this layer, if any - * @param {HTTPResponseHandler} fallback the handler inherited from the transport or default + * @param {unknown} value the configured handler, if any * @returns {HTTPResponseHandler} the handler to run */ -function responseHandlerFrom( - value: unknown, fallback: HTTPResponseHandler, -): HTTPResponseHandler { +function responseHandlerFrom(value: unknown): HTTPResponseHandler { if (value === undefined || value === null) { - return fallback; + return (response) => response.text(); } if (typeof value !== "function") { throw new TypeError("options.responseHandler must be a function"); diff --git a/src/transport/signal.ts b/src/transport/signal.ts index 14dd50a2..0760a1ec 100644 --- a/src/transport/signal.ts +++ b/src/transport/signal.ts @@ -4,9 +4,8 @@ */ /** - * Check a signal supplied by a caller, whether it was given to a transport, to a single send, - * or to an emitter wrapper, by its platform brand rather than the interface prototype of this - * realm + * Check a signal supplied to a message or emitter wrapper by its platform brand rather than + * the interface prototype of this realm * * @param {unknown} value the signal supplied by the caller, if any * @returns {AbortSignal|undefined} the signal, or undefined when none was supplied diff --git a/test/integration/emitter_factory_test.ts b/test/integration/emitter_factory_test.ts index 24802734..6d188f4d 100644 --- a/test/integration/emitter_factory_test.ts +++ b/test/integration/emitter_factory_test.ts @@ -74,6 +74,15 @@ function gotEmitter(message: Message, options?: Options): Promise { } describe("emitterFor() defaults", () => { + it("Preserves custom transport options and return types", async () => { + const transport: TransportFunction = async (_message, options) => { + expect(options?.routingKey).to.equal("orders"); + return 42; + }; + const result: number = await emitterFor(transport)(fixture, { routingKey: "orders" }); + expect(result).to.equal(42); + }); + it("Keeps CloudEvent header arrays in custom transport options", async () => { const transport: TransportFunction = async (_message, options) => { expect(options?.headers?.["x-tenant-id"]).to.deep.equal(["store-42", "store-99"]); diff --git a/test/integration/http_transport_test.ts b/test/integration/http_transport_test.ts index 0799f5e8..653c95a8 100644 --- a/test/integration/http_transport_test.ts +++ b/test/integration/http_transport_test.ts @@ -13,12 +13,14 @@ import { json, text } from "stream/consumers"; import { runInNewContext } from "vm"; import { - CONSTANTS, FetchHeadersInit, FetchRequestInit, Headers as CloudEventHeaders, HTTPTransportError, + CONSTANTS, Headers as CloudEventHeaders, HTTPTransportError, HTTPTransportOptions, Message, Mode, emitterFor, httpTransport, } from "../../src"; import { assertStructured, fixture } from "./emitter_factory_test"; type Handler = (request: IncomingMessage, response: ServerResponse) => void | Promise; +type FetchRequestInit = NonNullable[1]>; +type FetchHeadersInit = NonNullable; // nock cannot intercept fetch, so these tests use a local server @@ -56,6 +58,7 @@ describe("Built-in HTTP transport", () => { expect(response.headers.get("x-request-id")).to.equal("receipt-7"); expect(response.bodyUsed).to.equal(true); expect(body).to.equal("accepted"); + expectType(body); expect(receivedHeaders?.["x-request-id"]).to.equal("order-123"); expect(receivedHeaders?.["content-type"]).to.equal(CONSTANTS.DEFAULT_CONTENT_TYPE); expect(receivedHeaders?.["ce-id"]).to.equal(fixture.id); @@ -147,7 +150,7 @@ describe("Built-in HTTP transport", () => { }); }); - it("Infers bodies from transport and per-send response handlers", async () => { + it("Infers bodies from the transport response handler", async () => { await withServer((_request, response) => { response.writeHead(202); response.end("42"); @@ -158,15 +161,15 @@ describe("Built-in HTTP transport", () => { const configured = await emit(fixture); expectType<{ receipt: number } | undefined>(configured.body); - // @ts-expect-error the transport handler determines the default body type + // @ts-expect-error the transport handler determines the body type expectType(configured.body); expect(configured.body).to.deep.equal({ receipt: 42 }); - const overridden = await emit(fixture, { responseHandler: (response) => response.text() }); - expectType(overridden.body); - // @ts-expect-error the per-send handler replaces the transport body type for this call - expectType<{ receipt: number } | undefined>(overridden.body); - expect(overridden.body).to.equal("42"); + const withOptions = await emit(fixture, { + headers: { "x-request-id": "order-123" }, signal: new AbortController().signal, + }); + expectType<{ receipt: number } | undefined>(withOptions.body); + expect(withOptions.body).to.deep.equal({ receipt: 42 }); }); }); @@ -175,10 +178,10 @@ describe("Built-in HTTP transport", () => { response.writeHead(202); response.end("not needed"); }, async (url) => { - const emit = emitterFor(httpTransport(url)); - const result = await emit(fixture, { + const emit = emitterFor(httpTransport(url, { responseHandler: async (response) => { await response.body?.cancel(); }, - }); + })); + const result = await emit(fixture); expectType(result.body); expect(result.body).to.equal(undefined); @@ -190,11 +193,10 @@ describe("Built-in HTTP transport", () => { it("Lets a custom response handler hand its stream to the caller", async () => { await withServer(streamEvent, async (url) => { const controller = new AbortController(); - const emit = emitterFor(httpTransport(url)); - const result = await emit(fixture, { - signal: controller.signal, + const emit = emitterFor(httpTransport(url, { responseHandler: async (response) => response.body, - }); + })); + const result = await emit(fixture, { signal: controller.signal }); expectType | null | undefined>(result.body); expect(result.response.bodyUsed).to.equal(false); @@ -211,10 +213,10 @@ describe("Built-in HTTP transport", () => { response.writeHead(202); response.end("not a receipt"); }, async (url) => { - const emit = emitterFor(httpTransport(url)); - const result = await emit(fixture, { + const emit = emitterFor(httpTransport(url, { responseHandler: async () => { throw handlerError; }, - }); + })); + const result = await emit(fixture); expect(result.response.status).to.equal(202); expect(result.response.bodyUsed).to.equal(true); @@ -343,8 +345,9 @@ describe("Built-in HTTP transport", () => { }); }); - it("Passes standard Fetch options to fetch", async () => { + it("Passes standard and platform-specific Fetch options to fetch", async () => { let receivedOptions: FetchRequestInit | undefined; + const platformOptions = { dispatcher: {} }; await withFetch(async (_input, options) => { receivedOptions = options; @@ -352,6 +355,7 @@ describe("Built-in HTTP transport", () => { }, async () => { const emit = emitterFor(httpTransport("https://events.example.com/orders", { fetchOptions: { + ...platformOptions, cache: "no-store", credentials: "include", redirect: "error", @@ -364,6 +368,7 @@ describe("Built-in HTTP transport", () => { expect(receivedOptions?.credentials).to.equal("include"); expect(receivedOptions?.redirect).to.equal("error"); expect(receivedOptions?.method).to.equal("POST"); + expect(receivedOptions).to.include(platformOptions); }); it("Keeps the manual redirect when fetchOptions leaves redirect undefined", async () => { @@ -508,14 +513,13 @@ describe("Built-in HTTP transport", () => { response.writeHead(202); response.write("partial"); }, async (url) => { - const emit = emitterFor(httpTransport(url)); - const emitted = emit(fixture, { - signal: controller.signal, + const emit = emitterFor(httpTransport(url, { responseHandler: async (response) => { markHandlerStarted(); return response.text(); }, - }); + })); + const emitted = emit(fixture, { signal: controller.signal }); await handlerStarted; controller.abort(new DOMException("deadline exceeded", "TimeoutError")); @@ -543,28 +547,36 @@ describe("Built-in HTTP transport", () => { }); }); - it("Reports an abort from the transport signal", async () => { + it("Reports an abort from a per-send signal", async () => { const controller = new AbortController(); - await withServer(() => controller.abort(new Error("shutting down")), async (url) => { - const emit = emitterFor(httpTransport(url, { signal: controller.signal })); - const error = await transportErrorFrom(emit(fixture)); + await withServer(() => controller.abort(new Error("send stopped")), async (url) => { + const emit = emitterFor(httpTransport(url)); + const error = await transportErrorFrom(emit(fixture, { signal: controller.signal })); expect(error.kind).to.equal("aborted"); expect(error.response).to.equal(undefined); - expect((error.cause as Error).message).to.equal("shutting down"); + expect((error.cause as Error).message).to.equal("send stopped"); }); }); - it("Reports an abort from a per-send signal", async () => { + it("Keeps the transport available after one concurrent message is aborted", async () => { const controller = new AbortController(); - - await withServer(() => controller.abort(), async (url) => { + await withServer((request, response) => { + if (request.headers["ce-id"] === "cancelled") { + controller.abort(new Error("cancel one message")); + } else { + acceptEvent(request, response); + } + }, async (url) => { const emit = emitterFor(httpTransport(url)); - const error = await transportErrorFrom(emit(fixture, { signal: controller.signal })); - - expect(error.kind).to.equal("aborted"); - expect(error.cause).not.to.equal(undefined); + const cancelled = transportErrorFrom(emit(fixture.cloneWith({ id: "cancelled" }), { + signal: controller.signal, + })); + const other = emit(fixture.cloneWith({ id: "other" })); + expect((await cancelled).kind).to.equal("aborted"); + expect((await other).response.status).to.equal(204); + expect((await emit(fixture)).response.status).to.equal(204); }); }); @@ -588,55 +600,14 @@ describe("Built-in HTTP transport", () => { controller.abort(); await withServer(() => { requestCount++; }, async (url) => { - const emit = emitterFor(httpTransport(url, { signal: controller.signal })); - const error = await transportErrorFrom(emit(fixture)); + const emit = emitterFor(httpTransport(url)); + const error = await transportErrorFrom(emit(fixture, { signal: controller.signal })); expect(error.kind).to.equal("aborted"); expect(requestCount).to.equal(0); }); }); - it("Uses the first reason when both signals are already aborted", async () => { - const transport = new AbortController(); - const send = new AbortController(); - transport.abort(new Error("transport stopped first")); - send.abort(new Error("send stopped second")); - - const emit = emitterFor(httpTransport(UNREACHABLE_URL, { signal: transport.signal })); - const error = await transportErrorFrom(emit(fixture, { signal: send.signal })); - - expect(error.kind).to.equal("aborted"); - expect((error.cause as Error).message).to.equal("transport stopped first"); - }); - - it("Sends with a transport signal and a per-send signal set at once", async () => { - const transport = new AbortController(); - - await withServer(acceptEvent, async (url) => { - const emit = emitterFor(httpTransport(url, { signal: transport.signal })); - const { response } = await emit(fixture, { signal: new AbortController().signal }); - - expect(response.status).to.equal(204); - expect(transport.signal.aborted).to.equal(false); - }); - }); - - it("Reports an abort from either signal when both are set", async () => { - for (const abortedSignal of ["transport", "per-send"]) { - const transport = new AbortController(); - const send = new AbortController(); - const aborting = abortedSignal === "transport" ? transport : send; - - await withServer(() => aborting.abort(new Error(`${abortedSignal} gave up`)), async (url) => { - const emit = emitterFor(httpTransport(url, { signal: transport.signal })); - const error = await transportErrorFrom(emit(fixture, { signal: send.signal })); - - expect(error.kind).to.equal("aborted"); - expect((error.cause as Error).message).to.equal(`${abortedSignal} gave up`); - }); - } - }); - it("Shares one source listener between concurrent sends and removes it afterward", async () => { const controller = new AbortController(); let releaseRequests = (): void => undefined; @@ -648,8 +619,8 @@ describe("Built-in HTTP transport", () => { await requestsMayComplete; return new Response(null, { status: 204 }); }, async () => { - const emit = emitterFor(httpTransport("https://events.example.com", { signal: controller.signal })); - const emitted = Array.from({ length: 20 }, () => emit(fixture)); + const emit = emitterFor(httpTransport("https://events.example.com")); + const emitted = Array.from({ length: 20 }, () => emit(fixture, { signal: controller.signal })); try { expect(getEventListeners(controller.signal, "abort")).to.have.length(1); @@ -663,9 +634,9 @@ describe("Built-in HTTP transport", () => { }); }); - it("Fans a shared transport abort out to every concurrent send", async () => { + it("Fans a shared message signal out to every concurrent send", async () => { const controller = new AbortController(); - const reason = new Error("transport shutting down"); + const reason = new Error("shutting down"); await withFetch(async (_input, options) => new Promise((_resolve, reject) => { const signal = options?.signal; @@ -675,8 +646,10 @@ describe("Built-in HTTP transport", () => { } signal.addEventListener("abort", () => reject(signal.reason), { once: true }); }), async () => { - const emit = emitterFor(httpTransport("https://events.example.com", { signal: controller.signal })); - const emitted = Array.from({ length: 20 }, () => transportErrorFrom(emit(fixture))); + const emit = emitterFor(httpTransport("https://events.example.com")); + const emitted = Array.from({ length: 20 }, () => transportErrorFrom(emit(fixture, { + signal: controller.signal, + }))); try { expect(getEventListeners(controller.signal, "abort")).to.have.length(1); @@ -694,29 +667,50 @@ describe("Built-in HTTP transport", () => { }); }); - it("Stops applying a transport signal once the send has resolved", async () => { - const transport = new AbortController(); - - await withServer(streamEvent, async (url) => { - const emit = emitterFor(httpTransport(url, { signal: transport.signal })); - const result = await emit(fixture, { - responseHandler: async (response) => response.body, - }); - - // the transport signal no longer reaches a body the handler handed to the caller - transport.abort(); - expect(await new Response(result.body).text()).to.equal("streamed"); - }); - }); - it("Rejects a per-send signal that is not an AbortSignal", async () => { const emit = emitterFor(httpTransport(UNREACHABLE_URL)); await rejects(emit(fixture, { signal: "not a signal" as unknown as AbortSignal }), TypeError); }); - it("Rejects a per-send response handler that is not a function", async () => { - const emit = emitterFor(httpTransport(UNREACHABLE_URL)); - await rejects(emit(fixture, { responseHandler: "text" }), TypeError); + it("Rejects unsupported transport options when the transport is created", () => { + for (const options of [ + { signal: new AbortController().signal }, { timeout: 1000 }, { timeout: undefined }, + { method: "GET" }, { url: "https://other.example" }, { mode: Mode.STRUCTURED }, + { redirect: "follow" }, { responseHanlder: async () => "receipt" }, + ]) { + const [name] = Object.keys(options); + expect(() => httpTransport(UNREACHABLE_URL, options as never)) + .to.throw(TypeError, `unsupported HTTP transport option: ${name}`); + } + expect(() => httpTransport(UNREACHABLE_URL, { + // @ts-expect-error unsupported transport options are rejected statically + timeout: 1000, + })).to.throw(TypeError, "unsupported HTTP transport option: timeout"); + }); + + it("Rejects unsupported message options in the transport and its emitter", async () => { + await withoutFetch(async () => { + const send = httpTransport(UNREACHABLE_URL); + const emit = emitterFor(send); + for (const options of [ + { fetchOptions: { redirect: "follow" } }, { method: "GET" }, + { url: "https://other.example" }, { mode: Mode.STRUCTURED }, + { responseHandler: async () => 42 }, { responseHandler: undefined }, { timeout: 1000 }, + ]) { + await rejects(send({ headers: {}, body: "" }, options as never), TypeError); + await rejects(emit(fixture, options as never), TypeError); + } + // @ts-expect-error Fetch options belong to the transport + await rejects(emit(fixture, { fetchOptions: { redirect: "follow" } }), TypeError); + // @ts-expect-error the HTTP method is fixed by the transport + await rejects(send({ headers: {}, body: "" }, { method: "GET" }), TypeError); + // @ts-expect-error the sink is fixed by the transport + await rejects(emit(fixture, { url: "https://other.example" }), TypeError); + // @ts-expect-error mode is configured when creating the emitter + await rejects(emit(fixture, { mode: Mode.STRUCTURED }), TypeError); + // @ts-expect-error response handlers are configured when creating the transport + await rejects(emit(fixture, { responseHandler: async () => 42 }), TypeError); + }); }); it("Rejects a per-send header that is not a valid header", async () => { @@ -773,9 +767,6 @@ describe("Built-in HTTP transport", () => { expect(() => httpTransport("https://events.example.com", { headers: new Headers({ "x-tenant-id": "store-42" }), })).not.to.throw(); - expect(() => httpTransport("https://events.example.com", { - signal: "not a signal" as unknown as AbortSignal, - })).to.throw(TypeError, "options.signal must be an AbortSignal"); expect(() => httpTransport("https://events.example.com", { responseHandler: "text" as never, })).to.throw(TypeError, "options.responseHandler must be a function"); @@ -825,6 +816,16 @@ async function withFetch(stub: typeof globalThis.fetch, run: () => Promise } } +// Runs with a Fetch that accepts everything, then checks that nothing reached it +async function withoutFetch(run: () => Promise): Promise { + let requests = 0; + await withFetch(async () => { + requests++; + return new Response(null, { status: 204 }); + }, run); + expect(requests).to.equal(0); +} + export async function withServer(handler: Handler, run: (url: string) => Promise): Promise { const server = createServer((request, response) => { Promise.resolve(handler(request, response)).catch((error) => { From 4659593e4cc4cec4de6bebeecc4ce16b0fa7ff30 Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Sun, 18 Oct 2026 17:39:36 +0900 Subject: [PATCH 24/26] fix: validate CloudEvents header overrides Signed-off-by: kahirokunn --- README.md | 7 + src/schema/validator.ts | 12 + src/transport/emitter.ts | 2 +- src/transport/http/headers.ts | 149 ++++++++++++ src/transport/http/index.ts | 47 +++- test/integration/http_transport_test.ts | 298 +++++++++++++++++++++++- 6 files changed, 500 insertions(+), 15 deletions(-) create mode 100644 src/schema/validator.ts create mode 100644 src/transport/http/headers.ts diff --git a/README.md b/README.md index 8f8b0fbe..24b6e864 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,13 @@ under `fetchOptions`. The options passed to `emit()` apply to that Message only: `TypeError`. To discard a response body, use `responseHandler: async (response) => { await response.body?.cancel(); }`. +Existing `ce-*` and `content-type` headers cannot be changed. New CloudEvents +headers must be valid and, in structured mode, match the body. + +Other headers, such as `authorization`, `traceparent` and `baggage`, can be added +or overridden. `host` and `content-length` are controlled by Fetch and are +rejected. Invalid headers reject with a `TypeError` before the request is sent. + There is no timeout option: a deadline is an `AbortSignal` passed with the message. diff --git a/src/schema/validator.ts b/src/schema/validator.ts new file mode 100644 index 00000000..e482b581 --- /dev/null +++ b/src/schema/validator.ts @@ -0,0 +1,12 @@ +/* + Copyright 2021 The CloudEvents Authors + SPDX-License-Identifier: Apache-2.0 +*/ + +import { ErrorObject } from "ajv"; +import compiled from "./v1"; + +type SchemaValidator = ((data: unknown) => boolean) & { errors?: ErrorObject[] | null }; + +// The generated validator sets `errors` at runtime, but its inferred type omits it. +export const validate: SchemaValidator = compiled; diff --git a/src/transport/emitter.ts b/src/transport/emitter.ts index 813564ff..103e6ef6 100644 --- a/src/transport/emitter.ts +++ b/src/transport/emitter.ts @@ -15,7 +15,7 @@ import { EventEmitter } from "events"; export interface Options { /** Aborts the send, for transports that support cancellation */ signal?: AbortSignal; - /** Headers for this send, taking precedence over the ones the binding produced */ + /** Headers for this send, taking precedence over the ones the binding produced except CloudEvents ones */ headers?: THeaders; [key: string]: string | Record | unknown; } diff --git a/src/transport/http/headers.ts b/src/transport/http/headers.ts new file mode 100644 index 00000000..c0bbaef6 --- /dev/null +++ b/src/transport/http/headers.ts @@ -0,0 +1,149 @@ +/* + Copyright 2021 The CloudEvents Authors + SPDX-License-Identifier: Apache-2.0 +*/ + +import CONSTANTS from "../../constants"; +import { V1, V03 } from "../../event/cloudevent"; +import { ValidationError } from "../../event/validation"; +import { Message } from "../../message"; +import { validate } from "../../schema/validator"; + +const SHARED_ATTRIBUTES = ["id", "source", "specversion", "type", "subject", "time", "datacontenttype"]; + +/** + * Check CloudEvents header additions after all caller headers have been merged. + * Messages without added CloudEvents headers and unrelated HTTP headers do not trigger event validation. + * Changes to existing headers have already been rejected by then. + * + * @param {Message} message the message whose body will be sent unchanged + * @param {Headers} original the headers produced by the binding + * @param {Headers} headers the headers that will be sent + * @returns {void} + */ +export function validateHeaderAdditions( + message: Message, original: Headers, headers: Headers, +): void { + const added = new Set(); + headers.forEach((value, name) => { + if (name.startsWith(CONSTANTS.EXTENSIONS_PREFIX) && !original.has(name)) { + added.add(name); + } + }); + const typeAdded = headers.get(CONSTANTS.HEADER_CONTENT_TYPE) !== original.get(CONSTANTS.HEADER_CONTENT_TYPE); + if (added.size === 0 && !typeAdded) { + return; + } + + const type = mediaType(headers); + const attributeValue = (name: string, value: string): string => + added.has(name) ? headerAttribute(value) : value; + if (type.startsWith(CONSTANTS.MIME_CE)) { + if (type !== CONSTANTS.MIME_CE_JSON || typeof message.body !== "string") { + if (added.size > 0) { + throw new TypeError("cannot verify CloudEvents headers against the structured body"); + } + return; + } + let payload: Record; + try { + payload = (JSON.parse(message.body) ?? {}) as Record; + } catch { + throw new TypeError("invalid JSON CloudEvent body"); + } + const version = payload.specversion; + validateAttributes(payload, version); + const attributes = { ...payload }; + headers.forEach((value, name) => { + if (!name.startsWith(CONSTANTS.EXTENSIONS_PREFIX) + || (!typeAdded && !added.has(name))) { + return; + } + const attribute = attributeName(name, version); + const decoded = attributeValue(name, value); + attributes[attribute] = decoded; + const expected = payload[attribute]; + const matches = decoded === String(expected) + || (attribute === CONSTANTS.CE_ATTRIBUTES.TIME + && new Date(decoded).getTime() === new Date(expected as string).getTime()); + if (!Object.prototype.hasOwnProperty.call(payload, attribute) || !matches) { + throw new TypeError(`${name} does not match the structured CloudEvent body`); + } + }); + validateAttributes(attributes, version); + return; + } + + const rawVersion = headers.get(CONSTANTS.CE_HEADERS.SPEC_VERSION); + const version = rawVersion === null ? null : attributeValue(CONSTANTS.CE_HEADERS.SPEC_VERSION, rawVersion); + if (!isKnownVersion(version)) { + return; + } + const attributes: Record = Object.create(null); + headers.forEach((value, name) => { + if (name.startsWith(CONSTANTS.EXTENSIONS_PREFIX)) { + attributes[attributeName(name, version)] = attributeValue(name, value); + } + }); + if (headers.has(CONSTANTS.HEADER_CONTENT_TYPE)) { + attributes[CONSTANTS.CE_ATTRIBUTES.CONTENT_TYPE] = headers.get(CONSTANTS.HEADER_CONTENT_TYPE); + } + validateAttributes(attributes, version); +} + +function isKnownVersion(version: unknown): boolean { + return version === V1 || version === V03; +} + +function mediaType(headers: Headers): string { + return (headers.get(CONSTANTS.HEADER_CONTENT_TYPE) ?? "").split(";", 1)[0].trim().toLowerCase(); +} + +function attributeName(name: string, version: unknown): string { + const attribute = name.slice(CONSTANTS.EXTENSIONS_PREFIX.length); + // 1.0 sends datacontenttype as content-type, never as a ce- header + if (version === V1 && (!/^[a-z0-9]+$/.test(attribute) || attribute === CONSTANTS.CE_ATTRIBUTES.CONTENT_TYPE)) { + throw new TypeError(`invalid CloudEvents 1.0 header: ${name}`); + } + return attribute; +} + +// Accept older quoted header forms before percent-decoding. +function headerAttribute(value: string): string { + const unquoted = value.startsWith("\"") && value.endsWith("\"") + ? value.slice(1, -1).replace(/\\(.)/g, "$1") + : value; + try { + return decodeURIComponent(unquoted); + } catch { + throw new TypeError("CloudEvents header values must use valid UTF-8 percent encoding"); + } +} + +// Validate raw attributes before constructor defaults or parser corrections. +function validateAttributes(attributes: Record, version: unknown): void { + if (typeof version === "string" && version !== "" && !isKnownVersion(version)) { + return; + } + let checked = attributes; + if (version === V03) { + // Only the shared attributes use the 1.0 schema. 0.3 also permits map + // extensions and has different schema and content-encoding attributes. + checked = {}; + for (const name of SHARED_ATTRIBUTES) { + if (Object.prototype.hasOwnProperty.call(attributes, name)) { + checked[name] = attributes[name]; + } + } + } + if (!validate(checked)) { + throw new ValidationError("invalid HTTP CloudEvents attributes", validate.errors); + } + if (version === V1) { + for (const name of Object.keys(attributes)) { + if (name !== CONSTANTS.STRUCTURED_ATTRS_1.DATA_BASE64 && !/^[a-z0-9]+$/.test(name)) { + throw new TypeError(`invalid CloudEvents attribute name: ${name}`); + } + } + } +} diff --git a/src/transport/http/index.ts b/src/transport/http/index.ts index 529f8e01..d352154d 100644 --- a/src/transport/http/index.ts +++ b/src/transport/http/index.ts @@ -4,8 +4,10 @@ */ import { Headers as CloudEventHeaders, Message } from "../../message"; +import CONSTANTS from "../../constants"; import { Options, TransportFunction } from "../emitter"; import { combineSignals, signalFrom } from "../signal"; +import { validateHeaderAdditions } from "./headers"; /** The request options accepted by the Fetch implementation in the current environment */ type FetchRequestInit = NonNullable[1]>; @@ -20,7 +22,7 @@ export type HTTPResponseHandler = (response: Response) => Promise; * Options applied to every request sent by an HTTP transport */ export interface HTTPTransportOptions { - /** HTTP headers applied to every request, per-send headers take precedence */ + /** HTTP headers applied to every request, per-send headers take precedence but neither can change CloudEvents ones */ headers?: FetchHeadersInit; /** Fetch options applied to every request, apart from the ones this transport controls */ fetchOptions?: Omit; @@ -159,7 +161,7 @@ export function httpTransport( } const sendSignal = signalFrom(sendOptions?.signal); const headers = requestHeaders( - sinkHeaders, message.headers, transportHeaders, headersFrom(sendOptions?.headers), + sinkHeaders, message, transportHeaders, headersFrom(sendOptions?.headers), ); const combinedSignal = combineSignals(sendSignal); try { @@ -253,21 +255,26 @@ function validateHTTPURL(sink: string | URL): URL { * Merge the headers for a single request * * @param {Headers} sinkHeaders the headers built from the sink URL, if it carried credentials - * @param {CloudEventHeaders} messageHeaders the headers of the event Message + * @param {Message} message the event Message * @param {Headers} transportHeaders the headers configured on this transport, if any * @param {Headers} sendHeaders the headers supplied with this send, if any * @returns {Headers} the headers to send */ function requestHeaders( - sinkHeaders: Headers | undefined, messageHeaders: CloudEventHeaders, + sinkHeaders: Headers | undefined, message: Message, transportHeaders?: Headers, sendHeaders?: Headers, ): Headers { const headers = new Headers(); // lowest precedence first: sink credentials, binding, transport, this send setHeaders(headers, sinkHeaders); - setHeaders(headers, messageHeaders); + setHeaders(headers, message.headers); + if (transportHeaders === undefined && sendHeaders === undefined) { + return headers; + } + const original = new Headers(headers); setHeaders(headers, transportHeaders); setHeaders(headers, sendHeaders); + validateHeaderAdditions(message, original, headers); return headers; } @@ -334,7 +341,7 @@ function headersFrom(source: unknown): Headers | undefined { } /** - * Copy headers onto a target, replacing any that are already there + * Merge headers, rejecting changes to CloudEvents headers and the ones Fetch controls * * @param {Headers} target the headers being built * @param {CloudEventHeaders|Headers} source the headers to copy, undefined ones are ignored @@ -344,16 +351,34 @@ function setHeaders(target: Headers, source?: CloudEventHeaders | Headers): void if (source === undefined) { return; } - if (source instanceof Headers) { - source.forEach((value, name) => target.set(name, value)); - return; - } + const headers = source instanceof Headers ? source : normalizeHeaders(source); + headers.forEach((value, name) => { + if (name === "host" || name === "content-length") { + throw new TypeError(`${name} is controlled by Fetch`); + } + if ((name.startsWith(CONSTANTS.EXTENSIONS_PREFIX) || name === CONSTANTS.HEADER_CONTENT_TYPE) + && target.has(name)) { + throw new TypeError(`cannot override CloudEvents header: ${name}`); + } + target.set(name, value); + }); +} + +/** + * Collect the headers of a Message, so names are lowercased and a repeated name keeps its last value + * + * @param {CloudEventHeaders} source the headers of the Message + * @returns {Headers} the headers, without the undefined ones + */ +function normalizeHeaders(source: CloudEventHeaders): Headers { + const headers = new Headers(); for (const [name, value] of Object.entries(source as Record)) { const headerValue = headerValueFrom(value); if (headerValue !== undefined) { - target.set(name, headerValue); + headers.set(name, headerValue); } } + return headers; } /** diff --git a/test/integration/http_transport_test.ts b/test/integration/http_transport_test.ts index 653c95a8..02a1eb5d 100644 --- a/test/integration/http_transport_test.ts +++ b/test/integration/http_transport_test.ts @@ -13,8 +13,8 @@ import { json, text } from "stream/consumers"; import { runInNewContext } from "vm"; import { - CONSTANTS, Headers as CloudEventHeaders, HTTPTransportError, HTTPTransportOptions, - Message, Mode, emitterFor, httpTransport, + CloudEvent, CONSTANTS, Headers as CloudEventHeaders, HTTPTransportError, HTTPTransportOptions, + HTTP, Message, Mode, emitterFor, httpTransport, } from "../../src"; import { assertStructured, fixture } from "./emitter_factory_test"; @@ -228,17 +228,27 @@ describe("Built-in HTTP transport", () => { it("Applies transport headers and lets per-send headers override them", async () => { const { received: receivedHeaders, handler } = headerCollector(); + const tracing = { + traceparent: `00-${"a".repeat(32)}-${"b".repeat(16)}-01`, + tracestate: "vendor=old", baggage: "tenant=store-42", + }; + const sendTracing = { + traceparent: `00-${"c".repeat(32)}-${"d".repeat(16)}-01`, + tracestate: "vendor=new", baggage: "tenant=store-99,region=jp", + }; + await withServer(handler, async (url) => { const emit = emitterFor(httpTransport(url, { headers: new Headers({ authorization: "Bearer transport-token", "x-tenant-id": "store-42", + ...tracing, }), })); await emit(fixture); await emit(fixture, { - headers: { "x-tenant-id": "store-99", "x-request-id": "order-123" }, + headers: { "x-tenant-id": "store-99", "x-request-id": "order-123", ...sendTracing }, }); expect(receivedHeaders[0]?.authorization).to.equal("Bearer transport-token"); @@ -246,11 +256,293 @@ describe("Built-in HTTP transport", () => { expect(receivedHeaders[1]?.authorization).to.equal("Bearer transport-token"); expect(receivedHeaders[1]?.["x-tenant-id"]).to.equal("store-99"); expect(receivedHeaders[1]?.["x-request-id"]).to.equal("order-123"); + expect(receivedHeaders[0]).to.include(tracing); + expect(receivedHeaders[1]).to.include(sendTracing); // a header neither layer set keeps the value the binding produced expect(receivedHeaders[1]?.["ce-type"]).to.equal(fixture.type); }); }); + it("Accepts new binary attributes", async () => { + const { received, handler } = headerCollector(); + await withServer(handler, async (url) => { + const emit = emitterFor(httpTransport(url, { + headers: { "ce-tenant": "store-42" }, + })); + await emit(fixture, { + headers: { + "ce-region": "jp", "ce-subject": "order-123", + }, + }); + expect(received[0]?.["ce-id"]).to.equal(fixture.id); + expect(received[0]?.["ce-tenant"]).to.equal("store-42"); + expect(received[0]?.["ce-region"]).to.equal("jp"); + expect(received[0]?.["ce-subject"]).to.equal("order-123"); + expect(received[0]?.["content-type"]).to.equal(CONSTANTS.DEFAULT_CONTENT_TYPE); + }); + }); + + it("Rejects duplicate CloudEvents headers even with identical values", async () => { + const repeated: Array<[Mode, string, string]> = [ + [Mode.BINARY, "CE-ID", fixture.id], + [Mode.BINARY, "ce-id", ` ${fixture.id} `], + [Mode.BINARY, "ce-lunch", String(fixture.lunch)], + [Mode.BINARY, "Content-Type", CONSTANTS.DEFAULT_CONTENT_TYPE], + [Mode.STRUCTURED, "Content-Type", CONSTANTS.DEFAULT_CE_CONTENT_TYPE], + ]; + await withoutFetch(async () => { + for (const [mode, name, value] of repeated) { + const headers = { [name]: value }; + const error = { name: "TypeError", message: `cannot override CloudEvents header: ${name.toLowerCase()}` }; + await rejects(emitterFor(httpTransport(UNREACHABLE_URL, { headers }), { mode })(fixture), error); + await rejects(emitterFor(httpTransport(UNREACHABLE_URL), { mode })(fixture, { headers }), error); + } + }); + }); + + it("Rejects changes to existing CloudEvents headers at either option level", async () => { + const changes = { + "CE-ID": "another-id", "ce-source": "/another-source", "ce-type": "another.type", + "ce-specversion": "0.3", "ce-lunch": "ramen", "content-type": "text/plain", + }; + await withoutFetch(async () => { + for (const [name, value] of Object.entries(changes)) { + const error = { name: "TypeError", message: `cannot override CloudEvents header: ${name.toLowerCase()}` }; + await rejects(emitterFor(httpTransport(UNREACHABLE_URL, { headers: { [name]: value } }))(fixture), error); + await rejects(emitterFor(httpTransport(UNREACHABLE_URL))(fixture, { headers: { [name]: value } }), error); + } + for (const specversion of ["0.3", "11.8"]) { + await rejects(emitterFor(httpTransport(UNREACHABLE_URL))(fixture.cloneWith({ specversion }), { + headers: { "ce-id": "another-id" }, + }), TypeError); + } + }); + }); + + it("Rejects transport overrides even if the per-send headers restore the original value", async () => { + await withoutFetch(async () => { + const emit = emitterFor(httpTransport(UNREACHABLE_URL, { headers: { "ce-id": "another-id" } })); + await rejects(emit(fixture, { headers: { "ce-id": fixture.id } }), { + name: "TypeError", message: "cannot override CloudEvents header: ce-id", + }); + }); + }); + + it("Rejects per-send overrides of CloudEvents attributes added by the transport", async () => { + await withoutFetch(async () => { + const emit = emitterFor(httpTransport(UNREACHABLE_URL, { headers: { "ce-tenant": "store-42" } })); + for (const value of ["store-42", "store-99"]) { + await rejects(emit(fixture, { headers: { "CE-TENANT": value } }), { + name: "TypeError", message: "cannot override CloudEvents header: ce-tenant", + }); + } + }); + }); + + it("Rejects host and content-length from Messages and either option level", async () => { + await withoutFetch(async () => { + for (const [name, value] of [["Host", "other.example.com"], ["Content-Length", "1"]]) { + const error = { name: "TypeError", message: `${name.toLowerCase()} is controlled by Fetch` }; + const message = HTTP.binary(fixture); + message.headers[name] = value; + await rejects(httpTransport(UNREACHABLE_URL)(message), error); + await rejects(emitterFor(httpTransport(UNREACHABLE_URL, { headers: { [name]: value } }))(fixture), error); + await rejects(emitterFor(httpTransport(UNREACHABLE_URL))(fixture, { headers: { [name]: value } }), error); + } + }); + }); + + it("Keeps binding attribute values when validating additional headers", async () => { + const { received, handler } = headerCollector(); + const headers = { "ce-tenant": "shop" }; + await withServer(handler, async (url) => { + for (const source of ["/orders/a%20b", "/orders/%E3%81%82"]) { + const event = fixture.cloneWith({ source, tracestate: "vendor=25%" }); + await emitterFor(httpTransport(url, { headers }))(event); + await emitterFor(httpTransport(url))(event, { headers }); + for (const requestHeaders of received.slice(-2)) { + expect(requestHeaders["ce-source"]).to.equal(source); + expect(requestHeaders["ce-tracestate"]).to.equal("vendor=25%"); + } + } + expect(received).to.have.length(4); + }); + }); + + it("Rejects invalid CloudEvents header additions before calling Fetch", async () => { + const invalid: FetchHeadersInit[] = [ + { "ce-subject": "" }, + { "ce-dataschema": "/relative" }, + { "ce-bad-extension": "value" }, + { "ce-data_base64": "ZGF0YQ==" }, + { "ce-datacontenttype": "text/plain" }, + ]; + await withoutFetch(async () => { + for (const headers of invalid) { + await rejects(emitterFor(httpTransport(UNREACHABLE_URL, { headers }))(fixture), TypeError); + await rejects(emitterFor(httpTransport(UNREACHABLE_URL))(fixture, { headers }), TypeError); + } + const message = HTTP.binary(fixture); + delete message.headers["ce-time"]; + await rejects(httpTransport(UNREACHABLE_URL)(message, { headers: { "ce-time": "not a timestamp" } }), TypeError); + }); + }); + + it("Accepts structured metadata headers that match the body", async () => { + const { received, handler } = headerCollector(); + const event = new CloudEvent({ + id: "event-42", source: "/account/%2F", type: "order.created", tenant: "store-42", + time: "2026-10-18T00:00:00Z", + }); + await withServer(handler, async (url) => { + const emit = emitterFor(httpTransport(url), { mode: Mode.STRUCTURED }); + await emit(event, { + headers: new Headers({ + "CE-ID": event.id, + "ce-source": "/account/%252F", + "ce-type": event.type, + "ce-time": "2026-10-18T09:00:00+09:00", + "ce-tenant": "store-42", + }), + }); + expect(received[0]?.["ce-id"]).to.equal(event.id); + expect(received[0]?.["ce-tenant"]).to.equal(event.tenant); + expect(received[0]?.["content-type"]).to.equal(CONSTANTS.DEFAULT_CE_CONTENT_TYPE); + }); + }); + + it("Rejects content-type changes including casing and media type parameters", async () => { + const error = { name: "TypeError", message: "cannot override CloudEvents header: content-type" }; + await withoutFetch(async () => { + for (const mode of [Mode.BINARY, Mode.STRUCTURED]) { + const type = mode === Mode.BINARY ? CONSTANTS.DEFAULT_CONTENT_TYPE : CONSTANTS.DEFAULT_CE_CONTENT_TYPE; + for (const value of [type.toUpperCase(), `${type}; charset=UTF-8`]) { + const headers = { "Content-Type": value }; + await rejects(emitterFor(httpTransport(UNREACHABLE_URL, { headers }), { mode })(fixture), error); + await rejects(emitterFor(httpTransport(UNREACHABLE_URL), { mode })(fixture, { headers }), error); + } + } + }); + }); + + it("Validates added structured metadata without reinterpreting existing headers", async () => { + const event = fixture.cloneWith({ source: "/orders/a%20b", tracestate: "vendor=25%", tenant: "shop" }); + const message = HTTP.structured(event); + message.headers["ce-source"] = "/orders/a%2520b"; + message.headers["ce-tracestate"] = "vendor=25%25"; + const { received, handler } = headerCollector(); + await withServer(handler, async (url) => { + await httpTransport(url)(message, { headers: { "ce-tenant": "shop" } }); + expect(received[0]?.["ce-source"]).to.equal("/orders/a%2520b"); + expect(received[0]?.["ce-tracestate"]).to.equal("vendor=25%25"); + expect(received[0]?.["ce-tenant"]).to.equal("shop"); + }); + }); + + it("Checks structured additions against the body without imposing 1.0 rules on other versions", async () => { + const { received, handler } = headerCollector(); + await withServer(handler, async (url) => { + const emit = emitterFor(httpTransport(url), { mode: Mode.STRUCTURED }); + for (const specversion of ["0.3", "11.8"]) { + const event = new CloudEvent({ + ...fixture, specversion, tenant: "store-42", "map-key": "value", + }, false); + await emit(event, { headers: { "ce-tenant": "store-42", "ce-map-key": "value" } }); + await rejects(emit(event, { headers: { "ce-tenant": "store-99" } }), { + name: "TypeError", message: "ce-tenant does not match the structured CloudEvent body", + }); + } + expect(received).to.have.length(2); + }); + }); + + it("Rejects headers that conflict with the structured body before calling Fetch", async () => { + await withoutFetch(async () => { + const invalid: FetchHeadersInit[] = [ + { "ce-id": "different-event" }, + { "ce-tenant": "not-in-the-body" }, + { "ce-datacontenttype": "application/json" }, + ]; + const structured = emitterFor(httpTransport(UNREACHABLE_URL), { mode: Mode.STRUCTURED }); + for (const headers of invalid) { + await rejects(structured(fixture, { headers }), TypeError); + const configured = emitterFor(httpTransport(UNREACHABLE_URL, { headers }), { mode: Mode.STRUCTURED }); + await rejects(configured(fixture), TypeError); + } + const midnight = fixture.cloneWith({ time: "2026-10-18T00:00:00Z" }); + await rejects(structured(midnight, { headers: { "ce-time": "2026-10-18" } }), TypeError); + }); + }); + + it("Forwards opaque structured bodies unread and rejects metadata additions it cannot verify", async () => { + let reads = 0; + const stream = new ReadableStream({ + pull: () => { reads++; }, + }, { highWaterMark: 0 }); + const messages: Message[] = [ + { headers: { "content-type": CONSTANTS.DEFAULT_CE_CONTENT_TYPE }, body: stream }, + { headers: { "content-type": "application/cloudevents+avro" }, body: new Uint8Array([1, 2, 3]) }, + ]; + let requests = 0; + await withFetch(async (_input, options) => { + expect(options?.body).to.equal(messages[requests++].body); + return new Response(null, { status: 204 }); + }, async () => { + const send = httpTransport(UNREACHABLE_URL); + for (const message of messages) { + await rejects(send(message, { headers: { "ce-id": fixture.id } }), { + name: "TypeError", message: "cannot verify CloudEvents headers against the structured body", + }); + await send(message, { headers: { baggage: "tenant=store-42" } }); + } + }); + expect(requests).to.equal(messages.length); + expect(reads).to.equal(0); + expect(stream.locked).to.equal(false); + }); + + it("Does not apply 1.0 extension naming or reserved header rules to other versions", async () => { + const { received, handler } = headerCollector(); + await withServer(handler, async (url) => { + const emit = emitterFor(httpTransport(url)); + await emit(fixture.cloneWith({ specversion: "0.3" }), { + headers: { "ce-map-key": "value", "ce-datacontenttype": "legacy-value" }, + }); + await emit(fixture.cloneWith({ specversion: "11.8" }), { + headers: { "ce-datacontenttype": "future-value" }, + }); + expect(received[0]?.["ce-map-key"]).to.equal("value"); + expect(received[1]?.["ce-datacontenttype"]).to.equal("future-value"); + }); + }); + + it("Accepts encoded and quoted attribute values without rewriting the wire headers", async () => { + const { received, handler } = headerCollector(); + await withServer(handler, async (url) => { + const message = HTTP.binary(fixture); + delete message.headers["ce-specversion"]; + for (const version of ["1%2E0", "\"1.0\""]) { + await httpTransport(url)(message, { + headers: { + "ce-subject": "order%20%E2%82%AC", "ce-tenant": "\"quoted\\\"tenant\"", "ce-specversion": version, + }, + }); + } + expect(received[0]?.["ce-subject"]).to.equal("order%20%E2%82%AC"); + expect(received[0]?.["ce-tenant"]).to.equal("\"quoted\\\"tenant\""); + expect(received.map((headers) => headers["ce-specversion"])).to.deep.equal(["1%2E0", "\"1.0\""]); + }); + }); + + it("Rejects malformed UTF-8 encodings in added attribute headers", async () => { + await withoutFetch(async () => { + const emit = emitterFor(httpTransport(UNREACHABLE_URL)); + await rejects(emit(fixture, { headers: { "ce-tenant": "%FF" } }), { + name: "TypeError", message: "CloudEvents header values must use valid UTF-8 percent encoding", + }); + }); + }); + it("Sends credentials from the sink URL as an authorization header", async () => { const { received: receivedHeaders, handler } = headerCollector(); From 81df20601a48e01eb6811c630891691b46d1cd9d Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Sun, 18 Oct 2026 17:40:12 +0900 Subject: [PATCH 25/26] refactor: type the compiled schema validator errors Signed-off-by: kahirokunn --- src/event/spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/event/spec.ts b/src/event/spec.ts index 042da8ed..5ea3adbb 100644 --- a/src/event/spec.ts +++ b/src/event/spec.ts @@ -7,13 +7,13 @@ import { ValidationError } from "./validation"; import { CloudEventV1 } from "./interfaces"; import { V1 } from "./cloudevent"; -import validate from "../schema/v1"; +import { validate } from "../schema/validator"; export function validateCloudEvent(event: CloudEventV1): boolean { if (event.specversion === V1) { if (!validate(event)) { - throw new ValidationError("invalid payload", (validate as any).errors); + throw new ValidationError("invalid payload", validate.errors); } } else { return false; From 8dc7749a52c0e431bb5500a5c12024318d2fe9c1 Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Sun, 18 Oct 2026 17:40:53 +0900 Subject: [PATCH 26/26] refactor: remove redundant type assertions Signed-off-by: kahirokunn --- src/event/cloudevent.ts | 4 ++-- src/message/mqtt/index.ts | 2 +- src/transport/http/index.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/event/cloudevent.ts b/src/event/cloudevent.ts index 25de580e..3ea56ef9 100644 --- a/src/event/cloudevent.ts +++ b/src/event/cloudevent.ts @@ -62,10 +62,10 @@ export class CloudEvent implements CloudEventV1 { delete properties.time; this.type = properties.type as string; - delete (properties as any).type; + delete properties.type; this.source = properties.source as string; - delete (properties as any).source; + delete properties.source; this.specversion = (properties.specversion) || V1; delete properties.specversion; diff --git a/src/message/mqtt/index.ts b/src/message/mqtt/index.ts index f576c567..121323d4 100644 --- a/src/message/mqtt/index.ts +++ b/src/message/mqtt/index.ts @@ -101,7 +101,7 @@ function MQTTMessageFactory(contentType: string, headers: Record)) { + for (const [name, value] of Object.entries(source)) { const headerValue = headerValueFrom(value); if (headerValue !== undefined) { headers.set(name, headerValue);