Add OnLabelDelete trigger (#1576)

Signed-off-by: Dvinyanin Alexandr <dvinyanin.alexandr@gmail.com>
This commit is contained in:
Alex 2022-04-28 17:01:20 +07:00 committed by GitHub
parent bde8549e5d
commit 83e8963e38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 451 additions and 24 deletions

View File

@ -1,7 +1,6 @@
lockfileVersion: 5.3
specifiers:
'@anticrm/platform': ~0.6.6
'@anticrm/skillset': ^0.6.0
'@elastic/elasticsearch': ^7.14.0
'@koa/cors': ^3.1.0
@ -74,6 +73,7 @@ specifiers:
'@rush-temp/model-recruit': file:./projects/model-recruit.tgz
'@rush-temp/model-rig': file:./projects/model-rig.tgz
'@rush-temp/model-server-attachment': file:./projects/model-server-attachment.tgz
'@rush-temp/model-server-board': file:./projects/model-server-board.tgz
'@rush-temp/model-server-calendar': file:./projects/model-server-calendar.tgz
'@rush-temp/model-server-chunter': file:./projects/model-server-chunter.tgz
'@rush-temp/model-server-contact': file:./projects/model-server-contact.tgz
@ -117,6 +117,8 @@ specifiers:
'@rush-temp/server': file:./projects/server.tgz
'@rush-temp/server-attachment': file:./projects/server-attachment.tgz
'@rush-temp/server-attachment-resources': file:./projects/server-attachment-resources.tgz
'@rush-temp/server-board': file:./projects/server-board.tgz
'@rush-temp/server-board-resources': file:./projects/server-board-resources.tgz
'@rush-temp/server-calendar': file:./projects/server-calendar.tgz
'@rush-temp/server-calendar-resources': file:./projects/server-calendar-resources.tgz
'@rush-temp/server-chunter': file:./projects/server-chunter.tgz
@ -275,7 +277,6 @@ specifiers:
xml2js: ~0.4.23
dependencies:
'@anticrm/platform': 0.6.6
'@anticrm/skillset': 0.6.0
'@elastic/elasticsearch': 7.16.0
'@koa/cors': 3.1.0
@ -348,6 +349,7 @@ dependencies:
'@rush-temp/model-recruit': file:projects/model-recruit.tgz_typescript@4.5.4
'@rush-temp/model-rig': file:projects/model-rig.tgz_37f79b97d0d86442e45d380c86f520c5
'@rush-temp/model-server-attachment': file:projects/model-server-attachment.tgz_typescript@4.5.4
'@rush-temp/model-server-board': file:projects/model-server-board.tgz_typescript@4.5.4
'@rush-temp/model-server-calendar': file:projects/model-server-calendar.tgz_typescript@4.5.4
'@rush-temp/model-server-chunter': file:projects/model-server-chunter.tgz_typescript@4.5.4
'@rush-temp/model-server-contact': file:projects/model-server-contact.tgz_typescript@4.5.4
@ -391,6 +393,8 @@ dependencies:
'@rush-temp/server': file:projects/server.tgz
'@rush-temp/server-attachment': file:projects/server-attachment.tgz
'@rush-temp/server-attachment-resources': file:projects/server-attachment-resources.tgz
'@rush-temp/server-board': file:projects/server-board.tgz
'@rush-temp/server-board-resources': file:projects/server-board-resources.tgz
'@rush-temp/server-calendar': file:projects/server-calendar.tgz
'@rush-temp/server-calendar-resources': file:projects/server-calendar-resources.tgz
'@rush-temp/server-chunter': file:projects/server-chunter.tgz
@ -1514,7 +1518,7 @@ packages:
chalk: 4.1.2
emittery: 0.8.1
exit: 0.1.2
graceful-fs: 4.2.8
graceful-fs: 4.2.10
jest-changed-files: 27.5.1
jest-config: 27.4.7_ts-node@10.5.0
jest-haste-map: 27.5.1
@ -1652,7 +1656,7 @@ packages:
collect-v8-coverage: 1.0.1
exit: 0.1.2
glob: 7.2.0
graceful-fs: 4.2.8
graceful-fs: 4.2.10
istanbul-lib-coverage: 3.2.0
istanbul-lib-instrument: 5.1.0
istanbul-lib-report: 3.0.0
@ -1795,7 +1799,7 @@ packages:
chalk: 4.1.2
convert-source-map: 1.8.0
fast-json-stable-stringify: 2.1.0
graceful-fs: 4.2.8
graceful-fs: 4.2.10
jest-haste-map: 27.5.1
jest-regex-util: 27.4.0
jest-util: 27.5.1
@ -1847,7 +1851,7 @@ packages:
dependencies:
'@types/istanbul-lib-coverage': 2.0.3
'@types/istanbul-reports': 3.0.1
'@types/node': 17.0.0
'@types/node': 17.0.10
'@types/yargs': 16.0.4
chalk: 4.1.2
dev: false
@ -2546,7 +2550,7 @@ packages:
/@types/accepts/1.3.5:
resolution: {integrity: sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==}
dependencies:
'@types/node': 17.0.0
'@types/node': 17.0.10
dev: false
/@types/argparse/1.0.38:
@ -2634,7 +2638,7 @@ packages:
'@types/connect': 3.4.35
'@types/express': 4.17.13
'@types/keygrip': 1.0.2
'@types/node': 17.0.0
'@types/node': 17.0.10
dev: false
/@types/cors/2.8.12:
@ -4974,7 +4978,7 @@ packages:
engines: {node: '>=10'}
dependencies:
globby: 11.0.4
graceful-fs: 4.2.8
graceful-fs: 4.2.10
is-glob: 4.0.3
is-path-cwd: 2.2.0
is-path-inside: 3.0.3
@ -5304,7 +5308,7 @@ packages:
resolution: {integrity: sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA==}
engines: {node: '>=10.13.0'}
dependencies:
graceful-fs: 4.2.8
graceful-fs: 4.2.10
tapable: 2.2.1
dev: false
@ -6323,7 +6327,7 @@ packages:
resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==}
engines: {node: '>=6 <7 || >=8'}
dependencies:
graceful-fs: 4.2.8
graceful-fs: 4.2.10
jsonfile: 4.0.0
universalify: 0.1.2
dev: false
@ -7480,7 +7484,7 @@ packages:
ci-info: 3.3.0
deepmerge: 4.2.2
glob: 7.2.0
graceful-fs: 4.2.8
graceful-fs: 4.2.10
jest-circus: 27.5.1
jest-environment-jsdom: 27.5.1
jest-environment-node: 27.5.1
@ -7802,7 +7806,7 @@ packages:
'@jest/types': 27.4.2
'@types/stack-utils': 2.0.1
chalk: 4.1.2
graceful-fs: 4.2.8
graceful-fs: 4.2.10
micromatch: 4.0.4
pretty-format: 27.4.6
slash: 3.0.0
@ -7931,7 +7935,7 @@ packages:
dependencies:
'@jest/types': 27.4.2
chalk: 4.1.2
graceful-fs: 4.2.8
graceful-fs: 4.2.10
jest-haste-map: 27.5.1
jest-pnp-resolver: 1.2.2_jest-resolve@27.4.6
jest-util: 27.5.1
@ -8159,7 +8163,7 @@ packages:
babel-preset-current-node-syntax: 1.0.1_@babel+core@7.16.5
chalk: 4.1.2
expect: 27.5.1
graceful-fs: 4.2.8
graceful-fs: 4.2.10
jest-diff: 27.5.1
jest-get-type: 27.4.0
jest-haste-map: 27.5.1
@ -9871,7 +9875,7 @@ packages:
/proper-lockfile/4.1.2:
resolution: {integrity: sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==}
dependencies:
graceful-fs: 4.2.8
graceful-fs: 4.2.10
retry: 0.12.0
signal-exit: 3.0.6
dev: false
@ -10425,7 +10429,7 @@ packages:
resolution: {integrity: sha1-dB4kXiMfB8r7b98PEzrfohalAq0=}
dependencies:
es6-promise: 3.3.1
graceful-fs: 4.2.8
graceful-fs: 4.2.10
mkdirp: 0.5.5
rimraf: 2.7.1
dev: false
@ -12177,7 +12181,7 @@ packages:
engines: {node: '>=10.13.0'}
dependencies:
glob-to-regexp: 0.4.1
graceful-fs: 4.2.8
graceful-fs: 4.2.10
dev: false
/wbuf/1.7.3:
@ -13075,7 +13079,7 @@ packages:
dev: false
file:projects/client-resources.tgz_ac194b5590200ebf8338e0f86ec190f4:
resolution: {integrity: sha512-nwv9zNEGsaR1LmsITLutQfjyFbB/dVJSM99JtkUNhb8G7zdbGB+35MW8ROi2e0J47GZ1hB3XWnUvWUU4gXL8eA==, tarball: file:projects/client-resources.tgz}
resolution: {integrity: sha512-JuRnENm51wjubrmUPfbSGjyzbXh9OEkYwbKZT/MFQp3tPlLPNLTJQP4kqKNKr+LiFAWA5CNjPKSMb6VmUhiQwQ==, tarball: file:projects/client-resources.tgz}
id: file:projects/client-resources.tgz
name: '@rush-temp/client-resources'
version: 0.0.0
@ -13943,7 +13947,7 @@ packages:
dev: false
file:projects/model-all.tgz_typescript@4.5.4:
resolution: {integrity: sha512-oZv+eWtLk2+Ob4FSPKWX+er/NOIOsE11NvX98h9tVghc+fUgDjWpNiGXyXI7QT7gImg6BvM3QgwZFFO2y2JZig==, tarball: file:projects/model-all.tgz}
resolution: {integrity: sha512-us5oab1ZLRTtB5eKcSATpbe7fIoH9YWT5CHYi42M0Nhn/mLqh50pS1lf2kDkZuGHtolK/Q/G/FkTpZwJ1duDHQ==, tarball: file:projects/model-all.tgz}
id: file:projects/model-all.tgz
name: '@rush-temp/model-all'
version: 0.0.0
@ -14302,6 +14306,27 @@ packages:
- typescript
dev: false
file:projects/model-server-board.tgz_typescript@4.5.4:
resolution: {integrity: sha512-9Wh2M5ZVQTr3QV3Ll1Mj9zAzIV2T4tFj1jr0hK2K2fAEX2Aw/sYfnudX2G4lNPYt76xCrIo921IcoG9sGc3CqQ==, tarball: file:projects/model-server-board.tgz}
id: file:projects/model-server-board.tgz
name: '@rush-temp/model-server-board'
version: 0.0.0
dependencies:
'@rushstack/heft': 0.44.13
'@types/heft-jest': 1.0.2
'@typescript-eslint/eslint-plugin': 5.7.0_c25e8c1f4f4f7aaed27aa6f9ce042237
'@typescript-eslint/parser': 5.7.0_eslint@7.32.0+typescript@4.5.4
eslint: 7.32.0
eslint-config-standard-with-typescript: 21.0.1_ce2fa0c4dfa1c256100cababd749a13a
eslint-plugin-import: 2.25.3_eslint@7.32.0
eslint-plugin-node: 11.1.0_eslint@7.32.0
eslint-plugin-promise: 5.2.0_eslint@7.32.0
prettier: 2.5.1
transitivePeerDependencies:
- supports-color
- typescript
dev: false
file:projects/model-server-calendar.tgz_typescript@4.5.4:
resolution: {integrity: sha512-siQsflBb5rERBFO+Wu8SnrqdDtPSQZrAmIeQyzzrSVpLPNOL3JZ87YBuHJ/gqK/3RVtA1SZ17hJftMJH1gtdXQ==, tarball: file:projects/model-server-calendar.tgz}
id: file:projects/model-server-calendar.tgz
@ -15084,7 +15109,7 @@ packages:
dev: false
file:projects/prod-tracker.tgz_a07ec81d4d975778878ca12202ea119e:
resolution: {integrity: sha512-DegdZVFP21HUwqbhSqazxR2nu9OqSlJ8QxOn1S3IOD9AGi7H5OOSvw6E/RItOlGAts0bi261Z81Dgi9EJvTtvA==, tarball: file:projects/prod-tracker.tgz}
resolution: {integrity: sha512-CXoZBlh1kEQXQ96e8INaZnbze29VJjyeKkHGkepnOh6iuOHQR3/c1Q53kIw7f0rHXiPzjGSgFgBogAJq4vYFNw==, tarball: file:projects/prod-tracker.tgz}
id: file:projects/prod-tracker.tgz
name: '@rush-temp/prod-tracker'
version: 0.0.0
@ -15130,7 +15155,7 @@ packages:
dev: false
file:projects/prod.tgz_a07ec81d4d975778878ca12202ea119e:
resolution: {integrity: sha512-WaWihWZzBZ9WDVbJtB+fFusKyv8pR4hbBAZGkpcZ0yiOQL4tL5R0ZFsh0TxDy1TD68XKFqF2FnM3ngNQQr8bKA==, tarball: file:projects/prod.tgz}
resolution: {integrity: sha512-+xxBB7gdcbI1Fgjt8KUwFHzgtyDJHlXDdivDghTuT0SPUYQ758ZxlvFr4aXJAjzFRSuir1dtBbwzlFhvl5ml5w==, tarball: file:projects/prod.tgz}
id: file:projects/prod.tgz
name: '@rush-temp/prod'
version: 0.0.0
@ -15345,6 +15370,47 @@ packages:
- supports-color
dev: false
file:projects/server-board-resources.tgz:
resolution: {integrity: sha512-40wcvMBRSSXcRc/GN/sjOYx7CcneCcFUp9BrieLQAjOOa34/RmuwnlBkxGmSr1t4bwwLcB1rX9mI+hYURm2v4w==, tarball: file:projects/server-board-resources.tgz}
name: '@rush-temp/server-board-resources'
version: 0.0.0
dependencies:
'@rushstack/heft': 0.44.13
'@types/heft-jest': 1.0.2
'@typescript-eslint/eslint-plugin': 5.7.0_c25e8c1f4f4f7aaed27aa6f9ce042237
'@typescript-eslint/parser': 5.7.0_eslint@7.32.0+typescript@4.5.4
eslint: 7.32.0
eslint-config-standard-with-typescript: 21.0.1_ce2fa0c4dfa1c256100cababd749a13a
eslint-plugin-import: 2.25.3_eslint@7.32.0
eslint-plugin-node: 11.1.0_eslint@7.32.0
eslint-plugin-promise: 5.2.0_eslint@7.32.0
prettier: 2.5.1
typescript: 4.5.4
transitivePeerDependencies:
- supports-color
dev: false
file:projects/server-board.tgz:
resolution: {integrity: sha512-3SiZfjze5LDrZ+l9DfK85TL+e4RAHPddnSAwy9RomjxrHZ64zIO6wcQEeI30E+obQtlFAzGEkSyFKXcvWscR5w==, tarball: file:projects/server-board.tgz}
name: '@rush-temp/server-board'
version: 0.0.0
dependencies:
'@rushstack/heft': 0.44.13
'@types/heft-jest': 1.0.2
'@types/node': 16.11.14
'@typescript-eslint/eslint-plugin': 5.7.0_c25e8c1f4f4f7aaed27aa6f9ce042237
'@typescript-eslint/parser': 5.7.0_eslint@7.32.0+typescript@4.5.4
eslint: 7.32.0
eslint-config-standard-with-typescript: 21.0.1_ce2fa0c4dfa1c256100cababd749a13a
eslint-plugin-import: 2.25.3_eslint@7.32.0
eslint-plugin-node: 11.1.0_eslint@7.32.0
eslint-plugin-promise: 5.2.0_eslint@7.32.0
prettier: 2.5.1
typescript: 4.5.4
transitivePeerDependencies:
- supports-color
dev: false
file:projects/server-calendar-resources.tgz:
resolution: {integrity: sha512-mn4H33JaWwXKx3lLx354s0XBD2Py4K8CXnmg7qRyndQvBYYckws2z2abNmtW3Vwb9oLWxmZ9EVaWs3zym1JQSA==, tarball: file:projects/server-calendar-resources.tgz}
name: '@rush-temp/server-calendar-resources'
@ -15961,7 +16027,7 @@ packages:
dev: false
file:projects/server.tgz:
resolution: {integrity: sha512-QGkRW1mGSE2Ea5tck0CmcMaaPKIW75KM4EelumP9j4JU/cw74rvB4EFYExoVZo4vSlH/vpmKLy/ArHswa1uqYg==, tarball: file:projects/server.tgz}
resolution: {integrity: sha512-7bMozTdtookHF/N7rxCajviO/2OFCWfqNKgNe45uZJh+gf2n0q0dqatG91GP7690/eMFVoRmFU/laEr6Tf8oTg==, tarball: file:projects/server.tgz}
name: '@rush-temp/server'
version: 0.0.0
dependencies:
@ -16480,7 +16546,7 @@ packages:
dev: false
file:projects/tool.tgz:
resolution: {integrity: sha512-dpLTm3pciJoonDmNZIn9//Y3flBEkwWX0fsDcuUZd2uxvCRynA7sdA0x8ax74iIeHe/ucShMia+kXmUEQD1bNQ==, tarball: file:projects/tool.tgz}
resolution: {integrity: sha512-SVQmUfFM7cJwp/KuOZ522wyXyYYMe2YzFIYrHu5S1S8z2btbBAZzP1nH1gkU1GC5Vh8LVrL9NIhw6jTHWoJylA==, tarball: file:projects/tool.tgz}
name: '@rush-temp/tool'
version: 0.0.0
dependencies:

View File

@ -93,6 +93,8 @@
"@anticrm/inventory-resources": "~0.6.0",
"@anticrm/server-attachment": "~0.6.1",
"@anticrm/server-attachment-resources": "~0.6.0",
"@anticrm/server-board": "~0.6.0",
"@anticrm/server-board-resources": "~0.6.0",
"@anticrm/server-contact": "~0.6.1",
"@anticrm/server-contact-resources": "~0.6.0",
"@anticrm/server-notification": "~0.6.0",

View File

@ -18,6 +18,7 @@ import { addLocation } from '@anticrm/platform'
import login from '@anticrm/login'
import { clientId } from '@anticrm/client'
import { serverAttachmentId } from '@anticrm/server-attachment'
import { serverBoardId } from '@anticrm/server-board'
import { serverContactId } from '@anticrm/server-contact'
import { serverNotificationId } from '@anticrm/server-notification'
import { serverSettingId } from '@anticrm/server-setting'
@ -44,6 +45,7 @@ export function configurePlatformDev() {
addLocation(clientId, () => import(/* webpackChunkName: "client-dev" */ '@anticrm/dev-client-resources'))
addLocation(serverAttachmentId, () => import(/* webpackChunkName: "server-attachment" */ '@anticrm/server-attachment-resources'))
addLocation(serverBoardId, () => import(/* webpackChunkName: "server-board" */ '@anticrm/server-board-resources'))
addLocation(serverContactId, () => import(/* webpackChunkName: "server-contact" */ '@anticrm/server-contact-resources'))
addLocation(serverNotificationId, () => import(/* webpackChunkName: "server-notification" */ '@anticrm/server-notification-resources'))
addLocation(serverSettingId, () => import(/* webpackChunkName: "server-setting" */ '@anticrm/server-setting-resources'))

View File

@ -67,6 +67,8 @@
"@anticrm/dev-storage": "~0.6.6",
"@anticrm/server-attachment": "~0.6.1",
"@anticrm/server-attachment-resources": "~0.6.0",
"@anticrm/server-board": "~0.6.0",
"@anticrm/server-board-resources": "~0.6.0",
"xml2js": "~0.4.23",
"@anticrm/model-recruit": "~0.6.0",
"@anticrm/recruit": "~0.6.3",

View File

@ -39,6 +39,7 @@ import { DOMAIN_ATTACHMENT } from '@anticrm/model-attachment'
import { createMongoAdapter, createMongoTxAdapter } from '@anticrm/mongo'
import { addLocation } from '@anticrm/platform'
import { serverAttachmentId } from '@anticrm/server-attachment'
import { serverBoardId } from '@anticrm/server-board'
import { serverCalendarId } from '@anticrm/server-calendar'
import { serverChunterId } from '@anticrm/server-chunter'
import { serverContactId } from '@anticrm/server-contact'
@ -115,6 +116,7 @@ export class ElasticTool {
constructor (readonly mongoUrl: string, readonly dbName: string, readonly minio: Client, readonly elasticUrl: string) {
addLocation(serverAttachmentId, () => import('@anticrm/server-attachment-resources'))
addLocation(serverBoardId, () => import('@anticrm/server-board-resources'))
addLocation(serverContactId, () => import('@anticrm/server-contact-resources'))
addLocation(serverNotificationId, () => import('@anticrm/server-notification-resources'))
addLocation(serverChunterId, () => import('@anticrm/server-chunter-resources'))

View File

@ -44,6 +44,7 @@
"@anticrm/model-demo": "~0.6.0",
"@anticrm/model-server-core": "~0.6.0",
"@anticrm/model-server-attachment": "~0.6.0",
"@anticrm/model-server-board": "~0.6.0",
"@anticrm/model-server-contact": "~0.6.0",
"@anticrm/model-server-notification": "~0.6.0",
"@anticrm/model-server-setting": "~0.6.0",

View File

@ -28,6 +28,7 @@ import { createModel as leadModel } from '@anticrm/model-lead'
import { createModel as presentationModel } from '@anticrm/model-presentation'
import { createModel as recruitModel } from '@anticrm/model-recruit'
import { createModel as serverAttachmentModel } from '@anticrm/model-server-attachment'
import { createModel as serverBoardModel } from '@anticrm/model-server-board'
import { createModel as serverContactModel } from '@anticrm/model-server-contact'
import { createModel as serverNotificationModel } from '@anticrm/model-server-notification'
import { createModel as serverChunterModel } from '@anticrm/model-server-chunter'
@ -84,6 +85,7 @@ const builders: [(b: Builder) => void, string][] = [
[serverCoreModel, 'server-core'],
[serverAttachmentModel, 'server-attachment'],
[serverBoardModel, 'server-board'],
[serverContactModel, 'server-contact'],
[serverNotificationModel, 'server-notification'],
[serveSettingModel, 'server-setting'],

View File

@ -0,0 +1,7 @@
module.exports = {
extends: ['./node_modules/@anticrm/model-rig/profiles/default/config/eslint.config.json'],
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json'
}
}

View File

@ -0,0 +1,4 @@
*
!/lib/**
!CHANGELOG.md
/lib/**/__tests__/

View File

@ -0,0 +1,18 @@
// The "rig.json" file directs tools to look for their config files in an external package.
// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
{
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
/**
* (Required) The name of the rig package to inherit from.
* It should be an NPM package name with the "-rig" suffix.
*/
"rigPackageName": "@anticrm/model-rig"
/**
* (Optional) Selects a config profile from the rig package. The name must consist of
* lowercase alphanumeric words separated by hyphens, for example "sample-profile".
* If omitted, then the "default" profile will be used."
*/
// "rigProfile": "your-profile-name"
}

View File

@ -0,0 +1,34 @@
{
"name": "@anticrm/model-server-board",
"version": "0.6.0",
"main": "lib/index.js",
"author": "Anticrm Platform Contributors",
"license": "EPL-2.0",
"scripts": {
"build": "heft build",
"build:watch": "tsc",
"lint:fix": "eslint --fix src",
"lint": "eslint src",
"format": "prettier --write src && eslint --fix src"
},
"devDependencies": {
"@anticrm/model-rig": "~0.6.0",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-promise": "^5.1.1",
"eslint-plugin-node": "^11.1.0",
"eslint": "^7.32.0",
"@types/heft-jest": "^1.0.2",
"@typescript-eslint/parser": "^5.4.0",
"eslint-config-standard-with-typescript": "^21.0.1",
"prettier": "^2.4.1",
"@rushstack/heft": "^0.44.13"
},
"dependencies": {
"@anticrm/core": "~0.6.16",
"@anticrm/model": "~0.6.0",
"@anticrm/platform": "~0.6.5",
"@anticrm/server-board": "~0.6.0",
"@anticrm/server-core": "~0.6.1"
}
}

View File

@ -0,0 +1,26 @@
//
// Copyright © 2022 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
import { Builder } from '@anticrm/model'
import serverCore from '@anticrm/server-core'
import core from '@anticrm/core'
import serverBoard from '@anticrm/server-board'
export function createModel (builder: Builder): void {
builder.createDoc(serverCore.class.Trigger, core.space.Model, {
trigger: serverBoard.trigger.OnLabelDelete
})
}

View File

@ -0,0 +1,8 @@
{
"extends": "./node_modules/@anticrm/model-rig/profiles/default/tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./lib",
}
}

View File

@ -86,6 +86,8 @@
"@anticrm/image-cropper-resources": "~0.6.0",
"@anticrm/server-attachment": "~0.6.1",
"@anticrm/server-attachment-resources": "~0.6.0",
"@anticrm/server-board": "~0.6.0",
"@anticrm/server-board-resources": "~0.6.0",
"@anticrm/server-contact": "~0.6.1",
"@anticrm/server-contact-resources": "~0.6.0",
"@anticrm/server-notification": "~0.6.0",

View File

@ -18,6 +18,7 @@ import { addLocation } from '@anticrm/platform'
import login from '@anticrm/login'
import { clientId } from '@anticrm/client'
import { serverAttachmentId } from '@anticrm/server-attachment'
import { serverBoardId } from '@anticrm/server-board'
import { serverContactId } from '@anticrm/server-contact'
import { serverNotificationId } from '@anticrm/server-notification'
import { serverSettingId } from '@anticrm/server-setting'
@ -40,6 +41,7 @@ export function configurePlatformDev() {
addLocation(clientId, () => import(/* webpackChunkName: "client-dev" */ '@anticrm/dev-client-resources'))
addLocation(serverAttachmentId, () => import(/* webpackChunkName: "server-attachment" */ '@anticrm/server-attachment-resources'))
addLocation(serverBoardId, () => import(/* webpackChunkName: "server-attachment" */ '@anticrm/server-board-resources'))
addLocation(serverContactId, () => import(/* webpackChunkName: "server-contact" */ '@anticrm/server-contact-resources'))
addLocation(serverNotificationId, () => import(/* webpackChunkName: "server-notification" */ '@anticrm/server-notification-resources'))
addLocation(serverSettingId, () => import(/* webpackChunkName: "server-setting" */ '@anticrm/server-setting-resources'))

View File

@ -1258,6 +1258,21 @@
"projectFolder": "models/board",
"shouldPublish": true
},
{
"packageName": "@anticrm/server-board",
"projectFolder": "server-plugins/board",
"shouldPublish": true
},
{
"packageName": "@anticrm/model-server-board",
"projectFolder": "models/server-board",
"shouldPublish": true
},
{
"packageName": "@anticrm/server-board-resources",
"projectFolder": "server-plugins/board-resources",
"shouldPublish": true
},
{
"packageName": "@anticrm/kanban",
"projectFolder": "packages/kanban",

View File

@ -0,0 +1,7 @@
module.exports = {
extends: ['./node_modules/@anticrm/platform-rig/profiles/default/config/eslint.config.json'],
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json'
}
}

View File

@ -0,0 +1,4 @@
*
!/lib/**
!CHANGELOG.md
/lib/**/__tests__/

View File

@ -0,0 +1,18 @@
// The "rig.json" file directs tools to look for their config files in an external package.
// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
{
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
/**
* (Required) The name of the rig package to inherit from.
* It should be an NPM package name with the "-rig" suffix.
*/
"rigPackageName": "@anticrm/platform-rig"
/**
* (Optional) Selects a config profile from the rig package. The name must consist of
* lowercase alphanumeric words separated by hyphens, for example "sample-profile".
* If omitted, then the "default" profile will be used."
*/
// "rigProfile": "your-profile-name"
}

View File

@ -0,0 +1,34 @@
{
"name": "@anticrm/server-board-resources",
"version": "0.6.0",
"main": "lib/index.js",
"author": "Anticrm Platform Contributors",
"license": "EPL-2.0",
"scripts": {
"build": "heft build",
"build:watch": "tsc",
"lint:fix": "eslint --fix src",
"lint": "eslint src",
"format": "prettier --write src && eslint --fix src"
},
"devDependencies": {
"@anticrm/platform-rig": "~0.6.0",
"@types/heft-jest": "^1.0.2",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-promise": "^5.1.1",
"eslint-plugin-node": "^11.1.0",
"eslint": "^7.32.0",
"@typescript-eslint/parser": "^5.4.0",
"eslint-config-standard-with-typescript": "^21.0.1",
"prettier": "^2.4.1",
"@rushstack/heft": "^0.44.13",
"typescript": "^4.3.5"
},
"dependencies": {
"@anticrm/core": "~0.6.16",
"@anticrm/platform": "~0.6.5",
"@anticrm/server-core": "~0.6.1",
"@anticrm/board": "~0.6.0"
}
}

View File

@ -0,0 +1,55 @@
//
// Copyright © 2022 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
import type { Tx, TxCreateDoc, TxRemoveDoc } from '@anticrm/core'
import type { TriggerControl } from '@anticrm/server-core'
import type { Card, CardLabel } from '@anticrm/board'
import board from '@anticrm/board'
import core, { TxProcessor } from '@anticrm/core'
/**
* @public
*/
export async function OnLabelDelete (tx: Tx, { findAll, hierarchy, txFactory }: TriggerControl): Promise<Tx[]> {
if (tx._class !== core.class.TxRemoveDoc) {
return []
}
const rmTx = tx as TxRemoveDoc<CardLabel>
if (!hierarchy.isDerived(rmTx.objectClass, board.class.CardLabel)) {
return []
}
const createTx = (await findAll(core.class.TxCreateDoc, {
objectId: rmTx.objectId
}, { limit: 1 }))[0]
if (createTx === undefined) {
return []
}
const label = TxProcessor.createDoc2Doc(createTx as TxCreateDoc<CardLabel>)
const cards = await findAll<Card>(board.class.Card, { space: label.attachedTo as any, labels: label._id })
return cards.map(card =>
txFactory.createTxUpdateDoc<Card>(card._class, card.space, card._id,
{ $pull: { labels: label._id as any } }
))
}
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
export default async () => ({
trigger: {
OnLabelDelete
}
})

View File

@ -0,0 +1,8 @@
{
"extends": "./node_modules/@anticrm/platform-rig/profiles/default/tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./lib"
}
}

View File

@ -0,0 +1,7 @@
module.exports = {
extends: ['./node_modules/@anticrm/platform-rig/profiles/default/config/eslint.config.json'],
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json'
}
}

View File

@ -0,0 +1,4 @@
*
!/lib/**
!CHANGELOG.md
/lib/**/__tests__/

View File

@ -0,0 +1,18 @@
// The "rig.json" file directs tools to look for their config files in an external package.
// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
{
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
/**
* (Required) The name of the rig package to inherit from.
* It should be an NPM package name with the "-rig" suffix.
*/
"rigPackageName": "@anticrm/platform-rig"
/**
* (Optional) Selects a config profile from the rig package. The name must consist of
* lowercase alphanumeric words separated by hyphens, for example "sample-profile".
* If omitted, then the "default" profile will be used."
*/
// "rigProfile": "your-profile-name"
}

View File

@ -0,0 +1,34 @@
{
"name": "@anticrm/server-board",
"version": "0.6.0",
"main": "lib/index.js",
"author": "Anticrm Platform Contributors",
"license": "EPL-2.0",
"scripts": {
"build": "heft build",
"build:watch": "tsc",
"lint:fix": "eslint --fix src",
"lint": "eslint src",
"format": "prettier --write src && eslint --fix src"
},
"devDependencies": {
"@anticrm/platform-rig": "~0.6.0",
"@types/heft-jest": "^1.0.2",
"@types/node": "~16.11.12",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-promise": "^5.1.1",
"eslint-plugin-node": "^11.1.0",
"eslint": "^7.32.0",
"@typescript-eslint/parser": "^5.4.0",
"eslint-config-standard-with-typescript": "^21.0.1",
"prettier": "^2.4.1",
"@rushstack/heft": "^0.44.13",
"typescript": "^4.3.5"
},
"dependencies": {
"@anticrm/core": "~0.6.16",
"@anticrm/platform": "~0.6.5",
"@anticrm/server-core": "~0.6.1"
}
}

View File

@ -0,0 +1,32 @@
//
// Copyright © 2022 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
import type { Resource, Plugin } from '@anticrm/platform'
import { plugin } from '@anticrm/platform'
import type { TriggerFunc } from '@anticrm/server-core'
/**
* @public
*/
export const serverBoardId = 'server-board' as Plugin
/**
* @public
*/
export default plugin(serverBoardId, {
trigger: {
OnLabelDelete: '' as Resource<TriggerFunc>
}
})

View File

@ -0,0 +1,9 @@
{
"extends": "./node_modules/@anticrm/platform-rig/profiles/default/tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./lib",
"esModuleInterop": true
}
}

