diff --git a/package-lock.json b/package-lock.json index a1835aa3..f5d51615 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@powerhousedao/connect", - "version": "1.0.0-dev.66", + "version": "1.0.0-dev.74", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@powerhousedao/connect", - "version": "1.0.0-dev.66", + "version": "1.0.0-dev.74", "license": "AGPL-3.0-only", "dependencies": { "@powerhousedao/design-system": "1.0.0-alpha.160", @@ -14,7 +14,7 @@ "@sentry/vite-plugin": "^2.22.2", "@tanstack/react-virtual": "^3.8.1", "did-key-creator": "^1.2.0", - "document-drive": "^1.0.0-alpha.88", + "document-drive": "1.0.0-alpha.89", "document-model": "1.7.0", "document-model-libs": "^1.83.0", "electron-is-dev": "^3.0.1", @@ -6847,9 +6847,9 @@ } }, "node_modules/@prisma/client": { - "version": "5.17.0", - "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.17.0.tgz", - "integrity": "sha512-N2tnyKayT0Zf7mHjwEyE8iG7FwTmXDHFZ1GnNhQp0pJUObsuel4ZZ1XwfuAYkq5mRIiC/Kot0kt0tGCfLJ70Jw==", + "version": "5.19.1", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.19.1.tgz", + "integrity": "sha512-x30GFguInsgt+4z5I4WbkZP2CGpotJMUXy+Gl/aaUjHn2o1DnLYNTA+q9XdYmAQZM8fIIkvUiA2NpgosM3fneg==", "hasInstallScript": true, "optional": true, "engines": { @@ -8835,9 +8835,9 @@ } }, "node_modules/@redis/client": { - "version": "1.5.17", - "resolved": "https://registry.npmjs.org/@redis/client/-/client-1.5.17.tgz", - "integrity": "sha512-IPvU9A31qRCZ7lds/x+ksuK/UMndd0EASveAvCvEtFFKIZjZ+m/a4a0L7S28KEWoR5ka8526hlSghDo4Hrc2Hg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@redis/client/-/client-1.6.0.tgz", + "integrity": "sha512-aR0uffYI700OEEH4gYnitAnv3vzVGXCFvYfdpu/CJKvk4pHfLPEy/JSZyrpQ+15WhXe1yJRXLtfQ84s4mEXnPg==", "optional": true, "dependencies": { "cluster-key-slot": "1.1.2", @@ -8864,27 +8864,27 @@ } }, "node_modules/@redis/json": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@redis/json/-/json-1.0.6.tgz", - "integrity": "sha512-rcZO3bfQbm2zPRpqo82XbW8zg4G/w4W3tI7X8Mqleq9goQjAGLL7q/1n1ZX4dXEAmORVZ4s1+uKLaUOg7LrUhw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@redis/json/-/json-1.0.7.tgz", + "integrity": "sha512-6UyXfjVaTBTJtKNG4/9Z8PSpKE6XgSyEb8iwaqDcy+uKrd/DGYHTWkUdnQDyzm727V7p21WUMhsqz5oy65kPcQ==", "optional": true, "peerDependencies": { "@redis/client": "^1.0.0" } }, "node_modules/@redis/search": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@redis/search/-/search-1.1.6.tgz", - "integrity": "sha512-mZXCxbTYKBQ3M2lZnEddwEAks0Kc7nauire8q20oA0oA/LoA+E/b5Y5KZn232ztPb1FkIGqo12vh3Lf+Vw5iTw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@redis/search/-/search-1.2.0.tgz", + "integrity": "sha512-tYoDBbtqOVigEDMAcTGsRlMycIIjwMCgD8eR2t0NANeQmgK/lvxNAvYyb6bZDD4frHRhIHkJu2TBRvB0ERkOmw==", "optional": true, "peerDependencies": { "@redis/client": "^1.0.0" } }, "node_modules/@redis/time-series": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-1.0.5.tgz", - "integrity": "sha512-IFjIgTusQym2B5IZJG3XKr5llka7ey84fw/NOYqESP5WUfQs9zz1ww/9+qoz4ka/S6KcGBodzlCeZ5UImKbscg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-1.1.0.tgz", + "integrity": "sha512-c1Q99M5ljsIuc4YdaCwfUEXsofakb9c8+Zse2qxTadu8TalLXuAESzLvFAvNVbkmSlvlzIQOLpBCmWI9wTOt+g==", "optional": true, "peerDependencies": { "@redis/client": "^1.0.0" @@ -11513,9 +11513,9 @@ "dev": true }, "node_modules/@types/validator": { - "version": "13.12.0", - "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.12.0.tgz", - "integrity": "sha512-nH45Lk7oPIJ1RVOF6JgFI6Dy0QpHEzq4QecZhvguxYPDwT8c93prCMqAtiIttm39voZ+DDR+qkNnMpJmMBRqag==", + "version": "13.12.1", + "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.12.1.tgz", + "integrity": "sha512-w0URwf7BQb0rD/EuiG12KP0bailHKHP5YVviJG9zw3ykAokL0TuxU2TUqMB7EwZ59bDHYdeTIvjI5m0S7qHfOA==", "optional": true }, "node_modules/@types/wicg-file-system-access": { @@ -15872,9 +15872,9 @@ } }, "node_modules/document-drive": { - "version": "1.0.0-alpha.88", - "resolved": "https://registry.npmjs.org/document-drive/-/document-drive-1.0.0-alpha.88.tgz", - "integrity": "sha512-HwLtyr9wo5Q4c6aMKOK8rFqXO0NZwB07gVljCeCqrromcDekHeQREvYUQaqXlo4RKhQP3dyyzcI6itzS0g5qjQ==", + "version": "1.0.0-alpha.89", + "resolved": "https://registry.npmjs.org/document-drive/-/document-drive-1.0.0-alpha.89.tgz", + "integrity": "sha512-icOYZ0FSkE5iGhnPOPRrH8zbYIxeDnj8mDrVwZ7K25YOxXJd0XO7hgqwfNFjeO2fGcxsAG5fl1r2512F7gilGQ==", "dependencies": { "exponential-backoff": "^3.1.1", "graphql": "^16.9.0", @@ -15885,7 +15885,7 @@ "uuid": "^9.0.1" }, "optionalDependencies": { - "@prisma/client": "5.17.0", + "@prisma/client": "^5.18.0", "localforage": "^1.10.0", "redis": "^4.6.15", "sequelize": "^6.37.3", @@ -24314,6 +24314,7 @@ }, "node_modules/npm/node_modules/@isaacs/cliui": { "version": "8.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24330,6 +24331,7 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/ansi-regex": { "version": "6.0.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -24341,11 +24343,13 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/emoji-regex": { "version": "9.2.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/string-width": { "version": "5.1.2", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24362,6 +24366,7 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi": { "version": "7.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24376,11 +24381,13 @@ }, "node_modules/npm/node_modules/@isaacs/string-locale-compare": { "version": "1.1.0", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/@npmcli/agent": { "version": "2.2.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24396,6 +24403,7 @@ }, "node_modules/npm/node_modules/@npmcli/arborist": { "version": "7.5.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24444,6 +24452,7 @@ }, "node_modules/npm/node_modules/@npmcli/config": { "version": "8.3.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24462,6 +24471,7 @@ }, "node_modules/npm/node_modules/@npmcli/fs": { "version": "3.1.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24473,6 +24483,7 @@ }, "node_modules/npm/node_modules/@npmcli/git": { "version": "5.0.8", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24492,6 +24503,7 @@ }, "node_modules/npm/node_modules/@npmcli/installed-package-contents": { "version": "2.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24507,6 +24519,7 @@ }, "node_modules/npm/node_modules/@npmcli/map-workspaces": { "version": "3.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24521,6 +24534,7 @@ }, "node_modules/npm/node_modules/@npmcli/metavuln-calculator": { "version": "7.1.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24536,6 +24550,7 @@ }, "node_modules/npm/node_modules/@npmcli/name-from-folder": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -24544,6 +24559,7 @@ }, "node_modules/npm/node_modules/@npmcli/node-gyp": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -24552,6 +24568,7 @@ }, "node_modules/npm/node_modules/@npmcli/package-json": { "version": "5.2.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24569,6 +24586,7 @@ }, "node_modules/npm/node_modules/@npmcli/promise-spawn": { "version": "7.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24580,6 +24598,7 @@ }, "node_modules/npm/node_modules/@npmcli/query": { "version": "3.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24591,6 +24610,7 @@ }, "node_modules/npm/node_modules/@npmcli/redact": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -24599,6 +24619,7 @@ }, "node_modules/npm/node_modules/@npmcli/run-script": { "version": "8.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24615,14 +24636,17 @@ }, "node_modules/npm/node_modules/@pkgjs/parseargs": { "version": "0.11.0", + "dev": true, "inBundle": true, "license": "MIT", + "optional": true, "engines": { "node": ">=14" } }, "node_modules/npm/node_modules/@sigstore/bundle": { "version": "2.3.2", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -24634,6 +24658,7 @@ }, "node_modules/npm/node_modules/@sigstore/core": { "version": "1.1.0", + "dev": true, "inBundle": true, "license": "Apache-2.0", "engines": { @@ -24642,6 +24667,7 @@ }, "node_modules/npm/node_modules/@sigstore/protobuf-specs": { "version": "0.3.2", + "dev": true, "inBundle": true, "license": "Apache-2.0", "engines": { @@ -24650,6 +24676,7 @@ }, "node_modules/npm/node_modules/@sigstore/sign": { "version": "2.3.2", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -24666,6 +24693,7 @@ }, "node_modules/npm/node_modules/@sigstore/tuf": { "version": "2.3.4", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -24678,6 +24706,7 @@ }, "node_modules/npm/node_modules/@sigstore/verify": { "version": "1.2.1", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -24691,6 +24720,7 @@ }, "node_modules/npm/node_modules/@tufjs/canonical-json": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -24699,6 +24729,7 @@ }, "node_modules/npm/node_modules/@tufjs/models": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24711,6 +24742,7 @@ }, "node_modules/npm/node_modules/abbrev": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -24719,6 +24751,7 @@ }, "node_modules/npm/node_modules/agent-base": { "version": "7.1.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24730,6 +24763,7 @@ }, "node_modules/npm/node_modules/aggregate-error": { "version": "3.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24742,6 +24776,7 @@ }, "node_modules/npm/node_modules/ansi-regex": { "version": "5.0.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -24750,6 +24785,7 @@ }, "node_modules/npm/node_modules/ansi-styles": { "version": "6.2.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -24761,21 +24797,25 @@ }, "node_modules/npm/node_modules/aproba": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/archy": { "version": "1.0.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/balanced-match": { "version": "1.0.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/bin-links": { "version": "4.0.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24790,6 +24830,7 @@ }, "node_modules/npm/node_modules/binary-extensions": { "version": "2.3.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -24801,6 +24842,7 @@ }, "node_modules/npm/node_modules/brace-expansion": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24809,6 +24851,7 @@ }, "node_modules/npm/node_modules/cacache": { "version": "18.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24831,6 +24874,7 @@ }, "node_modules/npm/node_modules/chalk": { "version": "5.3.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -24842,6 +24886,7 @@ }, "node_modules/npm/node_modules/chownr": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -24850,6 +24895,7 @@ }, "node_modules/npm/node_modules/ci-info": { "version": "4.0.0", + "dev": true, "funding": [ { "type": "github", @@ -24864,6 +24910,7 @@ }, "node_modules/npm/node_modules/cidr-regex": { "version": "4.1.1", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -24875,6 +24922,7 @@ }, "node_modules/npm/node_modules/clean-stack": { "version": "2.2.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -24883,6 +24931,7 @@ }, "node_modules/npm/node_modules/cli-columns": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24895,6 +24944,7 @@ }, "node_modules/npm/node_modules/cmd-shim": { "version": "6.0.3", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -24903,6 +24953,7 @@ }, "node_modules/npm/node_modules/color-convert": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24914,16 +24965,19 @@ }, "node_modules/npm/node_modules/color-name": { "version": "1.1.4", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/common-ancestor-path": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/cross-spawn": { "version": "7.0.3", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24937,6 +24991,7 @@ }, "node_modules/npm/node_modules/cross-spawn/node_modules/which": { "version": "2.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24951,6 +25006,7 @@ }, "node_modules/npm/node_modules/cssesc": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "MIT", "bin": { @@ -24962,6 +25018,7 @@ }, "node_modules/npm/node_modules/debug": { "version": "4.3.5", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24978,11 +25035,13 @@ }, "node_modules/npm/node_modules/debug/node_modules/ms": { "version": "2.1.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/diff": { "version": "5.2.0", + "dev": true, "inBundle": true, "license": "BSD-3-Clause", "engines": { @@ -24991,24 +25050,29 @@ }, "node_modules/npm/node_modules/eastasianwidth": { "version": "0.2.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/emoji-regex": { "version": "8.0.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/encoding": { "version": "0.1.13", + "dev": true, "inBundle": true, "license": "MIT", + "optional": true, "dependencies": { "iconv-lite": "^0.6.2" } }, "node_modules/npm/node_modules/env-paths": { "version": "2.2.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -25017,16 +25081,19 @@ }, "node_modules/npm/node_modules/err-code": { "version": "2.0.3", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/exponential-backoff": { "version": "3.1.1", + "dev": true, "inBundle": true, "license": "Apache-2.0" }, "node_modules/npm/node_modules/fastest-levenshtein": { "version": "1.0.16", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -25035,6 +25102,7 @@ }, "node_modules/npm/node_modules/foreground-child": { "version": "3.2.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25050,6 +25118,7 @@ }, "node_modules/npm/node_modules/fs-minipass": { "version": "3.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25061,6 +25130,7 @@ }, "node_modules/npm/node_modules/glob": { "version": "10.4.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25083,11 +25153,13 @@ }, "node_modules/npm/node_modules/graceful-fs": { "version": "4.2.11", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/hosted-git-info": { "version": "7.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25099,11 +25171,13 @@ }, "node_modules/npm/node_modules/http-cache-semantics": { "version": "4.1.1", + "dev": true, "inBundle": true, "license": "BSD-2-Clause" }, "node_modules/npm/node_modules/http-proxy-agent": { "version": "7.0.2", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -25116,6 +25190,7 @@ }, "node_modules/npm/node_modules/https-proxy-agent": { "version": "7.0.5", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -25128,8 +25203,10 @@ }, "node_modules/npm/node_modules/iconv-lite": { "version": "0.6.3", + "dev": true, "inBundle": true, "license": "MIT", + "optional": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -25139,6 +25216,7 @@ }, "node_modules/npm/node_modules/ignore-walk": { "version": "6.0.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25150,6 +25228,7 @@ }, "node_modules/npm/node_modules/imurmurhash": { "version": "0.1.4", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -25158,6 +25237,7 @@ }, "node_modules/npm/node_modules/indent-string": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -25166,6 +25246,7 @@ }, "node_modules/npm/node_modules/ini": { "version": "4.1.3", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -25174,6 +25255,7 @@ }, "node_modules/npm/node_modules/init-package-json": { "version": "6.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25191,6 +25273,7 @@ }, "node_modules/npm/node_modules/ip-address": { "version": "9.0.5", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -25203,6 +25286,7 @@ }, "node_modules/npm/node_modules/ip-regex": { "version": "5.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -25214,6 +25298,7 @@ }, "node_modules/npm/node_modules/is-cidr": { "version": "5.1.0", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -25225,6 +25310,7 @@ }, "node_modules/npm/node_modules/is-fullwidth-code-point": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -25233,16 +25319,19 @@ }, "node_modules/npm/node_modules/is-lambda": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/isexe": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/jackspeak": { "version": "3.4.0", + "dev": true, "inBundle": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -25260,11 +25349,13 @@ }, "node_modules/npm/node_modules/jsbn": { "version": "1.1.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/json-parse-even-better-errors": { "version": "3.0.2", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -25273,6 +25364,7 @@ }, "node_modules/npm/node_modules/json-stringify-nice": { "version": "1.1.4", + "dev": true, "inBundle": true, "license": "ISC", "funding": { @@ -25281,6 +25373,7 @@ }, "node_modules/npm/node_modules/jsonparse": { "version": "1.3.1", + "dev": true, "engines": [ "node >= 0.2.0" ], @@ -25289,16 +25382,19 @@ }, "node_modules/npm/node_modules/just-diff": { "version": "6.0.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/just-diff-apply": { "version": "5.5.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/libnpmaccess": { "version": "8.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25311,6 +25407,7 @@ }, "node_modules/npm/node_modules/libnpmdiff": { "version": "6.1.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25329,6 +25426,7 @@ }, "node_modules/npm/node_modules/libnpmexec": { "version": "8.1.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25349,6 +25447,7 @@ }, "node_modules/npm/node_modules/libnpmfund": { "version": "5.0.12", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25360,6 +25459,7 @@ }, "node_modules/npm/node_modules/libnpmhook": { "version": "10.0.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25372,6 +25472,7 @@ }, "node_modules/npm/node_modules/libnpmorg": { "version": "6.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25384,6 +25485,7 @@ }, "node_modules/npm/node_modules/libnpmpack": { "version": "7.0.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25398,6 +25500,7 @@ }, "node_modules/npm/node_modules/libnpmpublish": { "version": "9.0.9", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25416,6 +25519,7 @@ }, "node_modules/npm/node_modules/libnpmsearch": { "version": "7.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25427,6 +25531,7 @@ }, "node_modules/npm/node_modules/libnpmteam": { "version": "6.0.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25439,6 +25544,7 @@ }, "node_modules/npm/node_modules/libnpmversion": { "version": "6.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25454,6 +25560,7 @@ }, "node_modules/npm/node_modules/lru-cache": { "version": "10.2.2", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -25462,6 +25569,7 @@ }, "node_modules/npm/node_modules/make-fetch-happen": { "version": "13.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25484,6 +25592,7 @@ }, "node_modules/npm/node_modules/minimatch": { "version": "9.0.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25498,6 +25607,7 @@ }, "node_modules/npm/node_modules/minipass": { "version": "7.1.2", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -25506,6 +25616,7 @@ }, "node_modules/npm/node_modules/minipass-collect": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25517,6 +25628,7 @@ }, "node_modules/npm/node_modules/minipass-fetch": { "version": "3.0.5", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -25533,6 +25645,7 @@ }, "node_modules/npm/node_modules/minipass-flush": { "version": "1.0.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25544,6 +25657,7 @@ }, "node_modules/npm/node_modules/minipass-flush/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25555,6 +25669,7 @@ }, "node_modules/npm/node_modules/minipass-pipeline": { "version": "1.2.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25566,6 +25681,7 @@ }, "node_modules/npm/node_modules/minipass-pipeline/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25577,6 +25693,7 @@ }, "node_modules/npm/node_modules/minipass-sized": { "version": "1.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25588,6 +25705,7 @@ }, "node_modules/npm/node_modules/minipass-sized/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25599,6 +25717,7 @@ }, "node_modules/npm/node_modules/minizlib": { "version": "2.1.2", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -25611,6 +25730,7 @@ }, "node_modules/npm/node_modules/minizlib/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25622,6 +25742,7 @@ }, "node_modules/npm/node_modules/mkdirp": { "version": "1.0.4", + "dev": true, "inBundle": true, "license": "MIT", "bin": { @@ -25633,11 +25754,13 @@ }, "node_modules/npm/node_modules/ms": { "version": "2.1.3", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/mute-stream": { "version": "1.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -25646,6 +25769,7 @@ }, "node_modules/npm/node_modules/negotiator": { "version": "0.6.3", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -25654,6 +25778,7 @@ }, "node_modules/npm/node_modules/node-gyp": { "version": "10.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -25677,6 +25802,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/proc-log": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -25685,6 +25811,7 @@ }, "node_modules/npm/node_modules/nopt": { "version": "7.2.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25699,6 +25826,7 @@ }, "node_modules/npm/node_modules/normalize-package-data": { "version": "6.0.2", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -25712,6 +25840,7 @@ }, "node_modules/npm/node_modules/npm-audit-report": { "version": "5.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -25720,6 +25849,7 @@ }, "node_modules/npm/node_modules/npm-bundled": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25731,6 +25861,7 @@ }, "node_modules/npm/node_modules/npm-install-checks": { "version": "6.3.0", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -25742,6 +25873,7 @@ }, "node_modules/npm/node_modules/npm-normalize-package-bin": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -25750,6 +25882,7 @@ }, "node_modules/npm/node_modules/npm-package-arg": { "version": "11.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25764,6 +25897,7 @@ }, "node_modules/npm/node_modules/npm-packlist": { "version": "8.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25775,6 +25909,7 @@ }, "node_modules/npm/node_modules/npm-pick-manifest": { "version": "9.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25789,6 +25924,7 @@ }, "node_modules/npm/node_modules/npm-profile": { "version": "10.0.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25801,6 +25937,7 @@ }, "node_modules/npm/node_modules/npm-registry-fetch": { "version": "17.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25819,6 +25956,7 @@ }, "node_modules/npm/node_modules/npm-user-validate": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "engines": { @@ -25827,6 +25965,7 @@ }, "node_modules/npm/node_modules/p-map": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -25841,11 +25980,13 @@ }, "node_modules/npm/node_modules/package-json-from-dist": { "version": "1.0.0", + "dev": true, "inBundle": true, "license": "BlueOak-1.0.0" }, "node_modules/npm/node_modules/pacote": { "version": "18.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25876,6 +26017,7 @@ }, "node_modules/npm/node_modules/parse-conflict-json": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25889,6 +26031,7 @@ }, "node_modules/npm/node_modules/path-key": { "version": "3.1.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -25897,6 +26040,7 @@ }, "node_modules/npm/node_modules/path-scurry": { "version": "1.11.1", + "dev": true, "inBundle": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -25912,6 +26056,7 @@ }, "node_modules/npm/node_modules/postcss-selector-parser": { "version": "6.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -25924,6 +26069,7 @@ }, "node_modules/npm/node_modules/proc-log": { "version": "4.2.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -25932,6 +26078,7 @@ }, "node_modules/npm/node_modules/proggy": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -25940,6 +26087,7 @@ }, "node_modules/npm/node_modules/promise-all-reject-late": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "ISC", "funding": { @@ -25948,6 +26096,7 @@ }, "node_modules/npm/node_modules/promise-call-limit": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "funding": { @@ -25956,11 +26105,13 @@ }, "node_modules/npm/node_modules/promise-inflight": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/promise-retry": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -25973,6 +26124,7 @@ }, "node_modules/npm/node_modules/promzard": { "version": "1.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25984,6 +26136,7 @@ }, "node_modules/npm/node_modules/qrcode-terminal": { "version": "0.12.0", + "dev": true, "inBundle": true, "bin": { "qrcode-terminal": "bin/qrcode-terminal.js" @@ -25991,6 +26144,7 @@ }, "node_modules/npm/node_modules/read": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -26002,6 +26156,7 @@ }, "node_modules/npm/node_modules/read-cmd-shim": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -26010,6 +26165,7 @@ }, "node_modules/npm/node_modules/read-package-json-fast": { "version": "3.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -26022,6 +26178,7 @@ }, "node_modules/npm/node_modules/retry": { "version": "0.12.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -26030,11 +26187,14 @@ }, "node_modules/npm/node_modules/safer-buffer": { "version": "2.1.2", + "dev": true, "inBundle": true, - "license": "MIT" + "license": "MIT", + "optional": true }, "node_modules/npm/node_modules/semver": { "version": "7.6.2", + "dev": true, "inBundle": true, "license": "ISC", "bin": { @@ -26046,6 +26206,7 @@ }, "node_modules/npm/node_modules/shebang-command": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26057,6 +26218,7 @@ }, "node_modules/npm/node_modules/shebang-regex": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -26065,6 +26227,7 @@ }, "node_modules/npm/node_modules/signal-exit": { "version": "4.1.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -26076,6 +26239,7 @@ }, "node_modules/npm/node_modules/sigstore": { "version": "2.3.1", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -26092,6 +26256,7 @@ }, "node_modules/npm/node_modules/smart-buffer": { "version": "4.2.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -26101,6 +26266,7 @@ }, "node_modules/npm/node_modules/socks": { "version": "2.8.3", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26114,6 +26280,7 @@ }, "node_modules/npm/node_modules/socks-proxy-agent": { "version": "8.0.4", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26127,6 +26294,7 @@ }, "node_modules/npm/node_modules/spdx-correct": { "version": "3.2.0", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -26136,6 +26304,7 @@ }, "node_modules/npm/node_modules/spdx-correct/node_modules/spdx-expression-parse": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26145,11 +26314,13 @@ }, "node_modules/npm/node_modules/spdx-exceptions": { "version": "2.5.0", + "dev": true, "inBundle": true, "license": "CC-BY-3.0" }, "node_modules/npm/node_modules/spdx-expression-parse": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26159,16 +26330,19 @@ }, "node_modules/npm/node_modules/spdx-license-ids": { "version": "3.0.18", + "dev": true, "inBundle": true, "license": "CC0-1.0" }, "node_modules/npm/node_modules/sprintf-js": { "version": "1.1.3", + "dev": true, "inBundle": true, "license": "BSD-3-Clause" }, "node_modules/npm/node_modules/ssri": { "version": "10.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -26180,6 +26354,7 @@ }, "node_modules/npm/node_modules/string-width": { "version": "4.2.3", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26194,6 +26369,7 @@ "node_modules/npm/node_modules/string-width-cjs": { "name": "string-width", "version": "4.2.3", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26207,6 +26383,7 @@ }, "node_modules/npm/node_modules/strip-ansi": { "version": "6.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26219,6 +26396,7 @@ "node_modules/npm/node_modules/strip-ansi-cjs": { "name": "strip-ansi", "version": "6.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26230,6 +26408,7 @@ }, "node_modules/npm/node_modules/supports-color": { "version": "9.4.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -26241,6 +26420,7 @@ }, "node_modules/npm/node_modules/tar": { "version": "6.2.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -26257,6 +26437,7 @@ }, "node_modules/npm/node_modules/tar/node_modules/fs-minipass": { "version": "2.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -26268,6 +26449,7 @@ }, "node_modules/npm/node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -26279,6 +26461,7 @@ }, "node_modules/npm/node_modules/tar/node_modules/minipass": { "version": "5.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -26287,16 +26470,19 @@ }, "node_modules/npm/node_modules/text-table": { "version": "0.2.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/tiny-relative-date": { "version": "1.3.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/treeverse": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -26305,6 +26491,7 @@ }, "node_modules/npm/node_modules/tuf-js": { "version": "2.2.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26318,6 +26505,7 @@ }, "node_modules/npm/node_modules/unique-filename": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -26329,6 +26517,7 @@ }, "node_modules/npm/node_modules/unique-slug": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -26340,11 +26529,13 @@ }, "node_modules/npm/node_modules/util-deprecate": { "version": "1.0.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/validate-npm-package-license": { "version": "3.0.4", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -26354,6 +26545,7 @@ }, "node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26363,6 +26555,7 @@ }, "node_modules/npm/node_modules/validate-npm-package-name": { "version": "5.0.1", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -26371,11 +26564,13 @@ }, "node_modules/npm/node_modules/walk-up-path": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/which": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -26390,6 +26585,7 @@ }, "node_modules/npm/node_modules/which/node_modules/isexe": { "version": "3.1.1", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -26398,6 +26594,7 @@ }, "node_modules/npm/node_modules/wrap-ansi": { "version": "8.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26415,6 +26612,7 @@ "node_modules/npm/node_modules/wrap-ansi-cjs": { "name": "wrap-ansi", "version": "7.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26431,6 +26629,7 @@ }, "node_modules/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { "version": "4.3.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26445,6 +26644,7 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex": { "version": "6.0.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -26456,11 +26656,13 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/emoji-regex": { "version": "9.2.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/wrap-ansi/node_modules/string-width": { "version": "5.1.2", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26477,6 +26679,7 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/strip-ansi": { "version": "7.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26491,6 +26694,7 @@ }, "node_modules/npm/node_modules/write-file-atomic": { "version": "5.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -26503,6 +26707,7 @@ }, "node_modules/npm/node_modules/yallist": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "ISC" }, @@ -28934,20 +29139,17 @@ } }, "node_modules/redis": { - "version": "4.6.15", - "resolved": "https://registry.npmjs.org/redis/-/redis-4.6.15.tgz", - "integrity": "sha512-2NtuOpMW3tnYzBw6S8mbXSX7RPzvVFCA2wFJq9oErushO2UeBkxObk+uvo7gv7n0rhWeOj/IzrHO8TjcFlRSOg==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/redis/-/redis-4.7.0.tgz", + "integrity": "sha512-zvmkHEAdGMn+hMRXuMBtu4Vo5P6rHQjLoHftu+lBqq8ZTA3RCVC/WzD790bkKKiNFp7d5/9PcSD19fJyyRvOdQ==", "optional": true, - "workspaces": [ - "./packages/*" - ], "dependencies": { "@redis/bloom": "1.2.0", - "@redis/client": "1.5.17", + "@redis/client": "1.6.0", "@redis/graph": "1.1.1", - "@redis/json": "1.0.6", - "@redis/search": "1.1.6", - "@redis/time-series": "1.0.5" + "@redis/json": "1.0.7", + "@redis/search": "1.2.0", + "@redis/time-series": "1.1.0" } }, "node_modules/reflect.getprototypeof": { diff --git a/package.json b/package.json index ba7a54e1..0dfd51f7 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "@sentry/vite-plugin": "^2.22.2", "@tanstack/react-virtual": "^3.8.1", "did-key-creator": "^1.2.0", - "document-drive": "^1.0.0-alpha.88", + "document-drive": "1.0.0-alpha.89", "document-model": "1.7.0", "document-model-libs": "^1.83.0", "electron-is-dev": "^3.0.1", diff --git a/src/app/document-drive.ts b/src/app/document-drive.ts index 516810aa..6f3ccfc2 100644 --- a/src/app/document-drive.ts +++ b/src/app/document-drive.ts @@ -17,6 +17,7 @@ import { import { IpcMain, webContents } from 'electron'; import { join } from 'path'; import { logger } from 'src/services/logger'; +import { getReactorDefaultDrivesConfig } from 'src/utils/reactor'; export default ( documentModels: DocumentModel[], @@ -28,6 +29,7 @@ export default ( new FilesystemStorage(join(path, 'Document Drives')), new InMemoryCache(), new BaseQueueManager(1, 10), + { ...getReactorDefaultDrivesConfig() }, ); const promise = documentDrive diff --git a/src/components/modal/modals/SettingsModal.tsx b/src/components/modal/modals/SettingsModal.tsx index 43d61492..8ba18173 100644 --- a/src/components/modal/modals/SettingsModal.tsx +++ b/src/components/modal/modals/SettingsModal.tsx @@ -71,17 +71,6 @@ export const SettingsModal: React.FC = props => { onContinue: () => { clearStorage() .then(() => { - // resets the default drive to unloaded if it is defined - setConfig(conf => ({ - ...conf, - defaultDrives: conf.defaultDrives - ? conf.defaultDrives.map(drive => ({ - ...drive, - loaded: false, - })) - : undefined, - })); - // refreshes the page to reload default drive onRefresh(); }) diff --git a/src/hooks/useFeatureFlags/default-config.ts b/src/hooks/useFeatureFlags/default-config.ts index 7fc5ffab..4d996b32 100644 --- a/src/hooks/useFeatureFlags/default-config.ts +++ b/src/hooks/useFeatureFlags/default-config.ts @@ -4,14 +4,9 @@ const ENABLED_EDITORS = import.meta.env.VITE_ENABLED_EDITORS || undefined; const enabledEditors = ENABLED_EDITORS?.split(','); const DISABLED_EDITORS = import.meta.env.VITE_DISABLED_EDITORS || undefined; -const DEFAULT_DRIVES_URL = import.meta.env.VITE_DEFAULT_DRIVES_URL || undefined; const disabledEditors = DISABLED_EDITORS?.split(','); export interface FeatureFlag { - defaultDrives?: { - url: string; - loaded: boolean; - }[]; editors: { enabledEditors?: '*' | string[]; disabledEditors?: '*' | string[]; @@ -19,12 +14,6 @@ export interface FeatureFlag { } const defaultConfig: FeatureFlag = { - defaultDrives: DEFAULT_DRIVES_URL - ? DEFAULT_DRIVES_URL.split(',').map(url => ({ - url, - loaded: false, - })) - : undefined, editors: { enabledEditors: ENABLED_EDITORS === '*' ? '*' : enabledEditors, disabledEditors: DISABLED_EDITORS === '*' ? '*' : disabledEditors, diff --git a/src/hooks/useLoadDefaultDrives.ts b/src/hooks/useLoadDefaultDrives.ts deleted file mode 100644 index daed457f..00000000 --- a/src/hooks/useLoadDefaultDrives.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { useEffect, useRef } from 'react'; -import { logger } from 'src/services/logger'; -import { useDocumentDriveServer } from './useDocumentDriveServer'; -import { useFeatureFlag } from './useFeatureFlags'; -import defaultConfig from './useFeatureFlags/default-config'; - -type DefaultDrive = { - url: string; - loaded: boolean; -}; - -const areLoadedDrivesUpToDate = ( - defaultDrivesConfig: DefaultDrive[], - loadedDrives: DefaultDrive[], -) => { - for (const defaultDrive of defaultDrivesConfig) { - const loadedDrive = loadedDrives.find( - loadedDrive => loadedDrive.url === defaultDrive.url, - ); - - if (!loadedDrive) { - return false; - } - } - - return true; -}; - -export const useLoadDefaultDrives = () => { - const loadingDrives = useRef([]); - const { - addRemoteDrive, - documentDrives, - documentDrivesStatus, - clearStorage, - } = useDocumentDriveServer(); - const { - setConfig, - config: { defaultDrives }, - } = useFeatureFlag(); - - async function resetDefaultDrive() { - await clearStorage(); - setConfig(defaultConfig); - location.reload(); - loadingDrives.current = []; - } - - useEffect(() => { - if (!defaultDrives) return; - - // reset default drives if config has been updated - if ( - loadingDrives.current.length <= 0 && - defaultDrives.every(drive => drive.loaded) && - defaultConfig.defaultDrives && - defaultConfig.defaultDrives.length > 0 && - !areLoadedDrivesUpToDate(defaultConfig.defaultDrives, defaultDrives) - ) { - void resetDefaultDrive(); - return; - } - - for (const defaultDrive of defaultDrives) { - if ( - documentDrivesStatus === 'LOADED' && - !defaultDrive.loaded && - !loadingDrives.current.includes(defaultDrive.url) - ) { - const isDriveAlreadyAdded = documentDrives.some(drive => { - return drive.state.local.triggers.some( - trigger => trigger.data?.url === defaultDrive.url, - ); - }); - - if (isDriveAlreadyAdded) { - setConfig(conf => ({ - ...conf, - defaultDrives: [ - ...(conf.defaultDrives || []).filter( - drive => drive.url !== defaultDrive.url, - ), - { ...defaultDrive, loaded: true }, - ], - })); - - return; - } - - loadingDrives.current.push(defaultDrive.url); - - addRemoteDrive(defaultDrive.url, { - sharingType: 'PUBLIC', - availableOffline: true, - listeners: [ - { - block: true, - callInfo: { - data: defaultDrive.url, - name: 'switchboard-push', - transmitterType: 'SwitchboardPush', - }, - filter: { - branch: ['main'], - documentId: ['*'], - documentType: ['*'], - scope: ['global'], - }, - label: 'Switchboard Sync', - listenerId: '1', - system: true, - }, - ], - triggers: [], - pullInterval: 3000, - }) - .then(() => - setConfig(conf => ({ - ...conf, - defaultDrives: [ - ...(conf.defaultDrives || []).filter( - drive => drive.url !== defaultDrive.url, - ), - { ...defaultDrive, loaded: true }, - ], - })), - ) - .catch(logger.error) - .finally(() => { - loadingDrives.current = loadingDrives.current.filter( - url => url !== defaultDrive.url, - ); - }); - } - } - }, [documentDrives, defaultDrives, documentDrivesStatus]); - - return loadingDrives.current.length > 0; -}; diff --git a/src/hooks/useLoadInitialData.tsx b/src/hooks/useLoadInitialData.tsx index 320a4754..f0849f56 100644 --- a/src/hooks/useLoadInitialData.tsx +++ b/src/hooks/useLoadInitialData.tsx @@ -15,7 +15,6 @@ import { useUiNodes } from 'src/hooks/useUiNodes'; import { DefaultDocumentDriveServer as server } from 'src/utils/document-drive-server'; import { useClientErrorHandler } from './useClientErrorHandler'; import { useDocumentDrives } from './useDocumentDrives'; -import { useLoadDefaultDrives } from './useLoadDefaultDrives'; import { isLatestVersion } from './utils'; export const useLoadInitialData = () => { @@ -32,8 +31,6 @@ export const useLoadInitialData = () => { const [, , serverSubscribeUpdates] = useDocumentDrives(server); const clientErrorHandler = useClientErrorHandler(); - useLoadDefaultDrives(); - async function checkLatestVersion() { const result = await isLatestVersion(); if (result === null) return; diff --git a/src/hooks/useUiNodes.ts b/src/hooks/useUiNodes.ts index a0863d2c..caaed3ab 100644 --- a/src/hooks/useUiNodes.ts +++ b/src/hooks/useUiNodes.ts @@ -84,6 +84,11 @@ export function useUiNodes() { ) as SharingType; const driveSyncStatus = await getSyncStatus(id, sharingType); + const normalizedDriveSyncStatus = + driveSyncStatus === 'INITIAL_SYNC' + ? 'SYNCING' + : driveSyncStatus; + const driveNode: UiDriveNode = { id, name, @@ -92,7 +97,7 @@ export function useUiNodes() { children: [], nodeMap: {}, sharingType, - syncStatus: driveSyncStatus, + syncStatus: normalizedDriveSyncStatus, availableOffline, icon, parentFolder: null, @@ -106,7 +111,7 @@ export function useUiNodes() { driveId: id, parentFolder: n.parentFolder || id, kind: n.kind.toUpperCase(), - syncStatus: driveSyncStatus, + syncStatus: normalizedDriveSyncStatus, sharingType, }; @@ -130,10 +135,16 @@ export function useUiNodes() { for await (const node of nodes) { if (node.kind === FILE) { - node.syncStatus = await getSyncStatus( + const fileSyncStatus = await getSyncStatus( node.synchronizationUnits[0].syncId, sharingType, ); + const normalizedFileSyncStatus = + fileSyncStatus === 'INITIAL_SYNC' + ? 'SYNCING' + : fileSyncStatus; + + node.syncStatus = normalizedFileSyncStatus; } if (node.parentFolder === id) { diff --git a/src/utils/browser-document-drive.ts b/src/utils/browser-document-drive.ts index b1cc1769..679c7471 100644 --- a/src/utils/browser-document-drive.ts +++ b/src/utils/browser-document-drive.ts @@ -6,12 +6,14 @@ import { BrowserStorage } from 'document-drive/storage/browser'; import { utils } from 'document-model/document'; import { logger } from 'src/services/logger'; import { documentModels } from 'src/store/document-model'; +import { getReactorDefaultDrivesConfig } from './reactor'; export const BrowserDocumentDriveServer = new DocumentDriveServer( documentModels, new BrowserStorage(connectConfig.routerBasename), new InMemoryCache(), new BaseQueueManager(1, 10), + { ...getReactorDefaultDrivesConfig() }, ); async function init() { diff --git a/src/utils/reactor.ts b/src/utils/reactor.ts new file mode 100644 index 00000000..62824a52 --- /dev/null +++ b/src/utils/reactor.ts @@ -0,0 +1,47 @@ +import { DocumentDriveServerOptions } from 'document-drive/server'; + +const DEFAULT_DRIVES_URL = import.meta.env.VITE_DEFAULT_DRIVES_URL || undefined; +const defaultDrivesUrl = DEFAULT_DRIVES_URL?.split(','); + +export const getReactorDefaultDrivesConfig = (): Pick< + DocumentDriveServerOptions, + 'defaultRemoteDrives' | 'removeOldRemoteDrives' +> => { + const defaultDrives: DocumentDriveServerOptions['defaultRemoteDrives'] = + defaultDrivesUrl?.map(driveUrl => ({ + url: driveUrl, + options: { + sharingType: 'PUBLIC', + availableOffline: true, + listeners: [ + { + block: true, + callInfo: { + data: driveUrl, + name: 'switchboard-push', + transmitterType: 'SwitchboardPush', + }, + filter: { + branch: ['main'], + documentId: ['*'], + documentType: ['*'], + scope: ['global'], + }, + label: 'Switchboard Sync', + listenerId: '1', + system: true, + }, + ], + triggers: [], + pullInterval: 3000, + }, + })); + + return { + defaultRemoteDrives: defaultDrives, + removeOldRemoteDrives: { + strategy: 'preserve-by-url', + urls: defaultDrivesUrl || [], + }, + }; +};