From 7d509b8bdf7ff4314029db84e622454c2569e091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Javier=20Ribo=CC=81=20Labrador?= Date: Sat, 16 Dec 2023 07:02:45 -0500 Subject: [PATCH 1/5] =?UTF-8?q?fix:=20add=20vitest=20coverage=20v8.=20Sign?= =?UTF-8?q?ed-off-by:=20Francisco=20Javier=20Rib=C3=B3=20Labrador=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 54 ++++++++++++++++++++++++++++++++++ packages/database/package.json | 1 + 2 files changed, 55 insertions(+) diff --git a/package-lock.json b/package-lock.json index 1dd3b797..103f6514 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1924,6 +1924,12 @@ "node": ">=6.9.0" } }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -6242,6 +6248,12 @@ "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==" }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -6709,6 +6721,33 @@ "vitest": "^1.0.0" } }, + "node_modules/@vitest/coverage-v8": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.0.4.tgz", + "integrity": "sha512-xD6Yuql6RW0Ir/JJIs6rVrmnG2/KOWJF+IRX1oJQk5wGKGxbtdrYPbl+WTUn/4ICCQ2G20zbE1e8/nPNyAG5Vg==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.2.1", + "@bcoe/v8-coverage": "^0.2.3", + "debug": "^4.3.4", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-lib-source-maps": "^4.0.1", + "istanbul-reports": "^3.1.6", + "magic-string": "^0.30.5", + "magicast": "^0.3.2", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^9.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "^1.0.0" + } + }, "node_modules/@vitest/expect": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.0.4.tgz", @@ -25217,6 +25256,20 @@ "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", "dev": true }, + "node_modules/v8-to-istanbul": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", + "integrity": "sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -26220,6 +26273,7 @@ "@pluto-encrypted/indexdb": "../indexdb/", "@pluto-encrypted/inmemory": "../inmemory/", "@pluto-encrypted/leveldb": "../leveldb/", + "@vitest/coverage-v8": "^1.0.4", "level": "^6.0.1" }, "optionalDependencies": { diff --git a/packages/database/package.json b/packages/database/package.json index ea101434..350b0eb9 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -42,6 +42,7 @@ "@pluto-encrypted/indexdb": "../indexdb/", "@pluto-encrypted/inmemory": "../inmemory/", "@pluto-encrypted/leveldb": "../leveldb/", + "@vitest/coverage-v8": "^1.0.4", "level": "^6.0.1" }, "dependencies": { From 516d1e4dce454a2a8ca671c92e2a1bc5d3cc2704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Javier=20Ribo=CC=81=20Labrador?= Date: Sat, 16 Dec 2023 07:03:07 -0500 Subject: [PATCH 2/5] =?UTF-8?q?fix:=20update=20vitest=20configuration.=20S?= =?UTF-8?q?igned-off-by:=20Francisco=20Javier=20Rib=C3=B3=20Labrador=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/database/package.json | 4 ++-- vitest.config.ts | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/database/package.json b/packages/database/package.json index 350b0eb9..b8483ce6 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -21,7 +21,7 @@ "test:watch": "NODE_ENV=debug vitest tests/*.test.ts", "test:debug": "NODE_ENV=debug vitest tests/*.test.ts --inspect-brk --pool threads --poolOptions.threads.singleThread", "build": "rm -rf build && npx rollup -c rollup/rollup.mjs", - "coverage": "npx vitest run --coverage.enabled --coverage.reporter='json-summary' && npx istanbul-badges-readme --readmeDir=\"../../\"", + "coverage": "npx vitest run --coverage.enabled && npx istanbul-badges-readme --readmeDir=\"../../\"", "docs": "npx typedoc --options typedoc.json --hideGenerator" }, "repository": { @@ -53,4 +53,4 @@ "build/*" ], "gitHead": "6aa4ce8bbb9938fc4c4e790efffa5b902631362c" -} \ No newline at end of file +} diff --git a/vitest.config.ts b/vitest.config.ts index c5b46ef8..cf79e6c6 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -5,8 +5,14 @@ export default defineConfig({ test: { reporters: ['default'], // or 'verbose' coverage: { - provider: 'istanbul', - reporter: ['json-summary'] - } + provider: 'v8', + reporter: ['json-summary', 'html'], + thresholds: { + branches: 58, + functions: 64, + lines: 74, + statements: 71 + } + }, } }) From 7fdec06f7b23ac1fb658eb773e299353803df1b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Rib=C3=B3?= Date: Sat, 16 Dec 2023 12:05:11 +0000 Subject: [PATCH 3/5] chore(docs): Rebuild docs [skip ci] --- README.md | 2 +- docs/classes/Database.md | 94 +- .../database/coverage/database/index.html | 116 + .../coverage/database/release.config.mjs.html | 160 + .../coverage/database/rollup/index.html | 116 + .../coverage/database/rollup/rollup.mjs.html | 100 + .../database/coverage/database/src/index.html | 131 + .../coverage/database/src/index.ts.html | 3697 +++++++++++++++++ .../database/src/schemas/Credential.ts.html | 433 ++ .../schemas/CredentialRequestMetadata.ts.html | 322 ++ .../coverage/database/src/schemas/DID.ts.html | 220 + .../database/src/schemas/DIDPair.ts.html | 184 + .../database/src/schemas/LinkSecret.ts.html | 229 + .../database/src/schemas/Mediator.ts.html | 253 ++ .../database/src/schemas/Message.ts.html | 469 +++ .../database/src/schemas/PrivateKey.ts.html | 604 +++ .../coverage/database/src/schemas/index.html | 221 + .../coverage/database/src/types.ts.html | 217 + 18 files changed, 7520 insertions(+), 48 deletions(-) create mode 100644 packages/database/coverage/database/index.html create mode 100644 packages/database/coverage/database/release.config.mjs.html create mode 100644 packages/database/coverage/database/rollup/index.html create mode 100644 packages/database/coverage/database/rollup/rollup.mjs.html create mode 100644 packages/database/coverage/database/src/index.html create mode 100644 packages/database/coverage/database/src/index.ts.html create mode 100644 packages/database/coverage/database/src/schemas/Credential.ts.html create mode 100644 packages/database/coverage/database/src/schemas/CredentialRequestMetadata.ts.html create mode 100644 packages/database/coverage/database/src/schemas/DID.ts.html create mode 100644 packages/database/coverage/database/src/schemas/DIDPair.ts.html create mode 100644 packages/database/coverage/database/src/schemas/LinkSecret.ts.html create mode 100644 packages/database/coverage/database/src/schemas/Mediator.ts.html create mode 100644 packages/database/coverage/database/src/schemas/Message.ts.html create mode 100644 packages/database/coverage/database/src/schemas/PrivateKey.ts.html create mode 100644 packages/database/coverage/database/src/schemas/index.html create mode 100644 packages/database/coverage/database/src/types.ts.html diff --git a/README.md b/README.md index 02eaf127..86f2b510 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ We are not going to stop here but ensure that our SDK can be used in any platfor ## QA & Documentation | Statements | Branches | Functions | Lines | | --------------------------- | ----------------------- | ------------------------- | ----------------- | -| ![Statements](https://img.shields.io/badge/statements-94.5%25-brightgreen.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-88.88%25-yellow.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-92.85%25-brightgreen.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-94.23%25-brightgreen.svg?style=flat) | +| ![Statements](https://img.shields.io/badge/statements-94.58%25-brightgreen.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-92.05%25-brightgreen.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-85.24%25-yellow.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-94.58%25-brightgreen.svg?style=flat) | ### Documentation diff --git a/docs/classes/Database.md b/docs/classes/Database.md index c5711d89..38105de2 100644 --- a/docs/classes/Database.md +++ b/docs/classes/Database.md @@ -82,7 +82,7 @@ preferred underlying storage technology, most appropriate for your use case. #### Defined in -[index.ts:99](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L99) +[index.ts:99](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L99) ## Accessors @@ -123,7 +123,7 @@ await db.credentialmetadatas.remove({selector: {id: {$eq: 1}}}) #### Defined in -[index.ts:133](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L133) +[index.ts:133](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L133) ___ @@ -164,7 +164,7 @@ await db.credentials.remove({selector: {id: {$eq: 1}}}) #### Defined in -[index.ts:229](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L229) +[index.ts:229](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L229) ___ @@ -205,7 +205,7 @@ await db.didpairs.remove({selector: {id: {$eq: 1}}}) #### Defined in -[index.ts:197](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L197) +[index.ts:197](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L197) ___ @@ -246,7 +246,7 @@ await db.dids.remove({selector: {id: {$eq: 1}}}) #### Defined in -[index.ts:293](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L293) +[index.ts:293](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L293) ___ @@ -287,7 +287,7 @@ await db.linksecrets.remove({selector: {id: {$eq: 1}}}) #### Defined in -[index.ts:165](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L165) +[index.ts:165](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L165) ___ @@ -328,7 +328,7 @@ await db.mediators.remove({selector: {id: {$eq: 1}}}) #### Defined in -[index.ts:261](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L261) +[index.ts:261](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L261) ___ @@ -369,7 +369,7 @@ await db.messages.remove({selector: {id: {$eq: 1}}}) #### Defined in -[index.ts:357](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L357) +[index.ts:357](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L357) ___ @@ -410,7 +410,7 @@ await db.privatekeys.remove({selector: {id: {$eq: 1}}}) #### Defined in -[index.ts:325](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L325) +[index.ts:325](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L325) ## Methods @@ -424,7 +424,7 @@ await db.privatekeys.remove({selector: {id: {$eq: 1}}}) #### Defined in -[index.ts:101](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L101) +[index.ts:101](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L101) ___ @@ -441,7 +441,7 @@ and then destroy the database itself. #### Defined in -[index.ts:365](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L365) +[index.ts:365](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L365) ___ @@ -465,7 +465,7 @@ Domain.Pluto.fetchCredentialMetadata #### Defined in -[index.ts:1187](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L1187) +[index.ts:1187](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1187) ___ @@ -483,7 +483,7 @@ Domain.Pluto.getAllCredentials #### Defined in -[index.ts:1137](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L1137) +[index.ts:1137](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1137) ___ @@ -505,7 +505,7 @@ Domain.Pluto.getAllDidPairs #### Defined in -[index.ts:751](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L751) +[index.ts:751](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L751) ___ @@ -523,7 +523,7 @@ Domain.Pluto.getAllMediators #### Defined in -[index.ts:1132](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L1132) +[index.ts:1132](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1132) ___ @@ -545,7 +545,7 @@ Domain.Pluto.getAllMessages #### Defined in -[index.ts:469](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L469) +[index.ts:469](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L469) ___ @@ -569,7 +569,7 @@ Domain.Pluto.getAllMessagesByDID #### Defined in -[index.ts:945](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L945) +[index.ts:945](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L945) ___ @@ -594,7 +594,7 @@ Domain.Pluto.getAllMessagesByFromToDID #### Defined in -[index.ts:1058](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L1058) +[index.ts:1058](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1058) ___ @@ -619,7 +619,7 @@ Domain.Pluto.getAllMessagesOfType #### Defined in -[index.ts:1027](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L1027) +[index.ts:1027](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1027) ___ @@ -637,7 +637,7 @@ Domain.Pluto.getAllMessagesReceived #### Defined in -[index.ts:978](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L978) +[index.ts:978](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L978) ___ @@ -661,7 +661,7 @@ Domain.Pluto.getAllMessagesReceivedFrom #### Defined in -[index.ts:1010](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L1010) +[index.ts:1010](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1010) ___ @@ -679,7 +679,7 @@ Domain.Pluto.getAllMessagesSent #### Defined in -[index.ts:963](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L963) +[index.ts:963](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L963) ___ @@ -703,7 +703,7 @@ Domain.Pluto.getAllMessagesSentTo #### Defined in -[index.ts:993](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L993) +[index.ts:993](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L993) ___ @@ -721,7 +721,7 @@ Domain.Pluto.getAllPeerDIDs #### Defined in -[index.ts:1095](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L1095) +[index.ts:1095](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1095) ___ @@ -739,7 +739,7 @@ Domain.Pluto.getAllPrismDIDs #### Defined in -[index.ts:853](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L853) +[index.ts:853](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L853) ___ @@ -763,7 +763,7 @@ Domain.Pluto.getDIDInfoByAlias #### Defined in -[index.ts:918](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L918) +[index.ts:918](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L918) ___ @@ -787,7 +787,7 @@ Domain.Pluto.getDIDInfoByDID #### Defined in -[index.ts:885](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L885) +[index.ts:885](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L885) ___ @@ -811,7 +811,7 @@ Domain.Pluto.getDIDPrivateKeyByID #### Defined in -[index.ts:829](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L829) +[index.ts:829](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L829) ___ @@ -835,7 +835,7 @@ Domain.Pluto.getDIDPrivateKeysByDID #### Defined in -[index.ts:817](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L817) +[index.ts:817](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L817) ___ @@ -859,7 +859,7 @@ Domain.Pluto.getLinkSecret #### Defined in -[index.ts:1144](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L1144) +[index.ts:1144](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1144) ___ @@ -887,7 +887,7 @@ Domain.Pluto.getMessage #### Defined in -[index.ts:411](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L411) +[index.ts:411](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L411) ___ @@ -915,7 +915,7 @@ Domain.Pluto.getPairByDID #### Defined in -[index.ts:765](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L765) +[index.ts:765](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L765) ___ @@ -939,7 +939,7 @@ Domain.Pluto.getPairByName #### Defined in -[index.ts:789](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L789) +[index.ts:789](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L789) ___ @@ -963,7 +963,7 @@ Domain.Pluto.getPrismDIDKeyPathIndex #### Defined in -[index.ts:1079](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L1079) +[index.ts:1079](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1079) ___ @@ -981,7 +981,7 @@ Domain.Pluto.getPrismLastKeyPathIndex #### Defined in -[index.ts:1087](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L1087) +[index.ts:1087](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1087) ___ @@ -1001,7 +1001,7 @@ Domain.Pluto.start #### Defined in -[index.ts:481](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L481) +[index.ts:481](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L481) ___ @@ -1025,7 +1025,7 @@ Domain.Pluto.storeCredential #### Defined in -[index.ts:1122](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L1122) +[index.ts:1122](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1122) ___ @@ -1050,7 +1050,7 @@ Domain.Pluto.storeCredentialMetadata #### Defined in -[index.ts:1176](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L1176) +[index.ts:1176](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1176) ___ @@ -1078,7 +1078,7 @@ Domain.Pluto.storeDIDPair #### Defined in -[index.ts:693](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L693) +[index.ts:693](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L693) ___ @@ -1103,7 +1103,7 @@ Domain.Pluto.storeLinkSecret #### Defined in -[index.ts:1166](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L1166) +[index.ts:1166](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1166) ___ @@ -1129,7 +1129,7 @@ Domain.Pluto.storeMediator #### Defined in -[index.ts:840](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L840) +[index.ts:840](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L840) ___ @@ -1157,7 +1157,7 @@ Domain.Pluto.storeMessage #### Defined in -[index.ts:430](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L430) +[index.ts:430](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L430) ___ @@ -1185,7 +1185,7 @@ Domain.Pluto.storeMessages #### Defined in -[index.ts:459](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L459) +[index.ts:459](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L459) ___ @@ -1212,7 +1212,7 @@ Domain.Pluto.storePeerDID #### Defined in -[index.ts:651](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L651) +[index.ts:651](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L651) ___ @@ -1242,7 +1242,7 @@ Domain.Pluto.storePrismDID #### Defined in -[index.ts:624](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L624) +[index.ts:624](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L624) ___ @@ -1271,7 +1271,7 @@ Domain.Pluto.storePrivateKeys #### Defined in -[index.ts:712](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L712) +[index.ts:712](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L712) ___ @@ -1299,4 +1299,4 @@ Database #### Defined in -[index.ts:378](https://github.com/elribonazo/pluto-encrypted/blob/23a8a9b/packages/database/src/index.ts#L378) +[index.ts:378](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L378) diff --git a/packages/database/coverage/database/index.html b/packages/database/coverage/database/index.html new file mode 100644 index 00000000..4fa7be47 --- /dev/null +++ b/packages/database/coverage/database/index.html @@ -0,0 +1,116 @@ + + + + + + Code coverage report for database + + + + + + + + + +
+
+

All files database

+
+ +
+ 0% + Statements + 0/25 +
+ + +
+ 0% + Branches + 0/1 +
+ + +
+ 0% + Functions + 0/1 +
+ + +
+ 0% + Lines + 0/25 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
release.config.mjs +
+
0%0/250%0/10%0/10%0/25
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/packages/database/coverage/database/release.config.mjs.html b/packages/database/coverage/database/release.config.mjs.html new file mode 100644 index 00000000..15065c15 --- /dev/null +++ b/packages/database/coverage/database/release.config.mjs.html @@ -0,0 +1,160 @@ + + + + + + Code coverage report for database/release.config.mjs + + + + + + + + + +
+
+

All files / database release.config.mjs

+
+ +
+ 0% + Statements + 0/25 +
+ + +
+ 0% + Branches + 0/1 +
+ + +
+ 0% + Functions + 0/1 +
+ + +
+ 0% + Lines + 0/25 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
export default {
+  plugins: [
+    "@semantic-release/commit-analyzer",
+    "@semantic-release/release-notes-generator",
+    [
+      "@semantic-release/changelog",
+      {
+        changelogFile: "../../CHANGELOG.md",
+      },
+    ],
+    "@semantic-release/npm",
+    [
+      "@semantic-release/git",
+      {
+        assets: [
+          "**/*"
+        ],
+        message:
+          "chore(release): Released ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
+        signedCommit: true,
+      },
+    ],
+    "@semantic-release/github",
+  ],
+};
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/packages/database/coverage/database/rollup/index.html b/packages/database/coverage/database/rollup/index.html new file mode 100644 index 00000000..c9525426 --- /dev/null +++ b/packages/database/coverage/database/rollup/index.html @@ -0,0 +1,116 @@ + + + + + + Code coverage report for database/rollup + + + + + + + + + +
+
+

All files database/rollup

+
+ +
+ 0% + Statements + 0/5 +
+ + +
+ 0% + Branches + 0/1 +
+ + +
+ 0% + Functions + 0/1 +
+ + +
+ 0% + Lines + 0/5 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
rollup.mjs +
+
0%0/50%0/10%0/10%0/5
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/packages/database/coverage/database/rollup/rollup.mjs.html b/packages/database/coverage/database/rollup/rollup.mjs.html new file mode 100644 index 00000000..27050eb6 --- /dev/null +++ b/packages/database/coverage/database/rollup/rollup.mjs.html @@ -0,0 +1,100 @@ + + + + + + Code coverage report for database/rollup/rollup.mjs + + + + + + + + + +
+
+

All files / database/rollup rollup.mjs

+
+ +
+ 0% + Statements + 0/5 +
+ + +
+ 0% + Branches + 0/1 +
+ + +
+ 0% + Functions + 0/1 +
+ + +
+ 0% + Lines + 0/5 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6  +  +  +  +  + 
import nodePolyfills from "rollup-plugin-polyfill-node";
+
+import CreateConfig from "../../../rollup/index.mjs";
+
+export default CreateConfig(undefined, []);
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/packages/database/coverage/database/src/index.html b/packages/database/coverage/database/src/index.html new file mode 100644 index 00000000..d3ee0520 --- /dev/null +++ b/packages/database/coverage/database/src/index.html @@ -0,0 +1,131 @@ + + + + + + Code coverage report for database/src + + + + + + + + + +
+
+

All files database/src

+
+ +
+ 94.15% + Statements + 1176/1249 +
+ + +
+ 92.37% + Branches + 109/118 +
+ + +
+ 86.79% + Functions + 46/53 +
+ + +
+ 94.15% + Lines + 1176/1249 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
index.ts +
+
97.67%1176/120493.16%109/11788.46%46/5297.67%1176/1204
types.ts +
+
0%0/450%0/10%0/10%0/45
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/packages/database/coverage/database/src/index.ts.html b/packages/database/coverage/database/src/index.ts.html new file mode 100644 index 00000000..4fb78aa5 --- /dev/null +++ b/packages/database/coverage/database/src/index.ts.html @@ -0,0 +1,3697 @@ + + + + + + Code coverage report for database/src/index.ts + + + + + + + + + +
+
+

All files / database/src index.ts