View File

@ -43,6 +43,8 @@
"@anticrm/server-ws": "~0.6.11",
"@anticrm/server-attachment": "~0.6.1",
"@anticrm/server-attachment-resources": "~0.6.0",
"@anticrm/server-board": "~0.6.0",
"@anticrm/server-board-resources": "~0.6.0",
"@anticrm/mongo": "~0.6.1",
"@anticrm/elastic": "~0.6.0",
"elastic-apm-node": "~3.26.0",

View File

@ -32,6 +32,7 @@ import { PrivateMiddleware, ModifiedMiddleware } from '@anticrm/middleware'
import { createMongoAdapter, createMongoTxAdapter } from '@anticrm/mongo'
import { addLocation } from '@anticrm/platform'
import { serverAttachmentId } from '@anticrm/server-attachment'
import { serverBoardId } from '@anticrm/server-board'
import { serverCalendarId } from '@anticrm/server-calendar'
import { serverChunterId } from '@anticrm/server-chunter'
import { serverContactId } from '@anticrm/server-contact'
@ -90,6 +91,7 @@ export function start (
host?: string
): () => void {
addLocation(serverAttachmentId, () => import('@anticrm/server-attachment-resources'))
addLocation(serverBoardId, () => import('@anticrm/server-board-resources'))
addLocation(serverContactId, () => import('@anticrm/server-contact-resources'))
addLocation(serverNotificationId, () => import('@anticrm/server-notification-resources'))
addLocation(serverSettingId, () => import('@anticrm/server-setting-resources'))