diff --git a/package-lock.json b/package-lock.json index b7f028e0..8c1b2b2e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -82,7 +82,7 @@ "typescript": "^5.1.6" }, "peerDependencies": { - "@input-output-hk/atala-prism-wallet-sdk": "^2.4.1" + "@input-output-hk/atala-prism-wallet-sdk": "^2.5.0" } }, "../../iohk/atala-prism-wallet-sdk-ts": { @@ -2721,13 +2721,6 @@ "resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.10.1.tgz", "integrity": "sha512-Dq5rYfEpdeel0bLVN+nfD1VWmzCkK+pJbSjIawGE+RY4+NIJqhbUDDQjvV0NUK84fMfwxvtFoCtEe70HfZjFcw==" }, - "node_modules/@gar/promisify": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", - "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", - "optional": true, - "peer": true - }, "node_modules/@grpc/grpc-js": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.7.3.tgz", @@ -2863,9 +2856,9 @@ } }, "node_modules/@input-output-hk/atala-prism-wallet-sdk": { - "version": "2.4.1", - "resolved": "https://npm.pkg.github.com/download/@input-output-hk/atala-prism-wallet-sdk/2.4.1/f062c209abefa00973b923c85918b1c5e104f610", - "integrity": "sha512-dFZUICIwQyvZZeIPCYFvmjlSg0U5+gVnnXE5SMsLs62zcteJjDlxvAzpPSC02zdzkM0746CQR0G14lyi+UT9vA==", + "version": "2.5.0", + "resolved": "https://npm.pkg.github.com/download/@input-output-hk/atala-prism-wallet-sdk/2.5.0/2ad8fea45603571aaa9a0423493cfc8bc167913f", + "integrity": "sha512-3xAtnT/gqsKXzSeqmGc+IlfnpY3SBluD96rRqJ0sz2S3rA30Ehx2mjidiySaL/fYywfbj/dropvK0D5GM28bjA==", "license": "Apache-2.0", "peer": true, "dependencies": { @@ -2884,7 +2877,6 @@ "core-js": "^3.29.1", "did-jwt": "^6.11.5", "did-resolver": "^4.1.0", - "didcomm": "^0.4.1", "didcomm-node": "^0.4.1", "elliptic": "^6.5.4", "google-protobuf": "^3.21.2", @@ -2892,8 +2884,8 @@ "jose": "^4.12.2", "jsonwebtoken": "^9.0.0", "multiformats": "^9.9.0", - "sqlite3": "^5.1.6", - "util": "^0.12.5" + "util": "^0.12.5", + "uuid": "^9.0.0" } }, "node_modules/@input-output-hk/atala-prism-wallet-sdk/node_modules/buffer": { @@ -3758,145 +3750,6 @@ "node": ">=10" } }, - "node_modules/@mapbox/node-pre-gyp": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", - "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", - "peer": true, - "dependencies": { - "detect-libc": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "make-dir": "^3.1.0", - "node-fetch": "^2.6.7", - "nopt": "^5.0.0", - "npmlog": "^5.0.1", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.11" - }, - "bin": { - "node-pre-gyp": "bin/node-pre-gyp" - } - }, - "node_modules/@mapbox/node-pre-gyp/node_modules/are-we-there-yet": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", - "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", - "peer": true, - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@mapbox/node-pre-gyp/node_modules/gauge": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", - "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", - "peer": true, - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.2", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.1", - "object-assign": "^4.1.1", - "signal-exit": "^3.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@mapbox/node-pre-gyp/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "peer": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@mapbox/node-pre-gyp/node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "peer": true, - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@mapbox/node-pre-gyp/node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "peer": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@mapbox/node-pre-gyp/node_modules/nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "peer": true, - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@mapbox/node-pre-gyp/node_modules/npmlog": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", - "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", - "peer": true, - "dependencies": { - "are-we-there-yet": "^2.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^3.0.0", - "set-blocking": "^2.0.0" - } - }, - "node_modules/@mapbox/node-pre-gyp/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "peer": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/@mongodb-js/saslprep": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.0.tgz", @@ -4085,58 +3938,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@npmcli/move-file": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", - "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", - "deprecated": "This functionality has been moved to @npmcli/fs", - "optional": true, - "peer": true, - "dependencies": { - "mkdirp": "^1.0.4", - "rimraf": "^3.0.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@npmcli/move-file/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "optional": true, - "peer": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@npmcli/move-file/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "optional": true, - "peer": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/@npmcli/node-gyp": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-3.0.0.tgz", @@ -7258,7 +7059,8 @@ "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true }, "node_modules/acorn": { "version": "8.10.0", @@ -7320,6 +7122,7 @@ "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, "dependencies": { "debug": "4" }, @@ -7331,7 +7134,7 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", - "devOptional": true, + "dev": true, "dependencies": { "humanize-ms": "^1.2.1" }, @@ -7343,7 +7146,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "devOptional": true, + "dev": true, "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" @@ -7470,13 +7273,14 @@ "node_modules/aproba": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "dev": true }, "node_modules/are-we-there-yet": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", - "devOptional": true, + "dev": true, "dependencies": { "delegates": "^1.0.0", "readable-stream": "^3.6.0" @@ -7951,7 +7755,8 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "node_modules/base64-arraybuffer-es6": { "version": "0.6.0", @@ -8042,6 +7847,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -8438,6 +8244,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, "engines": { "node": ">=10" } @@ -8477,7 +8284,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "devOptional": true, + "dev": true, "engines": { "node": ">=6" } @@ -8637,6 +8444,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true, "bin": { "color-support": "bin.js" } @@ -8704,7 +8512,8 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, "node_modules/concat-stream": { "version": "2.0.0", @@ -8761,7 +8570,8 @@ "node_modules/console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "dev": true }, "node_modules/conventional-changelog-angular": { "version": "6.0.0", @@ -9320,7 +9130,8 @@ "node_modules/delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "dev": true }, "node_modules/deprecation": { "version": "2.3.1", @@ -9346,15 +9157,6 @@ "node": ">=4" } }, - "node_modules/detect-libc": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", - "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -9440,12 +9242,6 @@ "integrity": "sha512-S6fWHvCXkZg2IhS4RcVHxwuyVejPR7c+a4Go0xbQ9ps5kILa8viiYQgrM4gfTyeTjJ0ekgJH9gk/BawTpmkbZA==", "peer": true }, - "node_modules/didcomm": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/didcomm/-/didcomm-0.4.1.tgz", - "integrity": "sha512-fcGSfLL5ri18vbbjRexHWVk2RAxZ/eBlyKeLCzS/3k5RdogqJbnUEcNsq64at1nA1u16ENa1bsZodGeRoq84ZA==", - "peer": true - }, "node_modules/didcomm-node": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/didcomm-node/-/didcomm-node-0.4.1.tgz", @@ -9959,7 +9755,7 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "devOptional": true, + "dev": true, "engines": { "node": ">=6" } @@ -9980,7 +9776,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", - "devOptional": true + "dev": true }, "node_modules/error-ex": { "version": "1.3.2", @@ -11397,7 +11193,8 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true }, "node_modules/fsevents": { "version": "2.3.3", @@ -11448,7 +11245,7 @@ "version": "4.0.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", - "devOptional": true, + "dev": true, "dependencies": { "aproba": "^1.0.3 || ^2.0.0", "color-support": "^1.1.3", @@ -11854,7 +11651,7 @@ "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "devOptional": true + "dev": true }, "node_modules/graphemer": { "version": "1.4.0", @@ -11990,7 +11787,8 @@ "node_modules/has-unicode": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "dev": true }, "node_modules/hash.js": { "version": "1.1.7", @@ -12060,7 +11858,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", - "devOptional": true + "dev": true }, "node_modules/http-parser-js": { "version": "0.5.8", @@ -12085,6 +11883,7 @@ "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, "dependencies": { "agent-base": "6", "debug": "4" @@ -12106,7 +11905,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", - "devOptional": true, + "dev": true, "dependencies": { "ms": "^2.0.0" } @@ -12255,7 +12054,7 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "devOptional": true, + "dev": true, "engines": { "node": ">=0.8.19" } @@ -12264,22 +12063,16 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } }, - "node_modules/infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", - "optional": true, - "peer": true - }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -12646,7 +12439,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", - "devOptional": true + "dev": true }, "node_modules/is-map": { "version": "2.0.2", @@ -12966,7 +12759,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "devOptional": true + "dev": true }, "node_modules/isobject": { "version": "3.0.1", @@ -15386,6 +15179,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -15429,7 +15223,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", - "devOptional": true, + "dev": true, "dependencies": { "minipass": "^3.0.0" }, @@ -15441,7 +15235,7 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "devOptional": true, + "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -15479,7 +15273,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", - "devOptional": true, + "dev": true, "dependencies": { "minipass": "^3.0.0" }, @@ -15491,7 +15285,7 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "devOptional": true, + "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -15525,7 +15319,7 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", - "devOptional": true, + "dev": true, "dependencies": { "minipass": "^3.0.0" }, @@ -15537,7 +15331,7 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "devOptional": true, + "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -15549,7 +15343,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", - "devOptional": true, + "dev": true, "dependencies": { "minipass": "^3.0.0" }, @@ -15561,7 +15355,7 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "devOptional": true, + "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -15573,6 +15367,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, "dependencies": { "minipass": "^3.0.0", "yallist": "^4.0.0" @@ -15585,6 +15380,7 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -15596,6 +15392,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, "bin": { "mkdirp": "bin/cmd.js" }, @@ -15850,7 +15647,7 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "devOptional": true, + "dev": true, "engines": { "node": ">= 0.6" } @@ -19625,7 +19422,7 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", - "devOptional": true, + "dev": true, "dependencies": { "are-we-there-yet": "^3.0.0", "console-control-strings": "^1.1.0", @@ -19822,6 +19619,7 @@ "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, "engines": { "node": ">=0.10.0" } @@ -19962,6 +19760,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, "dependencies": { "wrappy": "1" } @@ -20228,7 +20027,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "devOptional": true, + "dev": true, "dependencies": { "aggregate-error": "^3.0.0" }, @@ -20540,6 +20339,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -20954,13 +20754,13 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", - "devOptional": true + "dev": true }, "node_modules/promise-retry": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", - "devOptional": true, + "dev": true, "dependencies": { "err-code": "^2.0.2", "retry": "^0.12.0" @@ -21801,7 +21601,7 @@ "version": "0.12.0", "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", - "devOptional": true, + "dev": true, "engines": { "node": ">= 4" } @@ -23084,7 +22884,8 @@ "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "dev": true }, "node_modules/set-function-name": { "version": "2.0.1", @@ -23170,7 +22971,8 @@ "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true }, "node_modules/signale": { "version": "1.4.0", @@ -23617,299 +23419,6 @@ "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true }, - "node_modules/sqlite3": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.6.tgz", - "integrity": "sha512-olYkWoKFVNSSSQNvxVUfjiVbz3YtBwTJj+mfV5zpHmqW3sELx2Cf4QCdirMelhM5Zh+KDVaKgQHqCxrqiWHybw==", - "hasInstallScript": true, - "peer": true, - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.0", - "node-addon-api": "^4.2.0", - "tar": "^6.1.11" - }, - "optionalDependencies": { - "node-gyp": "8.x" - }, - "peerDependencies": { - "node-gyp": "8.x" - }, - "peerDependenciesMeta": { - "node-gyp": { - "optional": true - } - } - }, - "node_modules/sqlite3/node_modules/@npmcli/fs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", - "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", - "optional": true, - "peer": true, - "dependencies": { - "@gar/promisify": "^1.0.1", - "semver": "^7.3.5" - } - }, - "node_modules/sqlite3/node_modules/@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", - "optional": true, - "peer": true, - "engines": { - "node": ">= 6" - } - }, - "node_modules/sqlite3/node_modules/cacache": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", - "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", - "optional": true, - "peer": true, - "dependencies": { - "@npmcli/fs": "^1.0.0", - "@npmcli/move-file": "^1.0.1", - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "glob": "^7.1.4", - "infer-owner": "^1.0.4", - "lru-cache": "^6.0.0", - "minipass": "^3.1.1", - "minipass-collect": "^1.0.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.2", - "mkdirp": "^1.0.3", - "p-map": "^4.0.0", - "promise-inflight": "^1.0.1", - "rimraf": "^3.0.2", - "ssri": "^8.0.1", - "tar": "^6.0.2", - "unique-filename": "^1.1.1" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/sqlite3/node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "optional": true, - "peer": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/sqlite3/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "optional": true, - "peer": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/sqlite3/node_modules/http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", - "optional": true, - "peer": true, - "dependencies": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/sqlite3/node_modules/make-fetch-happen": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", - "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", - "optional": true, - "peer": true, - "dependencies": { - "agentkeepalive": "^4.1.3", - "cacache": "^15.2.0", - "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", - "is-lambda": "^1.0.1", - "lru-cache": "^6.0.0", - "minipass": "^3.1.3", - "minipass-collect": "^1.0.2", - "minipass-fetch": "^1.3.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.2", - "promise-retry": "^2.0.1", - "socks-proxy-agent": "^6.0.0", - "ssri": "^8.0.0" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/sqlite3/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "optional": true, - "peer": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/sqlite3/node_modules/minipass-fetch": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", - "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", - "optional": true, - "peer": true, - "dependencies": { - "minipass": "^3.1.0", - "minipass-sized": "^1.0.3", - "minizlib": "^2.0.0" - }, - "engines": { - "node": ">=8" - }, - "optionalDependencies": { - "encoding": "^0.1.12" - } - }, - "node_modules/sqlite3/node_modules/node-addon-api": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", - "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==", - "peer": true - }, - "node_modules/sqlite3/node_modules/node-gyp": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", - "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", - "optional": true, - "peer": true, - "dependencies": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.6", - "make-fetch-happen": "^9.1.0", - "nopt": "^5.0.0", - "npmlog": "^6.0.0", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.2", - "which": "^2.0.2" - }, - "bin": { - "node-gyp": "bin/node-gyp.js" - }, - "engines": { - "node": ">= 10.12.0" - } - }, - "node_modules/sqlite3/node_modules/nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "optional": true, - "peer": true, - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/sqlite3/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "optional": true, - "peer": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/sqlite3/node_modules/socks-proxy-agent": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", - "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", - "optional": true, - "peer": true, - "dependencies": { - "agent-base": "^6.0.2", - "debug": "^4.3.3", - "socks": "^2.6.2" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/sqlite3/node_modules/ssri": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", - "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", - "optional": true, - "peer": true, - "dependencies": { - "minipass": "^3.1.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/sqlite3/node_modules/unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "optional": true, - "peer": true, - "dependencies": { - "unique-slug": "^2.0.0" - } - }, - "node_modules/sqlite3/node_modules/unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "optional": true, - "peer": true, - "dependencies": { - "imurmurhash": "^0.1.4" - } - }, "node_modules/ssri": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz", @@ -24288,6 +23797,7 @@ "version": "6.1.11", "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", + "dev": true, "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -24320,6 +23830,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, "dependencies": { "minipass": "^3.0.0" }, @@ -24331,6 +23842,7 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -25533,7 +25045,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "devOptional": true, + "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -25623,6 +25135,7 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "dev": true, "dependencies": { "string-width": "^1.0.2 || 2 || 3 || 4" } @@ -25668,7 +25181,8 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true }, "node_modules/write-file-atomic": { "version": "5.0.1", diff --git a/package.json b/package.json index a93bfa40..ef572acd 100644 --- a/package.json +++ b/package.json @@ -139,7 +139,7 @@ "author": "elribonazo@gmail.com", "license": "Apache-2.0", "peerDependencies": { - "@input-output-hk/atala-prism-wallet-sdk": "^2.4.1" + "@input-output-hk/atala-prism-wallet-sdk": "^2.5.0" }, "dependencies": { "dexie": "^3.2.4", diff --git a/src/index.ts b/src/index.ts index 4ad50a7b..c05c0ce5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -24,7 +24,6 @@ import DIDSchema, { DIDSchemaType } from "./schemas/DID"; import CredentialSchema, { CredentialCollection, CredentialMethods, - CredentialSchemaType, CredentialSubjectType, } from "./schemas/Credential"; import DIDPairSchema, { DIDPairSchemaType } from "./schemas/DIDPair"; @@ -38,7 +37,14 @@ import PrivateKeySchema, { PrivateKeyDocument, PrivateKeyMethods, } from "./schemas/PrivateKey"; -import { RxDBDevModePlugin } from "rxdb/plugins/dev-mode"; +import LinkSecretSchema, { + LinkSecretColletion, + LinkSecretMethods, +} from "./schemas/LinkSecret"; +import CredentialRequestMetadataSchema, { + CredentialRequestMetadataCollection, + CredentialRequestMetadataMethods, +} from "./schemas/CredentialRequestMetadata"; addRxPlugin(RxDBMigrationPlugin); addRxPlugin(RxDBQueryBuilderPlugin); @@ -58,7 +64,9 @@ export type PlutoCollections = { didpairs: RxCollection; mediators: MediatorCollection; privatekeys: PrivateKeyColletion; - verifiablecredentials: CredentialCollection; + credentials: CredentialCollection; + credentialrequestmetadatas: CredentialRequestMetadataCollection; + linksecrets: LinkSecretColletion; }; export type PlutoDatabase = RxDatabase; @@ -167,10 +175,18 @@ export class Database implements Domain.Pluto { schema: PrivateKeySchema, methods: PrivateKeyMethods, }, - verifiablecredentials: { + credentials: { schema: CredentialSchema, methods: CredentialMethods, }, + credentialrequestmetadatas: { + schema: CredentialRequestMetadataSchema, + methods: CredentialRequestMetadataMethods, + }, + linksecrets: { + schema: LinkSecretSchema, + methods: LinkSecretMethods, + }, }); this._db = database; } catch (err) { @@ -621,48 +637,14 @@ export class Database implements Domain.Pluto { return peerDIDs; } - private parseCredentialSubject(credentialSubject: { - [name: string]: any; - }): CredentialSubjectType[] { - return Object.keys(credentialSubject).reduce( - (all, key) => { - const value = credentialSubject[key]; - all.push({ - type: "string", - value: value, - name: key, - }); - return all; - }, - [] - ); - } + async storeCredential(credential: Domain.Credential): Promise { + if (!credential.isStorable || !credential.isStorable()) { + throw new Error("Credential is not storable"); + } + const storable = credential.toStorable(); + if (!storable.id) storable.id = uuidv4(); - async storeCredential( - credential: Domain.VerifiableCredential - ): Promise { - await this.db.verifiablecredentials.insert({ - id: credential.id, - credentialType: credential.credentialType, - context: credential.context, - type: credential.type, - credentialSchema: credential.credentialSchema, - credentialSubject: this.parseCredentialSubject( - credential.credentialSubject - ), - credentialStatus: credential.credentialStatus, - refreshService: credential.refreshService, - evidence: credential.evidence, - subject: credential.subject ? credential.subject.toString() : undefined, - termsOfUse: credential.termsOfUse, - issuer: credential.issuer.toString(), - issuanceDate: credential.issuanceDate, - expirationDate: credential.expirationDate, - validFrom: credential.validFrom, - validUntil: credential.validUntil, - proof: credential.proof, - aud: credential.aud, - }); + await this.db.credentials.insert(storable); } async getAllMediators(): Promise { @@ -671,9 +653,59 @@ export class Database implements Domain.Pluto { ); } - async getAllCredentials(): Promise { - return (await this.db.verifiablecredentials.find().exec()).map( + async getAllCredentials(): Promise { + return (await this.db.credentials.find().exec()).map( (verifiableCredential) => verifiableCredential.toDomainCredential() ); } + + async getLinkSecret( + linkSecretName?: string | undefined + ): Promise { + const linkSecret = await this.db.linksecrets + .findOne() + .where({ name: linkSecretName }) + .exec(); + + if (linkSecret) { + return linkSecret.toDomainLinkSecret(); + } + + return null; + } + + async storeLinkSecret( + linkSecret: string, + linkSecretName: string + ): Promise { + await this.db.linksecrets.insert({ + name: linkSecretName, + secret: linkSecret, + }); + } + + async storeCredentialMetadata( + metadata: Domain.Anoncreds.CredentialRequestMeta, + linkSecret: string + ): Promise { + await this.db.credentialrequestmetadatas.insert({ + ...metadata, + id: uuidv4(), + link_secret_name: linkSecret, + }); + } + + async fetchCredentialMetadata( + linkSecretName: string + ): Promise { + const credentialRequestMetadata = await this.db.credentialrequestmetadatas + .findOne() + .where({ link_secret_name: linkSecretName }) + .exec(); + + if (credentialRequestMetadata) { + return credentialRequestMetadata.toDomainCredentialRequestMetadata(); + } + return null; + } } diff --git a/src/schemas/Credential.ts b/src/schemas/Credential.ts index 8561502f..b7658f60 100644 --- a/src/schemas/Credential.ts +++ b/src/schemas/Credential.ts @@ -1,4 +1,11 @@ -import { Domain } from "@input-output-hk/atala-prism-wallet-sdk"; +import { + AnonCredsCredential, + AnonCredsCredentialProperties, + AnonCredsRecoveryId, + Domain, + JWTCredential, + JWTVerifiableCredentialRecoveryId, +} from "@input-output-hk/atala-prism-wallet-sdk"; import type { Schema } from "../types"; import { RxCollection, RxDocument } from "rxdb"; @@ -9,24 +16,17 @@ export type CredentialSubjectType = { }; export type CredentialSchemaType = { - id?: string; - credentialType: Domain.CredentialType; - context: string[]; - type: string[]; - credentialSchema?: Domain.VerifiableCredentialTypeContainer; - credentialSubject: CredentialSubjectType[]; - credentialStatus?: Domain.VerifiableCredentialTypeContainer; - refreshService: Domain.VerifiableCredentialTypeContainer; - evidence: Domain.VerifiableCredentialTypeContainer; + id: string; + recoveryId: string; + credentialData: string; + issuer?: string; subject?: string; - termsOfUse: Domain.VerifiableCredentialTypeContainer; - issuer: string; - issuanceDate: string; - expirationDate?: string; - validFrom?: Domain.VerifiableCredentialTypeContainer; - validUntil?: Domain.VerifiableCredentialTypeContainer; - proof?: string; - aud: string[]; + credentialCreated?: string; + credentialUpdated?: string; + credentialSchema?: string; + validUntil?: string; + revoked?: boolean; + availableClaims?: string[]; }; /** @@ -41,171 +41,72 @@ const CredentialSchema: Schema = { type: "string", maxLength: 60, }, - credentialType: { + recoveryId: { type: "string", }, - context: { - type: "array", - items: { - type: "string", - }, - }, - type: { - type: "array", - items: { - type: "string", - }, - }, - credentialSchema: { - type: "object", - properties: { - id: { - type: "string", - }, - type: { - type: "string", - }, - }, - }, - credentialSubject: { - type: "array", - items: { - type: "object", - properties: { - name: { - type: "string", - }, - value: { - type: "string", - }, - type: { - type: "string", - }, - }, - }, - }, - credentialStatus: { - type: "object", - properties: { - id: { - type: "string", - }, - type: { - type: "string", - }, - }, - }, - refreshService: { - type: "object", - properties: { - id: { - type: "string", - }, - type: { - type: "string", - }, - }, + credentialData: { + type: "string", }, - evidence: { - type: "object", - properties: { - id: { - type: "string", - }, - type: { - type: "string", - }, - }, + issuer: { + type: "string", }, subject: { type: "string", }, - - termsOfUse: { - type: "object", - properties: { - id: { - type: "string", - }, - type: { - type: "string", - }, - }, - }, - issuer: { + credentialCreated: { type: "string", }, - issuanceDate: { + credentialUpdated: { type: "string", }, - expirationDate: { + credentialSchema: { type: "string", }, - validFrom: { - type: "object", - properties: { - id: { - type: "string", - }, - type: { - type: "string", - }, - }, - }, validUntil: { - type: "object", - properties: { - id: { - type: "string", - }, - type: { - type: "string", - }, - }, - }, - proof: { type: "string", }, - aud: { + revoked: { + type: "boolean", + }, + availableClaims: { type: "array", items: { type: "string", }, }, }, - encrypted: [], - required: [ - "credentialType", - "context", - "type", - "credentialSubject", - "refreshService", - "evidence", - "termsOfUse", - "issuer", - "issuanceDate", - "aud", - ], + encrypted: ["credentialData"], + required: ["id", "recoveryId", "credentialData"], }; export type CredentialDocument = RxDocument; export type CredentialMethodTypes = { - toDomainCredential: ( - this: CredentialSchemaType - ) => Domain.VerifiableCredential; + toDomainCredential: (this: CredentialSchemaType) => Domain.Credential; }; export const CredentialMethods: CredentialMethodTypes = { toDomainCredential: function toDomainCredential(this: CredentialSchemaType) { - return { - ...this, - subject: this.subject ? Domain.DID.fromString(this.subject) : undefined, - issuer: Domain.DID.fromString(this.issuer), - credentialSubject: this.credentialSubject.reduce((all, current) => { - all[current.name] = current.value; - return all; - }, {}), - }; + if (this.recoveryId === JWTVerifiableCredentialRecoveryId) { + const jwtString = Buffer.from(this.credentialData).toString(); + const jwtObj = JSON.parse(jwtString); + return JWTCredential.fromJWT(jwtObj, jwtString); + } else if (this.recoveryId === AnonCredsRecoveryId) { + const credentialData = Buffer.from(this.credentialData).toString(); + const credentialJson = JSON.parse(credentialData); + return new AnonCredsCredential({ + schema_id: credentialJson[AnonCredsCredentialProperties.schemaId], + cred_def_id: + credentialJson[AnonCredsCredentialProperties.credentialDefinitionId], + values: credentialJson[AnonCredsCredentialProperties.values], + signature: credentialJson[AnonCredsCredentialProperties.signasture], + signature_correctness_proof: + credentialJson[ + AnonCredsCredentialProperties.signatureCorrectnessProof + ], + }); + } else { + throw new Error("Unsupported key type from db storage"); + } }, }; diff --git a/src/schemas/CredentialRequestMetadata.ts b/src/schemas/CredentialRequestMetadata.ts new file mode 100644 index 00000000..0f5cab39 --- /dev/null +++ b/src/schemas/CredentialRequestMetadata.ts @@ -0,0 +1,77 @@ +import { + AnonCredsCredential, + AnonCredsCredentialProperties, + AnonCredsRecoveryId, + Domain, + JWTCredential, + JWTVerifiableCredentialRecoveryId, +} from "@input-output-hk/atala-prism-wallet-sdk"; +import type { Schema } from "../types"; +import { RxCollection, RxDocument } from "rxdb"; + +export type CredentialRequestMetadataSchemaType = { + id: string; + link_secret_blinding_data: { + v_prime: string; + }; + link_secret_name: string; + nonce: string; +}; + +/** + * CredentialRequestMetadataSchema + */ +const CredentialRequestMetadataSchema: Schema = + { + version: 0, + primaryKey: "id", + type: "object", + properties: { + id: { + type: "string", + maxLength: 60, + }, + link_secret_blinding_data: { + type: "object", + properties: { + v_prime: { + type: "string", + }, + }, + }, + link_secret_name: { + type: "string", + }, + nonce: { + type: "string", + }, + }, + encrypted: ["link_secret_blinding_data", "nonce"], + required: ["id", "link_secret_blinding_data", "link_secret_name", "nonce"], + }; + +export type CredentialRequestMetadataDocument = + RxDocument; + +export type CredentialRequestMetadataMethodTypes = { + toDomainCredentialRequestMetadata: ( + this: CredentialRequestMetadataSchemaType + ) => Domain.Anoncreds.CredentialRequestMeta; +}; + +export const CredentialRequestMetadataMethods: CredentialRequestMetadataMethodTypes = + { + toDomainCredentialRequestMetadata: + function toDomainCredentialRequestMetadata( + this: CredentialRequestMetadataSchemaType + ) { + return this; + }, + }; + +export type CredentialRequestMetadataCollection = RxCollection< + CredentialRequestMetadataSchemaType, + CredentialRequestMetadataMethodTypes +>; + +export default CredentialRequestMetadataSchema; diff --git a/src/schemas/LinkSecret.ts b/src/schemas/LinkSecret.ts new file mode 100644 index 00000000..5ad8578f --- /dev/null +++ b/src/schemas/LinkSecret.ts @@ -0,0 +1,49 @@ +import { Domain } from "@input-output-hk/atala-prism-wallet-sdk"; +import type { Schema } from "../types"; +import { RxCollection, RxDocument } from "rxdb"; + +export type LinkSecretSchemaType = { + readonly name: string; + readonly secret: string; +}; + +/** + * LinkSecretSchema + */ +const LinkSecretSchema: Schema = { + version: 0, + primaryKey: "name", + type: "object", + properties: { + name: { + type: "string", + maxLength: 60, + }, + secret: { + type: "string", + }, + }, + encrypted: ["secret"], + required: ["name", "secret"], +}; + +export type LinkSecretDocument = RxDocument< + LinkSecretSchemaType, + LinkSecretMethodTypes +>; + +export type LinkSecretMethodTypes = { + toDomainLinkSecret: (this: LinkSecretDocument) => Domain.Anoncreds.LinkSecret; +}; + +export type LinkSecretColletion = RxCollection< + LinkSecretSchemaType, + LinkSecretMethodTypes +>; + +export const LinkSecretMethods: LinkSecretMethodTypes = { + toDomainLinkSecret: function toDomainLinkSecret(this: LinkSecretDocument) { + return this.secret; + }, +}; +export default LinkSecretSchema; diff --git a/tests/fixtures.ts b/tests/fixtures.ts index 4ec789f1..6bb87996 100644 --- a/tests/fixtures.ts +++ b/tests/fixtures.ts @@ -5,8 +5,8 @@ import { Secp256k1PrivateKey, X25519KeyPair, X25519PrivateKey, + Domain, } from "@input-output-hk/atala-prism-wallet-sdk"; - const secpPrivateKey = new Secp256k1PrivateKey( new Uint8Array([ 45, 182, 188, 189, 107, 229, 136, 180, 199, 177, 110, 84, 98, 140, 121, 84, @@ -19,7 +19,7 @@ export const secp256K1 = new Secp256k1KeyPair( ); const ed25519PrivateKey = new Ed25519PrivateKey( - Buffer.from("JLIJQ5jlkyqtGmtOth6yggJLLC0zuRhUPiBhd1-rGPs") + Buffer.from("JLIJQ5jlkyqtGmtOth6yggJLLC0zuRhUPiBhd1-rGPs", "base64url") ); export const ed25519 = new Ed25519KeyPair( ed25519PrivateKey, @@ -27,9 +27,190 @@ export const ed25519 = new Ed25519KeyPair( ); const x25519PrivateKey = new X25519PrivateKey( - Buffer.from("eHbEtI71XIBIsuQK7XdjZ_ZPnLZb3y4paWoqSoS7BnI") + Buffer.from("eHbEtI71XIBIsuQK7XdjZ_ZPnLZb3y4paWoqSoS7BnI", "base64url") ); export const x25519 = new X25519KeyPair( x25519PrivateKey, x25519PrivateKey.publicKey() ); + +export const linkSecret: Domain.Anoncreds.LinkSecret = + "11713282333014162675185775227133916651856831195832037281552411830422122210216"; + +export const schema: Domain.Anoncreds.Schema = { + name: "schema name", + version: "1.0", + attrNames: ["name", "age"], + issuerId: "did:web:xyz", +}; + +export const schemaId = "did:web:xyz/resource/schema"; +export const schemas = { [schemaId]: schema }; +export const credDefId = "did:web:xyz/resource/cred-def"; + +export const credOffer: Domain.Anoncreds.CredentialOffer = { + schema_id: schemaId, + cred_def_id: "did:web:xyz/resource/cred-def", + key_correctness_proof: { + c: "76557819503450570442357976029271303987759136289314846847024757974752606615433", + xz_cap: + "26047879363332547950920668394631678475313752008082689588028385075806198959009721480298642181417611387120760535340960652992598169976318796059443404652478753165940963938026715950444631637055579596396026982943529446772342056118213731997539494790069972362712412848545977350411933491687478962150552753933891241069977903236245408595467016248045708851235686828269686277218325172481148269365738838667311348922929239876501229218854901336077610669087389670091204141817761014674154146755628794442065539896048607369184947340323162627521384048677015174858428761829211514983844416604741456701465732354883642257230400665085164493995639836946749428712602480384130632356640901418646806091518373306556288954289", + xr_cap: [ + [ + "age", + "37523550844923066276917545265534491936001653058431807699727798378094010348017417786213033463012541464861614713651678817589894752131766899552202186956509278956052677681349590167219631006515597935364124683509557223008283580029502931430380055551345019089794453342866634865505293670597130041956152064268604570574775784367900164625667326244382433984825612756021533073304839324299187948682509607641828855308845653725291687712265043071582873816295392972053358963210517456371474273531564989381194134152519027319325114667103082545250397114009229013996244896611333191925354781709243382864211341173108829209135657104587482214147977220885303413739052442209985783183870139853950883453738389448581714672060", + ], + [ + "name", + "40114198290379256041372995441628703701697468212013103904320488156133624512624518776636636679936428767628511100834703945932272277119352677403376670387372871153129929576812118980029243346717913240254947965865744085397369091151556546260636586787167694200525462305016276069215035338546740434877965464035950368040654082423013022634233986285166071269362922845761571385784692708141028444335024777471220924204393976065258643143210131836379590020472238396839577304048276973858344620772092596583905864740719861059017160818497762374044149149314046526512381034705421360416522645565343294048956673555742143144006335123972014910685697417095527968642708567895812407107903351826576984395268441796123152869510", + ], + [ + "master_secret", + "17378775238119039681239435504832690562693139985297581004609697280961799415478395227365074603387798682709917541921746683788459574112268962573229585691444414002163279289000517128970409045422613794886895141511303902319051161040962745971806552893764259050521879639998894425230406084402232911982800786217758930274472277822969507777888869816351683032762867227108504826294469816717150773627310267951901092893045791169831629487768555281136526127037211876008761095116571863850777229858315210904916939671575373966848439177870458227542504890675195429629741131074431032162974747956977739339739205375284664571315097532432745565887768994606184944468164941808835757519277660700337481958408893690556466192208", + ], + ], + }, + nonce: "1155389807945475146571300", + method_name: "anoncreds", +}; + +export const credDef: Domain.Anoncreds.CredentialDefinition = { + schemaId: schemaId, + issuerId: "did:web:xyz", + type: "CL", + tag: "default-tag", + value: { + primary: { + n: "2138440416314633374591088195063696546043123277066922638020134791602273076278733265198390559999196639059617332341897171969471396384426442263407149455313654361683364983454358134154449737184762832549626365860664862681300853260092245460133629393197506797813510115597160823513332022868942084864264115026443220310847039670437343802177458713870037673612155704946372493840496386886773727466495489416209443026828278038061798339071661238983028310965032474627760641708951476779486574582009667149594572417153818776817059886544993889576267253226541766667935646506220326294624143640755229768275395867260209310406030868988219396673", + s: "375783515905172479678189694439438293124410653823481120500720236836905424414937248674149487774807325687499797860172928285508262280982970486768785344476352731223145346966890620843636512852741061102998942506714117113306492151964896503097722677379824165340858924427501815041684806109662866453098916197117471136063544146802291756839519730104512053670312142976363639936614666586671853469442125677481817693926232925010812196258066027716393514210467312905260647664980944899919627823305269563954240416713003055413714633135095057064137982879242895058862234484222386526805971607419993779687534728535549485529895709794024363544", + r: [ + [ + "name", + "1339792759576954480492376578847792893360328516229286900150133471363186583829749911481667461401130501227404036403509999655715920590906655449568921973193383734895050724786440176443319672836559729173248746986868722909818220919403659226270224677749054849267437090960630699131904219878221761847284501312771606158271185560102808030298570761806506842137173746368720591853713380684958166350096104972264094294658573736651672550243062941442151223970367393394495048879093769466881961496855436604768494279534819818767775118321755604018201554330386132841353338949038092004967328970916219672468954833865033319360866074670007780618", + ], + [ + "master_secret", + "812744365608357986515546951213735794905780531247400654485983675689007345252680783465620382756268298324619070095212727671013163587057960315104611505032391159923993186222992472271453158974000542388378728270352857044809506169036309424352546411124179707638441673291158450401569249553417829367721202384508794163270341742020366880294131562095198464204914661778362000567741892826931098757894984606489166588347686099839472171239690638334264704817162009248984017866176802917792042053625420351082400053844639007943327226933542386763152742005797026693758548721701645341688448869500455939673371665799883665035196100593742820765", + ], + [ + "age", + "1449485663749865112122084718309651799315876369399955386403349647157857267039738681846930133397399422116354888183111371765400737684123480339059046850189555156190164677867617134270296041268333092741226364695203773774260453734976395787415140818149909781659096210986518767963537521355538341046796673590463001432519694523140909453262132434115275751962728302009629278131044645113553957913861064628840202634780565720519420413110235161108122048945955929418529430552412537083201815025931848807079298247150295522314313662791060217650118275501496403633416974085086279896777251419212772606455298376048561561660554033200664561122", + ], + ], + rctxt: + "860911025032267966121537116747511648169210971555331852297327983657139587085942104673653614121933222003762276431341903715802016467096443789060052518852455149260273877263078757890535509188798812965587842763977780248898565717270220023917514653105171642271549164940634714174542454453494892988595340755873769347520154470471770549002457696766440819869518496811070236983222777464118573117519720995323647212086015212164299500917094183811610380285975565511188317704996015410378305078269879189003145417420690660051014495457659387330566369572172736139469523933999250778057312091553667159949004204624608553681313568626037528816", + z: "2121804520854046155333146480946067403536032620048509173296488461620991470957905025190073393533065162826019376175710496819562862443921284310624809586091960645852195207737003870600962592140196338174630044646719556493115513937191171697377398878248566738696903934756282960488248731988728585511385043106689590903854157937005001256453527432445636221995990491062748065236450143241984118701723276135733985922648057616666342802697522278188836392945197544183484607303781398698553490093880903336637463635680300818603734335511536928765778308620191754963249571453280495676312497378814397081522448865551665149984638461990456850881", + }, + }, +}; + +export const credDefs = { [credDefId]: credDef }; + +export const createJWTPayload = ( + id: string, + proof: string, + credentialType: Domain.CredentialType +) => { + const vc = { + id, + credentialType: credentialType, + type: [credentialType], + aud: ["aud"], + context: ["context"], + credentialSubject: { whatever: "credSubject" }, + evidence: { + id: "evidenceId", + type: "evidenceType", + }, + expirationDate: new Date().toISOString(), + issuanceDate: new Date().toISOString(), + issuer: new Domain.DID( + "did", + "peer", + "2.Ez6LSms555YhFthn1WV8ciDBpZm86hK9tp83WojJUmxPGk1hZ.Vz6MkmdBjMyB4TS5UbbQw54szm8yvMMf1ftGV2sQVYAxaeWhE.SeyJpZCI6Im5ldy1pZCIsInQiOiJkbSIsInMiOiJodHRwczovL21lZGlhdG9yLnJvb3RzaWQuY2xvdWQiLCJhIjpbImRpZGNvbW0vdjIiXX0" + ), + refreshService: { + id: "refreshServiceId", + type: "refreshServiceType", + }, + termsOfUse: { + id: "termsOfUseId", + type: "termsOfUseType", + }, + validFrom: { + id: "validFromId", + type: "validFromType", + }, + validUntil: { + id: "validUntilId", + type: "validUntilType", + }, + credentialSchema: { + id: "credentialSchemaId", + type: "credentialSchemaType", + }, + credentialStatus: { + id: "credentialStatusId", + type: "credentialStatusType", + }, + proof: proof, + }; + + const jwtPayload: any = { + id: "123", + iss: "did:peer:2.issuer", + nbf: 1680615608435, + sub: "did:peer:2.sub", + exp: 1680615608435, + aud: ["aud-json"], + vc: vc, + }; + + return jwtPayload; +}; +export const credRequestMeta: Domain.Anoncreds.CredentialRequestMeta = { + link_secret_blinding_data: { + v_prime: + "77955816791910907008648197625607251151043985904464685610589268755863823710042524325116894319321593903274621305101429675982328480929558765668395477286044036175023571135951855240427212072392115346223990606637530234412828281763675277786130736667970888577953183545724972075795470500481480587504146888168295548415330994692518385699942377815143595346327569474696881929936106990569016082555989993978175098221779656764883735585641835663445021379504408712254130562797706300716047105206280868009518894051808092685428634143160521444146484478798980767637798519834481411563284127214784285274598304432830695507876151369513892826498610123007743998318639", + }, + nonce: "384669312299348345170475", + link_secret_name: "link-secret-id", +}; + +export const credentialIssued: Domain.Anoncreds.CredentialIssued = { + schema_id: schemaId, + cred_def_id: "did:web:xyz/resource/cred-def", + values: [ + ["age", { raw: "28", encoded: "28" }], + [ + "name", + { + raw: "john", + encoded: + "68231017646261521938414776289104528029572365316885701689085572319872983785594", + }, + ], + ], + signature: { + p_credential: { + m_2: "90069112451055455821909400594406389902973279602878070870495376996444562816830", + a: "863206875070883508185084882433898034597056397288064150964909699848368101345942320681713420008320908172031366175764418516990530197118497873083108998836069955208560561365885178868957934721121818800195152765722925303482592098299043872531270628211279296662298703380533421005111978188231514326269144788469626292012467891951834985914306479999402596193828005218601831577836972155135721113555056320950898902900812022442212634154104525444865293627714269994627396682813488336112739630599692616934030468341046723507920859605204701140679082157987867742695138146865893004386171114420488126218257552981621418620795971402342420055", + e: "259344723055062059907025491480697571938277889515152306249728583105665800713306759149981690559193987143012367913206299323899696942213235956742930103453519678657228466134629917218519", + v: "8143446409913772255034152121328368039740626498888186354398879911744619763092523700068534155970316639325500748530790803346133400742208591972338832230481355996998878663423674449927007017103519158518841363025981102486265082027859231212785242394349018269859142047237847004466507505310624703221646956096334505927823727535128643408929895721360649486881661653430795374387398186589089307192641017475854047689060015396792244392488752028709889494148392343976206977761336843050968984216787674405343600492400040342034954879243301323597723425634111031850182237417361092482780483169862079554189749933027076569428078736298787846257330215373212181232245606400244542414366394276001432386415321137893700290570865313825552071290779533007084933667485178966714254743589959898887425372871525225305207025738953531478454150168638254081854031392", + }, + }, + signature_correctness_proof: { + se: "471472993450654125094815726148197965574424476578333157254325140782961168825105331051644868767781028679788350834880525043676296586472820693042050052742548830411776592846473749819901073592049502739648801719081538069485917308909817697575396656049685055624390272024518499392129521543088779385005671778669761735194904527436501886256576199999327721691983944094804259738379761906169617912917061639899452266237275643426312858778978574970646335896180734752298062049872360989081844266166354770197707949373253367460986810798494254673065207170398218825977487917435335438139842606666094711078074326163791098396957184806668244832", + c: "99614365014321274953096367476703930366339506406903542322778818757090357462808", + }, +}; + +export const createAnonCredsPayload = () => { + return credentialIssued; +}; + +export const encodeAnonCredsCredential = (cred: object) => { + const json = JSON.stringify(cred); + const encoded = Buffer.from(json); + return encoded; +}; diff --git a/tests/pluto.test.ts b/tests/pluto.test.ts index 7a9cc8f3..2b8a2dcc 100644 --- a/tests/pluto.test.ts +++ b/tests/pluto.test.ts @@ -3,13 +3,24 @@ import "./setup"; import expect from "expect"; import { Database, PrivateKeyMethods } from "../src"; import { randomUUID } from "crypto"; -import { Domain } from "@input-output-hk/atala-prism-wallet-sdk"; +import { + AnonCredsCredential, + Apollo, + Castor, + Domain, + JWTCredential, + Pollux, +} from "@input-output-hk/atala-prism-wallet-sdk"; import * as Fixtures from "./fixtures"; import * as sinon from "sinon"; const databaseName = "prism-db"; const keyData = new Uint8Array(32); - +const jwtParts = [ + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9", + "eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwidHlwZSI6Imp3dCJ9", + "18bn-r7uRWAG4FCFBjxemKvFYPCAoJTOHaHthuXh5nM", +]; const messageType = "https://didcomm.org/basicmessage/2.0/message"; const createMessage = ( from?: Domain.DID, @@ -309,6 +320,15 @@ describe("Pluto + Dexie encrypted integration for browsers", () => { expect(dbMesaage!.id).toBe(message.id); }); + it("Should store a Message and update it", async () => { + const message = createMessage(); + await db.storeMessage(message); + await db.storeMessage(message); + const dbMesaage = await db.getMessage(message.id); + expect(dbMesaage).not.toBe(null); + expect(dbMesaage!.id).toBe(message.id); + }); + it("Should get all the messages", async () => { const allMessages = await db.getAllMessages(); expect(allMessages.length).toBe(0); @@ -396,11 +416,13 @@ describe("Pluto + Dexie encrypted integration for browsers", () => { it("Should get a did pair by its did", async () => { const host = Domain.DID.fromString("did:prism:123456"); const receiver = Domain.DID.fromString("did:prism:654321"); - const notfound = Domain.DID.fromString("did:prism:65432155555"); - const name = "example"; await db.storeDIDPair(host, receiver, name); expect(await db.getPairByDID(host)).not.toBe(null); + }); + + it("Should return null when a pair is fetched by a non existing did", async () => { + const notfound = Domain.DID.fromString("did:prism:65432155555"); expect(await db.getPairByDID(notfound)).toBe(null); }); @@ -410,7 +432,10 @@ describe("Pluto + Dexie encrypted integration for browsers", () => { const name = "example"; await db.storeDIDPair(host, receiver, name); expect(await db.getPairByName(name)).not.toBe(null); - expect(await db.getPairByName(" ")).toBe(null); + }); + + it("Should return null when a pair by name is not found", async () => { + expect(await db.getPairByName("not found")).toBe(null); }); it("Should store a mediator", async () => { @@ -483,99 +508,97 @@ describe("Pluto + Dexie encrypted integration for browsers", () => { expect(await db.getDIDPrivateKeyByID("123")).toHaveProperty("type"); }); - it("Should store a verifiable credential", async () => { + const encodeJWTCredential = (cred: object): string => { + const json = JSON.stringify(cred); + const encoded = Buffer.from(json).toString("base64"); + return `${jwtParts[0]}.${encoded}.${jwtParts[2]}`; + }; + + it("Should store and fetch a JWT Credential", async () => { expect((await db.getAllCredentials()).length).toBe(0); - await db.storeCredential({ - id: "", - credentialType: Domain.CredentialType.JWT, - context: ["test0", "test1"], - type: ["auth"], - credentialSchema: { - id: randomUUID(), - type: "decode_jwt", - }, - credentialSubject: { - test: "yes", - }, - credentialStatus: { - id: randomUUID(), - type: "test", - }, - refreshService: { - id: randomUUID(), - type: "test", - }, - evidence: { - id: randomUUID(), - type: "test", - }, - termsOfUse: { - id: randomUUID(), - type: "test", - }, - issuer: Domain.DID.fromString("did:prism:123"), - subject: Domain.DID.fromString("did:prism:123"), - issuanceDate: "2023-04-04T13:40:08.435Z", - expirationDate: "2023-04-04T13:40:08.435Z", - validFrom: { - id: randomUUID(), - type: "test", - }, - validUntil: { - id: randomUUID(), - type: "test", - }, - proof: "", - aud: ["test0", "test1"], + const jwtPayload = Fixtures.createJWTPayload( + "jwtid", + "proof", + Domain.CredentialType.JWT + ); + const encoded = encodeJWTCredential(jwtPayload); + const pollux = new Pollux(new Castor(new Apollo())); + const result = await pollux.parseCredential(Buffer.from(encoded), { + type: Domain.CredentialType.JWT, }); + await db.storeCredential(result); expect((await db.getAllCredentials()).length).toBe(1); }); - it("Should store a verifiable credential with empty subject", async () => { + it("Should store and fetch a Anoncreds Credential", async () => { expect((await db.getAllCredentials()).length).toBe(0); - await db.storeCredential({ - id: "", - credentialType: Domain.CredentialType.JWT, - context: ["test0", "test1"], - type: ["auth"], - credentialSchema: { - id: randomUUID(), - type: "decode_jwt", + const payload = Fixtures.createAnonCredsPayload(); + const result = new AnonCredsCredential({ + ...payload, + values: { + ...(payload.values.map(([varname, val]) => ({ + [varname]: val, + })) as any), }, - credentialSubject: { - test: "yes", - }, - credentialStatus: { - id: randomUUID(), - type: "test", - }, - refreshService: { - id: randomUUID(), - type: "test", - }, - evidence: { - id: randomUUID(), - type: "test", - }, - termsOfUse: { - id: randomUUID(), - type: "test", - }, - issuer: Domain.DID.fromString("did:prism:123"), - issuanceDate: "2023-04-04T13:40:08.435Z", - expirationDate: "2023-04-04T13:40:08.435Z", - validFrom: { - id: randomUUID(), - type: "test", - }, - validUntil: { - id: randomUUID(), - type: "test", - }, - proof: "", - aud: ["test0", "test1"], }); + await db.storeCredential(result); expect((await db.getAllCredentials()).length).toBe(1); }); + + it("Should store and fetch a link secret by its name", async () => { + const name = "test"; + const secret = "12345"; + await db.storeLinkSecret(secret, name); + expect(await db.getLinkSecret(name)).toBe(secret); + }); + + it("Should store and fetch a link secret without params", async () => { + const name = "test"; + const secret = "12345"; + await db.storeLinkSecret(secret, name); + expect(await db.getLinkSecret()).toBe(secret); + }); + + it("Should return null when no link secret is found", async () => { + expect(await db.getLinkSecret("notfound")).toBe(null); + }); + + it("Should store and fetch credential metadata by link secret name", async () => { + const linkSecretName = "test"; + await db.storeCredentialMetadata( + Fixtures.credRequestMeta, + linkSecretName + ); + expect( + (await db.fetchCredentialMetadata(linkSecretName))?.link_secret_name + ).toBe(linkSecretName); + }); + + it("should return null when no credentialMetadata is found by the linkSecretName", async () => { + expect(await db.fetchCredentialMetadata("notfound")).toBe(null); + }); + + it("Should throw an error if a non storable credential is stored", async () => { + expect(db.storeCredential({ fail: true } as any)).rejects.toThrowError( + new Error("Credential is not storable") + ); + }); + + it("Should throw an error if an unrecoverable key is loaded from DB", async () => { + const payload = Fixtures.createAnonCredsPayload(); + const result = new AnonCredsCredential({ + ...payload, + values: { + ...(payload.values.map(([varname, val]) => ({ + [varname]: val, + })) as any), + }, + }); + result.recoveryId = "demo"; + await db.storeCredential(result); + expect(db.getAllCredentials()).rejects.toThrowError( + new Error("Unsupported key type from db storage") + ); + }); }); });