+
+ +
+ 97.67% + Statements + 1176/1204 +
+ + +
+ 93.16% + Branches + 109/117 +
+ + +
+ 88.46% + Functions + 46/52 +
+ + +
+ 97.67% + Lines + 1176/1204 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 +807 +808 +809 +810 +811 +812 +813 +814 +815 +816 +817 +818 +819 +820 +821 +822 +823 +824 +825 +826 +827 +828 +829 +830 +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844 +845 +846 +847 +848 +849 +850 +851 +852 +853 +854 +855 +856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 +878 +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891 +892 +893 +894 +895 +896 +897 +898 +899 +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961 +962 +963 +964 +965 +966 +967 +968 +969 +970 +971 +972 +973 +974 +975 +976 +977 +978 +979 +980 +981 +982 +983 +984 +985 +986 +987 +988 +989 +990 +991 +992 +993 +994 +995 +996 +997 +998 +999 +1000 +1001 +1002 +1003 +1004 +1005 +1006 +1007 +1008 +1009 +1010 +1011 +1012 +1013 +1014 +1015 +1016 +1017 +1018 +1019 +1020 +1021 +1022 +1023 +1024 +1025 +1026 +1027 +1028 +1029 +1030 +1031 +1032 +1033 +1034 +1035 +1036 +1037 +1038 +1039 +1040 +1041 +1042 +1043 +1044 +1045 +1046 +1047 +1048 +1049 +1050 +1051 +1052 +1053 +1054 +1055 +1056 +1057 +1058 +1059 +1060 +1061 +1062 +1063 +1064 +1065 +1066 +1067 +1068 +1069 +1070 +1071 +1072 +1073 +1074 +1075 +1076 +1077 +1078 +1079 +1080 +1081 +1082 +1083 +1084 +1085 +1086 +1087 +1088 +1089 +1090 +1091 +1092 +1093 +1094 +1095 +1096 +1097 +1098 +1099 +1100 +1101 +1102 +1103 +1104 +1105 +1106 +1107 +1108 +1109 +1110 +1111 +1112 +1113 +1114 +1115 +1116 +1117 +1118 +1119 +1120 +1121 +1122 +1123 +1124 +1125 +1126 +1127 +1128 +1129 +1130 +1131 +1132 +1133 +1134 +1135 +1136 +1137 +1138 +1139 +1140 +1141 +1142 +1143 +1144 +1145 +1146 +1147 +1148 +1149 +1150 +1151 +1152 +1153 +1154 +1155 +1156 +1157 +1158 +1159 +1160 +1161 +1162 +1163 +1164 +1165 +1166 +1167 +1168 +1169 +1170 +1171 +1172 +1173 +1174 +1175 +1176 +1177 +1178 +1179 +1180 +1181 +1182 +1183 +1184 +1185 +1186 +1187 +1188 +1189 +1190 +1191 +1192 +1193 +1194 +1195 +1196 +1197 +1198 +1199 +1200 +1201 +1202 +1203 +1204 +12051x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +  +  +1x +1x +1x +1x +1x +1x +3x +3x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +  +  +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +  +  +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +  +  +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +3x +3x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +  +  +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +  +  +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +9x +9x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +  +  +1x +1x +1x +1x +1x +1x +80x +80x +720x +720x +80x +80x +1x +1x +1x +1x +1x +1x +1x +120x +120x +120x +120x +120x +120x +120x +120x +120x +  +  +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +3x +3x +120x +120x +120x +1x +1x +1x +1x +1x +1x +1x +9x +9x +9x +9x +9x +9x +9x +9x +6x +6x +3x +9x +1x +1x +1x +1x +1x +1x +1x +27x +27x +27x +27x +27x +27x +27x +27x +27x +6x +6x +6x +6x +6x +27x +21x +21x +21x +21x +21x +21x +27x +1x +1x +1x +1x +1x +1x +1x +6x +12x +12x +6x +1x +1x +1x +1x +1x +1x +6x +6x +6x +1x +1x +960x +960x +1x +1x +1x +1x +1x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +120x +600x +4800x +4800x +4800x +4800x +4800x +234x +234x +234x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +  +  +  +3x +3x +231x +231x +231x +234x +  +  +231x +231x +  +234x +4800x +4800x +4800x +4800x +600x +120x +120x +  +  +  +  +  +  +120x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +1x +1x +1x +1x +1x +1x +1x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +3x +1x +1x +1x +1x +1x +1x +1x +1x +12x +12x +12x +12x +12x +12x +12x +12x +12x +12x +1x +1x +1x +1x +1x +1x +1x +1x +1x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +15x +1x +1x +1x +1x +1x +1x +6x +6x +6x +6x +3x +6x +6x +1x +1x +1x +1x +1x +1x +1x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +3x +3x +3x +3x +3x +3x +6x +1x +1x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +3x +3x +3x +3x +3x +3x +6x +1x +1x +45x +45x +45x +45x +1x +1x +45x +45x +45x +45x +45x +45x +45x +45x +45x +45x +1x +1x +6x +6x +6x +6x +6x +6x +6x +6x +6x +1x +1x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +1x +1x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +18x +1x +1x +12x +12x +12x +12x +12x +12x +12x +12x +12x +9x +9x +9x +9x +9x +3x +3x +3x +3x +6x +6x +6x +9x +9x +9x +9x +9x +9x +9x +3x +3x +12x +1x +1x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +1x +1x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +1x +1x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +1x +1x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +1x +1x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +1x +1x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +1x +1x +6x +6x +6x +6x +6x +6x +6x +6x +6x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +6x +6x +6x +6x +6x +6x +6x +6x +6x +1x +1x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +1x +1x +9x +9x +3x +3x +6x +9x +1x +1x +9x +9x +3x +3x +6x +9x +1x +1x +6x +6x +6x +6x +6x +6x +6x +6x +6x +3x +3x +3x +3x +3x +3x +6x +6x +6x +6x +3x +3x +3x +3x +6x +6x +1x +1x +15x +3x +3x +12x +12x +12x +12x +15x +1x +1x +15x +15x +15x +1x +1x +15x +15x +15x +15x +15x +1x +1x +9x +9x +9x +6x +6x +6x +6x +6x +6x +9x +9x +9x +9x +9x +9x +6x +6x +3x +3x +9x +1x +1x +6x +6x +6x +6x +6x +6x +6x +6x +1x +1x +3x +3x +3x +3x +3x +3x +3x +3x +3x +1x +1x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +6x +3x +3x +3x +6x +1x + 
import { Domain } from "@atala/prism-wallet-sdk";
+import {
+  MangoQuerySelector,
+  RxCollection,
+  RxCollectionBase,
+  RxCollectionCreator,
+  RxDatabase,
+  RxDatabaseCreator,
+  RxDumpDatabase,
+  RxQuery,
+  RxStorage,
+  createRxDatabase,
+  flatClone,
+  getFromMapOrThrow,
+  removeRxDatabase
+} from "rxdb";
+import { RxError } from "rxdb";
+import { addRxPlugin } from "rxdb";
+import { RxDBMigrationPlugin } from "rxdb/plugins/migration";
+import { RxDBQueryBuilderPlugin } from "rxdb/plugins/query-builder";
+import { v4 as uuidv4 } from "uuid";
+import { RxDBJsonDumpPlugin } from "rxdb/plugins/json-dump";
+import MessageSchema, {
+  MessageColletion,
+  MessageDocument,
+  MessageMethods,
+  MessageSchemaType,
+} from "./schemas/Message";
+import DIDSchema, { DIDCollection, DIDDocument, DIDSchemaType } from "./schemas/DID";
+import CredentialSchema, {
+  CredentialCollection,
+  CredentialDocument,
+  CredentialMethods,
+  CredentialSchemaType,
+} from "./schemas/Credential";
+import DIDPairSchema, { DIDPairCollection, DIDPairDocument, DIDPairSchemaType } from "./schemas/DIDPair";
+import MediatorSchema, {
+  MediatorCollection,
+  MediatorDocument,
+  MediatorMethods,
+  MediatorSchemaType,
+} from "./schemas/Mediator";
+import PrivateKeySchema, {
+  KeySchemaType,
+  KeySpec,
+  PrivateKeyColletion,
+  PrivateKeyDocument,
+  PrivateKeyMethods,
+} from "./schemas/PrivateKey";
+import LinkSecretSchema, {
+  LinkSecretColletion,
+  LinkSecretDocument,
+  LinkSecretMethods,
+  LinkSecretSchemaType,
+} from "./schemas/LinkSecret";
+import CredentialRequestMetadataSchema, {
+  CredentialRequestMetadataCollection,
+  CredentialRequestMetadataDocument,
+  CredentialRequestMetadataMethods,
+  CredentialRequestMetadataSchemaType,
+} from "./schemas/CredentialRequestMetadata";
+import { GenericORMType, PlutoCollections } from "./types";
+import { BulkWriteRow, MangoQuerySelectorAndIndex, RxDocument, RxDocumentData } from "rxdb/dist/types/types";
+ 
+addRxPlugin(RxDBMigrationPlugin);
+addRxPlugin(RxDBQueryBuilderPlugin);
+//addRxPlugin(RxDBDevModePlugin);
+addRxPlugin(RxDBJsonDumpPlugin);
+ 
+export * from "./schemas/Message";
+export * from "./schemas/DID";
+export * from "./schemas/Credential";
+export * from "./schemas/DIDPair";
+export * from "./schemas/Mediator";
+export * from "./schemas/PrivateKey";
+ 
+export type ValuesOf<T> = T[keyof T];
+export type PlutoDatabase = RxDatabase<PlutoCollections>;
+ 
+/**
+ * Pluto is a storage interface describing storage requirements of the edge agents
+ * which will be implemented using this SDK. Implement this interface using your
+ * preferred underlying storage technology, most appropriate for your use case.
+ *
+ */
+export class Database implements Domain.Pluto {
+  /**
+   * @internal
+   */
+  private _db!: PlutoDatabase;
+ 
+  protected get db() {
+    if (!this._db) {
+      throw new Error("Start Pluto first.");
+    }
+    return this._db;
+  }
+ 
+  constructor(private dbOptions: RxDatabaseCreator) { }
+ 
+  async backup() {
+    return this.db.exportJSON();
+  }
+ 
+  /**
+   * CredentialRequestMetadatas
+   * Stores anoncreds credential metadata + exposes orm functions
+   * 
+   * #### Count all Credential Metadatas with optional query
+   * ```ts
+   * await db.credentialmetadatas.count({selector: {id: {$eq: 1}}}) //Query is optional
+   * ```
+   * 
+   * #### Find all credential metadatas matching the query
+   * ```ts
+   * await db.credentialmetadatas.find({selector: {id: {$eq: 1}}}) //Query is optional
+   * ```
+   * 
+   * #### Find all credential metadatas by id
+   * ```ts
+   * await db.credentialmetadatas.findByIds([id])
+   * ```
+   * #### Find one credential metadatas matching the query
+   * ```ts
+   * await db.credentialmetadatas.findOne({selector: {id: {$eq: 1}}}) //Query is optional
+   * ```
+   * 
+   * #### Remove any credential metadatas matching the query
+   * ```ts
+   * await db.credentialmetadatas.remove({selector: {id: {$eq: 1}}})
+   * ```
+   */
+  get credentialrequestmetadatas() {
+    return this._db.collections.credentialrequestmetadatas
+  }
+ 
+  /**
+   * LinkSecrets 
+   * Stores anoncreds link secrets + exposes orm functions
+   * 
+   * #### Count all LinkSecrets with optional query
+   * ```ts
+   * await db.linksecrets.count({selector: {id: {$eq: 1}}}) //Query is optional
+   * ```
+   * 
+   * #### Find all LinkSecrets matching the query
+   * ```ts
+   * await db.linksecrets.find({selector: {id: {$eq: 1}}}) //Query is optional
+   * ```
+   * 
+   * #### Find all LinkSecrets by id
+   * ```ts
+   * await db.linksecrets.findByIds([id])
+   * ```
+   * #### Find one LinkSecrets matching the query
+   * ```ts
+   * await db.linksecrets.findOne({selector: {id: {$eq: 1}}}) //Query is optional
+   * ```
+   * 
+   * #### Remove any LinkSecrets matching the query
+   * ```ts
+   * await db.linksecrets.remove({selector: {id: {$eq: 1}}})
+   * ```
+   */
+  get linksecrets() {
+    return this._db.collections.linksecrets
+  }
+ 
+  /**
+   * DIDPairs 
+   * Stores groups of dids, also known as connections + exposes orm functions
+   * 
+   * #### Count all DIDPairs with optional query
+   * ```ts
+   * await db.didpairs.count({selector: {id: {$eq: 1}}}) //Query is optional
+   * ```
+   * 
+   * #### Find all DIDPairs matching the query
+   * ```ts
+   * await db.didpairs.find({selector: {id: {$eq: 1}}}) //Query is optional
+   * ```
+   * 
+   * #### Find all DIDPairs by id
+   * ```ts
+   * await db.didpairs.findByIds([id])
+   * ```
+   * #### Find one DIDPairs matching the query
+   * ```ts
+   * await db.didpairs.findOne({selector: {id: {$eq: 1}}}) //Query is optional
+   * ```
+   * 
+   * #### Remove any DIDPairs matching the query
+   * ```ts
+   * await db.didpairs.remove({selector: {id: {$eq: 1}}})
+   * ```
+   */
+  get didpairs() {
+    return this._db.collections.didpairs
+  }
+ 
+  /**
+   * Credentials 
+   * Stores credentials, both anoncreda and prism/jwt + exposes orm functions
+   * 
+   * #### Count all Credentials with optional query
+   * ```ts
+   * await db.credentials.count({selector: {id: {$eq: 1}}}) //Query is optional
+   * ```
+   * 
+   * #### Find all Credentials matching the query
+   * ```ts
+   * await db.credentials.find({selector: {id: {$eq: 1}}}) //Query is optional
+   * ```
+   * 
+   * #### Find all Credentials by id
+   * ```ts
+   * await db.credentials.findByIds([id])
+   * ```
+   * #### Find one Credentials matching the query
+   * ```ts
+   * await db.credentials.findOne({selector: {id: {$eq: 1}}}) //Query is optional
+   * ```
+   * 
+   * #### Remove any Credentials matching the query
+   * ```ts
+   * await db.credentials.remove({selector: {id: {$eq: 1}}})
+   * ```
+   */
+  get credentials() {
+    return this._db.collections.credentials
+  }
+ 
+  /**
+   * Mediators 
+   * Stores mediators + exposes orm functions
+   * 
+   * #### Count all Mediators with optional query
+   * ```ts
+   * await db.mediators.count({selector: {id: {$eq: 1}}}) //Query is optional
+   * ```
+   * 
+   * #### Find all Mediators matching the query
+   * ```ts
+   * await db.mediators.find({selector: {id: {$eq: 1}}}) //Query is optional
+   * ```
+   * 
+   * #### Find all Mediators by id
+   * ```ts
+   * await db.mediators.findByIds([id])
+   * ```
+   * #### Find one Mediators matching the query
+   * ```ts
+   * await db.mediators.findOne({selector: {id: {$eq: 1}}}) //Query is optional
+   * ```
+   * 
+   * #### Remove any Mediators matching the query
+   * ```ts
+   * await db.mediators.remove({selector: {id: {$eq: 1}}})
+   * ```
+   */
+  get mediators() {
+    return this._db.collections.mediators
+  }
+ 
+  /**
+    * DIDs 
+    * Stores dids + exposes orm functions
+    * 
+    * #### Count all DIDS with optional query
+    * ```ts
+    * await db.dids.count({selector: {id: {$eq: 1}}}) //Query is optional
+    * ```
+    * 
+    * #### Find all DIDS matching the query
+    * ```ts
+    * await db.dids.find({selector: {id: {$eq: 1}}}) //Query is optional
+    * ```
+    * 
+    * #### Find all DIDS by id
+    * ```ts
+    * await db.dids.findByIds([id])
+    * ```
+    * #### Find one DIDS matching the query
+    * ```ts
+    * await db.dids.findOne({selector: {id: {$eq: 1}}}) //Query is optional
+    * ```
+    * 
+    * #### Remove any DIDS matching the query
+    * ```ts
+    * await db.dids.remove({selector: {id: {$eq: 1}}})
+    * ```
+    */
+  get dids() {
+    return this._db.collections.dids
+  }
+ 
+  /**
+    * PrivateKeys 
+    * Stores privateKeys + exposes orm functions
+    * 
+    * #### Count all PrivateKeys with optional query
+    * ```ts
+    * await db.privatekeys.count({selector: {id: {$eq: 1}}}) //Query is optional
+    * ```
+    * 
+    * #### Find all PrivateKeys matching the query
+    * ```ts
+    * await db.privatekeys.find({selector: {id: {$eq: 1}}}) //Query is optional
+    * ```
+    * 
+    * #### Find all PrivateKeys by id
+    * ```ts
+    * await db.privatekeys.findByIds([id])
+    * ```
+    * #### Find one PrivateKeys matching the query
+    * ```ts
+    * await db.privatekeys.findOne({selector: {id: {$eq: 1}}}) //Query is optional
+    * ```
+    * 
+    * #### Remove any PrivateKeys matching the query
+    * ```ts
+    * await db.privatekeys.remove({selector: {id: {$eq: 1}}})
+    * ```
+    */
+  get privatekeys() {
+    return this._db.collections.privatekeys
+  }
+ 
+  /**
+    * Messages 
+    * Stores Messages + exposes orm functions
+    * 
+    * #### Count all Messages with optional query
+    * ```ts
+    * await db.messages.count({selector: {id: {$eq: 1}}}) //Query is optional
+    * ```
+    * 
+    * #### Find all Messages matching the query
+    * ```ts
+    * await db.messages.find({selector: {id: {$eq: 1}}}) //Query is optional
+    * ```
+    * 
+    * #### Find all Messages by id
+    * ```ts
+    * await db.messages.findByIds([id])
+    * ```
+    * #### Find one Messages matching the query
+    * ```ts
+    * await db.messages.findOne({selector: {id: {$eq: 1}}}) //Query is optional
+    * ```
+    * 
+    * #### Remove any Messages matching the query
+    * ```ts
+    * await db.messages.remove({selector: {id: {$eq: 1}}})
+    * ```
+    */
+  get messages() {
+    return this._db.collections.messages
+  }
+ 
+  /**
+   * Use with caution, this will remove all entries from database
+   * and then destroy the database itself.
+   */
+  async clear() {
+    const storages = Array.from(this.db.storageInstances.values())
+    for (let storage of storages) {
+      await storage.cleanup(0)
+    }
+    await removeRxDatabase(this.dbOptions.name, this.db.storage);
+  }
+ 
+  /**
+   * Creates a database instance.
+   * @param options 
+   * @returns Database
+   */
+  static async createEncrypted(
+    options: {
+      name: string,
+      encryptionKey: Uint8Array,
+      importData?: RxDumpDatabase<PlutoCollections>,
+      storage: RxStorage<any, any>
+    }
+  ) {
+    const { name, storage, encryptionKey, importData } = options;
+    if (!storage) {
+      throw new Error("Please provide a valid storage.");
+    }
+    const database = new Database({
+      ignoreDuplicate: true,
+      name: name,
+      storage: storage,
+      password: Buffer.from(encryptionKey).toString(),
+    });
+ 
+    await database.start()
+ 
+    if (importData) {
+      await database.db.importJSON(importData);
+    }
+ 
+    return database;
+  }
+ 
+  /**
+   * Get a Message by its id
+   * @param id 
+   * @returns [Message](https://input-output-hk.github.io/atala-prism-wallet-sdk-ts/classes/Domain.Message.html)
+   */
+  async getMessage(id: string): Promise<Domain.Message | null> {
+    const message = await this.db.messages.findOne({
+      selector: {
+        id: {
+          $eq: id
+        }
+      }
+    });
+    if (message) {
+      return message.toDomainMessage();
+    }
+    return null;
+  }
+ 
+  /**
+   * Stores a message
+   * @param [Message](https://input-output-hk.github.io/atala-prism-wallet-sdk-ts/classes/Domain.Message.html) 
+   * @returns void
+   */
+  async storeMessage(message: Domain.Message): Promise<void> {
+    const existing = await this.db.messages
+      .findOne({
+        selector: {
+          id: {
+            $eq: message.id
+          }
+        }
+      });
+    if (existing) {
+      await existing.patch({
+        ...message,
+        to: message.to?.toString(),
+        from: message.from?.toString(),
+      });
+    } else {
+      await this.db.messages.insert({
+        ...message,
+        to: message.to?.toString(),
+        from: message.from?.toString(),
+      });
+    }
+  }
+ 
+  /**
+   * Stores multiple messages in 1 call
+   * @param [Message[]](https://input-output-hk.github.io/atala-prism-wallet-sdk-ts/classes/Domain.Message.html) 
+   * @returns void
+   */
+  async storeMessages(messages: Domain.Message[]): Promise<void> {
+    for (let message of messages) {
+      await this.storeMessage(message)
+    }
+  }
+ 
+  /**
+  * Get all the stored messages
+  * @returns [Message[]](https://input-output-hk.github.io/atala-prism-wallet-sdk-ts/classes/Domain.Message.html) 
+  */
+  async getAllMessages(): Promise<Domain.Message[]> {
+    const messages = await this.db.messages.find();
+    return messages.map((message) => message.toDomainMessage());
+  }
+ 
+  private applyORMStatics(collectionObj: RxCollectionCreator<any>) {
+    return collectionObj
+  }
+ 
+  /**
+   * Start the database and build collections
+   */
+  async start(): Promise<void> {
+    const { dbOptions } = this;
+    try {
+      const database = await createRxDatabase<PlutoDatabase>({
+        ...dbOptions,
+        multiInstance: false
+      });
+      await database.addCollections<PlutoCollections>({
+        messages: this.applyORMStatics({
+          schema: MessageSchema,
+          methods: MessageMethods,
+        }),
+        dids: this.applyORMStatics({
+          schema: DIDSchema,
+        }),
+        didpairs: this.applyORMStatics({
+          schema: DIDPairSchema,
+        }),
+        mediators: this.applyORMStatics({
+          schema: MediatorSchema,
+          methods: MediatorMethods,
+        }),
+        privatekeys: this.applyORMStatics({
+          schema: PrivateKeySchema,
+          methods: PrivateKeyMethods,
+        }),
+        credentials: this.applyORMStatics({
+          schema: CredentialSchema,
+          methods: CredentialMethods,
+        }),
+        credentialrequestmetadatas: this.applyORMStatics({
+          schema: CredentialRequestMetadataSchema,
+          methods: CredentialRequestMetadataMethods,
+        }),
+        linksecrets: this.applyORMStatics({
+          schema: LinkSecretSchema,
+          methods: LinkSecretMethods,
+        }),
+      });
+      this._db = database;
+ 
+      const execOrmNames = ['count', 'findByIds', 'find', 'findOne', "remove"];
+      for (let ormNme of execOrmNames) {
+        for (let collectionName in this.db.collections) {
+          const collection: ValuesOf<PlutoCollections> = this.db.collections[collectionName]
+          const originalOrmMethod = collection[ormNme]
+ 
+          collection[ormNme] = new Proxy(originalOrmMethod, {
+            async apply(target, thisArg, args) {
+ 
+              if (target.name === ormNme) {
+                if (ormNme === "remove") {
+                  const rxDocumentArray = await collection.find(...args)
+                  const docsData: RxDocumentData<any>[] = [];
+                  const docsMap: Map<string, RxDocumentData<any>> = new Map();
+                  rxDocumentArray.forEach(rxDocument => {
+                    const data: RxDocumentData<any> = rxDocument.toMutableJSON(true) as any;
+                    docsData.push(data);
+                    docsMap.set(rxDocument.primary, data);
+                  });
+ 
+                  await Promise.all(
+                    docsData.map(doc => {
+                      const primary = (doc as any)[collection.schema.primaryPath];
+                      const rxDocument = rxDocumentArray.find((doc) => doc[collection.schema.primaryPath] === primary)
+                      return collection._runHooks('pre', 'remove', doc, rxDocument);
+                    })
+                  );
+ 
+                  const removeDocs: BulkWriteRow<any>[] = docsData.map(doc => {
+                    const writeDoc = flatClone(doc);
+                    writeDoc._deleted = true;
+                    return {
+                      previous: doc,
+                      document: writeDoc
+                    };
+                  });
+ 
+                  const results = await collection.storageInstance.bulkWrite(
+                    removeDocs,
+                    'rx-collection-bulk-remove'
+                  );
+ 
+                  const successIds: string[] = Object.keys(results.success);
+ 
+                  await Promise.all(
+                    successIds.map(id => {
+                      return collection._runHooks(
+                        'post',
+                        'remove',
+                        docsMap.get(id),
+                        rxDocumentArray.find((doc) => doc[collection.schema.primaryPath] === id)
+                      );
+                    })
+                  );
+ 
+                  const rxDocumentMap = rxDocumentArray.reduce((map, doc) => {
+                    const primary = (doc as any)[collection.schema.primaryPath];
+                    map.set(primary, doc);
+                    return map
+                  }, new Map<string, RxDocument<any>>());
+ 
+                  const rxDocuments = successIds.map(id => getFromMapOrThrow(rxDocumentMap, id));
+                  const [error] = Object.values(results.error)
+                  if (error) {
+                    //TODO: Improve error handling
+                    throw new Error(`Could not remove ${JSON.stringify(error)}`)
+                  }
+                  return rxDocuments;
+                }
+ 
+                const query = Reflect.apply(target, thisArg, args) as RxQuery;
+ 
+                if (!query.exec) {
+                  throw new Error("Wrong ORM function does not return exec")
+                }
+                return query.exec()
+              }
+              return Reflect.apply(target, thisArg, args);
+            }
+          })
+ 
+ 
+        }
+      }
+ 
+    } catch (err) {
+      /* istanbul ignore else */
+      if ((err as RxError).code === "DB1") {
+        throw new Error("Invalid authentication");
+        /* istanbul ignore next */
+      } else throw err;
+    }
+  }
+ 
+  /**
+   * Stores a prismDID and its privateKey
+   * @param did 
+   * @param keyPathIndex 
+   * @param privateKey 
+   * @param privateKeyMetaId 
+   * @param alias 
+   */
+  async storePrismDID(
+    did: Domain.DID,
+    keyPathIndex: number,
+    privateKey: Domain.PrivateKey,
+    privateKeyMetaId?: string | null,
+    alias?: string | undefined
+  ): Promise<void> {
+    await this.db.dids.insert({
+      did: did.toString(),
+      method: did.method,
+      methodId: did.methodId,
+      schema: did.schema,
+      alias: alias,
+    });
+    await this.storePrivateKeys(
+      privateKey,
+      did,
+      keyPathIndex,
+      privateKeyMetaId ?? null
+    );
+  }
+ 
+  /**
+   * Stores a peerdid with its privateKeys
+   * @param did 
+   * @param privateKeys 
+   */
+  async storePeerDID(
+    did: Domain.DID,
+    privateKeys: Domain.PrivateKey[]
+  ): Promise<void> {
+    await this.db.dids.insert({
+      did: did.toString(),
+      method: did.method,
+      methodId: did.methodId,
+      schema: did.schema,
+    });
+    for (let prv of privateKeys) {
+      await this.db.privatekeys.insert({
+        id: uuidv4(),
+        did: did.toString(),
+        type: prv.type,
+        keySpecification: Array.from(prv.keySpecification).reduce(
+          (all, [key, value]) => [
+            ...all,
+            {
+              type: "string",
+              name: key,
+              value: `${value}`,
+            },
+          ],
+          [
+            {
+              type: "string",
+              name: "raw",
+              value: Buffer.from(prv.raw).toString("hex"),
+            },
+          ] as KeySpec[]
+        ),
+      })
+    }
+  }
+ 
+  /**
+   * Stores a didpair
+   * @param host 
+   * @param receiver 
+   * @param name 
+   */
+  async storeDIDPair(
+    host: Domain.DID,
+    receiver: Domain.DID,
+    name: string
+  ): Promise<void> {
+    await this.db.didpairs.insert({
+      hostDID: host.toString(),
+      receiverDID: receiver.toString(),
+      name,
+    });
+  }
+ 
+  /**
+   * Stores privateKeys references to an existing DID
+   * @param privateKey 
+   * @param did 
+   * @param keyPathIndex 
+   * @param metaId 
+   */
+  async storePrivateKeys(
+    privateKey: Domain.PrivateKey,
+    did: Domain.DID,
+    keyPathIndex: number,
+    metaId?: string | null
+  ): Promise<void> {
+    await this.db.privatekeys.insert({
+      id: uuidv4(),
+      did: did.toString(),
+      type: privateKey.type,
+      keySpecification: Array.from(privateKey.keySpecification).reduce(
+        (all, [key, value]) => [
+          ...all,
+          {
+            type: "string",
+            name: key,
+            value: `${value}`,
+          },
+        ],
+        [
+          {
+            type: "string",
+            name: "raw",
+            value: Buffer.from(privateKey.raw).toString("hex"),
+          },
+          {
+            type: "number",
+            name: "index",
+            value: `${keyPathIndex}`,
+          },
+        ] as KeySpec[]
+      ),
+    });
+  }
+ 
+  /**
+   * Gets all the stores didPairs
+   * @returns [Domain.DIDPair[]](https://input-output-hk.github.io/atala-prism-wallet-sdk-ts/classes/Domain.DIDPair.html)
+   */
+  async getAllDidPairs(): Promise<Domain.DIDPair[]> {
+    const { DID, DIDPair } = Domain;
+    const results = await this.db.didpairs.find()
+    return results.map(
+      ({ hostDID, receiverDID, name }) =>
+        new DIDPair(DID.fromString(hostDID), DID.fromString(receiverDID), name)
+    );
+  }
+ 
+  /**
+   * Get a did pair (connection) by one of its dids
+   * @param did 
+   * @returns [Domain.DIDPair](https://input-output-hk.github.io/atala-prism-wallet-sdk-ts/classes/Domain.DIDPair.html)
+   */
+  async getPairByDID(did: Domain.DID): Promise<Domain.DIDPair | null> {
+    const { DID, DIDPair } = Domain;
+    const didPair = await this.db.didpairs
+      .findOne({
+        selector: {
+          $or: [
+            {
+              hostDID: did.toString(),
+            },
+            {
+              receiverDID: did.toString(),
+            },
+          ],
+        }
+      })
+    return didPair
+      ? new DIDPair(
+        DID.fromString(didPair.hostDID),
+        DID.fromString(didPair.receiverDID),
+        didPair.name
+      )
+      : null;
+  }
+ 
+  async getPairByName(name: string): Promise<Domain.DIDPair | null> {
+    const { DID, DIDPair } = Domain;
+    const didPair = await this.db.didpairs
+      .findOne({
+        selector: {
+          $and: [
+            {
+              name,
+            },
+          ],
+        }
+      });
+ 
+    return didPair
+      ? new DIDPair(
+        DID.fromString(didPair.hostDID),
+        DID.fromString(didPair.receiverDID),
+        didPair.name
+      )
+      : null;
+  }
+ 
+  private getPrivateKeyFromDB(
+    privateKey: PrivateKeyDocument
+  ): Domain.PrivateKey {
+    return privateKey.toDomainPrivateKey();
+  }
+ 
+  async getDIDPrivateKeysByDID(did: Domain.DID): Promise<Domain.PrivateKey[]> {
+    const privateKeys = await this.db.privatekeys
+      .find({
+        selector: {
+          did: {
+            $eq: did.toString()
+          }
+        }
+      })
+    return privateKeys.map(this.getPrivateKeyFromDB);
+  }
+ 
+  async getDIDPrivateKeyByID(id: string): Promise<Domain.PrivateKey | null> {
+    const privateKey = await this.db.privatekeys.findOne({
+      selector: {
+        id: {
+          $eq: id
+        }
+      }
+    })
+    return privateKey ? this.getPrivateKeyFromDB(privateKey) : null;
+  }
+ 
+  async storeMediator(
+    mediator: Domain.DID,
+    host: Domain.DID,
+    routing: Domain.DID
+  ): Promise<void> {
+    await this.db.mediators.insert({
+      id: uuidv4(),
+      mediatorDID: mediator.toString(),
+      hostDID: host.toString(),
+      routingDID: routing.toString(),
+    });
+  }
+ 
+  async getAllPrismDIDs(): Promise<Domain.PrismDIDInfo[]> {
+    const dids = await this.db.dids.find({
+      selector: {
+        method: {
+          $eq: "prism"
+        }
+      }
+    });
+ 
+    const prismDIDInfo: Domain.PrismDIDInfo[] = [];
+ 
+    for (let did of dids) {
+      const didPrivateKeys = await this.getDIDPrivateKeysByDID(
+        Domain.DID.fromString(did.did)
+      );
+ 
+      for (let privateKey of didPrivateKeys) {
+        const indexProp = privateKey.getProperty(Domain.KeyProperties.index)!;
+ 
+        prismDIDInfo.push(
+          new Domain.PrismDIDInfo(
+            Domain.DID.fromString(did.did),
+            parseInt(indexProp),
+            did.alias
+          )
+        );
+      }
+    }
+ 
+    return prismDIDInfo;
+  }
+ 
+  async getDIDInfoByDID(did: Domain.DID): Promise<Domain.PrismDIDInfo | null> {
+ 
+    const didDB = await this.db.dids
+      .findOne({
+        selector: {
+          did: did.toString()
+        }
+      });
+ 
+    if (didDB) {
+      const privateKeys = await this.getDIDPrivateKeysByDID(
+        Domain.DID.fromString(didDB.did)
+      );
+      /* istanbul ignore if */
+      if (!privateKeys.length) {
+        throw new Error(
+          "Imposible to recover PrismDIDInfo without its privateKey data."
+        );
+      }
+      const indexProp = privateKeys
+        .at(0)!
+        .getProperty(Domain.KeyProperties.index);
+      const index = indexProp ? parseInt(indexProp) : undefined;
+      return new Domain.PrismDIDInfo(
+        Domain.DID.fromString(didDB.did),
+        index,
+        didDB.alias
+      );
+    }
+ 
+    return null;
+  }
+ 
+  async getDIDInfoByAlias(alias: string): Promise<Domain.PrismDIDInfo[]> {
+    const dids = await this.db.dids.find({
+      selector: {
+        alias: {
+          $eq: alias
+        }
+      }
+    });
+    const prismDIDInfo: Domain.PrismDIDInfo[] = [];
+    for (let did of dids) {
+      const didPrivateKeys = await this.getDIDPrivateKeysByDID(
+        Domain.DID.fromString(did.did)
+      );
+      for (let privateKey of didPrivateKeys) {
+        const indexProp = privateKey.getProperty(Domain.KeyProperties.index)!;
+        prismDIDInfo.push(
+          new Domain.PrismDIDInfo(
+            Domain.DID.fromString(did.did),
+            parseInt(indexProp),
+            did.alias
+          )
+        );
+      }
+    }
+    return prismDIDInfo;
+  }
+ 
+  async getAllMessagesByDID(did: Domain.DID): Promise<Domain.Message[]> {
+    const messages = await this.db.messages
+      .find({
+        selector: {
+          $or: [
+            {
+              to: did.toString(),
+            },
+            {
+              from: did.toString(),
+            },
+          ],
+        }
+      })
+ 
+    return messages.map((message) => message.toDomainMessage());
+  }
+ 
+  async getAllMessagesSent(): Promise<Domain.Message[]> {
+    const messages = await this.db.messages
+      .find({
+        selector: {
+          $or: [
+            {
+              direction: Domain.MessageDirection.SENT,
+            },
+          ],
+        }
+      })
+ 
+    return messages.map((message) => message.toDomainMessage());
+  }
+ 
+  async getAllMessagesReceived(): Promise<Domain.Message[]> {
+    const messages = await this.db.messages
+      .find({
+        selector: {
+          $or: [
+            {
+              direction: Domain.MessageDirection.RECEIVED,
+            },
+          ],
+        }
+      })
+ 
+    return messages.map((message) => message.toDomainMessage());
+  }
+ 
+  async getAllMessagesSentTo(did: Domain.DID): Promise<Domain.Message[]> {
+    const messages = await this.db.messages
+      .find({
+        selector: {
+          $and: [
+            {
+              to: did.toString(),
+            },
+            {
+              direction: Domain.MessageDirection.SENT,
+            },
+          ],
+        }
+      })
+    return messages.map((message) => message.toDomainMessage());
+  }
+ 
+  async getAllMessagesReceivedFrom(did: Domain.DID): Promise<Domain.Message[]> {
+    const messages = await this.db.messages
+      .find({
+        selector: {
+          $and: [
+            {
+              from: did.toString(),
+            },
+            {
+              direction: Domain.MessageDirection.RECEIVED,
+            },
+          ],
+        }
+      });
+    return messages.map((message) => message.toDomainMessage());
+  }
+ 
+  async getAllMessagesOfType(
+    type: string,
+    relatedWithDID?: Domain.DID | undefined
+  ): Promise<Domain.Message[]> {
+    const query: MangoQuerySelector<MessageSchemaType>[] = [
+      {
+        piuri: type,
+      },
+    ];
+    if (relatedWithDID) {
+      query.push({
+        $or: [
+          {
+            from: relatedWithDID.toString(),
+          },
+          {
+            to: relatedWithDID.toString(),
+          },
+        ],
+      });
+    }
+    const messages = await this.db.messages
+      .find({
+        selector: {
+          $and: query,
+        }
+      })
+ 
+    return messages.map((message) => message.toDomainMessage());
+  }
+ 
+  async getAllMessagesByFromToDID(
+    from: Domain.DID,
+    to: Domain.DID
+  ): Promise<Domain.Message[]> {
+    const messages = await this.db.messages
+      .find({
+        selector: {
+          $or: [
+            {
+              from: from.toString(),
+            },
+            {
+              to: to.toString(),
+            },
+          ],
+        }
+      })
+ 
+    return messages.map((message) => message.toDomainMessage());
+  }
+ 
+  async getPrismDIDKeyPathIndex(did: Domain.DID): Promise<number | null> {
+    const [key] = await this.getDIDPrivateKeysByDID(did);
+    if (!key) {
+      return null;
+    }
+    return parseInt(key.index);
+  }
+ 
+  async getPrismLastKeyPathIndex(): Promise<number> {
+    const results = await this.getAllPrismDIDs();
+    if (!results || results.length === 0) {
+      return 0;
+    }
+    return Math.max(...results.map((result) => result.keyPathIndex));
+  }
+ 
+  async getAllPeerDIDs(): Promise<Domain.PeerDID[]> {
+    const peerDIDs: Domain.PeerDID[] = [];
+    const dids = await this.db.dids.find({
+      selector: {
+        method: {
+          $eq: 'peer'
+        }
+      }
+    });
+    for (let did of dids) {
+      const peerDID = Domain.DID.fromString(did.did);
+      const keys = await this.getDIDPrivateKeysByDID(peerDID);
+      peerDIDs.push(
+        new Domain.PeerDID(
+          peerDID,
+          keys.map((key) => ({
+            keyCurve: {
+              curve: key.curve as any,
+            },
+            value: key.raw,
+          }))
+        )
+      );
+    }
+    return peerDIDs;
+  }
+ 
+  async storeCredential(credential: Domain.Credential): Promise<void> {
+    if (!credential.isStorable || !credential.isStorable()) {
+      throw new Error("Credential is not storable");
+    }
+    const storable = credential.toStorable();
+    if (!storable.id) storable.id = uuidv4();
+ 
+    await this.db.credentials.insert(storable);
+  }
+ 
+  async getAllMediators(): Promise<Domain.Mediator[]> {
+    const mediators = await this.db.mediators.find()
+    return mediators.map((mediator) => mediator.toDomainMediator());
+  }
+ 
+  async getAllCredentials(): Promise<Domain.Credential[]> {
+    const credentials = await this.db.credentials.find()
+    return credentials.map(
+      (verifiableCredential) => verifiableCredential.toDomainCredential()
+    );
+  }
+ 
+  async getLinkSecret(
+    linkSecretName?: string | undefined
+  ): Promise<string | null> {
+    const query = linkSecretName ?
+      {
+        selector: {
+          name: {
+            $eq: linkSecretName
+          }
+        }
+      } : {}
+ 
+    const linkSecret = await this.db.linksecrets
+      .findOne(query);
+ 
+    if (linkSecret) {
+      return linkSecret.toDomainLinkSecret();
+    }
+ 
+    return null;
+  }
+ 
+  async storeLinkSecret(
+    linkSecret: string,
+    linkSecretName: string
+  ): Promise<void> {
+    await this.db.linksecrets.insert({
+      name: linkSecretName,
+      secret: linkSecret,
+    });
+  }
+ 
+  async storeCredentialMetadata(
+    metadata: Domain.Anoncreds.CredentialRequestMeta,
+    linkSecret: string
+  ): Promise<void> {
+    await this.db.credentialrequestmetadatas.insert({
+      ...metadata,
+      id: uuidv4(),
+      link_secret_name: linkSecret,
+    });
+  }
+ 
+  async fetchCredentialMetadata(
+    linkSecretName: string
+  ): Promise<Domain.Anoncreds.CredentialRequestMeta | null> {
+    const credentialRequestMetadata = await this.db.credentialrequestmetadatas
+      .findOne({
+        selector: {
+          link_secret_name: {
+            $eq: linkSecretName
+          }
+        }
+      });
+ 
+    if (credentialRequestMetadata) {
+      return credentialRequestMetadata.toDomainCredentialRequestMetadata();
+    }
+    return null;
+  }
+}
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/packages/database/coverage/database/src/schemas/Credential.ts.html b/packages/database/coverage/database/src/schemas/Credential.ts.html new file mode 100644 index 00000000..52e515b4 --- /dev/null +++ b/packages/database/coverage/database/src/schemas/Credential.ts.html @@ -0,0 +1,433 @@ + + + + + + Code coverage report for database/src/schemas/Credential.ts + + + + + + + + + +
+
+

