mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 03:14:40 +03:00
UBERF-6469: Fix slow index creation (#5324)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
0baf9026d2
commit
7b1ea0d3e5
@ -1071,8 +1071,8 @@ dependencies:
|
||||
specifier: ~3.0.1
|
||||
version: 3.0.1
|
||||
fast-equals:
|
||||
specifier: ^2.0.3
|
||||
version: 2.0.4
|
||||
specifier: ^5.0.1
|
||||
version: 5.0.1
|
||||
file-loader:
|
||||
specifier: ^6.2.0
|
||||
version: 6.2.0(webpack@5.90.3)
|
||||
@ -1100,9 +1100,6 @@ dependencies:
|
||||
jest-environment-jsdom:
|
||||
specifier: 29.7.0
|
||||
version: 29.7.0(bufferutil@4.0.8)
|
||||
just-clone:
|
||||
specifier: ~6.2.0
|
||||
version: 6.2.0
|
||||
jwt-simple:
|
||||
specifier: ^0.5.6
|
||||
version: 0.5.6
|
||||
@ -9854,8 +9851,9 @@ packages:
|
||||
resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
|
||||
dev: false
|
||||
|
||||
/fast-equals@2.0.4:
|
||||
resolution: {integrity: sha512-caj/ZmjHljPrZtbzJ3kfH5ia/k4mTJe/qSiXAGzxZWRZgsgDV0cvNaQULqUX8t0/JVlzzEdYOwCN5DmzTxoD4w==}
|
||||
/fast-equals@5.0.1:
|
||||
resolution: {integrity: sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
dev: false
|
||||
|
||||
/fast-fifo@1.3.2:
|
||||
@ -17247,7 +17245,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/attachment.tgz(@types/node@20.11.19)(esbuild@0.20.1)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-D/lsCMnkacZsKVy5aT8Qkgm07HqAVUI38CnAOUaqXA0lcyq9kx+w3dkRw1/dOsVYOAU+AgeUCjUXvWJSElvCyw==, tarball: file:projects/attachment.tgz}
|
||||
resolution: {integrity: sha512-cx14AtAo4QYUy52N/58H4zFPj/HiIm1I0mtJkg5bgMS/61eqyRf5134oshbrJdYfekWeQdgYFfTDdrbpss41AA==, tarball: file:projects/attachment.tgz}
|
||||
id: file:projects/attachment.tgz
|
||||
name: '@rush-temp/attachment'
|
||||
version: 0.0.0
|
||||
@ -17362,7 +17360,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/bitrix-resources.tgz(@types/node@20.11.19)(esbuild@0.20.1)(postcss-load-config@4.0.2)(postcss@8.4.35)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-Ns1thSBWcRmOOWMUYhploH4DuM/4sz78SCMRXgpf9+6GUqGkECoV2TU0FlqLi0KQuEIwYNMAaPr28HvTXuQakw==, tarball: file:projects/bitrix-resources.tgz}
|
||||
resolution: {integrity: sha512-cUK3DRpGUYhwsppaNx1yFQEZP5agjMZ3SMQ1mwSSNPo1J3AsKgx7CXV+HmEYTEwmGqlyfSIZyTC49RC3StEdsw==, tarball: file:projects/bitrix-resources.tgz}
|
||||
id: file:projects/bitrix-resources.tgz
|
||||
name: '@rush-temp/bitrix-resources'
|
||||
version: 0.0.0
|
||||
@ -17377,7 +17375,7 @@ packages:
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
eslint-plugin-svelte: 2.35.1(eslint@8.56.0)(svelte@4.2.12)(ts-node@10.9.2)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
p-queue: 7.3.4
|
||||
prettier: 3.2.5
|
||||
@ -17411,7 +17409,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/bitrix.tgz(@types/node@20.11.19)(esbuild@0.20.1)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-k0W8OHvcf5GtME/iGr8dNdJTsJYDGFdRhwoC+Evxhhdn5SCNFQTGJKwmgk2CBTmxf9lgHUpB4lnbO8QswfHIog==, tarball: file:projects/bitrix.tgz}
|
||||
resolution: {integrity: sha512-3AJ9kYcBOg4BxKpuvcpoTVqqk2mez3ql0prE2jXrRplv1XyZingfM1jxm/OLWx0AfMvvpuPRPWwN0HQLxqrgLg==, tarball: file:projects/bitrix.tgz}
|
||||
id: file:projects/bitrix.tgz
|
||||
name: '@rush-temp/bitrix'
|
||||
version: 0.0.0
|
||||
@ -17425,7 +17423,7 @@ packages:
|
||||
eslint-plugin-import: 2.29.1(eslint@8.56.0)
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
prettier: 3.2.5
|
||||
prettier-plugin-svelte: 3.2.1(prettier@3.2.5)(svelte@4.2.11)
|
||||
@ -17583,7 +17581,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/calendar-resources.tgz(@types/node@20.11.19)(esbuild@0.20.1)(postcss-load-config@4.0.2)(postcss@8.4.35)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-TI3ishUw3HPbt2SeSX50em3La2vmIAvmGU5iqJbTJAn1wTt0b0Dc1Xl7c6WUgxG29vrOffK9EXez7EUGFjThOg==, tarball: file:projects/calendar-resources.tgz}
|
||||
resolution: {integrity: sha512-KEgUsxx5OPssVA4dCTFcT99uA9JCm7f35a1l5+8kiuTd1mVzabZ7JEdDVVFCWIArNQzafTEc9Wux4/OyzYAd1w==, tarball: file:projects/calendar-resources.tgz}
|
||||
id: file:projects/calendar-resources.tgz
|
||||
name: '@rush-temp/calendar-resources'
|
||||
version: 0.0.0
|
||||
@ -17599,7 +17597,7 @@ packages:
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
eslint-plugin-svelte: 2.35.1(eslint@8.56.0)(svelte@4.2.12)(ts-node@10.9.2)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
prettier: 3.2.5
|
||||
prettier-plugin-svelte: 3.2.2(prettier@3.2.5)(svelte@4.2.12)
|
||||
@ -17693,7 +17691,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/chunter-resources.tgz(@types/node@20.11.19)(esbuild@0.20.1)(postcss-load-config@4.0.2)(postcss@8.4.35)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-tJLr0k3LCPWYjdpkeqt178E0vkvs3mMMvnWAy4Dgxuc13eVJeYot+ZISnBHNbDZxjEqAlzs2bryhgFro4Kgpuw==, tarball: file:projects/chunter-resources.tgz}
|
||||
resolution: {integrity: sha512-TlZtHog4swrIxwXk4kWTriQcX1FZn2PkCmoaiELcdrsCLnDcs3V07L1WO0aB20H1uIxT1NrcgAwjMJSyXGG6uQ==, tarball: file:projects/chunter-resources.tgz}
|
||||
id: file:projects/chunter-resources.tgz
|
||||
name: '@rush-temp/chunter-resources'
|
||||
version: 0.0.0
|
||||
@ -17708,7 +17706,7 @@ packages:
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
eslint-plugin-svelte: 2.35.1(eslint@8.56.0)(svelte@4.2.12)(ts-node@10.9.2)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
html-to-text: 9.0.5
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
prettier: 3.2.5
|
||||
@ -17741,7 +17739,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/chunter.tgz(@types/node@20.11.19)(esbuild@0.20.1)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-z3T4NEBe0x8kwUPNSf7oPMk1PhiqjGWb6qQ5efmAylO7ekyrDgkgInaBxtvFm2EUgvEpN9iRCHFDOlk9rnw6KA==, tarball: file:projects/chunter.tgz}
|
||||
resolution: {integrity: sha512-n0vmTwy427dSbEyy+JEywzjIPIq9QYqiZs1dOr66UlM8DZm7jKVAFT9Wyqk/HLEgvXUqssPDt6shjb6oJzqRKQ==, tarball: file:projects/chunter.tgz}
|
||||
id: file:projects/chunter.tgz
|
||||
name: '@rush-temp/chunter'
|
||||
version: 0.0.0
|
||||
@ -17754,7 +17752,7 @@ packages:
|
||||
eslint-plugin-import: 2.29.1(eslint@8.56.0)
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
prettier: 3.2.5
|
||||
prettier-plugin-svelte: 3.2.1(prettier@3.2.5)(svelte@4.2.11)
|
||||
@ -18073,7 +18071,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/core.tgz(@types/node@20.11.19)(esbuild@0.20.1)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-+RrWsbByWA0nrA9AedoLd6bFnNroQZEyZhvVYy+taeyH1b75zftqBipa218osGxRVy9mGBcGDkXYrLqLLSNlKQ==, tarball: file:projects/core.tgz}
|
||||
resolution: {integrity: sha512-hfCFq02/du3ge1FsqKxAcxp042TYZzNT3e78bLz06dD+bZhfLBhUKUfk6a7GYklvyGpQak7ofWksYXjUXgD/iA==, tarball: file:projects/core.tgz}
|
||||
id: file:projects/core.tgz
|
||||
name: '@rush-temp/core'
|
||||
version: 0.0.0
|
||||
@ -18086,7 +18084,7 @@ packages:
|
||||
eslint-plugin-import: 2.29.1(eslint@8.56.0)
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
just-clone: 6.2.0
|
||||
prettier: 3.2.5
|
||||
@ -18341,7 +18339,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/document-resources.tgz(@tiptap/pm@2.2.4)(@types/node@20.11.19)(esbuild@0.20.1)(postcss-load-config@4.0.2)(postcss@8.4.35)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-Gfy7uUoAyEpQwqGaKZboe8Vzk3q2vAGRmEmM1hni5Q2JATD6rUYygA1mJfPgXMPwuBODnllmyYsnEizTkbYAIA==, tarball: file:projects/document-resources.tgz}
|
||||
resolution: {integrity: sha512-lq3P4ssvoWdkmr1IEG4g/B3ABSwm/IeLOEYZ4tKW9uYbh9J48Y0kwJzX5CStrFEt/OjsMnC53NMj0OmKe2NH+w==, tarball: file:projects/document-resources.tgz}
|
||||
id: file:projects/document-resources.tgz
|
||||
name: '@rush-temp/document-resources'
|
||||
version: 0.0.0
|
||||
@ -18356,7 +18354,7 @@ packages:
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
eslint-plugin-svelte: 2.35.1(eslint@8.56.0)(svelte@4.2.12)(ts-node@10.9.2)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
prettier: 3.2.5
|
||||
prettier-plugin-svelte: 3.2.2(prettier@3.2.5)(svelte@4.2.12)
|
||||
@ -18455,7 +18453,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/front.tgz(esbuild@0.20.1):
|
||||
resolution: {integrity: sha512-RgYDBRe/fE/U3MPc3kt+yY7Pk0+x6bvg0A7JEbcwzv2uLFLV9mJZQ9H0EGl0Dk4Z//KcUebmixAFGropfj4J6w==, tarball: file:projects/front.tgz}
|
||||
resolution: {integrity: sha512-FUaosylcN95zNQkY7mLbsjhs32+zf9TRRLP31Q3/4lrhln64fFc9gdUxGjFcEsUPO9tVIGHQaefgsbib4MO6AQ==, tarball: file:projects/front.tgz}
|
||||
id: file:projects/front.tgz
|
||||
name: '@rush-temp/front'
|
||||
version: 0.0.0
|
||||
@ -19092,7 +19090,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/lead-resources.tgz(@types/node@20.11.19)(esbuild@0.20.1)(postcss-load-config@4.0.2)(postcss@8.4.35)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-eKmYO9CWpUHwemQeaK4MSv1mnSiV51vCaZ+IahlmEVYx78fjBr3ACugWy1q6yqrpK+uo7EFAaYN/KrtsiLSPVQ==, tarball: file:projects/lead-resources.tgz}
|
||||
resolution: {integrity: sha512-UGK8wET5IeEzE1T3vEB9yAbRKc1A0xqYihHDE037/tuxY+uOixfEL9nYq80hGmVDd2JUkincH9b4yZiUrKoCQA==, tarball: file:projects/lead-resources.tgz}
|
||||
id: file:projects/lead-resources.tgz
|
||||
name: '@rush-temp/lead-resources'
|
||||
version: 0.0.0
|
||||
@ -19106,7 +19104,7 @@ packages:
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
eslint-plugin-svelte: 2.35.1(eslint@8.56.0)(svelte@4.2.12)(ts-node@10.9.2)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
prettier: 3.2.5
|
||||
prettier-plugin-svelte: 3.2.2(prettier@3.2.5)(svelte@4.2.12)
|
||||
@ -19279,7 +19277,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/middleware.tgz(@types/node@20.11.19)(esbuild@0.20.1)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-V3mzQ90Tfm9CYTISQF8lbAKFHBbjOSXTp0PwvWjaxFj2i0+x5w/yB/fEP9DzNOWs6auR8jXDOtLyEv1DdOrjSg==, tarball: file:projects/middleware.tgz}
|
||||
resolution: {integrity: sha512-TCRTOdjjnR5k1q3QSV18aGhCAjDDtZ79BpVt01TuDdL8tPNyDCkKbPg2vRlWGNd5LgOLUp0m+jcnlaF+eFKTUA==, tarball: file:projects/middleware.tgz}
|
||||
id: file:projects/middleware.tgz
|
||||
name: '@rush-temp/middleware'
|
||||
version: 0.0.0
|
||||
@ -19292,7 +19290,7 @@ packages:
|
||||
eslint-plugin-import: 2.29.1(eslint@8.56.0)
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
prettier: 3.2.5
|
||||
prettier-plugin-svelte: 3.2.1(prettier@3.2.5)(svelte@4.2.11)
|
||||
@ -19386,7 +19384,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/model-attachment.tgz:
|
||||
resolution: {integrity: sha512-3oaROiJx1Vu6bvfHuyglUy4WqCjHTs3ZAM0iHPYw+2Sko3bEBalhzDJ4aaAGYtqwynSzUaUGnsD5WucyMCx+dQ==, tarball: file:projects/model-attachment.tgz}
|
||||
resolution: {integrity: sha512-vTirthaEcbL64JZiZqyf5oOrvM0gDvlnXPeMWkjK0r9fP9Dd1+zkUi2niZUK/qUoirwn0tblnAvs54yYM1m2Yw==, tarball: file:projects/model-attachment.tgz}
|
||||
name: '@rush-temp/model-attachment'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
@ -20435,7 +20433,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/model.tgz(@types/node@20.11.19)(esbuild@0.20.1)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-HZjjPAnuNQFDwDEJRpD3soC0Xv0PZ5MO5fdPO25T/voPL7GzDMCuDRYh9Qd0QGBWIkylDT69g7coT3JQjwk1kw==, tarball: file:projects/model.tgz}
|
||||
resolution: {integrity: sha512-bbEi9kNp7XmfrqTRcByyZhZdhK7w1KVuNxukpFWrd2/0h2ti/9nBJq8VsLyRwg9vxPkMkbbHkCV2vVZ90+db1Q==, tarball: file:projects/model.tgz}
|
||||
id: file:projects/model.tgz
|
||||
name: '@rush-temp/model'
|
||||
version: 0.0.0
|
||||
@ -20449,7 +20447,7 @@ packages:
|
||||
eslint-plugin-import: 2.29.1(eslint@8.56.0)
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
prettier: 3.2.5
|
||||
prettier-plugin-svelte: 3.2.1(prettier@3.2.5)(svelte@4.2.11)
|
||||
@ -20617,7 +20615,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/openai.tgz(esbuild@0.20.1)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-jctOwrRZSmIDeMJVCE79FqUIWFHSAzVcw5wMCsv8IjlhgyD9zIwi9y3jq7L3Q1/2Lio/NwusHwvem93FI36MPw==, tarball: file:projects/openai.tgz}
|
||||
resolution: {integrity: sha512-USG5T83hwCnuqLE+j4uPqXuutlLYAAnY8AQSfI+xr8WknkfcjvScCAsQhW4sYL/VnRBp/UlGIQtkQCiFL3G91Q==, tarball: file:projects/openai.tgz}
|
||||
id: file:projects/openai.tgz
|
||||
name: '@rush-temp/openai'
|
||||
version: 0.0.0
|
||||
@ -20632,7 +20630,7 @@ packages:
|
||||
eslint-plugin-import: 2.29.1(eslint@8.56.0)
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
got: 11.8.6
|
||||
html-to-text: 9.0.5
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
@ -21021,7 +21019,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/presentation.tgz(@types/node@20.11.19)(esbuild@0.20.1)(postcss-load-config@4.0.2)(postcss@8.4.35)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-aumx71ZjObibTxi9/QhHh6cXBC7RUX9qpRgCgxI44z5Uhsf018PWFhjRqECrt7cxffsk77JPissDKpXOl4IBUw==, tarball: file:projects/presentation.tgz}
|
||||
resolution: {integrity: sha512-k8w+ycKPm5V73wCFHxNGgC/D8uMG3rUW9qTTzE2nnQSkQ1Ra7WYz3tY2e05dapAIJCXSdHfe2VKXyW7Kfp1Ifw==, tarball: file:projects/presentation.tgz}
|
||||
id: file:projects/presentation.tgz
|
||||
name: '@rush-temp/presentation'
|
||||
version: 0.0.0
|
||||
@ -21036,7 +21034,7 @@ packages:
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
eslint-plugin-svelte: 2.35.1(eslint@8.56.0)(svelte@4.2.12)(ts-node@10.9.2)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
png-chunks-extract: 1.0.0
|
||||
prettier: 3.2.5
|
||||
@ -21127,7 +21125,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/query.tgz(@types/node@20.11.19)(esbuild@0.20.1)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-mjK85PglsAwPINQ7XM03imZnSs3Arzd4B8s0lUtdFcMNpn416TqQvRIQhd18Y6kaWqD4RM/7GDPahGhvxou0sw==, tarball: file:projects/query.tgz}
|
||||
resolution: {integrity: sha512-EL/z5iBsZ04802G2QN9HCGerWMIUFHfRJ4WXbjPtBRs+GvsPP5btRmbs49o3OIIPlLCX1mSjik15jyYSIDclyg==, tarball: file:projects/query.tgz}
|
||||
id: file:projects/query.tgz
|
||||
name: '@rush-temp/query'
|
||||
version: 0.0.0
|
||||
@ -21140,7 +21138,7 @@ packages:
|
||||
eslint-plugin-import: 2.29.1(eslint@8.56.0)
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
prettier: 3.2.5
|
||||
prettier-plugin-svelte: 3.2.1(prettier@3.2.5)(svelte@4.2.11)
|
||||
@ -21875,7 +21873,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/server-core.tgz(esbuild@0.20.1)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-kLlgw/b8BhUayPhuPtnldGHyrrIQ6/G805PSxIm0n5pp32gjwcQvjPGcNGLysu+PPotheYvKYmqx8SiiKmONmw==, tarball: file:projects/server-core.tgz}
|
||||
resolution: {integrity: sha512-x/3Vq7e0UqK2mDn0agMJjw6nA5+ZmeIu4ZvR9iHioFLJgAkvJmyZ40bGLXk7P5lFzsP1qFmJ1GCG8zWOorvSzg==, tarball: file:projects/server-core.tgz}
|
||||
id: file:projects/server-core.tgz
|
||||
name: '@rush-temp/server-core'
|
||||
version: 0.0.0
|
||||
@ -21891,7 +21889,7 @@ packages:
|
||||
eslint-plugin-import: 2.29.1(eslint@8.56.0)
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
html-to-text: 9.0.5
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
prettier: 3.2.5
|
||||
@ -22875,7 +22873,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/server-tool.tgz(@types/node@20.11.19)(bufferutil@4.0.8)(esbuild@0.20.1)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-XDqxe9bRKTG9AjzLdgI8gXJ0o2z30IfYiyZ7RZZw2IVQALeTfdaRtCOtAfC1UBU5uiaLZzdE/U8VGq3qG0MO+g==, tarball: file:projects/server-tool.tgz}
|
||||
resolution: {integrity: sha512-La/JqbJn8mFb4MYQ5DKwjn5sxUJ0VYBI8UEcP2iC3KIcvjRrQ0Rcy6q5QBeVpYRpfnAcvUvFCuwR8i1TklseZw==, tarball: file:projects/server-tool.tgz}
|
||||
id: file:projects/server-tool.tgz
|
||||
name: '@rush-temp/server-tool'
|
||||
version: 0.0.0
|
||||
@ -22889,6 +22887,7 @@ packages:
|
||||
eslint-plugin-import: 2.29.1(eslint@8.56.0)
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
fast-equals: 5.0.1
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
mongodb: 6.3.0
|
||||
prettier: 3.2.5
|
||||
@ -23042,7 +23041,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/server-ws.tgz(esbuild@0.20.1)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-8KOhhL5VHcbLA97lQgIGid/+wL2Hq5f9PYhT8VXcMySwlQsfSJd9tLOXu1XzFBBtKmdKy9gSHRs+9ITuF+QmgA==, tarball: file:projects/server-ws.tgz}
|
||||
resolution: {integrity: sha512-U8RVqOkhC0aFRzjZzXrGwKzS+keJrlDuQOtap4w7XOXaHaZO+/dWWw2u3cTTRWdt3xKDFwDAAwiHaBkviaGGtg==, tarball: file:projects/server-ws.tgz}
|
||||
id: file:projects/server-ws.tgz
|
||||
name: '@rush-temp/server-ws'
|
||||
version: 0.0.0
|
||||
@ -23196,7 +23195,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/setting.tgz(@types/node@20.11.19)(esbuild@0.20.1)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-Oka8dksob3awcqqqrdQWbOz4W9setdSK3r388GyD/mCpJF+MIEh982zj7CEfVBoEw9TU4EkmjtTaDGGvzU8rew==, tarball: file:projects/setting.tgz}
|
||||
resolution: {integrity: sha512-jqdy2bj9Tt1XPVgZJZnWM0qngSJobWthQ6UOF6CpceocIU9KqV1cKjjEt3XR96++k+aMuPWOD78NdG2RI5Gxgg==, tarball: file:projects/setting.tgz}
|
||||
id: file:projects/setting.tgz
|
||||
name: '@rush-temp/setting'
|
||||
version: 0.0.0
|
||||
@ -23840,7 +23839,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/text-editor.tgz(@types/node@20.11.19)(bufferutil@4.0.8)(esbuild@0.20.1)(postcss-load-config@4.0.2)(postcss@8.4.35)(prosemirror-model@1.19.4)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-ZS4/UhxcE1r6KFI6C/p7Y132OFSVNSSdqOKK4YaJbAe36ULW/Ktp/1/L0oUlInsGPXfkiwpRoxrehXdFeSzHtg==, tarball: file:projects/text-editor.tgz}
|
||||
resolution: {integrity: sha512-JbV3dbxXXUQ8HmfqUkI/XcmvHmhOOAwJcwkFybbg8pNHPO8jTRKmYQB6HyXNMgoe4XFfxKDwWRFG/DS0QBaLzg==, tarball: file:projects/text-editor.tgz}
|
||||
id: file:projects/text-editor.tgz
|
||||
name: '@rush-temp/text-editor'
|
||||
version: 0.0.0
|
||||
@ -23883,7 +23882,7 @@ packages:
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
eslint-plugin-svelte: 2.35.1(eslint@8.56.0)(svelte@4.2.12)(ts-node@10.9.2)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
filesize: 8.0.7
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
lib0: 0.2.89
|
||||
@ -23931,7 +23930,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/text.tgz(@types/node@20.11.19)(bufferutil@4.0.8)(esbuild@0.20.1)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-GNJGI+dwyisnWsbLjkApxfLGV0VnEJk5nZIIDnGong7NF6tbj7+aLOHcQRjJAq+lawW7rr+HXlnvlNDJ7pkp5Q==, tarball: file:projects/text.tgz}
|
||||
resolution: {integrity: sha512-+71BisKHNmsLjMHsBChfyRUJXOP7P2gOAIHC1JP8z/AHvuGfWZirZRyYtRBY1E5PFu7qaI6G4SM2ARIvKBAaxw==, tarball: file:projects/text.tgz}
|
||||
id: file:projects/text.tgz
|
||||
name: '@rush-temp/text'
|
||||
version: 0.0.0
|
||||
@ -23964,7 +23963,7 @@ packages:
|
||||
eslint-plugin-import: 2.29.1(eslint@8.56.0)
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
jest-environment-jsdom: 29.7.0(bufferutil@4.0.8)
|
||||
prettier: 3.2.5
|
||||
@ -24068,7 +24067,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/time-resources.tgz(@types/node@20.11.19)(esbuild@0.20.1)(postcss-load-config@4.0.2)(postcss@8.4.35)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-C9v36hBLOWZUBJai1N2uGHpY0tOKxMZeqpGYbr5MBW/EwToFHxih4nxgGdHPFGdJ/vKGChp3zRwPaZhtjaWcMQ==, tarball: file:projects/time-resources.tgz}
|
||||
resolution: {integrity: sha512-jFJhdhEj33cRIOSEL2Fr2T32bWpKifEmwCTiSbBuNBG7mDhvFFD3LFVqIN1QCXfGlGU4DAjL6d5/DHXe6KXb7Q==, tarball: file:projects/time-resources.tgz}
|
||||
id: file:projects/time-resources.tgz
|
||||
name: '@rush-temp/time-resources'
|
||||
version: 0.0.0
|
||||
@ -24082,7 +24081,7 @@ packages:
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
eslint-plugin-svelte: 2.35.1(eslint@8.56.0)(svelte@4.2.12)(ts-node@10.9.2)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
prettier: 3.2.5
|
||||
prettier-plugin-svelte: 3.2.2(prettier@3.2.5)(svelte@4.2.12)
|
||||
@ -24145,7 +24144,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/tool.tgz(bufferutil@4.0.8):
|
||||
resolution: {integrity: sha512-Dw6hHluSSLjzbWy4xcV/56nu2+LCZhikHhBY8T4VIKT51hMVJ5WP5Qi0SFEZTyfCfOTfRWRd+F54hdhA3YUJtQ==, tarball: file:projects/tool.tgz}
|
||||
resolution: {integrity: sha512-46NgBZuhcTT7XEc+NxbKu9abwTd63lNVTDR8WrDt8aLuSxorolUYMJSiZcaagz85/eGcn21Q25yvzvhEt2N0Sw==, tarball: file:projects/tool.tgz}
|
||||
id: file:projects/tool.tgz
|
||||
name: '@rush-temp/tool'
|
||||
version: 0.0.0
|
||||
@ -24169,7 +24168,7 @@ packages:
|
||||
eslint-plugin-import: 2.29.1(eslint@8.56.0)
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
got: 11.8.6
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
libphonenumber-js: 1.10.56
|
||||
@ -24233,7 +24232,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/tracker-resources.tgz(@types/node@20.11.19)(esbuild@0.20.1)(postcss-load-config@4.0.2)(postcss@8.4.35)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-RfZZj5+SAWRRm9f3OY5pIn4ojwHfHAxxkcyxJcH+V2jV6zkyUKELNc3gyhSpqXUttwsqbMipRaAfsO1T2cf3wQ==, tarball: file:projects/tracker-resources.tgz}
|
||||
resolution: {integrity: sha512-7BBFEYPBl6fH5eqy+QwRcUetnmw64hiQbP6uMGruSDJR5AS4EzDpa8YB9xHLWFwyp0SnCLCZXunLkaYNtaTcug==, tarball: file:projects/tracker-resources.tgz}
|
||||
id: file:projects/tracker-resources.tgz
|
||||
name: '@rush-temp/tracker-resources'
|
||||
version: 0.0.0
|
||||
@ -24247,7 +24246,7 @@ packages:
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
eslint-plugin-svelte: 2.35.1(eslint@8.56.0)(svelte@4.2.12)(ts-node@10.9.2)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
prettier: 3.2.5
|
||||
prettier-plugin-svelte: 3.2.2(prettier@3.2.5)(svelte@4.2.12)
|
||||
@ -24343,7 +24342,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/ui.tgz(@types/node@20.11.19)(esbuild@0.20.1)(postcss-load-config@4.0.2)(postcss@8.4.35)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-ltSyM60qvCyNW+47uWt5mqN4I9uWVGkado9etVgBZW8zampgBNVtFe86XRO86JxL43N4SNTGXg4//FvTGNrqrw==, tarball: file:projects/ui.tgz}
|
||||
resolution: {integrity: sha512-GJx3NNFCi0LxO874CYl32IFBnFnX0YIQQ02PY5akpHXjjayRV2GLNFTHMlZF0FBGo9QissArVITnPsMYlqSeOw==, tarball: file:projects/ui.tgz}
|
||||
id: file:projects/ui.tgz
|
||||
name: '@rush-temp/ui'
|
||||
version: 0.0.0
|
||||
@ -24361,7 +24360,7 @@ packages:
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
eslint-plugin-svelte: 2.35.1(eslint@8.56.0)(svelte@4.2.12)(ts-node@10.9.2)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
just-clone: 6.2.0
|
||||
prettier: 3.2.5
|
||||
@ -24425,7 +24424,7 @@ packages:
|
||||
dev: false
|
||||
|
||||
file:projects/view-resources.tgz(@types/node@20.11.19)(esbuild@0.20.1)(postcss-load-config@4.0.2)(postcss@8.4.35)(ts-node@10.9.2):
|
||||
resolution: {integrity: sha512-My4rMrLqRvuEvyeud09gfeY/ils1zFNhnsaZo5R4x9Smgf3BxQcisgc8vNychKmIPw1aOQOidARG16UpZW7z9A==, tarball: file:projects/view-resources.tgz}
|
||||
resolution: {integrity: sha512-lLrDKJ7LC57uC3cDvJWyCANN7xPWPrYrJgFzhHVC8Py/lRueG0oGBSvud44ezxw0Y1frKQceECacfmNCJdMF5g==, tarball: file:projects/view-resources.tgz}
|
||||
id: file:projects/view-resources.tgz
|
||||
name: '@rush-temp/view-resources'
|
||||
version: 0.0.0
|
||||
@ -24439,7 +24438,7 @@ packages:
|
||||
eslint-plugin-n: 15.7.0(eslint@8.56.0)
|
||||
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
|
||||
eslint-plugin-svelte: 2.35.1(eslint@8.56.0)(svelte@4.2.12)(ts-node@10.9.2)
|
||||
fast-equals: 2.0.4
|
||||
fast-equals: 5.0.1
|
||||
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2)
|
||||
prettier: 3.2.5
|
||||
prettier-plugin-svelte: 3.2.2(prettier@3.2.5)(svelte@4.2.12)
|
||||
|
@ -14,7 +14,7 @@
|
||||
//
|
||||
|
||||
import clientPlugin from '@hcengineering/client'
|
||||
import { AccountClient, createClient } from '@hcengineering/core'
|
||||
import core, { AccountClient, createClient, groupByArray, MigrationState } from '@hcengineering/core'
|
||||
import { migrateOperations } from '@hcengineering/model-all'
|
||||
import { getMetadata, getResource } from '@hcengineering/platform'
|
||||
import { connect } from './connection'
|
||||
@ -27,9 +27,18 @@ export default async () => {
|
||||
GetClient: async (): Promise<AccountClient> => {
|
||||
if (client === undefined) {
|
||||
client = await createClient(connect)
|
||||
|
||||
const states = await client.findAll<MigrationState>(core.class.MigrationState, {})
|
||||
const migrateState = new Map(
|
||||
Array.from(groupByArray(states, (it) => it.plugin).entries()).map((it) => [
|
||||
it[0],
|
||||
new Set(it[1].map((q) => q.state))
|
||||
])
|
||||
)
|
||||
;(client as any).migrateState = migrateState
|
||||
for (const op of migrateOperations) {
|
||||
console.log('Migrate', op[0])
|
||||
await op[1].upgrade(client, {
|
||||
await op[1].upgrade(client as any, {
|
||||
log (msg, data) {
|
||||
console.log(msg, data)
|
||||
},
|
||||
|
@ -131,7 +131,7 @@
|
||||
"commander": "^8.1.0",
|
||||
"csv-parse": "~5.1.0",
|
||||
"email-addresses": "^5.0.0",
|
||||
"fast-equals": "^2.0.3",
|
||||
"fast-equals": "^5.0.1",
|
||||
"got": "^11.8.3",
|
||||
"libphonenumber-js": "^1.9.46",
|
||||
"mime-types": "~2.1.34",
|
||||
|
@ -138,6 +138,7 @@ export function devTool (
|
||||
const _client = await client.getClient()
|
||||
await f(_client.db(ACCOUNT_DB), _client)
|
||||
client.close()
|
||||
console.log(`closing database connection to '${uri}'...`)
|
||||
}
|
||||
|
||||
program.version('0.0.1')
|
||||
@ -363,13 +364,12 @@ export function devTool (
|
||||
|
||||
const avgTime = (Date.now() - st) / (workspaces.length - toProcess + 1)
|
||||
console.log(
|
||||
'---UPGRADING----',
|
||||
ws.workspace,
|
||||
ws.workspaceUrl,
|
||||
'----------------------------------------------------------\n---UPGRADING----',
|
||||
'pending: ',
|
||||
toProcess,
|
||||
'ETA:',
|
||||
Math.floor(avgTime * toProcess * 100) / 100
|
||||
'ETA: ',
|
||||
Math.floor(avgTime * toProcess),
|
||||
ws.workspace
|
||||
)
|
||||
toProcess--
|
||||
try {
|
||||
@ -384,11 +384,11 @@ export function devTool (
|
||||
logger,
|
||||
cmd.force
|
||||
)
|
||||
console.log('---UPGRADING-DONE----', ws.workspace, Date.now() - t)
|
||||
console.log('---done---------', 'pending: ', toProcess, 'TIME:', Date.now() - t, ws.workspace)
|
||||
} catch (err: any) {
|
||||
withError.push(ws.workspace)
|
||||
logger.log('error', JSON.stringify(err))
|
||||
console.log('---UPGRADING-FAILED----', ws.workspace, Date.now() - t)
|
||||
console.log(' FAILED-------', 'pending: ', toProcess, 'TIME:', Date.now() - t, ws.workspace)
|
||||
} finally {
|
||||
if (!cmd.console) {
|
||||
;(logger as FileModelLogger).close()
|
||||
@ -409,7 +409,7 @@ export function devTool (
|
||||
console.log('Upgrade done')
|
||||
// console.log((process as any)._getActiveHandles())
|
||||
// console.log((process as any)._getActiveRequests())
|
||||
process.exit()
|
||||
// process.exit()
|
||||
} else {
|
||||
console.log('UPGRADE write logs at:', cmd.logs)
|
||||
for (const ws of workspaces) {
|
||||
|
@ -117,7 +117,7 @@ export class TActivityMessage extends TAttachedDoc implements ActivityMessage {
|
||||
repliedPersons?: Ref<Person>[]
|
||||
|
||||
@Prop(TypeTimestamp(), activity.string.LastReply)
|
||||
@Index(IndexKind.Indexed)
|
||||
// @Index(IndexKind.Indexed)
|
||||
lastReply?: Timestamp
|
||||
|
||||
@Prop(Collection(activity.class.Reaction), activity.string.Reactions)
|
||||
@ -134,15 +134,15 @@ export class TDocUpdateMessage extends TActivityMessage implements DocUpdateMess
|
||||
objectId!: Ref<Doc>
|
||||
|
||||
@Prop(TypeRef(core.class.Class), core.string.Class)
|
||||
@Index(IndexKind.Indexed)
|
||||
// @Index(IndexKind.Indexed)
|
||||
objectClass!: Ref<Class<Doc>>
|
||||
|
||||
@Prop(TypeRef(core.class.TxCUD), core.string.Object)
|
||||
@Index(IndexKind.Indexed)
|
||||
// @Index(IndexKind.Indexed)
|
||||
txId!: Ref<TxCUD<Doc>>
|
||||
|
||||
@Prop(TypeString(), core.string.Object)
|
||||
@Index(IndexKind.Indexed)
|
||||
// @Index(IndexKind.Indexed)
|
||||
action!: DocUpdateAction
|
||||
|
||||
updateCollection?: string
|
||||
@ -153,11 +153,11 @@ export class TDocUpdateMessage extends TActivityMessage implements DocUpdateMess
|
||||
export class TActivityReference extends TActivityMessage implements ActivityReference {
|
||||
// Source document we have reference from, it should be parent document for Comment/Message.
|
||||
@Prop(TypeRef(core.class.Doc), core.string.Object)
|
||||
@Index(IndexKind.Indexed)
|
||||
// @Index(IndexKind.Indexed)
|
||||
srcDocId!: Ref<Doc>
|
||||
|
||||
@Prop(TypeRef(core.class.Class), core.string.Class)
|
||||
@Index(IndexKind.Indexed)
|
||||
// @Index(IndexKind.Indexed)
|
||||
srcDocClass!: Ref<Class<Doc>>
|
||||
|
||||
// Reference to comment/message in source doc
|
||||
@ -386,6 +386,22 @@ export function createModel (builder: Builder): void {
|
||||
},
|
||||
activity.ids.AddReactionNotification
|
||||
)
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_ACTIVITY,
|
||||
indexes: [
|
||||
{ attachedTo: 1, createdOn: 1 },
|
||||
{ attachedTo: 1, createdOn: -1 }
|
||||
],
|
||||
disabled: [
|
||||
{ modifiedOn: 1 },
|
||||
{ createdOn: -1 },
|
||||
{ space: 1 },
|
||||
{ modifiedBy: 1 },
|
||||
{ createdBy: 1 },
|
||||
{ attachedToClass: 1 }
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
export default activity
|
||||
|
@ -272,6 +272,17 @@ export function createModel (builder: Builder): void {
|
||||
group: 'edit'
|
||||
}
|
||||
})
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_ATTACHMENT,
|
||||
disabled: [
|
||||
{ attachedToClass: 1 },
|
||||
{ modifiedOn: 1 },
|
||||
{ modifiedBy: 1 },
|
||||
{ createdBy: 1 },
|
||||
{ createdOn: -1 },
|
||||
{ state: 1 }
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
export default attachment
|
||||
|
@ -133,4 +133,8 @@ export function createModel (builder: Builder): void {
|
||||
},
|
||||
bitrix.action.BitrixImport
|
||||
)
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_BITRIX,
|
||||
disabled: [{ _id: 1 }, { _class: 1 }, { space: 1 }, { modifiedBy: 1 }, { createdBy: 1 }, { createdOn: -1 }]
|
||||
})
|
||||
}
|
||||
|
@ -14,8 +14,14 @@
|
||||
//
|
||||
|
||||
import core, { TxOperations } from '@hcengineering/core'
|
||||
import { type MigrateOperation, type MigrationClient, type MigrationUpgradeClient } from '@hcengineering/model'
|
||||
import {
|
||||
tryUpgrade,
|
||||
type MigrateOperation,
|
||||
type MigrationClient,
|
||||
type MigrationUpgradeClient
|
||||
} from '@hcengineering/model'
|
||||
import bitrix from './plugin'
|
||||
import { bitrixId } from '@hcengineering/bitrix'
|
||||
|
||||
async function createSpace (tx: TxOperations): Promise<void> {
|
||||
const current = await tx.findOne(core.class.Space, {
|
||||
@ -40,7 +46,14 @@ async function createSpace (tx: TxOperations): Promise<void> {
|
||||
export const bitrixOperation: MigrateOperation = {
|
||||
async migrate (client: MigrationClient): Promise<void> {},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createSpace(tx)
|
||||
await tryUpgrade(client, bitrixId, [
|
||||
{
|
||||
state: 'create-defaults',
|
||||
func: async (client) => {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createSpace(tx)
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,8 @@ import {
|
||||
type MigrationClient,
|
||||
type MigrationUpgradeClient,
|
||||
createOrUpdate,
|
||||
tryMigrate
|
||||
tryMigrate,
|
||||
tryUpgrade
|
||||
} from '@hcengineering/model'
|
||||
import core, { DOMAIN_SPACE } from '@hcengineering/model-core'
|
||||
import { DOMAIN_TASK, createProjectType, createSequence, fixTaskTypes } from '@hcengineering/model-task'
|
||||
@ -184,7 +185,14 @@ export const boardOperation: MigrateOperation = {
|
||||
])
|
||||
},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const ops = new TxOperations(client, core.account.System)
|
||||
await createDefaults(ops)
|
||||
await tryUpgrade(client, boardId, [
|
||||
{
|
||||
state: 'board0001',
|
||||
func: async (client) => {
|
||||
const ops = new TxOperations(client, core.account.System)
|
||||
await createDefaults(ops)
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -313,6 +313,18 @@ export function createModel (builder: Builder): void {
|
||||
builder.mixin(calendar.class.Event, core.class.Class, view.mixin.ObjectPresenter, {
|
||||
presenter: calendar.component.EventPresenter
|
||||
})
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_CALENDAR,
|
||||
disabled: [
|
||||
{ attachedToClass: 1 },
|
||||
{ modifiedOn: 1 },
|
||||
{ modifiedBy: 1 },
|
||||
{ createdBy: 1 },
|
||||
{ createdOn: -1 },
|
||||
{ state: 1 }
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
export default calendar
|
||||
|
@ -18,6 +18,7 @@ import contact from '@hcengineering/contact'
|
||||
import core, { TxOperations, type Ref } from '@hcengineering/core'
|
||||
import {
|
||||
tryMigrate,
|
||||
tryUpgrade,
|
||||
type MigrateOperation,
|
||||
type MigrationClient,
|
||||
type MigrationUpgradeClient
|
||||
@ -139,12 +140,17 @@ async function migrateTimezone (client: MigrationClient): Promise<void> {
|
||||
|
||||
export const calendarOperation: MigrateOperation = {
|
||||
async migrate (client: MigrationClient): Promise<void> {
|
||||
await fixEventDueDate(client)
|
||||
await migrateReminders(client)
|
||||
await fillOriginalStartTime(client)
|
||||
await migrateSync(client)
|
||||
await migrateExternalCalendars(client)
|
||||
await tryMigrate(client, calendarId, [
|
||||
{
|
||||
state: 'calendar001',
|
||||
func: async (client) => {
|
||||
await fixEventDueDate(client)
|
||||
await migrateReminders(client)
|
||||
await fillOriginalStartTime(client)
|
||||
await migrateSync(client)
|
||||
await migrateExternalCalendars(client)
|
||||
}
|
||||
},
|
||||
{
|
||||
state: 'timezone',
|
||||
func: migrateTimezone
|
||||
@ -152,7 +158,14 @@ export const calendarOperation: MigrateOperation = {
|
||||
])
|
||||
},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await migrateCalendars(tx)
|
||||
await tryUpgrade(client, calendarId, [
|
||||
{
|
||||
state: 'u-calendar0002',
|
||||
func: async (client) => {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await migrateCalendars(tx)
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -744,6 +744,11 @@ export function createModel (builder: Builder, options = { addApplication: true
|
||||
builder.mixin(chunter.class.ThreadMessage, core.class.Class, activity.mixin.ActivityMessagePreview, {
|
||||
presenter: chunter.component.ThreadMessagePreview
|
||||
})
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_CHUNTER,
|
||||
disabled: [{ _class: 1 }, { space: 1 }, { modifiedBy: 1 }, { createdBy: 1 }, { createdOn: -1 }]
|
||||
})
|
||||
}
|
||||
|
||||
export default chunter
|
||||
|
@ -19,14 +19,15 @@ import {
|
||||
type MigrateOperation,
|
||||
type MigrationClient,
|
||||
type MigrationUpgradeClient,
|
||||
tryMigrate
|
||||
tryMigrate,
|
||||
tryUpgrade
|
||||
} from '@hcengineering/model'
|
||||
import activity, { DOMAIN_ACTIVITY } from '@hcengineering/model-activity'
|
||||
import notification from '@hcengineering/notification'
|
||||
|
||||
import chunter from './plugin'
|
||||
|
||||
const DOMAIN_COMMENT = 'comment' as Domain
|
||||
export const DOMAIN_COMMENT = 'comment' as Domain
|
||||
|
||||
export async function createDocNotifyContexts (
|
||||
client: MigrationUpgradeClient,
|
||||
@ -128,9 +129,7 @@ export const chunterOperation: MigrateOperation = {
|
||||
{
|
||||
state: 'create-chat-messages',
|
||||
func: convertCommentsToChatMessages
|
||||
}
|
||||
])
|
||||
await tryMigrate(client, chunterId, [
|
||||
},
|
||||
{
|
||||
state: 'remove-backlinks',
|
||||
func: removeBacklinks
|
||||
@ -138,8 +137,15 @@ export const chunterOperation: MigrateOperation = {
|
||||
])
|
||||
},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createGeneral(client, tx)
|
||||
await createRandom(client, tx)
|
||||
await tryUpgrade(client, chunterId, [
|
||||
{
|
||||
state: 'create-defaults',
|
||||
func: async (client) => {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createGeneral(client, tx)
|
||||
await createRandom(client, tx)
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -1133,4 +1133,22 @@ export function createModel (builder: Builder): void {
|
||||
)
|
||||
|
||||
createPublicLinkAction(builder, contact.class.Contact, contact.action.PublicLink)
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_CHANNEL,
|
||||
disabled: [
|
||||
{ attachedToClass: 1 },
|
||||
{ provider: 1 },
|
||||
{ space: 1 },
|
||||
{ modifiedBy: 1 },
|
||||
{ modifiedOn: 1 },
|
||||
{ createdBy: 1 },
|
||||
{ createdBy: -1 },
|
||||
{ createdOn: -1 }
|
||||
]
|
||||
})
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_CONTACT,
|
||||
disabled: [{ attachedToClass: 1 }, { modifiedBy: 1 }, { createdBy: 1 }, { createdOn: -1 }, { attachedTo: 1 }]
|
||||
})
|
||||
}
|
||||
|
@ -6,7 +6,8 @@ import {
|
||||
type MigrationClient,
|
||||
type MigrationUpgradeClient,
|
||||
type ModelLogger,
|
||||
tryMigrate
|
||||
tryMigrate,
|
||||
tryUpgrade
|
||||
} from '@hcengineering/model'
|
||||
import core from '@hcengineering/model-core'
|
||||
import { DOMAIN_VIEW } from '@hcengineering/model-view'
|
||||
@ -53,10 +54,11 @@ async function createSpace (tx: TxOperations): Promise<void> {
|
||||
|
||||
async function createEmployeeEmail (client: TxOperations): Promise<void> {
|
||||
const employees = await client.findAll(contact.mixin.Employee, {})
|
||||
const channels = await client.findAll(contact.class.Channel, {
|
||||
provider: contact.channelProvider.Email,
|
||||
attachedTo: { $in: employees.map((p) => p._id) }
|
||||
})
|
||||
const channels = (
|
||||
await client.findAll(contact.class.Channel, {
|
||||
attachedTo: { $in: employees.map((p) => p._id) }
|
||||
})
|
||||
).filter((it) => it.provider === contact.channelProvider.Email)
|
||||
const channelsMap = new Map(channels.map((p) => [p.attachedTo, p]))
|
||||
for (const employee of employees) {
|
||||
const acc = await client.findOne(contact.class.PersonAccount, { person: employee._id })
|
||||
@ -207,8 +209,21 @@ export const contactOperation: MigrateOperation = {
|
||||
])
|
||||
},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createSpace(tx)
|
||||
await createEmployeeEmail(tx)
|
||||
await tryUpgrade(client, contactId, [
|
||||
{
|
||||
state: 'createSpace',
|
||||
func: async (client) => {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createSpace(tx)
|
||||
}
|
||||
},
|
||||
{
|
||||
state: 'createEmails',
|
||||
func: async (client) => {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createEmployeeEmail(tx)
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,8 @@ import {
|
||||
type Timestamp,
|
||||
type Type,
|
||||
type TypeAny,
|
||||
type Version
|
||||
type Version,
|
||||
type DomainIndexConfiguration
|
||||
} from '@hcengineering/core'
|
||||
import {
|
||||
Hidden,
|
||||
@ -387,6 +388,11 @@ export class TIndexConfiguration<T extends Doc = Doc> extends TClass implements
|
||||
searchDisabled!: boolean
|
||||
}
|
||||
|
||||
@Model(core.class.DomainIndexConfiguration, core.class.Doc, DOMAIN_MODEL)
|
||||
export class TDomainIndexConfiguration extends TDoc implements DomainIndexConfiguration {
|
||||
domain!: Domain
|
||||
}
|
||||
|
||||
@UX(core.string.CollaborativeDoc)
|
||||
@Model(core.class.TypeCollaborativeDoc, core.class.Type)
|
||||
export class TTypeCollaborativeDoc extends TType {}
|
||||
|
@ -15,6 +15,14 @@
|
||||
|
||||
import {
|
||||
AccountRole,
|
||||
DOMAIN_BLOB,
|
||||
DOMAIN_BLOB_DATA,
|
||||
DOMAIN_CONFIGURATION,
|
||||
DOMAIN_DOC_INDEX_STATE,
|
||||
DOMAIN_MIGRATION,
|
||||
DOMAIN_STATUS,
|
||||
DOMAIN_TRANSIENT,
|
||||
DOMAIN_TX,
|
||||
systemAccountEmail,
|
||||
type AttachedDoc,
|
||||
type Class,
|
||||
@ -37,6 +45,7 @@ import {
|
||||
TConfigurationElement,
|
||||
TDoc,
|
||||
TDocIndexState,
|
||||
TDomainIndexConfiguration,
|
||||
TEnum,
|
||||
TEnumOf,
|
||||
TFullTextSearchContext,
|
||||
@ -68,7 +77,17 @@ import {
|
||||
TTypeTimestamp,
|
||||
TVersion
|
||||
} from './core'
|
||||
import { TAccount, TSpace, TSpaceType, TSpaceTypeDescriptor, TTypedSpace, TRole, TPermission } from './security'
|
||||
import { definePermissions } from './permissions'
|
||||
import {
|
||||
DOMAIN_SPACE,
|
||||
TAccount,
|
||||
TPermission,
|
||||
TRole,
|
||||
TSpace,
|
||||
TSpaceType,
|
||||
TSpaceTypeDescriptor,
|
||||
TTypedSpace
|
||||
} from './security'
|
||||
import { TStatus, TStatusCategory } from './status'
|
||||
import { TUserStatus } from './transient'
|
||||
import {
|
||||
@ -82,7 +101,6 @@ import {
|
||||
TTxUpdateDoc,
|
||||
TTxWorkspaceEvent
|
||||
} from './tx'
|
||||
import { definePermissions } from './permissions'
|
||||
|
||||
export { coreId } from '@hcengineering/core'
|
||||
export * from './core'
|
||||
@ -153,7 +171,8 @@ export function createModel (builder: Builder): void {
|
||||
TStatus,
|
||||
TStatusCategory,
|
||||
TMigrationState,
|
||||
TBlob
|
||||
TBlob,
|
||||
TDomainIndexConfiguration
|
||||
)
|
||||
|
||||
builder.createDoc(
|
||||
@ -173,25 +192,100 @@ export function createModel (builder: Builder): void {
|
||||
{
|
||||
indexes: [
|
||||
'tx.objectId',
|
||||
'tx._class',
|
||||
'tx.objectClass',
|
||||
'tx.operations.attachedTo',
|
||||
'space',
|
||||
'objectSpace',
|
||||
{
|
||||
_class: 1,
|
||||
objectSpace: 1,
|
||||
_id: 1,
|
||||
modifiedOn: 1
|
||||
},
|
||||
{
|
||||
_class: 1,
|
||||
_id: 1,
|
||||
modifiedOn: 1
|
||||
objectSpace: 1,
|
||||
modifiedBy: 1,
|
||||
objectClass: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_TX,
|
||||
disabled: [{ space: 1 }, { objectClass: 1 }, { createdBy: 1 }, { createdBy: -1 }, { createdOn: -1 }]
|
||||
})
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_TRANSIENT,
|
||||
disableCollection: true,
|
||||
disabled: [
|
||||
{ _id: 1 },
|
||||
{ space: 1 },
|
||||
{ objectClass: 1 },
|
||||
{ modifiedBy: 1 },
|
||||
{ createdBy: 1 },
|
||||
{ createdBy: -1 },
|
||||
{ createdOn: -1 }
|
||||
]
|
||||
})
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_CONFIGURATION,
|
||||
disabled: [
|
||||
{ _class: 1 },
|
||||
{ space: 1 },
|
||||
{ modifiedOn: 1 },
|
||||
{ modifiedBy: 1 },
|
||||
{ createdBy: 1 },
|
||||
{ createdBy: -1 },
|
||||
{ createdOn: -1 }
|
||||
]
|
||||
})
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_MIGRATION,
|
||||
disabled: [
|
||||
{ _class: 1 },
|
||||
{ space: 1 },
|
||||
{ modifiedOn: 1 },
|
||||
{ modifiedBy: 1 },
|
||||
{ createdBy: 1 },
|
||||
{ createdBy: -1 },
|
||||
{ createdOn: -1 }
|
||||
]
|
||||
})
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_STATUS,
|
||||
disabled: [{ modifiedOn: 1 }, { modifiedBy: 1 }, { createdBy: 1 }, { createdBy: -1 }, { createdOn: -1 }]
|
||||
})
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_SPACE,
|
||||
disabled: [{ space: 1 }, { modifiedBy: 1 }, { createdBy: 1 }, { createdBy: -1 }, { createdOn: -1 }]
|
||||
})
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_BLOB,
|
||||
disabled: [{ _class: 1 }, { space: 1 }, { modifiedBy: 1 }, { createdBy: 1 }, { createdBy: -1 }, { createdOn: -1 }]
|
||||
})
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_BLOB_DATA,
|
||||
disableCollection: true,
|
||||
disabled: [{ _class: 1 }, { space: 1 }, { modifiedBy: 1 }, { createdBy: 1 }, { createdBy: -1 }, { createdOn: -1 }]
|
||||
})
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_DOC_INDEX_STATE,
|
||||
disabled: [
|
||||
{ attachedToClass: 1 },
|
||||
{ stages: 1 },
|
||||
{ generationId: 1 },
|
||||
{ space: 1 },
|
||||
{ _class: 1 },
|
||||
{ modifiedBy: 1 },
|
||||
{ createdBy: 1 },
|
||||
{ createdBy: -1 },
|
||||
{ createdOn: -1 }
|
||||
],
|
||||
skip: ['stages.']
|
||||
})
|
||||
|
||||
builder.mixin<Class<DocIndexState>, IndexingConfiguration<TxCollectionCUD<Doc, AttachedDoc>>>(
|
||||
core.class.DocIndexState,
|
||||
|
@ -13,30 +13,46 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import core, { TxOperations } from '@hcengineering/core'
|
||||
import { type MigrateOperation, type MigrationClient, type MigrationUpgradeClient } from '@hcengineering/model'
|
||||
import core, { coreId, DOMAIN_DOC_INDEX_STATE, TxOperations } from '@hcengineering/core'
|
||||
import {
|
||||
tryUpgrade,
|
||||
type MigrateOperation,
|
||||
type MigrationClient,
|
||||
type MigrationUpgradeClient
|
||||
} from '@hcengineering/model'
|
||||
|
||||
export const coreOperation: MigrateOperation = {
|
||||
async migrate (client: MigrationClient): Promise<void> {},
|
||||
async migrate (client: MigrationClient): Promise<void> {
|
||||
// We need to delete all documents in doc index state for missing classes
|
||||
const allDocs = client.hierarchy.getDescendants(core.class.Doc)
|
||||
await client.deleteMany(DOMAIN_DOC_INDEX_STATE, { objectClass: { $nin: allDocs } })
|
||||
},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await tryUpgrade(client, coreId, [
|
||||
{
|
||||
state: 'create-defaults',
|
||||
func: async (client) => {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
|
||||
const spaceSpace = await tx.findOne(core.class.Space, {
|
||||
_id: core.space.Space
|
||||
})
|
||||
if (spaceSpace === undefined) {
|
||||
await tx.createDoc(
|
||||
core.class.Space,
|
||||
core.space.Space,
|
||||
{
|
||||
name: 'Space for all spaces',
|
||||
description: 'Spaces',
|
||||
private: false,
|
||||
archived: false,
|
||||
members: []
|
||||
},
|
||||
core.space.Space
|
||||
)
|
||||
}
|
||||
const spaceSpace = await tx.findOne(core.class.Space, {
|
||||
_id: core.space.Space
|
||||
})
|
||||
if (spaceSpace === undefined) {
|
||||
await tx.createDoc(
|
||||
core.class.Space,
|
||||
core.space.Space,
|
||||
{
|
||||
name: 'Space for all spaces',
|
||||
description: 'Spaces',
|
||||
private: false,
|
||||
archived: false,
|
||||
members: []
|
||||
},
|
||||
core.space.Space
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -444,4 +444,16 @@ export function createModel (builder: Builder): void {
|
||||
defineDocument(builder)
|
||||
|
||||
defineApplication(builder)
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_DOCUMENT,
|
||||
disabled: [
|
||||
{ modifiedOn: 1 },
|
||||
{ modifiedBy: 1 },
|
||||
{ createdBy: 1 },
|
||||
{ attachedToClass: 1 },
|
||||
{ createdOn: -1 },
|
||||
{ attachedTo: 1 }
|
||||
]
|
||||
})
|
||||
}
|
||||
|
@ -20,7 +20,8 @@ import {
|
||||
type MigrateOperation,
|
||||
type MigrationClient,
|
||||
type MigrationUpgradeClient,
|
||||
tryMigrate
|
||||
tryMigrate,
|
||||
tryUpgrade
|
||||
} from '@hcengineering/model'
|
||||
import { DOMAIN_ATTACHMENT } from '@hcengineering/model-attachment'
|
||||
import core, { DOMAIN_SPACE } from '@hcengineering/model-core'
|
||||
@ -276,8 +277,13 @@ async function migrateTeamspaces (client: MigrationClient): Promise<void> {
|
||||
|
||||
export const documentOperation: MigrateOperation = {
|
||||
async migrate (client: MigrationClient): Promise<void> {
|
||||
await setNoParent(client)
|
||||
await tryMigrate(client, documentId, [
|
||||
{
|
||||
state: 'migrate-no-parent',
|
||||
func: async (client) => {
|
||||
await setNoParent(client)
|
||||
}
|
||||
},
|
||||
{
|
||||
state: 'collaborativeContent',
|
||||
func: migrateCollaborativeContent
|
||||
@ -297,14 +303,26 @@ export const documentOperation: MigrateOperation = {
|
||||
{
|
||||
state: 'updateDocumentIcons',
|
||||
func: migrateDocumentIcons
|
||||
},
|
||||
{
|
||||
state: 'migrate-timespaces',
|
||||
func: async (client) => {
|
||||
await migrateTeamspaces(client)
|
||||
}
|
||||
}
|
||||
])
|
||||
await migrateTeamspaces(client)
|
||||
},
|
||||
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createSpace(tx)
|
||||
await createDefaultTeamspaceType(tx)
|
||||
await tryUpgrade(client, documentId, [
|
||||
{
|
||||
state: 'u-default-project',
|
||||
func: async (client) => {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createSpace(tx)
|
||||
await createDefaultTeamspaceType(tx)
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -294,4 +294,17 @@ export function createModel (builder: Builder): void {
|
||||
builder.mixin(gmail.class.Message, core.class.Class, core.mixin.FullTextSearchContext, {
|
||||
parentPropagate: false
|
||||
})
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_GMAIL,
|
||||
disabled: [
|
||||
{ _class: 1 },
|
||||
{ createdOn: -1 },
|
||||
{ space: 1 },
|
||||
{ modifiedBy: 1 },
|
||||
{ createdBy: 1 },
|
||||
{ attachedToClass: 1 },
|
||||
{ createdOn: -1 }
|
||||
]
|
||||
})
|
||||
}
|
||||
|
@ -14,29 +14,42 @@
|
||||
//
|
||||
|
||||
import core, { TxOperations } from '@hcengineering/core'
|
||||
import { type MigrateOperation, type MigrationClient, type MigrationUpgradeClient } from '@hcengineering/model'
|
||||
import {
|
||||
tryUpgrade,
|
||||
type MigrateOperation,
|
||||
type MigrationClient,
|
||||
type MigrationUpgradeClient
|
||||
} from '@hcengineering/model'
|
||||
import gmail from './plugin'
|
||||
import { gmailId } from '@hcengineering/gmail'
|
||||
|
||||
export const gmailOperation: MigrateOperation = {
|
||||
async migrate (client: MigrationClient): Promise<void> {},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
const current = await tx.findOne(core.class.Space, {
|
||||
_id: gmail.space.Gmail
|
||||
})
|
||||
if (current === undefined) {
|
||||
await tx.createDoc(
|
||||
core.class.Space,
|
||||
core.space.Space,
|
||||
{
|
||||
name: 'Gmail',
|
||||
description: 'Space for all gmail messages',
|
||||
private: false,
|
||||
archived: false,
|
||||
members: []
|
||||
},
|
||||
gmail.space.Gmail
|
||||
)
|
||||
}
|
||||
await tryUpgrade(client, gmailId, [
|
||||
{
|
||||
state: 'create-defaults',
|
||||
func: async (client) => {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
const current = await tx.findOne(core.class.Space, {
|
||||
_id: gmail.space.Gmail
|
||||
})
|
||||
if (current === undefined) {
|
||||
await tx.createDoc(
|
||||
core.class.Space,
|
||||
core.space.Space,
|
||||
{
|
||||
name: 'Gmail',
|
||||
description: 'Space for all gmail messages',
|
||||
private: false,
|
||||
archived: false,
|
||||
members: []
|
||||
},
|
||||
gmail.space.Gmail
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,17 @@ export function createModel (builder: Builder): void {
|
||||
},
|
||||
guest.account.Guest
|
||||
)
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: GUEST_DOMAIN,
|
||||
disabled: [
|
||||
{ createdOn: -1 },
|
||||
{ space: 1 },
|
||||
{ modifiedBy: 1 },
|
||||
{ createdBy: 1 },
|
||||
{ attachedToClass: 1 },
|
||||
{ createdOn: -1 }
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
export { guestId } from '@hcengineering/guest'
|
||||
|
@ -12,7 +12,8 @@ import {
|
||||
type MigrationClient,
|
||||
type MigrationUpgradeClient,
|
||||
type ModelLogger,
|
||||
tryMigrate
|
||||
tryMigrate,
|
||||
tryUpgrade
|
||||
} from '@hcengineering/model'
|
||||
import core from '@hcengineering/model-core'
|
||||
import guest from './plugin'
|
||||
@ -92,6 +93,13 @@ export const guestOperation: MigrateOperation = {
|
||||
])
|
||||
},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
await createDefaults(client)
|
||||
await tryUpgrade(client, guestId, [
|
||||
{
|
||||
state: 'create-defaults',
|
||||
func: async (client) => {
|
||||
await createDefaults(client)
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -562,4 +562,8 @@ export function createModel (builder: Builder): void {
|
||||
},
|
||||
hr.ids.CreatePublicHolidayNotification
|
||||
)
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_HR,
|
||||
disabled: [{ modifiedOn: 1 }, { modifiedBy: 1 }, { createdBy: 1 }, { attachedToClass: 1 }, { createdOn: -1 }]
|
||||
})
|
||||
}
|
||||
|
@ -14,9 +14,14 @@
|
||||
//
|
||||
|
||||
import { TxOperations } from '@hcengineering/core'
|
||||
import { type MigrateOperation, type MigrationClient, type MigrationUpgradeClient } from '@hcengineering/model'
|
||||
import {
|
||||
tryUpgrade,
|
||||
type MigrateOperation,
|
||||
type MigrationClient,
|
||||
type MigrationUpgradeClient
|
||||
} from '@hcengineering/model'
|
||||
import core from '@hcengineering/model-core'
|
||||
import hr from './index'
|
||||
import hr, { hrId } from './index'
|
||||
|
||||
async function createSpace (tx: TxOperations): Promise<void> {
|
||||
const current = await tx.findOne(core.class.Space, {
|
||||
@ -43,7 +48,14 @@ async function createSpace (tx: TxOperations): Promise<void> {
|
||||
export const hrOperation: MigrateOperation = {
|
||||
async migrate (client: MigrationClient): Promise<void> {},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createSpace(tx)
|
||||
await tryUpgrade(client, hrId, [
|
||||
{
|
||||
state: 'create-defaults',
|
||||
func: async (client) => {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createSpace(tx)
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -229,4 +229,16 @@ export function createModel (builder: Builder): void {
|
||||
builder.mixin(inventory.class.Product, core.class.Class, view.mixin.ClassFilters, {
|
||||
filters: ['attachedTo']
|
||||
})
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_INVENTORY,
|
||||
disabled: [
|
||||
{ modifiedOn: 1 },
|
||||
{ modifiedBy: 1 },
|
||||
{ createdBy: 1 },
|
||||
{ attachedToClass: 1 },
|
||||
{ createdOn: -1 },
|
||||
{ attachedTo: 1 }
|
||||
]
|
||||
})
|
||||
}
|
||||
|
@ -14,8 +14,14 @@
|
||||
//
|
||||
|
||||
import core, { TxOperations } from '@hcengineering/core'
|
||||
import { type MigrateOperation, type MigrationClient, type MigrationUpgradeClient } from '@hcengineering/model'
|
||||
import {
|
||||
tryUpgrade,
|
||||
type MigrateOperation,
|
||||
type MigrationClient,
|
||||
type MigrationUpgradeClient
|
||||
} from '@hcengineering/model'
|
||||
import inventory from './plugin'
|
||||
import { inventoryId } from '@hcengineering/inventory'
|
||||
|
||||
async function createSpace (tx: TxOperations): Promise<void> {
|
||||
const categories = await tx.findOne(core.class.Space, {
|
||||
@ -57,7 +63,14 @@ async function createSpace (tx: TxOperations): Promise<void> {
|
||||
export const inventoryOperation: MigrateOperation = {
|
||||
async migrate (client: MigrationClient): Promise<void> {},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createSpace(tx)
|
||||
await tryUpgrade(client, inventoryId, [
|
||||
{
|
||||
state: 'create-defaults',
|
||||
func: async (client) => {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createSpace(tx)
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@
|
||||
//
|
||||
|
||||
// To help typescript locate view plugin properly
|
||||
import activity from '@hcengineering/activity'
|
||||
import type { Employee } from '@hcengineering/contact'
|
||||
import { type FindOptions, IndexKind, type Ref, SortingOrder, type Status, type Timestamp } from '@hcengineering/core'
|
||||
import { type Customer, type Funnel, type Lead, leadId } from '@hcengineering/lead'
|
||||
@ -44,7 +45,6 @@ import workbench from '@hcengineering/model-workbench'
|
||||
import notification from '@hcengineering/notification'
|
||||
import setting from '@hcengineering/setting'
|
||||
import { type ViewOptionsModel } from '@hcengineering/view'
|
||||
import activity from '@hcengineering/activity'
|
||||
|
||||
import lead from './plugin'
|
||||
|
||||
|
@ -179,9 +179,14 @@ export const leadOperation: MigrateOperation = {
|
||||
])
|
||||
},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const ops = new TxOperations(client, core.account.System)
|
||||
await createDefaults(ops)
|
||||
|
||||
await tryUpgrade(client, leadId, [])
|
||||
await tryUpgrade(client, leadId, [
|
||||
{
|
||||
state: 'u-default-funnel',
|
||||
func: async (client) => {
|
||||
const ops = new TxOperations(client, core.account.System)
|
||||
await createDefaults(ops)
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ export class TDocUpdates extends TDoc implements DocUpdates {
|
||||
attachedTo!: Ref<Doc>
|
||||
|
||||
@Prop(TypeRef(core.class.Account), getEmbeddedLabel('Hidden'))
|
||||
@Index(IndexKind.Indexed)
|
||||
// @Index(IndexKind.Indexed)
|
||||
hidden!: boolean
|
||||
|
||||
attachedToClass!: Ref<Class<Doc>>
|
||||
@ -231,7 +231,7 @@ export class TInboxNotification extends TDoc implements InboxNotification {
|
||||
user!: Ref<Account>
|
||||
|
||||
@Prop(TypeBoolean(), core.string.Boolean)
|
||||
@Index(IndexKind.Indexed)
|
||||
// @Index(IndexKind.Indexed)
|
||||
isViewed!: boolean
|
||||
|
||||
title?: IntlString
|
||||
@ -657,6 +657,10 @@ export function createModel (builder: Builder): void {
|
||||
},
|
||||
presenter: notification.component.ReactionNotificationPresenter
|
||||
})
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_NOTIFICATION,
|
||||
disabled: [{ modifiedOn: 1 }, { modifiedBy: 1 }, { createdBy: 1 }, { isViewed: 1 }, { hidden: 1 }]
|
||||
})
|
||||
}
|
||||
|
||||
export function generateClassNotificationTypes (
|
||||
|
@ -28,6 +28,7 @@ import core, {
|
||||
} from '@hcengineering/core'
|
||||
import {
|
||||
tryMigrate,
|
||||
tryUpgrade,
|
||||
type MigrateOperation,
|
||||
type MigrationClient,
|
||||
type MigrationUpgradeClient
|
||||
@ -286,6 +287,13 @@ export const notificationOperation: MigrateOperation = {
|
||||
])
|
||||
},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
await createSpace(client)
|
||||
await tryUpgrade(client, notificationId, [
|
||||
{
|
||||
state: 'create-defaults',
|
||||
func: async (client) => {
|
||||
await createSpace(client)
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -36,4 +36,9 @@ export class TSpacePreference extends TPreference implements SpacePreference {
|
||||
|
||||
export function createModel (builder: Builder): void {
|
||||
builder.createModel(TPreference, TSpacePreference)
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_PREFERENCE,
|
||||
disabled: [{ modifiedOn: 1 }, { createdOn: 1 }]
|
||||
})
|
||||
}
|
||||
|
@ -14,9 +14,14 @@
|
||||
//
|
||||
|
||||
import { TxOperations } from '@hcengineering/core'
|
||||
import { type MigrateOperation, type MigrationClient, type MigrationUpgradeClient } from '@hcengineering/model'
|
||||
import {
|
||||
tryUpgrade,
|
||||
type MigrateOperation,
|
||||
type MigrationClient,
|
||||
type MigrationUpgradeClient
|
||||
} from '@hcengineering/model'
|
||||
import core from '@hcengineering/model-core'
|
||||
import preference from '@hcengineering/preference'
|
||||
import preference, { preferenceId } from '@hcengineering/preference'
|
||||
|
||||
async function createSpace (tx: TxOperations): Promise<void> {
|
||||
const current = await tx.findOne(core.class.Space, {
|
||||
@ -45,7 +50,14 @@ async function createDefaults (tx: TxOperations): Promise<void> {
|
||||
export const preferenceOperation: MigrateOperation = {
|
||||
async migrate (client: MigrationClient): Promise<void> {},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const ops = new TxOperations(client, core.account.System)
|
||||
await createDefaults(ops)
|
||||
await tryUpgrade(client, preferenceId, [
|
||||
{
|
||||
state: 'create-defaults',
|
||||
func: async (client) => {
|
||||
const ops = new TxOperations(client, core.account.System)
|
||||
await createDefaults(ops)
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -75,10 +75,14 @@ export const recruitOperation: MigrateOperation = {
|
||||
])
|
||||
},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createDefaults(tx)
|
||||
|
||||
await tryUpgrade(client, recruitId, [
|
||||
{
|
||||
state: 'create-default-project',
|
||||
func: async (client) => {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createDefaults(tx)
|
||||
}
|
||||
},
|
||||
{
|
||||
state: 'remove-members',
|
||||
func: async (client): Promise<void> => {
|
||||
|
@ -16,12 +16,11 @@
|
||||
import activity from '@hcengineering/activity'
|
||||
import type { PersonAccount } from '@hcengineering/contact'
|
||||
import contact from '@hcengineering/contact'
|
||||
import { type Domain, IndexKind, type Ref, type Tx } from '@hcengineering/core'
|
||||
import { type Domain, type Ref, type Tx } from '@hcengineering/core'
|
||||
import {
|
||||
ArrOf,
|
||||
type Builder,
|
||||
Collection,
|
||||
Index,
|
||||
Mixin,
|
||||
Model,
|
||||
Prop,
|
||||
@ -53,7 +52,7 @@ export const DOMAIN_REQUEST = 'request' as Domain
|
||||
@UX(request.string.Request, request.icon.Requests)
|
||||
export class TRequest extends TAttachedDoc implements Request {
|
||||
@Prop(ArrOf(TypeRef(contact.class.PersonAccount)), request.string.Requested)
|
||||
@Index(IndexKind.Indexed)
|
||||
// @Index(IndexKind.Indexed)
|
||||
requested!: Ref<PersonAccount>[]
|
||||
|
||||
@Prop(ArrOf(TypeRef(contact.class.PersonAccount)), request.string.Approved)
|
||||
@ -63,7 +62,7 @@ export class TRequest extends TAttachedDoc implements Request {
|
||||
requiredApprovesCount!: number
|
||||
|
||||
@Prop(TypeString(), request.string.Status)
|
||||
@Index(IndexKind.Indexed)
|
||||
// @Index(IndexKind.Indexed)
|
||||
status!: RequestStatus
|
||||
|
||||
tx!: Tx
|
||||
@ -162,4 +161,19 @@ export function createModel (builder: Builder): void {
|
||||
},
|
||||
request.ids.TxRequestCreate
|
||||
)
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_REQUEST,
|
||||
disabled: [
|
||||
{ _class: 1 },
|
||||
{ space: 1 },
|
||||
{ modifiedBy: 1 },
|
||||
{ modifiedOn: 1 },
|
||||
{ createdBy: 1 },
|
||||
{ createdOn: 1 },
|
||||
{ attachedTo: 1 },
|
||||
{ attachedToClass: 1 },
|
||||
{ status: 1 },
|
||||
{ requested: 1 }
|
||||
]
|
||||
})
|
||||
}
|
||||
|
@ -234,8 +234,6 @@ async function createDocUpdateMessages (client: MigrationClient): Promise<void>
|
||||
}
|
||||
|
||||
for (const activityClass of activityDocClasses) {
|
||||
console.log('processing', activityClass)
|
||||
|
||||
if (client.hierarchy.isMixin(activityClass)) {
|
||||
// Skip mixins
|
||||
continue
|
||||
|
@ -628,4 +628,9 @@ export function createModel (builder: Builder): void {
|
||||
builder.mixin(core.class.Permission, core.class.Class, view.mixin.ObjectPresenter, {
|
||||
presenter: setting.component.PermissionPresenter
|
||||
})
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_SETTING,
|
||||
disabled: [{ modifiedOn: 1 }, { modifiedBy: 1 }, { createdOn: 1 }, { space: 1 }]
|
||||
})
|
||||
}
|
||||
|
@ -14,8 +14,14 @@
|
||||
//
|
||||
|
||||
import core, { TxOperations } from '@hcengineering/core'
|
||||
import { type MigrateOperation, type MigrationClient, type MigrationUpgradeClient } from '@hcengineering/model'
|
||||
import {
|
||||
tryUpgrade,
|
||||
type MigrateOperation,
|
||||
type MigrationClient,
|
||||
type MigrationUpgradeClient
|
||||
} from '@hcengineering/model'
|
||||
import setting from './plugin'
|
||||
import { settingId } from '@hcengineering/setting'
|
||||
|
||||
async function createSpace (tx: TxOperations): Promise<void> {
|
||||
const current = await tx.findOne(core.class.Space, {
|
||||
@ -40,7 +46,14 @@ async function createSpace (tx: TxOperations): Promise<void> {
|
||||
export const settingOperation: MigrateOperation = {
|
||||
async migrate (client: MigrationClient): Promise<void> {},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createSpace(tx)
|
||||
await tryUpgrade(client, settingId, [
|
||||
{
|
||||
state: 'create-defaults',
|
||||
func: async (client) => {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createSpace(tx)
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -145,4 +145,16 @@ export function createModel (builder: Builder): void {
|
||||
},
|
||||
tags.filter.FilterTagsNin
|
||||
)
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_TAGS,
|
||||
disabled: [
|
||||
{ modifiedOn: 1 },
|
||||
{ modifiedBy: 1 },
|
||||
{ createdBy: 1 },
|
||||
{ createdOn: 1 },
|
||||
{ space: 1 },
|
||||
{ attachedToClass: 1 },
|
||||
{ createdOn: -1 }
|
||||
]
|
||||
})
|
||||
}
|
||||
|
@ -1,29 +1,42 @@
|
||||
import core, { TxOperations } from '@hcengineering/core'
|
||||
import { type MigrateOperation, type MigrationClient, type MigrationUpgradeClient } from '@hcengineering/model'
|
||||
import {
|
||||
tryUpgrade,
|
||||
type MigrateOperation,
|
||||
type MigrationClient,
|
||||
type MigrationUpgradeClient
|
||||
} from '@hcengineering/model'
|
||||
import tags from './plugin'
|
||||
import { tagsId } from '@hcengineering/tags'
|
||||
|
||||
export const tagsOperation: MigrateOperation = {
|
||||
async migrate (client: MigrationClient): Promise<void> {},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
const current = await tx.findOne(core.class.Space, {
|
||||
_id: tags.space.Tags
|
||||
})
|
||||
if (current === undefined) {
|
||||
await tx.createDoc(
|
||||
core.class.Space,
|
||||
core.space.Space,
|
||||
{
|
||||
name: 'Tags',
|
||||
description: 'Space for all tags',
|
||||
private: false,
|
||||
archived: false,
|
||||
members: []
|
||||
},
|
||||
tags.space.Tags
|
||||
)
|
||||
} else if (current.private) {
|
||||
await tx.update(current, { private: false })
|
||||
}
|
||||
await tryUpgrade(client, tagsId, [
|
||||
{
|
||||
state: 'create-defaults',
|
||||
func: async (client) => {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
const current = await tx.findOne(core.class.Space, {
|
||||
_id: tags.space.Tags
|
||||
})
|
||||
if (current === undefined) {
|
||||
await tx.createDoc(
|
||||
core.class.Space,
|
||||
core.space.Space,
|
||||
{
|
||||
name: 'Tags',
|
||||
description: 'Space for all tags',
|
||||
private: false,
|
||||
archived: false,
|
||||
members: []
|
||||
},
|
||||
tags.space.Tags
|
||||
)
|
||||
} else if (current.private) {
|
||||
await tx.update(current, { private: false })
|
||||
}
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -592,6 +592,30 @@ export function createModel (builder: Builder): void {
|
||||
})
|
||||
|
||||
createPublicLinkAction(builder, task.class.Task, task.action.PublicLink)
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_TASK,
|
||||
disabled: [
|
||||
{ modifiedBy: 1 },
|
||||
{ attachedToClass: 1 },
|
||||
{ component: 1 },
|
||||
{ milestone: 1 },
|
||||
{ relations: 1 },
|
||||
{ priority: 1 }
|
||||
]
|
||||
})
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_KANBAN,
|
||||
disabled: [
|
||||
{ space: 1 },
|
||||
{ modifiedOn: 1 },
|
||||
{ modifiedBy: 1 },
|
||||
{ createdBy: 1 },
|
||||
{ createdOn: -1 },
|
||||
{ _class: 1 },
|
||||
{ attachedToClass: 1 }
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -15,14 +15,14 @@
|
||||
|
||||
import {
|
||||
ClassifierKind,
|
||||
DOMAIN_TX,
|
||||
TxOperations,
|
||||
generateId,
|
||||
toIdMap,
|
||||
type Class,
|
||||
type Doc,
|
||||
type Ref,
|
||||
type TxCreateDoc,
|
||||
generateId,
|
||||
DOMAIN_TX
|
||||
type TxCreateDoc
|
||||
} from '@hcengineering/core'
|
||||
import {
|
||||
createOrUpdate,
|
||||
@ -35,7 +35,7 @@ import {
|
||||
import core, { DOMAIN_SPACE } from '@hcengineering/model-core'
|
||||
import tags from '@hcengineering/model-tags'
|
||||
import { getEmbeddedLabel } from '@hcengineering/platform'
|
||||
import { type ProjectType, taskId, type TaskType } from '@hcengineering/task'
|
||||
import { taskId, type ProjectType, type TaskType } from '@hcengineering/task'
|
||||
import { DOMAIN_TASK } from '.'
|
||||
import task from './plugin'
|
||||
|
||||
@ -282,30 +282,39 @@ export const taskOperation: MigrateOperation = {
|
||||
await client.update(DOMAIN_TASK, { _id: taskType._id }, { $set: { space: taskType.parent } })
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
state: 'task001',
|
||||
func: async (client) => {
|
||||
await migrateTaskTypes(client)
|
||||
await migrateProjectTypes(client)
|
||||
}
|
||||
}
|
||||
])
|
||||
await migrateTaskTypes(client)
|
||||
await migrateProjectTypes(client)
|
||||
},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createDefaults(tx)
|
||||
|
||||
await createOrUpdate(
|
||||
tx,
|
||||
tags.class.TagCategory,
|
||||
tags.space.Tags,
|
||||
{
|
||||
icon: tags.icon.Tags,
|
||||
label: 'Text Label',
|
||||
targetClass: task.class.Task,
|
||||
tags: [],
|
||||
default: true
|
||||
},
|
||||
task.category.TaskTag
|
||||
)
|
||||
|
||||
await tryUpgrade(client, taskId, [
|
||||
{
|
||||
state: 'u-task-001',
|
||||
func: async (client) => {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createDefaults(tx)
|
||||
|
||||
await createOrUpdate(
|
||||
tx,
|
||||
tags.class.TagCategory,
|
||||
tags.space.Tags,
|
||||
{
|
||||
icon: tags.icon.Tags,
|
||||
label: 'Text Label',
|
||||
targetClass: task.class.Task,
|
||||
tags: [],
|
||||
default: true
|
||||
},
|
||||
task.category.TaskTag
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
state: 'reorderStates',
|
||||
func: reorderStates
|
||||
|
@ -257,4 +257,17 @@ export function createModel (builder: Builder): void {
|
||||
parentPropagate: false,
|
||||
childProcessingAllowed: true
|
||||
})
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_TELEGRAM,
|
||||
disabled: [
|
||||
{ _class: 1 },
|
||||
{ space: 1 },
|
||||
{ modifiedBy: 1 },
|
||||
{ attachedToClass: 1 },
|
||||
{ createdBy: 1 },
|
||||
{ createdOn: 1 },
|
||||
{ createdOn: -1 }
|
||||
]
|
||||
})
|
||||
}
|
||||
|
@ -14,29 +14,42 @@
|
||||
//
|
||||
|
||||
import core, { TxOperations } from '@hcengineering/core'
|
||||
import { type MigrateOperation, type MigrationClient, type MigrationUpgradeClient } from '@hcengineering/model'
|
||||
import {
|
||||
tryUpgrade,
|
||||
type MigrateOperation,
|
||||
type MigrationClient,
|
||||
type MigrationUpgradeClient
|
||||
} from '@hcengineering/model'
|
||||
import telegram from './plugin'
|
||||
import { telegramId } from '@hcengineering/telegram'
|
||||
|
||||
export const telegramOperation: MigrateOperation = {
|
||||
async migrate (client: MigrationClient): Promise<void> {},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
const current = await tx.findOne(core.class.Space, {
|
||||
_id: telegram.space.Telegram
|
||||
})
|
||||
if (current === undefined) {
|
||||
await tx.createDoc(
|
||||
core.class.Space,
|
||||
core.space.Space,
|
||||
{
|
||||
name: 'Telegram',
|
||||
description: 'Space for all telegram messages',
|
||||
private: false,
|
||||
archived: false,
|
||||
members: []
|
||||
},
|
||||
telegram.space.Telegram
|
||||
)
|
||||
}
|
||||
await tryUpgrade(client, telegramId, [
|
||||
{
|
||||
state: 'create-defaults',
|
||||
func: async (client) => {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
const current = await tx.findOne(core.class.Space, {
|
||||
_id: telegram.space.Telegram
|
||||
})
|
||||
if (current === undefined) {
|
||||
await tx.createDoc(
|
||||
core.class.Space,
|
||||
core.space.Space,
|
||||
{
|
||||
name: 'Telegram',
|
||||
description: 'Space for all telegram messages',
|
||||
private: false,
|
||||
archived: false,
|
||||
members: []
|
||||
},
|
||||
telegram.space.Telegram
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -168,4 +168,9 @@ export function createModel (builder: Builder): void {
|
||||
builder.mixin(templates.class.MessageTemplate, core.class.Class, view.mixin.IgnoreActions, {
|
||||
actions: [view.action.Open, tracker.action.NewRelatedIssue]
|
||||
})
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_TEMPLATES,
|
||||
disabled: [{ _class: 1 }, { space: 1 }, { modifiedBy: 1 }, { modifiedOn: 1 }, { createdBy: 1 }, { createdOn: -1 }]
|
||||
})
|
||||
}
|
||||
|
@ -14,31 +14,44 @@
|
||||
//
|
||||
|
||||
import core, { TxOperations } from '@hcengineering/core'
|
||||
import { type MigrateOperation, type MigrationClient, type MigrationUpgradeClient } from '@hcengineering/model'
|
||||
import {
|
||||
tryUpgrade,
|
||||
type MigrateOperation,
|
||||
type MigrationClient,
|
||||
type MigrationUpgradeClient
|
||||
} from '@hcengineering/model'
|
||||
import templates from './plugin'
|
||||
import { templatesId } from '@hcengineering/templates'
|
||||
|
||||
export const templatesOperation: MigrateOperation = {
|
||||
async migrate (client: MigrationClient): Promise<void> {},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
const current = await tx.findOne(core.class.Space, {
|
||||
_id: templates.space.Templates
|
||||
})
|
||||
if (current === undefined) {
|
||||
await tx.createDoc(
|
||||
templates.class.TemplateCategory,
|
||||
core.space.Space,
|
||||
{
|
||||
name: 'Public templates',
|
||||
description: 'Space for public templates',
|
||||
private: false,
|
||||
archived: false,
|
||||
members: []
|
||||
},
|
||||
templates.space.Templates
|
||||
)
|
||||
} else if (current.private) {
|
||||
await tx.update(current, { private: false })
|
||||
}
|
||||
await tryUpgrade(client, templatesId, [
|
||||
{
|
||||
state: 'create-defaults',
|
||||
func: async (client) => {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
const current = await tx.findOne(core.class.Space, {
|
||||
_id: templates.space.Templates
|
||||
})
|
||||
if (current === undefined) {
|
||||
await tx.createDoc(
|
||||
templates.class.TemplateCategory,
|
||||
core.space.Space,
|
||||
{
|
||||
name: 'Public templates',
|
||||
description: 'Space for public templates',
|
||||
private: false,
|
||||
archived: false,
|
||||
members: []
|
||||
},
|
||||
templates.space.Templates
|
||||
)
|
||||
} else if (current.private) {
|
||||
await tx.update(current, { private: false })
|
||||
}
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -387,6 +387,18 @@ export function createModel (builder: Builder): void {
|
||||
builder.mixin(time.class.ProjectToDo, core.class.Class, view.mixin.ObjectPanel, {
|
||||
component: view.component.AttachedDocPanel
|
||||
})
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_TIME,
|
||||
disabled: [
|
||||
{ modifiedOn: 1 },
|
||||
{ modifiedBy: 1 },
|
||||
{ createdBy: 1 },
|
||||
{ attachedToClass: 1 },
|
||||
{ createdOn: -1 },
|
||||
{ modifiedOn: 1 }
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
export * from './migration'
|
||||
|
@ -19,13 +19,15 @@ import {
|
||||
type MigrateOperation,
|
||||
type MigrationClient,
|
||||
type MigrationUpgradeClient,
|
||||
createOrUpdate
|
||||
createOrUpdate,
|
||||
tryMigrate,
|
||||
tryUpgrade
|
||||
} from '@hcengineering/model'
|
||||
import { makeRank } from '@hcengineering/rank'
|
||||
import core from '@hcengineering/model-core'
|
||||
import task from '@hcengineering/task'
|
||||
import tags from '@hcengineering/tags'
|
||||
import { type ToDo, ToDoPriority } from '@hcengineering/time'
|
||||
import { timeId, type ToDo, ToDoPriority } from '@hcengineering/time'
|
||||
import { DOMAIN_TIME } from '.'
|
||||
import time from './plugin'
|
||||
|
||||
@ -183,26 +185,40 @@ async function fillProps (client: MigrationClient): Promise<void> {
|
||||
|
||||
export const timeOperation: MigrateOperation = {
|
||||
async migrate (client: MigrationClient): Promise<void> {
|
||||
await fillProps(client)
|
||||
await tryMigrate(client, timeId, [
|
||||
{
|
||||
state: 'm-time-001',
|
||||
func: async (client) => {
|
||||
await fillProps(client)
|
||||
}
|
||||
}
|
||||
])
|
||||
},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createDefaultSpace(tx)
|
||||
await createOrUpdate(
|
||||
tx,
|
||||
tags.class.TagCategory,
|
||||
tags.space.Tags,
|
||||
await tryUpgrade(client, timeId, [
|
||||
{
|
||||
icon: tags.icon.Tags,
|
||||
label: 'Other',
|
||||
targetClass: time.class.ToDo,
|
||||
tags: [],
|
||||
default: true
|
||||
},
|
||||
time.category.Other
|
||||
)
|
||||
await migrateWorkSlots(tx)
|
||||
await migrateTodosSpace(tx)
|
||||
await migrateTodosRanks(tx)
|
||||
state: 'u-time-0001',
|
||||
func: async (client) => {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createDefaultSpace(tx)
|
||||
await createOrUpdate(
|
||||
tx,
|
||||
tags.class.TagCategory,
|
||||
tags.space.Tags,
|
||||
{
|
||||
icon: tags.icon.Tags,
|
||||
label: 'Other',
|
||||
targetClass: time.class.ToDo,
|
||||
tags: [],
|
||||
default: true
|
||||
},
|
||||
time.category.Other
|
||||
)
|
||||
await migrateWorkSlots(tx)
|
||||
await migrateTodosSpace(tx)
|
||||
await migrateTodosRanks(tx)
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ import { createActions as defineActions } from './actions'
|
||||
import tracker from './plugin'
|
||||
import { definePresenters } from './presenters'
|
||||
import {
|
||||
DOMAIN_TRACKER,
|
||||
TComponent,
|
||||
TIssue,
|
||||
TIssueStatus,
|
||||
@ -712,4 +713,25 @@ export function createModel (builder: Builder): void {
|
||||
builder.mixin(tracker.class.Issue, core.class.Class, view.mixin.ObjectIcon, {
|
||||
component: tracker.component.IssueStatusPresenter
|
||||
})
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_TRACKER,
|
||||
disabled: [
|
||||
{ space: 1 },
|
||||
{ attachedToClass: 1 },
|
||||
{ status: 1 },
|
||||
{ project: 1 },
|
||||
{ priority: 1 },
|
||||
{ assignee: 1 },
|
||||
{ sprint: 1 },
|
||||
{ component: 1 },
|
||||
{ category: 1 },
|
||||
{ modifiedOn: 1 },
|
||||
{ modifiedBy: 1 },
|
||||
{ createdBy: 1 },
|
||||
{ relations: 1 },
|
||||
{ milestone: 1 },
|
||||
{ createdOn: -1 }
|
||||
]
|
||||
})
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ import core, {
|
||||
import {
|
||||
createOrUpdate,
|
||||
tryMigrate,
|
||||
tryUpgrade,
|
||||
type MigrateOperation,
|
||||
type MigrationClient,
|
||||
type MigrationUpgradeClient
|
||||
@ -43,6 +44,7 @@ import {
|
||||
TimeReportDayType,
|
||||
classicIssueTaskStatuses,
|
||||
createStatesData,
|
||||
trackerId,
|
||||
type Issue,
|
||||
type IssueStatus,
|
||||
type Project
|
||||
@ -497,7 +499,7 @@ async function restoreTaskTypes (client: MigrationClient): Promise<void> {
|
||||
|
||||
export const trackerOperation: MigrateOperation = {
|
||||
async migrate (client: MigrationClient): Promise<void> {
|
||||
await tryMigrate(client, 'tracker', [
|
||||
await tryMigrate(client, trackerId, [
|
||||
{
|
||||
state: 'fix-category-descriptors',
|
||||
func: async (client) => {
|
||||
@ -642,7 +644,14 @@ export const trackerOperation: MigrateOperation = {
|
||||
])
|
||||
},
|
||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createDefaults(tx)
|
||||
await tryUpgrade(client, trackerId, [
|
||||
{
|
||||
state: 'create-defaults',
|
||||
func: async (client) => {
|
||||
const tx = new TxOperations(client, core.account.System)
|
||||
await createDefaults(tx)
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -1098,6 +1098,11 @@ export function createModel (builder: Builder): void {
|
||||
builder.mixin(core.class.Status, core.class.Class, view.mixin.AttributePresenter, {
|
||||
presenter: view.component.StatusRefPresenter
|
||||
})
|
||||
|
||||
builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, {
|
||||
domain: DOMAIN_VIEW,
|
||||
disabled: [{ space: 1 }, { modifiedOn: 1 }, { modifiedBy: 1 }, { createdBy: 1 }, { createdOn: -1 }]
|
||||
})
|
||||
}
|
||||
|
||||
export default view
|
||||
|
@ -34,7 +34,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@hcengineering/platform": "^0.6.9",
|
||||
"fast-equals": "^2.0.3"
|
||||
"fast-equals": "^5.0.1"
|
||||
},
|
||||
"repository": "https://github.com/hcengineering/anticrm",
|
||||
"publishConfig": {
|
||||
|
@ -636,3 +636,17 @@ export interface IndexingConfiguration<T extends Doc> extends Class<Doc> {
|
||||
indexes: (FieldIndex<T> | string)[]
|
||||
searchDisabled?: boolean
|
||||
}
|
||||
|
||||
export interface DomainIndexConfiguration extends Doc {
|
||||
domain: Domain
|
||||
disableCollection?: boolean // For some special cases we could decide to disable collection and index creations at all.
|
||||
|
||||
// A set of indexes we need to disable for domain
|
||||
// Disabled indexes will be removed
|
||||
disabled?: (FieldIndex<Doc> | string)[]
|
||||
|
||||
// Additional indexes we could like to enabled
|
||||
indexes?: (FieldIndex<Doc> | string)[]
|
||||
|
||||
skip?: string[]
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ import type {
|
||||
ConfigurationElement,
|
||||
Doc,
|
||||
DocIndexState,
|
||||
DomainIndexConfiguration,
|
||||
Enum,
|
||||
EnumOf,
|
||||
FullTextData,
|
||||
@ -135,6 +136,7 @@ export default plugin(coreId, {
|
||||
TypeRelatedDocument: '' as Ref<Class<Type<RelatedDocument>>>,
|
||||
DocIndexState: '' as Ref<Class<DocIndexState>>,
|
||||
IndexStageState: '' as Ref<Class<IndexStageState>>,
|
||||
DomainIndexConfiguration: '' as Ref<Class<DomainIndexConfiguration>>,
|
||||
|
||||
Configuration: '' as Ref<Class<Configuration>>,
|
||||
|
||||
|
@ -70,7 +70,6 @@ export abstract class MemDb extends TxProcessor implements Storage {
|
||||
getObject<T extends Doc>(_id: Ref<T>): T {
|
||||
const doc = this.objectById.get(_id)
|
||||
if (doc === undefined) {
|
||||
console.log(_id)
|
||||
throw new PlatformError(new Status(Severity.ERROR, core.status.ObjectNotFound, { _id }))
|
||||
}
|
||||
return doc as T
|
||||
|
@ -76,7 +76,6 @@
|
||||
let updates = getUpdateProps(dragCard, state)
|
||||
|
||||
if (updates === undefined) {
|
||||
console.log('no update props')
|
||||
panelDragLeave(undefined, dragCardState)
|
||||
dragCard = undefined
|
||||
dragCardAvailableCategories = undefined
|
||||
@ -126,7 +125,6 @@
|
||||
}
|
||||
|
||||
const updates = getUpdateProps(dragCard, state)
|
||||
console.log('UPD', updates)
|
||||
if (updates === undefined) {
|
||||
return
|
||||
}
|
||||
|
@ -36,7 +36,7 @@
|
||||
"@hcengineering/core": "^0.6.28",
|
||||
"@hcengineering/platform": "^0.6.9",
|
||||
"toposort": "^2.0.2",
|
||||
"fast-equals": "^2.0.3"
|
||||
"fast-equals": "^5.0.1"
|
||||
},
|
||||
"repository": "https://github.com/hcenginneing/anticrm",
|
||||
"publishConfig": {
|
||||
|
@ -98,12 +98,16 @@ export interface MigrationClient {
|
||||
|
||||
hierarchy: Hierarchy
|
||||
model: ModelDb
|
||||
|
||||
migrateState: Map<string, Set<string>>
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type MigrationUpgradeClient = Client
|
||||
export type MigrationUpgradeClient = Client & {
|
||||
migrateState: Map<string, Set<string>>
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
@ -135,11 +139,7 @@ export interface UpgradeOperations {
|
||||
* @public
|
||||
*/
|
||||
export async function tryMigrate (client: MigrationClient, plugin: string, migrations: Migrations[]): Promise<void> {
|
||||
const states = new Set(
|
||||
(await client.find<MigrationState>(DOMAIN_MIGRATION, { _class: core.class.MigrationState, plugin })).map(
|
||||
(p) => p.state
|
||||
)
|
||||
)
|
||||
const states = client.migrateState.get(plugin) ?? new Set()
|
||||
for (const migration of migrations) {
|
||||
if (states.has(migration.state)) continue
|
||||
await migration.func(client)
|
||||
@ -164,7 +164,7 @@ export async function tryUpgrade (
|
||||
plugin: string,
|
||||
migrations: UpgradeOperations[]
|
||||
): Promise<void> {
|
||||
const states = new Set((await client.findAll(core.class.MigrationState, { plugin })).map((p) => p.state))
|
||||
const states = client.migrateState.get(plugin) ?? new Set()
|
||||
for (const migration of migrations) {
|
||||
if (states.has(migration.state)) continue
|
||||
await migration.func(client)
|
||||
|
@ -60,7 +60,6 @@ export function getPlugins (): Plugin[] {
|
||||
function getLocation (plugin: Plugin): PluginLoader<Resources> {
|
||||
const location = locations.get(plugin)
|
||||
if (location === undefined) {
|
||||
console.log(plugin)
|
||||
throw new PlatformError(
|
||||
new Status(Severity.ERROR, platform.status.NoLocationForPlugin, {
|
||||
plugin
|
||||
|
@ -49,7 +49,7 @@
|
||||
"svelte": "^4.2.12",
|
||||
"@hcengineering/client": "^0.6.14",
|
||||
"@hcengineering/collaborator-client": "^0.6.0",
|
||||
"fast-equals": "^2.0.3",
|
||||
"fast-equals": "^5.0.1",
|
||||
"png-chunks-extract": "^1.0.0"
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,6 @@
|
||||
const indexDocQuery = createQuery()
|
||||
$: if (objectId !== undefined) {
|
||||
indexDocQuery.query(core.class.DocIndexState, { _id: objectId as Ref<DocIndexState> }, (res) => {
|
||||
console.log(res)
|
||||
indexDoc = res.shift()
|
||||
})
|
||||
} else {
|
||||
|
@ -51,6 +51,7 @@ import { onDestroy } from 'svelte'
|
||||
import { type KeyedAttribute } from '..'
|
||||
import { OptimizeQueryMiddleware, PresentationPipelineImpl, type PresentationPipeline } from './pipeline'
|
||||
import plugin from './plugin'
|
||||
import { Analytics } from '@hcengineering/analytics'
|
||||
|
||||
let liveQuery: LQ
|
||||
let client: TxOperations & MeasureClient
|
||||
@ -99,6 +100,7 @@ class UIClient extends TxOperations implements Client, MeasureClient {
|
||||
it(...tx)
|
||||
})
|
||||
} catch (err: any) {
|
||||
Analytics.handleError(err)
|
||||
console.log(err)
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,8 @@
|
||||
"dependencies": {
|
||||
"@hcengineering/platform": "^0.6.9",
|
||||
"@hcengineering/core": "^0.6.28",
|
||||
"fast-equals": "^2.0.3"
|
||||
"@hcengineering/analytics": "^0.6.0",
|
||||
"fast-equals": "^5.0.1"
|
||||
},
|
||||
"repository": "https://github.com/hcenginneing/anticrm",
|
||||
"publishConfig": {
|
||||
|
@ -58,6 +58,7 @@ import core, {
|
||||
} from '@hcengineering/core'
|
||||
import { PlatformError } from '@hcengineering/platform'
|
||||
import { deepEqual } from 'fast-equals'
|
||||
import { Analytics } from '@hcengineering/analytics'
|
||||
|
||||
const CACHE_SIZE = 100
|
||||
|
||||
@ -132,6 +133,7 @@ export class LiveQuery implements WithTx, Client {
|
||||
continue
|
||||
}
|
||||
}
|
||||
Analytics.handleError(err)
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
@ -149,6 +151,7 @@ export class LiveQuery implements WithTx, Client {
|
||||
continue
|
||||
}
|
||||
}
|
||||
Analytics.handleError(err)
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
@ -398,7 +401,8 @@ export class LiveQuery implements WithTx, Client {
|
||||
q.total = result.total
|
||||
await this.callback(q)
|
||||
})
|
||||
.catch((err) => {
|
||||
.catch((err: any) => {
|
||||
Analytics.handleError(err)
|
||||
console.log('failed to update Live Query: ', err)
|
||||
})
|
||||
|
||||
@ -1311,7 +1315,8 @@ export class LiveQuery implements WithTx, Client {
|
||||
if (!this.removeFromQueue(q)) {
|
||||
try {
|
||||
await this.refresh(q, true)
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
Analytics.handleError(err)
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
@ -1322,7 +1327,8 @@ export class LiveQuery implements WithTx, Client {
|
||||
if (hasClass(q, indexingParam._class) && q.query.$search !== undefined) {
|
||||
try {
|
||||
await this.refresh(q, true)
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
Analytics.handleError(err)
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
@ -1336,7 +1342,8 @@ export class LiveQuery implements WithTx, Client {
|
||||
if (!this.removeFromQueue(q)) {
|
||||
try {
|
||||
await this.refresh(q, true)
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
Analytics.handleError(err)
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
@ -1347,7 +1354,8 @@ export class LiveQuery implements WithTx, Client {
|
||||
if (hasClass(q, params._class)) {
|
||||
try {
|
||||
await this.refresh(q, true)
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
Analytics.handleError(err)
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
@ -1363,7 +1371,8 @@ export class LiveQuery implements WithTx, Client {
|
||||
if (!this.removeFromQueue(q)) {
|
||||
try {
|
||||
await this.refresh(q)
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
Analytics.handleError(err)
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
@ -1374,7 +1383,8 @@ export class LiveQuery implements WithTx, Client {
|
||||
if (typeof q.query.space !== 'string') {
|
||||
try {
|
||||
await this.refresh(q)
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
Analytics.handleError(err)
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
|
@ -81,6 +81,6 @@
|
||||
"diff": "^5.1.0",
|
||||
"slugify": "^1.6.6",
|
||||
"lib0": "^0.2.88",
|
||||
"fast-equals": "^2.0.3"
|
||||
"fast-equals": "^5.0.1"
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@
|
||||
"@tiptap/extension-underline": "^2.2.4",
|
||||
"@tiptap/suggestion": "^2.2.4",
|
||||
"prosemirror-model": "^1.19.4",
|
||||
"fast-equals": "^2.0.3",
|
||||
"fast-equals": "^5.0.1",
|
||||
"yjs": "^13.5.52",
|
||||
"y-prosemirror": "^1.2.1"
|
||||
},
|
||||
|
@ -42,11 +42,12 @@
|
||||
"@hcengineering/theme": "^0.6.3",
|
||||
"@hcengineering/core": "^0.6.28",
|
||||
"svelte": "^4.2.12",
|
||||
"fast-equals": "^2.0.3",
|
||||
"fast-equals": "^5.0.1",
|
||||
"autolinker": "4.0.0",
|
||||
"emoji-regex": "^10.1.0",
|
||||
"date-fns": "^2.30.0",
|
||||
"date-fns-tz": "^2.0.0"
|
||||
"date-fns-tz": "^2.0.0",
|
||||
"@hcengineering/analytics": "^0.6.0"
|
||||
},
|
||||
"repository": "https://github.com/hcenginneing/anticrm",
|
||||
"publishConfig": {
|
||||
|
@ -168,9 +168,7 @@
|
||||
const mouseOutEvent = (e: MouseEvent) => {
|
||||
time.cursorMarker = undefined
|
||||
}
|
||||
const clickEvent = (e: MouseEvent) => {
|
||||
console.log('[Timeline] Cursor: ', time.cursorMarker)
|
||||
}
|
||||
const clickEvent = (e: MouseEvent) => {}
|
||||
|
||||
onMount(() => {
|
||||
container.addEventListener('wheel', wheelEvent)
|
||||
|
@ -4,14 +4,16 @@ import { writable } from 'svelte/store'
|
||||
import type {
|
||||
AnyComponent,
|
||||
AnySvelteComponent,
|
||||
DeviceOptions,
|
||||
HorizontalAlignment,
|
||||
PopupAlignment,
|
||||
PopupOptions,
|
||||
PopupPositionElement,
|
||||
VerticalAlignment,
|
||||
DeviceOptions
|
||||
VerticalAlignment
|
||||
} from './types'
|
||||
|
||||
import { Analytics } from '@hcengineering/analytics'
|
||||
|
||||
export interface CompAndProps {
|
||||
id: string
|
||||
is: AnySvelteComponent | ComponentType
|
||||
@ -80,7 +82,8 @@ export function showPopup (
|
||||
addPopup({ id, is: resolved, props, element: _element, onClose, onUpdate, close: closePopupOp, options })
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
Analytics.handleError(err)
|
||||
console.error(err)
|
||||
})
|
||||
} else {
|
||||
addPopup({ id, is: component, props, element: _element, onClose, onUpdate, close: closePopupOp, options })
|
||||
|
@ -47,7 +47,6 @@
|
||||
isFullSize
|
||||
on:fullsize
|
||||
on:close={() => {
|
||||
console.log('close')
|
||||
dispatch('close')
|
||||
}}
|
||||
>
|
||||
|
@ -58,7 +58,7 @@
|
||||
"qs": "~6.11.0",
|
||||
"@hcengineering/tags": "^0.6.12",
|
||||
"@hcengineering/tags-resources": "^0.6.0",
|
||||
"fast-equals": "^2.0.3",
|
||||
"fast-equals": "^5.0.1",
|
||||
"@hcengineering/recruit": "^0.6.21",
|
||||
"@hcengineering/task": "^0.6.13"
|
||||
},
|
||||
|
@ -43,7 +43,7 @@
|
||||
"@hcengineering/recruit": "^0.6.21",
|
||||
"@hcengineering/tags": "^0.6.12",
|
||||
"@hcengineering/task": "^0.6.13",
|
||||
"fast-equals": "^2.0.3",
|
||||
"fast-equals": "^5.0.1",
|
||||
"qs": "~6.11.0"
|
||||
},
|
||||
"repository": "https://github.com/hcengineering/anticrm",
|
||||
|
@ -53,7 +53,7 @@
|
||||
"@hcengineering/view-resources": "^0.6.0",
|
||||
"@hcengineering/view": "^0.6.9",
|
||||
"@hcengineering/workbench": "^0.6.9",
|
||||
"fast-equals": "^2.0.3",
|
||||
"fast-equals": "^5.0.1",
|
||||
"date-fns": "^2.30.0",
|
||||
"date-fns-tz": "^2.0.0"
|
||||
}
|
||||
|
@ -60,7 +60,7 @@
|
||||
"@hcengineering/view-resources": "^0.6.0",
|
||||
"@hcengineering/workbench": "^0.6.9",
|
||||
"@hcengineering/workbench-resources": "^0.6.1",
|
||||
"fast-equals": "^2.0.3",
|
||||
"fast-equals": "^5.0.1",
|
||||
"svelte": "^4.2.12",
|
||||
"html-to-text": "^9.0.3"
|
||||
}
|
||||
|
@ -39,7 +39,7 @@
|
||||
"@hcengineering/platform": "^0.6.9",
|
||||
"@hcengineering/ui": "^0.6.11",
|
||||
"@hcengineering/view": "^0.6.9",
|
||||
"fast-equals": "^2.0.3"
|
||||
"fast-equals": "^5.0.1"
|
||||
},
|
||||
"repository": "https://github.com/hcengineering/anticrm",
|
||||
"publishConfig": {
|
||||
|
@ -96,32 +96,46 @@ class Connection implements ClientConnection {
|
||||
if (!(s instanceof Promise)) {
|
||||
console.log('no ping response from server. Closing socket.', s, (s as any)?.readyState)
|
||||
// Trying to close connection and re-establish it.
|
||||
s?.close()
|
||||
s?.close(1000)
|
||||
} else {
|
||||
console.log('no ping response from server. Closing socket.', s)
|
||||
void s.then((s) => {
|
||||
s.close()
|
||||
s.close(1000)
|
||||
})
|
||||
}
|
||||
this.websocket = null
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
void this.sendRequest({ method: 'ping', params: [] }).then(() => {
|
||||
this.pingResponse = Date.now()
|
||||
})
|
||||
if (!this.closed) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
void this.sendRequest({ method: 'ping', params: [] }).then(() => {
|
||||
this.pingResponse = Date.now()
|
||||
})
|
||||
} else {
|
||||
clearInterval(this.interval)
|
||||
}
|
||||
}, pingTimeout)
|
||||
}
|
||||
|
||||
async close (): Promise<void> {
|
||||
this.closed = true
|
||||
clearInterval(this.interval)
|
||||
const closeEvt = serialize(
|
||||
{
|
||||
method: 'close',
|
||||
params: [],
|
||||
id: -1
|
||||
},
|
||||
false
|
||||
)
|
||||
if (this.websocket !== null) {
|
||||
if (this.websocket instanceof Promise) {
|
||||
await this.websocket.then((ws) => {
|
||||
ws.close()
|
||||
ws.send(closeEvt)
|
||||
ws.close(1000)
|
||||
})
|
||||
} else {
|
||||
this.websocket.send(closeEvt)
|
||||
this.websocket.close(1000)
|
||||
}
|
||||
this.websocket = null
|
||||
@ -143,6 +157,9 @@ class Connection implements ClientConnection {
|
||||
this.delay = 0
|
||||
return await this.pending
|
||||
} catch (err: any) {
|
||||
if (this.closed) {
|
||||
throw new Error('connection closed')
|
||||
}
|
||||
this.pending = undefined
|
||||
console.log('failed to connect', err)
|
||||
if (err?.code === UNAUTHORIZED.code) {
|
||||
|
@ -100,8 +100,6 @@
|
||||
notification,
|
||||
integration: provider.integrationType !== undefined ? integrations.has(provider.integrationType) : false
|
||||
}
|
||||
} else {
|
||||
console.log('provider not found: ', item.provider)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,8 +72,6 @@
|
||||
notification,
|
||||
integration: provider.integrationType !== undefined ? integrations.has(provider.integrationType) : false
|
||||
}
|
||||
} else {
|
||||
console.log('provider not found: ', item.provider)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,6 @@
|
||||
const accounts = await client.findAll(contact.class.PersonAccount, { person: sourceAccount._id })
|
||||
|
||||
const h = client.getHierarchy()
|
||||
console.log('merge employee:', sourceAccount.name, 'to', targetAccount.name)
|
||||
// Move all possible references to Account and Employee and replace to target one.
|
||||
const reftos = (await client.findAll(core.class.Attribute, { 'type._class': core.class.RefTo })).filter((it) => {
|
||||
const to = it.type as RefTo<Doc>
|
||||
@ -258,7 +257,6 @@
|
||||
await updateAttribute(builder, v, d, { key: attr.name, attr }, targetAccount._id)
|
||||
}
|
||||
if (builder.txes.length > 0) {
|
||||
console.log('merge employee:', sourceAccount.name, 'to', targetAccount.name, d, builder.txes.length)
|
||||
await builder.commit()
|
||||
}
|
||||
}
|
||||
@ -288,7 +286,6 @@
|
||||
for (const v of values) {
|
||||
await updateAttribute(builder, v, d, { key: attr.name, attr }, targetAccount._id)
|
||||
}
|
||||
console.log('merge employee:', sourceAccount.name, 'to', targetAccount.name, d, builder.txes.length)
|
||||
await builder.commit()
|
||||
}
|
||||
}
|
||||
|
@ -63,6 +63,6 @@
|
||||
"@hcengineering/rank": "^0.6.0",
|
||||
"@tiptap/core": "^2.2.4",
|
||||
"slugify": "^1.6.6",
|
||||
"fast-equals": "^2.0.3"
|
||||
"fast-equals": "^5.0.1"
|
||||
}
|
||||
}
|
||||
|
@ -153,7 +153,8 @@ export async function connect (title: string): Promise<Client | undefined> {
|
||||
return
|
||||
}
|
||||
} catch (err: any) {
|
||||
console.log(err)
|
||||
Analytics.handleError(err)
|
||||
console.error(err)
|
||||
const requirdVersion = getMetadata(presentation.metadata.RequiredVersion)
|
||||
console.log('checking min model version', requirdVersion)
|
||||
if (requirdVersion !== undefined) {
|
||||
|
@ -57,6 +57,6 @@
|
||||
"@hcengineering/view-resources": "^0.6.0",
|
||||
"@hcengineering/workbench": "^0.6.9",
|
||||
"svelte": "^4.2.12",
|
||||
"fast-equals": "^2.0.3"
|
||||
"fast-equals": "^5.0.1"
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ export async function doLogin (email: string, password: string): Promise<[Status
|
||||
}
|
||||
return [result.error ?? OK, result.result]
|
||||
} catch (err: any) {
|
||||
console.log('login error', err)
|
||||
console.error('login error', err)
|
||||
Analytics.handleError(err)
|
||||
return [unknownError(err), undefined]
|
||||
}
|
||||
@ -900,7 +900,7 @@ export async function getEnpoint (): Promise<string | undefined> {
|
||||
const result = await response.json()
|
||||
return result.result
|
||||
} catch (err: any) {
|
||||
console.log('get endpoint error', err)
|
||||
console.error('get endpoint error', err)
|
||||
Analytics.handleError(err)
|
||||
}
|
||||
}
|
||||
@ -920,7 +920,7 @@ export async function getSessionLoginInfo (): Promise<LoginInfo | WorkspaceLogin
|
||||
const result = await response.json()
|
||||
return result
|
||||
} catch (err: any) {
|
||||
console.log('login error', err)
|
||||
console.error('login error', err)
|
||||
Analytics.handleError(err)
|
||||
}
|
||||
}
|
||||
|
@ -482,7 +482,6 @@
|
||||
}
|
||||
|
||||
function fileSelected () {
|
||||
console.log(inputFile.files)
|
||||
const file = inputFile.files?.[0]
|
||||
if (file !== undefined) {
|
||||
createAttachment(file)
|
||||
|
@ -13,6 +13,7 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { Analytics } from '@hcengineering/analytics'
|
||||
import login from '@hcengineering/login'
|
||||
import { getResource } from '@hcengineering/platform'
|
||||
import presentation from '@hcengineering/presentation'
|
||||
@ -43,8 +44,9 @@
|
||||
const changePassword = await getResource(login.function.ChangePassword)
|
||||
await changePassword(oldPassword, password)
|
||||
label = setting.string.Saved
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
} catch (e: any) {
|
||||
Analytics.handleError(e)
|
||||
console.error(e)
|
||||
label = presentation.string.Save
|
||||
saved = false
|
||||
error = true
|
||||
|
@ -61,7 +61,7 @@
|
||||
"@hcengineering/platform": "^0.6.9",
|
||||
"@hcengineering/text-editor": "^0.6.0",
|
||||
"@hcengineering/time": "^0.6.0",
|
||||
"fast-equals": "^2.0.3",
|
||||
"fast-equals": "^5.0.1",
|
||||
"@hcengineering/activity": "^0.6.0",
|
||||
"@hcengineering/activity-resources": "^0.6.1"
|
||||
}
|
||||
|
@ -70,7 +70,7 @@
|
||||
"@hcengineering/view-resources": "^0.6.0",
|
||||
"@hcengineering/workbench": "^0.6.9",
|
||||
"@hcengineering/workbench-resources": "^0.6.1",
|
||||
"fast-equals": "^2.0.3",
|
||||
"fast-equals": "^5.0.1",
|
||||
"svelte": "^4.2.12"
|
||||
}
|
||||
}
|
||||
|
@ -56,6 +56,6 @@
|
||||
"@hcengineering/text-editor": "^0.6.0",
|
||||
"@hcengineering/analytics": "^0.6.0",
|
||||
"@hcengineering/query": "^0.6.8",
|
||||
"fast-equals": "^2.0.3"
|
||||
"fast-equals": "^5.0.1"
|
||||
}
|
||||
}
|
||||
|
@ -379,7 +379,6 @@ async function ShowEditor (
|
||||
}
|
||||
}
|
||||
if (editor !== undefined) {
|
||||
console.log('EVT', evt)
|
||||
showPopup(
|
||||
editor,
|
||||
cprops,
|
||||
|
@ -17,6 +17,7 @@
|
||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||
import { AttributeModel } from '@hcengineering/view'
|
||||
import { getObjectPresenter } from '../utils'
|
||||
import { Analytics } from '@hcengineering/analytics'
|
||||
|
||||
export let objectId: Ref<Doc> | undefined = undefined
|
||||
export let _class: Ref<Class<Doc>> | undefined = undefined
|
||||
@ -61,10 +62,8 @@
|
||||
.then((p) => {
|
||||
presenter = p
|
||||
})
|
||||
.catch((p) => {
|
||||
console.log(objectId)
|
||||
console.log(_class)
|
||||
console.log(value)
|
||||
.catch((p: any) => {
|
||||
Analytics.handleError(p)
|
||||
throw p
|
||||
})
|
||||
}
|
||||
|
@ -944,7 +944,8 @@ export async function moveToSpace (
|
||||
const allAttached = await client.findAll(collection.of, { attachedTo: doc._id })
|
||||
for (const attached of allAttached) {
|
||||
// Do not use extra for childs.
|
||||
await moveToSpace(client, attached, space).catch((err) => {
|
||||
await moveToSpace(client, attached, space).catch((err: any) => {
|
||||
Analytics.handleError(err)
|
||||
console.log('failed to move', name, err)
|
||||
})
|
||||
}
|
||||
|
@ -263,7 +263,8 @@ export async function connect (title: string): Promise<Client | undefined> {
|
||||
return
|
||||
}
|
||||
} catch (err: any) {
|
||||
console.log(err)
|
||||
console.error(err)
|
||||
Analytics.handleError(err)
|
||||
const requirdVersion = getMetadata(presentation.metadata.RequiredVersion)
|
||||
console.log('checking min model version', requirdVersion)
|
||||
if (requirdVersion !== undefined) {
|
||||
|
@ -40,7 +40,7 @@
|
||||
"@hcengineering/recruit": "^0.6.21",
|
||||
"@hcengineering/server": "^0.6.4",
|
||||
"@hcengineering/server-core": "^0.6.1",
|
||||
"fast-equals": "^2.0.3",
|
||||
"fast-equals": "^5.0.1",
|
||||
"got": "^11.8.3",
|
||||
"html-to-text": "^9.0.3"
|
||||
}
|
||||
|
@ -957,7 +957,7 @@ export async function upgradeWorkspace (
|
||||
const versionStr = versionToString(version)
|
||||
|
||||
console.log(
|
||||
`${workspaceUrl} - ${forceUpdate ? 'force-' : ''}upgrade from "${
|
||||
`${ws.workspace} - ${forceUpdate ? 'force-' : ''}upgrade from "${
|
||||
ws?.version !== undefined ? versionToString(ws.version) : ''
|
||||
}" to "${versionStr}"`
|
||||
)
|
||||
|
@ -39,7 +39,7 @@
|
||||
"@hcengineering/platform": "^0.6.9",
|
||||
"@hcengineering/text": "^0.6.1",
|
||||
"@hcengineering/query": "^0.6.8",
|
||||
"fast-equals": "^2.0.3",
|
||||
"fast-equals": "^5.0.1",
|
||||
"uuid": "^8.3.2"
|
||||
}
|
||||
}
|
||||
|
@ -58,6 +58,7 @@
|
||||
"sharp": "~0.32.0",
|
||||
"@hcengineering/minio": "^0.6.0",
|
||||
"@hcengineering/mongo": "^0.6.1",
|
||||
"morgan": "^1.10.0"
|
||||
"morgan": "^1.10.0",
|
||||
"@hcengineering/analytics": "^0.6.0"
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import { Analytics } from '@hcengineering/analytics'
|
||||
import { MeasureContext, WorkspaceId, metricsAggregate } from '@hcengineering/core'
|
||||
import { StorageAdapter } from '@hcengineering/server-core'
|
||||
import { Token, decodeToken } from '@hcengineering/server-token'
|
||||
@ -126,7 +127,8 @@ async function getFileRange (
|
||||
resolve()
|
||||
})
|
||||
dataStream.on('error', (err) => {
|
||||
console.error(err)
|
||||
void ctx.error('error receive stream', { workspace: workspace.name, uuid, error: err })
|
||||
Analytics.handleError(err)
|
||||
res.end()
|
||||
reject(err)
|
||||
})
|
||||
@ -136,11 +138,12 @@ async function getFileRange (
|
||||
})
|
||||
} catch (err: any) {
|
||||
if (err?.code === 'NoSuchKey' || err?.code === 'NotFound') {
|
||||
console.log('No such key', workspace.name, uuid)
|
||||
await ctx.info('No such key', { workspace: workspace.name, uuid })
|
||||
res.status(404).send()
|
||||
return
|
||||
} else {
|
||||
console.log(err)
|
||||
Analytics.handleError(err)
|
||||
void ctx.error(err)
|
||||
}
|
||||
res.status(500).send()
|
||||
}
|
||||
@ -207,12 +210,14 @@ async function getFile (
|
||||
})
|
||||
dataStream.on('error', function (err) {
|
||||
res.status(500).send()
|
||||
console.log(err)
|
||||
Analytics.handleError(err)
|
||||
void ctx.error('error', { err })
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
} catch (err: any) {
|
||||
console.log(err)
|
||||
await ctx.error('get-file-error', { workspace: workspace.name, err })
|
||||
Analytics.handleError(err)
|
||||
res.status(500).send()
|
||||
}
|
||||
},
|
||||
@ -304,8 +309,9 @@ export function start (
|
||||
admin
|
||||
})
|
||||
res.end(json)
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
} catch (err: any) {
|
||||
void ctx.error('statistics error', { err })
|
||||
Analytics.handleError(err)
|
||||
res.writeHead(404, {})
|
||||
res.end()
|
||||
}
|
||||
@ -394,31 +400,30 @@ export function start (
|
||||
})
|
||||
|
||||
const filesHandler = async (ctx: MeasureContext, req: Request, res: Response): Promise<void> => {
|
||||
let payload: Token
|
||||
try {
|
||||
const cookies = ((req?.headers?.cookie as string) ?? '').split(';').map((it) => it.trim().split('='))
|
||||
|
||||
const token = cookies.find((it) => it[0] === 'presentation-metadata-Token')?.[1]
|
||||
const payload =
|
||||
payload =
|
||||
token !== undefined
|
||||
? decodeToken(token)
|
||||
: { email: 'guest', workspace: { name: req.query.workspace as string, productId: '' } }
|
||||
|
||||
let uuid = req.query.file as string
|
||||
if (token === undefined) {
|
||||
try {
|
||||
const d = await ctx.with(
|
||||
'notoken-stat',
|
||||
{ workspace: payload.workspace.name },
|
||||
async () => await config.storageAdapter.stat(ctx, payload.workspace, uuid)
|
||||
)
|
||||
if (d !== undefined && !(d.contentType ?? '').includes('image')) {
|
||||
// Do not allow to return non images with no token.
|
||||
if (token === undefined) {
|
||||
res.status(403).send()
|
||||
return
|
||||
}
|
||||
const d = await ctx.with(
|
||||
'notoken-stat',
|
||||
{ workspace: payload.workspace.name },
|
||||
async () => await config.storageAdapter.stat(ctx, payload.workspace, uuid)
|
||||
)
|
||||
if (d !== undefined && !(d.contentType ?? '').includes('image')) {
|
||||
// Do not allow to return non images with no token.
|
||||
if (token === undefined) {
|
||||
res.status(403).send()
|
||||
return
|
||||
}
|
||||
} catch (err) {}
|
||||
}
|
||||
}
|
||||
|
||||
const size = req.query.size as 'inline' | 'tiny' | 'x-small' | 'small' | 'medium' | 'large' | 'x-large' | 'full'
|
||||
@ -442,7 +447,7 @@ export function start (
|
||||
}
|
||||
} catch (error: any) {
|
||||
if (error?.code === 'NoSuchKey' || error?.code === 'NotFound') {
|
||||
console.log('No such key', req.query.file)
|
||||
await ctx.error('No such key', { file: req.query.file })
|
||||
res.status(404).send()
|
||||
return
|
||||
} else {
|
||||
@ -541,8 +546,9 @@ export function start (
|
||||
}
|
||||
|
||||
res.status(200).send()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
} catch (error: any) {
|
||||
Analytics.handleError(error)
|
||||
await ctx.error('failed to delete', { url: req.url })
|
||||
res.status(500).send()
|
||||
}
|
||||
}
|
||||
@ -585,7 +591,6 @@ export function start (
|
||||
|
||||
https
|
||||
.get(url, options, (response) => {
|
||||
console.log('status', response.statusCode)
|
||||
if (response.statusCode !== 200) {
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
res.status(500).send(`server returned ${response.statusCode}`)
|
||||
@ -603,31 +608,34 @@ export function start (
|
||||
config.storageAdapter
|
||||
.put(ctx, payload.workspace, id, buffer, contentType, buffer.length)
|
||||
.then(async (objInfo) => {
|
||||
console.log('uploaded uuid', id, objInfo.etag)
|
||||
|
||||
res.status(200).send({
|
||||
id,
|
||||
contentType,
|
||||
size: buffer.length
|
||||
})
|
||||
})
|
||||
.catch((err) => {
|
||||
.catch((err: any) => {
|
||||
if (err !== null) {
|
||||
console.log('minio putObject error', err)
|
||||
Analytics.handleError(err)
|
||||
void ctx.error('error', { err })
|
||||
res.status(500).send(err)
|
||||
}
|
||||
})
|
||||
})
|
||||
.on('error', function (err) {
|
||||
Analytics.handleError(err)
|
||||
void ctx.error('error', { err })
|
||||
res.status(500).send(err)
|
||||
})
|
||||
})
|
||||
.on('error', (e) => {
|
||||
console.error(e)
|
||||
Analytics.handleError(e)
|
||||
void ctx.error('error', { e })
|
||||
res.status(500).send(e)
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
} catch (error: any) {
|
||||
Analytics.handleError(error)
|
||||
void ctx.error('error', { error })
|
||||
res.status(500).send()
|
||||
}
|
||||
})
|
||||
@ -679,41 +687,27 @@ export function start (
|
||||
config.storageAdapter
|
||||
.put(ctx, payload.workspace, id, buffer, contentType ?? 'application/octet-stream', buffer.length)
|
||||
.then(async () => {
|
||||
console.log('uploaded uuid', id)
|
||||
|
||||
// if (attachedTo !== undefined) {
|
||||
// const elastic = await createElasticAdapter(config.elasticUrl, payload.workspace)
|
||||
|
||||
// const indexedDoc: IndexedDoc = {
|
||||
// id: id as Ref<Doc>,
|
||||
// _class: attachment.class.Attachment,
|
||||
// space,
|
||||
// modifiedOn: Date.now(),
|
||||
// modifiedBy: 'core:account:System' as Ref<Account>,
|
||||
// attachedTo,
|
||||
// data: buffer.toString('base64')
|
||||
// }
|
||||
|
||||
// await elastic.index(indexedDoc)
|
||||
// }
|
||||
|
||||
res.status(200).send({
|
||||
id,
|
||||
contentType,
|
||||
size: buffer.length
|
||||
})
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('minio putObject error', err)
|
||||
.catch((err: any) => {
|
||||
Analytics.handleError(err)
|
||||
void ctx.error('error', { err })
|
||||
res.status(500).send(err)
|
||||
})
|
||||
})
|
||||
.on('error', function (err) {
|
||||
Analytics.handleError(err)
|
||||
void ctx.error('error', { err })
|
||||
res.status(500).send(err)
|
||||
})
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
} catch (error: any) {
|
||||
Analytics.handleError(error)
|
||||
void ctx.error('error', { error })
|
||||
res.status(500).send()
|
||||
}
|
||||
})
|
||||
@ -800,14 +794,10 @@ async function getResizeID (
|
||||
}
|
||||
let hasSmall = false
|
||||
const sizeId = uuid + `%size%${width}`
|
||||
try {
|
||||
const d = await config.storageAdapter.stat(ctx, payload.workspace, sizeId)
|
||||
hasSmall = d !== undefined && d.size > 0
|
||||
} catch (err: any) {
|
||||
if (err.code !== 'NotFound') {
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
|
||||
const d = await config.storageAdapter.stat(ctx, payload.workspace, sizeId)
|
||||
hasSmall = d !== undefined && d.size > 0
|
||||
|
||||
if (hasSmall) {
|
||||
// We have cached small document, let's proceed with it.
|
||||
uuid = sizeId
|
||||
|
@ -36,6 +36,6 @@
|
||||
"@hcengineering/platform": "^0.6.9",
|
||||
"@hcengineering/server-core": "^0.6.1",
|
||||
"@hcengineering/server-preference": "^0.6.0",
|
||||
"fast-equals": "^2.0.3"
|
||||
"fast-equals": "^5.0.1"
|
||||
}
|
||||
}
|
||||
|
@ -45,6 +45,7 @@
|
||||
"@hcengineering/server-core": "^0.6.1",
|
||||
"@hcengineering/server": "^0.6.4",
|
||||
"@hcengineering/mongo": "^0.6.1",
|
||||
"@hcengineering/minio": "^0.6.0"
|
||||
"@hcengineering/minio": "^0.6.0",
|
||||
"fast-equals": "^5.0.1"
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user