diff --git a/.vscode/launch.json b/.vscode/launch.json index 212695f498..3c6ef408f1 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -146,22 +146,6 @@ "sourceMaps": true, "cwd": "${workspaceRoot}/dev/tool" }, - { - "name": "Debug Collaborator", - "type": "node", - "request": "launch", - "args": ["src/__start.ts"], - "env": { - "SECRET": "secret", - "MINIO_ACCESS_KEY": "minioadmin", - "MINIO_SECRET_KEY": "minioadmin", - "MINIO_ENDPOINT": "localhost" - }, - "runtimeArgs": ["--nolazy", "-r", "ts-node/register"], - "sourceMaps": true, - "cwd": "${workspaceRoot}/pods/collaborator", - "protocol": "inspector" - }, { "name": "Debug backup", "type": "node", diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index f22f973f4b..b1d5a6132b 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -41,9 +41,6 @@ specifiers: '@rush-temp/dev-storage': file:./projects/dev-storage.tgz '@rush-temp/devmodel': file:./projects/devmodel.tgz '@rush-temp/devmodel-resources': file:./projects/devmodel-resources.tgz - '@rush-temp/document': file:./projects/document.tgz - '@rush-temp/document-assets': file:./projects/document-assets.tgz - '@rush-temp/document-resources': file:./projects/document-resources.tgz '@rush-temp/elastic': file:./projects/elastic.tgz '@rush-temp/front': file:./projects/front.tgz '@rush-temp/generator': file:./projects/generator.tgz @@ -78,7 +75,6 @@ specifiers: '@rush-temp/model-chunter': file:./projects/model-chunter.tgz '@rush-temp/model-contact': file:./projects/model-contact.tgz '@rush-temp/model-core': file:./projects/model-core.tgz - '@rush-temp/model-document': file:./projects/model-document.tgz '@rush-temp/model-gmail': file:./projects/model-gmail.tgz '@rush-temp/model-hr': file:./projects/model-hr.tgz '@rush-temp/model-inventory': file:./projects/model-inventory.tgz @@ -129,7 +125,6 @@ specifiers: '@rush-temp/platform-rig': file:./projects/platform-rig.tgz '@rush-temp/pod-account': file:./projects/pod-account.tgz '@rush-temp/pod-backup': file:./projects/pod-backup.tgz - '@rush-temp/pod-collaborator': file:./projects/pod-collaborator.tgz '@rush-temp/pod-front': file:./projects/pod-front.tgz '@rush-temp/pod-server': file:./projects/pod-server.tgz '@rush-temp/preference': file:./projects/preference.tgz @@ -334,7 +329,6 @@ specifiers: koa-bodyparser: ^4.3.0 koa-router: ^10.1.1 lexorank: ~1.0.4 - lib0: ~0.2.52 libphonenumber-js: ^1.9.46 mime-types: ~2.1.34 mini-css-extract-plugin: ^2.2.0 @@ -394,7 +388,6 @@ specifiers: ws: ^8.10.0 xml2js: ~0.4.23 y-prosemirror: ^1.2.1 - y-protocols: ^1.0.5 y-websocket: ^1.5.0 yjs: ^13.5.52 @@ -439,9 +432,6 @@ dependencies: '@rush-temp/dev-storage': file:projects/dev-storage.tgz '@rush-temp/devmodel': file:projects/devmodel.tgz_typescript@4.8.4 '@rush-temp/devmodel-resources': file:projects/devmodel-resources.tgz_ed2e4f4d904d50838e5f15c036f084b4 - '@rush-temp/document': file:projects/document.tgz - '@rush-temp/document-assets': file:projects/document-assets.tgz_typescript@4.8.4 - '@rush-temp/document-resources': file:projects/document-resources.tgz_a1d864769aaf53d09b76fe134ab55e60 '@rush-temp/elastic': file:projects/elastic.tgz_@types+node@16.11.68 '@rush-temp/front': file:projects/front.tgz '@rush-temp/generator': file:projects/generator.tgz_bufferutil@4.0.7 @@ -476,7 +466,6 @@ dependencies: '@rush-temp/model-chunter': file:projects/model-chunter.tgz_typescript@4.8.4 '@rush-temp/model-contact': file:projects/model-contact.tgz_typescript@4.8.4 '@rush-temp/model-core': file:projects/model-core.tgz_typescript@4.8.4 - '@rush-temp/model-document': file:projects/model-document.tgz_typescript@4.8.4 '@rush-temp/model-gmail': file:projects/model-gmail.tgz_typescript@4.8.4 '@rush-temp/model-hr': file:projects/model-hr.tgz_typescript@4.8.4 '@rush-temp/model-inventory': file:projects/model-inventory.tgz_typescript@4.8.4 @@ -527,7 +516,6 @@ dependencies: '@rush-temp/platform-rig': file:projects/platform-rig.tgz_c5e43dc15df4ac7868d10b0872442df4 '@rush-temp/pod-account': file:projects/pod-account.tgz '@rush-temp/pod-backup': file:projects/pod-backup.tgz - '@rush-temp/pod-collaborator': file:projects/pod-collaborator.tgz_bufferutil@4.0.7 '@rush-temp/pod-front': file:projects/pod-front.tgz '@rush-temp/pod-server': file:projects/pod-server.tgz '@rush-temp/preference': file:projects/preference.tgz @@ -605,7 +593,7 @@ dependencies: '@rush-temp/templates-resources': file:projects/templates-resources.tgz_a1d864769aaf53d09b76fe134ab55e60 '@rush-temp/tests-sanity': file:projects/tests-sanity.tgz '@rush-temp/text': file:projects/text.tgz_a7abb371f17d2bc77abec7bc53398db5 - '@rush-temp/text-editor': file:projects/text-editor.tgz_1e646fd62a3adc9d0b41f256dafe3d38 + '@rush-temp/text-editor': file:projects/text-editor.tgz_a1d864769aaf53d09b76fe134ab55e60 '@rush-temp/theme': file:projects/theme.tgz_a1d864769aaf53d09b76fe134ab55e60 '@rush-temp/tool': file:projects/tool.tgz_bufferutil@4.0.7 '@rush-temp/tracker': file:projects/tracker.tgz @@ -732,7 +720,6 @@ dependencies: koa-bodyparser: 4.3.0 koa-router: 10.1.1 lexorank: 1.0.5 - lib0: 0.2.53 libphonenumber-js: 1.10.14 mime-types: 2.1.35 mini-css-extract-plugin: 2.6.1_webpack@5.75.0 @@ -791,8 +778,7 @@ dependencies: webpack-dev-server: 4.11.1_5f7427e5f586f1bfc73e23d8c6331293 ws: 8.11.0_bufferutil@4.0.7 xml2js: 0.4.23 - y-prosemirror: 1.2.1_4b437ae61db91263defb65d2247376eb - y-protocols: 1.0.5 + y-prosemirror: 1.2.1_709ebdfd1c5bc23c335c8dea11286d09 y-websocket: 1.5.0_yjs@13.5.52 yjs: 13.5.52 @@ -6365,7 +6351,7 @@ packages: y-prosemirror: 1.0.20 dependencies: '@tiptap/core': 2.0.3_@tiptap+pm@2.0.3 - y-prosemirror: 1.2.1_4b437ae61db91263defb65d2247376eb + y-prosemirror: 1.2.1_709ebdfd1c5bc23c335c8dea11286d09 dev: false /@tiptap/extension-collaboration/2.0.3_9d93b21d48f6156ab534bd7bbcc15ccc: @@ -6377,7 +6363,7 @@ packages: dependencies: '@tiptap/core': 2.0.3_@tiptap+pm@2.0.3 '@tiptap/pm': 2.0.3_@tiptap+core@2.0.3 - y-prosemirror: 1.2.1_4b437ae61db91263defb65d2247376eb + y-prosemirror: 1.2.1_709ebdfd1c5bc23c335c8dea11286d09 dev: false /@tiptap/extension-document/2.0.3_@tiptap+core@2.0.3: @@ -17134,7 +17120,7 @@ packages: dev: false optional: true - /y-prosemirror/1.2.1_4b437ae61db91263defb65d2247376eb: + /y-prosemirror/1.2.1_709ebdfd1c5bc23c335c8dea11286d09: resolution: {integrity: sha512-czMBfB1eL2awqmOSxQM8cS/fsUOGE6fjvyPLInrh4crPxFiw67wDpwIW+EGBYKRa04sYbS0ScGj7ZgvWuDrmBQ==} peerDependencies: prosemirror-model: ^1.7.1 @@ -17147,7 +17133,6 @@ packages: prosemirror-model: 1.19.2 prosemirror-state: 1.4.3 prosemirror-view: 1.31.4 - y-protocols: 1.0.5 yjs: 13.5.52 dev: false @@ -18123,82 +18108,6 @@ packages: - typescript dev: false - file:projects/document-assets.tgz_typescript@4.8.4: - resolution: {integrity: sha512-O2pojKbUHyYRybsghngPaWxbgKhXwf9mf5aNSOSb+Kj04bERRLmle3fW59SaTAuqQw2efYKbfLO9baeVzQSp1A==, tarball: file:projects/document-assets.tgz} - id: file:projects/document-assets.tgz - name: '@rush-temp/document-assets' - version: 0.0.0 - dependencies: - '@rushstack/heft': 0.47.11 - '@types/heft-jest': 1.0.3 - '@types/node': 16.11.68 - '@typescript-eslint/eslint-plugin': 5.42.1_d506b9be61cb4ac2646ecbc6e0680464 - '@typescript-eslint/parser': 5.42.1_eslint@8.27.0+typescript@4.8.4 - eslint: 8.27.0 - eslint-config-standard-with-typescript: 23.0.0_c9fe9619f50f4e82337a86c3af25e566 - eslint-plugin-import: 2.26.0_eslint@8.27.0 - eslint-plugin-n: 15.5.1_eslint@8.27.0 - eslint-plugin-promise: 6.1.1_eslint@8.27.0 - prettier: 2.8.8 - transitivePeerDependencies: - - supports-color - - typescript - dev: false - - file:projects/document-resources.tgz_a1d864769aaf53d09b76fe134ab55e60: - resolution: {integrity: sha512-qvUetpakwin4/2798Kzg0mZYjTOxzszP2okTsYE0/10yCECZ1q+m+CmPhYZqsnOdKJVxr1GiYSUluWmeXeI+ig==, tarball: file:projects/document-resources.tgz} - id: file:projects/document-resources.tgz - name: '@rush-temp/document-resources' - version: 0.0.0 - dependencies: - '@typescript-eslint/eslint-plugin': 5.42.1_d506b9be61cb4ac2646ecbc6e0680464 - '@typescript-eslint/parser': 5.42.1_eslint@8.27.0+typescript@4.8.4 - eslint: 8.27.0 - eslint-config-standard-with-typescript: 23.0.0_c9fe9619f50f4e82337a86c3af25e566 - eslint-plugin-import: 2.26.0_eslint@8.27.0 - eslint-plugin-n: 15.5.1_eslint@8.27.0 - eslint-plugin-promise: 6.1.1_eslint@8.27.0 - eslint-plugin-svelte3: 4.0.0_eslint@8.27.0+svelte@3.55.1 - prettier: 2.8.8 - prettier-plugin-svelte: 2.8.0_prettier@2.8.8+svelte@3.55.1 - sass: 1.56.1 - svelte: 3.55.1 - svelte-check: 3.2.0_ae2e9904602215f07e0b815d3fa1ffe9 - svelte-loader: 3.1.4_svelte@3.55.1 - svelte-preprocess: 5.0.3_6420a3eba9d5580d9c2f627c17e61722 - typescript: 4.8.4 - transitivePeerDependencies: - - '@babel/core' - - coffeescript - - less - - postcss - - postcss-load-config - - pug - - stylus - - sugarss - - supports-color - dev: false - - file:projects/document.tgz: - resolution: {integrity: sha512-JLRtzVrQ7j6bnJ466wZwLrh+FZiniq/4jxnV2cchVxvwffQ1Nsjd5pqEN4tRpSvl+mRdzEHPaXX/XysW3Ay9gQ==, tarball: file:projects/document.tgz} - name: '@rush-temp/document' - version: 0.0.0 - dependencies: - '@rushstack/heft': 0.47.11 - '@types/heft-jest': 1.0.3 - '@typescript-eslint/eslint-plugin': 5.42.1_d506b9be61cb4ac2646ecbc6e0680464 - '@typescript-eslint/parser': 5.42.1_eslint@8.27.0+typescript@4.8.4 - eslint: 8.27.0 - eslint-config-standard-with-typescript: 23.0.0_c9fe9619f50f4e82337a86c3af25e566 - eslint-plugin-import: 2.26.0_eslint@8.27.0 - eslint-plugin-n: 15.5.1_eslint@8.27.0 - eslint-plugin-promise: 6.1.1_eslint@8.27.0 - prettier: 2.8.8 - typescript: 4.8.4 - transitivePeerDependencies: - - supports-color - dev: false - file:projects/elastic.tgz_@types+node@16.11.68: resolution: {integrity: sha512-PY7mQyOCUoEgFlhhSs3lYKHUBwIHNsNOQzOgojlTo+YreJOUeTQFo8/1nqlva6uq5B0+l85QUiqiV3YYHOytOQ==, tarball: file:projects/elastic.tgz} id: file:projects/elastic.tgz @@ -18840,7 +18749,7 @@ packages: dev: false file:projects/model-all.tgz_typescript@4.8.4: - resolution: {integrity: sha512-g6cNmmiQ8u2RKGeoHFUfJZpwv3ANw9G+eL5w9ugE1641qM35z4Mc98pCVvC4qo7KxEUkf71fEAkVn1PYEhd1Zw==, tarball: file:projects/model-all.tgz} + resolution: {integrity: sha512-4l1yEr88a5e6IOcEXjJn6RdM26DoIb8wwpdwk4a0UBk0fbp8O/kmo7+jKGmf0kFL+ibLgKNvFm5BYVpue+hA1g==, tarball: file:projects/model-all.tgz} id: file:projects/model-all.tgz name: '@rush-temp/model-all' version: 0.0.0 @@ -19034,27 +18943,6 @@ packages: - typescript dev: false - file:projects/model-document.tgz_typescript@4.8.4: - resolution: {integrity: sha512-0+DwgNfG3I1w8ZwQYeq7y8oTHniKJuvXKruBT4PM89y2bXZ+PcdL/DS2iHzfIQ2DtOatbIHd33mR7kgR1JZwCQ==, tarball: file:projects/model-document.tgz} - id: file:projects/model-document.tgz - name: '@rush-temp/model-document' - version: 0.0.0 - dependencies: - '@rushstack/heft': 0.47.11 - '@types/heft-jest': 1.0.3 - '@typescript-eslint/eslint-plugin': 5.42.1_d506b9be61cb4ac2646ecbc6e0680464 - '@typescript-eslint/parser': 5.42.1_eslint@8.27.0+typescript@4.8.4 - eslint: 8.27.0 - eslint-config-standard-with-typescript: 23.0.0_c9fe9619f50f4e82337a86c3af25e566 - eslint-plugin-import: 2.26.0_eslint@8.27.0 - eslint-plugin-n: 15.5.1_eslint@8.27.0 - eslint-plugin-promise: 6.1.1_eslint@8.27.0 - prettier: 2.8.8 - transitivePeerDependencies: - - supports-color - - typescript - dev: false - file:projects/model-gmail.tgz_typescript@4.8.4: resolution: {integrity: sha512-x0wXbISbTDWAxhxqfojSV2B8FrPzRDM9kZcVqC7fxRObWIFzJKvqBn4FRVk3mMhFdKBMtzdg+SBbJIhm9gDDCg==, tarball: file:projects/model-gmail.tgz} id: file:projects/model-gmail.tgz @@ -20209,41 +20097,6 @@ packages: - supports-color dev: false - file:projects/pod-collaborator.tgz_bufferutil@4.0.7: - resolution: {integrity: sha512-1/aln2xUZfGeRUlzGkjmMklZF/d4eaiAleHSuT8Z5SE7+AlI3sUoIZU9Pqfm/xtX2pI5zAQzduQtMfjNyiV5YA==, tarball: file:projects/pod-collaborator.tgz} - id: file:projects/pod-collaborator.tgz - name: '@rush-temp/pod-collaborator' - version: 0.0.0 - dependencies: - '@rushstack/heft': 0.47.11 - '@types/heft-jest': 1.0.3 - '@types/node': 16.11.68 - '@types/ws': 8.5.3 - '@typescript-eslint/eslint-plugin': 5.42.1_d506b9be61cb4ac2646ecbc6e0680464 - '@typescript-eslint/parser': 5.42.1_eslint@8.27.0+typescript@4.8.4 - cross-env: 7.0.3 - esbuild: 0.16.14 - eslint: 8.27.0 - eslint-config-standard-with-typescript: 23.0.0_c9fe9619f50f4e82337a86c3af25e566 - eslint-plugin-import: 2.26.0_eslint@8.27.0 - eslint-plugin-n: 15.5.1_eslint@8.27.0 - eslint-plugin-promise: 6.1.1_eslint@8.27.0 - lib0: 0.2.73 - lodash.debounce: 4.0.8 - prettier: 2.8.8 - ts-node: 10.9.1_867af3484524ae72fe2b1aa24b40f5ee - typescript: 4.8.4 - ws: 8.11.0_bufferutil@4.0.7 - y-protocols: 1.0.5 - yjs: 13.5.52 - transitivePeerDependencies: - - '@swc/core' - - '@swc/wasm' - - bufferutil - - supports-color - - utf-8-validate - dev: false - file:projects/pod-front.tgz: resolution: {integrity: sha512-7RjucQVYaMbYBJEUo6gC6sAepQUPSxoErDAM22zx68541Ds2Jx6FmD/kHEDJSqk5ve1ECKPTL2xmMuStWiTn7A==, tarball: file:projects/pod-front.tgz} name: '@rush-temp/pod-front' @@ -20287,7 +20140,7 @@ packages: dev: false file:projects/pod-server.tgz: - resolution: {integrity: sha512-SWB1f4OdOIZosUoV511VmwfS+cawaMdX+W/PdpsAOHHRG17St/PLy4+IpVec0B3xeFLXq9pdXiBXq5J73LwWKA==, tarball: file:projects/pod-server.tgz} + resolution: {integrity: sha512-0g+8yGEuBrExc15sVQk2hZKTF1KVrcU6VVtUU8GdUxBN07HJb9l8luuYXsbHMwW+FU/e7FKiVK9VJh2FVmzuSw==, tarball: file:projects/pod-server.tgz} name: '@rush-temp/pod-server' version: 0.0.0 dependencies: @@ -20395,7 +20248,7 @@ packages: dev: false file:projects/prod.tgz_91152849c259b1b3925f7bb3d415bc80: - resolution: {integrity: sha512-wZWIAN+CPlPommWoqqH2yf11giIQ+B7Gbx6NQ8hkQ3PeZS2zJWsN3Ki+4vYu+BOZHwthzEJn3Y9LhKsyTL9m2A==, tarball: file:projects/prod.tgz} + resolution: {integrity: sha512-crJHAbNcTU2tnkH30njWj7LLUQbPQXdgDc6tGxZESKmARWrC2GxJ3PIIryN1iK3vO21qE7vBPO6oDoXpIOUjSQ==, tarball: file:projects/prod.tgz} id: file:projects/prod.tgz name: '@rush-temp/prod' version: 0.0.0 @@ -22087,7 +21940,7 @@ packages: - supports-color dev: false - file:projects/text-editor.tgz_1e646fd62a3adc9d0b41f256dafe3d38: + file:projects/text-editor.tgz_a1d864769aaf53d09b76fe134ab55e60: resolution: {integrity: sha512-mZ+9T1R2k5X+qEj4fXliwEVDzmBbGEggRReeFSTver56sVbuZQrbnAeeHEa1kMX6rD/O5kKTn8Bwk+S97y3jkw==, tarball: file:projects/text-editor.tgz} id: file:projects/text-editor.tgz name: '@rush-temp/text-editor' @@ -22121,7 +21974,6 @@ packages: '@typescript-eslint/eslint-plugin': 5.42.1_d506b9be61cb4ac2646ecbc6e0680464 '@typescript-eslint/parser': 5.42.1_eslint@8.27.0+typescript@4.8.4 diff: 5.1.0 - emoji-regex: 10.2.1 eslint: 8.27.0 eslint-config-standard-with-typescript: 23.0.0_c9fe9619f50f4e82337a86c3af25e566 eslint-plugin-import: 2.26.0_eslint@8.27.0 @@ -22149,7 +22001,7 @@ packages: svelte-loader: 3.1.4_svelte@3.55.1 svelte-preprocess: 5.0.3_6420a3eba9d5580d9c2f627c17e61722 typescript: 4.8.4 - y-prosemirror: 1.2.1_4b437ae61db91263defb65d2247376eb + y-prosemirror: 1.2.1_709ebdfd1c5bc23c335c8dea11286d09 y-websocket: 1.5.0_yjs@13.5.52 yjs: 13.5.52 transitivePeerDependencies: diff --git a/dev/docker-compose.yaml b/dev/docker-compose.yaml index 0f66cfc881..b37a3acbd2 100644 --- a/dev/docker-compose.yaml +++ b/dev/docker-compose.yaml @@ -63,19 +63,6 @@ services: - INIT_WORKSPACE=demo-tracker - MODEL_ENABLED=* restart: unless-stopped - collaborator: - image: hardcoreeng/collaborator - links: - - transactor - ports: - - 3078:3078 - environment: - - COLLABORATOR_PORT=3078 - - SECRET=secret - - MINIO_ENDPOINT=minio - - MINIO_ACCESS_KEY=minioadmin - - MINIO_SECRET_KEY=minioadmin - restart: unless-stopped front: image: hardcoreeng/front links: @@ -90,7 +77,6 @@ services: - SERVER_SECRET=secret - ACCOUNTS_URL=http://localhost:3000 - REKONI_URL=http://localhost:4004 - - COLLABORATOR_URL=ws://localhost:3078 - CALENDAR_URL=http://localhost:8095 - GMAIL_URL=http://localhost:8088 - TELEGRAM_URL=http://localhost:8086 diff --git a/dev/prod/.env b/dev/prod/.env index 4427dfffbd..483f583868 100644 --- a/dev/prod/.env +++ b/dev/prod/.env @@ -7,5 +7,3 @@ CALENDAR_URL=http://localhost:8095 FRONT_URL=http://localhost:8080 REKONI_URL=http://localhost:4004 - -COLLABORATOR_URL=ws://locahost:3078 diff --git a/dev/prod/config.json b/dev/prod/config.json index 56f6fefd9d..9a68daead4 100644 --- a/dev/prod/config.json +++ b/dev/prod/config.json @@ -1,6 +1,5 @@ { "ACCOUNTS_URL":"http://localhost:3000", - "COLLABORATOR_URL": "ws://localhost:3078", "UPLOAD_URL":"/files", "REKONI_URL": "http://localhost:4004" } \ No newline at end of file diff --git a/dev/prod/package.json b/dev/prod/package.json index 68620a7bb8..425b3d3b45 100644 --- a/dev/prod/package.json +++ b/dev/prod/package.json @@ -158,9 +158,6 @@ "@hcengineering/hr-resources": "^0.6.0", "@hcengineering/server-hr": "^0.6.0", "@hcengineering/server-hr-resources": "^0.6.0", - "@hcengineering/document": "^0.6.0", - "@hcengineering/document-assets": "^0.6.0", - "@hcengineering/document-resources": "^0.6.0", "@hcengineering/bitrix": "^0.6.41", "@hcengineering/bitrix-assets": "^0.6.0", "@hcengineering/bitrix-resources": "^0.6.0", diff --git a/dev/prod/public/config-dev.json b/dev/prod/public/config-dev.json index 9290519054..8d7126952f 100644 --- a/dev/prod/public/config-dev.json +++ b/dev/prod/public/config-dev.json @@ -1,6 +1,5 @@ { "ACCOUNTS_URL":"https://account.hc.engineering", - "COLLABORATOR_URL": "wss://collaborator.hc.engineering", "UPLOAD_URL":"/files", "MODEL_VERSION": null, "TELEGRAM_URL": "https://telegram.hc.engineering", diff --git a/dev/prod/public/config.json b/dev/prod/public/config.json index 4c5d9c73b7..b02d84c8e8 100644 --- a/dev/prod/public/config.json +++ b/dev/prod/public/config.json @@ -1,6 +1,5 @@ { "ACCOUNTS_URL":"/account", - "COLLABORATOR_URL": "ws://localhost:3078", "UPLOAD_URL":"/files", "MODEL_VERSION": null, "TELEGRAM_URL": "http://localhost:8086", diff --git a/dev/prod/src/platform.ts b/dev/prod/src/platform.ts index 2c8bad93b9..370e980a1b 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -23,7 +23,6 @@ import calendar, { calendarId } from '@hcengineering/calendar' import { chunterId } from '@hcengineering/chunter' import client, { clientId } from '@hcengineering/client' import { contactId } from '@hcengineering/contact' -import document, { documentId } from '@hcengineering/document' import gmail, { gmailId } from '@hcengineering/gmail' import { hrId } from '@hcengineering/hr' import { imageCropperId } from '@hcengineering/image-cropper' @@ -55,7 +54,6 @@ import '@hcengineering/board-assets' import '@hcengineering/calendar-assets' import '@hcengineering/chunter-assets' import '@hcengineering/contact-assets' -import '@hcengineering/document-assets' import '@hcengineering/gmail-assets' import '@hcengineering/hr-assets' import '@hcengineering/inventory-assets' @@ -86,7 +84,6 @@ interface Config { ACCOUNTS_URL: string UPLOAD_URL: string MODEL_VERSION: string - COLLABORATOR_URL: string REKONI_URL: string TELEGRAM_URL: string GMAIL_URL: string @@ -104,8 +101,6 @@ export async function configurePlatform() { setMetadata(login.metadata.AccountsUrl, config.ACCOUNTS_URL) setMetadata(presentation.metadata.UploadURL, config.UPLOAD_URL) - setMetadata(document.metadata.CollaboratorUrl, config.COLLABORATOR_URL) - if (config.MODEL_VERSION != null) { console.log('Minimal Model version requirement', config.MODEL_VERSION) setMetadata(presentation.metadata.RequiredVersion, config.MODEL_VERSION) @@ -160,7 +155,6 @@ export async function configurePlatform() { addLocation(boardId, () => import(/* webpackChunkName: "board" */ '@hcengineering/board-resources')) addLocation(automationId, () => import(/* webpackChunkName: "automation" */ '@hcengineering/automation-resources')) addLocation(hrId, () => import(/* webpackChunkName: "hr" */ '@hcengineering/hr-resources')) - addLocation(documentId, () => import(/* webpackChunkName: "document" */ '@hcengineering/document-resources')) addLocation(bitrixId, () => import(/* webpackChunkName: "bitrix" */ '@hcengineering/bitrix-resources')) addLocation(requestId, () => import(/* webpackChunkName: "request" */ '@hcengineering/request-resources')) addLocation(supportId, () => import(/* webpackChunkName: "support" */ '@hcengineering/support-resources')) diff --git a/models/all/package.json b/models/all/package.json index 758d4ef5cf..24685b0729 100644 --- a/models/all/package.json +++ b/models/all/package.json @@ -74,7 +74,6 @@ "@hcengineering/model-preference": "^0.6.0", "@hcengineering/model-hr": "^0.6.0", "@hcengineering/model-server-hr": "^0.6.0", - "@hcengineering/model-document": "^0.6.0", "@hcengineering/model-bitrix": "^0.6.0", "@hcengineering/model-request": "^0.6.0", "@hcengineering/model-server-request": "^0.6.0", diff --git a/models/all/src/index.ts b/models/all/src/index.ts index 5acff344f0..738da386b5 100644 --- a/models/all/src/index.ts +++ b/models/all/src/index.ts @@ -26,7 +26,6 @@ import calendar, { calendarId, createModel as calendarModel } from '@hcengineeri import chunter, { chunterId, createModel as chunterModel } from '@hcengineering/model-chunter' import contact, { contactId, createModel as contactModel } from '@hcengineering/model-contact' import { createModel as coreModel } from '@hcengineering/model-core' -import document, { documentId, createModel as documentModel } from '@hcengineering/model-document' import gmail, { gmailId, createModel as gmailModel } from '@hcengineering/model-gmail' import hr, { hrId, createModel as hrModel } from '@hcengineering/model-hr' import inventory, { inventoryId, createModel as inventoryModel } from '@hcengineering/model-inventory' @@ -214,18 +213,6 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ classFilter: defaultFilter } ], - [ - documentModel, - documentId, - { - label: document.string.ConfigLabel, - description: document.string.ConfigDescription, - enabled: false, - beta: true, - icon: document.icon.DocumentApplication, - classFilter: defaultFilter - } - ], [ trackerModel, trackerId, diff --git a/models/all/src/migration.ts b/models/all/src/migration.ts index 304f55e256..40dce1c17a 100644 --- a/models/all/src/migration.ts +++ b/models/all/src/migration.ts @@ -35,7 +35,6 @@ import { viewOperation } from '@hcengineering/model-view' import { trackerOperation } from '@hcengineering/model-tracker' import { boardOperation } from '@hcengineering/model-board' import { hrOperation } from '@hcengineering/model-hr' -import { documentOperation } from '@hcengineering/model-document' import { bitrixOperation } from '@hcengineering/model-bitrix' import { calendarOperation } from '@hcengineering/model-calendar' @@ -60,7 +59,6 @@ export const migrateOperations: [string, MigrateOperation][] = [ ['tracker', trackerOperation], ['board', boardOperation], ['hr', hrOperation], - ['document', documentOperation], ['bitrix', bitrixOperation], ['inventiry', inventoryOperation] ] diff --git a/models/document/.eslintrc.js b/models/document/.eslintrc.js deleted file mode 100644 index 59eb1482fa..0000000000 --- a/models/document/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['./node_modules/@hcengineering/model-rig/profiles/default/config/eslint.config.json'], - parserOptions: { - tsconfigRootDir: __dirname, - project: './tsconfig.json' - } -} diff --git a/models/document/.npmignore b/models/document/.npmignore deleted file mode 100644 index e3ec093c38..0000000000 --- a/models/document/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -* -!/lib/** -!CHANGELOG.md -/lib/**/__tests__/ diff --git a/models/document/config/rig.json b/models/document/config/rig.json deleted file mode 100644 index 45672e5d25..0000000000 --- a/models/document/config/rig.json +++ /dev/null @@ -1,18 +0,0 @@ -// The "rig.json" file directs tools to look for their config files in an external package. -// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package -{ - "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", - - /** - * (Required) The name of the rig package to inherit from. - * It should be an NPM package name with the "-rig" suffix. - */ - "rigPackageName": "@hcengineering/model-rig" - - /** - * (Optional) Selects a config profile from the rig package. The name must consist of - * lowercase alphanumeric words separated by hyphens, for example "sample-profile". - * If omitted, then the "default" profile will be used." - */ - // "rigProfile": "your-profile-name" -} diff --git a/models/document/package.json b/models/document/package.json deleted file mode 100644 index e99eeda5d4..0000000000 --- a/models/document/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "@hcengineering/model-document", - "version": "0.6.0", - "main": "lib/index.js", - "author": "Anticrm Platform Contributors", - "license": "EPL-2.0", - "scripts": { - "build": "heft build", - "build:watch": "tsc", - "lint:fix": "eslint --fix src", - "lint": "eslint src", - "format": "prettier --write src && eslint --fix src" - }, - "devDependencies": { - "@hcengineering/model-rig": "^0.6.0", - "@typescript-eslint/eslint-plugin": "^5.41.0", - "eslint-plugin-import": "^2.26.0", - "eslint-plugin-promise": "^6.1.1", - "eslint-plugin-n": "^15.4.0", - "eslint": "^8.26.0", - "@types/heft-jest": "^1.0.3", - "@typescript-eslint/parser": "^5.41.0", - "eslint-config-standard-with-typescript": "^23.0.0", - "prettier": "^2.7.1", - "@rushstack/heft": "^0.47.9" - }, - "dependencies": { - "@hcengineering/model-core": "^0.6.0", - "@hcengineering/model-chunter": "^0.6.0", - "@hcengineering/model-workbench": "^0.6.1", - "@hcengineering/model-attachment": "^0.6.0", - "@hcengineering/model-view": "^0.6.0", - "@hcengineering/model-presentation": "^0.6.0", - "@hcengineering/model": "^0.6.6", - "@hcengineering/setting": "^0.6.9", - "@hcengineering/core": "^0.6.27", - "@hcengineering/ui": "^0.6.10", - "@hcengineering/platform": "^0.6.9", - "@hcengineering/notification": "^0.6.14", - "@hcengineering/document": "^0.6.0", - "@hcengineering/document-resources": "^0.6.0", - "@hcengineering/view": "^0.6.8", - "@hcengineering/contact": "^0.6.19", - "@hcengineering/tags": "^0.6.11" - } -} diff --git a/models/document/src/index.ts b/models/document/src/index.ts deleted file mode 100644 index aba886af6e..0000000000 --- a/models/document/src/index.ts +++ /dev/null @@ -1,269 +0,0 @@ -// -// Copyright © 2022 Hardcore Engineering Inc. -// -// Licensed under the Eclipse Public License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. You may -// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import contact, { Employee } from '@hcengineering/contact' -import type { Domain, Markup, Ref } from '@hcengineering/core' -import { IndexKind } from '@hcengineering/core' -import { - CollaboratorDocument, - Document, - DocumentRequest, - DocumentRequestKind, - DocumentVersion, - DocumentVersionState, - documentId -} from '@hcengineering/document' -import { - ArrOf, - Builder, - Collection, - Hidden, - Index, - Model, - Prop, - ReadOnly, - TypeNumber, - TypeRef, - TypeString, - UX -} from '@hcengineering/model' -import attachment, { TAttachment } from '@hcengineering/model-attachment' -import chunter from '@hcengineering/model-chunter' -import core, { TAttachedDoc, TDoc } from '@hcengineering/model-core' -import presentation from '@hcengineering/model-presentation' -import view, { actionTemplates, createAction } from '@hcengineering/model-view' -import workbench from '@hcengineering/model-workbench' -import tags from '@hcengineering/tags' -import document from './plugin' - -export { documentId } from '@hcengineering/document' -export { documentOperation } from './migration' -export { document as default } - -export const DOMAIN_DOCUMENT = 'document' as Domain - -@Model(document.class.DocumentRequest, core.class.AttachedDoc, DOMAIN_DOCUMENT) -@UX(document.string.Document) -export class TDocumentRequest extends TAttachedDoc implements DocumentRequest { - kind!: DocumentRequestKind - assignee!: Ref - message!: Markup -} - -@Model(document.class.CollaboratorDocument, attachment.class.Attachment, DOMAIN_DOCUMENT) -@UX(document.string.Document) -export class TCollaboratorDocument extends TAttachment implements CollaboratorDocument {} - -@Model(document.class.DocumentVersion, core.class.AttachedDoc, DOMAIN_DOCUMENT) -@UX(document.string.Version) -export class TDocumentVersion extends TAttachedDoc implements DocumentVersion { - @Prop(TypeNumber(), document.string.Version) - @Index(IndexKind.FullText) - @ReadOnly() - version!: number - - @Prop(TypeString(), document.string.Description) - @Index(IndexKind.FullText) - description!: Markup - - @Prop(TypeString(), document.string.Description) - @Index(IndexKind.FullText) - reason!: Markup - - @Prop(TypeString(), document.string.Description) - @Index(IndexKind.FullText) - impact!: Markup - - // @Prop(TypeString(), document.string.Status) - state!: DocumentVersionState - - @Prop(TypeString(), document.string.Document) - @Hidden() - content!: Markup - - @Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files }) - attachments!: number - - @Prop(Collection(chunter.class.Comment), chunter.string.Comments) - comments!: number - - contentAttachmentId!: Ref - initialContentId!: Ref -} - -@Model(document.class.Document, core.class.Doc, DOMAIN_DOCUMENT) -@UX(document.string.Document, document.icon.Document, undefined, 'name') -export class TDocument extends TDoc implements Document { - @Prop(TypeString(), document.string.Name) - @Index(IndexKind.FullText) - name!: string - - @Prop(TypeNumber(), document.string.Version) - @ReadOnly() - @Hidden() - version!: number - - @Prop(TypeNumber(), document.string.LastRevision) - @ReadOnly() - @Hidden() - latest!: number - - @Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files }) - attachments?: number - - @Prop(Collection(chunter.class.Comment), chunter.string.Comments) - comments?: number - - @Prop(Collection(tags.class.TagReference), document.string.Labels) - labels?: number - - @Prop(Collection(document.class.DocumentVersion), document.string.Version) - @Hidden() - versions!: number - - @Prop(ArrOf(TypeRef(contact.mixin.Employee)), document.string.Authors) - authors!: Ref[] - - @Prop(ArrOf(TypeRef(contact.mixin.Employee)), document.string.Reviewers) - reviewers!: Ref[] - - @Prop(ArrOf(TypeRef(contact.mixin.Employee)), document.string.Approvers) - approvers!: Ref[] - - @Prop(Collection(document.class.DocumentRequest), document.string.Requests) - @Hidden() - requests!: number -} - -export function createModel (builder: Builder): void { - builder.createModel(TDocument, TDocumentVersion, TCollaboratorDocument, TDocumentRequest) - - builder.createDoc( - workbench.class.Application, - core.space.Model, - { - label: document.string.DocumentApplication, - icon: document.icon.DocumentApplication, - alias: documentId, - hidden: false, - navigatorModel: { - specials: [ - { - id: 'my-documents', - position: 'top', - label: document.string.MyDocuments, - icon: document.icon.Document, - component: document.component.MyDocuments - }, - { - id: 'library', - position: 'top', - label: document.string.Library, - icon: document.icon.Library, - component: document.component.Documents - } - ], - spaces: [] - }, - navHeaderComponent: document.component.NewDocumentHeader - }, - document.app.Documents - ) - - builder.mixin(document.class.Document, core.class.Class, view.mixin.ObjectFactory, { - component: document.component.CreateDocument - }) - - builder.mixin(document.class.Document, core.class.Class, view.mixin.ObjectPanel, { - component: document.component.EditDoc - }) - - builder.createDoc( - view.class.Viewlet, - core.space.Model, - { - attachTo: document.class.Document, - descriptor: view.viewlet.Table, - config: [ - '', - { - key: '', - presenter: document.component.Version, - label: document.string.Version - }, - 'comments', - 'attachments', - { - key: '', - presenter: tags.component.TagsPresenter, - label: document.string.Labels, - sortingKey: 'labels', - props: { - _class: document.class.Document, - key: 'labels', - icon: document.icon.Document - } - }, - 'modifiedOn' - ], - options: { - lookup: { - _id: { - versions: document.class.DocumentVersion - } - } - } - }, - document.viewlet.TableDocument - ) - - builder.mixin(document.class.Document, core.class.Class, view.mixin.ObjectEditor, { - editor: document.component.EditDoc - }) - - builder.mixin(document.class.Document, core.class.Class, view.mixin.ObjectPresenter, { - presenter: document.component.DocumentPresenter - }) - builder.mixin(document.class.DocumentVersion, core.class.Class, view.mixin.ObjectPresenter, { - presenter: document.component.DocumentVersionPresenter - }) - - builder.createDoc( - presentation.class.ObjectSearchCategory, - core.space.Model, - { - icon: document.icon.Document, - label: document.string.SearchDocument, - query: document.completion.DocumentQuery - }, - document.completion.DocumentQueryCategory - ) - - createAction(builder, { - ...actionTemplates.open, - actionProps: { - component: document.component.EditDoc - }, - target: document.class.Document, - context: { - mode: ['browser', 'context'], - group: 'create' - }, - override: [view.action.Open] - }) - builder.mixin(document.class.DocumentVersion, core.class.Class, view.mixin.CollectionEditor, { - editor: document.component.DocumentVersions - }) -} diff --git a/models/document/src/migration.ts b/models/document/src/migration.ts deleted file mode 100644 index 5433ba2d97..0000000000 --- a/models/document/src/migration.ts +++ /dev/null @@ -1,62 +0,0 @@ -// -// Copyright © 2022 Hardcore Engineering Inc. -// -// Licensed under the Eclipse Public License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. You may -// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import { TxOperations } from '@hcengineering/core' -import { createOrUpdate, MigrateOperation, MigrationClient, MigrationUpgradeClient } from '@hcengineering/model' -import core from '@hcengineering/model-core' -import tags from '@hcengineering/tags' -import document from './index' - -async function createSpace (tx: TxOperations): Promise { - const contacts = await tx.findOne(core.class.Space, { - _id: document.space.Documents - }) - if (contacts === undefined) { - await tx.createDoc( - core.class.Space, - core.space.Space, - { - name: 'Documents', - description: 'Documents', - private: false, - archived: false, - members: [] - }, - document.space.Documents - ) - } -} - -export const documentOperation: MigrateOperation = { - async migrate (client: MigrationClient): Promise {}, - async upgrade (client: MigrationUpgradeClient): Promise { - const tx = new TxOperations(client, core.account.System) - await createSpace(tx) - - await createOrUpdate( - tx, - tags.class.TagCategory, - tags.space.Tags, - { - icon: tags.icon.Tags, - label: 'Labels', - targetClass: document.class.Document, - tags: [], - default: true - }, - document.category.Other - ) - } -} diff --git a/models/document/src/plugin.ts b/models/document/src/plugin.ts deleted file mode 100644 index c9ff392d84..0000000000 --- a/models/document/src/plugin.ts +++ /dev/null @@ -1,48 +0,0 @@ -// -// Copyright © 2022 Hardcore Engineering Inc. -// -// Licensed under the Eclipse Public License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. You may -// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import type { Doc, Ref } from '@hcengineering/core' -import {} from '@hcengineering/core' -import { documentId } from '@hcengineering/document' -import document from '@hcengineering/document-resources/src/plugin' -import { ObjectSearchCategory, ObjectSearchFactory } from '@hcengineering/model-presentation' -import { IntlString, mergeIds, Resource } from '@hcengineering/platform' -import { TagCategory } from '@hcengineering/tags' -import { AnyComponent } from '@hcengineering/ui' -import { ActionCategory } from '@hcengineering/view' - -export default mergeIds(documentId, document, { - component: { - Documents: '' as AnyComponent, - DocumentPresenter: '' as AnyComponent, - DocumentVersionPresenter: '' as AnyComponent, - DocumentVersions: '' as AnyComponent - }, - completion: { - DocumentQuery: '' as Resource, - DocumentQueryCategory: '' as Ref - }, - category: { - Document: '' as Ref, - Other: '' as Ref - }, - viewlet: { - TableDocument: '' as Ref - }, - string: { - ConfigLabel: '' as IntlString, - ConfigDescription: '' as IntlString - } -}) diff --git a/models/document/tsconfig.json b/models/document/tsconfig.json deleted file mode 100644 index 807a92c38c..0000000000 --- a/models/document/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "./node_modules/@hcengineering/model-rig/profiles/default/tsconfig.json", - - "compilerOptions": { - "rootDir": "./src", - "outDir": "./lib", - } -} \ No newline at end of file diff --git a/plugins/document-assets/.eslintrc.js b/plugins/document-assets/.eslintrc.js deleted file mode 100644 index 8f8d9f363a..0000000000 --- a/plugins/document-assets/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['./node_modules/@hcengineering/platform-rig/profiles/assets/config/eslint.config.json'], - parserOptions: { - tsconfigRootDir: __dirname, - project: './tsconfig.json' - } -} diff --git a/plugins/document-assets/assets/icons.svg b/plugins/document-assets/assets/icons.svg deleted file mode 100644 index 8f27bf9898..0000000000 --- a/plugins/document-assets/assets/icons.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/document-assets/config/rig.json b/plugins/document-assets/config/rig.json deleted file mode 100644 index b75800b9b7..0000000000 --- a/plugins/document-assets/config/rig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", - "rigPackageName": "@hcengineering/platform-rig", - "rigProfile": "assets" -} diff --git a/plugins/document-assets/lang/en.json b/plugins/document-assets/lang/en.json deleted file mode 100644 index 861316157c..0000000000 --- a/plugins/document-assets/lang/en.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "string": { - "CreateDocument": "Create an document", - "DocumentCreateLabel": "Document", - "Documents": "Documents", - "CreateAnVersion": "Create new version", - "Document": "Document", - "DocumentNamePlaceholder": "Name...", - "Name": "Name", - "Cancel": "Cancel", - "EditorPlaceholder": "type to start editing...", - "Version": "Version", - "SearchDocument": "Search document...", - "Revision": "Revision", - "NoVersions": "No version's defined", - "CreateEnVersion": "Create version for review", - "Versions": "Versions", - "CreateDocumentVersion": "Create new version", - "Approvers": "Approvers", - "Status": "Status", - "LastRevision": "Last revision", - "DocumentApplication": "Documents", - "MyDocuments": "My documents", - "Library": "Library", - "Labels": "Labels", - "AddLabel": "Add label...", - "Authors": "Authors", - "DocumentVersionPlaceholder": "version...", - "DescriptionPlaceholder": "type for details...", - - "PendingReview": "Pending", - "Latest": "Actual", - "Draft": "Draft", - - "Description": "Description", - "Reviewers": "Reviewers", - - "ViewMode": "View", - "EditMode": "Edit", - "SuggestMode": "Suggest", - - "CreateDraft": "New Draft", - "SendForApproval": "Ask Approval", - "SendForReview": "Ask for Review", - - "Approve": "Approve", - "Reject": "Reject", - "Approved": "Approved", - "Rejected": "Rejected", - - "CompareTo": "Compare to...", - - "ConfigLabel": "Documents", - "ConfigDescription": "Extension for collaborative document editing" - } -} \ No newline at end of file diff --git a/plugins/document-assets/lang/ru.json b/plugins/document-assets/lang/ru.json deleted file mode 100644 index 958245a4c2..0000000000 --- a/plugins/document-assets/lang/ru.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "string": { - "CreateDocument": "Создать документ", - "DocumentCreateLabel": "Документ", - "Documents": "Документы", - "CreateAnVersion": "Создать новую версию", - "Document": "Документ", - "DocumentNamePlaceholder": "Имя...", - "Name": "Имя", - "Cancel": "Отмена", - "EditorPlaceholder": "введите для начала...", - "Version": "Версия", - "SearchDocument": "Найти документ...", - "Revision": "Ревизия", - "NoVersions": "Версии не определены", - "CreateEnVersion": "Создать версию для оценки", - "Versions": "Версии", - "CreateDocumentVersion": "Создать версию", - "Approvers": "Утверждающие", - "Status": "Статус", - "LastRevision": "Последняя ревизия", - "DocumentApplication": "Документы", - "MyDocuments": "Мои документы", - "Library": "Библиотека", - "Labels": "Метки", - "AddLabel": "Добавить метку...", - "Authors": "Авторы", - "DocumentVersionPlaceholder": "версия...", - "DescriptionPlaceholder": "введите для деталей...", - - "PendingReview": "Ожидает", - "Latest": "Актуально", - "Draft": "Рабочая копия", - - "Description": "Описание", - "Reviewers": "Рецензенты", - - "ViewMode": "Просмотр", - "EditMode": "Редактирование", - "SuggestMode": "Комментирование", - - "CreateDraft": "Новая рабочая копия", - "SendForApproval": "Попросить утверждения", - "SendForReview": "Попросить рецензию", - - "Approve": "Утвердить", - "Reject": "Отказать", - "Approved": "Утверждено", - "Rejected": "Отказано", - - "CompareTo": "Сравнить с...", - "ConfigLabel": "Документы", - "ConfigDescription": "Расширение по работе с текстовыми документами" - } -} \ No newline at end of file diff --git a/plugins/document-assets/package.json b/plugins/document-assets/package.json deleted file mode 100644 index e74c84b740..0000000000 --- a/plugins/document-assets/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@hcengineering/document-assets", - "version": "0.6.0", - "main": "lib/index.js", - "author": "Anticrm Platform Contributors", - "template": "@hcengineering/assets-package", - "license": "EPL-2.0", - "scripts": { - "build": "heft build", - "test": "heft test", - "build:docs": "", - "lint": "eslint src", - "lint:fix": "eslint --fix src", - "format": "prettier --write src && eslint --fix src", - "build:watch": "tsc" - }, - "devDependencies": { - "@hcengineering/platform-rig": "^0.6.0", - "@types/heft-jest": "^1.0.3", - "@typescript-eslint/eslint-plugin": "^5.41.0", - "@typescript-eslint/parser": "^5.41.0", - "eslint-config-standard-with-typescript": "^23.0.0", - "eslint-plugin-import": "^2.26.0", - "eslint-plugin-n": "^15.4.0", - "eslint-plugin-promise": "^6.1.1", - "eslint": "^8.26.0", - "prettier": "^2.7.1", - "@rushstack/heft": "^0.47.9", - "@types/node": "~16.11.12" - }, - "dependencies": { - "@hcengineering/platform": "^0.6.9", - "@hcengineering/document": "^0.6.0" - } -} diff --git a/plugins/document-assets/src/__tests__/lang.test.ts b/plugins/document-assets/src/__tests__/lang.test.ts deleted file mode 100644 index cf96c6dcf7..0000000000 --- a/plugins/document-assets/src/__tests__/lang.test.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { makeLocalesTest } from '@hcengineering/platform' - -it( - 'Locales are equale', - makeLocalesTest((lang) => import(`../../lang/${lang}.json`)) -) diff --git a/plugins/document-assets/src/index.ts b/plugins/document-assets/src/index.ts deleted file mode 100644 index 0bb8286ce9..0000000000 --- a/plugins/document-assets/src/index.ts +++ /dev/null @@ -1,26 +0,0 @@ -// -// Copyright © 2022 Hardcore Engineering Inc. -// -// Licensed under the Eclipse Public License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. You may -// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import document, { documentId } from '@hcengineering/document' -import { addStringsLoader, loadMetadata } from '@hcengineering/platform' - -const icons = require('../assets/icons.svg') as string // eslint-disable-line -loadMetadata(document.icon, { - DocumentApplication: `${icons}#documentapplication`, - NewDocument: `${icons}#newdocument`, - Document: `${icons}#document`, - Library: `${icons}#library` -}) -addStringsLoader(documentId, async (lang: string) => await import(`../lang/${lang}.json`)) diff --git a/plugins/document-assets/tsconfig.json b/plugins/document-assets/tsconfig.json deleted file mode 100644 index e161b20ea1..0000000000 --- a/plugins/document-assets/tsconfig.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "compilerOptions": { - "moduleResolution": "node", - "target": "esnext", - "module": "commonjs", - "sourceMap": true, - "types": ["node", "heft-jest"], - "declaration": true, - "outDir": "./lib", - "strict": true, - "skipLibCheck": true, - "esModuleInterop": true, - "lib": [ - "esnext", - "dom" - ] - } -} \ No newline at end of file diff --git a/plugins/document-resources/.eslintrc.js b/plugins/document-resources/.eslintrc.js deleted file mode 100644 index 8e724805a8..0000000000 --- a/plugins/document-resources/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['./node_modules/@hcengineering/platform-rig/profiles/ui/config/eslint.config.json'], - parserOptions: { tsconfigRootDir: __dirname }, - settings: { - 'svelte3/ignore-styles': () => true - } -} diff --git a/plugins/document-resources/config/rig.json b/plugins/document-resources/config/rig.json deleted file mode 100644 index 1a4b944f83..0000000000 --- a/plugins/document-resources/config/rig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", - "rigPackageName": "@hcengineering/platform-rig", - "rigProfile": "ui" -} diff --git a/plugins/document-resources/package.json b/plugins/document-resources/package.json deleted file mode 100644 index d40e167121..0000000000 --- a/plugins/document-resources/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "@hcengineering/document-resources", - "version": "0.6.0", - "main": "src/index.ts", - "author": "Anticrm Platform Contributors", - "license": "EPL-2.0", - "scripts": { - "build": "tsc --incremental --noEmit --outDir ./dist_cache && echo build", - "build:docs": "api-extractor run --local", - "lint": "svelte-check && eslint", - "lint:fix": "eslint --fix src", - "format": "prettier --write --plugin-search-dir=. src && eslint --fix src", - "svelte-check": "svelte-check --output human", - "build:watch": "tsc --incremental --noEmit --outDir ./dist_cache" - }, - "devDependencies": { - "svelte-loader": "^3.1.3", - "sass": "^1.53.0", - "svelte-preprocess": "5.0.3", - "@hcengineering/platform-rig": "^0.6.0", - "@typescript-eslint/eslint-plugin": "^5.41.0", - "@typescript-eslint/parser": "^5.41.0", - "eslint-config-standard-with-typescript": "^23.0.0", - "eslint-plugin-import": "^2.26.0", - "eslint-plugin-n": "^15.4.0", - "eslint-plugin-promise": "^6.1.1", - "eslint-plugin-svelte3": "^4.0.0", - "prettier-plugin-svelte": "^2.8.0", - "eslint": "^8.26.0", - "prettier": "^2.7.1", - "svelte-check": "3.2.0", - "typescript": "^4.3.5" - }, - "dependencies": { - "@hcengineering/platform": "^0.6.9", - "svelte": "3.55.1", - "@hcengineering/document": "^0.6.0", - "@hcengineering/ui": "^0.6.10", - "@hcengineering/setting": "^0.6.9", - "@hcengineering/presentation": "^0.6.2", - "@hcengineering/core": "^0.6.27", - "@hcengineering/view": "^0.6.8", - "@hcengineering/attachment-resources": "^0.6.0", - "@hcengineering/panel": "^0.6.12", - "@hcengineering/view-resources": "^0.6.0", - "@hcengineering/attachment": "^0.6.8", - "@hcengineering/notification": "^0.6.14", - "@hcengineering/login": "^0.6.7", - "@hcengineering/contact": "^0.6.19", - "@hcengineering/tags": "^0.6.11", - "@hcengineering/text-editor": "^0.6.0", - "@hcengineering/contact-resources": "^0.6.0" - } -} diff --git a/plugins/document-resources/postcss.config.js b/plugins/document-resources/postcss.config.js deleted file mode 100644 index 88752c6cb0..0000000000 --- a/plugins/document-resources/postcss.config.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - plugins: [ - require('autoprefixer') - ] -} diff --git a/plugins/document-resources/src/components/CreateDocument.svelte b/plugins/document-resources/src/components/CreateDocument.svelte deleted file mode 100644 index 619f33ddf2..0000000000 --- a/plugins/document-resources/src/components/CreateDocument.svelte +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - 0} - on:close={() => { - dispatch('close') - }} - on:changeContent -> -
-
-
- -
- - (object.authors = detail)} - /> - (object.approvers = detail)} - /> - (object.reviewers = detail)} - /> - -
diff --git a/plugins/document-resources/src/components/DocumentEditor.svelte b/plugins/document-resources/src/components/DocumentEditor.svelte deleted file mode 100644 index f9ce369438..0000000000 --- a/plugins/document-resources/src/components/DocumentEditor.svelte +++ /dev/null @@ -1,51 +0,0 @@ - - - -{#key comparedVersion} - -{/key} diff --git a/plugins/document-resources/src/components/DocumentItem.svelte b/plugins/document-resources/src/components/DocumentItem.svelte deleted file mode 100644 index afd0bb6a19..0000000000 --- a/plugins/document-resources/src/components/DocumentItem.svelte +++ /dev/null @@ -1,39 +0,0 @@ - - - -
-
- -
- - {value.name} - {#if lastVersion} - - {lastVersion?.version} - {/if} - -
diff --git a/plugins/document-resources/src/components/DocumentPresenter.svelte b/plugins/document-resources/src/components/DocumentPresenter.svelte deleted file mode 100644 index 4a283e559e..0000000000 --- a/plugins/document-resources/src/components/DocumentPresenter.svelte +++ /dev/null @@ -1,49 +0,0 @@ - - - -{#if value} - - {#if inline} - - @{value.name}-{value.version} - - {:else} -
-
- -
- - {value.name}-{value.version} - -
- {/if} -
-{/if} diff --git a/plugins/document-resources/src/components/DocumentVersionPresenter.svelte b/plugins/document-resources/src/components/DocumentVersionPresenter.svelte deleted file mode 100644 index 3346f239eb..0000000000 --- a/plugins/document-resources/src/components/DocumentVersionPresenter.svelte +++ /dev/null @@ -1,53 +0,0 @@ - - - -{#if value} - - {#if !inline} -
- -
- {/if} - - {doc?.name} - {value.version} - -
-{/if} diff --git a/plugins/document-resources/src/components/Documents.svelte b/plugins/document-resources/src/components/Documents.svelte deleted file mode 100644 index 909062b529..0000000000 --- a/plugins/document-resources/src/components/Documents.svelte +++ /dev/null @@ -1,87 +0,0 @@ - - - - -
-
-
- -
-
-
-
- updateResultQuery(search, query)} /> - -
- -
-
-
-
- - {#if loading} - - {:else if viewlet} - - {/if} -
diff --git a/plugins/document-resources/src/components/EditDoc.svelte b/plugins/document-resources/src/components/EditDoc.svelte deleted file mode 100644 index 6c9b3e0fc3..0000000000 --- a/plugins/document-resources/src/components/EditDoc.svelte +++ /dev/null @@ -1,580 +0,0 @@ - - - -{#if documentObject !== undefined} - dispatch('close')} - > - - - - - - - saveTitle(evt)} - /> - -
-
- - - -
-
- - {#if version && version?.state !== DocumentVersionState.Draft} -
diff --git a/plugins/document-resources/src/components/Status.svelte b/plugins/document-resources/src/components/Status.svelte deleted file mode 100644 index 9364f9f645..0000000000 --- a/plugins/document-resources/src/components/Status.svelte +++ /dev/null @@ -1,64 +0,0 @@ - - - -{#if value} -
- {#if value.state === DocumentVersionState.Draft} -
-
- {/if} - {#if value.state === DocumentVersionState.Approved} -
-
- {/if} - {#if value.state === DocumentVersionState.Rejected} -
-
- {/if} -
-{/if} - - diff --git a/plugins/document-resources/src/components/Version.svelte b/plugins/document-resources/src/components/Version.svelte deleted file mode 100644 index be4a3bd8f6..0000000000 --- a/plugins/document-resources/src/components/Version.svelte +++ /dev/null @@ -1,40 +0,0 @@ - - - -{#if lastVersion} - {lastVersion.version} -{/if} diff --git a/plugins/document-resources/src/components/icons/Edit.svelte b/plugins/document-resources/src/components/icons/Edit.svelte deleted file mode 100644 index 82ef9b9910..0000000000 --- a/plugins/document-resources/src/components/icons/Edit.svelte +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - diff --git a/plugins/document-resources/src/index.ts b/plugins/document-resources/src/index.ts deleted file mode 100644 index bf4ee0830e..0000000000 --- a/plugins/document-resources/src/index.ts +++ /dev/null @@ -1,88 +0,0 @@ -// -// Copyright © 2022 Hardcore Engineering Inc. -// -// Licensed under the Eclipse Public License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. You may -// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import { Class, Client, DocumentQuery, Ref, RelatedDocument, WithLookup } from '@hcengineering/core' -import { Document } from '@hcengineering/document' -import { Resources } from '@hcengineering/platform' -import { ObjectSearchResult } from '@hcengineering/presentation' - -import CreateDocument from './components/CreateDocument.svelte' -import DocumentPresenter from './components/DocumentPresenter.svelte' -import DocumentVersionPresenter from './components/DocumentVersionPresenter.svelte' -import Documents from './components/Documents.svelte' -import MyDocuments from './components/MyDocuments.svelte' -import EditDoc from './components/EditDoc.svelte' -import DocumentItem from './components/DocumentItem.svelte' -import NewDocumentHeader from './components/NewDocumentHeader.svelte' -import Status from './components/Status.svelte' -import Version from './components/Version.svelte' - -import document from './plugin' - -const toObjectSearchResult = (e: WithLookup): ObjectSearchResult => ({ - doc: e, - title: e.name, - icon: document.icon.Document, - component: DocumentItem -}) - -async function queryDocument ( - _class: Ref>, - client: Client, - search: string, - filter?: { in?: RelatedDocument[], nin?: RelatedDocument[] } -): Promise { - const q: DocumentQuery = { name: { $like: `%${search}%` } } - if (filter?.in !== undefined || filter?.nin !== undefined) { - q._id = {} - if (filter.in !== undefined) { - q._id.$in = filter.in?.map((it) => it._id as Ref) - } - if (filter.nin !== undefined) { - q._id.$nin = filter.nin?.map((it) => it._id as Ref) - } - } - return ( - await client.findAll(_class, q, { - limit: 200, - lookup: { - _id: { - versions: document.class.DocumentVersion - } - } - }) - ).map(toObjectSearchResult) -} - -export default async (): Promise => ({ - component: { - CreateDocument, - DocumentPresenter, - Documents, - EditDoc, - DocumentVersionPresenter, - NewDocumentHeader, - MyDocuments, - Status, - Version - }, - completion: { - DocumentQuery: async ( - client: Client, - query: string, - filter?: { in?: RelatedDocument[], nin?: RelatedDocument[] } - ) => await queryDocument(document.class.Document, client, query, filter) - } -}) diff --git a/plugins/document-resources/src/plugin.ts b/plugins/document-resources/src/plugin.ts deleted file mode 100644 index 1eeb4d6410..0000000000 --- a/plugins/document-resources/src/plugin.ts +++ /dev/null @@ -1,83 +0,0 @@ -// -// Copyright © 2022 Hardcore Engineering Inc. -// -// Licensed under the Eclipse Public License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. You may -// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import document, { documentId } from '@hcengineering/document' -import { IntlString, mergeIds } from '@hcengineering/platform' -import { AnyComponent } from '@hcengineering/ui' - -export default mergeIds(documentId, document, { - component: { - EditDoc: '' as AnyComponent, - MyDocuments: '' as AnyComponent, - NewDocumentHeader: '' as AnyComponent, - Status: '' as AnyComponent, - Version: '' as AnyComponent, - Revision: '' as AnyComponent - }, - string: { - Apply: '' as IntlString, - DocumentNamePlaceholder: '' as IntlString, - Name: '' as IntlString, - Cancel: '' as IntlString, - Documents: '' as IntlString, - DocumentCreateLabel: '' as IntlString, - EditorPlaceholder: '' as IntlString, - Versions: '' as IntlString, - Document: '' as IntlString, - SearchDocument: '' as IntlString, - Version: '' as IntlString, - Revision: '' as IntlString, - NoVersions: '' as IntlString, - NoBaseVersion: '' as IntlString, - CreateAnVersion: '' as IntlString, - CreateDocumentVersion: '' as IntlString, - Approvers: '' as IntlString, - Status: '' as IntlString, - LastRevision: '' as IntlString, - DocumentApplication: '' as IntlString, - MyDocuments: '' as IntlString, - Library: '' as IntlString, - Labels: '' as IntlString, - Authors: '' as IntlString, - AddLabel: '' as IntlString, - DocumentVersionPlaceholder: '' as IntlString, - - PendingReview: '' as IntlString, - Latest: '' as IntlString, - Draft: '' as IntlString, - Approved: '' as IntlString, - Rejected: '' as IntlString, - - Description: '' as IntlString, - DescriptionPlaceholder: '' as IntlString, - Baseline: '' as IntlString, - Reviewers: '' as IntlString, - - ViewMode: '' as IntlString, - EditMode: '' as IntlString, - SuggestMode: '' as IntlString, - - CreateDraft: '' as IntlString, - SendForApproval: '' as IntlString, - SendForReview: '' as IntlString, - - Requests: '' as IntlString, - - Approve: '' as IntlString, - Reject: '' as IntlString, - - CompareTo: '' as IntlString - } -}) diff --git a/plugins/document-resources/svelte.config.js b/plugins/document-resources/svelte.config.js deleted file mode 100644 index 944a06f73e..0000000000 --- a/plugins/document-resources/svelte.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const sveltePreprocess = require('svelte-preprocess') - -module.exports = { - preprocess: sveltePreprocess() -}; \ No newline at end of file diff --git a/plugins/document-resources/tsconfig.json b/plugins/document-resources/tsconfig.json deleted file mode 100644 index 0980a1b8b4..0000000000 --- a/plugins/document-resources/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "compilerOptions": { - "moduleResolution": "node", - "target": "esnext", - "module": "esnext", - "declaration": true, - "outDir": "./lib", - "strict": true, - "skipLibCheck": true, - "esModuleInterop": true, - "lib": [ - "esnext", - "dom" - ] - } -} \ No newline at end of file diff --git a/plugins/document/.eslintrc.js b/plugins/document/.eslintrc.js deleted file mode 100644 index 7f7cebe58b..0000000000 --- a/plugins/document/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['./node_modules/@hcengineering/platform-rig/profiles/default/config/eslint.config.json'], - parserOptions: { - tsconfigRootDir: __dirname, - project: './tsconfig.json' - } -} diff --git a/plugins/document/.npmignore b/plugins/document/.npmignore deleted file mode 100644 index e3ec093c38..0000000000 --- a/plugins/document/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -* -!/lib/** -!CHANGELOG.md -/lib/**/__tests__/ diff --git a/plugins/document/config/rig.json b/plugins/document/config/rig.json deleted file mode 100644 index 2fdc07ba20..0000000000 --- a/plugins/document/config/rig.json +++ /dev/null @@ -1,18 +0,0 @@ -// The "rig.json" file directs tools to look for their config files in an external package. -// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package -{ - "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", - - /** - * (Required) The name of the rig package to inherit from. - * It should be an NPM package name with the "-rig" suffix. - */ - "rigPackageName": "@hcengineering/platform-rig" - - /** - * (Optional) Selects a config profile from the rig package. The name must consist of - * lowercase alphanumeric words separated by hyphens, for example "sample-profile". - * If omitted, then the "default" profile will be used." - */ - // "rigProfile": "your-profile-name" -} diff --git a/plugins/document/package.json b/plugins/document/package.json deleted file mode 100644 index 5e2d223d6f..0000000000 --- a/plugins/document/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@hcengineering/document", - "version": "0.6.0", - "main": "lib/index.js", - "author": "Anticrm Platform Contributors", - "license": "EPL-2.0", - "scripts": { - "build": "heft build", - "build:watch": "tsc", - "lint:fix": "eslint --fix src", - "lint": "eslint src", - "format": "prettier --write src && eslint --fix src" - }, - "devDependencies": { - "@hcengineering/platform-rig": "^0.6.0", - "@types/heft-jest": "^1.0.3", - "@typescript-eslint/eslint-plugin": "^5.41.0", - "eslint-plugin-import": "^2.26.0", - "eslint-plugin-promise": "^6.1.1", - "eslint-plugin-n": "^15.4.0", - "eslint": "^8.26.0", - "@typescript-eslint/parser": "^5.41.0", - "eslint-config-standard-with-typescript": "^23.0.0", - "prettier": "^2.7.1", - "@rushstack/heft": "^0.47.9", - "typescript": "^4.3.5" - }, - "dependencies": { - "@hcengineering/platform": "^0.6.9", - "@hcengineering/ui": "^0.6.10", - "@hcengineering/core": "^0.6.27", - "@hcengineering/view": "^0.6.8", - "@hcengineering/contact": "^0.6.19", - "@hcengineering/notification": "^0.6.14", - "@hcengineering/attachment": "^0.6.8" - }, - "repository": "https://github.com/hcengineering/anticrm", - "publishConfig": { - "registry": "https://npm.pkg.github.com" - } -} diff --git a/plugins/document/src/index.ts b/plugins/document/src/index.ts deleted file mode 100644 index 25ee0cbb83..0000000000 --- a/plugins/document/src/index.ts +++ /dev/null @@ -1,146 +0,0 @@ -// -// Copyright © 2022 Hardcore Engineering Inc. -// -// Licensed under the Eclipse Public License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. You may -// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import { Attachment } from '@hcengineering/attachment' -import { Employee } from '@hcengineering/contact' -import { AttachedDoc, Class, Doc, Markup, Ref, Space } from '@hcengineering/core' -import type { Asset, Metadata, Plugin } from '@hcengineering/platform' -import { IntlString, plugin } from '@hcengineering/platform' -import type { AnyComponent } from '@hcengineering/ui' - -/** - * @public - */ -export interface Document extends Doc { - name: string - - version: number // Latest approved version of document - latest: number // Latest draft version - - // Collection of versions of this document. - versions: number - - attachments?: number - comments?: number - labels?: number - - // List of authors, who could edit the version until it will be published - // Combined with reviewers. - authors: Ref[] - - // List of persons who revieded version - reviewers: Ref[] - - // List of persions who approved version. - approvers: Ref[] - - requests: number -} - -/** - * @public - */ -export enum DocumentVersionState { - Draft, - Approved, - Rejected -} -/** - * @public - */ -export interface DocumentVersion extends AttachedDoc { - version: number // Uniq version of document. - - description: Markup - reason: Markup - impact: Markup - - state: DocumentVersionState - - // Defined only if document being proposed for review or approval - content: Markup - contentAttachmentId: Ref - initialContentId: Ref | undefined - - // Attachments contain a CollaboratorDocument with content hold in S3 - attachments: number - comments: number -} - -/** - * A collaborative document handle, with a minio document in collaborative mode. - * @public - */ -export interface CollaboratorDocument extends Attachment {} - -/** - * @public - */ -export enum DocumentRequestKind { - Review, // Review requested - Approve, // Approve requested - Changes // Changes requested -} -/** - * @public - */ -export interface DocumentRequest extends AttachedDoc { - kind: DocumentRequestKind - assignee: Ref - message?: Markup -} - -/** - * @public - */ -export const documentId = 'document' as Plugin - -/** - * @public - */ -const documentPlugin = plugin(documentId, { - class: { - Document: '' as Ref>, - DocumentVersion: '' as Ref>, - DocumentRequest: '' as Ref>, - CollaboratorDocument: '' as Ref> - }, - component: { - CreateDocument: '' as AnyComponent - }, - icon: { - DocumentApplication: '' as Asset, - NewDocument: '' as Asset, - Document: '' as Asset, - Library: '' as Asset - }, - space: { - Documents: '' as Ref - }, - app: { - Documents: '' as Ref - }, - string: { - CreateDocument: '' as IntlString - }, - ids: { - NO_VERSION: '' as Ref - }, - metadata: { - CollaboratorUrl: '' as Metadata - } -}) - -export default documentPlugin diff --git a/plugins/document/tsconfig.json b/plugins/document/tsconfig.json deleted file mode 100644 index fd821f3e97..0000000000 --- a/plugins/document/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./node_modules/@hcengineering/platform-rig/profiles/default/tsconfig.json", - - "compilerOptions": { - "rootDir": "./src", - "outDir": "./lib", - "lib": ["esnext", "dom"] - } -} \ No newline at end of file diff --git a/pods/collaborator/.eslintrc.js b/pods/collaborator/.eslintrc.js deleted file mode 100644 index 7f7cebe58b..0000000000 --- a/pods/collaborator/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['./node_modules/@hcengineering/platform-rig/profiles/default/config/eslint.config.json'], - parserOptions: { - tsconfigRootDir: __dirname, - project: './tsconfig.json' - } -} diff --git a/pods/collaborator/.npmignore b/pods/collaborator/.npmignore deleted file mode 100644 index e3ec093c38..0000000000 --- a/pods/collaborator/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -* -!/lib/** -!CHANGELOG.md -/lib/**/__tests__/ diff --git a/pods/collaborator/Dockerfile b/pods/collaborator/Dockerfile deleted file mode 100644 index ab61de81ac..0000000000 --- a/pods/collaborator/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ - -FROM node:18-alpine - -WORKDIR /usr/src/app - -COPY bundle.js ./ - -EXPOSE 3078 -CMD [ "node", "bundle.js" ] diff --git a/pods/collaborator/build.sh b/pods/collaborator/build.sh deleted file mode 100755 index 0301e46926..0000000000 --- a/pods/collaborator/build.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# -# Copyright © 2020, 2021 Anticrm Platform Contributors. -# Copyright © 2021 Hardcore Engineering Inc. -# -# Licensed under the Eclipse Public License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. You may -# obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# -# See the License for the specific language governing permissions and -# limitations under the License. -# - -rushx bundle -rushx docker:build -rushx docker:push diff --git a/pods/collaborator/config/rig.json b/pods/collaborator/config/rig.json deleted file mode 100644 index 2fdc07ba20..0000000000 --- a/pods/collaborator/config/rig.json +++ /dev/null @@ -1,18 +0,0 @@ -// The "rig.json" file directs tools to look for their config files in an external package. -// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package -{ - "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", - - /** - * (Required) The name of the rig package to inherit from. - * It should be an NPM package name with the "-rig" suffix. - */ - "rigPackageName": "@hcengineering/platform-rig" - - /** - * (Optional) Selects a config profile from the rig package. The name must consist of - * lowercase alphanumeric words separated by hyphens, for example "sample-profile". - * If omitted, then the "default" profile will be used." - */ - // "rigProfile": "your-profile-name" -} diff --git a/pods/collaborator/package.json b/pods/collaborator/package.json deleted file mode 100644 index fa313b4dec..0000000000 --- a/pods/collaborator/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "@hcengineering/pod-collaborator", - "version": "0.6.0", - "main": "lib/index.js", - "author": "Anticrm Platform Contributors", - "license": "EPL-2.0", - "scripts": { - "build": "heft build", - "build:watch": "tsc", - "lint:fix": "eslint --fix src", - "bundle": "esbuild src/__start.ts --bundle --platform=node > bundle.js", - "docker:build": "docker build -t hardcoreeng/collaborator .", - "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/collaborator staging", - "docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/collaborator", - "run-local": "cross-env SECRET=secret MINIO_ENDPOINT=localhost MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin ts-node src/__start.ts", - "run-bundle": "cross-env SECRET=secret MINIO_ENDPOINT=localhost MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin node ./bundle.js", - "lint": "eslint src", - "format": "prettier --write src && eslint --fix src" - }, - "devDependencies": { - "cross-env": "~7.0.3", - "@hcengineering/platform-rig": "^0.6.0", - "@types/heft-jest": "^1.0.3", - "@types/node": "~16.11.12", - "@typescript-eslint/eslint-plugin": "^5.41.0", - "eslint-plugin-import": "^2.26.0", - "eslint-plugin-promise": "^6.1.1", - "eslint-plugin-n": "^15.4.0", - "eslint": "^8.26.0", - "esbuild": "^0.16.14", - "@typescript-eslint/parser": "^5.41.0", - "eslint-config-standard-with-typescript": "^23.0.0", - "prettier": "^2.7.1", - "ts-node": "^10.8.0", - "@rushstack/heft": "^0.47.9", - "typescript": "^4.3.5", - "@types/ws": "^8.5.3" - }, - "dependencies": { - "@hcengineering/core": "^0.6.27", - "@hcengineering/account": "^0.6.0", - "@hcengineering/platform": "^0.6.9", - "@hcengineering/server-tool": "^0.6.0", - "@hcengineering/server-token": "^0.6.6", - "@hcengineering/server-core": "^0.6.1", - "lib0": "~0.2.52", - "y-protocols": "^1.0.5", - "ws": "^8.10.0", - "yjs": "^13.5.52", - "@hcengineering/minio": "^0.6.0" - } -} diff --git a/pods/collaborator/src/__start.ts b/pods/collaborator/src/__start.ts deleted file mode 100644 index c3f75b0bea..0000000000 --- a/pods/collaborator/src/__start.ts +++ /dev/null @@ -1,50 +0,0 @@ -// -// Copyright © 2020, 2021 Anticrm Platform Contributors. -// Copyright © 2021 Hardcore Engineering Inc. -// -// Licensed under the Eclipse Public License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. You may -// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import { setMetadata } from '@hcengineering/platform' -import serverToken from '@hcengineering/server-token' -import { metricsContext } from './metrics' -import { start } from './server' - -import { MinioService } from '@hcengineering/minio' -import config from './config' - -setMetadata(serverToken.metadata.Secret, config.Secret) - -let minioPort = 9000 -let minioEndpoint = config.MinioEndpoint -const sp = minioEndpoint.split(':') -if (sp.length > 1) { - minioEndpoint = sp[0] - minioPort = parseInt(sp[1]) -} - -const minio = new MinioService({ - endPoint: minioEndpoint, - port: minioPort, - useSSL: false, - accessKey: config.MinioAccessKey, - secretKey: config.MinioSecretKey -}) - -const server = start(metricsContext, config.Port, minio) - -const close = (): void => { - server() -} -process.on('SIGINT', close) -process.on('SIGTERM', close) -process.on('exit', close) diff --git a/pods/collaborator/src/config.ts b/pods/collaborator/src/config.ts deleted file mode 100644 index f12c886494..0000000000 --- a/pods/collaborator/src/config.ts +++ /dev/null @@ -1,68 +0,0 @@ -// -// Copyright © 2022 Hardcore Engineering Inc. -// -// Licensed under the Eclipse Public License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. You may -// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// - -interface Config { - ServiceID: string - Secret: string - - Interval: number - - Port: number - - MinioEndpoint: string - MinioAccessKey: string - MinioSecretKey: string -} - -const envMap: { [key in keyof Config]: string } = { - ServiceID: 'SERVICE_ID', - Secret: 'SECRET', - Interval: 'INTERVAL', - Port: 'COLLABORATOR_PORT', - MinioEndpoint: 'MINIO_ENDPOINT', - MinioAccessKey: 'MINIO_ACCESS_KEY', - MinioSecretKey: 'MINIO_SECRET_KEY' -} - -const required: Array = [ - 'Secret', - 'ServiceID', - 'Port', - 'MinioEndpoint', - 'MinioAccessKey', - 'MinioSecretKey' -] - -const config: Config = (() => { - const params: Partial = { - Secret: process.env[envMap.Secret], - ServiceID: process.env[envMap.ServiceID] ?? 'collaborator-service', - Interval: parseInt(process.env[envMap.Interval] ?? '30000'), - Port: parseInt(process.env[envMap.Port] ?? '3078'), - MinioEndpoint: process.env[envMap.MinioEndpoint], - MinioAccessKey: process.env[envMap.MinioAccessKey], - MinioSecretKey: process.env[envMap.MinioSecretKey] - } - - const missingEnv = required.filter((key) => params[key] === undefined).map((key) => envMap[key]) - - if (missingEnv.length > 0) { - throw Error(`Missing env variables: ${missingEnv.join(', ')}`) - } - - return params as Config -})() - -export default config diff --git a/pods/collaborator/src/index.ts b/pods/collaborator/src/index.ts deleted file mode 100644 index f21098492a..0000000000 --- a/pods/collaborator/src/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -// -// Copyright © 2020, 2021 Anticrm Platform Contributors. -// Copyright © 2021, 2022 Hardcore Engineering Inc. -// -// Licensed under the Eclipse Public License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. You may -// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// - -export { start } from './server' diff --git a/pods/collaborator/src/metrics.ts b/pods/collaborator/src/metrics.ts deleted file mode 100644 index 128c637e37..0000000000 --- a/pods/collaborator/src/metrics.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { MeasureMetricsContext, metricsToString, newMetrics } from '@hcengineering/core' -import { writeFile } from 'fs/promises' - -const metricsFile = process.env.METRICS_FILE -const metricsConsole = (process.env.METRICS_CONSOLE ?? 'false') === 'true' - -const METRICS_UPDATE_INTERVAL = !metricsConsole ? 1000 : 30000 - -const metrics = newMetrics() -export const metricsContext = new MeasureMetricsContext('System', {}, metrics) - -if (metricsFile !== undefined || metricsConsole) { - console.info('storing measurements into local file', metricsFile) - let oldMetricsValue = '' - - const intTimer = setInterval(() => { - const val = metricsToString(metrics, 'System', 140) - if (val !== oldMetricsValue) { - oldMetricsValue = val - if (metricsFile !== undefined) { - writeFile(metricsFile, val).catch((err) => console.error(err)) - } - if (metricsConsole) { - console.info('METRICS:', val) - } - } - }, METRICS_UPDATE_INTERVAL) - - const closeTimer = (): void => { - clearInterval(intTimer) - } - process.on('SIGINT', closeTimer) - process.on('SIGTERM', closeTimer) -} diff --git a/pods/collaborator/src/server.ts b/pods/collaborator/src/server.ts deleted file mode 100644 index 45b1ce71fd..0000000000 --- a/pods/collaborator/src/server.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { MeasureContext } from '@hcengineering/core' -import { UNAUTHORIZED } from '@hcengineering/platform' -import { Token, decodeToken } from '@hcengineering/server-token' -import { IncomingMessage, createServer } from 'http' -import WebSocket, { WebSocketServer } from 'ws' -import { setupWSConnection } from './yserver' - -import { MinioService } from '@hcengineering/minio' -/** - * @public - * @param sessionFactory - - * @param port - - * @param host - - */ -export function start (ctx: MeasureContext, port: number, minio: MinioService, host?: string): () => void { - console.log(`starting server on port ${port} ...`) - - const wss = new WebSocketServer({ - noServer: true, - perMessageDeflate: { - zlibDeflateOptions: { - // See zlib defaults. - chunkSize: 1024, - memLevel: 7, - level: 3 - }, - zlibInflateOptions: { - chunkSize: 10 * 1024 - }, - // Below options specified as default values. - concurrencyLimit: 10, // Limits zlib concurrency for perf. - threshold: 1024 // Size (in bytes) below which messages - // should not be compressed if context takeover is disabled. - } - }) - // eslint-disable-next-line @typescript-eslint/no-misused-promises - wss.on( - 'connection', - (ws: WebSocket, request: IncomingMessage, token: Token, documentId: string, initialContentId: string) => { - setupWSConnection(ws, request, documentId, token, minio, initialContentId) - } - ) - - const server = createServer() - - server.on('upgrade', (request: IncomingMessage, socket: any, head: Buffer) => { - try { - const parsedUrl = new URL('http://host' + (request.url ?? '')) - const token = parsedUrl.searchParams.get('token') - const payload = decodeToken(token ?? '') - - const documentId = parsedUrl.searchParams.get('documentId') as string - console.log('client connected with payload', payload, documentId) - const initialContentId = parsedUrl.searchParams.get('initialContentId') as string - wss.handleUpgrade(request, socket, head, (ws) => - wss.emit('connection', ws, request, payload, documentId, initialContentId) - ) - } catch (err) { - wss.handleUpgrade(request, socket, head, (ws) => { - const resp = { - id: -1, - error: UNAUTHORIZED, - result: 'hello' - } - ws.send(JSON.stringify(resp)) - ws.onmessage = (msg) => { - const resp = { - error: UNAUTHORIZED - } - ws.send(JSON.stringify(resp)) - } - }) - } - }) - - server.listen(port, host) - return () => { - server.close() - } -} diff --git a/pods/collaborator/src/yserver.ts b/pods/collaborator/src/yserver.ts deleted file mode 100644 index 4df7e0173d..0000000000 --- a/pods/collaborator/src/yserver.ts +++ /dev/null @@ -1,351 +0,0 @@ -import { applyAwarenessUpdate, Awareness, encodeAwarenessUpdate, removeAwarenessStates } from 'y-protocols/awareness' -import { readSyncMessage, writeSyncStep1, writeUpdate } from 'y-protocols/sync' -import { applyUpdate, Doc, encodeStateAsUpdate } from 'yjs' - -import { createDecoder, readVarUint, readVarUint8Array } from 'lib0/decoding' -import { createEncoder, length, toUint8Array, writeVarUint, writeVarUint8Array } from 'lib0/encoding' - -import { Token } from '@hcengineering/server-token' -import WebSocket from 'ws' - -import { MinioService } from '@hcengineering/minio' - -const wsReadyStateConnecting = 0 -const wsReadyStateOpen = 1 -const wsReadyStateClosing = 2 // eslint-disable-line -const wsReadyStateClosed = 3 // eslint-disable-line - -// disable gc when using snapshots! -const gcEnabled = process.env.GC !== 'false' && process.env.GC !== '0' - -/** - * @public - */ -export interface YPersistence { - bindState: ( - documentId: string, - ydoc: WSSharedDoc, - token: Token, - minio: MinioService, - initialContentId: string - ) => Promise - writeState: (documentId: string, ydoc: WSSharedDoc, token: Token) => Promise - provider: any -} - -/** - * @public - */ -let persistence: YPersistence -persistence = { - provider: 'platform', - bindState: async ( - documentId: string, - ydoc: WSSharedDoc, - token: Token, - minio: MinioService, - initialContentId: string - ): Promise => { - try { - ydoc.minio = minio - - let minioDocument: Buffer | undefined - try { - minioDocument = Buffer.concat(await minio.read(token.workspace, documentId)) - console.log('bind for document', documentId, token.email) - } catch (err: any) { - if (initialContentId !== undefined && initialContentId.length > 0) { - // Try first take existing document. - - const existingDoc = getYDoc(initialContentId, token, true, minio, initialContentId, false) - if (existingDoc !== undefined) { - const newUpdates = encodeStateAsUpdate(existingDoc) - minioDocument = Buffer.from(newUpdates.buffer) - console.log('bind for existing document', documentId, token.email) - } else { - minioDocument = Buffer.concat(await minio.read(token.workspace, initialContentId)) - console.log('bind for initial document', documentId, token.email, initialContentId) - } - } - } - - if (minioDocument !== undefined && minioDocument.length > 0) { - try { - const uint8arr = new Uint8Array(minioDocument) - applyUpdate(ydoc, uint8arr) - } catch (err) { - console.error(err) - } - } - } catch (err: any) { - console.error(err) - } - }, - writeState: async (documentId: string, ydoc: WSSharedDoc, token: Token): Promise => { - try { - const newUpdates = encodeStateAsUpdate(ydoc) - const buffer = Buffer.from(newUpdates.buffer) - - await ydoc?.minio?.put(token.workspace, documentId, buffer) - - console.log('state written for', documentId, token.email) - } catch (err: any) { - console.error(err) - } - } -} - -/** - * @public - */ -export function setPersistence (persistence_: YPersistence): void { - persistence = persistence_ -} - -/** - * @public - */ -export const getPersistence = (): YPersistence | null => persistence - -/** - * @public - */ -export const docs: Map = new Map() - -const messageSync = 0 -const messageAwareness = 1 -// const messageAuth = 2 - -/** - * @param {Uint8Array} update - * @param {any} origin - * @param {WSSharedDoc} doc - */ -const updateHandler = (update: Uint8Array, origin: any, doc: WSSharedDoc): any => { - const encoder = createEncoder() - writeVarUint(encoder, messageSync) - writeUpdate(encoder, update) - const message = toUint8Array(encoder) - doc.conns.forEach((_, conn) => send(doc, conn, message)) -} - -export interface ConnectionEntry { - ids: Set - token: Token -} - -class WSSharedDoc extends Doc { - conns = new Map() - awareness: Awareness - - minio?: MinioService - - /** - * @param {{ added: Array, updated: Array, removed: Array }} changes - * @param {Object | null} conn Origin is the connection that made the change - */ - awarenessChangeHandler = ( - { added, updated, removed }: { added: Array, updated: Array, removed: Array }, - conn: WebSocket | null - ): void => { - const changedClients = added.concat(updated, removed) - if (conn !== null) { - const connControlledIDs = /** @type {Set} */ this.conns.get(conn) - if (connControlledIDs !== undefined) { - added.forEach((clientID) => { - connControlledIDs.ids.add(clientID) - }) - removed.forEach((clientID) => { - connControlledIDs.ids.delete(clientID) - }) - } - } - // broadcast awareness update - const encoder = createEncoder() - writeVarUint(encoder, messageAwareness) - writeVarUint8Array(encoder, encodeAwarenessUpdate(this.awareness, changedClients)) - const buff = toUint8Array(encoder) - this.conns.forEach((_, c) => { - send(this, c, buff) - }) - } - - constructor (readonly name: string) { - super({ gc: gcEnabled }) - - this.awareness = new Awareness(this) - this.awareness.setLocalState(null) - - this.awareness.on('update', this.awarenessChangeHandler) - this.on('update', updateHandler) - } -} - -/** - * Gets a Y.Doc by name, whether in memory or on disk - * - * @param {string} docId - the name of the Y.Doc to find or create - * @param {boolean} gc - whether to allow gc on the doc (applies only when created) - * @return {WSSharedDoc} - */ -export function getYDoc ( - docId: string, - token: Token, - gc = true, - minio: MinioService, - initialContentId: string, - allowBind = true -): WSSharedDoc | undefined { - let doc = docs.get(docId) - if (doc === undefined && allowBind) { - doc = new WSSharedDoc(docId) - doc.gc = gc - docs.set(docId, doc) - - void persistence.bindState(docId, doc, token, minio, initialContentId) - } - return doc -} -/** - * @param {any} conn - * @param {WSSharedDoc} doc - * @param {Uint8Array} message - */ -const messageListener = (conn: any, doc: WSSharedDoc, message: Uint8Array): void => { - try { - const encoder = createEncoder() - const decoder = createDecoder(message) - const messageType = readVarUint(decoder) - switch (messageType) { - case messageSync: - writeVarUint(encoder, messageSync) - readSyncMessage(decoder, encoder, doc, null) - - // If the `encoder` only contains the type of reply message and no - // message, there is no need to send the message. When `encoder` only - // contains the type of reply, its length is 1. - if (length(encoder) > 1) { - send(doc, conn, toUint8Array(encoder)) - } - break - case messageAwareness: { - applyAwarenessUpdate(doc.awareness, readVarUint8Array(decoder), conn) - break - } - } - } catch (err) { - console.error(err) - doc.emit('error', [err]) - } -} - -/** - * @param {WSSharedDoc} doc - * @param {any} conn - */ -const closeConn = (doc: WSSharedDoc, conn: any): void => { - if (doc.conns.has(conn)) { - /** - * @type {Set} - */ - const controlledIds = doc.conns.get(conn) - doc.conns.delete(conn) - removeAwarenessStates(doc.awareness, Array.from(controlledIds?.ids?.values() ?? []), null) - if (doc.conns.size === 0 && persistence !== null) { - // if persisted, we store state and destroy ydocument - if (controlledIds !== undefined) { - void persistence.writeState(doc.name, doc, controlledIds?.token).then(() => { - docs.delete(doc.name) - doc.destroy() - }) - } - } - } - conn.close() -} - -/** - * @param {WSSharedDoc} doc - * @param {any} conn - * @param {Uint8Array} m - */ -const send = (doc: WSSharedDoc, conn: any, m: Uint8Array): void => { - if (conn.readyState !== wsReadyStateConnecting && conn.readyState !== wsReadyStateOpen) { - closeConn(doc, conn) - } - try { - conn.send( - m, - /** @param {any} err */ (err: any) => { - err != null && closeConn(doc, conn) - } - ) - } catch (e) { - closeConn(doc, conn) - } -} - -const pingTimeout = 30000 - -export function setupWSConnection ( - conn: WebSocket, - req: any, - documentId: string, - token: Token, - minio: MinioService, - initialContentId: string, - gc = true -): void { - conn.binaryType = 'arraybuffer' - // get doc, initialize if it does not exist yet - const doc = getYDoc(documentId, token, gc, minio, initialContentId) - if (doc === undefined) { - conn.close() - return - } - doc.conns.set(conn, { ids: new Set(), token }) - // listen and reply to events - conn.on('message', (message: ArrayBuffer) => messageListener(conn, doc, new Uint8Array(message))) - - // Check if connection is still alive - let pongReceived = true - const pingInterval = setInterval(() => { - if (!pongReceived) { - if (doc.conns.has(conn)) { - closeConn(doc, conn) - } - clearInterval(pingInterval) - } else if (doc.conns.has(conn)) { - pongReceived = false - try { - conn.ping() - } catch (e) { - closeConn(doc, conn) - clearInterval(pingInterval) - } - } - }, pingTimeout) - conn.on('close', () => { - closeConn(doc, conn) - clearInterval(pingInterval) - }) - conn.on('pong', () => { - pongReceived = true - }) - // put the following in a variables in a block so the interval handlers don't keep in in - // scope - { - // send sync step 1 - const encoder = createEncoder() - writeVarUint(encoder, messageSync) - writeSyncStep1(encoder, doc) - send(doc, conn, toUint8Array(encoder)) - const awarenessStates = doc.awareness.getStates() - if (awarenessStates.size > 0) { - const encoder = createEncoder() - writeVarUint(encoder, messageAwareness) - writeVarUint8Array(encoder, encodeAwarenessUpdate(doc.awareness, Array.from(awarenessStates.keys()))) - send(doc, conn, toUint8Array(encoder)) - } - } -} diff --git a/pods/collaborator/tsconfig.json b/pods/collaborator/tsconfig.json deleted file mode 100644 index 0a48e04279..0000000000 --- a/pods/collaborator/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "./node_modules/@hcengineering/platform-rig/profiles/default/tsconfig.json", - - "compilerOptions": { - "rootDir": "./src", - "outDir": "./lib", - "esModuleInterop": true, - "types": ["node"] - } -} \ No newline at end of file diff --git a/pods/front/run.sh b/pods/front/run.sh index 6cd93ae249..85d240ab87 100755 --- a/pods/front/run.sh +++ b/pods/front/run.sh @@ -1,7 +1,6 @@ #!/bin/bash export ACCOUNTS_URL=http://localhost:3333 -export COLLABORATOR_URL=ws://localhost:3078 export UPLOAD_URL=http://localhost:3333/files export TRANSACTOR_URL=ws://localhost:3333 export ELASTIC_URL=http://elastic:9200 diff --git a/pods/server/package.json b/pods/server/package.json index fa88aab200..6ab9be8e18 100644 --- a/pods/server/package.json +++ b/pods/server/package.json @@ -110,7 +110,6 @@ "@hcengineering/tracker-assets": "^0.6.0", "@hcengineering/board-assets": "^0.6.10", "@hcengineering/hr-assets": "^0.6.10", - "@hcengineering/document-assets": "^0.6.0", "@hcengineering/bitrix-assets": "^0.6.0", "@hcengineering/request-assets": "^0.6.0", "@hcengineering/login": "^0.6.7", @@ -136,7 +135,6 @@ "@hcengineering/tracker": "^0.6.11", "@hcengineering/board": "^0.6.10", "@hcengineering/hr": "^0.6.10", - "@hcengineering/document": "^0.6.0", "@hcengineering/bitrix": "^0.6.41", "@hcengineering/request": "^0.6.4", "@hcengineering/support": "^0.6.0" diff --git a/pods/server/src/server.ts b/pods/server/src/server.ts index 11922946b9..20d43b1066 100644 --- a/pods/server/src/server.ts +++ b/pods/server/src/server.ts @@ -94,7 +94,6 @@ import { boardId } from '@hcengineering/board' import { calendarId } from '@hcengineering/calendar' import { chunterId } from '@hcengineering/chunter' import { contactId } from '@hcengineering/contact' -import { documentId } from '@hcengineering/document' import { gmailId } from '@hcengineering/gmail' import { hrId } from '@hcengineering/hr' import { inventoryId } from '@hcengineering/inventory' @@ -126,7 +125,6 @@ import boardEn from '@hcengineering/board-assets/lang/en.json' import calendarEn from '@hcengineering/calendar-assets/lang/en.json' import chunterEn from '@hcengineering/chunter-assets/lang/en.json' import contactEn from '@hcengineering/contact-assets/lang/en.json' -import documentEn from '@hcengineering/document-assets/lang/en.json' import gmailEn from '@hcengineering/gmail-assets/lang/en.json' import hrEn from '@hcengineering/hr-assets/lang/en.json' import inventoryEn from '@hcengineering/inventory-assets/lang/en.json' @@ -171,7 +169,6 @@ addStringsLoader(trackerId, async (lang: string) => trackerEn) addStringsLoader(boardId, async (lang: string) => boardEn) addStringsLoader(preferenceId, async (lang: string) => preferenceEn) addStringsLoader(hrId, async (lang: string) => hrEn) -addStringsLoader(documentId, async (lang: string) => documentEn) addStringsLoader(bitrixId, async (lang: string) => bitrixEn) addStringsLoader(requestId, async (lang: string) => requestEn) /** diff --git a/products/tracker/config.json b/products/tracker/config.json index 56f6fefd9d..9a68daead4 100644 --- a/products/tracker/config.json +++ b/products/tracker/config.json @@ -1,6 +1,5 @@ { "ACCOUNTS_URL":"http://localhost:3000", - "COLLABORATOR_URL": "ws://localhost:3078", "UPLOAD_URL":"/files", "REKONI_URL": "http://localhost:4004" } \ No newline at end of file diff --git a/products/tracker/public/config.json b/products/tracker/public/config.json index 1e971524a3..fe8def8763 100644 --- a/products/tracker/public/config.json +++ b/products/tracker/public/config.json @@ -1,6 +1,5 @@ { "ACCOUNTS_URL":"/account", - "COLLABORATOR_URL": "ws://localhost:3078", "UPLOAD_URL":"/files", "MODEL_VERSION": null } \ No newline at end of file diff --git a/rush.json b/rush.json index 51577d4f5b..98bd720265 100644 --- a/rush.json +++ b/rush.json @@ -801,11 +801,6 @@ "projectFolder": "pods/account", "shouldPublish": false }, - { - "packageName": "@hcengineering/pod-collaborator", - "projectFolder": "pods/collaborator", - "shouldPublish": false - }, { "packageName": "@hcengineering/panel", "projectFolder": "packages/panel", @@ -1388,27 +1383,6 @@ "projectFolder": "server-plugins/hr-resources", "shouldPublish": false }, - - { - "packageName": "@hcengineering/document", - "projectFolder": "plugins/document", - "shouldPublish": false - }, - { - "packageName": "@hcengineering/document-assets", - "projectFolder": "plugins/document-assets", - "shouldPublish": false - }, - { - "packageName": "@hcengineering/document-resources", - "projectFolder": "plugins/document-resources", - "shouldPublish": false - }, - { - "packageName": "@hcengineering/model-document", - "projectFolder": "models/document", - "shouldPublish": false - }, { "packageName": "@hcengineering/apm", "projectFolder": "tools/apm", diff --git a/server/front/run.sh b/server/front/run.sh index 6cd93ae249..85d240ab87 100755 --- a/server/front/run.sh +++ b/server/front/run.sh @@ -1,7 +1,6 @@ #!/bin/bash export ACCOUNTS_URL=http://localhost:3333 -export COLLABORATOR_URL=ws://localhost:3078 export UPLOAD_URL=http://localhost:3333/files export TRANSACTOR_URL=ws://localhost:3333 export ELASTIC_URL=http://elastic:9200 diff --git a/server/front/src/index.ts b/server/front/src/index.ts index 3f90343ade..f290b2f93d 100644 --- a/server/front/src/index.ts +++ b/server/front/src/index.ts @@ -136,7 +136,6 @@ export function start ( accountsUrl: string uploadUrl: string modelVersion: string - collaboratorUrl: string rekoniUrl: string telegramUrl: string gmailUrl: string @@ -177,7 +176,6 @@ export function start ( ACCOUNTS_URL: config.accountsUrl, UPLOAD_URL: config.uploadUrl, MODEL_VERSION: config.modelVersion, - COLLABORATOR_URL: config.collaboratorUrl, REKONI_URL: config.rekoniUrl, TELEGRAM_URL: config.telegramUrl, GMAIL_URL: config.gmailUrl, diff --git a/server/front/src/starter.ts b/server/front/src/starter.ts index 5c86bac2a9..1e8d41162c 100644 --- a/server/front/src/starter.ts +++ b/server/front/src/starter.ts @@ -74,12 +74,6 @@ export function startFront (extraConfig?: Record): void { process.exit(1) } - const collaboratorUrl = process.env.COLLABORATOR_URL - if (collaboratorUrl === undefined) { - console.error('please provide collaborator url') - process.exit(1) - } - const gmailUrl = process.env.GMAIL_URL if (gmailUrl === undefined) { console.error('please provide gmail url') @@ -127,7 +121,6 @@ export function startFront (extraConfig?: Record): void { accountsUrl, uploadUrl, modelVersion, - collaboratorUrl, gmailUrl, telegramUrl, rekoniUrl, diff --git a/tests/docker-compose.yaml b/tests/docker-compose.yaml index d7124c783b..fe0066d55a 100644 --- a/tests/docker-compose.yaml +++ b/tests/docker-compose.yaml @@ -50,18 +50,6 @@ services: - MINIO_ACCESS_KEY=minioadmin - MINIO_SECRET_KEY=minioadmin - MODEL_ENABLED=* - collaborator: - image: hardcoreeng/collaborator - links: - - transactor - ports: - - 3079:3079 - environment: - - COLLABORATOR_PORT=3079 - - SECRET=secret - - MINIO_ENDPOINT=minio - - MINIO_ACCESS_KEY=minioadmin - - MINIO_SECRET_KEY=minioadmin front: image: hardcoreeng/front pull_policy: never @@ -71,14 +59,12 @@ services: - minio - elastic - transactor - - collaborator ports: - 8083:8083 environment: - SERVER_PORT=8083 - SERVER_SECRET=secret - ACCOUNTS_URL=http://localhost:3003 - - COLLABORATOR_URL=ws://localhost:3079 - UPLOAD_URL=/files - TRANSACTOR_URL=ws://localhost:3334 - ELASTIC_URL=http://elastic:9200