All files / database/src/schemas Credential.ts

+
+ +
+ 100% + Statements + 116/116 +
+ + +
+ 100% + Branches + 4/4 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 116/116 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +1171x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +9x +3x +3x +3x +9x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +9x +1x +1x +1x +1x +1x +1x +1x +1x +1x + 
import {
+  AnonCredsCredential,
+  AnonCredsCredentialProperties,
+  AnonCredsRecoveryId,
+  Domain,
+  JWTCredential,
+  JWTVerifiableCredentialRecoveryId,
+} from "@atala/prism-wallet-sdk";
+import type { GenericORMType, Schema } from "../types";
+import { RxCollection, RxDocument } from "rxdb";
+ 
+export type CredentialSubjectType = {
+  type: string;
+  name: string;
+  value: string;
+};
+ 
+export type CredentialSchemaType = {
+  id: string;
+  recoveryId: string;
+  credentialData: string;
+  issuer?: string;
+  subject?: string;
+  credentialCreated?: string;
+  credentialUpdated?: string;
+  credentialSchema?: string;
+  validUntil?: string;
+  revoked?: boolean;
+  availableClaims?: string[];
+};
+ 
+const CredentialSchema: Schema<CredentialSchemaType> = {
+  version: 0,
+  primaryKey: "id",
+  type: "object",
+  properties: {
+    id: {
+      type: "string",
+      maxLength: 60,
+    },
+    recoveryId: {
+      type: "string",
+    },
+    credentialData: {
+      type: "string",
+    },
+    issuer: {
+      type: "string",
+    },
+    subject: {
+      type: "string",
+    },
+    credentialCreated: {
+      type: "string",
+    },
+    credentialUpdated: {
+      type: "string",
+    },
+    credentialSchema: {
+      type: "string",
+    },
+    validUntil: {
+      type: "string",
+    },
+    revoked: {
+      type: "boolean",
+    },
+    availableClaims: {
+      type: "array",
+      items: {
+        type: "string",
+      },
+    },
+  },
+  encrypted: ["credentialData"],
+  required: ["id", "recoveryId", "credentialData"],
+};
+ 
+export type CredentialDocument = RxDocument<CredentialSchemaType>;
+export type CredentialMethodTypes = {
+  toDomainCredential: (this: CredentialSchemaType) => Domain.Credential;
+};
+ 
+export const CredentialMethods: CredentialMethodTypes = {
+  toDomainCredential: function toDomainCredential(this: CredentialSchemaType) {
+    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");
+    }
+  },
+};
+ 
+export type CredentialCollection = RxCollection<
+  CredentialSchemaType,
+  CredentialMethodTypes,
+  GenericORMType<CredentialDocument>
+>;
+ 
+export default CredentialSchema;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/packages/database/coverage/database/src/schemas/CredentialRequestMetadata.ts.html b/packages/database/coverage/database/src/schemas/CredentialRequestMetadata.ts.html new file mode 100644 index 00000000..0a11d41f --- /dev/null +++ b/packages/database/coverage/database/src/schemas/CredentialRequestMetadata.ts.html @@ -0,0 +1,322 @@ + + + + + + Code coverage report for database/src/schemas/CredentialRequestMetadata.ts + + + + + + + + + +
+
+

