From d7504fa5e63a2b64a50c64c31c2853259c62c2b9 Mon Sep 17 00:00:00 2001 From: lumix Date: Thu, 22 May 2025 13:09:43 +0800 Subject: [PATCH] feat: add rule for eslint import & autofix (#116) * feat: add rule for eslint import & autofix * feat: autofix unused import * feat: autofix unused import * test: seems secret is not working --- .eslintignore.web | 1 + .eslintrc.cjs | 80 +- .github/workflows/web_coverage.yaml | 3 +- deploy/server.ts | 15 +- package.json | 7 +- pnpm-lock.yaml | 980 ++++++++++++++++-- src/application/database-yjs/cell.parse.ts | 14 +- src/application/database-yjs/cell.type.ts | 4 +- .../services/js-services/http/http_api.ts | 180 ++-- src/application/services/js-services/index.ts | 190 ++-- src/application/services/services.type.ts | 10 +- .../slate-yjs/utils/applyToSlate.ts | 36 +- src/components/editor/EditorOverlay.tsx | 58 +- vite.config.ts | 3 +- 14 files changed, 1256 insertions(+), 325 deletions(-) diff --git a/.eslintignore.web b/.eslintignore.web index 17209292..8a362dbe 100644 --- a/.eslintignore.web +++ b/.eslintignore.web @@ -3,4 +3,5 @@ dist/ .eslintrc.cjs tsconfig.json vite.config.ts +vite-env.d.ts coverage/ \ No newline at end of file diff --git a/.eslintrc.cjs b/.eslintrc.cjs index be02b0d0..d710c09a 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -5,7 +5,12 @@ module.exports = { es6: true, node: true, }, - extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:import/recommended', + 'plugin:import/typescript' + ], parser: '@typescript-eslint/parser', parserOptions: { project: 'tsconfig.json', @@ -13,7 +18,15 @@ module.exports = { tsconfigRootDir: __dirname, extraFileExtensions: ['.json'], }, - plugins: ['@typescript-eslint', 'react-hooks'], + plugins: ['@typescript-eslint', 'react-hooks', 'import', 'unused-imports'], + settings: { + 'import/resolver': { + typescript: { + alwaysTryTypes: true, + project: 'tsconfig.json', + }, + }, + }, rules: { 'react-hooks/rules-of-hooks': 'error', 'react-hooks/exhaustive-deps': 'error', @@ -34,7 +47,8 @@ module.exports = { eqeqeq: ['error', 'always'], 'no-cond-assign': 'error', 'no-duplicate-case': 'error', - 'no-duplicate-imports': 'error', + // replaced by import/no-duplicates + 'no-duplicate-imports': 'off', 'no-empty': [ 'error', { @@ -66,8 +80,66 @@ module.exports = { { blankLine: 'any', prev: 'import', next: 'import' }, { blankLine: 'always', prev: 'block-like', next: '*' }, { blankLine: 'always', prev: 'block', next: '*' }, - ], + 'import/no-unresolved': ['error', { + ignore: ['\\.svg$', 'bun'] + }], + 'import/named': 'warn', + 'import/namespace': 'warn', + 'import/default': 'warn', + 'import/export': 'warn', + 'import/no-duplicates': 'error', + // Detect whether there are modules that are exported but not used. + 'import/no-unused-modules': 'warn', + + // unused-imports should be error level so eslint can auto fix it + 'unused-imports/no-unused-imports': 'error', + 'unused-imports/no-unused-vars': [ + 'error', + { + vars: 'all', + varsIgnorePattern: '^_', + args: 'after-used', + argsIgnorePattern: '^_' + } + ], + '@typescript-eslint/no-unused-vars': ['error', { + vars: 'all', + varsIgnorePattern: '^_', + args: 'after-used', + argsIgnorePattern: '^_' + }], + + 'import/order': ['warn', { + 'groups': [ + 'builtin', + 'external', + 'internal', + 'parent', + 'sibling', + 'index', + 'object', + 'type' + ], + 'newlines-between': 'always', + 'alphabetize': { + 'order': 'asc', + 'caseInsensitive': true + }, + 'pathGroups': [ + { + 'pattern': '@/**', + 'group': 'internal', + 'position': 'after' + }, + { + 'pattern': 'src/**', + 'group': 'internal', + 'position': 'after' + } + ], + 'pathGroupsExcludedImportTypes': ['builtin'] + }] }, ignorePatterns: ['src/**/*.test.ts', '**/__tests__/**/*.json', 'package.json', '__mocks__/*.ts'], }; diff --git a/.github/workflows/web_coverage.yaml b/.github/workflows/web_coverage.yaml index bee3ecc2..460027a2 100644 --- a/.github/workflows/web_coverage.yaml +++ b/.github/workflows/web_coverage.yaml @@ -44,7 +44,6 @@ jobs: with: component: true build: pnpm run build - start: pnpm run start browser: chrome env: COVERAGE: "true" @@ -58,7 +57,7 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v2 with: - token: ${{ secrets.WEB_CODE_COV }} + token: cf9245e0-e136-4e21-b0ee-35755fa0c493 files: coverage/jest/lcov.info, coverage/cypress/lcov.info flags: appflowy_web name: codecov-umbrella diff --git a/deploy/server.ts b/deploy/server.ts index 2b0a2d07..f9f84fb0 100644 --- a/deploy/server.ts +++ b/deploy/server.ts @@ -1,10 +1,11 @@ -import path from 'path'; import * as fs from 'fs'; -import pino from 'pino'; -import { type CheerioAPI, load } from 'cheerio'; +import path from 'path'; + +// @ts-expect-error no bun // eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-expect-error import { fetch } from 'bun'; +import { type CheerioAPI, load } from 'cheerio'; +import pino from 'pino'; const distDir = path.join(__dirname, 'dist'); const indexPath = path.join(distDir, 'index.html'); @@ -270,9 +271,9 @@ const start = () => { start(); -export {}; +export { }; -function getIconBase64 (svgText: string, color: string) { +function getIconBase64(svgText: string, color: string) { let newSvgText = svgText.replace(/fill="[^"]*"/g, ``); newSvgText = newSvgText.replace('= 0.4'} dependencies: - call-bind: 1.0.7 - is-array-buffer: 3.0.4 + call-bind: 1.0.8 + is-array-buffer: 3.0.5 + dev: true + + /array-buffer-byte-length@1.0.2: + resolution: {integrity: sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + is-array-buffer: 3.0.5 dev: true /array-includes@3.1.8: @@ -6533,6 +6554,19 @@ packages: engines: {node: '>=8'} dev: true + /array.prototype.findlastindex@1.2.6: + resolution: {integrity: sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.4 + define-properties: 1.2.1 + es-abstract: 1.23.9 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + es-shim-unscopables: 1.1.0 + dev: true + /array.prototype.flat@1.3.2: resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==} engines: {node: '>= 0.4'} @@ -6567,14 +6601,27 @@ packages: resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} engines: {node: '>= 0.4'} dependencies: - array-buffer-byte-length: 1.0.1 - call-bind: 1.0.7 + array-buffer-byte-length: 1.0.2 + call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.3 + es-abstract: 1.23.9 es-errors: 1.3.0 - get-intrinsic: 1.2.4 - is-array-buffer: 3.0.4 - is-shared-array-buffer: 1.0.3 + get-intrinsic: 1.3.0 + is-array-buffer: 3.0.5 + is-shared-array-buffer: 1.0.4 + dev: true + + /arraybuffer.prototype.slice@1.0.4: + resolution: {integrity: sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.2 + call-bind: 1.0.8 + define-properties: 1.2.1 + es-abstract: 1.23.9 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + is-array-buffer: 3.0.5 dev: true /asn1@0.2.6: @@ -6591,6 +6638,11 @@ packages: engines: {node: '>=8'} dev: true + /async-function@1.0.0: + resolution: {integrity: sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==} + engines: {node: '>= 0.4'} + dev: true + /async-retry@1.3.3: resolution: {integrity: sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==} dependencies: @@ -6947,6 +6999,13 @@ packages: write-file-atomic: 3.0.3 dev: true + /call-bind-apply-helpers@1.0.2: + resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + /call-bind@1.0.7: resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} engines: {node: '>= 0.4'} @@ -6956,6 +7015,24 @@ packages: function-bind: 1.1.2 get-intrinsic: 1.2.4 set-function-length: 1.2.2 + dev: true + + /call-bind@1.0.8: + resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==} + engines: {node: '>= 0.4'} + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.0 + get-intrinsic: 1.2.4 + set-function-length: 1.2.2 + + /call-bound@1.0.4: + resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind-apply-helpers: 1.0.2 + get-intrinsic: 1.3.0 + dev: true /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} @@ -7938,27 +8015,54 @@ packages: resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 es-errors: 1.3.0 - is-data-view: 1.0.1 + is-data-view: 1.0.2 + dev: true + + /data-view-buffer@1.0.2: + resolution: {integrity: sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-data-view: 1.0.2 dev: true /data-view-byte-length@1.0.1: resolution: {integrity: sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 es-errors: 1.3.0 - is-data-view: 1.0.1 + is-data-view: 1.0.2 + dev: true + + /data-view-byte-length@1.0.2: + resolution: {integrity: sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-data-view: 1.0.2 dev: true /data-view-byte-offset@1.0.0: resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 es-errors: 1.3.0 - is-data-view: 1.0.1 + is-data-view: 1.0.2 + dev: true + + /data-view-byte-offset@1.0.1: + resolution: {integrity: sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-data-view: 1.0.2 dev: true /date-arithmetic@4.1.0: @@ -8293,6 +8397,15 @@ packages: engines: {node: '>=12'} dev: true + /dunder-proto@1.0.1: + resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} + engines: {node: '>= 0.4'} + dependencies: + call-bind-apply-helpers: 1.0.2 + es-errors: 1.3.0 + gopd: 1.2.0 + dev: true + /duplexify@3.7.1: resolution: {integrity: sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==} dependencies: @@ -8394,7 +8507,7 @@ packages: data-view-byte-offset: 1.0.0 es-define-property: 1.0.0 es-errors: 1.3.0 - es-object-atoms: 1.0.0 + es-object-atoms: 1.1.1 es-set-tostringtag: 2.0.3 es-to-primitive: 1.2.1 function.prototype.name: 1.1.6 @@ -8433,12 +8546,73 @@ packages: which-typed-array: 1.1.15 dev: true + /es-abstract@1.23.9: + resolution: {integrity: sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.2 + arraybuffer.prototype.slice: 1.0.4 + available-typed-arrays: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.4 + data-view-buffer: 1.0.2 + data-view-byte-length: 1.0.2 + data-view-byte-offset: 1.0.1 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + es-set-tostringtag: 2.1.0 + es-to-primitive: 1.3.0 + function.prototype.name: 1.1.8 + get-intrinsic: 1.3.0 + get-proto: 1.0.1 + get-symbol-description: 1.1.0 + globalthis: 1.0.4 + gopd: 1.2.0 + has-property-descriptors: 1.0.2 + has-proto: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.2 + internal-slot: 1.1.0 + is-array-buffer: 3.0.5 + is-callable: 1.2.7 + is-data-view: 1.0.2 + is-regex: 1.2.1 + is-shared-array-buffer: 1.0.4 + is-string: 1.1.1 + is-typed-array: 1.1.15 + is-weakref: 1.1.1 + math-intrinsics: 1.1.0 + object-inspect: 1.13.4 + object-keys: 1.1.1 + object.assign: 4.1.7 + own-keys: 1.0.1 + regexp.prototype.flags: 1.5.4 + safe-array-concat: 1.1.3 + safe-push-apply: 1.0.0 + safe-regex-test: 1.1.0 + set-proto: 1.0.0 + string.prototype.trim: 1.2.10 + string.prototype.trimend: 1.0.9 + string.prototype.trimstart: 1.0.8 + typed-array-buffer: 1.0.3 + typed-array-byte-length: 1.0.3 + typed-array-byte-offset: 1.0.4 + typed-array-length: 1.0.7 + unbox-primitive: 1.1.0 + which-typed-array: 1.1.19 + dev: true + /es-define-property@1.0.0: resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} engines: {node: '>= 0.4'} dependencies: get-intrinsic: 1.2.4 + /es-define-property@1.0.1: + resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} + engines: {node: '>= 0.4'} + /es-errors@1.3.0: resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} engines: {node: '>= 0.4'} @@ -8458,11 +8632,28 @@ packages: es-errors: 1.3.0 dev: true + /es-object-atoms@1.1.1: + resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + dev: true + /es-set-tostringtag@2.0.3: resolution: {integrity: sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==} engines: {node: '>= 0.4'} dependencies: - get-intrinsic: 1.2.4 + get-intrinsic: 1.3.0 + has-tostringtag: 1.0.2 + hasown: 2.0.2 + dev: true + + /es-set-tostringtag@2.1.0: + resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + get-intrinsic: 1.3.0 has-tostringtag: 1.0.2 hasown: 2.0.2 dev: true @@ -8473,6 +8664,13 @@ packages: hasown: 2.0.2 dev: true + /es-shim-unscopables@1.1.0: + resolution: {integrity: sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==} + engines: {node: '>= 0.4'} + dependencies: + hasown: 2.0.2 + dev: true + /es-to-primitive@1.2.1: resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} engines: {node: '>= 0.4'} @@ -8482,6 +8680,15 @@ packages: is-symbol: 1.0.4 dev: true + /es-to-primitive@1.3.0: + resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==} + engines: {node: '>= 0.4'} + dependencies: + is-callable: 1.2.7 + is-date-object: 1.0.5 + is-symbol: 1.0.4 + dev: true + /es6-error@4.1.1: resolution: {integrity: sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==} dev: true @@ -8549,6 +8756,104 @@ packages: source-map: 0.6.1 dev: true + /eslint-import-resolver-node@0.3.9: + resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} + dependencies: + debug: 3.2.7(supports-color@8.1.1) + is-core-module: 2.13.1 + resolve: 1.22.8 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0): + resolution: {integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + eslint: '*' + eslint-plugin-import: '*' + dependencies: + debug: 4.3.7 + enhanced-resolve: 5.16.1 + eslint: 8.57.0 + eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.2.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + fast-glob: 3.3.2 + get-tsconfig: 4.10.0 + is-core-module: 2.13.1 + is-glob: 4.0.3 + transitivePeerDependencies: + - '@typescript-eslint/parser' + - eslint-import-resolver-node + - eslint-import-resolver-webpack + - supports-color + dev: true + + /eslint-module-utils@2.12.0(@typescript-eslint/parser@7.2.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): + resolution: {integrity: sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: '*' + eslint-import-resolver-node: '*' + eslint-import-resolver-typescript: '*' + eslint-import-resolver-webpack: '*' + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + eslint: + optional: true + eslint-import-resolver-node: + optional: true + eslint-import-resolver-typescript: + optional: true + eslint-import-resolver-webpack: + optional: true + dependencies: + '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@4.9.5) + debug: 3.2.7(supports-color@8.1.1) + eslint: 8.57.0 + eslint-import-resolver-node: 0.3.9 + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): + resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + dependencies: + '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@4.9.5) + array-includes: 3.1.8 + array.prototype.findlastindex: 1.2.6 + array.prototype.flat: 1.3.2 + array.prototype.flatmap: 1.3.2 + debug: 3.2.7(supports-color@8.1.1) + doctrine: 2.1.0 + eslint: 8.57.0 + eslint-import-resolver-node: 0.3.9 + eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.2.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + hasown: 2.0.2 + is-core-module: 2.13.1 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.fromentries: 2.0.8 + object.groupby: 1.0.3 + object.values: 1.2.0 + semver: 6.3.1 + tsconfig-paths: 3.15.0 + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + dev: true + /eslint-plugin-react-hooks@4.6.0(eslint@8.57.0): resolution: {integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==} engines: {node: '>=10'} @@ -8590,6 +8895,19 @@ packages: string.prototype.matchall: 4.0.11 dev: true + /eslint-plugin-unused-imports@4.1.4(@typescript-eslint/eslint-plugin@7.2.0)(eslint@8.57.0): + resolution: {integrity: sha512-YptD6IzQjDardkl0POxnnRBhU1OEePMV0nd6siHaRBbd+lyh6NAhFEobiznKU7kTsSsDeSD62Pe7kAM1b7dAZQ==} + peerDependencies: + '@typescript-eslint/eslint-plugin': ^8.0.0-0 || ^7.0.0 || ^6.0.0 || ^5.0.0 + eslint: ^9.0.0 || ^8.0.0 + peerDependenciesMeta: + '@typescript-eslint/eslint-plugin': + optional: true + dependencies: + '@typescript-eslint/eslint-plugin': 7.2.0(@typescript-eslint/parser@7.2.0)(eslint@8.57.0)(typescript@4.9.5) + eslint: 8.57.0 + dev: true + /eslint-scope@5.1.1: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} engines: {node: '>=8.0.0'} @@ -8851,7 +9169,7 @@ packages: '@nodelib/fs.walk': 1.2.8 glob-parent: 5.1.2 merge2: 1.4.1 - micromatch: 4.0.5 + micromatch: 4.0.8 /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} @@ -8999,6 +9317,13 @@ packages: is-callable: 1.2.7 dev: true + /for-each@0.3.5: + resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} + engines: {node: '>= 0.4'} + dependencies: + is-callable: 1.2.7 + dev: true + /foreground-child@2.0.0: resolution: {integrity: sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==} engines: {node: '>=8.0.0'} @@ -9107,12 +9432,24 @@ packages: resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.3 + es-abstract: 1.23.9 functions-have-names: 1.2.3 dev: true + /function.prototype.name@1.1.8: + resolution: {integrity: sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.4 + define-properties: 1.2.1 + functions-have-names: 1.2.3 + hasown: 2.0.2 + is-callable: 1.2.7 + dev: true + /functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} @@ -9134,6 +9471,22 @@ packages: has-symbols: 1.0.3 hasown: 2.0.2 + /get-intrinsic@1.3.0: + resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + function-bind: 1.1.2 + get-proto: 1.0.1 + gopd: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.2 + math-intrinsics: 1.1.0 + dev: true + /get-node-dimensions@1.2.1: resolution: {integrity: sha512-2MSPMu7S1iOTL+BOa6K1S62hB2zUAYNF/lV0gSVlOaacd087lc6nR1H1r0e3B1CerTo+RceOmi1iJW+vp21xcQ==} dev: false @@ -9163,6 +9516,14 @@ packages: through: 2.3.8 dev: false + /get-proto@1.0.1: + resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} + engines: {node: '>= 0.4'} + dependencies: + dunder-proto: 1.0.1 + es-object-atoms: 1.1.1 + dev: true + /get-stdin@5.0.1: resolution: {integrity: sha512-jZV7n6jGE3Gt7fgSTJoz91Ak5MuTLwMwkoYdjxuJ/AmjIsE1UC03y/IWkZCQGEvVNS9qoRNwy5BCqxImv0FVeA==} engines: {node: '>=0.12.0'} @@ -9190,9 +9551,24 @@ packages: resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 es-errors: 1.3.0 - get-intrinsic: 1.2.4 + get-intrinsic: 1.3.0 + dev: true + + /get-symbol-description@1.1.0: + resolution: {integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + dev: true + + /get-tsconfig@4.10.0: + resolution: {integrity: sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==} + dependencies: + resolve-pkg-maps: 1.0.0 dev: true /getos@3.2.1: @@ -9272,6 +9648,14 @@ packages: define-properties: 1.2.1 dev: true + /globalthis@1.0.4: + resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} + engines: {node: '>= 0.4'} + dependencies: + define-properties: 1.2.1 + gopd: 1.2.0 + dev: true + /globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} @@ -9305,6 +9689,11 @@ packages: dependencies: get-intrinsic: 1.2.4 + /gopd@1.2.0: + resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} + engines: {node: '>= 0.4'} + dev: true + /graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} @@ -9364,16 +9753,28 @@ packages: /has-property-descriptors@1.0.2: resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} dependencies: - es-define-property: 1.0.0 + es-define-property: 1.0.1 /has-proto@1.0.3: resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} engines: {node: '>= 0.4'} + /has-proto@1.2.0: + resolution: {integrity: sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==} + engines: {node: '>= 0.4'} + dependencies: + dunder-proto: 1.0.1 + dev: true + /has-symbols@1.0.3: resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} engines: {node: '>= 0.4'} + /has-symbols@1.1.0: + resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} + engines: {node: '>= 0.4'} + dev: true + /has-tostringtag@1.0.2: resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} engines: {node: '>= 0.4'} @@ -9737,6 +10138,15 @@ packages: side-channel: 1.0.6 dev: true + /internal-slot@1.1.0: + resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + hasown: 2.0.2 + side-channel: 1.1.0 + dev: true + /internmap@1.0.1: resolution: {integrity: sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==} dev: false @@ -9760,7 +10170,7 @@ packages: resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 has-tostringtag: 1.0.2 dev: false @@ -9768,19 +10178,46 @@ packages: resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 + call-bind: 1.0.8 + get-intrinsic: 1.3.0 + dev: true + + /is-array-buffer@3.0.5: + resolution: {integrity: sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.4 + get-intrinsic: 1.3.0 dev: true /is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + /is-async-function@2.1.1: + resolution: {integrity: sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==} + engines: {node: '>= 0.4'} + dependencies: + async-function: 1.0.0 + call-bound: 1.0.4 + get-proto: 1.0.1 + has-tostringtag: 1.0.2 + safe-regex-test: 1.1.0 + dev: true + /is-bigint@1.0.4: resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} dependencies: has-bigints: 1.0.2 dev: true + /is-bigint@1.1.0: + resolution: {integrity: sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==} + engines: {node: '>= 0.4'} + dependencies: + has-bigints: 1.0.2 + dev: true + /is-binary-path@2.1.0: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} @@ -9791,7 +10228,15 @@ packages: resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 + has-tostringtag: 1.0.2 + dev: true + + /is-boolean-object@1.2.2: + resolution: {integrity: sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 has-tostringtag: 1.0.2 dev: true @@ -9828,12 +10273,29 @@ packages: is-typed-array: 1.1.13 dev: true + /is-data-view@1.0.2: + resolution: {integrity: sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + get-intrinsic: 1.3.0 + is-typed-array: 1.1.15 + dev: true + /is-date-object@1.0.5: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.2 + /is-date-object@1.1.0: + resolution: {integrity: sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + has-tostringtag: 1.0.2 + dev: true + /is-deflate@1.0.0: resolution: {integrity: sha512-YDoFpuZWu1VRXlsnlYMzKyVRITXj7Ej/V9gXQ2/pAe7X1J7M/RNOqaIYi6qUn+B7nGyB9pDXrv02dsB58d2ZAQ==} dev: true @@ -9848,6 +10310,13 @@ packages: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} + /is-finalizationregistry@1.1.1: + resolution: {integrity: sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + dev: true + /is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} @@ -9856,6 +10325,16 @@ packages: resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} engines: {node: '>=6'} + /is-generator-function@1.1.0: + resolution: {integrity: sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + get-proto: 1.0.1 + has-tostringtag: 1.0.2 + safe-regex-test: 1.1.0 + dev: true + /is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -9879,6 +10358,11 @@ packages: is-path-inside: 3.0.3 dev: true + /is-map@2.0.3: + resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==} + engines: {node: '>= 0.4'} + dev: true + /is-negative-zero@2.0.3: resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} engines: {node: '>= 0.4'} @@ -9891,6 +10375,14 @@ packages: has-tostringtag: 1.0.2 dev: true + /is-number-object@1.1.1: + resolution: {integrity: sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + has-tostringtag: 1.0.2 + dev: true + /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -9925,14 +10417,36 @@ packages: resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 has-tostringtag: 1.0.2 + /is-regex@1.2.1: + resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + gopd: 1.2.0 + has-tostringtag: 1.0.2 + hasown: 2.0.2 + dev: true + + /is-set@2.0.3: + resolution: {integrity: sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==} + engines: {node: '>= 0.4'} + dev: true + /is-shared-array-buffer@1.0.3: resolution: {integrity: sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 + dev: true + + /is-shared-array-buffer@1.0.4: + resolution: {integrity: sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 dev: true /is-stream@1.1.0: @@ -9951,11 +10465,28 @@ packages: has-tostringtag: 1.0.2 dev: true + /is-string@1.1.1: + resolution: {integrity: sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + has-tostringtag: 1.0.2 + dev: true + /is-symbol@1.0.4: resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} engines: {node: '>= 0.4'} dependencies: - has-symbols: 1.0.3 + has-symbols: 1.1.0 + dev: true + + /is-symbol@1.1.1: + resolution: {integrity: sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + has-symbols: 1.1.0 + safe-regex-test: 1.1.0 dev: true /is-typed-array@1.1.13: @@ -9965,6 +10496,13 @@ packages: which-typed-array: 1.1.15 dev: true + /is-typed-array@1.1.15: + resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==} + engines: {node: '>= 0.4'} + dependencies: + which-typed-array: 1.1.19 + dev: true + /is-typedarray@1.0.0: resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==} @@ -9973,10 +10511,30 @@ packages: engines: {node: '>=10'} dev: true + /is-weakmap@2.0.2: + resolution: {integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==} + engines: {node: '>= 0.4'} + dev: true + /is-weakref@1.0.2: resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 + dev: true + + /is-weakref@1.1.1: + resolution: {integrity: sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + dev: true + + /is-weakset@2.0.4: + resolution: {integrity: sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + get-intrinsic: 1.3.0 dev: true /is-windows@1.0.2: @@ -10680,6 +11238,13 @@ packages: /json-stringify-safe@5.0.1: resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} + /json5@1.0.2: + resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} + hasBin: true + dependencies: + minimist: 1.2.8 + dev: true + /json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} @@ -11066,6 +11631,11 @@ packages: resolution: {integrity: sha512-6qE4B9deFBIa9YSpOc9O0Sgc43zTeVYbgDT5veRKSlB2+ZuHNoVVxA1L/ckMUayV9Ay9y7Z/SZCLcGteW9i7bg==} dev: false + /math-intrinsics@1.1.0: + resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} + engines: {node: '>= 0.4'} + dev: true + /mdast-util-find-and-replace@3.0.2: resolution: {integrity: sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==} dependencies: @@ -11809,11 +12379,16 @@ packages: resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} dev: true + /object-inspect@1.13.4: + resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==} + engines: {node: '>= 0.4'} + dev: true + /object-is@1.1.6: resolution: {integrity: sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 dev: false @@ -11825,12 +12400,24 @@ packages: resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 has-symbols: 1.0.3 object-keys: 1.1.1 dev: true + /object.assign@4.1.7: + resolution: {integrity: sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.4 + define-properties: 1.2.1 + es-object-atoms: 1.1.1 + has-symbols: 1.1.0 + object-keys: 1.1.1 + dev: true + /object.entries@1.1.8: resolution: {integrity: sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==} engines: {node: '>= 0.4'} @@ -11850,6 +12437,15 @@ packages: es-object-atoms: 1.0.0 dev: true + /object.groupby@1.0.3: + resolution: {integrity: sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.3 + dev: true + /object.hasown@1.1.4: resolution: {integrity: sha512-FZ9LZt9/RHzGySlBARE3VF+gE26TxR38SdmqOqliuTnl9wrKulaQs+4dee1V+Io8VfxqzAfHu6YuRgUy8OHoTg==} engines: {node: '>= 0.4'} @@ -11913,6 +12509,15 @@ packages: resolution: {integrity: sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA==} dev: true + /own-keys@1.0.1: + resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.3.0 + object-keys: 1.1.1 + safe-push-apply: 1.0.0 + dev: true + /p-finally@1.0.0: resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==} engines: {node: '>=4'} @@ -13311,6 +13916,20 @@ packages: resolution: {integrity: sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==} dev: false + /reflect.getprototypeof@1.0.10: + resolution: {integrity: sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + es-abstract: 1.23.9 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + get-intrinsic: 1.3.0 + get-proto: 1.0.1 + which-builtin-type: 1.2.1 + dev: true + /regenerate-unicode-properties@10.1.1: resolution: {integrity: sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q==} engines: {node: '>=4'} @@ -13339,11 +13958,23 @@ packages: resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 es-errors: 1.3.0 set-function-name: 2.0.2 + /regexp.prototype.flags@1.5.4: + resolution: {integrity: sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + es-errors: 1.3.0 + get-proto: 1.0.1 + gopd: 1.2.0 + set-function-name: 2.0.2 + dev: true + /regexpu-core@5.3.2: resolution: {integrity: sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==} engines: {node: '>=4'} @@ -13462,6 +14093,10 @@ packages: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} + /resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + dev: true + /resolve.exports@2.0.2: resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==} engines: {node: '>=10'} @@ -13589,9 +14224,20 @@ packages: resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==} engines: {node: '>=0.4'} dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 - has-symbols: 1.0.3 + call-bind: 1.0.8 + get-intrinsic: 1.3.0 + has-symbols: 1.1.0 + isarray: 2.0.5 + dev: true + + /safe-array-concat@1.1.3: + resolution: {integrity: sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==} + engines: {node: '>=0.4'} + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.4 + get-intrinsic: 1.3.0 + has-symbols: 1.1.0 isarray: 2.0.5 dev: true @@ -13602,15 +14248,32 @@ packages: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} dev: true + /safe-push-apply@1.0.0: + resolution: {integrity: sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + isarray: 2.0.5 + dev: true + /safe-regex-test@1.0.3: resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 es-errors: 1.3.0 is-regex: 1.1.4 dev: true + /safe-regex-test@1.1.0: + resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-regex: 1.2.1 + dev: true + /safe-stable-stringify@2.4.3: resolution: {integrity: sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==} engines: {node: '>=10'} @@ -13735,6 +14398,15 @@ packages: functions-have-names: 1.2.3 has-property-descriptors: 1.0.2 + /set-proto@1.0.0: + resolution: {integrity: sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==} + engines: {node: '>= 0.4'} + dependencies: + dunder-proto: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + dev: true + /shallow-clone@3.0.1: resolution: {integrity: sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==} engines: {node: '>=8'} @@ -13768,16 +14440,56 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} + /side-channel-list@1.0.0: + resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.4 + dev: true + + /side-channel-map@1.0.1: + resolution: {integrity: sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + dev: true + + /side-channel-weakmap@1.0.2: + resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + side-channel-map: 1.0.1 + dev: true + /side-channel@1.0.6: resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 es-errors: 1.3.0 get-intrinsic: 1.2.4 object-inspect: 1.13.1 dev: true + /side-channel@1.1.0: + resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.4 + side-channel-list: 1.0.0 + side-channel-map: 1.0.1 + side-channel-weakmap: 1.0.2 + dev: true + /signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} @@ -14029,31 +14741,54 @@ packages: side-channel: 1.0.6 dev: true + /string.prototype.trim@1.2.10: + resolution: {integrity: sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.4 + define-data-property: 1.1.4 + define-properties: 1.2.1 + es-abstract: 1.23.9 + es-object-atoms: 1.1.1 + has-property-descriptors: 1.0.2 + dev: true + /string.prototype.trim@1.2.9: resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.3 - es-object-atoms: 1.0.0 + es-abstract: 1.23.9 + es-object-atoms: 1.1.1 dev: true /string.prototype.trimend@1.0.8: resolution: {integrity: sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - es-object-atoms: 1.0.0 + es-object-atoms: 1.1.1 + dev: true + + /string.prototype.trimend@1.0.9: + resolution: {integrity: sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.4 + define-properties: 1.2.1 + es-object-atoms: 1.1.1 dev: true /string.prototype.trimstart@1.0.8: resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - es-object-atoms: 1.0.0 + es-object-atoms: 1.1.1 dev: true /string_decoder@1.1.1: @@ -14619,6 +15354,15 @@ packages: resolution: {integrity: sha512-YKhUKqbteklNppC2NqL7dv1cWF8eEobgHVD5kjF1y9Q4ocqpBiaDlYslQ9eMhtbqIPRrA68RIEXqknEjlxdwxw==} dev: true + /tsconfig-paths@3.15.0: + resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} + dependencies: + '@types/json5': 0.0.29 + json5: 1.0.2 + minimist: 1.2.8 + strip-bom: 3.0.0 + dev: true + /tsconfig@7.0.0: resolution: {integrity: sha512-vZXmzPrL+EmC4T/4rVlT2jNVMWCi/O4DIiSj3UHg1OE5kCKbk4mfrXc6dZksLgRM/TZlKnousKH9bbTazUWRRw==} dependencies: @@ -14672,20 +15416,40 @@ packages: resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 es-errors: 1.3.0 - is-typed-array: 1.1.13 + is-typed-array: 1.1.15 + dev: true + + /typed-array-buffer@1.0.3: + resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-typed-array: 1.1.15 dev: true /typed-array-byte-length@1.0.1: resolution: {integrity: sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 - is-typed-array: 1.1.13 + gopd: 1.2.0 + has-proto: 1.2.0 + is-typed-array: 1.1.15 + dev: true + + /typed-array-byte-length@1.0.3: + resolution: {integrity: sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.8 + for-each: 0.3.3 + gopd: 1.2.0 + has-proto: 1.2.0 + is-typed-array: 1.1.15 dev: true /typed-array-byte-offset@1.0.2: @@ -14693,25 +15457,50 @@ packages: engines: {node: '>= 0.4'} dependencies: available-typed-arrays: 1.0.7 - call-bind: 1.0.7 + call-bind: 1.0.8 for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 - is-typed-array: 1.1.13 + gopd: 1.2.0 + has-proto: 1.2.0 + is-typed-array: 1.1.15 + dev: true + + /typed-array-byte-offset@1.0.4: + resolution: {integrity: sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.8 + for-each: 0.3.3 + gopd: 1.2.0 + has-proto: 1.2.0 + is-typed-array: 1.1.15 + reflect.getprototypeof: 1.0.10 dev: true /typed-array-length@1.0.6: resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 - is-typed-array: 1.1.13 + gopd: 1.2.0 + has-proto: 1.2.0 + is-typed-array: 1.1.15 possible-typed-array-names: 1.0.0 dev: true + /typed-array-length@1.0.7: + resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.8 + for-each: 0.3.3 + gopd: 1.2.0 + is-typed-array: 1.1.15 + possible-typed-array-names: 1.0.0 + reflect.getprototypeof: 1.0.10 + dev: true + /typedarray-to-buffer@3.1.5: resolution: {integrity: sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==} dependencies: @@ -14734,12 +15523,22 @@ packages: /unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 has-bigints: 1.0.2 - has-symbols: 1.0.3 + has-symbols: 1.1.0 which-boxed-primitive: 1.0.2 dev: true + /unbox-primitive@1.1.0: + resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + has-bigints: 1.0.2 + has-symbols: 1.1.0 + which-boxed-primitive: 1.1.1 + dev: true + /uncontrollable@7.2.1(react@18.2.0): resolution: {integrity: sha512-svtcfoTADIB0nT9nltgjujTi7BzVmwjZClOmskKu/E8FW9BXzg9os8OLr4f8Dlnk0rYWJIWr4wv9eKUXiQvQwQ==} peerDependencies: @@ -15326,10 +16125,50 @@ packages: is-bigint: 1.0.4 is-boolean-object: 1.1.2 is-number-object: 1.0.7 - is-string: 1.0.7 + is-string: 1.1.1 is-symbol: 1.0.4 dev: true + /which-boxed-primitive@1.1.1: + resolution: {integrity: sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==} + engines: {node: '>= 0.4'} + dependencies: + is-bigint: 1.1.0 + is-boolean-object: 1.2.2 + is-number-object: 1.1.1 + is-string: 1.1.1 + is-symbol: 1.1.1 + dev: true + + /which-builtin-type@1.2.1: + resolution: {integrity: sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==} + engines: {node: '>= 0.4'} + dependencies: + call-bound: 1.0.4 + function.prototype.name: 1.1.8 + has-tostringtag: 1.0.2 + is-async-function: 2.1.1 + is-date-object: 1.1.0 + is-finalizationregistry: 1.1.1 + is-generator-function: 1.1.0 + is-regex: 1.2.1 + is-weakref: 1.1.1 + isarray: 2.0.5 + which-boxed-primitive: 1.1.1 + which-collection: 1.0.2 + which-typed-array: 1.1.19 + dev: true + + /which-collection@1.0.2: + resolution: {integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==} + engines: {node: '>= 0.4'} + dependencies: + is-map: 2.0.3 + is-set: 2.0.3 + is-weakmap: 2.0.2 + is-weakset: 2.0.4 + dev: true + /which-module@2.0.1: resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} dev: true @@ -15339,9 +16178,22 @@ packages: engines: {node: '>= 0.4'} dependencies: available-typed-arrays: 1.0.7 - call-bind: 1.0.7 + call-bind: 1.0.8 for-each: 0.3.3 - gopd: 1.0.1 + gopd: 1.2.0 + has-tostringtag: 1.0.2 + dev: true + + /which-typed-array@1.1.19: + resolution: {integrity: sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.4 + for-each: 0.3.5 + get-proto: 1.0.1 + gopd: 1.2.0 has-tostringtag: 1.0.2 dev: true diff --git a/src/application/database-yjs/cell.parse.ts b/src/application/database-yjs/cell.parse.ts index 97bc5ca1..8835e952 100644 --- a/src/application/database-yjs/cell.parse.ts +++ b/src/application/database-yjs/cell.parse.ts @@ -1,9 +1,9 @@ import { YDatabaseCell, YjsDatabaseKey } from '@/application/types'; import { FieldType } from '@/application/database-yjs/database.type'; -import { YArray } from 'yjs/dist/src/types/YArray'; +import * as Y from 'yjs'; import { Cell, CheckboxCell, DateTimeCell, FileMediaCell, FileMediaCellData } from './cell.type'; -export function parseYDatabaseCommonCellToCell (cell: YDatabaseCell): Cell { +export function parseYDatabaseCommonCellToCell(cell: YDatabaseCell): Cell { return { createdAt: Number(cell.get(YjsDatabaseKey.created_at)), lastModified: Number(cell.get(YjsDatabaseKey.last_modified)), @@ -12,7 +12,7 @@ export function parseYDatabaseCommonCellToCell (cell: YDatabaseCell): Cell { }; } -export function parseYDatabaseCellToCell (cell: YDatabaseCell): Cell { +export function parseYDatabaseCellToCell(cell: YDatabaseCell): Cell { const fieldType = parseInt(cell.get(YjsDatabaseKey.field_type)); if (fieldType === FieldType.DateTime) { @@ -30,7 +30,7 @@ export function parseYDatabaseCellToCell (cell: YDatabaseCell): Cell { return parseYDatabaseCommonCellToCell(cell); } -export function parseYDatabaseDateTimeCellToCell (cell: YDatabaseCell): DateTimeCell { +export function parseYDatabaseDateTimeCellToCell(cell: YDatabaseCell): DateTimeCell { return { ...parseYDatabaseCommonCellToCell(cell), data: cell.get(YjsDatabaseKey.data) as string, @@ -42,8 +42,8 @@ export function parseYDatabaseDateTimeCellToCell (cell: YDatabaseCell): DateTime }; } -export function parseYDatabaseFileMediaCellToCell (cell: YDatabaseCell): FileMediaCell { - const data = cell.get(YjsDatabaseKey.data) as YArray; +export function parseYDatabaseFileMediaCellToCell(cell: YDatabaseCell): FileMediaCell { + const data = cell.get(YjsDatabaseKey.data) as Y.Array; const dataJson = data.toJSON().map((item: string) => JSON.parse(item)) as FileMediaCellData; return { @@ -53,7 +53,7 @@ export function parseYDatabaseFileMediaCellToCell (cell: YDatabaseCell): FileMed }; } -export function parseYDatabaseCheckboxCellToCell (cell: YDatabaseCell): CheckboxCell { +export function parseYDatabaseCheckboxCellToCell(cell: YDatabaseCell): CheckboxCell { return { ...parseYDatabaseCommonCellToCell(cell), data: cell.get(YjsDatabaseKey.data) === 'Yes', diff --git a/src/application/database-yjs/cell.type.ts b/src/application/database-yjs/cell.type.ts index 67b991dc..5a102742 100644 --- a/src/application/database-yjs/cell.type.ts +++ b/src/application/database-yjs/cell.type.ts @@ -2,7 +2,7 @@ import { FieldId, RowId } from '@/application/types'; import { DateFormat, TimeFormat } from '@/application/database-yjs/index'; import { FieldType } from '@/application/database-yjs/database.type'; import React from 'react'; -import { YArray } from 'yjs/dist/src/types/YArray'; +import * as Y from 'yjs'; export interface Cell { createdAt: number; @@ -97,7 +97,7 @@ export interface ChecklistCell extends Cell { export interface RelationCell extends Cell { fieldType: FieldType.Relation; - data: YArray; + data: Y.Array; } export type RelationCellData = RowId[]; diff --git a/src/application/services/js-services/http/http_api.ts b/src/application/services/js-services/http/http_api.ts index fea13ba3..3744f5d5 100644 --- a/src/application/services/js-services/http/http_api.ts +++ b/src/application/services/js-services/http/http_api.ts @@ -46,17 +46,17 @@ import dayjs from 'dayjs'; import { omit } from 'lodash-es'; import { nanoid } from 'nanoid'; import { notify } from '@/components/_shared/notify'; -import { RepeatedChatMessage } from '@appflowyinc/ai-chat/dist/types'; +import { RepeatedChatMessage } from '@appflowyinc/ai-chat'; export * from './gotrue'; let axiosInstance: AxiosInstance | null = null; -export function getAxiosInstance () { +export function getAxiosInstance() { return axiosInstance; } -export function initAPIService (config: AFCloudConfig) { +export function initAPIService(config: AFCloudConfig) { if (axiosInstance) { return; } @@ -131,7 +131,7 @@ export function initAPIService (config: AFCloudConfig) { }); } -export async function signInWithUrl (url: string) { +export async function signInWithUrl(url: string) { const hash = new URL(url).hash; if (!hash) { @@ -168,7 +168,7 @@ export async function signInWithUrl (url: string) { } } -export async function verifyToken (accessToken: string) { +export async function verifyToken(accessToken: string) { const url = `/api/user/verify/${accessToken}`; const response = await axiosInstance?.get<{ code: number; @@ -187,7 +187,7 @@ export async function verifyToken (accessToken: string) { return Promise.reject(data); } -export async function getCurrentUser (): Promise { +export async function getCurrentUser(): Promise { const url = '/api/user/profile'; const response = await axiosInstance?.get<{ code: number; @@ -235,7 +235,7 @@ interface AFWorkspace { database_storage_id: string, } -function afWorkspace2Workspace (workspace: AFWorkspace): Workspace { +function afWorkspace2Workspace(workspace: AFWorkspace): Workspace { return { id: workspace.workspace_id, owner: { @@ -250,7 +250,7 @@ function afWorkspace2Workspace (workspace: AFWorkspace): Workspace { }; } -export async function openWorkspace (workspaceId: string) { +export async function openWorkspace(workspaceId: string) { const url = `/api/workspace/${workspaceId}/open`; const response = await axiosInstance?.put<{ code: number; @@ -264,7 +264,7 @@ export async function openWorkspace (workspaceId: string) { return Promise.reject(response?.data); } -export async function updateWorkspace (workspaceId: string, payload: UpdateWorkspacePayload) { +export async function updateWorkspace(workspaceId: string, payload: UpdateWorkspacePayload) { const url = `/api/workspace`; const response = await axiosInstance?.patch<{ code: number; @@ -286,7 +286,7 @@ export async function updateWorkspace (workspaceId: string, payload: UpdateWorks return Promise.reject(data); } -export async function createWorkspace (payload: CreateWorkspacePayload) { +export async function createWorkspace(payload: CreateWorkspacePayload) { const url = '/api/workspace'; const response = await axiosInstance?.post<{ code: number; @@ -305,7 +305,7 @@ export async function createWorkspace (payload: CreateWorkspacePayload) { return Promise.reject(data); } -export async function getUserWorkspaceInfo (): Promise<{ +export async function getUserWorkspaceInfo(): Promise<{ user_id: string; selected_workspace: Workspace; workspaces: Workspace[]; @@ -339,7 +339,7 @@ export async function getUserWorkspaceInfo (): Promise<{ return Promise.reject(data); } -export async function publishView (workspaceId: string, viewId: string, payload?: PublishViewPayload) { +export async function publishView(workspaceId: string, viewId: string, payload?: PublishViewPayload) { const url = `/api/workspace/${workspaceId}/page-view/${viewId}/publish`; const response = await axiosInstance?.post<{ code: number; @@ -353,7 +353,7 @@ export async function publishView (workspaceId: string, viewId: string, payload? return Promise.reject(response?.data); } -export async function unpublishView (workspaceId: string, viewId: string) { +export async function unpublishView(workspaceId: string, viewId: string) { const url = `/api/workspace/${workspaceId}/page-view/${viewId}/unpublish`; const response = await axiosInstance?.post<{ code: number; @@ -367,7 +367,7 @@ export async function unpublishView (workspaceId: string, viewId: string) { return Promise.reject(response?.data); } -export async function updatePublishNamespace (workspaceId: string, payload: UploadPublishNamespacePayload) { +export async function updatePublishNamespace(workspaceId: string, payload: UploadPublishNamespacePayload) { const url = `/api/workspace/${workspaceId}/publish-namespace`; const response = await axiosInstance?.put<{ code: number; @@ -381,7 +381,7 @@ export async function updatePublishNamespace (workspaceId: string, payload: Uplo return Promise.reject(response?.data); } -export async function getPublishViewMeta (namespace: string, publishName: string) { +export async function getPublishViewMeta(namespace: string, publishName: string) { const url = `/api/workspace/v1/published/${namespace}/${publishName}`; const response = await axiosInstance?.get<{ code: number; @@ -400,7 +400,7 @@ export async function getPublishViewMeta (namespace: string, publishName: string return response?.data.data; } -export async function getPublishViewBlob (namespace: string, publishName: string) { +export async function getPublishViewBlob(namespace: string, publishName: string) { const url = `/api/workspace/published/${namespace}/${publishName}/blob`; const response = await axiosInstance?.get(url, { responseType: 'blob', @@ -409,7 +409,7 @@ export async function getPublishViewBlob (namespace: string, publishName: string return blobToBytes(response?.data); } -export async function updateCollab (workspaceId: string, objectId: string, collabType: Types, docState: Uint8Array, context: { +export async function updateCollab(workspaceId: string, objectId: string, collabType: Types, docState: Uint8Array, context: { version_vector: number; }) { const url = `/api/workspace/v1/${workspaceId}/collab/${objectId}/web-update`; @@ -440,7 +440,7 @@ export async function updateCollab (workspaceId: string, objectId: string, colla return context; } -export async function getCollab (workspaceId: string, objectId: string, collabType: Types) { +export async function getCollab(workspaceId: string, objectId: string, collabType: Types) { const url = `/api/workspace/v1/${workspaceId}/collab/${objectId}`; const response = await axiosInstance?.get<{ code: number; @@ -466,7 +466,7 @@ export async function getCollab (workspaceId: string, objectId: string, collabTy }; } -export async function getPageCollab (workspaceId: string, viewId: string) { +export async function getPageCollab(workspaceId: string, viewId: string) { const url = `/api/workspace/${workspaceId}/page-view/${viewId}`; const response = await axiosInstance?.get<{ code: number; @@ -500,7 +500,7 @@ export async function getPageCollab (workspaceId: string, viewId: string) { }; } -export async function getPublishView (publishNamespace: string, publishName: string) { +export async function getPublishView(publishNamespace: string, publishName: string) { const meta = await getPublishViewMeta(publishNamespace, publishName); const blob = await getPublishViewBlob(publishNamespace, publishName); @@ -537,7 +537,7 @@ export async function getPublishView (publishNamespace: string, publishName: str } } -export async function updatePublishConfig (workspaceId: string, payload: UpdatePublishConfigPayload) { +export async function updatePublishConfig(workspaceId: string, payload: UpdatePublishConfigPayload) { const url = `/api/workspace/${workspaceId}/publish`; const response = await axiosInstance?.patch<{ code: number; @@ -551,7 +551,7 @@ export async function updatePublishConfig (workspaceId: string, payload: UpdateP return Promise.reject(response?.data); } -export async function getPublishInfoWithViewId (viewId: string) { +export async function getPublishInfoWithViewId(viewId: string) { const url = `/api/workspace/v1/published-info/${viewId}`; const response = await axiosInstance?.get<{ code: number; @@ -576,7 +576,7 @@ export async function getPublishInfoWithViewId (viewId: string) { return Promise.reject(data); } -export async function getAppFavorites (workspaceId: string) { +export async function getAppFavorites(workspaceId: string) { const url = `/api/workspace/${workspaceId}/favorite`; const response = await axiosInstance?.get<{ code: number; @@ -595,7 +595,7 @@ export async function getAppFavorites (workspaceId: string) { return Promise.reject(data); } -export async function getAppTrash (workspaceId: string) { +export async function getAppTrash(workspaceId: string) { const url = `/api/workspace/${workspaceId}/trash`; const response = await axiosInstance?.get<{ code: number; @@ -614,7 +614,7 @@ export async function getAppTrash (workspaceId: string) { return Promise.reject(data); } -export async function getAppRecent (workspaceId: string) { +export async function getAppRecent(workspaceId: string) { const url = `/api/workspace/${workspaceId}/recent`; const response = await axiosInstance?.get<{ code: number; @@ -633,7 +633,7 @@ export async function getAppRecent (workspaceId: string) { return Promise.reject(data); } -export async function getAppOutline (workspaceId: string) { +export async function getAppOutline(workspaceId: string) { const url = `/api/workspace/${workspaceId}/folder?depth=10`; const response = await axiosInstance?.get<{ @@ -651,7 +651,7 @@ export async function getAppOutline (workspaceId: string) { return Promise.reject(data); } -export async function getView (workspaceId: string, viewId: string, depth: number = 1) { +export async function getView(workspaceId: string, viewId: string, depth: number = 1) { const url = `/api/workspace/${workspaceId}/folder?depth=${depth}&root_view_id=${viewId}`; const response = await axiosInstance?.get<{ code: number; @@ -668,7 +668,7 @@ export async function getView (workspaceId: string, viewId: string, depth: numbe return Promise.reject(data); } -export async function getPublishNamespace (workspaceId: string) { +export async function getPublishNamespace(workspaceId: string) { const url = `/api/workspace/${workspaceId}/publish-namespace`; const response = await axiosInstance?.get<{ code: number; @@ -685,7 +685,7 @@ export async function getPublishNamespace (workspaceId: string) { return Promise.reject(data); } -export async function getPublishHomepage (workspaceId: string) { +export async function getPublishHomepage(workspaceId: string) { const url = `/api/workspace/${workspaceId}/publish-default`; const response = await axiosInstance?.get<{ code: number; @@ -707,7 +707,7 @@ export async function getPublishHomepage (workspaceId: string) { return Promise.reject(data); } -export async function updatePublishHomepage (workspaceId: string, viewId: string) { +export async function updatePublishHomepage(workspaceId: string, viewId: string) { const url = `/api/workspace/${workspaceId}/publish-default`; const response = await axiosInstance?.put<{ code: number; @@ -723,7 +723,7 @@ export async function updatePublishHomepage (workspaceId: string, viewId: string return Promise.reject(response?.data); } -export async function removePublishHomepage (workspaceId: string) { +export async function removePublishHomepage(workspaceId: string) { const url = `/api/workspace/${workspaceId}/publish-default`; const response = await axiosInstance?.delete<{ code: number; @@ -737,7 +737,7 @@ export async function removePublishHomepage (workspaceId: string) { return Promise.reject(response?.data); } -export async function getPublishOutline (publishNamespace: string) { +export async function getPublishOutline(publishNamespace: string) { const url = `/api/workspace/published-outline/${publishNamespace}`; const response = await axiosInstance?.get<{ code: number; @@ -754,7 +754,7 @@ export async function getPublishOutline (publishNamespace: string) { return Promise.reject(data); } -export async function getPublishViewComments (viewId: string): Promise { +export async function getPublishViewComments(viewId: string): Promise { const url = `/api/workspace/published-info/${viewId}/comment`; const response = await axiosInstance?.get<{ code: number; @@ -803,7 +803,7 @@ export async function getPublishViewComments (viewId: string): Promise> { +export async function getReactions(viewId: string, commentId?: string): Promise> { let url = `/api/workspace/published-info/${viewId}/reaction`; if (commentId) { @@ -854,7 +854,7 @@ export async function getReactions (viewId: string, commentId?: string): Promise return Promise.reject(data); } -export async function createGlobalCommentOnPublishView (viewId: string, content: string, replyCommentId?: string) { +export async function createGlobalCommentOnPublishView(viewId: string, content: string, replyCommentId?: string) { const url = `/api/workspace/published-info/${viewId}/comment`; const response = await axiosInstance?.post<{ code: number; message: string }>(url, { content, @@ -868,7 +868,7 @@ export async function createGlobalCommentOnPublishView (viewId: string, content: return Promise.reject(response?.data.message); } -export async function deleteGlobalCommentOnPublishView (viewId: string, commentId: string) { +export async function deleteGlobalCommentOnPublishView(viewId: string, commentId: string) { const url = `/api/workspace/published-info/${viewId}/comment`; const response = await axiosInstance?.delete<{ code: number; message: string }>(url, { data: { @@ -883,7 +883,7 @@ export async function deleteGlobalCommentOnPublishView (viewId: string, commentI return Promise.reject(response?.data.message); } -export async function addReaction (viewId: string, commentId: string, reactionType: string) { +export async function addReaction(viewId: string, commentId: string, reactionType: string) { const url = `/api/workspace/published-info/${viewId}/reaction`; const response = await axiosInstance?.post<{ code: number; message: string }>(url, { comment_id: commentId, @@ -897,7 +897,7 @@ export async function addReaction (viewId: string, commentId: string, reactionTy return Promise.reject(response?.data.message); } -export async function removeReaction (viewId: string, commentId: string, reactionType: string) { +export async function removeReaction(viewId: string, commentId: string, reactionType: string) { const url = `/api/workspace/published-info/${viewId}/reaction`; const response = await axiosInstance?.delete<{ code: number; message: string }>(url, { data: { @@ -913,7 +913,7 @@ export async function removeReaction (viewId: string, commentId: string, reactio return Promise.reject(response?.data.message); } -export async function getWorkspaces (): Promise { +export async function getWorkspaces(): Promise { const query = new URLSearchParams({ include_member_count: 'true', }); @@ -951,7 +951,7 @@ export interface WorkspaceFolder { children: WorkspaceFolder[]; } -function iterateFolder (folder: WorkspaceFolder): FolderView { +function iterateFolder(folder: WorkspaceFolder): FolderView { return { id: folder.view_id, name: folder.name, @@ -965,7 +965,7 @@ function iterateFolder (folder: WorkspaceFolder): FolderView { }; } -export async function getWorkspaceFolder (workspaceId: string): Promise { +export async function getWorkspaceFolder(workspaceId: string): Promise { const url = `/api/workspace/${workspaceId}/folder`; const response = await axiosInstance?.get<{ code: number; @@ -988,7 +988,7 @@ export interface DuplicatePublishViewPayload { dest_view_id: string; } -export async function duplicatePublishView (workspaceId: string, payload: DuplicatePublishViewPayload) { +export async function duplicatePublishView(workspaceId: string, payload: DuplicatePublishViewPayload) { const url = `/api/workspace/${workspaceId}/published-duplicate`; const res = await axiosInstance?.post<{ @@ -1006,7 +1006,7 @@ export async function duplicatePublishView (workspaceId: string, payload: Duplic return Promise.reject(res?.data.message); } -export async function createTemplate (template: UploadTemplatePayload) { +export async function createTemplate(template: UploadTemplatePayload) { const url = '/api/template-center/template'; const response = await axiosInstance?.post<{ code: number; @@ -1020,7 +1020,7 @@ export async function createTemplate (template: UploadTemplatePayload) { return Promise.reject(response?.data.message); } -export async function updateTemplate (viewId: string, template: UploadTemplatePayload) { +export async function updateTemplate(viewId: string, template: UploadTemplatePayload) { const url = `/api/template-center/template/${viewId}`; const response = await axiosInstance?.put<{ code: number; @@ -1034,7 +1034,7 @@ export async function updateTemplate (viewId: string, template: UploadTemplatePa return Promise.reject(response?.data.message); } -export async function getTemplates ({ +export async function getTemplates({ categoryId, nameContains, }: { @@ -1065,7 +1065,7 @@ export async function getTemplates ({ return Promise.reject(data); } -export async function getTemplateById (viewId: string) { +export async function getTemplateById(viewId: string) { const url = `/api/template-center/template/${viewId}`; const response = await axiosInstance?.get<{ code: number; @@ -1082,7 +1082,7 @@ export async function getTemplateById (viewId: string) { return Promise.reject(data); } -export async function deleteTemplate (viewId: string) { +export async function deleteTemplate(viewId: string) { const url = `/api/template-center/template/${viewId}`; const response = await axiosInstance?.delete<{ code: number; @@ -1096,7 +1096,7 @@ export async function deleteTemplate (viewId: string) { return Promise.reject(response?.data.message); } -export async function getTemplateCategories () { +export async function getTemplateCategories() { const url = '/api/template-center/category'; const response = await axiosInstance?.get<{ code: number; @@ -1116,7 +1116,7 @@ export async function getTemplateCategories () { return Promise.reject(data); } -export async function addTemplateCategory (category: TemplateCategoryFormValues) { +export async function addTemplateCategory(category: TemplateCategoryFormValues) { const url = '/api/template-center/category'; const response = await axiosInstance?.post<{ code: number; @@ -1130,7 +1130,7 @@ export async function addTemplateCategory (category: TemplateCategoryFormValues) return Promise.reject(response?.data.message); } -export async function updateTemplateCategory (id: string, category: TemplateCategoryFormValues) { +export async function updateTemplateCategory(id: string, category: TemplateCategoryFormValues) { const url = `/api/template-center/category/${id}`; const response = await axiosInstance?.put<{ code: number; @@ -1144,7 +1144,7 @@ export async function updateTemplateCategory (id: string, category: TemplateCate return Promise.reject(response?.data.message); } -export async function deleteTemplateCategory (categoryId: string) { +export async function deleteTemplateCategory(categoryId: string) { const url = `/api/template-center/category/${categoryId}`; const response = await axiosInstance?.delete<{ code: number; @@ -1158,7 +1158,7 @@ export async function deleteTemplateCategory (categoryId: string) { return Promise.reject(response?.data.message); } -export async function getTemplateCreators () { +export async function getTemplateCreators() { const url = '/api/template-center/creator'; const response = await axiosInstance?.get<{ code: number; @@ -1177,7 +1177,7 @@ export async function getTemplateCreators () { return Promise.reject(data); } -export async function createTemplateCreator (creator: TemplateCreatorFormValues) { +export async function createTemplateCreator(creator: TemplateCreatorFormValues) { const url = '/api/template-center/creator'; const response = await axiosInstance?.post<{ code: number; @@ -1191,7 +1191,7 @@ export async function createTemplateCreator (creator: TemplateCreatorFormValues) return Promise.reject(response?.data.message); } -export async function updateTemplateCreator (creatorId: string, creator: TemplateCreatorFormValues) { +export async function updateTemplateCreator(creatorId: string, creator: TemplateCreatorFormValues) { const url = `/api/template-center/creator/${creatorId}`; const response = await axiosInstance?.put<{ code: number; @@ -1205,7 +1205,7 @@ export async function updateTemplateCreator (creatorId: string, creator: Templat return Promise.reject(response?.data.message); } -export async function deleteTemplateCreator (creatorId: string) { +export async function deleteTemplateCreator(creatorId: string) { const url = `/api/template-center/creator/${creatorId}`; const response = await axiosInstance?.delete<{ code: number; @@ -1219,7 +1219,7 @@ export async function deleteTemplateCreator (creatorId: string) { return Promise.reject(response?.data.message); } -export async function uploadTemplateAvatar (file: File) { +export async function uploadTemplateAvatar(file: File) { const url = '/api/template-center/avatar'; const formData = new FormData(); @@ -1249,7 +1249,7 @@ export async function uploadTemplateAvatar (file: File) { return Promise.reject(data); } -export async function getInvitation (invitationId: string) { +export async function getInvitation(invitationId: string) { const url = `/api/workspace/invite/${invitationId}`; const response = await axiosInstance?.get<{ code: number; @@ -1266,7 +1266,7 @@ export async function getInvitation (invitationId: string) { return Promise.reject(data); } -export async function acceptInvitation (invitationId: string) { +export async function acceptInvitation(invitationId: string) { const url = `/api/workspace/accept-invite/${invitationId}`; const response = await axiosInstance?.post<{ code: number; @@ -1280,7 +1280,7 @@ export async function acceptInvitation (invitationId: string) { return Promise.reject(response?.data.message); } -export async function getRequestAccessInfo (requestId: string): Promise { +export async function getRequestAccessInfo(requestId: string): Promise { const url = `/api/access-request/${requestId}`; const response = await axiosInstance?.get<{ code: number; @@ -1310,7 +1310,7 @@ export async function getRequestAccessInfo (requestId: string): Promise void) { +export async function uploadImportFile(presignedUrl: string, file: File, onProgress: (progress: number) => void) { const response = await axios.put(presignedUrl, file, { onUploadProgress: (progressEvent) => { const { progress = 0 } = progressEvent; @@ -1460,7 +1460,7 @@ export async function uploadImportFile (presignedUrl: string, file: File, onProg }); } -export async function addAppPage (workspaceId: string, parentViewId: string, { +export async function addAppPage(workspaceId: string, parentViewId: string, { layout, name, }: CreatePagePayload) { @@ -1484,7 +1484,7 @@ export async function addAppPage (workspaceId: string, parentViewId: string, { return Promise.reject(response?.data); } -export async function updatePage (workspaceId: string, viewId: string, data: UpdatePagePayload) { +export async function updatePage(workspaceId: string, viewId: string, data: UpdatePagePayload) { const url = `/api/workspace/${workspaceId}/page-view/${viewId}`; const res = await axiosInstance?.patch<{ @@ -1499,7 +1499,7 @@ export async function updatePage (workspaceId: string, viewId: string, data: Upd return Promise.reject(res?.data); } -export async function deleteTrash (workspaceId: string, viewId?: string) { +export async function deleteTrash(workspaceId: string, viewId?: string) { if (viewId) { const url = `/api/workspace/${workspaceId}/trash/${viewId}`; const response = await axiosInstance?.delete<{ @@ -1528,7 +1528,7 @@ export async function deleteTrash (workspaceId: string, viewId?: string) { } -export async function moveToTrash (workspaceId: string, viewId: string) { +export async function moveToTrash(workspaceId: string, viewId: string) { const url = `/api/workspace/${workspaceId}/page-view/${viewId}/move-to-trash`; const response = await axiosInstance?.post<{ code: number; @@ -1542,7 +1542,7 @@ export async function moveToTrash (workspaceId: string, viewId: string) { return Promise.reject(response?.data); } -export async function movePageTo (workspaceId: string, viewId: string, parentViewId: string, prevViewId?: string) { +export async function movePageTo(workspaceId: string, viewId: string, parentViewId: string, prevViewId?: string) { const url = `/api/workspace/${workspaceId}/page-view/${viewId}/move`; const response = await axiosInstance?.post<{ code: number; @@ -1559,7 +1559,7 @@ export async function movePageTo (workspaceId: string, viewId: string, parentVie return Promise.reject(response?.data); } -export async function restorePage (workspaceId: string, viewId?: string) { +export async function restorePage(workspaceId: string, viewId?: string) { const url = viewId ? `/api/workspace/${workspaceId}/page-view/${viewId}/restore-from-trash` : `/api/workspace/${workspaceId}/restore-all-pages-from-trash`; const response = await axiosInstance?.post<{ code: number; @@ -1573,7 +1573,7 @@ export async function restorePage (workspaceId: string, viewId?: string) { return Promise.reject(response?.data); } -export async function createSpace (workspaceId: string, payload: CreateSpacePayload) { +export async function createSpace(workspaceId: string, payload: CreateSpacePayload) { const url = `/api/workspace/${workspaceId}/space`; const response = await axiosInstance?.post<{ code: number; @@ -1590,7 +1590,7 @@ export async function createSpace (workspaceId: string, payload: CreateSpacePayl return Promise.reject(response?.data); } -export async function updateSpace (workspaceId: string, payload: UpdateSpacePayload) { +export async function updateSpace(workspaceId: string, payload: UpdateSpacePayload) { const url = `/api/workspace/${workspaceId}/space/${payload.view_id}`; const data = omit(payload, ['view_id']); const response = await axiosInstance?.patch<{ @@ -1605,7 +1605,7 @@ export async function updateSpace (workspaceId: string, payload: UpdateSpacePayl return Promise.reject(response?.data); } -export async function uploadFile (workspaceId: string, viewId: string, file: File, onProgress?: (progress: number) => void) { +export async function uploadFile(workspaceId: string, viewId: string, file: File, onProgress?: (progress: number) => void) { const url = `/api/file_storage/${workspaceId}/v1/blob/${viewId}`; // Check file size, if over 7MB, check subscription plan @@ -1666,7 +1666,7 @@ export async function uploadFile (workspaceId: string, viewId: string, file: Fil } -export async function inviteMembers (workspaceId: string, emails: string[]) { +export async function inviteMembers(workspaceId: string, emails: string[]) { const url = `/api/workspace/${workspaceId}/invite`; const payload = emails.map(e => ({ @@ -1686,7 +1686,7 @@ export async function inviteMembers (workspaceId: string, emails: string[]) { return Promise.reject(res?.data); } -export async function getMembers (workspaceId: string) { +export async function getMembers(workspaceId: string) { const url = `/api/workspace/${workspaceId}/member`; const res = await axiosInstance?.get<{ code: number; @@ -1701,7 +1701,7 @@ export async function getMembers (workspaceId: string) { return Promise.reject(res?.data); } -export async function leaveWorkspace (workspaceId: string) { +export async function leaveWorkspace(workspaceId: string) { const url = `/api/workspace/${workspaceId}/leave`; const res = await axiosInstance?.post<{ code: number; @@ -1715,7 +1715,7 @@ export async function leaveWorkspace (workspaceId: string) { return Promise.reject(res?.data); } -export async function deleteWorkspace (workspaceId: string) { +export async function deleteWorkspace(workspaceId: string) { const url = `/api/workspace/${workspaceId}`; const res = await axiosInstance?.delete<{ code: number; @@ -1729,7 +1729,7 @@ export async function deleteWorkspace (workspaceId: string) { return Promise.reject(res?.data); } -export async function getQuickNoteList (workspaceId: string, params: { +export async function getQuickNoteList(workspaceId: string, params: { offset?: number; limit?: number; searchTerm?: string; @@ -1760,7 +1760,7 @@ export async function getQuickNoteList (workspaceId: string, params: { return Promise.reject(res?.data); } -export async function createQuickNote (workspaceId: string, payload: QuickNoteEditorData[]): Promise { +export async function createQuickNote(workspaceId: string, payload: QuickNoteEditorData[]): Promise { const url = `/api/workspace/${workspaceId}/quick-note`; const res = await axiosInstance?.post<{ code: number; @@ -1777,7 +1777,7 @@ export async function createQuickNote (workspaceId: string, payload: QuickNoteEd return Promise.reject(res?.data); } -export async function updateQuickNote (workspaceId: string, noteId: string, payload: QuickNoteEditorData[]) { +export async function updateQuickNote(workspaceId: string, noteId: string, payload: QuickNoteEditorData[]) { const url = `/api/workspace/${workspaceId}/quick-note/${noteId}`; const res = await axiosInstance?.put<{ code: number; @@ -1793,7 +1793,7 @@ export async function updateQuickNote (workspaceId: string, noteId: string, payl return Promise.reject(res?.data); } -export async function deleteQuickNote (workspaceId: string, noteId: string) { +export async function deleteQuickNote(workspaceId: string, noteId: string) { const url = `/api/workspace/${workspaceId}/quick-note/${noteId}`; const res = await axiosInstance?.delete<{ code: number; @@ -1807,7 +1807,7 @@ export async function deleteQuickNote (workspaceId: string, noteId: string) { return Promise.reject(res?.data); } -export async function cancelSubscription (workspaceId: string, plan: SubscriptionPlan, reason?: string) { +export async function cancelSubscription(workspaceId: string, plan: SubscriptionPlan, reason?: string) { const url = `/billing/api/v1/cancel-subscription`; const res = await axiosInstance?.post<{ code: number; @@ -1826,7 +1826,7 @@ export async function cancelSubscription (workspaceId: string, plan: Subscriptio return Promise.reject(res?.data); } -export async function searchWorkspace (workspaceId: string, query: string) { +export async function searchWorkspace(workspaceId: string, query: string) { const url = `/api/search/${workspaceId}`; const res = await axiosInstance?.get<{ code: number; @@ -1847,7 +1847,7 @@ export async function searchWorkspace (workspaceId: string, query: string) { return Promise.reject(res?.data); } -export async function getChatMessages (workspaceId: string, chatId: string, limit?: number | undefined) { +export async function getChatMessages(workspaceId: string, chatId: string, limit?: number | undefined) { const url = `/api/chat/${workspaceId}/${chatId}/message`; const response = await axiosInstance?.get<{ @@ -1867,7 +1867,7 @@ export async function getChatMessages (workspaceId: string, chatId: string, limi return Promise.reject(data); } -export async function duplicatePage (workspaceId: string, viewId: string) { +export async function duplicatePage(workspaceId: string, viewId: string) { const url = `/api/workspace/${workspaceId}/page-view/${viewId}/duplicate`; const response = await axiosInstance?.post<{ code: number; @@ -1881,7 +1881,7 @@ export async function duplicatePage (workspaceId: string, viewId: string) { return Promise.reject(response?.data); } -export async function joinWorkspaceByInvitationCode ( +export async function joinWorkspaceByInvitationCode( code: string, ) { const url = `/api/workspace/join-by-invite-code`; @@ -1902,7 +1902,7 @@ export async function joinWorkspaceByInvitationCode ( return Promise.reject(response?.data); } -export async function getWorkspaceInfoByInvitationCode (code: string) { +export async function getWorkspaceInfoByInvitationCode(code: string) { const url = `/api/invite-code-info`; const response = await axiosInstance?.get<{ diff --git a/src/application/services/js-services/index.ts b/src/application/services/js-services/index.ts index 291470b3..463ef063 100644 --- a/src/application/services/js-services/index.ts +++ b/src/application/services/js-services/index.ts @@ -48,7 +48,7 @@ import { YjsEditorKey, } from '@/application/types'; import { applyYDoc } from '@/application/ydoc/apply'; -import { RepeatedChatMessage } from '@appflowyinc/ai-chat/dist/types'; +import { RepeatedChatMessage } from '@appflowyinc/ai-chat'; import { nanoid } from 'nanoid'; import * as Y from 'yjs'; @@ -69,19 +69,19 @@ export class AFClientService implements AFService { } > = new Map(); - constructor (config: AFServiceConfig) { + constructor(config: AFServiceConfig) { APIService.initAPIService(config.cloudConfig); } - getAxiosInstance () { + getAxiosInstance() { return APIService.getAxiosInstance(); } - getClientId () { + getClientId() { return this.clientId; } - async publishView (workspaceId: string, viewId: string, payload?: PublishViewPayload) { + async publishView(workspaceId: string, viewId: string, payload?: PublishViewPayload) { if (this.publishViewInfo.has(viewId)) { this.publishViewInfo.delete(viewId); } @@ -89,7 +89,7 @@ export class AFClientService implements AFService { return APIService.publishView(workspaceId, viewId, payload); } - async unpublishView (workspaceId: string, viewId: string) { + async unpublishView(workspaceId: string, viewId: string) { if (this.publishViewInfo.has(viewId)) { this.publishViewInfo.delete(viewId); } @@ -97,28 +97,28 @@ export class AFClientService implements AFService { return APIService.unpublishView(workspaceId, viewId); } - async updatePublishNamespace (workspaceId: string, payload: UploadPublishNamespacePayload) { + async updatePublishNamespace(workspaceId: string, payload: UploadPublishNamespacePayload) { this.publishViewInfo.clear(); return APIService.updatePublishNamespace(workspaceId, payload); } - async getPublishNamespace (workspaceId: string) { + async getPublishNamespace(workspaceId: string) { return APIService.getPublishNamespace(workspaceId); } - async getPublishHomepage (workspaceId: string) { + async getPublishHomepage(workspaceId: string) { return APIService.getPublishHomepage(workspaceId); } - async updatePublishHomepage (workspaceId: string, viewId: string) { + async updatePublishHomepage(workspaceId: string, viewId: string) { return APIService.updatePublishHomepage(workspaceId, viewId); } - async removePublishHomepage (workspaceId: string) { + async removePublishHomepage(workspaceId: string) { return APIService.removePublishHomepage(workspaceId); } - async getPublishViewMeta (namespace: string, publishName: string) { + async getPublishViewMeta(namespace: string, publishName: string) { const name = `${namespace}_${publishName}`; const isLoaded = this.publishViewLoaded.has(name); @@ -140,7 +140,7 @@ export class AFClientService implements AFService { return viewMeta; } - async getPublishView (namespace: string, publishName: string) { + async getPublishView(namespace: string, publishName: string) { const name = `${namespace}_${publishName}`; const isLoaded = this.publishViewLoaded.has(name); @@ -175,7 +175,7 @@ export class AFClientService implements AFService { return doc; } - async getPublishRowDocument (viewId: string) { + async getPublishRowDocument(viewId: string) { const doc = await openCollabDB(viewId); if (hasCollabCache(doc)) { @@ -186,15 +186,15 @@ export class AFClientService implements AFService { } - async createRowDoc (rowKey: string) { + async createRowDoc(rowKey: string) { return createRowDoc(rowKey); } - deleteRowDoc (rowKey: string) { + deleteRowDoc(rowKey: string) { return deleteRowDoc(rowKey); } - async getAppDatabaseViewRelations (workspaceId: string, databaseStorageId: string) { + async getAppDatabaseViewRelations(workspaceId: string, databaseStorageId: string) { const res = await APIService.getCollab(workspaceId, databaseStorageId, Types.WorkspaceDatabase); const doc = new Y.Doc(); @@ -213,7 +213,7 @@ export class AFClientService implements AFService { return result; } - async getPublishInfo (viewId: string) { + async getPublishInfo(viewId: string) { if (this.publishViewInfo.has(viewId)) { return this.publishViewInfo.get(viewId) as { namespace: string; @@ -249,36 +249,36 @@ export class AFClientService implements AFService { return data; } - async updatePublishConfig (workspaceId: string, config: UpdatePublishConfigPayload) { + async updatePublishConfig(workspaceId: string, config: UpdatePublishConfigPayload) { this.publishViewInfo.delete(config.view_id); return APIService.updatePublishConfig(workspaceId, config); } - async getPublishOutline (namespace: string) { + async getPublishOutline(namespace: string) { return APIService.getPublishOutline(namespace); } - async getAppOutline (workspaceId: string) { + async getAppOutline(workspaceId: string) { return APIService.getAppOutline(workspaceId); } - async getAppView (workspaceId: string, viewId: string) { + async getAppView(workspaceId: string, viewId: string) { return APIService.getView(workspaceId, viewId); } - async getAppFavorites (workspaceId: string) { + async getAppFavorites(workspaceId: string) { return APIService.getAppFavorites(workspaceId); } - async getAppRecent (workspaceId: string) { + async getAppRecent(workspaceId: string) { return APIService.getAppRecent(workspaceId); } - async getAppTrash (workspaceId: string) { + async getAppTrash(workspaceId: string) { return APIService.getAppTrash(workspaceId); } - async loginAuth (url: string) { + async loginAuth(url: string) { try { await APIService.signInWithUrl(url); emit(EventType.SESSION_VALID); @@ -291,48 +291,48 @@ export class AFClientService implements AFService { } @withSignIn() - async signInMagicLink ({ email }: { email: string; redirectTo: string }) { + async signInMagicLink({ email }: { email: string; redirectTo: string }) { return await APIService.signInWithMagicLink(email, AUTH_CALLBACK_URL); } @withSignIn() - async signInOTP (params: { email: string; code: string; redirectTo: string }) { + async signInOTP(params: { email: string; code: string; redirectTo: string }) { return APIService.signInOTP(params); } @withSignIn() - async signInGoogle (_: { redirectTo: string }) { + async signInGoogle(_: { redirectTo: string }) { return APIService.signInGoogle(AUTH_CALLBACK_URL); } @withSignIn() - async signInApple (_: { redirectTo: string }) { + async signInApple(_: { redirectTo: string }) { return APIService.signInApple(AUTH_CALLBACK_URL); } @withSignIn() - async signInGithub (_: { redirectTo: string }) { + async signInGithub(_: { redirectTo: string }) { return APIService.signInGithub(AUTH_CALLBACK_URL); } @withSignIn() - async signInDiscord (_: { redirectTo: string }) { + async signInDiscord(_: { redirectTo: string }) { return APIService.signInDiscord(AUTH_CALLBACK_URL); } - async getWorkspaces () { + async getWorkspaces() { const data = APIService.getWorkspaces(); return data; } - async getWorkspaceFolder (workspaceId: string) { + async getWorkspaceFolder(workspaceId: string) { const data = await APIService.getWorkspaceFolder(workspaceId); return data; } - async getCurrentUser () { + async getCurrentUser() { const token = getTokenParsed(); const userId = token?.user?.id; @@ -349,19 +349,19 @@ export class AFClientService implements AFService { return user; } - async openWorkspace (workspaceId: string) { + async openWorkspace(workspaceId: string) { return APIService.openWorkspace(workspaceId); } - async createWorkspace (payload: CreateWorkspacePayload) { + async createWorkspace(payload: CreateWorkspacePayload) { return APIService.createWorkspace(payload); } - async updateWorkspace (workspaceId: string, payload: UpdateWorkspacePayload) { + async updateWorkspace(workspaceId: string, payload: UpdateWorkspacePayload) { return APIService.updateWorkspace(workspaceId, payload); } - async getUserWorkspaceInfo () { + async getUserWorkspaceInfo() { const workspaceInfo = await APIService.getUserWorkspaceInfo(); if (!workspaceInfo) { @@ -375,7 +375,7 @@ export class AFClientService implements AFService { }; } - async duplicatePublishView (params: DuplicatePublishView) { + async duplicatePublishView(params: DuplicatePublishView) { return APIService.duplicatePublishView(params.workspaceId, { dest_view_id: params.spaceViewId, published_view_id: params.viewId, @@ -383,90 +383,90 @@ export class AFClientService implements AFService { }); } - createCommentOnPublishView (viewId: string, content: string, replyCommentId: string | undefined): Promise { + createCommentOnPublishView(viewId: string, content: string, replyCommentId: string | undefined): Promise { return APIService.createGlobalCommentOnPublishView(viewId, content, replyCommentId); } - deleteCommentOnPublishView (viewId: string, commentId: string): Promise { + deleteCommentOnPublishView(viewId: string, commentId: string): Promise { return APIService.deleteGlobalCommentOnPublishView(viewId, commentId); } - getPublishViewGlobalComments (viewId: string): Promise { + getPublishViewGlobalComments(viewId: string): Promise { return APIService.getPublishViewComments(viewId); } - getPublishViewReactions (viewId: string, commentId?: string): Promise> { + getPublishViewReactions(viewId: string, commentId?: string): Promise> { return APIService.getReactions(viewId, commentId); } - addPublishViewReaction (viewId: string, commentId: string, reactionType: string): Promise { + addPublishViewReaction(viewId: string, commentId: string, reactionType: string): Promise { return APIService.addReaction(viewId, commentId, reactionType); } - removePublishViewReaction (viewId: string, commentId: string, reactionType: string): Promise { + removePublishViewReaction(viewId: string, commentId: string, reactionType: string): Promise { return APIService.removeReaction(viewId, commentId, reactionType); } - async getTemplateCategories () { + async getTemplateCategories() { return APIService.getTemplateCategories(); } - async getTemplateCreators () { + async getTemplateCreators() { return APIService.getTemplateCreators(); } - async createTemplate (template: UploadTemplatePayload) { + async createTemplate(template: UploadTemplatePayload) { return APIService.createTemplate(template); } - async updateTemplate (id: string, template: UploadTemplatePayload) { + async updateTemplate(id: string, template: UploadTemplatePayload) { return APIService.updateTemplate(id, template); } - async getTemplateById (id: string) { + async getTemplateById(id: string) { return APIService.getTemplateById(id); } - async getTemplates (params: { + async getTemplates(params: { categoryId?: string; nameContains?: string; }) { return APIService.getTemplates(params); } - async deleteTemplate (id: string) { + async deleteTemplate(id: string) { return APIService.deleteTemplate(id); } - async addTemplateCategory (category: TemplateCategoryFormValues) { + async addTemplateCategory(category: TemplateCategoryFormValues) { return APIService.addTemplateCategory(category); } - async updateTemplateCategory (categoryId: string, category: TemplateCategoryFormValues) { + async updateTemplateCategory(categoryId: string, category: TemplateCategoryFormValues) { return APIService.updateTemplateCategory(categoryId, category); } - async deleteTemplateCategory (categoryId: string) { + async deleteTemplateCategory(categoryId: string) { return APIService.deleteTemplateCategory(categoryId); } - async updateTemplateCreator (creatorId: string, creator: TemplateCreatorFormValues) { + async updateTemplateCreator(creatorId: string, creator: TemplateCreatorFormValues) { return APIService.updateTemplateCreator(creatorId, creator); } - async createTemplateCreator (creator: TemplateCreatorFormValues) { + async createTemplateCreator(creator: TemplateCreatorFormValues) { return APIService.createTemplateCreator(creator); } - async deleteTemplateCreator (creatorId: string) { + async deleteTemplateCreator(creatorId: string) { return APIService.deleteTemplateCreator(creatorId); } - async uploadTemplateAvatar (file: File) { + async uploadTemplateAvatar(file: File) { return APIService.uploadTemplateAvatar(file); } - async getPageDoc (workspaceId: string, viewId: string, errorCallback?: (error: { + async getPageDoc(workspaceId: string, viewId: string, errorCallback?: (error: { code: number; }) => void) { @@ -509,47 +509,47 @@ export class AFClientService implements AFService { return doc; } - async getInvitation (invitationId: string) { + async getInvitation(invitationId: string) { return APIService.getInvitation(invitationId); } - async acceptInvitation (invitationId: string) { + async acceptInvitation(invitationId: string) { return APIService.acceptInvitation(invitationId); } - approveRequestAccess (requestId: string): Promise { + approveRequestAccess(requestId: string): Promise { return APIService.approveRequestAccess(requestId); } - getRequestAccessInfo (requestId: string) { + getRequestAccessInfo(requestId: string) { return APIService.getRequestAccessInfo(requestId); } - sendRequestAccess (workspaceId: string, viewId: string): Promise { + sendRequestAccess(workspaceId: string, viewId: string): Promise { return APIService.sendRequestAccess(workspaceId, viewId); } - getSubscriptionLink (workspaceId: string, plan: SubscriptionPlan, interval: SubscriptionInterval) { + getSubscriptionLink(workspaceId: string, plan: SubscriptionPlan, interval: SubscriptionInterval) { return APIService.getSubscriptionLink(workspaceId, plan, interval); } - cancelSubscription (workspaceId: string, plan: SubscriptionPlan, reason?: string) { + cancelSubscription(workspaceId: string, plan: SubscriptionPlan, reason?: string) { return APIService.cancelSubscription(workspaceId, plan, reason); } - getSubscriptions () { + getSubscriptions() { return APIService.getSubscriptions(); } - getActiveSubscription (workspaceId: string) { + getActiveSubscription(workspaceId: string) { return APIService.getActiveSubscription(workspaceId); } - getWorkspaceSubscriptions (workspaceId: string) { + getWorkspaceSubscriptions(workspaceId: string) { return APIService.getWorkspaceSubscriptions(workspaceId); } - registerDocUpdate (doc: Y.Doc, context: { + registerDocUpdate(doc: Y.Doc, context: { workspaceId: string, objectId: string, collabType: Types }) { const token = getTokenParsed(); @@ -564,69 +564,69 @@ export class AFClientService implements AFService { sync.initialize(); } - async importFile (file: File, onProgress: (progress: number) => void) { + async importFile(file: File, onProgress: (progress: number) => void) { const task = await APIService.createImportTask(file); await APIService.uploadImportFile(task.presignedUrl, file, onProgress); } - async createSpace (workspaceId: string, payload: CreateSpacePayload) { + async createSpace(workspaceId: string, payload: CreateSpacePayload) { return APIService.createSpace(workspaceId, payload); } - async updateSpace (workspaceId: string, payload: UpdateSpacePayload) { + async updateSpace(workspaceId: string, payload: UpdateSpacePayload) { return APIService.updateSpace(workspaceId, payload); } - async addAppPage (workspaceId: string, parentViewId: string, payload: CreatePagePayload) { + async addAppPage(workspaceId: string, parentViewId: string, payload: CreatePagePayload) { return APIService.addAppPage(workspaceId, parentViewId, payload); } - async updateAppPage (workspaceId: string, viewId: string, data: UpdatePagePayload) { + async updateAppPage(workspaceId: string, viewId: string, data: UpdatePagePayload) { return APIService.updatePage(workspaceId, viewId, data); } - async duplicateAppPage (workspaceId: string, viewId: string) { + async duplicateAppPage(workspaceId: string, viewId: string) { return APIService.duplicatePage(workspaceId, viewId); } - async deleteTrash (workspaceId: string, viewId?: string) { + async deleteTrash(workspaceId: string, viewId?: string) { return APIService.deleteTrash(workspaceId, viewId); } - async moveToTrash (workspaceId: string, viewId: string) { + async moveToTrash(workspaceId: string, viewId: string) { return APIService.moveToTrash(workspaceId, viewId); } - async restoreFromTrash (workspaceId: string, viewId?: string) { + async restoreFromTrash(workspaceId: string, viewId?: string) { return APIService.restorePage(workspaceId, viewId); } - async movePage (workspaceId: string, viewId: string, parentId: string, prevViewId?: string) { + async movePage(workspaceId: string, viewId: string, parentId: string, prevViewId?: string) { return APIService.movePageTo(workspaceId, viewId, parentId, prevViewId); } - async uploadFile (workspaceId: string, viewId: string, file: File, onProgress?: (progress: number) => void) { + async uploadFile(workspaceId: string, viewId: string, file: File, onProgress?: (progress: number) => void) { return APIService.uploadFile(workspaceId, viewId, file, onProgress); } - deleteWorkspace (workspaceId: string): Promise { + deleteWorkspace(workspaceId: string): Promise { return APIService.deleteWorkspace(workspaceId); } - leaveWorkspace (workspaceId: string): Promise { + leaveWorkspace(workspaceId: string): Promise { return APIService.leaveWorkspace(workspaceId); } - inviteMembers (workspaceId: string, emails: string[]): Promise { + inviteMembers(workspaceId: string, emails: string[]): Promise { return APIService.inviteMembers(workspaceId, emails); } - getWorkspaceMembers (workspaceId: string): Promise { + getWorkspaceMembers(workspaceId: string): Promise { return APIService.getMembers(workspaceId); } - getQuickNoteList (workspaceId: string, params: { + getQuickNoteList(workspaceId: string, params: { offset?: number; limit?: number; searchTerm?: string; @@ -634,23 +634,23 @@ export class AFClientService implements AFService { return APIService.getQuickNoteList(workspaceId, params); } - createQuickNote (workspaceId: string, data: QuickNoteEditorData[]) { + createQuickNote(workspaceId: string, data: QuickNoteEditorData[]) { return APIService.createQuickNote(workspaceId, data); } - updateQuickNote (workspaceId: string, id: string, data: QuickNoteEditorData[]) { + updateQuickNote(workspaceId: string, id: string, data: QuickNoteEditorData[]) { return APIService.updateQuickNote(workspaceId, id, data); } - deleteQuickNote (workspaceId: string, id: string) { + deleteQuickNote(workspaceId: string, id: string) { return APIService.deleteQuickNote(workspaceId, id); } - searchWorkspace (workspaceId: string, query: string) { + searchWorkspace(workspaceId: string, query: string) { return APIService.searchWorkspace(workspaceId, query); } - async getChatMessages ( + async getChatMessages( workspaceId: string, chatId: string, limit?: number | undefined, @@ -658,11 +658,11 @@ export class AFClientService implements AFService { return APIService.getChatMessages(workspaceId, chatId, limit); } - async joinWorkspaceByInvitationCode (code: string) { + async joinWorkspaceByInvitationCode(code: string) { return APIService.joinWorkspaceByInvitationCode(code); } - async getWorkspaceInfoByInvitationCode (code: string) { + async getWorkspaceInfoByInvitationCode(code: string) { return APIService.getWorkspaceInfoByInvitationCode(code); } } diff --git a/src/application/services/services.type.ts b/src/application/services/services.type.ts index 6ad0731d..0fa4c1a3 100644 --- a/src/application/services/services.type.ts +++ b/src/application/services/services.type.ts @@ -36,7 +36,7 @@ import { UploadTemplatePayload, } from '@/application/template.type'; import { AxiosInstance } from 'axios'; -import { RepeatedChatMessage } from '@appflowyinc/ai-chat/dist/types'; +import { RepeatedChatMessage } from '@appflowyinc/ai-chat'; export type AFService = PublishService @@ -46,9 +46,9 @@ export type AFService = & QuickNoteService & AIChatService & { - getClientId: () => string; - getAxiosInstance: () => AxiosInstance | null; -}; + getClientId: () => string; + getAxiosInstance: () => AxiosInstance | null; + }; export interface AFServiceConfig { cloudConfig: AFCloudConfig; @@ -185,7 +185,7 @@ export interface PublishService { updatePublishHomepage: (workspaceId: string, viewId: string) => Promise; removePublishHomepage: (workspaceId: string) => Promise; - getPublishOutline (namespace: string): Promise; + getPublishOutline(namespace: string): Promise; getPublishViewGlobalComments: (viewId: string) => Promise; createCommentOnPublishView: (viewId: string, content: string, replyCommentId?: string) => Promise; diff --git a/src/application/slate-yjs/utils/applyToSlate.ts b/src/application/slate-yjs/utils/applyToSlate.ts index bfae06ac..b34b6d56 100644 --- a/src/application/slate-yjs/utils/applyToSlate.ts +++ b/src/application/slate-yjs/utils/applyToSlate.ts @@ -5,7 +5,7 @@ import { YBlock, YjsEditorKey } from '@/application/types'; import isEqual from 'lodash-es/isEqual'; import { Editor, Element, NodeEntry } from 'slate'; import { YEvent, YMapEvent, YTextEvent } from 'yjs'; -import { YText } from 'yjs/dist/src/types/YText'; +import * as Y from 'yjs'; import { dataStringTOJson, getBlock, getChildrenArray, getPageId, getText } from '@/application/slate-yjs/utils/yjs'; import { findSlateEntryByBlockId } from '@/application/slate-yjs/utils/editor'; @@ -17,17 +17,17 @@ export function translateYEvents(editor: YjsEditor, events: Array) { events.forEach((event) => { console.log(event.path); - if(isEqual(event.path, ['document', 'blocks'])) { + if (isEqual(event.path, ['document', 'blocks'])) { applyBlocksYEvent(editor, event as BlockMapEvent); } - if(isEqual((event.path), ['document', 'blocks', event.path[2]])) { + if (isEqual((event.path), ['document', 'blocks', event.path[2]])) { const blockId = event.path[2] as string; applyUpdateBlockYEvent(editor, blockId, event as YMapEvent); } - if(isEqual(event.path, ['document', 'meta', 'text_map', event.path[3]])) { + if (isEqual(event.path, ['document', 'meta', 'text_map', event.path[3]])) { const textId = event.path[3] as string; applyTextYEvent(editor, textId, event as YTextEvent); @@ -42,7 +42,7 @@ function applyUpdateBlockYEvent(editor: YjsEditor, blockId: string, event: YMapE const newData = dataStringTOJson(block.get(YjsEditorKey.block_data)); const entry = findSlateEntryByBlockId(editor, blockId); - if(!entry) { + if (!entry) { console.error('Block node not found', blockId); return []; } @@ -65,7 +65,7 @@ function applyUpdateBlockYEvent(editor: YjsEditor, blockId: string, event: YMapE function applyTextYEvent(editor: YjsEditor, textId: string, event: YTextEvent) { const { target } = event; - const yText = target as YText; + const yText = target as Y.Text; const delta = yText.toDelta(); const slateDelta = delta.flatMap(deltaInsertToSlateNode); const [entry] = editor.nodes({ @@ -75,7 +75,7 @@ function applyTextYEvent(editor: YjsEditor, textId: string, event: YTextEvent) { }); console.log('=== Applying text Yjs event ===', entry); - if(!entry) { + if (!entry) { console.error('Text node not found', textId); return []; } @@ -107,14 +107,14 @@ function applyBlocksYEvent(editor: YjsEditor, event: BlockMapEvent) { keysChanged.forEach((key: string) => { const value = keys.get(key); - if(!value) return; + if (!value) return; - if(value.action === 'add') { + if (value.action === 'add') { handleNewBlock(editor, key, keyPath); - } else if(value.action === 'delete') { + } else if (value.action === 'delete') { handleDeleteNode(editor, key); - } else if(value.action === 'update') { + } else if (value.action === 'update') { console.log('=== Applying block update Yjs event ===', key); } }); @@ -127,7 +127,7 @@ function handleNewBlock(editor: YjsEditor, key: string, keyPath: Record !Editor.isEditor(n) && Element.isElement(n) && n.blockId === parentId, mode: 'all', at: [], }); - if(!parentEntry) { - if(keyPath[parentId]) { + if (!parentEntry) { + if (keyPath[parentId]) { path = [...keyPath[parentId], index + 1]; } else { console.error('Parent block not found', parentId); @@ -198,7 +198,7 @@ function handleDeleteNode(editor: YjsEditor, key: string) { match: (n) => !Editor.isEditor(n) && Element.isElement(n) && n.blockId === key, }); - if(!entry) { + if (!entry) { console.error('Block not found'); return []; } diff --git a/src/components/editor/EditorOverlay.tsx b/src/components/editor/EditorOverlay.tsx index 85ae5ea8..6a7c05a0 100644 --- a/src/components/editor/EditorOverlay.tsx +++ b/src/components/editor/EditorOverlay.tsx @@ -9,13 +9,15 @@ import { notify } from '@/components/_shared/notify'; import { insertDataAfterBlock } from '@/components/ai-chat/utils'; import { useEditorContext } from '@/components/editor/EditorContext'; import { getScrollParent } from '@/components/global-comment/utils'; + import { AIAssistantProvider, ContextPlaceholder, WriterRequest } from '@appflowyinc/ai-chat'; import { EditorData } from '@appflowyinc/editor'; import { Portal } from '@mui/material'; -import React, { useCallback, useEffect, useMemo } from 'react'; +import { useCallback, useEffect, useMemo, useState } from 'react'; import { ErrorBoundary } from 'react-error-boundary'; import { Element, NodeEntry, Range, Text, Transforms } from 'slate'; import { ReactEditor, useSlate } from 'slate-react'; + import BlockPopover from './components/block-popover'; import Panels from './components/panels'; import Toolbars from './components/toolbar'; @@ -34,20 +36,20 @@ function EditorOverlay({ const start = useMemo(() => selection ? editor.start(selection) : null, [editor, selection]); const end = useMemo(() => selection ? editor.end(selection) : null, [editor, selection]); const startBlock = useMemo(() => { - if(!start) return null; + if (!start) return null; try { return getBlockEntry(editor, start); - } catch(e) { + } catch (e) { return null; } }, [editor, start]); const endBlock = useMemo(() => { - if(!end) return null; + if (!end) return null; try { return getBlockEntry(editor, end); - } catch(e) { + } catch (e) { return null; } }, [editor, end]); @@ -57,11 +59,11 @@ function EditorOverlay({ }, [workspaceId, viewId, requestInstance]); const handleInsertBelow = useCallback((data: EditorData) => { - if(!endBlock) return; + if (!endBlock) return; try { const [node] = endBlock as NodeEntry; - if(!node) return; + if (!node) return; const blockId = insertDataAfterBlock(editor.sharedRoot, data, node.blockId as string); @@ -70,10 +72,10 @@ function EditorOverlay({ const [, path] = findSlateEntryByBlockId(editor, blockId); editor.select(editor.end(path)); - } catch(e) { + } catch (e) { // } - } catch(e) { + } catch (e) { console.error(e); } @@ -81,9 +83,9 @@ function EditorOverlay({ const handleReplaceSelection = useCallback((data: EditorData) => { try { - if(data.length === 1 && !isEmbedBlockTypes(data[0].type as unknown as BlockType)) { + if (data.length === 1 && !isEmbedBlockTypes(data[0].type as unknown as BlockType)) { ReactEditor.focus(editor); - if(Range.isExpanded(editor.selection as Range)) { + if (Range.isExpanded(editor.selection as Range)) { CustomEditor.deleteBlockForward(editor); } @@ -102,21 +104,21 @@ function EditorOverlay({ return; } else { ReactEditor.focus(editor); - if(Range.isExpanded(editor.selection as Range)) { + if (Range.isExpanded(editor.selection as Range)) { CustomEditor.deleteBlockForward(editor); } - if(!startBlock) return; + if (!startBlock) return; const [node] = startBlock as NodeEntry; - if(!node) return; + if (!node) return; const blockId = insertDataAfterBlock(editor.sharedRoot, data, node.blockId as string); const startYBlock = getBlock(node.blockId as string, editor.sharedRoot); const startYText = getText(startYBlock.get(YjsEditorKey.block_external_id), editor.sharedRoot); - if(startYText && startYText.length === 0) { + if (startYText && startYText.length === 0) { CustomEditor.deleteBlock(editor, node.blockId as string); } @@ -127,7 +129,7 @@ function EditorOverlay({ } // eslint-disable-next-line - } catch(e: any) { + } catch (e: any) { notify.error(e.message); } @@ -138,17 +140,17 @@ function EditorOverlay({ const handleExit = useCallback(() => { removeDecorate?.('ai-writer'); - if(!ReactEditor.isFocused(editor)) { + if (!ReactEditor.isFocused(editor)) { ReactEditor.focus(editor); } }, [removeDecorate, editor]); - const [container, setContainer] = React.useState(null); - const [scrollerContainer, setScrollerContainer] = React.useState(null); - const [absoluteHeight, setAbsoluteHeight] = React.useState(0); + const [container, setContainer] = useState(null); + const [scrollerContainer, setScrollerContainer] = useState(null); + const [absoluteHeight, setAbsoluteHeight] = useState(0); useEffect(() => { - if(endBlock) { + if (endBlock) { const [node] = endBlock; try { @@ -156,7 +158,7 @@ function EditorOverlay({ const firstChild = dom.firstChild as HTMLElement; - if(firstChild && firstChild.innerText.trim() === '') { + if (firstChild && firstChild.innerText.trim() === '') { setAbsoluteHeight(firstChild.offsetHeight); } else { setAbsoluteHeight(0); @@ -167,7 +169,7 @@ function EditorOverlay({ const container = dom.closest('.appflowy-scroll-container') || getScrollParent(dom); setScrollerContainer(container as HTMLDivElement); - } catch(e) { + } catch (e) { console.error(e); } } @@ -191,11 +193,11 @@ function EditorOverlay({ container={container} > {absoluteHeight ?
: + style={{ + transform: 'translateY(-' + absoluteHeight + 'px)', + }} + className={'w-full flex'} + > : } diff --git a/vite.config.ts b/vite.config.ts index bb36c046..248c32c4 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -99,6 +99,7 @@ export default defineConfig({ server: { port: process.env.PORT ? parseInt(process.env.PORT) : 3000, strictPort: true, + host: '0.0.0.0', watch: { ignored: ['node_modules'], }, @@ -125,7 +126,7 @@ export default defineConfig({ entryFileNames: 'static/js/[name]-[hash].js', assetFileNames: 'static/[ext]/[name]-[hash].[ext]', manualChunks(id) { - if( + if ( // id.includes('/react@') || // id.includes('/react-dom@') || id.includes('/react-is@') ||