diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 934b1b41..d821af46 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -65,11 +65,19 @@ jobs: - name: Setup Pages uses: actions/configure-pages@v4 + + - name: Deploy html docs + env: + GH_TOKEN: ${{ secrets.PLUTO_GITHUB }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + npm run docs-html + - name: Upload artifact uses: actions/upload-pages-artifact@v2 with: - # Upload entire repository - path: './packages/database/coverage' + path: './docs-html' + - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v3 \ No newline at end of file diff --git a/.gitignore b/.gitignore index c60c5bdc..1f8d887c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ build .npmrc prism-db *.tgz +docs-html diff --git a/README.md b/README.md index ba9557f3..62632dd8 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-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) | +| ![Statements](https://img.shields.io/badge/statements-92.45%25-brightgreen.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-91.44%25-brightgreen.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-83.87%25-yellow.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-92.45%25-brightgreen.svg?style=flat) | ### Documentation diff --git a/docs/classes/Database.md b/docs/classes/Database.md index 318a7ab2..8d34c353 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/96fb8d7/packages/database/src/index.ts#L99) +[index.ts:99](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L133) +[index.ts:133](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L229) +[index.ts:229](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L197) +[index.ts:197](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L293) +[index.ts:293](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L165) +[index.ts:165](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L261) +[index.ts:261](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L357) +[index.ts:357](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L325) +[index.ts:325](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L101) +[index.ts:101](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L365) +[index.ts:365](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L1187) +[index.ts:1187](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L1137) +[index.ts:1137](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L751) +[index.ts:751](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L1132) +[index.ts:1132](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L469) +[index.ts:469](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L945) +[index.ts:945](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L1058) +[index.ts:1058](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L1027) +[index.ts:1027](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L978) +[index.ts:978](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L1010) +[index.ts:1010](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L963) +[index.ts:963](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L993) +[index.ts:993](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L1095) +[index.ts:1095](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L853) +[index.ts:853](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L918) +[index.ts:918](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L885) +[index.ts:885](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L829) +[index.ts:829](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L817) +[index.ts:817](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L1144) +[index.ts:1144](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L411) +[index.ts:411](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L765) +[index.ts:765](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L789) +[index.ts:789](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L1079) +[index.ts:1079](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L1087) +[index.ts:1087](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L481) +[index.ts:481](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L1122) +[index.ts:1122](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L1176) +[index.ts:1176](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L693) +[index.ts:693](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L1166) +[index.ts:1166](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L840) +[index.ts:840](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L430) +[index.ts:430](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L459) +[index.ts:459](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L651) +[index.ts:651](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L624) +[index.ts:624](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/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/96fb8d7/packages/database/src/index.ts#L712) +[index.ts:712](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/packages/database/src/index.ts#L712) ___ @@ -1299,4 +1299,4 @@ Database #### Defined in -[index.ts:378](https://github.com/elribonazo/pluto-encrypted/blob/96fb8d7/packages/database/src/index.ts#L378) +[index.ts:378](https://github.com/elribonazo/pluto-encrypted/blob/7f66dfa/packages/database/src/index.ts#L378) diff --git a/package-lock.json b/package-lock.json index 878840b8..6cdca079 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "devDependencies": { "@babel/preset-env": "^7.22.20", "@babel/preset-typescript": "^7.22.15", + "@bndynet/typedoc-theme": "^0.0.1", "@rollup/plugin-commonjs": "^25.0.0", "@rollup/plugin-inject": "^5.0.3", "@rollup/plugin-json": "^6.0.0", @@ -1930,6 +1931,18 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "node_modules/@bndynet/typedoc-theme": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@bndynet/typedoc-theme/-/typedoc-theme-0.0.1.tgz", + "integrity": "sha512-8krJC83rXALS9Awt5j2OMbUMEQX41WbVmBHYbllW4RrNLiG3ei/iw87b6KPvK6/fq8h7BNwIumd9fzhX8/XBAQ==", + "dev": true, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "typedoc": "^0.24.1" + } + }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -26263,7 +26276,7 @@ }, "packages/database": { "name": "@pluto-encrypted/database", - "version": "1.0.7", + "version": "1.0.9", "license": "Apache-2.0", "dependencies": { "rxdb": "^14.17.0", @@ -26287,7 +26300,7 @@ }, "packages/indexdb": { "name": "@pluto-encrypted/indexdb", - "version": "1.0.2", + "version": "1.0.4", "license": "Apache-2.0", "dependencies": { "rxdb": "^14.17.0", @@ -26296,7 +26309,7 @@ }, "packages/inmemory": { "name": "@pluto-encrypted/inmemory", - "version": "1.0.2", + "version": "1.0.4", "license": "Apache-2.0", "dependencies": { "rxdb": "^14.17.0", @@ -26305,7 +26318,7 @@ }, "packages/leveldb": { "name": "@pluto-encrypted/leveldb", - "version": "1.0.2", + "version": "1.0.4", "license": "Apache-2.0", "dependencies": { "level": "^6.0.1", diff --git a/package.json b/package.json index 191bf613..682527a6 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "coverage": "npx lerna run --stream coverage", "test": "npx lerna run --stream test", "docs": "npx lerna run --stream docs", + "docs-html": "npx lerna run --stream docs-html", "release": "npx lerna exec --concurrency 1 -- semantic-release -e semantic-release-monorepo --tag-format='${LERNA_PACKAGE_NAME}-v\\${version}'" }, "author": "elribonazo@gmail.com", @@ -18,6 +19,7 @@ "devDependencies": { "@babel/preset-env": "^7.22.20", "@babel/preset-typescript": "^7.22.15", + "@bndynet/typedoc-theme": "^0.0.1", "@rollup/plugin-commonjs": "^25.0.0", "@rollup/plugin-inject": "^5.0.3", "@rollup/plugin-json": "^6.0.0", diff --git a/packages/database/.gitignore b/packages/database/.gitignore index c294ec98..6e68e506 100644 --- a/packages/database/.gitignore +++ b/packages/database/.gitignore @@ -2,4 +2,5 @@ node_modules junit.xml lcov.info build -.npmrc \ No newline at end of file +.npmrc +coverage/*.json \ No newline at end of file diff --git a/packages/database/coverage/base.css b/packages/database/coverage/base.css deleted file mode 100644 index f418035b..00000000 --- a/packages/database/coverage/base.css +++ /dev/null @@ -1,224 +0,0 @@ -body, html { - margin:0; padding: 0; - height: 100%; -} -body { - font-family: Helvetica Neue, Helvetica, Arial; - font-size: 14px; - color:#333; -} -.small { font-size: 12px; } -*, *:after, *:before { - -webkit-box-sizing:border-box; - -moz-box-sizing:border-box; - box-sizing:border-box; - } -h1 { font-size: 20px; margin: 0;} -h2 { font-size: 14px; } -pre { - font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; - margin: 0; - padding: 0; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; -} -a { color:#0074D9; text-decoration:none; } -a:hover { text-decoration:underline; } -.strong { font-weight: bold; } -.space-top1 { padding: 10px 0 0 0; } -.pad2y { padding: 20px 0; } -.pad1y { padding: 10px 0; } -.pad2x { padding: 0 20px; } -.pad2 { padding: 20px; } -.pad1 { padding: 10px; } -.space-left2 { padding-left:55px; } -.space-right2 { padding-right:20px; } -.center { text-align:center; } -.clearfix { display:block; } -.clearfix:after { - content:''; - display:block; - height:0; - clear:both; - visibility:hidden; - } -.fl { float: left; } -@media only screen and (max-width:640px) { - .col3 { width:100%; max-width:100%; } - .hide-mobile { display:none!important; } -} - -.quiet { - color: #7f7f7f; - color: rgba(0,0,0,0.5); -} -.quiet a { opacity: 0.7; } - -.fraction { - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; - font-size: 10px; - color: #555; - background: #E8E8E8; - padding: 4px 5px; - border-radius: 3px; - vertical-align: middle; -} - -div.path a:link, div.path a:visited { color: #333; } -table.coverage { - border-collapse: collapse; - margin: 10px 0 0 0; - padding: 0; -} - -table.coverage td { - margin: 0; - padding: 0; - vertical-align: top; -} -table.coverage td.line-count { - text-align: right; - padding: 0 5px 0 20px; -} -table.coverage td.line-coverage { - text-align: right; - padding-right: 10px; - min-width:20px; -} - -table.coverage td span.cline-any { - display: inline-block; - padding: 0 5px; - width: 100%; -} -.missing-if-branch { - display: inline-block; - margin-right: 5px; - border-radius: 3px; - position: relative; - padding: 0 4px; - background: #333; - color: yellow; -} - -.skip-if-branch { - display: none; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: #ccc; - color: white; -} -.missing-if-branch .typ, .skip-if-branch .typ { - color: inherit !important; -} -.coverage-summary { - border-collapse: collapse; - width: 100%; -} -.coverage-summary tr { border-bottom: 1px solid #bbb; } -.keyline-all { border: 1px solid #ddd; } -.coverage-summary td, .coverage-summary th { padding: 10px; } -.coverage-summary tbody { border: 1px solid #bbb; } -.coverage-summary td { border-right: 1px solid #bbb; } -.coverage-summary td:last-child { border-right: none; } -.coverage-summary th { - text-align: left; - font-weight: normal; - white-space: nowrap; -} -.coverage-summary th.file { border-right: none !important; } -.coverage-summary th.pct { } -.coverage-summary th.pic, -.coverage-summary th.abs, -.coverage-summary td.pct, -.coverage-summary td.abs { text-align: right; } -.coverage-summary td.file { white-space: nowrap; } -.coverage-summary td.pic { min-width: 120px !important; } -.coverage-summary tfoot td { } - -.coverage-summary .sorter { - height: 10px; - width: 7px; - display: inline-block; - margin-left: 0.5em; - background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; -} -.coverage-summary .sorted .sorter { - background-position: 0 -20px; -} -.coverage-summary .sorted-desc .sorter { - background-position: 0 -10px; -} -.status-line { height: 10px; } -/* yellow */ -.cbranch-no { background: yellow !important; color: #111; } -/* dark red */ -.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } -.low .chart { border:1px solid #C21F39 } -.highlighted, -.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{ - background: #C21F39 !important; -} -/* medium red */ -.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } -/* light red */ -.low, .cline-no { background:#FCE1E5 } -/* light green */ -.high, .cline-yes { background:rgb(230,245,208) } -/* medium green */ -.cstat-yes { background:rgb(161,215,106) } -/* dark green */ -.status-line.high, .high .cover-fill { background:rgb(77,146,33) } -.high .chart { border:1px solid rgb(77,146,33) } -/* dark yellow (gold) */ -.status-line.medium, .medium .cover-fill { background: #f9cd0b; } -.medium .chart { border:1px solid #f9cd0b; } -/* light yellow */ -.medium { background: #fff4c2; } - -.cstat-skip { background: #ddd; color: #111; } -.fstat-skip { background: #ddd; color: #111 !important; } -.cbranch-skip { background: #ddd !important; color: #111; } - -span.cline-neutral { background: #eaeaea; } - -.coverage-summary td.empty { - opacity: .5; - padding-top: 4px; - padding-bottom: 4px; - line-height: 1; - color: #888; -} - -.cover-fill, .cover-empty { - display:inline-block; - height: 12px; -} -.chart { - line-height: 0; -} -.cover-empty { - background: white; -} -.cover-full { - border-right: none !important; -} -pre.prettyprint { - border: none !important; - padding: 0 !important; - margin: 0 !important; -} -.com { color: #999 !important; } -.ignore-none { color: #999; font-weight: normal; } - -.wrapper { - min-height: 100%; - height: auto !important; - height: 100%; - margin: 0 auto -48px; -} -.footer, .push { - height: 48px; -} diff --git a/packages/database/coverage/block-navigation.js b/packages/database/coverage/block-navigation.js deleted file mode 100644 index cc121302..00000000 --- a/packages/database/coverage/block-navigation.js +++ /dev/null @@ -1,87 +0,0 @@ -/* eslint-disable */ -var jumpToCode = (function init() { - // Classes of code we would like to highlight in the file view - var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no']; - - // Elements to highlight in the file listing view - var fileListingElements = ['td.pct.low']; - - // We don't want to select elements that are direct descendants of another match - var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > ` - - // Selecter that finds elements on the page to which we can jump - var selector = - fileListingElements.join(', ') + - ', ' + - notSelector + - missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b` - - // The NodeList of matching elements - var missingCoverageElements = document.querySelectorAll(selector); - - var currentIndex; - - function toggleClass(index) { - missingCoverageElements - .item(currentIndex) - .classList.remove('highlighted'); - missingCoverageElements.item(index).classList.add('highlighted'); - } - - function makeCurrent(index) { - toggleClass(index); - currentIndex = index; - missingCoverageElements.item(index).scrollIntoView({ - behavior: 'smooth', - block: 'center', - inline: 'center' - }); - } - - function goToPrevious() { - var nextIndex = 0; - if (typeof currentIndex !== 'number' || currentIndex === 0) { - nextIndex = missingCoverageElements.length - 1; - } else if (missingCoverageElements.length > 1) { - nextIndex = currentIndex - 1; - } - - makeCurrent(nextIndex); - } - - function goToNext() { - var nextIndex = 0; - - if ( - typeof currentIndex === 'number' && - currentIndex < missingCoverageElements.length - 1 - ) { - nextIndex = currentIndex + 1; - } - - makeCurrent(nextIndex); - } - - return function jump(event) { - if ( - document.getElementById('fileSearch') === document.activeElement && - document.activeElement != null - ) { - // if we're currently focused on the search input, we don't want to navigate - return; - } - - switch (event.which) { - case 78: // n - case 74: // j - goToNext(); - break; - case 66: // b - case 75: // k - case 80: // p - goToPrevious(); - break; - } - }; -})(); -window.addEventListener('keydown', jumpToCode); diff --git a/packages/database/coverage/coverage-summary.json b/packages/database/coverage/coverage-summary.json deleted file mode 100644 index 2d2bb4f7..00000000 --- a/packages/database/coverage/coverage-summary.json +++ /dev/null @@ -1,13 +0,0 @@ -{"total": {"lines":{"total":1932,"covered":1851,"skipped":0,"pct":95.8},"statements":{"total":1932,"covered":1851,"skipped":0,"pct":95.8},"functions":{"total":60,"covered":52,"skipped":0,"pct":86.66},"branches":{"total":150,"covered":139,"skipped":0,"pct":92.66},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}} -,"/home/runner/work/pluto-encrypted/pluto-encrypted/packages/database/rollup/rollup.mjs": {"lines":{"total":5,"covered":0,"skipped":0,"pct":0},"functions":{"total":1,"covered":0,"skipped":0,"pct":0},"statements":{"total":5,"covered":0,"skipped":0,"pct":0},"branches":{"total":1,"covered":0,"skipped":0,"pct":0}} -,"/home/runner/work/pluto-encrypted/pluto-encrypted/packages/database/src/index.ts": {"lines":{"total":1204,"covered":1176,"skipped":0,"pct":97.67},"functions":{"total":52,"covered":46,"skipped":0,"pct":88.46},"statements":{"total":1204,"covered":1176,"skipped":0,"pct":97.67},"branches":{"total":117,"covered":109,"skipped":0,"pct":93.16}} -,"/home/runner/work/pluto-encrypted/pluto-encrypted/packages/database/src/types.ts": {"lines":{"total":45,"covered":0,"skipped":0,"pct":0},"functions":{"total":1,"covered":0,"skipped":0,"pct":0},"statements":{"total":45,"covered":0,"skipped":0,"pct":0},"branches":{"total":1,"covered":0,"skipped":0,"pct":0}} -,"/home/runner/work/pluto-encrypted/pluto-encrypted/packages/database/src/schemas/Credential.ts": {"lines":{"total":116,"covered":116,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":116,"covered":116,"skipped":0,"pct":100},"branches":{"total":4,"covered":4,"skipped":0,"pct":100}} -,"/home/runner/work/pluto-encrypted/pluto-encrypted/packages/database/src/schemas/CredentialRequestMetadata.ts": {"lines":{"total":79,"covered":79,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":79,"covered":79,"skipped":0,"pct":100},"branches":{"total":1,"covered":1,"skipped":0,"pct":100}} -,"/home/runner/work/pluto-encrypted/pluto-encrypted/packages/database/src/schemas/DID.ts": {"lines":{"total":45,"covered":45,"skipped":0,"pct":100},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":45,"covered":45,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} -,"/home/runner/work/pluto-encrypted/pluto-encrypted/packages/database/src/schemas/DIDPair.ts": {"lines":{"total":33,"covered":33,"skipped":0,"pct":100},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":33,"covered":33,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} -,"/home/runner/work/pluto-encrypted/pluto-encrypted/packages/database/src/schemas/LinkSecret.ts": {"lines":{"total":48,"covered":48,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":48,"covered":48,"skipped":0,"pct":100},"branches":{"total":1,"covered":1,"skipped":0,"pct":100}} -,"/home/runner/work/pluto-encrypted/pluto-encrypted/packages/database/src/schemas/Mediator.ts": {"lines":{"total":56,"covered":56,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":56,"covered":56,"skipped":0,"pct":100},"branches":{"total":1,"covered":1,"skipped":0,"pct":100}} -,"/home/runner/work/pluto-encrypted/pluto-encrypted/packages/database/src/schemas/Message.ts": {"lines":{"total":128,"covered":128,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":128,"covered":128,"skipped":0,"pct":100},"branches":{"total":1,"covered":1,"skipped":0,"pct":100}} -,"/home/runner/work/pluto-encrypted/pluto-encrypted/packages/database/src/schemas/PrivateKey.ts": {"lines":{"total":173,"covered":170,"skipped":0,"pct":98.26},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":173,"covered":170,"skipped":0,"pct":98.26},"branches":{"total":23,"covered":22,"skipped":0,"pct":95.65}} -} diff --git a/packages/database/coverage/favicon.png b/packages/database/coverage/favicon.png deleted file mode 100644 index c1525b81..00000000 Binary files a/packages/database/coverage/favicon.png and /dev/null differ diff --git a/packages/database/coverage/index.html b/packages/database/coverage/index.html deleted file mode 100644 index 736f14f3..00000000 --- a/packages/database/coverage/index.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - Code coverage report for All files - - - - - - - - - -
-
-

All files

-
- -
- 95.8% - Statements - 1851/1932 -
- - -
- 92.66% - Branches - 139/150 -
- - -
- 86.66% - Functions - 52/60 -
- - -
- 95.8% - Lines - 1851/1932 -
- - -
-

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

- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
rollup -
-
0%0/50%0/10%0/10%0/5
src -
-
94.15%1176/124992.37%109/11886.79%46/5394.15%1176/1249
src/schemas -
-
99.55%675/67896.77%30/31100%6/699.55%675/678
-
-
-
- - - - - - - - \ No newline at end of file diff --git a/packages/database/coverage/prettify.css b/packages/database/coverage/prettify.css deleted file mode 100644 index b317a7cd..00000000 --- a/packages/database/coverage/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/packages/database/coverage/prettify.js b/packages/database/coverage/prettify.js deleted file mode 100644 index b3225238..00000000 --- a/packages/database/coverage/prettify.js +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/packages/database/coverage/rollup/index.html b/packages/database/coverage/rollup/index.html deleted file mode 100644 index a1a2347f..00000000 --- a/packages/database/coverage/rollup/index.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - Code coverage report for rollup - - - - - - - - - -
-
-

All files 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/rollup/rollup.mjs.html b/packages/database/coverage/rollup/rollup.mjs.html deleted file mode 100644 index 32419732..00000000 --- a/packages/database/coverage/rollup/rollup.mjs.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - Code coverage report for rollup/rollup.mjs - - - - - - - - - -
-
-

All files / 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/sort-arrow-sprite.png b/packages/database/coverage/sort-arrow-sprite.png deleted file mode 100644 index 6ed68316..00000000 Binary files a/packages/database/coverage/sort-arrow-sprite.png and /dev/null differ diff --git a/packages/database/coverage/sorter.js b/packages/database/coverage/sorter.js deleted file mode 100644 index 2bb296a8..00000000 --- a/packages/database/coverage/sorter.js +++ /dev/null @@ -1,196 +0,0 @@ -/* eslint-disable */ -var addSorting = (function() { - 'use strict'; - var cols, - currentSort = { - index: 0, - desc: false - }; - - // returns the summary table element - function getTable() { - return document.querySelector('.coverage-summary'); - } - // returns the thead element of the summary table - function getTableHeader() { - return getTable().querySelector('thead tr'); - } - // returns the tbody element of the summary table - function getTableBody() { - return getTable().querySelector('tbody'); - } - // returns the th element for nth column - function getNthColumn(n) { - return getTableHeader().querySelectorAll('th')[n]; - } - - function onFilterInput() { - const searchValue = document.getElementById('fileSearch').value; - const rows = document.getElementsByTagName('tbody')[0].children; - for (let i = 0; i < rows.length; i++) { - const row = rows[i]; - if ( - row.textContent - .toLowerCase() - .includes(searchValue.toLowerCase()) - ) { - row.style.display = ''; - } else { - row.style.display = 'none'; - } - } - } - - // loads the search box - function addSearchBox() { - var template = document.getElementById('filterTemplate'); - var templateClone = template.content.cloneNode(true); - templateClone.getElementById('fileSearch').oninput = onFilterInput; - template.parentElement.appendChild(templateClone); - } - - // loads all columns - function loadColumns() { - var colNodes = getTableHeader().querySelectorAll('th'), - colNode, - cols = [], - col, - i; - - for (i = 0; i < colNodes.length; i += 1) { - colNode = colNodes[i]; - col = { - key: colNode.getAttribute('data-col'), - sortable: !colNode.getAttribute('data-nosort'), - type: colNode.getAttribute('data-type') || 'string' - }; - cols.push(col); - if (col.sortable) { - col.defaultDescSort = col.type === 'number'; - colNode.innerHTML = - colNode.innerHTML + ''; - } - } - return cols; - } - // attaches a data attribute to every tr element with an object - // of data values keyed by column name - function loadRowData(tableRow) { - var tableCols = tableRow.querySelectorAll('td'), - colNode, - col, - data = {}, - i, - val; - for (i = 0; i < tableCols.length; i += 1) { - colNode = tableCols[i]; - col = cols[i]; - val = colNode.getAttribute('data-value'); - if (col.type === 'number') { - val = Number(val); - } - data[col.key] = val; - } - return data; - } - // loads all row data - function loadData() { - var rows = getTableBody().querySelectorAll('tr'), - i; - - for (i = 0; i < rows.length; i += 1) { - rows[i].data = loadRowData(rows[i]); - } - } - // sorts the table using the data for the ith column - function sortByIndex(index, desc) { - var key = cols[index].key, - sorter = function(a, b) { - a = a.data[key]; - b = b.data[key]; - return a < b ? -1 : a > b ? 1 : 0; - }, - finalSorter = sorter, - tableBody = document.querySelector('.coverage-summary tbody'), - rowNodes = tableBody.querySelectorAll('tr'), - rows = [], - i; - - if (desc) { - finalSorter = function(a, b) { - return -1 * sorter(a, b); - }; - } - - for (i = 0; i < rowNodes.length; i += 1) { - rows.push(rowNodes[i]); - tableBody.removeChild(rowNodes[i]); - } - - rows.sort(finalSorter); - - for (i = 0; i < rows.length; i += 1) { - tableBody.appendChild(rows[i]); - } - } - // removes sort indicators for current column being sorted - function removeSortIndicators() { - var col = getNthColumn(currentSort.index), - cls = col.className; - - cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); - col.className = cls; - } - // adds sort indicators for current column being sorted - function addSortIndicators() { - getNthColumn(currentSort.index).className += currentSort.desc - ? ' sorted-desc' - : ' sorted'; - } - // adds event listeners for all sorter widgets - function enableUI() { - var i, - el, - ithSorter = function ithSorter(i) { - var col = cols[i]; - - return function() { - var desc = col.defaultDescSort; - - if (currentSort.index === i) { - desc = !currentSort.desc; - } - sortByIndex(i, desc); - removeSortIndicators(); - currentSort.index = i; - currentSort.desc = desc; - addSortIndicators(); - }; - }; - for (i = 0; i < cols.length; i += 1) { - if (cols[i].sortable) { - // add the click event handler on the th so users - // dont have to click on those tiny arrows - el = getNthColumn(i).querySelector('.sorter').parentElement; - if (el.addEventListener) { - el.addEventListener('click', ithSorter(i)); - } else { - el.attachEvent('onclick', ithSorter(i)); - } - } - } - } - // adds sorting functionality to the UI - return function() { - if (!getTable()) { - return; - } - cols = loadColumns(); - loadData(); - addSearchBox(); - addSortIndicators(); - enableUI(); - }; -})(); - -window.addEventListener('load', addSorting); diff --git a/packages/database/coverage/src/index.html b/packages/database/coverage/src/index.html deleted file mode 100644 index c1ce8378..00000000 --- a/packages/database/coverage/src/index.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - Code coverage report for src - - - - - - - - - -
-
-

All files 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/src/index.ts.html b/packages/database/coverage/src/index.ts.html deleted file mode 100644 index 1e0aeb8e..00000000 --- a/packages/database/coverage/src/index.ts.html +++ /dev/null @@ -1,3697 +0,0 @@ - - - - - - Code coverage report for src/index.ts - - - - - - - - - -
-
-

All files / 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/src/schemas/Credential.ts.html b/packages/database/coverage/src/schemas/Credential.ts.html deleted file mode 100644 index a5c92e4d..00000000 --- a/packages/database/coverage/src/schemas/Credential.ts.html +++ /dev/null @@ -1,433 +0,0 @@ - - - - - - Code coverage report for src/schemas/Credential.ts - - - - - - - - - -
-
-

All files / 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/src/schemas/CredentialRequestMetadata.ts.html b/packages/database/coverage/src/schemas/CredentialRequestMetadata.ts.html deleted file mode 100644 index 0ed4fd5d..00000000 --- a/packages/database/coverage/src/schemas/CredentialRequestMetadata.ts.html +++ /dev/null @@ -1,322 +0,0 @@ - - - - - - Code coverage report for src/schemas/CredentialRequestMetadata.ts - - - - - - - - - -
-
-

All files / 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/src/schemas/DID.ts.html b/packages/database/coverage/src/schemas/DID.ts.html deleted file mode 100644 index d8cbdcf0..00000000 --- a/packages/database/coverage/src/schemas/DID.ts.html +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - Code coverage report for src/schemas/DID.ts - - - - - - - - - -
-
-

All files / 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/src/schemas/DIDPair.ts.html b/packages/database/coverage/src/schemas/DIDPair.ts.html deleted file mode 100644 index 79891c1d..00000000 --- a/packages/database/coverage/src/schemas/DIDPair.ts.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - Code coverage report for src/schemas/DIDPair.ts - - - - - - - - - -
-
-

All files / 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/src/schemas/LinkSecret.ts.html b/packages/database/coverage/src/schemas/LinkSecret.ts.html deleted file mode 100644 index 52ec7b79..00000000 --- a/packages/database/coverage/src/schemas/LinkSecret.ts.html +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - Code coverage report for src/schemas/LinkSecret.ts - - - - - - - - - -
-
-

All files / 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/src/schemas/Mediator.ts.html b/packages/database/coverage/src/schemas/Mediator.ts.html deleted file mode 100644 index 6d0c8a36..00000000 --- a/packages/database/coverage/src/schemas/Mediator.ts.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - Code coverage report for src/schemas/Mediator.ts - - - - - - - - - -
-
-

All files / 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/src/schemas/Message.ts.html b/packages/database/coverage/src/schemas/Message.ts.html deleted file mode 100644 index e8d00550..00000000 --- a/packages/database/coverage/src/schemas/Message.ts.html +++ /dev/null @@ -1,469 +0,0 @@ - - - - - - Code coverage report for src/schemas/Message.ts - - - - - - - - - -
-
-

All files / 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/src/schemas/PrivateKey.ts.html b/packages/database/coverage/src/schemas/PrivateKey.ts.html deleted file mode 100644 index 9b6c9711..00000000 --- a/packages/database/coverage/src/schemas/PrivateKey.ts.html +++ /dev/null @@ -1,604 +0,0 @@ - - - - - - Code coverage report for src/schemas/PrivateKey.ts - - - - - - - - - -
-
-

All files / 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/src/schemas/index.html b/packages/database/coverage/src/schemas/index.html deleted file mode 100644 index dec9af59..00000000 --- a/packages/database/coverage/src/schemas/index.html +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - Code coverage report for src/schemas - - - - - - - - - -
-
-

All files 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/src/types.ts.html b/packages/database/coverage/src/types.ts.html deleted file mode 100644 index 9106b550..00000000 --- a/packages/database/coverage/src/types.ts.html +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - Code coverage report for src/types.ts - - - - - - - - - -
-
-

All files / 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/package.json b/packages/database/package.json index 2792073b..ba4cd2ac 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -22,7 +22,8 @@ "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 && npx istanbul-badges-readme --readmeDir=\"../../\"", - "docs": "npx typedoc --options typedoc.json --hideGenerator" + "docs": "npx typedoc --options ./typedoc.markdown.cjs --hideGenerator", + "docs-html": "npx typedoc --options ./typedoc.html.cjs --hideGenerator" }, "repository": { "type": "git", @@ -53,4 +54,4 @@ "build/*" ], "gitHead": "6aa4ce8bbb9938fc4c4e790efffa5b902631362c" -} +} \ No newline at end of file diff --git a/packages/database/typedoc.html.cjs b/packages/database/typedoc.html.cjs new file mode 100644 index 00000000..c1e3e0f8 --- /dev/null +++ b/packages/database/typedoc.html.cjs @@ -0,0 +1,35 @@ + + +module.exports = { + "$schema": "https://typedoc.org/schema.json", + "entryPoints": [ + "./src/index.ts" + ], + "out": "../../docs-html", + "tsconfig": "tsconfig.json", + "name": "@pluto-encrypted/database", + "useTsLinkResolution": true, + "hideGenerator": true, + "entryPointStrategy": "expand", + "excludePrivate": true, + "excludeReferences": true, + "excludeProtected": true, + "excludeInternal": true, + "excludeNotDocumented": true, + "readme": "none", + "excludeNotDocumentedKinds": [ + "TypeAlias", + "Variable" + ], + "includeVersion": false, + "theme": "default", + "plugin": [ + "typedoc-plugin-superstruct", + "typedoc-plugin-rename-defaults", + "@bndynet/typedoc-theme" + ], + "navigationLinks": { + "Docs": "https://elribonazo.github.io/pluto-encrypted/", + "GitHub": "https://github.com/elribonazo/pluto-encrypted" + } +} \ No newline at end of file diff --git a/packages/database/typedoc.markdown.cjs b/packages/database/typedoc.markdown.cjs new file mode 100644 index 00000000..5014d5bb --- /dev/null +++ b/packages/database/typedoc.markdown.cjs @@ -0,0 +1,35 @@ + + +module.exports = { + "$schema": "https://typedoc.org/schema.json", + "entryPoints": [ + "./src/index.ts" + ], + "out": "../../docs", + "tsconfig": "tsconfig.json", + "name": "@pluto-encrypted/database", + "useTsLinkResolution": true, + "hideGenerator": true, + "entryPointStrategy": "expand", + "excludePrivate": true, + "excludeReferences": true, + "excludeProtected": true, + "excludeInternal": true, + "excludeNotDocumented": true, + "readme": "none", + "excludeNotDocumentedKinds": [ + "TypeAlias", + "Variable" + ], + "includeVersion": false, + "theme": "default", + "plugin": [ + "typedoc-plugin-superstruct", + "typedoc-plugin-rename-defaults", + "typedoc-plugin-markdown" + ], + "navigationLinks": { + "Docs": "https://elribonazo.github.io/pluto-encrypted/", + "GitHub": "https://github.com/elribonazo/pluto-encrypted" + } +} \ No newline at end of file diff --git a/vitest.config.ts b/vitest.config.ts index cf79e6c6..bef529e9 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -6,12 +6,12 @@ export default defineConfig({ reporters: ['default'], // or 'verbose' coverage: { provider: 'v8', - reporter: ['json-summary', 'html'], + reporter: ['json-summary'], thresholds: { - branches: 58, - functions: 64, - lines: 74, - statements: 71 + branches: 95, + functions: 95, + lines: 95, + statements: 95 } }, }