All files / database/src/schemas CredentialRequestMetadata.ts

+
+ +
+ 100% + Statements + 79/79 +
+ + +
+ 100% + Branches + 1/1 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 79/79 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +801x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +3x +3x +3x +3x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x + 
import {
+  AnonCredsCredential,
+  AnonCredsCredentialProperties,
+  AnonCredsRecoveryId,
+  Domain,
+  JWTCredential,
+  JWTVerifiableCredentialRecoveryId,
+} from "@atala/prism-wallet-sdk";
+import type { GenericORMType, 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;
+};
+ 
+ 
+const CredentialRequestMetadataSchema: Schema<CredentialRequestMetadataSchemaType> =
+{
+  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<CredentialRequestMetadataSchemaType>;
+ 
+export type CredentialRequestMetadataMethodTypes = {
+  toDomainCredentialRequestMetadata: (
+    this: CredentialRequestMetadataSchemaType
+  ) => Domain.Anoncreds.CredentialRequestMeta;
+};
+ 
+export const CredentialRequestMetadataMethods: CredentialRequestMetadataMethodTypes =
+{
+  toDomainCredentialRequestMetadata:
+    function toDomainCredentialRequestMetadata(
+      this: CredentialRequestMetadataSchemaType
+    ) {
+      return this;
+    },
+};
+ 
+/**
+ * test content
+ */
+export type CredentialRequestMetadataCollection = RxCollection<
+  CredentialRequestMetadataSchemaType,
+  CredentialRequestMetadataMethodTypes,
+  GenericORMType<CredentialRequestMetadataDocument>
+>;
+ 
+export default CredentialRequestMetadataSchema;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/packages/database/coverage/database/src/schemas/DID.ts.html b/packages/database/coverage/database/src/schemas/DID.ts.html new file mode 100644 index 00000000..e6854553 --- /dev/null +++ b/packages/database/coverage/database/src/schemas/DID.ts.html @@ -0,0 +1,220 @@ + + + + + + Code coverage report for database/src/schemas/DID.ts + + + + + + + + + +
+
+

All files / database/src/schemas DID.ts

+
+ +
+ 100% + Statements + 45/45 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 45/45 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +461x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x + 
import { RxCollection, RxDocument } from "rxdb";
+import type { GenericORMType, Schema } from "../types";
+ 
+export type DIDSchemaType = {
+  schema: string;
+  method: string;
+  methodId: string;
+  alias?: string;
+  did: string;
+};
+ 
+const DIDSchema: Schema<DIDSchemaType> = {
+  version: 0,
+  primaryKey: "did",
+  type: "object",
+  properties: {
+    method: {
+      type: "string",
+      maxLength: 60,
+    },
+    methodId: {
+      type: "string",
+      maxLength: 60,
+    },
+    schema: {
+      type: "string",
+      maxLength: 60,
+    },
+    alias: {
+      type: "string",
+      maxLength: 60,
+    },
+    did: {
+      type: "string",
+      maxLength: 60,
+    },
+  },
+  encrypted: [],
+  required: ["method", "methodId", "did", "schema"],
+};
+export type DIDDocument = RxDocument<DIDSchemaType>;
+ 
+export type DIDCollection = RxCollection<DIDSchemaType, any, GenericORMType<DIDDocument>>
+ 
+export default DIDSchema;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/packages/database/coverage/database/src/schemas/DIDPair.ts.html b/packages/database/coverage/database/src/schemas/DIDPair.ts.html new file mode 100644 index 00000000..dc5185c2 --- /dev/null +++ b/packages/database/coverage/database/src/schemas/DIDPair.ts.html @@ -0,0 +1,184 @@ + + + + + + Code coverage report for database/src/schemas/DIDPair.ts + + + + + + + + + +
+
+

All files / database/src/schemas DIDPair.ts

+
+ +
+ 100% + Statements + 33/33 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 33/33 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +341x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x + 
import { RxCollection, RxDocument } from "rxdb";
+import type { GenericORMType, Schema } from "../types";
+ 
+export type DIDPairSchemaType = {
+  hostDID: string;
+  receiverDID: string;
+  name: string;
+};
+ 
+const DIDPairSchema: Schema<DIDPairSchemaType> = {
+  version: 0,
+  primaryKey: "name",
+  type: "object",
+  properties: {
+    hostDID: {
+      type: "string",
+    },
+    name: {
+      type: "string",
+      maxLength: 60,
+    },
+    receiverDID: {
+      type: "string",
+    },
+  },
+  encrypted: [],
+  required: ["name", "hostDID", "receiverDID"],
+};
+ 
+export type DIDPairDocument = RxDocument<DIDPairSchemaType>;
+export type DIDPairCollection = RxCollection<DIDPairSchemaType, any, GenericORMType<DIDPairDocument>>
+ 
+export default DIDPairSchema;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/packages/database/coverage/database/src/schemas/LinkSecret.ts.html b/packages/database/coverage/database/src/schemas/LinkSecret.ts.html new file mode 100644 index 00000000..20a29b71 --- /dev/null +++ b/packages/database/coverage/database/src/schemas/LinkSecret.ts.html @@ -0,0 +1,229 @@ + + + + + + Code coverage report for database/src/schemas/LinkSecret.ts + + + + + + + + + +
+
+

All files / database/src/schemas LinkSecret.ts

+
+ +
+ 100% + Statements + 48/48 +
+ + +
+ 100% + Branches + 1/1 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 48/48 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +491x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +6x +6x +1x +1x + 
import { Domain } from "@atala/prism-wallet-sdk";
+import type { GenericORMType, Schema } from "../types";
+import { RxCollection, RxDocument } from "rxdb";
+ 
+export type LinkSecretSchemaType = {
+  readonly name: string;
+  readonly secret: string;
+};
+ 
+ 
+const LinkSecretSchema: Schema<LinkSecretSchemaType> = {
+  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,
+  GenericORMType<LinkSecretDocument>
+>;
+ 
+export const LinkSecretMethods: LinkSecretMethodTypes = {
+  toDomainLinkSecret: function toDomainLinkSecret(this: LinkSecretDocument) {
+    return this.secret;
+  },
+};
+export default LinkSecretSchema;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/packages/database/coverage/database/src/schemas/Mediator.ts.html b/packages/database/coverage/database/src/schemas/Mediator.ts.html new file mode 100644 index 00000000..9812d43e --- /dev/null +++ b/packages/database/coverage/database/src/schemas/Mediator.ts.html @@ -0,0 +1,253 @@ + + + + + + Code coverage report for database/src/schemas/Mediator.ts + + + + + + + + + +
+
+

All files / database/src/schemas Mediator.ts

+
+ +
+ 100% + Statements + 56/56 +
+ + +
+ 100% + Branches + 1/1 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 56/56 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +571x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +9x +9x +9x +9x +9x +9x +9x +1x +1x +1x + 
import { RxCollection, RxDocument, RxDocumentBase } from "rxdb";
+import type { GenericORMType, Schema } from "../types";
+import { Domain } from "@atala/prism-wallet-sdk";
+ 
+export type MediatorSchemaType = {
+  id: string;
+  mediatorDID: string;
+  hostDID: string;
+  routingDID: string;
+};
+ 
+const MediatorSchema: Schema<MediatorSchemaType> = {
+  version: 0,
+  primaryKey: "id",
+  type: "object",
+  properties: {
+    id: {
+      type: "string",
+      maxLength: 60,
+    },
+    mediatorDID: {
+      type: "string",
+    },
+    hostDID: {
+      type: "string",
+    },
+    routingDID: {
+      type: "string",
+    },
+  },
+  encrypted: [],
+  required: ["id", "mediatorDID"],
+};
+ 
+export type MediatorDocument = RxDocument<MediatorSchemaType>;
+export type MediatorMethodTypes = {
+  toDomainMediator: (this: RxDocument<MediatorSchemaType, MediatorMethodTypes>) => Domain.Mediator;
+};
+export type MediatorCollection = RxCollection<
+  MediatorSchemaType,
+  MediatorMethodTypes,
+  GenericORMType<MediatorDocument>
+>;
+ 
+export const MediatorMethods: MediatorMethodTypes = {
+  toDomainMediator: function toDomainMediator(this: RxDocument<MediatorSchemaType, MediatorMethodTypes>) {
+    const mediator = this.toJSON()
+    return {
+      hostDID: Domain.DID.fromString(mediator.hostDID),
+      routingDID: Domain.DID.fromString(mediator.routingDID),
+      mediatorDID: Domain.DID.fromString(mediator.mediatorDID),
+    };
+  },
+};
+ 
+export default MediatorSchema;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/packages/database/coverage/database/src/schemas/Message.ts.html b/packages/database/coverage/database/src/schemas/Message.ts.html new file mode 100644 index 00000000..b0e83c11 --- /dev/null +++ b/packages/database/coverage/database/src/schemas/Message.ts.html @@ -0,0 +1,469 @@ + + + + + + Code coverage report for database/src/schemas/Message.ts + + + + + + + + + +
+
+

All files / database/src/schemas Message.ts

+
+ +
+ 100% + Statements + 128/128 +
+ + +
+ 100% + Branches + 1/1 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 128/128 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +1291x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +39x +39x +1x +1x +1x + 
import { Domain } from "@atala/prism-wallet-sdk";
+import type { GenericORMType, Schema } from "../types";
+import { RxCollection, RxCollectionCreator, RxDocument } from "rxdb";
+ 
+export type MessageSchemaType = {
+  readonly body: string;
+  readonly id: string;
+  readonly piuri: string;
+  readonly from?: string | undefined;
+  readonly to?: string | undefined;
+  readonly attachments: Domain.AttachmentDescriptor[];
+  readonly thid?: string;
+  readonly extraHeaders: string[];
+  readonly createdTime: string;
+  readonly expiresTimePlus: string;
+  readonly ack: string[];
+  readonly direction: Domain.MessageDirection;
+  readonly fromPrior?: string | undefined;
+  readonly pthid?: string | undefined;
+};
+ 
+ 
+const MessageSchema: Schema<MessageSchemaType> = {
+  version: 0,
+  primaryKey: "id",
+  type: "object",
+  properties: {
+    id: {
+      type: "string",
+      maxLength: 60,
+    },
+    body: {
+      type: "string",
+    },
+    piuri: {
+      type: "string",
+    },
+    attachments: {
+      type: "array",
+      items: {
+        type: "object",
+        properties: {
+          id: {
+            type: "id",
+            maxLength: 60,
+          },
+          description: {
+            type: "string",
+          },
+          byteCount: {
+            type: "number",
+          },
+          lastModTime: {
+            type: "string",
+          },
+          format: {
+            type: "string",
+          },
+          filename: {
+            type: "array",
+            items: {
+              type: "string",
+            },
+          },
+          mediaType: {
+            type: "string",
+          },
+          data: {
+            type: "object",
+          },
+        },
+      },
+    },
+    extraHeaders: {
+      type: "array",
+    },
+    createdTime: {
+      type: "string",
+    },
+    expiresTimePlus: {
+      type: "string",
+    },
+    ack: {
+      type: "array",
+    },
+    direction: {
+      type: "number",
+    },
+    from: {
+      type: "string",
+    },
+    to: {
+      type: "string",
+    },
+    thid: {
+      type: "string",
+    },
+    fromPrior: {
+      type: "string",
+    },
+    pthid: {
+      type: "string",
+    },
+  },
+  encrypted: ["thid", "attachments", "body"],
+  required: ["id"],
+};
+export type MessageDocument = RxDocument<MessageSchemaType, MessageMethodTypes>;
+ 
+export type MessageMethodTypes = {
+  toDomainMessage: (this: MessageDocument) => Domain.Message;
+};
+ 
+export type MessageColletion = RxCollection<
+  MessageSchemaType,
+  MessageMethodTypes,
+  GenericORMType<MessageDocument>
+>;
+ 
+ 
+ 
+export const MessageMethods: MessageMethodTypes = {
+  toDomainMessage: function toDomainMessage(this: MessageDocument) {
+    return Domain.Message.fromJson(JSON.stringify(this));
+  },
+};
+ 
+export default MessageSchema;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/packages/database/coverage/database/src/schemas/PrivateKey.ts.html b/packages/database/coverage/database/src/schemas/PrivateKey.ts.html new file mode 100644 index 00000000..d8e67601 --- /dev/null +++ b/packages/database/coverage/database/src/schemas/PrivateKey.ts.html @@ -0,0 +1,604 @@ + + + + + + Code coverage report for database/src/schemas/PrivateKey.ts + + + + + + + + + +
+
+

All files / database/src/schemas PrivateKey.ts

+
+ +
+ 98.26% + Statements + 170/173 +
+ + +
+ 95.65% + Branches + 22/23 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 98.26% + Lines + 170/173 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +1741x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +72x +72x +72x +72x +72x +72x +72x +72x +6x +6x +72x +3x +3x +63x +63x +63x +27x +12x +72x +3x +3x +60x +72x +3x +3x +57x +57x +72x +36x +36x +36x +36x +36x +36x +36x +36x +36x +36x +36x +36x +36x +36x +36x +36x +36x +36x +36x +33x +33x +33x +33x +33x +36x +36x +3x +3x +3x +3x +3x +36x +36x +36x +21x +21x +72x +12x +12x +12x +12x +12x +12x +12x +12x +12x +12x +12x +9x +9x +9x +9x +9x +9x +9x +9x +9x +9x +9x +9x +9x +9x +9x +  +  +  +72x +1x +1x +1x + 
import {
+  Ed25519PrivateKey,
+  KeyProperties,
+  Secp256k1PrivateKey,
+  X25519PrivateKey,
+  Domain,
+} from "@atala/prism-wallet-sdk";
+import type { GenericORMType, Schema } from "../types";
+import { RxCollection, RxDocument } from "rxdb";
+ 
+export type KeySpec = {
+  name: string;
+  type: string;
+  value: string;
+};
+ 
+export type KeySchemaType = {
+  id: string;
+  type: string;
+  did: string;
+  keySpecification: KeySpec[];
+};
+ 
+const PrivateKeySchema: Schema<KeySchemaType> = {
+  version: 0,
+  primaryKey: "id",
+  type: "object",
+  properties: {
+    id: {
+      type: "string",
+      maxLength: 60,
+    },
+    did: {
+      type: "string",
+    },
+    type: {
+      type: "string",
+    },
+    keySpecification: {
+      type: "array",
+      items: {
+        type: "object",
+        properties: {
+          name: {
+            type: "string",
+          },
+          type: {
+            type: "string",
+          },
+          value: {
+            type: "string",
+          },
+        },
+      },
+    },
+  },
+  encrypted: ["keySpecification", "type"],
+  required: ["keySpecification", "did", "type", "id"],
+};
+ 
+export type PrivateKeyMethodTypes = {
+  toDomainPrivateKey: (this: PrivateKeyDocument) => Domain.PrivateKey;
+};
+export type PrivateKeyColletion = RxCollection<
+  KeySchemaType,
+  PrivateKeyMethodTypes,
+  GenericORMType<PrivateKeyDocument>
+>;
+export type PrivateKeyDocument = RxDocument<
+  KeySchemaType,
+  PrivateKeyMethodTypes
+>;
+ 
+export const PrivateKeyMethods: PrivateKeyMethodTypes = {
+  toDomainPrivateKey: function toDomainPrivateKey(this: PrivateKeyDocument) {
+    const { type, keySpecification } = this;
+    const curve = keySpecification.find(
+      (item) => item.name === KeyProperties.curve
+    );
+    const raw = keySpecification.find(
+      (item) => item.name === KeyProperties.rawKey
+    );
+    if (!(type in Domain.KeyTypes)) {
+      throw new Error(`Invalid KeyType ${type || "undefined"}`);
+    }
+    if (!curve) {
+      throw new Error("Undefined key curve");
+    }
+ 
+    if (
+      curve.value !== Domain.Curve.SECP256K1 &&
+      curve.value !== Domain.Curve.ED25519 &&
+      curve.value !== Domain.Curve.X25519
+    ) {
+      throw new Error(`Invalid key curve ${curve.value}`);
+    }
+ 
+    if (!raw) {
+      throw new Error("Undefined key raw");
+    }
+ 
+    /* istanbul ignore else */
+    if (curve.value === Domain.Curve.SECP256K1) {
+      const index = keySpecification.find(
+        (item) => item.name === KeyProperties.index
+      );
+      const seed = keySpecification.find(
+        (item) => item.name === KeyProperties.seed
+      );
+ 
+      const privateKey = new Secp256k1PrivateKey(
+        Buffer.from(raw.value, "hex")
+      );
+ 
+      privateKey.keySpecification.set(Domain.KeyProperties.rawKey, raw.value);
+ 
+      privateKey.keySpecification.set(
+        Domain.KeyProperties.curve,
+        Domain.Curve.SECP256K1
+      );
+ 
+      if (index) {
+        privateKey.keySpecification.set(
+          Domain.KeyProperties.index,
+          index.value
+        );
+      }
+ 
+      if (seed) {
+        privateKey.keySpecification.set(
+          Domain.KeyProperties.seed,
+          seed.value
+        );
+      }
+ 
+      return privateKey;
+    }
+ 
+    /* istanbul ignore else */
+    if (curve.value === Domain.Curve.ED25519) {
+      const privateKey = new Ed25519PrivateKey(Buffer.from(raw.value, "hex"));
+ 
+      privateKey.keySpecification.set(Domain.KeyProperties.rawKey, raw.value);
+ 
+      privateKey.keySpecification.set(
+        Domain.KeyProperties.curve,
+        Domain.Curve.ED25519
+      );
+ 
+      return privateKey;
+    }
+ 
+ 
+    /* istanbul ignore else */
+    if (curve.value === Domain.Curve.X25519) {
+      const privateKey = new X25519PrivateKey(Buffer.from(raw.value, "hex"));
+ 
+      privateKey.keySpecification.set(Domain.KeyProperties.rawKey, raw.value);
+ 
+      privateKey.keySpecification.set(
+        Domain.KeyProperties.curve,
+        Domain.Curve.X25519
+      );
+ 
+      return privateKey;
+    }
+
+    /* istanbul ignore next */
+    throw new Error(`Invalid key ${curve.value} ${type}`);
+  },
+};
+ 
+export default PrivateKeySchema;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/packages/database/coverage/database/src/schemas/index.html b/packages/database/coverage/database/src/schemas/index.html new file mode 100644 index 00000000..448060c8 --- /dev/null +++ b/packages/database/coverage/database/src/schemas/index.html @@ -0,0 +1,221 @@ + + + + + + Code coverage report for database/src/schemas + + + + + + + + + +
+
+

All files database/src/schemas

+
+ +
+ 99.55% + Statements + 675/678 +
+ + +
+ 96.77% + Branches + 30/31 +
+ + +
+ 100% + Functions + 6/6 +
+ + +
+ 99.55% + Lines + 675/678 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Credential.ts +
+
100%116/116100%4/4100%1/1100%116/116
CredentialRequestMetadata.ts +
+
100%79/79100%1/1100%1/1100%79/79
DID.ts +
+
100%45/45100%0/0100%0/0100%45/45
DIDPair.ts +
+
100%33/33100%0/0100%0/0100%33/33
LinkSecret.ts +
+
100%48/48100%1/1100%1/1100%48/48
Mediator.ts +
+
100%56/56100%1/1100%1/1100%56/56
Message.ts +
+
100%128/128100%1/1100%1/1100%128/128
PrivateKey.ts +
+
98.26%170/17395.65%22/23100%1/198.26%170/173
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/packages/database/coverage/database/src/types.ts.html b/packages/database/coverage/database/src/types.ts.html new file mode 100644 index 00000000..0af59cd5 --- /dev/null +++ b/packages/database/coverage/database/src/types.ts.html @@ -0,0 +1,217 @@ + + + + + + Code coverage report for database/src/types.ts + + + + + + + + + +
+
+

All files / database/src types.ts

+
+ +
+ 0% + Statements + 0/45 +
+ + +
+ 0% + Branches + 0/1 +
+ + +
+ 0% + Functions + 0/1 +
+ + +
+ 0% + Lines + 0/45 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import { KeyFunctionMap, RxCollectionBase, RxJsonSchema, RxQuery, RxStorageInstanceCreationParams } from "rxdb";
+import { MangoQuery, MangoQueryNoLimit, MangoQuerySelectorAndIndex, RxCollection, RxDocument, RxDumpDatabase, RxStorage } from "rxdb/dist/types/types";
+import { CredentialCollection } from "./schemas/Credential";
+import { CredentialRequestMetadataCollection } from "./schemas/CredentialRequestMetadata";
+import { DIDCollection } from "./schemas/DID";
+import { DIDPairCollection } from "./schemas/DIDPair";
+import { LinkSecretColletion } from "./schemas/LinkSecret";
+import { MediatorCollection } from "./schemas/Mediator";
+import { MessageColletion } from "./schemas/Message";
+import { PrivateKeyColletion } from "./schemas/PrivateKey";
+
+
+export type NoKeys<T, K extends keyof T> = {
+    [P in Exclude<keyof T, K>]: T[P];
+};
+
+export type Schema<T> = RxJsonSchema<T> & {
+    encrypted: (keyof T)[];
+};
+
+export interface GenericORMType<RxDocType> extends RxCollection<any, any, any> {
+    count: (this: RxCollection<any, any, any>, query: MangoQuery<any> | undefined) => Promise<number>,
+    findByIds(this: RxCollection<any, any, any>, ids: string[]): Map<string, RxDocument>;
+    find(queryObj?: MangoQueryNoLimit<any> | string): RxDocument<RxDocType, any>[];
+    findOne(queryObj?: MangoQueryNoLimit<any> | string): RxDocument<RxDocType, any> | null;
+    remove(queryObj?: MangoQueryNoLimit<any> | string): RxDocument<RxDocType, any>[]
+}
+
+export type PlutoCollections = {
+    messages: MessageColletion;
+    dids: DIDCollection;
+    didpairs: DIDPairCollection;
+    mediators: MediatorCollection;
+    privatekeys: PrivateKeyColletion;
+    credentials: CredentialCollection;
+    credentialrequestmetadatas: CredentialRequestMetadataCollection;
+    linksecrets: LinkSecretColletion;
+};
+
+export type createEncryptedOptions = {
+    name: string,
+    encryptionKey: Uint8Array,
+    importData?: RxDumpDatabase<PlutoCollections>,
+    storage: RxStorage<any, any>
+}
+ +
+
+ + + + + + + + \ No newline at end of file From 47c5f32ff332b39b4ee560227630c31eb76997c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Javier=20Ribo=CC=81=20Labrador?= Date: Sat, 16 Dec 2023 07:14:15 -0500 Subject: [PATCH 4/5] =?UTF-8?q?chore(release):=20move=20release=20config?= =?UTF-8?q?=20to=20the=20root=20of=20the=20project.=20Signed-off-by:=20Fra?= =?UTF-8?q?ncisco=20Javier=20Rib=C3=B3=20Labrador=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- packages/database/release.config.mjs => release.config.mjs | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename packages/database/release.config.mjs => release.config.mjs (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 835836c0..286efe5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} with: push_options: '--force' - commit_message: "chore(docs): Rebuild docs [skip ci]" + commit_message: "chore(docs): Rebuild docs + coverage [skip ci]" commit_author: Javier Ribó commit_user_name: Javier Ribó commit_user_email: elribonazo@gmail.com \ No newline at end of file diff --git a/packages/database/release.config.mjs b/release.config.mjs similarity index 100% rename from packages/database/release.config.mjs rename to release.config.mjs From f10eb14697c1079e7a5b12aa5745b0af453ff5f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Rib=C3=B3?= Date: Sat, 16 Dec 2023 12:15:10 +0000 Subject: [PATCH 5/5] chore(docs): Rebuild docs + coverage [skip ci] --- README.md | 2 +- docs/classes/Database.md | 94 +- .../coverage/database/release.config.mjs.html | 160 - .../coverage/database/rollup/index.html | 116 - .../database/coverage/database/src/index.html | 131 - .../coverage/database/src/index.ts.html | 3697 ----------------- .../database/src/schemas/Credential.ts.html | 433 -- .../schemas/CredentialRequestMetadata.ts.html | 322 -- .../coverage/database/src/schemas/DID.ts.html | 220 - .../database/src/schemas/DIDPair.ts.html | 184 - .../database/src/schemas/LinkSecret.ts.html | 229 - .../database/src/schemas/Mediator.ts.html | 253 -- .../database/src/schemas/Message.ts.html | 469 --- .../database/src/schemas/PrivateKey.ts.html | 604 --- .../coverage/database/src/schemas/index.html | 221 - .../coverage/database/src/types.ts.html | 217 - .../coverage/{database => rollup}/index.html | 16 +- .../{database => }/rollup/rollup.mjs.html | 20 +- 18 files changed, 66 insertions(+), 7322 deletions(-) delete mode 100644 packages/database/coverage/database/release.config.mjs.html delete mode 100644 packages/database/coverage/database/rollup/index.html delete mode 100644 packages/database/coverage/database/src/index.html delete mode 100644 packages/database/coverage/database/src/index.ts.html delete mode 100644 packages/database/coverage/database/src/schemas/Credential.ts.html delete mode 100644 packages/database/coverage/database/src/schemas/CredentialRequestMetadata.ts.html delete mode 100644 packages/database/coverage/database/src/schemas/DID.ts.html delete mode 100644 packages/database/coverage/database/src/schemas/DIDPair.ts.html delete mode 100644 packages/database/coverage/database/src/schemas/LinkSecret.ts.html delete mode 100644 packages/database/coverage/database/src/schemas/Mediator.ts.html delete mode 100644 packages/database/coverage/database/src/schemas/Message.ts.html delete mode 100644 packages/database/coverage/database/src/schemas/PrivateKey.ts.html delete mode 100644 packages/database/coverage/database/src/schemas/index.html delete mode 100644 packages/database/coverage/database/src/types.ts.html rename packages/database/coverage/{database => rollup}/index.html (89%) rename packages/database/coverage/{database => }/rollup/rollup.mjs.html (84%) diff --git a/README.md b/README.md index 86f2b510..ba9557f3 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ We are not going to stop here but ensure that our SDK can be used in any platfor ## QA & Documentation | Statements | Branches | Functions | Lines | | --------------------------- | ----------------------- | ------------------------- | ----------------- | -| ![Statements](https://img.shields.io/badge/statements-94.58%25-brightgreen.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-92.05%25-brightgreen.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-85.24%25-yellow.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-94.58%25-brightgreen.svg?style=flat) | +| ![Statements](https://img.shields.io/badge/statements-95.8%25-brightgreen.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-92.66%25-brightgreen.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-86.66%25-yellow.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-95.8%25-brightgreen.svg?style=flat) | ### Documentation diff --git a/docs/classes/Database.md b/docs/classes/Database.md index 38105de2..397371f6 100644 --- a/docs/classes/Database.md +++ b/docs/classes/Database.md @@ -82,7 +82,7 @@ preferred underlying storage technology, most appropriate for your use case. #### Defined in -[index.ts:99](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L99) +[index.ts:99](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L99) ## Accessors @@ -123,7 +123,7 @@ await db.credentialmetadatas.remove({selector: {id: {$eq: 1}}}) #### Defined in -[index.ts:133](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L133) +[index.ts:133](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L133) ___ @@ -164,7 +164,7 @@ await db.credentials.remove({selector: {id: {$eq: 1}}}) #### Defined in -[index.ts:229](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L229) +[index.ts:229](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L229) ___ @@ -205,7 +205,7 @@ await db.didpairs.remove({selector: {id: {$eq: 1}}}) #### Defined in -[index.ts:197](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L197) +[index.ts:197](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L197) ___ @@ -246,7 +246,7 @@ await db.dids.remove({selector: {id: {$eq: 1}}}) #### Defined in -[index.ts:293](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L293) +[index.ts:293](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L293) ___ @@ -287,7 +287,7 @@ await db.linksecrets.remove({selector: {id: {$eq: 1}}}) #### Defined in -[index.ts:165](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L165) +[index.ts:165](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L165) ___ @@ -328,7 +328,7 @@ await db.mediators.remove({selector: {id: {$eq: 1}}}) #### Defined in -[index.ts:261](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L261) +[index.ts:261](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L261) ___ @@ -369,7 +369,7 @@ await db.messages.remove({selector: {id: {$eq: 1}}}) #### Defined in -[index.ts:357](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L357) +[index.ts:357](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L357) ___ @@ -410,7 +410,7 @@ await db.privatekeys.remove({selector: {id: {$eq: 1}}}) #### Defined in -[index.ts:325](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L325) +[index.ts:325](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L325) ## Methods @@ -424,7 +424,7 @@ await db.privatekeys.remove({selector: {id: {$eq: 1}}}) #### Defined in -[index.ts:101](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L101) +[index.ts:101](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L101) ___ @@ -441,7 +441,7 @@ and then destroy the database itself. #### Defined in -[index.ts:365](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L365) +[index.ts:365](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L365) ___ @@ -465,7 +465,7 @@ Domain.Pluto.fetchCredentialMetadata #### Defined in -[index.ts:1187](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1187) +[index.ts:1187](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L1187) ___ @@ -483,7 +483,7 @@ Domain.Pluto.getAllCredentials #### Defined in -[index.ts:1137](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1137) +[index.ts:1137](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L1137) ___ @@ -505,7 +505,7 @@ Domain.Pluto.getAllDidPairs #### Defined in -[index.ts:751](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L751) +[index.ts:751](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L751) ___ @@ -523,7 +523,7 @@ Domain.Pluto.getAllMediators #### Defined in -[index.ts:1132](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1132) +[index.ts:1132](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L1132) ___ @@ -545,7 +545,7 @@ Domain.Pluto.getAllMessages #### Defined in -[index.ts:469](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L469) +[index.ts:469](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L469) ___ @@ -569,7 +569,7 @@ Domain.Pluto.getAllMessagesByDID #### Defined in -[index.ts:945](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L945) +[index.ts:945](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L945) ___ @@ -594,7 +594,7 @@ Domain.Pluto.getAllMessagesByFromToDID #### Defined in -[index.ts:1058](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1058) +[index.ts:1058](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L1058) ___ @@ -619,7 +619,7 @@ Domain.Pluto.getAllMessagesOfType #### Defined in -[index.ts:1027](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1027) +[index.ts:1027](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L1027) ___ @@ -637,7 +637,7 @@ Domain.Pluto.getAllMessagesReceived #### Defined in -[index.ts:978](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L978) +[index.ts:978](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L978) ___ @@ -661,7 +661,7 @@ Domain.Pluto.getAllMessagesReceivedFrom #### Defined in -[index.ts:1010](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1010) +[index.ts:1010](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L1010) ___ @@ -679,7 +679,7 @@ Domain.Pluto.getAllMessagesSent #### Defined in -[index.ts:963](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L963) +[index.ts:963](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L963) ___ @@ -703,7 +703,7 @@ Domain.Pluto.getAllMessagesSentTo #### Defined in -[index.ts:993](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L993) +[index.ts:993](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L993) ___ @@ -721,7 +721,7 @@ Domain.Pluto.getAllPeerDIDs #### Defined in -[index.ts:1095](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1095) +[index.ts:1095](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L1095) ___ @@ -739,7 +739,7 @@ Domain.Pluto.getAllPrismDIDs #### Defined in -[index.ts:853](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L853) +[index.ts:853](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L853) ___ @@ -763,7 +763,7 @@ Domain.Pluto.getDIDInfoByAlias #### Defined in -[index.ts:918](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L918) +[index.ts:918](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L918) ___ @@ -787,7 +787,7 @@ Domain.Pluto.getDIDInfoByDID #### Defined in -[index.ts:885](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L885) +[index.ts:885](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L885) ___ @@ -811,7 +811,7 @@ Domain.Pluto.getDIDPrivateKeyByID #### Defined in -[index.ts:829](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L829) +[index.ts:829](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L829) ___ @@ -835,7 +835,7 @@ Domain.Pluto.getDIDPrivateKeysByDID #### Defined in -[index.ts:817](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L817) +[index.ts:817](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L817) ___ @@ -859,7 +859,7 @@ Domain.Pluto.getLinkSecret #### Defined in -[index.ts:1144](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1144) +[index.ts:1144](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L1144) ___ @@ -887,7 +887,7 @@ Domain.Pluto.getMessage #### Defined in -[index.ts:411](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L411) +[index.ts:411](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L411) ___ @@ -915,7 +915,7 @@ Domain.Pluto.getPairByDID #### Defined in -[index.ts:765](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L765) +[index.ts:765](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L765) ___ @@ -939,7 +939,7 @@ Domain.Pluto.getPairByName #### Defined in -[index.ts:789](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L789) +[index.ts:789](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L789) ___ @@ -963,7 +963,7 @@ Domain.Pluto.getPrismDIDKeyPathIndex #### Defined in -[index.ts:1079](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1079) +[index.ts:1079](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L1079) ___ @@ -981,7 +981,7 @@ Domain.Pluto.getPrismLastKeyPathIndex #### Defined in -[index.ts:1087](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1087) +[index.ts:1087](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L1087) ___ @@ -1001,7 +1001,7 @@ Domain.Pluto.start #### Defined in -[index.ts:481](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L481) +[index.ts:481](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L481) ___ @@ -1025,7 +1025,7 @@ Domain.Pluto.storeCredential #### Defined in -[index.ts:1122](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1122) +[index.ts:1122](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L1122) ___ @@ -1050,7 +1050,7 @@ Domain.Pluto.storeCredentialMetadata #### Defined in -[index.ts:1176](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1176) +[index.ts:1176](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L1176) ___ @@ -1078,7 +1078,7 @@ Domain.Pluto.storeDIDPair #### Defined in -[index.ts:693](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L693) +[index.ts:693](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L693) ___ @@ -1103,7 +1103,7 @@ Domain.Pluto.storeLinkSecret #### Defined in -[index.ts:1166](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L1166) +[index.ts:1166](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L1166) ___ @@ -1129,7 +1129,7 @@ Domain.Pluto.storeMediator #### Defined in -[index.ts:840](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L840) +[index.ts:840](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L840) ___ @@ -1157,7 +1157,7 @@ Domain.Pluto.storeMessage #### Defined in -[index.ts:430](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L430) +[index.ts:430](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L430) ___ @@ -1185,7 +1185,7 @@ Domain.Pluto.storeMessages #### Defined in -[index.ts:459](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L459) +[index.ts:459](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L459) ___ @@ -1212,7 +1212,7 @@ Domain.Pluto.storePeerDID #### Defined in -[index.ts:651](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L651) +[index.ts:651](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L651) ___ @@ -1242,7 +1242,7 @@ Domain.Pluto.storePrismDID #### Defined in -[index.ts:624](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L624) +[index.ts:624](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L624) ___ @@ -1271,7 +1271,7 @@ Domain.Pluto.storePrivateKeys #### Defined in -[index.ts:712](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L712) +[index.ts:712](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L712) ___ @@ -1299,4 +1299,4 @@ Database #### Defined in -[index.ts:378](https://github.com/elribonazo/pluto-encrypted/blob/4b14587/packages/database/src/index.ts#L378) +[index.ts:378](https://github.com/elribonazo/pluto-encrypted/blob/3b8277b/packages/database/src/index.ts#L378) diff --git a/packages/database/coverage/database/release.config.mjs.html b/packages/database/coverage/database/release.config.mjs.html deleted file mode 100644 index 15065c15..00000000 --- a/packages/database/coverage/database/release.config.mjs.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - Code coverage report for database/release.config.mjs - - - - - - - - - -
-
-

All files / database release.config.mjs

-
- -
- 0% - Statements - 0/25 -
- - -
- 0% - Branches - 0/1 -
- - -
- 0% - Functions - 0/1 -
- - -
- 0% - Lines - 0/25 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
export default {
-  plugins: [
-    "@semantic-release/commit-analyzer",
-    "@semantic-release/release-notes-generator",
-    [
-      "@semantic-release/changelog",
-      {
-        changelogFile: "../../CHANGELOG.md",
-      },
-    ],
-    "@semantic-release/npm",
-    [
-      "@semantic-release/git",
-      {
-        assets: [
-          "**/*"
-        ],
-        message:
-          "chore(release): Released ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
-        signedCommit: true,
-      },
-    ],
-    "@semantic-release/github",
-  ],
-};
- -
-
- - - - - - - - \ No newline at end of file diff --git a/packages/database/coverage/database/rollup/index.html b/packages/database/coverage/database/rollup/index.html deleted file mode 100644 index c9525426..00000000 --- a/packages/database/coverage/database/rollup/index.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - Code coverage report for database/rollup - - - - - - - - - -
-
-

All files database/rollup

-
- -
- 0% - Statements - 0/5 -
- - -
- 0% - Branches - 0/1 -
- - -
- 0% - Functions - 0/1 -
- - -
- 0% - Lines - 0/5 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
rollup.mjs -
-
0%0/50%0/10%0/10%0/5
-
-
-
- - - - - - - - \ No newline at end of file diff --git a/packages/database/coverage/database/src/index.html b/packages/database/coverage/database/src/index.html deleted file mode 100644 index d3ee0520..00000000 --- a/packages/database/coverage/database/src/index.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - Code coverage report for database/src - - - - - - - - - -
-
-

All files database/src

-
- -
- 94.15% - Statements - 1176/1249 -
- - -
- 92.37% - Branches - 109/118 -
- - -
- 86.79% - Functions - 46/53 -
- - -
- 94.15% - Lines - 1176/1249 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
index.ts -
-
97.67%1176/120493.16%109/11788.46%46/5297.67%1176/1204
types.ts -
-
0%0/450%0/10%0/10%0/45
-
-
-
- - - - - - - - \ No newline at end of file diff --git a/packages/database/coverage/database/src/index.ts.html b/packages/database/coverage/database/src/index.ts.html deleted file mode 100644 index 4fb78aa5..00000000 --- a/packages/database/coverage/database/src/index.ts.html +++ /dev/null @@ -1,3697 +0,0 @@ - - - - - - Code coverage report for database/src/index.ts - - - - - - - - - -
-
-

All files / database/src index.ts

-
- -
- 97.67% - Statements - 1176/1204 -
- - -
- 93.16% - Branches - 109/117 -
- - -
- 88.46% - Functions - 46/52 -
- - -
- 97.67% - Lines - 1176/1204 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739 -740 -741 -742 -743 -744 -745 -746 -747 -748 -749 -750 -751 -752 -753 -754 -755 -756 -757 -758 -759 -760 -761 -762 -763 -764 -765 -766 -767 -768 -769 -770 -771 -772 -773 -774 -775 -776 -777 -778 -779 -780 -781 -782 -783 -784 -785 -786 -787 -788 -789 -790 -791 -792 -793 -794 -795 -796 -797 -798 -799 -800 -801 -802 -803 -804 -805 -806 -807 -808 -809 -810 -811 -812 -813 -814 -815 -816 -817 -818 -819 -820 -821 -822 -823 -824 -825 -826 -827 -828 -829 -830 -831 -832 -833 -834 -835 -836 -837 -838 -839 -840 -841 -842 -843 -844 -845 -846 -847 -848 -849 -850 -851 -852 -853 -854 -855 -856 -857 -858 -859 -860 -861 -862 -863 -864 -865 -866 -867 -868 -869 -870 -871 -872 -873 -874 -875 -876 -877 -878 -879 -880 -881 -882 -883 -884 -885 -886 -887 -888 -889 -890 -891 -892 -893 -894 -895 -896 -897 -898 -899 -900 -901 -902 -903 -904 -905 -906 -907 -908 -909 -910 -911 -912 -913 -914 -915 -916 -917 -918 -919 -920 -921 -922 -923 -924 -925 -926 -927 -928 -929 -930 -931 -932 -933 -934 -935 -936 -937 -938 -939 -940 -941 -942 -943 -944 -945 -946 -947 -948 -949 -950 -951 -952 -953 -954 -955 -956 -957 -958 -959 -960 -961 -962 -963 -964 -965 -966 -967 -968 -969 -970 -971 -972 -973 -974 -975 -976 -977 -978 -979 -980 -981 -982 -983 -984 -985 -986 -987 -988 -989 -990 -991 -992 -993 -994 -995 -996 -997 -998 -999 -1000 -1001 -1002 -1003 -1004 -1005 -1006 -1007 -1008 -1009 -1010 -1011 -1012 -1013 -1014 -1015 -1016 -1017 -1018 -1019 -1020 -1021 -1022 -1023 -1024 -1025 -1026 -1027 -1028 -1029 -1030 -1031 -1032 -1033 -1034 -1035 -1036 -1037 -1038 -1039 -1040 -1041 -1042 -1043 -1044 -1045 -1046 -1047 -1048 -1049 -1050 -1051 -1052 -1053 -1054 -1055 -1056 -1057 -1058 -1059 -1060 -1061 -1062 -1063 -1064 -1065 -1066 -1067 -1068 -1069 -1070 -1071 -1072 -1073 -1074 -1075 -1076 -1077 -1078 -1079 -1080 -1081 -1082 -1083 -1084 -1085 -1086 -1087 -1088 -1089 -1090 -1091 -1092 -1093 -1094 -1095 -1096 -1097 -1098 -1099 -1100 -1101 -1102 -1103 -1104 -1105 -1106 -1107 -1108 -1109 -1110 -1111 -1112 -1113 -1114 -1115 -1116 -1117 -1118 -1119 -1120 -1121 -1122 -1123 -1124 -1125 -1126 -1127 -1128 -1129 -1130 -1131 -1132 -1133 -1134 -1135 -1136 -1137 -1138 -1139 -1140 -1141 -1142 -1143 -1144 -1145 -1146 -1147 -1148 -1149 -1150 -1151 -1152 -1153 -1154 -1155 -1156 -1157 -1158 -1159 -1160 -1161 -1162 -1163 -1164 -1165 -1166 -1167 -1168 -1169 -1170 -1171 -1172 -1173 -1174 -1175 -1176 -1177 -1178 -1179 -1180 -1181 -1182 -1183 -1184 -1185 -1186 -1187 -1188 -1189 -1190 -1191 -1192 -1193 -1194 -1195 -1196 -1197 -1198 -1199 -1200 -1201 -1202 -1203 -1204 -12051x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -  -  -1x -1x -1x -1x -1x -1x -3x -3x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -  -  -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -  -  -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -  -  -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -3x -3x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -  -  -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -  -  -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -9x -9x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -  -  -1x -1x -1x -1x -1x -1x -80x -80x -720x -720x -80x -80x -1x -1x -1x -1x -1x -1x -1x -120x -120x -120x -120x -120x -120x -120x -120x -120x -  -  -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -3x -3x -120x -120x -120x -1x -1x -1x -1x -1x -1x -1x -9x -9x -9x -9x -9x -9x -9x -9x -6x -6x -3x -9x -1x -1x -1x -1x -1x -1x -1x -27x -27x -27x -27x -27x -27x -27x -27x -27x -6x -6x -6x -6x -6x -27x -21x -21x -21x -21x -21x -21x -27x -1x -1x -1x -1x -1x -1x -1x -6x -12x -12x -6x -1x -1x -1x -1x -1x -1x -6x -6x -6x -1x -1x -960x -960x -1x -1x -1x -1x -1x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -120x -600x -4800x -4800x -4800x -4800x -4800x -234x -234x -234x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -  -  -  -3x -3x -231x -231x -231x -234x -  -  -231x -231x -  -234x -4800x -4800x -4800x -4800x -600x -120x -120x -  -  -  -  -  -  -120x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -1x -1x -1x -1x -1x -1x -1x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -3x -1x -1x -1x -1x -1x -1x -1x -1x -12x -12x -12x -12x -12x -12x -12x -12x -12x -12x -1x -1x -1x -1x -1x -1x -1x -1x -1x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -15x -1x -1x -1x -1x -1x -1x -6x -6x -6x -6x -3x -6x -6x -1x -1x -1x -1x -1x -1x -1x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -3x -3x -3x -3x -3x -3x -6x -1x -1x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -3x -3x -3x -3x -3x -3x -6x -1x -1x -45x -45x -45x -45x -1x -1x -45x -45x -45x -45x -45x -45x -45x -45x -45x -45x -1x -1x -6x -6x -6x -6x -6x -6x -6x -6x -6x -1x -1x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -1x -1x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -18x -1x -1x -12x -12x -12x -12x -12x -12x -12x -12x -12x -9x -9x -9x -9x -9x -3x -3x -3x -3x -6x -6x -6x -9x -9x -9x -9x -9x -9x -9x -3x -3x -12x -1x -1x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -1x -1x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -1x -1x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -1x -1x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -1x -1x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -1x -1x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -1x -1x -6x -6x -6x -6x -6x -6x -6x -6x -6x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -6x -6x -6x -6x -6x -6x -6x -6x -6x -1x -1x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -1x -1x -9x -9x -3x -3x -6x -9x -1x -1x -9x -9x -3x -3x -6x -9x -1x -1x -6x -6x -6x -6x -6x -6x -6x -6x -6x -3x -3x -3x -3x -3x -3x -6x -6x -6x -6x -3x -3x -3x -3x -6x -6x -1x -1x -15x -3x -3x -12x -12x -12x -12x -15x -1x -1x -15x -15x -15x -1x -1x -15x -15x -15x -15x -15x -1x -1x -9x -9x -9x -6x -6x -6x -6x -6x -6x -9x -9x -9x -9x -9x -9x -6x -6x -3x -3x -9x -1x -1x -6x -6x -6x -6x -6x -6x -6x -6x -1x -1x -3x -3x -3x -3x -3x -3x -3x -3x -3x -1x -1x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -6x -3x -3x -3x -6x -1x - 
import { Domain } from "@atala/prism-wallet-sdk";
-import {
-  MangoQuerySelector,
-  RxCollection,
-  RxCollectionBase,
-  RxCollectionCreator,
-  RxDatabase,
-  RxDatabaseCreator,
-  RxDumpDatabase,
-  RxQuery,
-  RxStorage,
-  createRxDatabase,
-  flatClone,
-  getFromMapOrThrow,
-  removeRxDatabase
-} from "rxdb";
-import { RxError } from "rxdb";
-import { addRxPlugin } from "rxdb";
-import { RxDBMigrationPlugin } from "rxdb/plugins/migration";
-import { RxDBQueryBuilderPlugin } from "rxdb/plugins/query-builder";
-import { v4 as uuidv4 } from "uuid";
-import { RxDBJsonDumpPlugin } from "rxdb/plugins/json-dump";
-import MessageSchema, {
-  MessageColletion,
-  MessageDocument,
-  MessageMethods,
-  MessageSchemaType,
-} from "./schemas/Message";
-import DIDSchema, { DIDCollection, DIDDocument, DIDSchemaType } from "./schemas/DID";
-import CredentialSchema, {
-  CredentialCollection,
-  CredentialDocument,
-  CredentialMethods,
-  CredentialSchemaType,
-} from "./schemas/Credential";
-import DIDPairSchema, { DIDPairCollection, DIDPairDocument, DIDPairSchemaType } from "./schemas/DIDPair";
-import MediatorSchema, {
-  MediatorCollection,
-  MediatorDocument,
-  MediatorMethods,
-  MediatorSchemaType,
-} from "./schemas/Mediator";
-import PrivateKeySchema, {
-  KeySchemaType,
-  KeySpec,
-  PrivateKeyColletion,
-  PrivateKeyDocument,
-  PrivateKeyMethods,
-} from "./schemas/PrivateKey";
-import LinkSecretSchema, {
-  LinkSecretColletion,
-  LinkSecretDocument,
-  LinkSecretMethods,
-  LinkSecretSchemaType,
-} from "./schemas/LinkSecret";
-import CredentialRequestMetadataSchema, {
-  CredentialRequestMetadataCollection,
-  CredentialRequestMetadataDocument,
-  CredentialRequestMetadataMethods,
-  CredentialRequestMetadataSchemaType,
-} from "./schemas/CredentialRequestMetadata";
-import { GenericORMType, PlutoCollections } from "./types";
-import { BulkWriteRow, MangoQuerySelectorAndIndex, RxDocument, RxDocumentData } from "rxdb/dist/types/types";
- 
-addRxPlugin(RxDBMigrationPlugin);
-addRxPlugin(RxDBQueryBuilderPlugin);
-//addRxPlugin(RxDBDevModePlugin);
-addRxPlugin(RxDBJsonDumpPlugin);
- 
-export * from "./schemas/Message";
-export * from "./schemas/DID";
-export * from "./schemas/Credential";
-export * from "./schemas/DIDPair";
-export * from "./schemas/Mediator";
-export * from "./schemas/PrivateKey";
- 
-export type ValuesOf<T> = T[keyof T];
-export type PlutoDatabase = RxDatabase<PlutoCollections>;
- 
-/**
- * Pluto is a storage interface describing storage requirements of the edge agents
- * which will be implemented using this SDK. Implement this interface using your
- * preferred underlying storage technology, most appropriate for your use case.
- *
- */
-export class Database implements Domain.Pluto {
-  /**
-   * @internal
-   */
-  private _db!: PlutoDatabase;
- 
-  protected get db() {
-    if (!this._db) {
-      throw new Error("Start Pluto first.");
-    }
-    return this._db;
-  }
- 
-  constructor(private dbOptions: RxDatabaseCreator) { }
- 
-  async backup() {
-    return this.db.exportJSON();
-  }
- 
-  /**
-   * CredentialRequestMetadatas
-   * Stores anoncreds credential metadata + exposes orm functions
-   * 
-   * #### Count all Credential Metadatas with optional query
-   * ```ts
-   * await db.credentialmetadatas.count({selector: {id: {$eq: 1}}}) //Query is optional
-   * ```
-   * 
-   * #### Find all credential metadatas matching the query
-   * ```ts
-   * await db.credentialmetadatas.find({selector: {id: {$eq: 1}}}) //Query is optional
-   * ```
-   * 
-   * #### Find all credential metadatas by id
-   * ```ts
-   * await db.credentialmetadatas.findByIds([id])
-   * ```
-   * #### Find one credential metadatas matching the query
-   * ```ts
-   * await db.credentialmetadatas.findOne({selector: {id: {$eq: 1}}}) //Query is optional
-   * ```
-   * 
-   * #### Remove any credential metadatas matching the query
-   * ```ts
-   * await db.credentialmetadatas.remove({selector: {id: {$eq: 1}}})
-   * ```
-   */
-  get credentialrequestmetadatas() {
-    return this._db.collections.credentialrequestmetadatas
-  }
- 
-  /**
-   * LinkSecrets 
-   * Stores anoncreds link secrets + exposes orm functions
-   * 
-   * #### Count all LinkSecrets with optional query
-   * ```ts
-   * await db.linksecrets.count({selector: {id: {$eq: 1}}}) //Query is optional
-   * ```
-   * 
-   * #### Find all LinkSecrets matching the query
-   * ```ts
-   * await db.linksecrets.find({selector: {id: {$eq: 1}}}) //Query is optional
-   * ```
-   * 
-   * #### Find all LinkSecrets by id
-   * ```ts
-   * await db.linksecrets.findByIds([id])
-   * ```
-   * #### Find one LinkSecrets matching the query
-   * ```ts
-   * await db.linksecrets.findOne({selector: {id: {$eq: 1}}}) //Query is optional
-   * ```
-   * 
-   * #### Remove any LinkSecrets matching the query
-   * ```ts
-   * await db.linksecrets.remove({selector: {id: {$eq: 1}}})
-   * ```
-   */
-  get linksecrets() {
-    return this._db.collections.linksecrets
-  }
- 
-  /**
-   * DIDPairs 
-   * Stores groups of dids, also known as connections + exposes orm functions
-   * 
-   * #### Count all DIDPairs with optional query
-   * ```ts
-   * await db.didpairs.count({selector: {id: {$eq: 1}}}) //Query is optional
-   * ```
-   * 
-   * #### Find all DIDPairs matching the query
-   * ```ts
-   * await db.didpairs.find({selector: {id: {$eq: 1}}}) //Query is optional
-   * ```
-   * 
-   * #### Find all DIDPairs by id
-   * ```ts
-   * await db.didpairs.findByIds([id])
-   * ```
-   * #### Find one DIDPairs matching the query
-   * ```ts
-   * await db.didpairs.findOne({selector: {id: {$eq: 1}}}) //Query is optional
-   * ```
-   * 
-   * #### Remove any DIDPairs matching the query
-   * ```ts
-   * await db.didpairs.remove({selector: {id: {$eq: 1}}})
-   * ```
-   */
-  get didpairs() {
-    return this._db.collections.didpairs
-  }
- 
-  /**
-   * Credentials 
-   * Stores credentials, both anoncreda and prism/jwt + exposes orm functions
-   * 
-   * #### Count all Credentials with optional query
-   * ```ts
-   * await db.credentials.count({selector: {id: {$eq: 1}}}) //Query is optional
-   * ```
-   * 
-   * #### Find all Credentials matching the query
-   * ```ts
-   * await db.credentials.find({selector: {id: {$eq: 1}}}) //Query is optional
-   * ```
-   * 
-   * #### Find all Credentials by id
-   * ```ts
-   * await db.credentials.findByIds([id])
-   * ```
-   * #### Find one Credentials matching the query
-   * ```ts
-   * await db.credentials.findOne({selector: {id: {$eq: 1}}}) //Query is optional
-   * ```
-   * 
-   * #### Remove any Credentials matching the query
-   * ```ts
-   * await db.credentials.remove({selector: {id: {$eq: 1}}})
-   * ```
-   */
-  get credentials() {
-    return this._db.collections.credentials
-  }
- 
-  /**
-   * Mediators 
-   * Stores mediators + exposes orm functions
-   * 
-   * #### Count all Mediators with optional query
-   * ```ts
-   * await db.mediators.count({selector: {id: {$eq: 1}}}) //Query is optional
-   * ```
-   * 
-   * #### Find all Mediators matching the query
-   * ```ts
-   * await db.mediators.find({selector: {id: {$eq: 1}}}) //Query is optional
-   * ```
-   * 
-   * #### Find all Mediators by id
-   * ```ts
-   * await db.mediators.findByIds([id])
-   * ```
-   * #### Find one Mediators matching the query
-   * ```ts
-   * await db.mediators.findOne({selector: {id: {$eq: 1}}}) //Query is optional
-   * ```
-   * 
-   * #### Remove any Mediators matching the query
-   * ```ts
-   * await db.mediators.remove({selector: {id: {$eq: 1}}})
-   * ```
-   */
-  get mediators() {
-    return this._db.collections.mediators
-  }
- 
-  /**
-    * DIDs 
-    * Stores dids + exposes orm functions
-    * 
-    * #### Count all DIDS with optional query
-    * ```ts
-    * await db.dids.count({selector: {id: {$eq: 1}}}) //Query is optional
-    * ```
-    * 
-    * #### Find all DIDS matching the query
-    * ```ts
-    * await db.dids.find({selector: {id: {$eq: 1}}}) //Query is optional
-    * ```
-    * 
-    * #### Find all DIDS by id
-    * ```ts
-    * await db.dids.findByIds([id])
-    * ```
-    * #### Find one DIDS matching the query
-    * ```ts
-    * await db.dids.findOne({selector: {id: {$eq: 1}}}) //Query is optional
-    * ```
-    * 
-    * #### Remove any DIDS matching the query
-    * ```ts
-    * await db.dids.remove({selector: {id: {$eq: 1}}})
-    * ```
-    */
-  get dids() {
-    return this._db.collections.dids
-  }
- 
-  /**
-    * PrivateKeys 
-    * Stores privateKeys + exposes orm functions
-    * 
-    * #### Count all PrivateKeys with optional query
-    * ```ts
-    * await db.privatekeys.count({selector: {id: {$eq: 1}}}) //Query is optional
-    * ```
-    * 
-    * #### Find all PrivateKeys matching the query
-    * ```ts
-    * await db.privatekeys.find({selector: {id: {$eq: 1}}}) //Query is optional
-    * ```
-    * 
-    * #### Find all PrivateKeys by id
-    * ```ts
-    * await db.privatekeys.findByIds([id])
-    * ```
-    * #### Find one PrivateKeys matching the query
-    * ```ts
-    * await db.privatekeys.findOne({selector: {id: {$eq: 1}}}) //Query is optional
-    * ```
-    * 
-    * #### Remove any PrivateKeys matching the query
-    * ```ts
-    * await db.privatekeys.remove({selector: {id: {$eq: 1}}})
-    * ```
-    */
-  get privatekeys() {
-    return this._db.collections.privatekeys
-  }
- 
-  /**
-    * Messages 
-    * Stores Messages + exposes orm functions
-    * 
-    * #### Count all Messages with optional query
-    * ```ts
-    * await db.messages.count({selector: {id: {$eq: 1}}}) //Query is optional
-    * ```
-    * 
-    * #### Find all Messages matching the query
-    * ```ts
-    * await db.messages.find({selector: {id: {$eq: 1}}}) //Query is optional
-    * ```
-    * 
-    * #### Find all Messages by id
-    * ```ts
-    * await db.messages.findByIds([id])
-    * ```
-    * #### Find one Messages matching the query
-    * ```ts
-    * await db.messages.findOne({selector: {id: {$eq: 1}}}) //Query is optional
-    * ```
-    * 
-    * #### Remove any Messages matching the query
-    * ```ts
-    * await db.messages.remove({selector: {id: {$eq: 1}}})
-    * ```
-    */
-  get messages() {
-    return this._db.collections.messages
-  }
- 
-  /**
-   * Use with caution, this will remove all entries from database
-   * and then destroy the database itself.
-   */
-  async clear() {
-    const storages = Array.from(this.db.storageInstances.values())
-    for (let storage of storages) {
-      await storage.cleanup(0)
-    }
-    await removeRxDatabase(this.dbOptions.name, this.db.storage);
-  }
- 
-  /**
-   * Creates a database instance.
-   * @param options 
-   * @returns Database
-   */
-  static async createEncrypted(
-    options: {
-      name: string,
-      encryptionKey: Uint8Array,
-      importData?: RxDumpDatabase<PlutoCollections>,
-      storage: RxStorage<any, any>
-    }
-  ) {
-    const { name, storage, encryptionKey, importData } = options;
-    if (!storage) {
-      throw new Error("Please provide a valid storage.");
-    }
-    const database = new Database({
-      ignoreDuplicate: true,
-      name: name,
-      storage: storage,
-      password: Buffer.from(encryptionKey).toString(),
-    });
- 
-    await database.start()
- 
-    if (importData) {
-      await database.db.importJSON(importData);
-    }
- 
-    return database;
-  }
- 
-  /**
-   * Get a Message by its id
-   * @param id 
-   * @returns [Message](https://input-output-hk.github.io/atala-prism-wallet-sdk-ts/classes/Domain.Message.html)
-   */
-  async getMessage(id: string): Promise<Domain.Message | null> {
-    const message = await this.db.messages.findOne({
-      selector: {
-        id: {
-          $eq: id
-        }
-      }
-    });
-    if (message) {
-      return message.toDomainMessage();
-    }
-    return null;
-  }
- 
-  /**
-   * Stores a message
-   * @param [Message](https://input-output-hk.github.io/atala-prism-wallet-sdk-ts/classes/Domain.Message.html) 
-   * @returns void
-   */
-  async storeMessage(message: Domain.Message): Promise<void> {
-    const existing = await this.db.messages
-      .findOne({
-        selector: {
-          id: {
-            $eq: message.id
-          }
-        }
-      });
-    if (existing) {
-      await existing.patch({
-        ...message,
-        to: message.to?.toString(),
-        from: message.from?.toString(),
-      });
-    } else {
-      await this.db.messages.insert({
-        ...message,
-        to: message.to?.toString(),
-        from: message.from?.toString(),
-      });
-    }
-  }
- 
-  /**
-   * Stores multiple messages in 1 call
-   * @param [Message[]](https://input-output-hk.github.io/atala-prism-wallet-sdk-ts/classes/Domain.Message.html) 
-   * @returns void
-   */
-  async storeMessages(messages: Domain.Message[]): Promise<void> {
-    for (let message of messages) {
-      await this.storeMessage(message)
-    }
-  }
- 
-  /**
-  * Get all the stored messages
-  * @returns [Message[]](https://input-output-hk.github.io/atala-prism-wallet-sdk-ts/classes/Domain.Message.html) 
-  */
-  async getAllMessages(): Promise<Domain.Message[]> {
-    const messages = await this.db.messages.find();
-    return messages.map((message) => message.toDomainMessage());
-  }
- 
-  private applyORMStatics(collectionObj: RxCollectionCreator<any>) {
-    return collectionObj
-  }
- 
-  /**
-   * Start the database and build collections
-   */
-  async start(): Promise<void> {
-    const { dbOptions } = this;
-    try {
-      const database = await createRxDatabase<PlutoDatabase>({
-        ...dbOptions,
-        multiInstance: false
-      });
-      await database.addCollections<PlutoCollections>({
-        messages: this.applyORMStatics({
-          schema: MessageSchema,
-          methods: MessageMethods,
-        }),
-        dids: this.applyORMStatics({
-          schema: DIDSchema,
-        }),
-        didpairs: this.applyORMStatics({
-          schema: DIDPairSchema,
-        }),
-        mediators: this.applyORMStatics({
-          schema: MediatorSchema,
-          methods: MediatorMethods,
-        }),
-        privatekeys: this.applyORMStatics({
-          schema: PrivateKeySchema,
-          methods: PrivateKeyMethods,
-        }),
-        credentials: this.applyORMStatics({
-          schema: CredentialSchema,
-          methods: CredentialMethods,
-        }),
-        credentialrequestmetadatas: this.applyORMStatics({
-          schema: CredentialRequestMetadataSchema,
-          methods: CredentialRequestMetadataMethods,
-        }),
-        linksecrets: this.applyORMStatics({
-          schema: LinkSecretSchema,
-          methods: LinkSecretMethods,
-        }),
-      });
-      this._db = database;
- 
-      const execOrmNames = ['count', 'findByIds', 'find', 'findOne', "remove"];
-      for (let ormNme of execOrmNames) {
-        for (let collectionName in this.db.collections) {
-          const collection: ValuesOf<PlutoCollections> = this.db.collections[collectionName]
-          const originalOrmMethod = collection[ormNme]
- 
-          collection[ormNme] = new Proxy(originalOrmMethod, {
-            async apply(target, thisArg, args) {
- 
-              if (target.name === ormNme) {
-                if (ormNme === "remove") {
-                  const rxDocumentArray = await collection.find(...args)
-                  const docsData: RxDocumentData<any>[] = [];
-                  const docsMap: Map<string, RxDocumentData<any>> = new Map();
-                  rxDocumentArray.forEach(rxDocument => {
-                    const data: RxDocumentData<any> = rxDocument.toMutableJSON(true) as any;
-                    docsData.push(data);
-                    docsMap.set(rxDocument.primary, data);
-                  });
- 
-                  await Promise.all(
-                    docsData.map(doc => {
-                      const primary = (doc as any)[collection.schema.primaryPath];
-                      const rxDocument = rxDocumentArray.find((doc) => doc[collection.schema.primaryPath] === primary)
-                      return collection._runHooks('pre', 'remove', doc, rxDocument);
-                    })
-                  );
- 
-                  const removeDocs: BulkWriteRow<any>[] = docsData.map(doc => {
-                    const writeDoc = flatClone(doc);
-                    writeDoc._deleted = true;
-                    return {
-                      previous: doc,
-                      document: writeDoc
-                    };
-                  });
- 
-                  const results = await collection.storageInstance.bulkWrite(
-                    removeDocs,
-                    'rx-collection-bulk-remove'
-                  );
- 
-                  const successIds: string[] = Object.keys(results.success);
- 
-                  await Promise.all(
-                    successIds.map(id => {
-                      return collection._runHooks(
-                        'post',
-                        'remove',
-                        docsMap.get(id),
-                        rxDocumentArray.find((doc) => doc[collection.schema.primaryPath] === id)
-                      );
-                    })
-                  );
- 
-                  const rxDocumentMap = rxDocumentArray.reduce((map, doc) => {
-                    const primary = (doc as any)[collection.schema.primaryPath];
-                    map.set(primary, doc);
-                    return map
-                  }, new Map<string, RxDocument<any>>());
- 
-                  const rxDocuments = successIds.map(id => getFromMapOrThrow(rxDocumentMap, id));
-                  const [error] = Object.values(results.error)
-                  if (error) {
-                    //TODO: Improve error handling
-                    throw new Error(`Could not remove ${JSON.stringify(error)}`)
-                  }
-                  return rxDocuments;
-                }
- 
-                const query = Reflect.apply(target, thisArg, args) as RxQuery;
- 
-                if (!query.exec) {
-                  throw new Error("Wrong ORM function does not return exec")
-                }
-                return query.exec()
-              }
-              return Reflect.apply(target, thisArg, args);
-            }
-          })
- 
- 
-        }
-      }
- 
-    } catch (err) {
-      /* istanbul ignore else */
-      if ((err as RxError).code === "DB1") {
-        throw new Error("Invalid authentication");
-        /* istanbul ignore next */
-      } else throw err;
-    }
-  }
- 
-  /**
-   * Stores a prismDID and its privateKey
-   * @param did 
-   * @param keyPathIndex 
-   * @param privateKey 
-   * @param privateKeyMetaId 
-   * @param alias 
-   */
-  async storePrismDID(
-    did: Domain.DID,
-    keyPathIndex: number,
-    privateKey: Domain.PrivateKey,
-    privateKeyMetaId?: string | null,
-    alias?: string | undefined
-  ): Promise<void> {
-    await this.db.dids.insert({
-      did: did.toString(),
-      method: did.method,
-      methodId: did.methodId,
-      schema: did.schema,
-      alias: alias,
-    });
-    await this.storePrivateKeys(
-      privateKey,
-      did,
-      keyPathIndex,
-      privateKeyMetaId ?? null
-    );
-  }
- 
-  /**
-   * Stores a peerdid with its privateKeys
-   * @param did 
-   * @param privateKeys 
-   */
-  async storePeerDID(
-    did: Domain.DID,
-    privateKeys: Domain.PrivateKey[]
-  ): Promise<void> {
-    await this.db.dids.insert({
-      did: did.toString(),
-      method: did.method,
-      methodId: did.methodId,
-      schema: did.schema,
-    });
-    for (let prv of privateKeys) {
-      await this.db.privatekeys.insert({
-        id: uuidv4(),
-        did: did.toString(),
-        type: prv.type,
-        keySpecification: Array.from(prv.keySpecification).reduce(
-          (all, [key, value]) => [
-            ...all,
-            {
-              type: "string",
-              name: key,
-              value: `${value}`,
-            },
-          ],
-          [
-            {
-              type: "string",
-              name: "raw",
-              value: Buffer.from(prv.raw).toString("hex"),
-            },
-          ] as KeySpec[]
-        ),
-      })
-    }
-  }
- 
-  /**
-   * Stores a didpair
-   * @param host 
-   * @param receiver 
-   * @param name 
-   */
-  async storeDIDPair(
-    host: Domain.DID,
-    receiver: Domain.DID,
-    name: string
-  ): Promise<void> {
-    await this.db.didpairs.insert({
-      hostDID: host.toString(),
-      receiverDID: receiver.toString(),
-      name,
-    });
-  }
- 
-  /**
-   * Stores privateKeys references to an existing DID
-   * @param privateKey 
-   * @param did 
-   * @param keyPathIndex 
-   * @param metaId 
-   */
-  async storePrivateKeys(
-    privateKey: Domain.PrivateKey,
-    did: Domain.DID,
-    keyPathIndex: number,
-    metaId?: string | null
-  ): Promise<void> {
-    await this.db.privatekeys.insert({
-      id: uuidv4(),
-      did: did.toString(),
-      type: privateKey.type,
-      keySpecification: Array.from(privateKey.keySpecification).reduce(
-        (all, [key, value]) => [
-          ...all,
-          {
-            type: "string",
-            name: key,
-            value: `${value}`,
-          },
-        ],
-        [
-          {
-            type: "string",
-            name: "raw",
-            value: Buffer.from(privateKey.raw).toString("hex"),
-          },
-          {
-            type: "number",
-            name: "index",
-            value: `${keyPathIndex}`,
-          },
-        ] as KeySpec[]
-      ),
-    });
-  }
- 
-  /**
-   * Gets all the stores didPairs
-   * @returns [Domain.DIDPair[]](https://input-output-hk.github.io/atala-prism-wallet-sdk-ts/classes/Domain.DIDPair.html)
-   */
-  async getAllDidPairs(): Promise<Domain.DIDPair[]> {
-    const { DID, DIDPair } = Domain;
-    const results = await this.db.didpairs.find()
-    return results.map(
-      ({ hostDID, receiverDID, name }) =>
-        new DIDPair(DID.fromString(hostDID), DID.fromString(receiverDID), name)
-    );
-  }
- 
-  /**
-   * Get a did pair (connection) by one of its dids
-   * @param did 
-   * @returns [Domain.DIDPair](https://input-output-hk.github.io/atala-prism-wallet-sdk-ts/classes/Domain.DIDPair.html)
-   */
-  async getPairByDID(did: Domain.DID): Promise<Domain.DIDPair | null> {
-    const { DID, DIDPair } = Domain;
-    const didPair = await this.db.didpairs
-      .findOne({
-        selector: {
-          $or: [
-            {
-              hostDID: did.toString(),
-            },
-            {
-              receiverDID: did.toString(),
-            },
-          ],
-        }
-      })
-    return didPair
-      ? new DIDPair(
-        DID.fromString(didPair.hostDID),
-        DID.fromString(didPair.receiverDID),
-        didPair.name
-      )
-      : null;
-  }
- 
-  async getPairByName(name: string): Promise<Domain.DIDPair | null> {
-    const { DID, DIDPair } = Domain;
-    const didPair = await this.db.didpairs
-      .findOne({
-        selector: {
-          $and: [
-            {
-              name,
-            },
-          ],
-        }
-      });
- 
-    return didPair
-      ? new DIDPair(
-        DID.fromString(didPair.hostDID),
-        DID.fromString(didPair.receiverDID),
-        didPair.name
-      )
-      : null;
-  }
- 
-  private getPrivateKeyFromDB(
-    privateKey: PrivateKeyDocument
-  ): Domain.PrivateKey {
-    return privateKey.toDomainPrivateKey();
-  }
- 
-  async getDIDPrivateKeysByDID(did: Domain.DID): Promise<Domain.PrivateKey[]> {
-    const privateKeys = await this.db.privatekeys
-      .find({
-        selector: {
-          did: {
-            $eq: did.toString()
-          }
-        }
-      })
-    return privateKeys.map(this.getPrivateKeyFromDB);
-  }
- 
-  async getDIDPrivateKeyByID(id: string): Promise<Domain.PrivateKey | null> {
-    const privateKey = await this.db.privatekeys.findOne({
-      selector: {
-        id: {
-          $eq: id
-        }
-      }
-    })
-    return privateKey ? this.getPrivateKeyFromDB(privateKey) : null;
-  }
- 
-  async storeMediator(
-    mediator: Domain.DID,
-    host: Domain.DID,
-    routing: Domain.DID
-  ): Promise<void> {
-    await this.db.mediators.insert({
-      id: uuidv4(),
-      mediatorDID: mediator.toString(),
-      hostDID: host.toString(),
-      routingDID: routing.toString(),
-    });
-  }
- 
-  async getAllPrismDIDs(): Promise<Domain.PrismDIDInfo[]> {
-    const dids = await this.db.dids.find({
-      selector: {
-        method: {
-          $eq: "prism"
-        }
-      }
-    });
- 
-    const prismDIDInfo: Domain.PrismDIDInfo[] = [];
- 
-    for (let did of dids) {
-      const didPrivateKeys = await this.getDIDPrivateKeysByDID(
-        Domain.DID.fromString(did.did)
-      );
- 
-      for (let privateKey of didPrivateKeys) {
-        const indexProp = privateKey.getProperty(Domain.KeyProperties.index)!;
- 
-        prismDIDInfo.push(
-          new Domain.PrismDIDInfo(
-            Domain.DID.fromString(did.did),
-            parseInt(indexProp),
-            did.alias
-          )
-        );
-      }
-    }
- 
-    return prismDIDInfo;
-  }
- 
-  async getDIDInfoByDID(did: Domain.DID): Promise<Domain.PrismDIDInfo | null> {
- 
-    const didDB = await this.db.dids
-      .findOne({
-        selector: {
-          did: did.toString()
-        }
-      });
- 
-    if (didDB) {
-      const privateKeys = await this.getDIDPrivateKeysByDID(
-        Domain.DID.fromString(didDB.did)
-      );
-      /* istanbul ignore if */
-      if (!privateKeys.length) {
-        throw new Error(
-          "Imposible to recover PrismDIDInfo without its privateKey data."
-        );
-      }
-      const indexProp = privateKeys
-        .at(0)!
-        .getProperty(Domain.KeyProperties.index);
-      const index = indexProp ? parseInt(indexProp) : undefined;
-      return new Domain.PrismDIDInfo(
-        Domain.DID.fromString(didDB.did),
-        index,
-        didDB.alias
-      );
-    }
- 
-    return null;
-  }
- 
-  async getDIDInfoByAlias(alias: string): Promise<Domain.PrismDIDInfo[]> {
-    const dids = await this.db.dids.find({
-      selector: {
-        alias: {
-          $eq: alias
-        }
-      }
-    });
-    const prismDIDInfo: Domain.PrismDIDInfo[] = [];
-    for (let did of dids) {
-      const didPrivateKeys = await this.getDIDPrivateKeysByDID(
-        Domain.DID.fromString(did.did)
-      );
-      for (let privateKey of didPrivateKeys) {
-        const indexProp = privateKey.getProperty(Domain.KeyProperties.index)!;
-        prismDIDInfo.push(
-          new Domain.PrismDIDInfo(
-            Domain.DID.fromString(did.did),
-            parseInt(indexProp),
-            did.alias
-          )
-        );
-      }
-    }
-    return prismDIDInfo;
-  }
- 
-  async getAllMessagesByDID(did: Domain.DID): Promise<Domain.Message[]> {
-    const messages = await this.db.messages
-      .find({
-        selector: {
-          $or: [
-            {
-              to: did.toString(),
-            },
-            {
-              from: did.toString(),
-            },
-          ],
-        }
-      })
- 
-    return messages.map((message) => message.toDomainMessage());
-  }
- 
-  async getAllMessagesSent(): Promise<Domain.Message[]> {
-    const messages = await this.db.messages
-      .find({
-        selector: {
-          $or: [
-            {
-              direction: Domain.MessageDirection.SENT,
-            },
-          ],
-        }
-      })
- 
-    return messages.map((message) => message.toDomainMessage());
-  }
- 
-  async getAllMessagesReceived(): Promise<Domain.Message[]> {
-    const messages = await this.db.messages
-      .find({
-        selector: {
-          $or: [
-            {
-              direction: Domain.MessageDirection.RECEIVED,
-            },
-          ],
-        }
-      })
- 
-    return messages.map((message) => message.toDomainMessage());
-  }
- 
-  async getAllMessagesSentTo(did: Domain.DID): Promise<Domain.Message[]> {
-    const messages = await this.db.messages
-      .find({
-        selector: {
-          $and: [
-            {
-              to: did.toString(),
-            },
-            {
-              direction: Domain.MessageDirection.SENT,
-            },
-          ],
-        }
-      })
-    return messages.map((message) => message.toDomainMessage());
-  }
- 
-  async getAllMessagesReceivedFrom(did: Domain.DID): Promise<Domain.Message[]> {
-    const messages = await this.db.messages
-      .find({
-        selector: {
-          $and: [
-            {
-              from: did.toString(),
-            },
-            {
-              direction: Domain.MessageDirection.RECEIVED,
-            },
-          ],
-        }
-      });
-    return messages.map((message) => message.toDomainMessage());
-  }
- 
-  async getAllMessagesOfType(
-    type: string,
-    relatedWithDID?: Domain.DID | undefined
-  ): Promise<Domain.Message[]> {
-    const query: MangoQuerySelector<MessageSchemaType>[] = [
-      {
-        piuri: type,
-      },
-    ];
-    if (relatedWithDID) {
-      query.push({
-        $or: [
-          {
-            from: relatedWithDID.toString(),
-          },
-          {
-            to: relatedWithDID.toString(),
-          },
-        ],
-      });
-    }
-    const messages = await this.db.messages
-      .find({
-        selector: {
-          $and: query,
-        }
-      })
- 
-    return messages.map((message) => message.toDomainMessage());
-  }
- 
-  async getAllMessagesByFromToDID(
-    from: Domain.DID,
-    to: Domain.DID
-  ): Promise<Domain.Message[]> {
-    const messages = await this.db.messages
-      .find({
-        selector: {
-          $or: [
-            {
-              from: from.toString(),
-            },
-            {
-              to: to.toString(),
-            },
-          ],
-        }
-      })
- 
-    return messages.map((message) => message.toDomainMessage());
-  }
- 
-  async getPrismDIDKeyPathIndex(did: Domain.DID): Promise<number | null> {
-    const [key] = await this.getDIDPrivateKeysByDID(did);
-    if (!key) {
-      return null;
-    }
-    return parseInt(key.index);
-  }
- 
-  async getPrismLastKeyPathIndex(): Promise<number> {
-    const results = await this.getAllPrismDIDs();
-    if (!results || results.length === 0) {
-      return 0;
-    }
-    return Math.max(...results.map((result) => result.keyPathIndex));
-  }
- 
-  async getAllPeerDIDs(): Promise<Domain.PeerDID[]> {
-    const peerDIDs: Domain.PeerDID[] = [];
-    const dids = await this.db.dids.find({
-      selector: {
-        method: {
-          $eq: 'peer'
-        }
-      }
-    });
-    for (let did of dids) {
-      const peerDID = Domain.DID.fromString(did.did);
-      const keys = await this.getDIDPrivateKeysByDID(peerDID);
-      peerDIDs.push(
-        new Domain.PeerDID(
-          peerDID,
-          keys.map((key) => ({
-            keyCurve: {
-              curve: key.curve as any,
-            },
-            value: key.raw,
-          }))
-        )
-      );
-    }
-    return peerDIDs;
-  }
- 
-  async storeCredential(credential: Domain.Credential): Promise<void> {
-    if (!credential.isStorable || !credential.isStorable()) {
-      throw new Error("Credential is not storable");
-    }
-    const storable = credential.toStorable();
-    if (!storable.id) storable.id = uuidv4();
- 
-    await this.db.credentials.insert(storable);
-  }
- 
-  async getAllMediators(): Promise<Domain.Mediator[]> {
-    const mediators = await this.db.mediators.find()
-    return mediators.map((mediator) => mediator.toDomainMediator());
-  }
- 
-  async getAllCredentials(): Promise<Domain.Credential[]> {
-    const credentials = await this.db.credentials.find()
-    return credentials.map(
-      (verifiableCredential) => verifiableCredential.toDomainCredential()
-    );
-  }
- 
-  async getLinkSecret(
-    linkSecretName?: string | undefined
-  ): Promise<string | null> {
-    const query = linkSecretName ?
-      {
-        selector: {
-          name: {
-            $eq: linkSecretName
-          }
-        }
-      } : {}
- 
-    const linkSecret = await this.db.linksecrets
-      .findOne(query);
- 
-    if (linkSecret) {
-      return linkSecret.toDomainLinkSecret();
-    }
- 
-    return null;
-  }
- 
-  async storeLinkSecret(
-    linkSecret: string,
-    linkSecretName: string
-  ): Promise<void> {
-    await this.db.linksecrets.insert({
-      name: linkSecretName,
-      secret: linkSecret,
-    });
-  }
- 
-  async storeCredentialMetadata(
-    metadata: Domain.Anoncreds.CredentialRequestMeta,
-    linkSecret: string
-  ): Promise<void> {
-    await this.db.credentialrequestmetadatas.insert({
-      ...metadata,
-      id: uuidv4(),
-      link_secret_name: linkSecret,
-    });
-  }
- 
-  async fetchCredentialMetadata(
-    linkSecretName: string
-  ): Promise<Domain.Anoncreds.CredentialRequestMeta | null> {
-    const credentialRequestMetadata = await this.db.credentialrequestmetadatas
-      .findOne({
-        selector: {
-          link_secret_name: {
-            $eq: linkSecretName
-          }
-        }
-      });
- 
-    if (credentialRequestMetadata) {
-      return credentialRequestMetadata.toDomainCredentialRequestMetadata();
-    }
-    return null;
-  }
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/packages/database/coverage/database/src/schemas/Credential.ts.html b/packages/database/coverage/database/src/schemas/Credential.ts.html deleted file mode 100644 index 52e515b4..00000000 --- a/packages/database/coverage/database/src/schemas/Credential.ts.html +++ /dev/null @@ -1,433 +0,0 @@ - - - - - - Code coverage report for database/src/schemas/Credential.ts - - - - - - - - - -
-
-

All files / database/src/schemas Credential.ts

-
- -
- 100% - Statements - 116/116 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 116/116 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -1171x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -9x -3x -3x -3x -9x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -3x -9x -1x -1x -1x -1x -1x -1x -1x -1x -1x - 
import {
-  AnonCredsCredential,
-  AnonCredsCredentialProperties,
-  AnonCredsRecoveryId,
-  Domain,
-  JWTCredential,
-  JWTVerifiableCredentialRecoveryId,
-} from "@atala/prism-wallet-sdk";
-import type { GenericORMType, Schema } from "../types";
-import { RxCollection, RxDocument } from "rxdb";
- 
-export type CredentialSubjectType = {
-  type: string;
-  name: string;
-  value: string;
-};
- 
-export type CredentialSchemaType = {
-  id: string;
-  recoveryId: string;
-  credentialData: string;
-  issuer?: string;
-  subject?: string;
-  credentialCreated?: string;
-  credentialUpdated?: string;
-  credentialSchema?: string;
-  validUntil?: string;
-  revoked?: boolean;
-  availableClaims?: string[];
-};
- 
-const CredentialSchema: Schema<CredentialSchemaType> = {
-  version: 0,
-  primaryKey: "id",
-  type: "object",
-  properties: {
-    id: {
-      type: "string",
-      maxLength: 60,
-    },
-    recoveryId: {
-      type: "string",
-    },
-    credentialData: {
-      type: "string",
-    },
-    issuer: {
-      type: "string",
-    },
-    subject: {
-      type: "string",
-    },
-    credentialCreated: {
-      type: "string",
-    },
-    credentialUpdated: {
-      type: "string",
-    },
-    credentialSchema: {
-      type: "string",
-    },
-    validUntil: {
-      type: "string",
-    },
-    revoked: {
-      type: "boolean",
-    },
-    availableClaims: {
-      type: "array",
-      items: {
-        type: "string",
-      },
-    },
-  },
-  encrypted: ["credentialData"],
-  required: ["id", "recoveryId", "credentialData"],
-};
- 
-export type CredentialDocument = RxDocument<CredentialSchemaType>;
-export type CredentialMethodTypes = {
-  toDomainCredential: (this: CredentialSchemaType) => Domain.Credential;
-};
- 
-export const CredentialMethods: CredentialMethodTypes = {
-  toDomainCredential: function toDomainCredential(this: CredentialSchemaType) {
-    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");
-    }
-  },
-};
- 
-export type CredentialCollection = RxCollection<
-  CredentialSchemaType,
-  CredentialMethodTypes,
-  GenericORMType<CredentialDocument>
->;
- 
-export default CredentialSchema;
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/packages/database/coverage/database/src/schemas/CredentialRequestMetadata.ts.html b/packages/database/coverage/database/src/schemas/CredentialRequestMetadata.ts.html deleted file mode 100644 index 0a11d41f..00000000 --- a/packages/database/coverage/database/src/schemas/CredentialRequestMetadata.ts.html +++ /dev/null @@ -1,322 +0,0 @@ - - - - - - Code coverage report for database/src/schemas/CredentialRequestMetadata.ts - - - - - - - - - -
-
-

All files / database/src/schemas CredentialRequestMetadata.ts

-
- -
- 100% - Statements - 79/79 -
- - -
- 100% - Branches - 1/1 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 79/79 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -801x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -3x -3x -3x -3x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x - 
import {
-  AnonCredsCredential,
-  AnonCredsCredentialProperties,
-  AnonCredsRecoveryId,
-  Domain,
-  JWTCredential,
-  JWTVerifiableCredentialRecoveryId,
-} from "@atala/prism-wallet-sdk";
-import type { GenericORMType, 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;
-};
- 
- 
-const CredentialRequestMetadataSchema: Schema<CredentialRequestMetadataSchemaType> =
-{
-  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<CredentialRequestMetadataSchemaType>;
- 
-export type CredentialRequestMetadataMethodTypes = {
-  toDomainCredentialRequestMetadata: (
-    this: CredentialRequestMetadataSchemaType
-  ) => Domain.Anoncreds.CredentialRequestMeta;
-};
- 
-export const CredentialRequestMetadataMethods: CredentialRequestMetadataMethodTypes =
-{
-  toDomainCredentialRequestMetadata:
-    function toDomainCredentialRequestMetadata(
-      this: CredentialRequestMetadataSchemaType
-    ) {
-      return this;
-    },
-};
- 
-/**
- * test content
- */
-export type CredentialRequestMetadataCollection = RxCollection<
-  CredentialRequestMetadataSchemaType,
-  CredentialRequestMetadataMethodTypes,
-  GenericORMType<CredentialRequestMetadataDocument>
->;
- 
-export default CredentialRequestMetadataSchema;
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/packages/database/coverage/database/src/schemas/DID.ts.html b/packages/database/coverage/database/src/schemas/DID.ts.html deleted file mode 100644 index e6854553..00000000 --- a/packages/database/coverage/database/src/schemas/DID.ts.html +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - Code coverage report for database/src/schemas/DID.ts - - - - - - - - - -
-
-

All files / database/src/schemas DID.ts

-
- -
- 100% - Statements - 45/45 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 45/45 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -461x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x - 
import { RxCollection, RxDocument } from "rxdb";
-import type { GenericORMType, Schema } from "../types";
- 
-export type DIDSchemaType = {
-  schema: string;
-  method: string;
-  methodId: string;
-  alias?: string;
-  did: string;
-};
- 
-const DIDSchema: Schema<DIDSchemaType> = {
-  version: 0,
-  primaryKey: "did",
-  type: "object",
-  properties: {
-    method: {
-      type: "string",
-      maxLength: 60,
-    },
-    methodId: {
-      type: "string",
-      maxLength: 60,
-    },
-    schema: {
-      type: "string",
-      maxLength: 60,
-    },
-    alias: {
-      type: "string",
-      maxLength: 60,
-    },
-    did: {
-      type: "string",
-      maxLength: 60,
-    },
-  },
-  encrypted: [],
-  required: ["method", "methodId", "did", "schema"],
-};
-export type DIDDocument = RxDocument<DIDSchemaType>;
- 
-export type DIDCollection = RxCollection<DIDSchemaType, any, GenericORMType<DIDDocument>>
- 
-export default DIDSchema;
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/packages/database/coverage/database/src/schemas/DIDPair.ts.html b/packages/database/coverage/database/src/schemas/DIDPair.ts.html deleted file mode 100644 index dc5185c2..00000000 --- a/packages/database/coverage/database/src/schemas/DIDPair.ts.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - Code coverage report for database/src/schemas/DIDPair.ts - - - - - - - - - -
-
-

All files / database/src/schemas DIDPair.ts

-
- -
- 100% - Statements - 33/33 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 33/33 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -341x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x - 
import { RxCollection, RxDocument } from "rxdb";
-import type { GenericORMType, Schema } from "../types";
- 
-export type DIDPairSchemaType = {
-  hostDID: string;
-  receiverDID: string;
-  name: string;
-};
- 
-const DIDPairSchema: Schema<DIDPairSchemaType> = {
-  version: 0,
-  primaryKey: "name",
-  type: "object",
-  properties: {
-    hostDID: {
-      type: "string",
-    },
-    name: {
-      type: "string",
-      maxLength: 60,
-    },
-    receiverDID: {
-      type: "string",
-    },
-  },
-  encrypted: [],
-  required: ["name", "hostDID", "receiverDID"],
-};
- 
-export type DIDPairDocument = RxDocument<DIDPairSchemaType>;
-export type DIDPairCollection = RxCollection<DIDPairSchemaType, any, GenericORMType<DIDPairDocument>>
- 
-export default DIDPairSchema;
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/packages/database/coverage/database/src/schemas/LinkSecret.ts.html b/packages/database/coverage/database/src/schemas/LinkSecret.ts.html deleted file mode 100644 index 20a29b71..00000000 --- a/packages/database/coverage/database/src/schemas/LinkSecret.ts.html +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - Code coverage report for database/src/schemas/LinkSecret.ts - - - - - - - - - -
-
-

All files / database/src/schemas LinkSecret.ts

-
- -
- 100% - Statements - 48/48 -
- - -
- 100% - Branches - 1/1 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 48/48 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -491x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -6x -6x -1x -1x - 
import { Domain } from "@atala/prism-wallet-sdk";
-import type { GenericORMType, Schema } from "../types";
-import { RxCollection, RxDocument } from "rxdb";
- 
-export type LinkSecretSchemaType = {
-  readonly name: string;
-  readonly secret: string;
-};
- 
- 
-const LinkSecretSchema: Schema<LinkSecretSchemaType> = {
-  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,
-  GenericORMType<LinkSecretDocument>
->;
- 
-export const LinkSecretMethods: LinkSecretMethodTypes = {
-  toDomainLinkSecret: function toDomainLinkSecret(this: LinkSecretDocument) {
-    return this.secret;
-  },
-};
-export default LinkSecretSchema;
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/packages/database/coverage/database/src/schemas/Mediator.ts.html b/packages/database/coverage/database/src/schemas/Mediator.ts.html deleted file mode 100644 index 9812d43e..00000000 --- a/packages/database/coverage/database/src/schemas/Mediator.ts.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - Code coverage report for database/src/schemas/Mediator.ts - - - - - - - - - -
-
-

All files / database/src/schemas Mediator.ts

-
- -
- 100% - Statements - 56/56 -
- - -
- 100% - Branches - 1/1 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 56/56 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -571x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -9x -9x -9x -9x -9x -9x -9x -1x -1x -1x - 
import { RxCollection, RxDocument, RxDocumentBase } from "rxdb";
-import type { GenericORMType, Schema } from "../types";
-import { Domain } from "@atala/prism-wallet-sdk";
- 
-export type MediatorSchemaType = {
-  id: string;
-  mediatorDID: string;
-  hostDID: string;
-  routingDID: string;
-};
- 
-const MediatorSchema: Schema<MediatorSchemaType> = {
-  version: 0,
-  primaryKey: "id",
-  type: "object",
-  properties: {
-    id: {
-      type: "string",
-      maxLength: 60,
-    },
-    mediatorDID: {
-      type: "string",
-    },
-    hostDID: {
-      type: "string",
-    },
-    routingDID: {
-      type: "string",
-    },
-  },
-  encrypted: [],
-  required: ["id", "mediatorDID"],
-};
- 
-export type MediatorDocument = RxDocument<MediatorSchemaType>;
-export type MediatorMethodTypes = {
-  toDomainMediator: (this: RxDocument<MediatorSchemaType, MediatorMethodTypes>) => Domain.Mediator;
-};
-export type MediatorCollection = RxCollection<
-  MediatorSchemaType,
-  MediatorMethodTypes,
-  GenericORMType<MediatorDocument>
->;
- 
-export const MediatorMethods: MediatorMethodTypes = {
-  toDomainMediator: function toDomainMediator(this: RxDocument<MediatorSchemaType, MediatorMethodTypes>) {
-    const mediator = this.toJSON()
-    return {
-      hostDID: Domain.DID.fromString(mediator.hostDID),
-      routingDID: Domain.DID.fromString(mediator.routingDID),
-      mediatorDID: Domain.DID.fromString(mediator.mediatorDID),
-    };
-  },
-};
- 
-export default MediatorSchema;
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/packages/database/coverage/database/src/schemas/Message.ts.html b/packages/database/coverage/database/src/schemas/Message.ts.html deleted file mode 100644 index b0e83c11..00000000 --- a/packages/database/coverage/database/src/schemas/Message.ts.html +++ /dev/null @@ -1,469 +0,0 @@ - - - - - - Code coverage report for database/src/schemas/Message.ts - - - - - - - - - -
-
-

All files / database/src/schemas Message.ts

-
- -
- 100% - Statements - 128/128 -
- - -
- 100% - Branches - 1/1 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 128/128 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -1291x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -39x -39x -1x -1x -1x - 
import { Domain } from "@atala/prism-wallet-sdk";
-import type { GenericORMType, Schema } from "../types";
-import { RxCollection, RxCollectionCreator, RxDocument } from "rxdb";
- 
-export type MessageSchemaType = {
-  readonly body: string;
-  readonly id: string;
-  readonly piuri: string;
-  readonly from?: string | undefined;
-  readonly to?: string | undefined;
-  readonly attachments: Domain.AttachmentDescriptor[];
-  readonly thid?: string;
-  readonly extraHeaders: string[];
-  readonly createdTime: string;
-  readonly expiresTimePlus: string;
-  readonly ack: string[];
-  readonly direction: Domain.MessageDirection;
-  readonly fromPrior?: string | undefined;
-  readonly pthid?: string | undefined;
-};
- 
- 
-const MessageSchema: Schema<MessageSchemaType> = {
-  version: 0,
-  primaryKey: "id",
-  type: "object",
-  properties: {
-    id: {
-      type: "string",
-      maxLength: 60,
-    },
-    body: {
-      type: "string",
-    },
-    piuri: {
-      type: "string",
-    },
-    attachments: {
-      type: "array",
-      items: {
-        type: "object",
-        properties: {
-          id: {
-            type: "id",
-            maxLength: 60,
-          },
-          description: {
-            type: "string",
-          },
-          byteCount: {
-            type: "number",
-          },
-          lastModTime: {
-            type: "string",
-          },
-          format: {
-            type: "string",
-          },
-          filename: {
-            type: "array",
-            items: {
-              type: "string",
-            },
-          },
-          mediaType: {
-            type: "string",
-          },
-          data: {
-            type: "object",
-          },
-        },
-      },
-    },
-    extraHeaders: {
-      type: "array",
-    },
-    createdTime: {
-      type: "string",
-    },
-    expiresTimePlus: {
-      type: "string",
-    },
-    ack: {
-      type: "array",
-    },
-    direction: {
-      type: "number",
-    },
-    from: {
-      type: "string",
-    },
-    to: {
-      type: "string",
-    },
-    thid: {
-      type: "string",
-    },
-    fromPrior: {
-      type: "string",
-    },
-    pthid: {
-      type: "string",
-    },
-  },
-  encrypted: ["thid", "attachments", "body"],
-  required: ["id"],
-};
-export type MessageDocument = RxDocument<MessageSchemaType, MessageMethodTypes>;
- 
-export type MessageMethodTypes = {
-  toDomainMessage: (this: MessageDocument) => Domain.Message;
-};
- 
-export type MessageColletion = RxCollection<
-  MessageSchemaType,
-  MessageMethodTypes,
-  GenericORMType<MessageDocument>
->;
- 
- 
- 
-export const MessageMethods: MessageMethodTypes = {
-  toDomainMessage: function toDomainMessage(this: MessageDocument) {
-    return Domain.Message.fromJson(JSON.stringify(this));
-  },
-};
- 
-export default MessageSchema;
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/packages/database/coverage/database/src/schemas/PrivateKey.ts.html b/packages/database/coverage/database/src/schemas/PrivateKey.ts.html deleted file mode 100644 index d8e67601..00000000 --- a/packages/database/coverage/database/src/schemas/PrivateKey.ts.html +++ /dev/null @@ -1,604 +0,0 @@ - - - - - - Code coverage report for database/src/schemas/PrivateKey.ts - - - - - - - - - -
-
-

All files / database/src/schemas PrivateKey.ts

-
- -
- 98.26% - Statements - 170/173 -
- - -
- 95.65% - Branches - 22/23 -
- - -
- 100% - Functions - 1/1 -
- - -
- 98.26% - Lines - 170/173 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -1741x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -72x -72x -72x -72x -72x -72x -72x -72x -6x -6x -72x -3x -3x -63x -63x -63x -27x -12x -72x -3x -3x -60x -72x -3x -3x -57x -57x -72x -36x -36x -36x -36x -36x -36x -36x -36x -36x -36x -36x -36x -36x -36x -36x -36x -36x -36x -36x -33x -33x -33x -33x -33x -36x -36x -3x -3x -3x -3x -3x -36x -36x -36x -21x -21x -72x -12x -12x -12x -12x -12x -12x -12x -12x -12x -12x -12x -9x -9x -9x -9x -9x -9x -9x -9x -9x -9x -9x -9x -9x -9x -9x -  -  -  -72x -1x -1x -1x - 
import {
-  Ed25519PrivateKey,
-  KeyProperties,
-  Secp256k1PrivateKey,
-  X25519PrivateKey,
-  Domain,
-} from "@atala/prism-wallet-sdk";
-import type { GenericORMType, Schema } from "../types";
-import { RxCollection, RxDocument } from "rxdb";
- 
-export type KeySpec = {
-  name: string;
-  type: string;
-  value: string;
-};
- 
-export type KeySchemaType = {
-  id: string;
-  type: string;
-  did: string;
-  keySpecification: KeySpec[];
-};
- 
-const PrivateKeySchema: Schema<KeySchemaType> = {
-  version: 0,
-  primaryKey: "id",
-  type: "object",
-  properties: {
-    id: {
-      type: "string",
-      maxLength: 60,
-    },
-    did: {
-      type: "string",
-    },
-    type: {
-      type: "string",
-    },
-    keySpecification: {
-      type: "array",
-      items: {
-        type: "object",
-        properties: {
-          name: {
-            type: "string",
-          },
-          type: {
-            type: "string",
-          },
-          value: {
-            type: "string",
-          },
-        },
-      },
-    },
-  },
-  encrypted: ["keySpecification", "type"],
-  required: ["keySpecification", "did", "type", "id"],
-};
- 
-export type PrivateKeyMethodTypes = {
-  toDomainPrivateKey: (this: PrivateKeyDocument) => Domain.PrivateKey;
-};
-export type PrivateKeyColletion = RxCollection<
-  KeySchemaType,
-  PrivateKeyMethodTypes,
-  GenericORMType<PrivateKeyDocument>
->;
-export type PrivateKeyDocument = RxDocument<
-  KeySchemaType,
-  PrivateKeyMethodTypes
->;
- 
-export const PrivateKeyMethods: PrivateKeyMethodTypes = {
-  toDomainPrivateKey: function toDomainPrivateKey(this: PrivateKeyDocument) {
-    const { type, keySpecification } = this;
-    const curve = keySpecification.find(
-      (item) => item.name === KeyProperties.curve
-    );
-    const raw = keySpecification.find(
-      (item) => item.name === KeyProperties.rawKey
-    );
-    if (!(type in Domain.KeyTypes)) {
-      throw new Error(`Invalid KeyType ${type || "undefined"}`);
-    }
-    if (!curve) {
-      throw new Error("Undefined key curve");
-    }
- 
-    if (
-      curve.value !== Domain.Curve.SECP256K1 &&
-      curve.value !== Domain.Curve.ED25519 &&
-      curve.value !== Domain.Curve.X25519
-    ) {
-      throw new Error(`Invalid key curve ${curve.value}`);
-    }
- 
-    if (!raw) {
-      throw new Error("Undefined key raw");
-    }
- 
-    /* istanbul ignore else */
-    if (curve.value === Domain.Curve.SECP256K1) {
-      const index = keySpecification.find(
-        (item) => item.name === KeyProperties.index
-      );
-      const seed = keySpecification.find(
-        (item) => item.name === KeyProperties.seed
-      );
- 
-      const privateKey = new Secp256k1PrivateKey(
-        Buffer.from(raw.value, "hex")
-      );
- 
-      privateKey.keySpecification.set(Domain.KeyProperties.rawKey, raw.value);
- 
-      privateKey.keySpecification.set(
-        Domain.KeyProperties.curve,
-        Domain.Curve.SECP256K1
-      );
- 
-      if (index) {
-        privateKey.keySpecification.set(
-          Domain.KeyProperties.index,
-          index.value
-        );
-      }
- 
-      if (seed) {
-        privateKey.keySpecification.set(
-          Domain.KeyProperties.seed,
-          seed.value
-        );
-      }
- 
-      return privateKey;
-    }
- 
-    /* istanbul ignore else */
-    if (curve.value === Domain.Curve.ED25519) {
-      const privateKey = new Ed25519PrivateKey(Buffer.from(raw.value, "hex"));
- 
-      privateKey.keySpecification.set(Domain.KeyProperties.rawKey, raw.value);
- 
-      privateKey.keySpecification.set(
-        Domain.KeyProperties.curve,
-        Domain.Curve.ED25519
-      );
- 
-      return privateKey;
-    }
- 
- 
-    /* istanbul ignore else */
-    if (curve.value === Domain.Curve.X25519) {
-      const privateKey = new X25519PrivateKey(Buffer.from(raw.value, "hex"));
- 
-      privateKey.keySpecification.set(Domain.KeyProperties.rawKey, raw.value);
- 
-      privateKey.keySpecification.set(
-        Domain.KeyProperties.curve,
-        Domain.Curve.X25519
-      );
- 
-      return privateKey;
-    }
-
-    /* istanbul ignore next */
-    throw new Error(`Invalid key ${curve.value} ${type}`);
-  },
-};
- 
-export default PrivateKeySchema;
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/packages/database/coverage/database/src/schemas/index.html b/packages/database/coverage/database/src/schemas/index.html deleted file mode 100644 index 448060c8..00000000 --- a/packages/database/coverage/database/src/schemas/index.html +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - Code coverage report for database/src/schemas - - - - - - - - - -
-
-

All files database/src/schemas

-
- -
- 99.55% - Statements - 675/678 -
- - -
- 96.77% - Branches - 30/31 -
- - -
- 100% - Functions - 6/6 -
- - -
- 99.55% - Lines - 675/678 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Credential.ts -
-
100%116/116100%4/4100%1/1100%116/116
CredentialRequestMetadata.ts -
-
100%79/79100%1/1100%1/1100%79/79
DID.ts -
-
100%45/45100%0/0100%0/0100%45/45
DIDPair.ts -
-
100%33/33100%0/0100%0/0100%33/33
LinkSecret.ts -
-
100%48/48100%1/1100%1/1100%48/48
Mediator.ts -
-
100%56/56100%1/1100%1/1100%56/56
Message.ts -
-
100%128/128100%1/1100%1/1100%128/128
PrivateKey.ts -
-
98.26%170/17395.65%22/23100%1/198.26%170/173
-
-
-
- - - - - - - - \ No newline at end of file diff --git a/packages/database/coverage/database/src/types.ts.html b/packages/database/coverage/database/src/types.ts.html deleted file mode 100644 index 0af59cd5..00000000 --- a/packages/database/coverage/database/src/types.ts.html +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - Code coverage report for database/src/types.ts - - - - - - - - - -
-
-

All files / database/src types.ts

-
- -
- 0% - Statements - 0/45 -
- - -
- 0% - Branches - 0/1 -
- - -
- 0% - Functions - 0/1 -
- - -
- 0% - Lines - 0/45 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import { KeyFunctionMap, RxCollectionBase, RxJsonSchema, RxQuery, RxStorageInstanceCreationParams } from "rxdb";
-import { MangoQuery, MangoQueryNoLimit, MangoQuerySelectorAndIndex, RxCollection, RxDocument, RxDumpDatabase, RxStorage } from "rxdb/dist/types/types";
-import { CredentialCollection } from "./schemas/Credential";
-import { CredentialRequestMetadataCollection } from "./schemas/CredentialRequestMetadata";
-import { DIDCollection } from "./schemas/DID";
-import { DIDPairCollection } from "./schemas/DIDPair";
-import { LinkSecretColletion } from "./schemas/LinkSecret";
-import { MediatorCollection } from "./schemas/Mediator";
-import { MessageColletion } from "./schemas/Message";
-import { PrivateKeyColletion } from "./schemas/PrivateKey";
-
-
-export type NoKeys<T, K extends keyof T> = {
-    [P in Exclude<keyof T, K>]: T[P];
-};
-
-export type Schema<T> = RxJsonSchema<T> & {
-    encrypted: (keyof T)[];
-};
-
-export interface GenericORMType<RxDocType> extends RxCollection<any, any, any> {
-    count: (this: RxCollection<any, any, any>, query: MangoQuery<any> | undefined) => Promise<number>,
-    findByIds(this: RxCollection<any, any, any>, ids: string[]): Map<string, RxDocument>;
-    find(queryObj?: MangoQueryNoLimit<any> | string): RxDocument<RxDocType, any>[];
-    findOne(queryObj?: MangoQueryNoLimit<any> | string): RxDocument<RxDocType, any> | null;
-    remove(queryObj?: MangoQueryNoLimit<any> | string): RxDocument<RxDocType, any>[]
-}
-
-export type PlutoCollections = {
-    messages: MessageColletion;
-    dids: DIDCollection;
-    didpairs: DIDPairCollection;
-    mediators: MediatorCollection;
-    privatekeys: PrivateKeyColletion;
-    credentials: CredentialCollection;
-    credentialrequestmetadatas: CredentialRequestMetadataCollection;
-    linksecrets: LinkSecretColletion;
-};
-
-export type createEncryptedOptions = {
-    name: string,
-    encryptionKey: Uint8Array,
-    importData?: RxDumpDatabase<PlutoCollections>,
-    storage: RxStorage<any, any>
-}
- -
-
- - - - - - - - \ No newline at end of file diff --git a/packages/database/coverage/database/index.html b/packages/database/coverage/rollup/index.html similarity index 89% rename from packages/database/coverage/database/index.html rename to packages/database/coverage/rollup/index.html index 4fa7be47..6e651481 100644 --- a/packages/database/coverage/database/index.html +++ b/packages/database/coverage/rollup/index.html @@ -3,7 +3,7 @@ - Code coverage report for database + Code coverage report for rollup @@ -19,13 +19,13 @@
-

All files database

+

All files rollup

0% Statements - 0/25 + 0/5
@@ -46,7 +46,7 @@

All files database

0% Lines - 0/25 + 0/5
@@ -79,18 +79,18 @@

All files database

- release.config.mjs + rollup.mjs
0% - 0/25 + 0/5 0% 0/1 0% 0/1 0% - 0/25 + 0/5 @@ -101,7 +101,7 @@

All files database

+ - - + + \ No newline at end of file