diff --git a/docs/TODO.md b/docs/TODO.md index 7433ec8..857fdb8 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -16,16 +16,17 @@ - [x] Add proper error handling and logging ### 1.2 Fix Interface Definitions -- [ ] Align TypeScript interfaces with project requirements -- [ ] Add missing properties referenced in tests -- [ ] Implement proper validation utilities -- [ ] Create comprehensive error types -- [ ] Add retry mechanism interfaces +- [x] Align TypeScript interfaces with project requirements +- [x] Add missing properties referenced in tests +- [x] Implement proper validation utilities +- [x] Create comprehensive error types +- [x] Add retry mechanism interfaces ### 1.3 Fix Test Suite -- [ ] Update all test files to match current interfaces -- [ ] Implement proper mock objects -- [ ] Fix TypeScript compilation errors +- [x] Update all test files to match current interfaces +- [x] Implement proper mock objects +- [x] Fix TypeScript compilation errors +- [ ] Fix test execution issues (plugin registration, validation) - [ ] Ensure 100% test coverage - [ ] Add integration tests for native platforms diff --git a/package-lock.json b/package-lock.json index 0d26bf9..5245c95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,11 +16,14 @@ "@capacitor/cli": "^5.0.0", "@capacitor/ios": "^5.0.0", "@types/jest": "^29.5.0", + "@types/jsdom": "^21.1.7", "@types/node": "^18.15.0", "@typescript-eslint/eslint-plugin": "^5.57.0", "@typescript-eslint/parser": "^5.57.0", "eslint": "^8.37.0", "jest": "^29.5.0", + "jest-environment-jsdom": "^30.0.5", + "jsdom": "^26.1.0", "prettier": "^2.8.7", "rimraf": "^4.4.0", "rollup": "^3.20.0", @@ -43,16 +46,30 @@ "node": ">=6.0.0" } }, + "node_modules/@asamuzakjp/css-color": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-3.2.0.tgz", + "integrity": "sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@csstools/css-calc": "^2.1.3", + "@csstools/css-color-parser": "^3.0.9", + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3", + "lru-cache": "^10.4.3" + } + }, "node_modules/@babel/code-frame": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", - "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.25.9", + "@babel/helper-validator-identifier": "^7.27.1", "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "picocolors": "^1.1.1" }, "engines": { "node": ">=6.9.0" @@ -223,9 +240,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "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==", "dev": true, "license": "MIT", "engines": { @@ -638,6 +655,121 @@ "@capacitor/core": "^5.0.0" } }, + "node_modules/@csstools/color-helpers": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.0.2.tgz", + "integrity": "sha512-JqWH1vsgdGcw2RR6VliXXdA0/59LttzlU8UlRT/iUUsEeWfYq8I+K0yhihEUTTHLRm1EXvpsCx3083EU15ecsA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "engines": { + "node": ">=18" + } + }, + "node_modules/@csstools/css-calc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.4.tgz", + "integrity": "sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-color-parser": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.0.10.tgz", + "integrity": "sha512-TiJ5Ajr6WRd1r8HSiwJvZBiJOqtH86aHpUjq5aEKWHiII2Qfjqd/HCWKPOW8EP4vcspXbHnXrwIDlu5savQipg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "dependencies": { + "@csstools/color-helpers": "^5.0.2", + "@csstools/css-calc": "^2.1.4" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-parser-algorithms": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.5.tgz", + "integrity": "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.4.tgz", + "integrity": "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.5.1", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.5.1.tgz", @@ -1112,6 +1244,228 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/@jest/environment-jsdom-abstract": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/@jest/environment-jsdom-abstract/-/environment-jsdom-abstract-30.0.5.tgz", + "integrity": "sha512-gpWwiVxZunkoglP8DCnT3As9x5O8H6gveAOpvaJd2ATAoSh7ZSSCWbr9LQtUMvr8WD3VjG9YnDhsmkCK5WN1rQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "30.0.5", + "@jest/fake-timers": "30.0.5", + "@jest/types": "30.0.5", + "@types/jsdom": "^21.1.7", + "@types/node": "*", + "jest-mock": "30.0.5", + "jest-util": "30.0.5" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "canvas": "^3.0.0", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/@jest/environment-jsdom-abstract/node_modules/@jest/environment": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.0.5.tgz", + "integrity": "sha512-aRX7WoaWx1oaOkDQvCWImVQ8XNtdv5sEWgk4gxR6NXb7WBUnL5sRak4WRzIQRZ1VTWPvV4VI4mgGjNL9TeKMYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/fake-timers": "30.0.5", + "@jest/types": "30.0.5", + "@types/node": "*", + "jest-mock": "30.0.5" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/environment-jsdom-abstract/node_modules/@jest/fake-timers": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.0.5.tgz", + "integrity": "sha512-ZO5DHfNV+kgEAeP3gK3XlpJLL4U3Sz6ebl/n68Uwt64qFFs5bv4bfEEjyRGK5uM0C90ewooNgFuKMdkbEoMEXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "30.0.5", + "@sinonjs/fake-timers": "^13.0.0", + "@types/node": "*", + "jest-message-util": "30.0.5", + "jest-mock": "30.0.5", + "jest-util": "30.0.5" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/environment-jsdom-abstract/node_modules/@jest/schemas": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-30.0.5.tgz", + "integrity": "sha512-DmdYgtezMkh3cpU8/1uyXakv3tJRcmcXxBOcO0tbaozPwpmh4YMsnWrQm9ZmZMfa5ocbxzbFk6O4bDPEc/iAnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.34.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/environment-jsdom-abstract/node_modules/@jest/types": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.0.5.tgz", + "integrity": "sha512-aREYa3aku9SSnea4aX6bhKn4bgv3AXkgijoQgbYV3yvbiGt6z+MQ85+6mIhx9DsKW2BuB/cLR/A+tcMThx+KLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/pattern": "30.0.1", + "@jest/schemas": "30.0.5", + "@types/istanbul-lib-coverage": "^2.0.6", + "@types/istanbul-reports": "^3.0.4", + "@types/node": "*", + "@types/yargs": "^17.0.33", + "chalk": "^4.1.2" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/environment-jsdom-abstract/node_modules/@sinclair/typebox": { + "version": "0.34.38", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.38.tgz", + "integrity": "sha512-HpkxMmc2XmZKhvaKIZZThlHmx1L0I/V1hWK1NubtlFnr6ZqdiOpV72TKudZUNQjZNsyDBay72qFEhEvb+bcwcA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jest/environment-jsdom-abstract/node_modules/@sinonjs/fake-timers": { + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz", + "integrity": "sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.1" + } + }, + "node_modules/@jest/environment-jsdom-abstract/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/environment-jsdom-abstract/node_modules/ci-info": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.0.tgz", + "integrity": "sha512-l+2bNRMiQgcfILUi33labAZYIWlH1kWDp+ecNo5iisRKrbm0xcRyCww71/YU0Fkw0mAFpz9bJayXPjey6vkmaQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/environment-jsdom-abstract/node_modules/jest-message-util": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", + "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@jest/types": "30.0.5", + "@types/stack-utils": "^2.0.3", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "micromatch": "^4.0.8", + "pretty-format": "30.0.5", + "slash": "^3.0.0", + "stack-utils": "^2.0.6" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/environment-jsdom-abstract/node_modules/jest-mock": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.0.5.tgz", + "integrity": "sha512-Od7TyasAAQX/6S+QCbN6vZoWOMwlTtzzGuxJku1GhGanAjz9y+QsQkpScDmETvdc9aSXyJ/Op4rhpMYBWW91wQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "30.0.5", + "@types/node": "*", + "jest-util": "30.0.5" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/environment-jsdom-abstract/node_modules/jest-util": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.0.5.tgz", + "integrity": "sha512-pvyPWssDZR0FlfMxCBoc0tvM8iUEskaRFALUtGQYzVEAqisAztmy+R8LnU14KT4XA0H/a5HMVTXat1jLne010g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "30.0.5", + "@types/node": "*", + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "graceful-fs": "^4.2.11", + "picomatch": "^4.0.2" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/environment-jsdom-abstract/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/@jest/environment-jsdom-abstract/node_modules/pretty-format": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.0.5.tgz", + "integrity": "sha512-D1tKtYvByrBkFLe2wHJl2bwMJIiT8rW+XA+TiataH79/FszLQMrpGEvzUVkzPau7OCO0Qnrhpe87PqtOAIB8Yw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "30.0.5", + "ansi-styles": "^5.2.0", + "react-is": "^18.3.1" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/@jest/expect": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", @@ -1173,6 +1527,30 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/@jest/pattern": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/@jest/pattern/-/pattern-30.0.1.tgz", + "integrity": "sha512-gWp7NfQW27LaBQz3TITS8L7ZCQ0TLvtmI//4OwlQRx4rnWxcPNIYjxZpDcN4+UlGxgm3jS5QPz8IPTCkb59wZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "jest-regex-util": "30.0.1" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/pattern/node_modules/jest-regex-util": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-30.0.1.tgz", + "integrity": "sha512-jHEQgBXAgc+Gh4g0p3bCevgRCVRkB4VB70zhoAE48gxeSr1hfUOsM/C2WoJgVL7Eyg//hudYENbm3Ne+/dRVVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/@jest/reporters": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", @@ -1579,6 +1957,18 @@ "pretty-format": "^29.0.0" } }, + "node_modules/@types/jsdom": { + "version": "21.1.7", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.7.tgz", + "integrity": "sha512-yOriVnggzrnQ3a9OKOCxaVuSug3w3/SbOj5i7VwXWZEyUNl3bLF9V3MfxGbZKuwqJOQyRfqXyROBB1CoZLFWzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" + } + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -1617,6 +2007,13 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/yargs": { "version": "17.0.33", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", @@ -1895,6 +2292,16 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -2521,6 +2928,34 @@ "node": ">= 8" } }, + "node_modules/cssstyle": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.6.0.tgz", + "integrity": "sha512-2z+rWdzbbSZv6/rhtvzvqeZQHrBaqgogqt85sqFNbabZOuFbCVFb8kPeEtZjiKkbrm395irpNKiYeFeLiQnFPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@asamuzakjp/css-color": "^3.2.0", + "rrweb-cssom": "^0.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/data-urls": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/debug": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", @@ -2539,6 +2974,13 @@ } } }, + "node_modules/decimal.js": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", + "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", + "dev": true, + "license": "MIT" + }, "node_modules/dedent": { "version": "1.5.3", "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.3.tgz", @@ -2683,6 +3125,19 @@ "dev": true, "license": "MIT" }, + "node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/env-paths": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", @@ -3503,6 +3958,19 @@ "node": ">= 0.4" } }, + "node_modules/html-encoding-sniffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-encoding": "^3.1.1" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -3510,6 +3978,34 @@ "dev": true, "license": "MIT" }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", @@ -3520,6 +4016,19 @@ "node": ">=10.17.0" } }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -3708,6 +4217,13 @@ "node": ">=8" } }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true, + "license": "MIT" + }, "node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -4053,6 +4569,225 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-environment-jsdom": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-30.0.5.tgz", + "integrity": "sha512-BmnDEoAH+jEjkPrvE9DTKS2r3jYSJWlN/r46h0/DBUxKrkgt2jAZ5Nj4wXLAcV1KWkRpcFqA5zri9SWzJZ1cCg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "30.0.5", + "@jest/environment-jsdom-abstract": "30.0.5", + "@types/jsdom": "^21.1.7", + "@types/node": "*", + "jsdom": "^26.1.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "canvas": "^3.0.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jest-environment-jsdom/node_modules/@jest/environment": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.0.5.tgz", + "integrity": "sha512-aRX7WoaWx1oaOkDQvCWImVQ8XNtdv5sEWgk4gxR6NXb7WBUnL5sRak4WRzIQRZ1VTWPvV4VI4mgGjNL9TeKMYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/fake-timers": "30.0.5", + "@jest/types": "30.0.5", + "@types/node": "*", + "jest-mock": "30.0.5" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-environment-jsdom/node_modules/@jest/fake-timers": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.0.5.tgz", + "integrity": "sha512-ZO5DHfNV+kgEAeP3gK3XlpJLL4U3Sz6ebl/n68Uwt64qFFs5bv4bfEEjyRGK5uM0C90ewooNgFuKMdkbEoMEXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "30.0.5", + "@sinonjs/fake-timers": "^13.0.0", + "@types/node": "*", + "jest-message-util": "30.0.5", + "jest-mock": "30.0.5", + "jest-util": "30.0.5" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-environment-jsdom/node_modules/@jest/schemas": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-30.0.5.tgz", + "integrity": "sha512-DmdYgtezMkh3cpU8/1uyXakv3tJRcmcXxBOcO0tbaozPwpmh4YMsnWrQm9ZmZMfa5ocbxzbFk6O4bDPEc/iAnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.34.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-environment-jsdom/node_modules/@jest/types": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.0.5.tgz", + "integrity": "sha512-aREYa3aku9SSnea4aX6bhKn4bgv3AXkgijoQgbYV3yvbiGt6z+MQ85+6mIhx9DsKW2BuB/cLR/A+tcMThx+KLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/pattern": "30.0.1", + "@jest/schemas": "30.0.5", + "@types/istanbul-lib-coverage": "^2.0.6", + "@types/istanbul-reports": "^3.0.4", + "@types/node": "*", + "@types/yargs": "^17.0.33", + "chalk": "^4.1.2" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-environment-jsdom/node_modules/@sinclair/typebox": { + "version": "0.34.38", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.38.tgz", + "integrity": "sha512-HpkxMmc2XmZKhvaKIZZThlHmx1L0I/V1hWK1NubtlFnr6ZqdiOpV72TKudZUNQjZNsyDBay72qFEhEvb+bcwcA==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-environment-jsdom/node_modules/@sinonjs/fake-timers": { + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz", + "integrity": "sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.1" + } + }, + "node_modules/jest-environment-jsdom/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-environment-jsdom/node_modules/ci-info": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.0.tgz", + "integrity": "sha512-l+2bNRMiQgcfILUi33labAZYIWlH1kWDp+ecNo5iisRKrbm0xcRyCww71/YU0Fkw0mAFpz9bJayXPjey6vkmaQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-environment-jsdom/node_modules/jest-message-util": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", + "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@jest/types": "30.0.5", + "@types/stack-utils": "^2.0.3", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "micromatch": "^4.0.8", + "pretty-format": "30.0.5", + "slash": "^3.0.0", + "stack-utils": "^2.0.6" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-environment-jsdom/node_modules/jest-mock": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.0.5.tgz", + "integrity": "sha512-Od7TyasAAQX/6S+QCbN6vZoWOMwlTtzzGuxJku1GhGanAjz9y+QsQkpScDmETvdc9aSXyJ/Op4rhpMYBWW91wQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "30.0.5", + "@types/node": "*", + "jest-util": "30.0.5" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-environment-jsdom/node_modules/jest-util": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.0.5.tgz", + "integrity": "sha512-pvyPWssDZR0FlfMxCBoc0tvM8iUEskaRFALUtGQYzVEAqisAztmy+R8LnU14KT4XA0H/a5HMVTXat1jLne010g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "30.0.5", + "@types/node": "*", + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "graceful-fs": "^4.2.11", + "picomatch": "^4.0.2" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-environment-jsdom/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/jest-environment-jsdom/node_modules/pretty-format": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.0.5.tgz", + "integrity": "sha512-D1tKtYvByrBkFLe2wHJl2bwMJIiT8rW+XA+TiataH79/FszLQMrpGEvzUVkzPau7OCO0Qnrhpe87PqtOAIB8Yw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "30.0.5", + "ansi-styles": "^5.2.0", + "react-is": "^18.3.1" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/jest-environment-node": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", @@ -4478,6 +5213,46 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsdom": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-26.1.0.tgz", + "integrity": "sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssstyle": "^4.2.1", + "data-urls": "^5.0.0", + "decimal.js": "^10.5.0", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.6", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.16", + "parse5": "^7.2.1", + "rrweb-cssom": "^0.8.0", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^5.1.1", + "w3c-xmlserializer": "^5.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.1.1", + "ws": "^8.18.0", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "canvas": "^3.0.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, "node_modules/jsesc": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", @@ -4854,6 +5629,13 @@ "node": ">=8" } }, + "node_modules/nwsapi": { + "version": "2.2.21", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.21.tgz", + "integrity": "sha512-o6nIY3qwiSXl7/LuOU0Dmuctd34Yay0yeuZRLFmDPrrdHpXKFndPj3hM+YEPVHYC5fx2otBx4Ilc/gyYSAUaIA==", + "dev": true, + "license": "MIT" + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -4990,6 +5772,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -5508,6 +6303,13 @@ "node": ">=12" } }, + "node_modules/rrweb-cssom": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", + "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==", + "dev": true, + "license": "MIT" + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -5553,6 +6355,13 @@ ], "license": "MIT" }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, "node_modules/sax": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.1.4.tgz", @@ -5560,6 +6369,19 @@ "dev": true, "license": "ISC" }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "license": "ISC", + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, "node_modules/semver": { "version": "7.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", @@ -5810,6 +6632,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true, + "license": "MIT" + }, "node_modules/tar": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", @@ -5892,6 +6721,26 @@ "readable-stream": "3" } }, + "node_modules/tldts": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz", + "integrity": "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tldts-core": "^6.1.86" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.86.tgz", + "integrity": "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==", + "dev": true, + "license": "MIT" + }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -5912,6 +6761,32 @@ "node": ">=8.0" } }, + "node_modules/tough-cookie": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", + "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tldts": "^6.1.32" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/tr46": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz", + "integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", @@ -6167,6 +7042,19 @@ "node": ">=10.12.0" } }, + "node_modules/w3c-xmlserializer": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", @@ -6177,6 +7065,53 @@ "makeerror": "1.0.12" } }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-url": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz", + "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tr46": "^5.1.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -6242,6 +7177,38 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/ws": { + "version": "8.18.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", + "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xml-name-validator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18" + } + }, "node_modules/xml2js": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz", @@ -6276,6 +7243,13 @@ "node": ">=8.0" } }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true, + "license": "MIT" + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index f5cf38c..d67b1db 100644 --- a/package.json +++ b/package.json @@ -31,11 +31,14 @@ "@capacitor/cli": "^5.0.0", "@capacitor/ios": "^5.0.0", "@types/jest": "^29.5.0", + "@types/jsdom": "^21.1.7", "@types/node": "^18.15.0", "@typescript-eslint/eslint-plugin": "^5.57.0", "@typescript-eslint/parser": "^5.57.0", "eslint": "^8.37.0", "jest": "^29.5.0", + "jest-environment-jsdom": "^30.0.5", + "jsdom": "^26.1.0", "prettier": "^2.8.7", "rimraf": "^4.4.0", "rollup": "^3.20.0", @@ -66,7 +69,7 @@ }, "jest": { "preset": "ts-jest", - "testEnvironment": "node", + "testEnvironment": "jsdom", "moduleFileExtensions": [ "ts", "tsx", diff --git a/src/daily-notification.ts b/src/daily-notification.ts index 1a17809..f7b1dbf 100644 --- a/src/daily-notification.ts +++ b/src/daily-notification.ts @@ -1,9 +1,13 @@ /** * DailyNotification class implementation * Handles scheduling and managing daily notifications + * Aligned with updated interface definitions + * + * @author Matthew Raymer + * @version 2.0.0 */ -import { DailyNotificationPlugin, NotificationOptions, NotificationSettings } from './definitions'; +import { DailyNotificationPlugin, NotificationOptions, NotificationSettings, NotificationResponse, PermissionStatus } from './definitions'; export class DailyNotification { private plugin: DailyNotificationPlugin; @@ -27,7 +31,7 @@ export class DailyNotification { /** * Get the last notification that was delivered */ - async getLastNotification() { + async getLastNotification(): Promise { return this.plugin.getLastNotification(); } @@ -54,6 +58,49 @@ export class DailyNotification { await this.plugin.updateSettings(settings); } + /** + * Get battery status information + */ + async getBatteryStatus() { + return this.plugin.getBatteryStatus(); + } + + /** + * Request battery optimization exemption + */ + async requestBatteryOptimizationExemption(): Promise { + await this.plugin.requestBatteryOptimizationExemption(); + } + + /** + * Set adaptive scheduling based on device state + * @param options Options containing enabled flag + */ + async setAdaptiveScheduling(options: { enabled: boolean }): Promise { + await this.plugin.setAdaptiveScheduling(options); + } + + /** + * Get current power state information + */ + async getPowerState() { + return this.plugin.getPowerState(); + } + + /** + * Check current permissions + */ + async checkPermissions(): Promise { + return this.plugin.checkPermissions(); + } + + /** + * Request permissions + */ + async requestPermissions(): Promise { + return this.plugin.requestPermissions(); + } + /** * Add an event listener for notification events * @param event Event type to listen for @@ -75,6 +122,23 @@ export class DailyNotification { this.eventListeners.get(event)?.delete(handler); } + /** + * Remove all event listeners for a specific event + * @param event Event type to clear listeners for + */ + offAll(event: string): void { + this.eventListeners.delete(event); + } + + /** + * Get all event listeners for a specific event + * @param event Event type to get listeners for + */ + getListeners(event: string): EventListener[] { + const listeners = this.eventListeners.get(event); + return listeners ? Array.from(listeners) : []; + } + private setupEventListeners(): void { document.addEventListener('notification', (event: Event) => { this.eventListeners.get('notification')?.forEach(handler => { @@ -93,6 +157,12 @@ export class DailyNotification { if (options.timezone && !this.isValidTimezone(options.timezone)) { throw new Error('Invalid timezone'); } + if (options.retryCount !== undefined && (options.retryCount < 0 || options.retryCount > 10)) { + throw new Error('Retry count must be between 0 and 10'); + } + if (options.retryInterval !== undefined && (options.retryInterval < 100 || options.retryInterval > 60000)) { + throw new Error('Retry interval must be between 100ms and 60s'); + } } private validateSettings(settings: NotificationSettings): void { @@ -102,6 +172,12 @@ export class DailyNotification { if (settings.timezone && !this.isValidTimezone(settings.timezone)) { throw new Error('Invalid timezone'); } + if (settings.retryCount !== undefined && (settings.retryCount < 0 || settings.retryCount > 10)) { + throw new Error('Retry count must be between 0 and 10'); + } + if (settings.retryInterval !== undefined && (settings.retryInterval < 100 || settings.retryInterval > 60000)) { + throw new Error('Retry interval must be between 100ms and 60s'); + } } private isValidUrl(url: string): boolean { @@ -126,4 +202,32 @@ export class DailyNotification { return false; } } + + /** + * Validate notification content + * @param content Content to validate + */ + validateContent(content: { title: string; body: string; data?: any }): boolean { + if (!content.title || typeof content.title !== 'string' || content.title.trim().length === 0) { + return false; + } + if (!content.body || typeof content.body !== 'string' || content.body.trim().length === 0) { + return false; + } + return true; + } + + /** + * Check if the plugin is available + */ + isAvailable(): boolean { + return this.plugin !== null && this.plugin !== undefined; + } + + /** + * Get plugin version information + */ + getVersion(): string { + return '2.0.0'; + } } \ No newline at end of file diff --git a/src/definitions.ts b/src/definitions.ts index 54ff04c..fbedde9 100644 --- a/src/definitions.ts +++ b/src/definitions.ts @@ -2,14 +2,18 @@ * Daily Notification Plugin Definitions * * TypeScript definitions for the Daily Notification Plugin + * Aligned with Android implementation and test requirements * * @author Matthew Raymer + * @version 2.0.0 */ export interface NotificationResponse { + id: string; title: string; body: string; - timestamp?: string; + timestamp: number; + url?: string; } export interface NotificationOptions { @@ -18,8 +22,17 @@ export interface NotificationOptions { title?: string; body?: string; sound?: boolean; - priority?: 'high' | 'low' | 'normal'; + priority?: 'high' | 'default' | 'low' | 'min' | 'max' | 'normal'; timezone?: string; + retryCount?: number; + retryInterval?: number; + offlineFallback?: boolean; + contentHandler?: ContentHandler; + headers?: Record; +} + +export interface ContentHandler { + (response?: any): Promise<{ title: string; body: string; data?: any }>; } export interface DailyNotificationPlugin { @@ -32,14 +45,21 @@ export interface DailyNotificationPlugin { requestBatteryOptimizationExemption(): Promise; setAdaptiveScheduling(options: { enabled: boolean }): Promise; getPowerState(): Promise; + checkPermissions(): Promise; + requestPermissions(): Promise; } export interface ScheduleOptions { url?: string; time?: string; sound?: boolean; - priority?: 'high' | 'default' | 'low' | 'min' | 'max'; + priority?: 'high' | 'default' | 'low' | 'min' | 'max' | 'normal'; timezone?: string; + retryCount?: number; + retryInterval?: number; + offlineFallback?: boolean; + contentHandler?: ContentHandler; + headers?: Record; } export interface NotificationSettings { @@ -48,13 +68,18 @@ export interface NotificationSettings { sound?: boolean; priority?: string; timezone?: string; + retryCount?: number; + retryInterval?: number; + offlineFallback?: boolean; } export interface NotificationStatus { - lastNotificationTime: number; - nextNotificationTime: number; - settings: NotificationSettings; + isEnabled?: boolean; isScheduled?: boolean; + lastNotificationTime: number | Promise; + nextNotificationTime: number | Promise; + pending?: number; + settings: NotificationSettings; error?: string; } @@ -79,8 +104,63 @@ export interface NotificationEvent extends Event { } export interface PermissionStatus { + status?: string; + granted?: boolean; notifications: PermissionState; backgroundRefresh?: PermissionState; // iOS only + alert?: boolean; + badge?: boolean; + sound?: boolean; + lockScreen?: boolean; + carPlay?: boolean; +} + +export type PermissionState = 'prompt' | 'prompt-with-rationale' | 'granted' | 'denied' | 'provisional' | 'ephemeral' | 'unknown'; + +// Additional interfaces for enhanced functionality +export interface NotificationMetrics { + scheduledTime: number; + actualDeliveryTime?: number; + contentAge: number; + engagement?: 'TAPPED' | 'DISMISSED' | 'IGNORED'; + failureReason?: string; + platformInfo: PlatformInfo; +} + +export interface PlatformInfo { + oem?: string; + osVersion: string; + appState: string; +} + +export interface FallbackContent { + title: string; + body: string; + isEmergency: boolean; + age?: string; } -export type PermissionState = 'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'; \ No newline at end of file +export interface CachePolicy { + maxSize: number; + evictionPolicy: 'LRU' | 'FIFO' | 'TTL'; + ttl?: number; + cleanupInterval: number; +} + +export interface NetworkConfig { + timeout: number; + retryAttempts: number; + retryDelay: number; + offlineFallback: boolean; +} + +export interface SchedulingConfig { + exactAlarms: boolean; + adaptiveScheduling: boolean; + quietHours?: { + start: string; + end: string; + enabled: boolean; + }; + timezone: string; +} \ No newline at end of file diff --git a/src/web.ts b/src/web.ts index 8734c0d..494202d 100644 --- a/src/web.ts +++ b/src/web.ts @@ -1,9 +1,12 @@ /** * Web implementation of the Daily Notification plugin + * + * @author Matthew Raymer + * @version 2.0.0 */ import { WebPlugin } from '@capacitor/core'; -import type { DailyNotificationPlugin, NotificationOptions, NotificationSettings, NotificationResponse, NotificationStatus, BatteryStatus, PowerState } from './definitions'; +import type { DailyNotificationPlugin, NotificationOptions, NotificationSettings, NotificationResponse, NotificationStatus, BatteryStatus, PowerState, PermissionStatus } from './definitions'; export class DailyNotificationWeb extends WebPlugin implements DailyNotificationPlugin { async scheduleDailyNotification(_options: NotificationOptions | any): Promise { @@ -13,9 +16,10 @@ export class DailyNotificationWeb extends WebPlugin implements DailyNotification async getLastNotification(): Promise { return { + id: 'web-notification', title: 'Web Notification', body: 'This is a web notification', - timestamp: new Date().toISOString() + timestamp: Date.now() }; } @@ -58,4 +62,30 @@ export class DailyNotificationWeb extends WebPlugin implements DailyNotification isOptimizationExempt: true }; } + + async checkPermissions(): Promise { + return { + status: 'granted', + granted: true, + notifications: 'granted', + alert: true, + badge: true, + sound: true, + lockScreen: true, + carPlay: false + }; + } + + async requestPermissions(): Promise { + return { + status: 'granted', + granted: true, + notifications: 'granted', + alert: true, + badge: true, + sound: true, + lockScreen: true, + carPlay: false + }; + } } \ No newline at end of file diff --git a/src/web/index.ts b/src/web/index.ts index b51af9d..d2de60e 100644 --- a/src/web/index.ts +++ b/src/web/index.ts @@ -1,107 +1,297 @@ /** - * DailyNotificationWeb implementation - * Web platform implementation for the Daily Notification Plugin + * DailyNotification Web Implementation + * + * Web platform implementation with proper mock functionality + * Aligned with updated interface definitions + * + * @author Matthew Raymer + * @version 2.0.0 */ -import { WebPlugin } from '@capacitor/core'; -import type { DailyNotificationPlugin, NotificationOptions, NotificationSettings, NotificationResponse, NotificationStatus, BatteryStatus, PowerState } from '../definitions'; +import { DailyNotificationPlugin, NotificationOptions, NotificationResponse, NotificationStatus, NotificationSettings, BatteryStatus, PowerState, PermissionStatus } from '../definitions'; -export class DailyNotificationWeb extends WebPlugin implements DailyNotificationPlugin { - private nextNotificationTime: number = 0; - private lastNotificationTime: number = 0; - private settings: NotificationSettings & { adaptiveScheduling?: boolean } = {}; +export class DailyNotificationWeb implements DailyNotificationPlugin { + private notifications: Map = new Map(); + private settings: NotificationSettings = { + sound: true, + priority: 'default', + timezone: 'UTC' + }; + private scheduledNotifications: Set = new Set(); - constructor() { - super({ - name: 'DailyNotification', - platforms: ['web'] - }); - } - - async initialize(options: NotificationOptions): Promise { - // Web implementation - store settings - this.settings = { ...options }; - } - - async scheduleDailyNotification(options: NotificationOptions | any): Promise { - // Web implementation using browser notifications - if (!('Notification' in window)) { - throw new Error('This browser does not support notifications'); + /** + * Schedule a daily notification + */ + async scheduleDailyNotification(options: NotificationOptions): Promise { + // Validate required parameters + if (!options.time) { + throw new Error('Time parameter is required'); } - if (Notification.permission === 'granted') { - new Notification(options.title || 'Daily Update', { - body: options.body || 'Your daily update is ready', - icon: '/icon.png', - badge: '/badge.png', - tag: 'daily-notification' - }); + // Create notification content + const notification: NotificationResponse = { + id: this.generateId(), + title: options.title || 'Daily Update', + body: options.body || 'Your daily notification is ready', + timestamp: Date.now(), + url: options.url + }; - this.nextNotificationTime = Date.now() + (24 * 60 * 60 * 1000); // 24 hours from now - this.lastNotificationTime = Date.now(); - } else if (Notification.permission !== 'denied') { - const permission = await Notification.requestPermission(); - if (permission === 'granted') { - await this.scheduleDailyNotification(options); - } + // Store notification + this.notifications.set(notification.id, notification); + this.scheduledNotifications.add(notification.id); + + // Schedule the notification using browser APIs if available + if ('Notification' in window && 'serviceWorker' in navigator) { + await this.scheduleBrowserNotification(notification, options); } + + console.log('Web notification scheduled:', notification); } + /** + * Get the last notification + */ async getLastNotification(): Promise { - return { - title: 'Last Notification', - body: 'This was the last notification', - timestamp: new Date(this.lastNotificationTime).toISOString() - }; + const notifications = Array.from(this.notifications.values()); + if (notifications.length === 0) { + return null; + } + + // Return the most recent notification + return notifications.sort((a, b) => b.timestamp - a.timestamp)[0]; } + /** + * Cancel all notifications + */ async cancelAllNotifications(): Promise { - // Web implementation - clear scheduled notifications - this.nextNotificationTime = 0; + this.scheduledNotifications.clear(); + this.notifications.clear(); + + // Cancel browser notifications if available + if ('Notification' in window) { + Notification.requestPermission().then(permission => { + if (permission === 'granted') { + // Clear any existing browser notifications + console.log('Browser notifications cleared'); + } + }); + } } + /** + * Get notification status + */ async getNotificationStatus(): Promise { return { - lastNotificationTime: this.lastNotificationTime, - nextNotificationTime: this.nextNotificationTime, + isEnabled: 'Notification' in window, + isScheduled: this.scheduledNotifications.size > 0, + lastNotificationTime: this.getLastNotificationTime(), + nextNotificationTime: this.getNextNotificationTime(), + pending: this.scheduledNotifications.size, settings: this.settings, - isScheduled: this.nextNotificationTime > 0 + error: undefined }; } + /** + * Update notification settings + */ async updateSettings(settings: NotificationSettings): Promise { this.settings = { ...this.settings, ...settings }; - - if (settings.time) { - this.nextNotificationTime = Date.now() + (24 * 60 * 60 * 1000); // 24 hours from now - } + console.log('Web notification settings updated:', this.settings); } + /** + * Get battery status (mock implementation) + */ async getBatteryStatus(): Promise { - // Web implementation - return mock battery status + // Mock battery status for web return { level: 100, isCharging: false, - powerState: 1, - isOptimizationExempt: true + powerState: 0, + isOptimizationExempt: false }; } + /** + * Request battery optimization exemption (web not applicable) + */ async requestBatteryOptimizationExemption(): Promise { - // Web implementation - no-op - console.log('Battery optimization exemption requested (web platform)'); + console.log('Battery optimization exemption not applicable on web'); } + /** + * Set adaptive scheduling (web not applicable) + */ async setAdaptiveScheduling(options: { enabled: boolean }): Promise { - // Web implementation - store setting - this.settings.adaptiveScheduling = options.enabled; + console.log('Adaptive scheduling not applicable on web:', options); } + /** + * Get power state (mock implementation) + */ async getPowerState(): Promise { - // Web implementation - return mock power state return { - powerState: 1, - isOptimizationExempt: true + powerState: 0, + isOptimizationExempt: false + }; + } + + /** + * Check permissions + */ + async checkPermissions(): Promise { + if (!('Notification' in window)) { + return { + status: 'denied', + granted: false, + notifications: 'denied', + alert: false, + badge: false, + sound: false, + lockScreen: false, + carPlay: false + }; + } + + const permission = Notification.permission; + return { + status: permission, + granted: permission === 'granted', + notifications: permission as any, + alert: permission === 'granted', + badge: permission === 'granted', + sound: permission === 'granted', + lockScreen: permission === 'granted', + carPlay: false + }; + } + + /** + * Request permissions + */ + async requestPermissions(): Promise { + if (!('Notification' in window)) { + throw new Error('Notifications not supported in this browser'); + } + + try { + const permission = await Notification.requestPermission(); + return { + status: permission, + granted: permission === 'granted', + notifications: permission as any, + alert: permission === 'granted', + badge: permission === 'granted', + sound: permission === 'granted', + lockScreen: permission === 'granted', + carPlay: false + }; + } catch (error) { + console.error('Error requesting notification permissions:', error); + throw error; + } + } + + /** + * Schedule browser notification using native APIs + */ + private async scheduleBrowserNotification(notification: NotificationResponse, options: NotificationOptions): Promise { + if (!('Notification' in window)) { + return; + } + + const permission = await Notification.requestPermission(); + if (permission !== 'granted') { + console.warn('Notification permission not granted'); + return; + } + + // Calculate next notification time + const nextTime = this.calculateNextNotificationTime(options.time!); + const delay = nextTime.getTime() - Date.now(); + + if (delay > 0) { + setTimeout(() => { + this.showBrowserNotification(notification, options); + }, delay); + } else { + // Show immediately if time has passed + this.showBrowserNotification(notification, options); + } + } + + /** + * Show browser notification + */ + private showBrowserNotification(notification: NotificationResponse, options: NotificationOptions): void { + if (!('Notification' in window)) { + return; + } + + const browserNotification = new Notification(notification.title, { + body: notification.body, + icon: '/favicon.ico', + tag: notification.id, + requireInteraction: false, + silent: !options.sound + }); + + // Handle notification click + browserNotification.onclick = () => { + if (notification.url) { + window.open(notification.url, '_blank'); + } + browserNotification.close(); }; + + // Auto-close after 10 seconds + setTimeout(() => { + browserNotification.close(); + }, 10000); + } + + /** + * Calculate next notification time + */ + private calculateNextNotificationTime(timeString: string): Date { + const [hours, minutes] = timeString.split(':').map(Number); + const now = new Date(); + const next = new Date(now); + + next.setHours(hours, minutes, 0, 0); + + // If time has passed today, schedule for tomorrow + if (next <= now) { + next.setDate(next.getDate() + 1); + } + + return next; + } + + /** + * Generate unique ID + */ + private generateId(): string { + return `web-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`; + } + + /** + * Get last notification time + */ + private async getLastNotificationTime(): Promise { + const last = await this.getLastNotification(); + return last ? last.timestamp : 0; + } + + /** + * Get next notification time + */ + private getNextNotificationTime(): number { + // For web, return 24 hours from now as placeholder + return Date.now() + (24 * 60 * 60 * 1000); } } \ No newline at end of file diff --git a/tests/advanced-scenarios.test.ts b/tests/advanced-scenarios.test.ts index c62c7a0..2a7239b 100644 --- a/tests/advanced-scenarios.test.ts +++ b/tests/advanced-scenarios.test.ts @@ -13,6 +13,10 @@ describe('DailyNotification Advanced Scenarios', () => { cancelAllNotifications: jest.fn(), getNotificationStatus: jest.fn(), updateSettings: jest.fn(), + getBatteryStatus: jest.fn(), + requestBatteryOptimizationExemption: jest.fn(), + setAdaptiveScheduling: jest.fn(), + getPowerState: jest.fn(), checkPermissions: jest.fn(), requestPermissions: jest.fn(), }; diff --git a/tests/daily-notification.test.ts b/tests/daily-notification.test.ts index 57e7cf0..fef249c 100644 --- a/tests/daily-notification.test.ts +++ b/tests/daily-notification.test.ts @@ -53,9 +53,10 @@ describe('DailyNotification Plugin', () => { describe('getLastNotification', () => { it('should return the last notification', async () => { const mockResponse: NotificationResponse = { + id: 'test-notification', title: 'Last Notification', body: 'This was the last notification', - timestamp: new Date().toISOString() + timestamp: Date.now() }; const result = await DailyNotification.getLastNotification(); diff --git a/tests/edge-cases.test.ts b/tests/edge-cases.test.ts index 6856da2..3fe4dab 100644 --- a/tests/edge-cases.test.ts +++ b/tests/edge-cases.test.ts @@ -18,6 +18,10 @@ describe('DailyNotification Edge Cases', () => { cancelAllNotifications: jest.fn(), getNotificationStatus: jest.fn(), updateSettings: jest.fn(), + getBatteryStatus: jest.fn(), + requestBatteryOptimizationExemption: jest.fn(), + setAdaptiveScheduling: jest.fn(), + getPowerState: jest.fn(), checkPermissions: jest.fn(), requestPermissions: jest.fn(), }; diff --git a/tests/enterprise-scenarios.test.ts b/tests/enterprise-scenarios.test.ts index cce4d98..a273aed 100644 --- a/tests/enterprise-scenarios.test.ts +++ b/tests/enterprise-scenarios.test.ts @@ -17,6 +17,10 @@ describe('DailyNotification Enterprise Scenarios', () => { cancelAllNotifications: jest.fn(), getNotificationStatus: jest.fn(), updateSettings: jest.fn(), + getBatteryStatus: jest.fn(), + requestBatteryOptimizationExemption: jest.fn(), + setAdaptiveScheduling: jest.fn(), + getPowerState: jest.fn(), checkPermissions: jest.fn(), requestPermissions: jest.fn(), };