From 7d452e2eb6d83ede285f425be2396ab9e99cb337 Mon Sep 17 00:00:00 2001 From: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com> Date: Mon, 28 Mar 2022 14:05:22 +0600 Subject: [PATCH] Remove attached docs without collections (#1209) Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com> --- common/config/rush/pnpm-lock.yaml | 214 +++++++++++++++++- dev/prod/package.json | 8 +- dev/prod/src/platform-dev.ts | 7 + dev/tool/package.json | 6 + dev/tool/src/elastic.ts | 6 + models/all/package.json | 5 +- models/all/src/index.ts | 6 + models/server-calendar/.eslintrc.js | 7 + models/server-calendar/.npmignore | 4 + models/server-calendar/config/rig.json | 18 ++ models/server-calendar/package.json | 34 +++ models/server-calendar/src/index.ts | 26 +++ models/server-calendar/tsconfig.json | 8 + models/server-gmail/.eslintrc.js | 7 + models/server-gmail/.npmignore | 4 + models/server-gmail/config/rig.json | 18 ++ models/server-gmail/package.json | 35 +++ models/server-gmail/src/index.ts | 27 +++ models/server-gmail/tsconfig.json | 8 + models/server-telegram/.eslintrc.js | 7 + models/server-telegram/.npmignore | 4 + models/server-telegram/config/rig.json | 18 ++ models/server-telegram/package.json | 35 +++ models/server-telegram/src/index.ts | 27 +++ models/server-telegram/tsconfig.json | 8 + rush.json | 45 ++++ .../calendar-resources/.eslintrc.js | 7 + server-plugins/calendar-resources/.npmignore | 4 + .../calendar-resources/config/rig.json | 18 ++ .../calendar-resources/package.json | 32 +++ .../calendar-resources/src/index.ts | 32 +++ .../calendar-resources/tsconfig.json | 8 + server-plugins/calendar/.eslintrc.js | 7 + server-plugins/calendar/.npmignore | 4 + server-plugins/calendar/config/rig.json | 18 ++ server-plugins/calendar/package.json | 33 +++ server-plugins/calendar/src/index.ts | 33 +++ server-plugins/calendar/tsconfig.json | 9 + server-plugins/gmail-resources/.eslintrc.js | 7 + server-plugins/gmail-resources/.npmignore | 4 + .../gmail-resources/config/rig.json | 18 ++ server-plugins/gmail-resources/package.json | 35 +++ server-plugins/gmail-resources/src/index.ts | 38 ++++ server-plugins/gmail-resources/tsconfig.json | 8 + server-plugins/gmail/.eslintrc.js | 7 + server-plugins/gmail/.npmignore | 4 + server-plugins/gmail/config/rig.json | 18 ++ server-plugins/gmail/package.json | 33 +++ server-plugins/gmail/src/index.ts | 33 +++ server-plugins/gmail/tsconfig.json | 9 + .../telegram-resources/.eslintrc.js | 7 + server-plugins/telegram-resources/.npmignore | 4 + .../telegram-resources/config/rig.json | 18 ++ .../telegram-resources/package.json | 35 +++ .../telegram-resources/src/index.ts | 38 ++++ .../telegram-resources/tsconfig.json | 8 + server-plugins/telegram/.eslintrc.js | 7 + server-plugins/telegram/.npmignore | 4 + server-plugins/telegram/config/rig.json | 18 ++ server-plugins/telegram/package.json | 33 +++ server-plugins/telegram/src/index.ts | 33 +++ server-plugins/telegram/tsconfig.json | 9 + server/server/package.json | 6 + server/server/src/server.ts | 6 + 64 files changed, 1230 insertions(+), 7 deletions(-) create mode 100644 models/server-calendar/.eslintrc.js create mode 100644 models/server-calendar/.npmignore create mode 100644 models/server-calendar/config/rig.json create mode 100644 models/server-calendar/package.json create mode 100644 models/server-calendar/src/index.ts create mode 100644 models/server-calendar/tsconfig.json create mode 100644 models/server-gmail/.eslintrc.js create mode 100644 models/server-gmail/.npmignore create mode 100644 models/server-gmail/config/rig.json create mode 100644 models/server-gmail/package.json create mode 100644 models/server-gmail/src/index.ts create mode 100644 models/server-gmail/tsconfig.json create mode 100644 models/server-telegram/.eslintrc.js create mode 100644 models/server-telegram/.npmignore create mode 100644 models/server-telegram/config/rig.json create mode 100644 models/server-telegram/package.json create mode 100644 models/server-telegram/src/index.ts create mode 100644 models/server-telegram/tsconfig.json create mode 100644 server-plugins/calendar-resources/.eslintrc.js create mode 100644 server-plugins/calendar-resources/.npmignore create mode 100644 server-plugins/calendar-resources/config/rig.json create mode 100644 server-plugins/calendar-resources/package.json create mode 100644 server-plugins/calendar-resources/src/index.ts create mode 100644 server-plugins/calendar-resources/tsconfig.json create mode 100644 server-plugins/calendar/.eslintrc.js create mode 100644 server-plugins/calendar/.npmignore create mode 100644 server-plugins/calendar/config/rig.json create mode 100644 server-plugins/calendar/package.json create mode 100644 server-plugins/calendar/src/index.ts create mode 100644 server-plugins/calendar/tsconfig.json create mode 100644 server-plugins/gmail-resources/.eslintrc.js create mode 100644 server-plugins/gmail-resources/.npmignore create mode 100644 server-plugins/gmail-resources/config/rig.json create mode 100644 server-plugins/gmail-resources/package.json create mode 100644 server-plugins/gmail-resources/src/index.ts create mode 100644 server-plugins/gmail-resources/tsconfig.json create mode 100644 server-plugins/gmail/.eslintrc.js create mode 100644 server-plugins/gmail/.npmignore create mode 100644 server-plugins/gmail/config/rig.json create mode 100644 server-plugins/gmail/package.json create mode 100644 server-plugins/gmail/src/index.ts create mode 100644 server-plugins/gmail/tsconfig.json create mode 100644 server-plugins/telegram-resources/.eslintrc.js create mode 100644 server-plugins/telegram-resources/.npmignore create mode 100644 server-plugins/telegram-resources/config/rig.json create mode 100644 server-plugins/telegram-resources/package.json create mode 100644 server-plugins/telegram-resources/src/index.ts create mode 100644 server-plugins/telegram-resources/tsconfig.json create mode 100644 server-plugins/telegram/.eslintrc.js create mode 100644 server-plugins/telegram/.npmignore create mode 100644 server-plugins/telegram/config/rig.json create mode 100644 server-plugins/telegram/package.json create mode 100644 server-plugins/telegram/src/index.ts create mode 100644 server-plugins/telegram/tsconfig.json diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 9e38179ee3..93da8536ab 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -66,9 +66,11 @@ 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-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 '@rush-temp/model-server-core': file:./projects/model-server-core.tgz + '@rush-temp/model-server-gmail': file:./projects/model-server-gmail.tgz '@rush-temp/model-server-inventory': file:./projects/model-server-inventory.tgz '@rush-temp/model-server-lead': file:./projects/model-server-lead.tgz '@rush-temp/model-server-notification': file:./projects/model-server-notification.tgz @@ -76,6 +78,7 @@ specifiers: '@rush-temp/model-server-setting': file:./projects/model-server-setting.tgz '@rush-temp/model-server-tags': file:./projects/model-server-tags.tgz '@rush-temp/model-server-task': file:./projects/model-server-task.tgz + '@rush-temp/model-server-telegram': file:./projects/model-server-telegram.tgz '@rush-temp/model-setting': file:./projects/model-setting.tgz '@rush-temp/model-tags': file:./projects/model-tags.tgz '@rush-temp/model-task': file:./projects/model-task.tgz @@ -102,11 +105,15 @@ 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-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 '@rush-temp/server-chunter-resources': file:./projects/server-chunter-resources.tgz '@rush-temp/server-contact': file:./projects/server-contact.tgz '@rush-temp/server-contact-resources': file:./projects/server-contact-resources.tgz '@rush-temp/server-core': file:./projects/server-core.tgz + '@rush-temp/server-gmail': file:./projects/server-gmail.tgz + '@rush-temp/server-gmail-resources': file:./projects/server-gmail-resources.tgz '@rush-temp/server-inventory': file:./projects/server-inventory.tgz '@rush-temp/server-inventory-resources': file:./projects/server-inventory-resources.tgz '@rush-temp/server-lead': file:./projects/server-lead.tgz @@ -121,6 +128,8 @@ specifiers: '@rush-temp/server-tags-resources': file:./projects/server-tags-resources.tgz '@rush-temp/server-task': file:./projects/server-task.tgz '@rush-temp/server-task-resources': file:./projects/server-task-resources.tgz + '@rush-temp/server-telegram': file:./projects/server-telegram.tgz + '@rush-temp/server-telegram-resources': file:./projects/server-telegram-resources.tgz '@rush-temp/server-token': file:./projects/server-token.tgz '@rush-temp/server-tool': file:./projects/server-tool.tgz '@rush-temp/server-ws': file:./projects/server-ws.tgz @@ -316,9 +325,11 @@ 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-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 '@rush-temp/model-server-core': file:projects/model-server-core.tgz_typescript@4.5.4 + '@rush-temp/model-server-gmail': file:projects/model-server-gmail.tgz_typescript@4.5.4 '@rush-temp/model-server-inventory': file:projects/model-server-inventory.tgz_typescript@4.5.4 '@rush-temp/model-server-lead': file:projects/model-server-lead.tgz_typescript@4.5.4 '@rush-temp/model-server-notification': file:projects/model-server-notification.tgz_typescript@4.5.4 @@ -326,6 +337,7 @@ dependencies: '@rush-temp/model-server-setting': file:projects/model-server-setting.tgz_typescript@4.5.4 '@rush-temp/model-server-tags': file:projects/model-server-tags.tgz_typescript@4.5.4 '@rush-temp/model-server-task': file:projects/model-server-task.tgz_typescript@4.5.4 + '@rush-temp/model-server-telegram': file:projects/model-server-telegram.tgz_typescript@4.5.4 '@rush-temp/model-setting': file:projects/model-setting.tgz_typescript@4.5.4 '@rush-temp/model-tags': file:projects/model-tags.tgz_typescript@4.5.4 '@rush-temp/model-task': file:projects/model-task.tgz_typescript@4.5.4 @@ -352,11 +364,15 @@ 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-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 '@rush-temp/server-chunter-resources': file:projects/server-chunter-resources.tgz '@rush-temp/server-contact': file:projects/server-contact.tgz '@rush-temp/server-contact-resources': file:projects/server-contact-resources.tgz '@rush-temp/server-core': file:projects/server-core.tgz + '@rush-temp/server-gmail': file:projects/server-gmail.tgz + '@rush-temp/server-gmail-resources': file:projects/server-gmail-resources.tgz '@rush-temp/server-inventory': file:projects/server-inventory.tgz '@rush-temp/server-inventory-resources': file:projects/server-inventory-resources.tgz '@rush-temp/server-lead': file:projects/server-lead.tgz @@ -371,6 +387,8 @@ dependencies: '@rush-temp/server-tags-resources': file:projects/server-tags-resources.tgz '@rush-temp/server-task': file:projects/server-task.tgz '@rush-temp/server-task-resources': file:projects/server-task-resources.tgz + '@rush-temp/server-telegram': file:projects/server-telegram.tgz + '@rush-temp/server-telegram-resources': file:projects/server-telegram-resources.tgz '@rush-temp/server-token': file:projects/server-token.tgz '@rush-temp/server-tool': file:projects/server-tool.tgz '@rush-temp/server-ws': file:projects/server-ws.tgz @@ -11516,7 +11534,7 @@ packages: dev: false file:projects/calendar.tgz: - resolution: {integrity: sha512-mN4GfaHpyGzuLV59eFw3c3R6p2r4ewEumsIhzyifgeXaXSD9Bnm06LG5LvFgF5G5TmDquUFcIq88w3Zzd20cQA==, tarball: file:projects/calendar.tgz} + resolution: {integrity: sha512-9rHPaxAA6s/VdO6ISsgKu0CcJcQg+fi3mYeU0C9K227tlswa5MLvgeh7+LvMW0ZO1z8rsaJSaMqOeJraQoR1jA==, tarball: file:projects/calendar.tgz} name: '@rush-temp/calendar' version: 0.0.0 dependencies: @@ -12468,7 +12486,7 @@ packages: dev: false file:projects/model-calendar.tgz_typescript@4.5.4: - resolution: {integrity: sha512-sI97CjbxdgK1qWGDrBViWm65NY+vwFzt1s94cGheRJP8CL/GqJNuaSyrJv0pqjfZgK6Z3IkcUq2ZUSSHwD+1gQ==, tarball: file:projects/model-calendar.tgz} + resolution: {integrity: sha512-1WD+gs/bHwfYdQWeuSL9DSwEZ6eGXJZQ5uIUdwQJMr8OUsKFTzIjou8X81QC5jd2LUR/c+Gdl2zbVVeOxXDflg==, tarball: file:projects/model-calendar.tgz} id: file:projects/model-calendar.tgz name: '@rush-temp/model-calendar' version: 0.0.0 @@ -12739,6 +12757,27 @@ packages: - typescript dev: false + file:projects/model-server-calendar.tgz_typescript@4.5.4: + resolution: {integrity: sha512-eZ6nF9bh3bKDYEvmufnD+/PfpXvVa7aKDx9KAPCeJjsHRVTkNsLJ8efGQzMeAU6KS/E++srSJwofrt4c62XnEg==, tarball: file:projects/model-server-calendar.tgz} + id: file:projects/model-server-calendar.tgz + name: '@rush-temp/model-server-calendar' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.41.8 + '@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-chunter.tgz_typescript@4.5.4: resolution: {integrity: sha512-q436fjz1U5/qOQWpdTxTz6zyODXWomGlzev0xiUJlq/sRLLhWJ3Dpl+yimq9KiXE/hBRjMVEOaIczoxf0mmtsw==, tarball: file:projects/model-server-chunter.tgz} id: file:projects/model-server-chunter.tgz @@ -12802,6 +12841,27 @@ packages: - typescript dev: false + file:projects/model-server-gmail.tgz_typescript@4.5.4: + resolution: {integrity: sha512-WdyhnyIucDdky15T5OQiTNpmd3Gx1TMQsNWs+Clv/MMMKL6AUzXpg91pPqQchJaLCPot2ayuNF0Pd8LblfnHdQ==, tarball: file:projects/model-server-gmail.tgz} + id: file:projects/model-server-gmail.tgz + name: '@rush-temp/model-server-gmail' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.41.8 + '@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-inventory.tgz_typescript@4.5.4: resolution: {integrity: sha512-X15P+dsGbNPR0s2x4cPRiZZ2FBaJHQ4kp6nJB/X0jt8xBx4KcU+JIieMLjEKCMQGkc9ne8CctbTKeBOMB7HEyw==, tarball: file:projects/model-server-inventory.tgz} id: file:projects/model-server-inventory.tgz @@ -12949,6 +13009,27 @@ packages: - typescript dev: false + file:projects/model-server-telegram.tgz_typescript@4.5.4: + resolution: {integrity: sha512-Y41l3LACfcZLw79y2QslzEVC+ZtMNS5CFeKr9eBAUh5w54ngOw9J+xihBgWORjX0Jh0/ESMx2RMWgI16U1V8Qg==, tarball: file:projects/model-server-telegram.tgz} + id: file:projects/model-server-telegram.tgz + name: '@rush-temp/model-server-telegram' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.41.8 + '@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-setting.tgz_typescript@4.5.4: resolution: {integrity: sha512-Wn36BFiTswK1XcYMl+EwqXYsxpypTRsu+1NB21LIisNmefROVCAuMu16xxcX6J2JbBcog0STXd5v9tQGAUUlvw==, tarball: file:projects/model-setting.tgz} id: file:projects/model-setting.tgz @@ -13243,7 +13324,7 @@ packages: dev: false file:projects/panel.tgz_096c09b0b673a57c275d9767a12070b1: - resolution: {integrity: sha512-59DljebpjOzUEcVvHo7/z2Pl/yTsKfO2yItAr1INXpdELlSTgiWGSZJG0Wcw/J9PcI+V3V3NJniUBv39jnykdg==, tarball: file:projects/panel.tgz} + resolution: {integrity: sha512-WkB6YLcwUZ2MFk6CCduxx3Pyx+g3JIwtLWVshJNcLIhmuIDeNQPN9FuflL2v60vQU41A6EaYr+DW56YygE0cuQ==, tarball: file:projects/panel.tgz} id: file:projects/panel.tgz name: '@rush-temp/panel' version: 0.0.0 @@ -13613,6 +13694,47 @@ packages: - supports-color dev: false + file:projects/server-calendar-resources.tgz: + resolution: {integrity: sha512-Bj1NxhHc9XB5eeg/YXOIzRes0hl8DcJx0/Hww9U+11FfiqSD/itwCglruOdqYTpp9+mtmBVqTn2vtME1bLeXWA==, tarball: file:projects/server-calendar-resources.tgz} + name: '@rush-temp/server-calendar-resources' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.41.8 + '@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-calendar.tgz: + resolution: {integrity: sha512-kDW5je0sq8HCnWty/IGYUf76M2l3wIXY6DizslrIm63Qj8dIiIKFCImqr/rpdY8UCaXmx0CLDc2GSbDhuRccXw==, tarball: file:projects/server-calendar.tgz} + name: '@rush-temp/server-calendar' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.41.8 + '@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-chunter-resources.tgz: resolution: {integrity: sha512-PuVidh0Zmun2S3g74Jj0qxT25EJCy5iE0+GOF/Dwqf7ndEnrhuo6e+xrsQDVADSAceKTLEIE4ikmb5NHAUdjXw==, tarball: file:projects/server-chunter-resources.tgz} name: '@rush-temp/server-chunter-resources' @@ -13719,6 +13841,47 @@ packages: - supports-color dev: false + file:projects/server-gmail-resources.tgz: + resolution: {integrity: sha512-FUyuD9w0lmt005H+gkp+RZZEAvM4Sb4s+FOAIRTPIT3Q8qu2T8oYWyZEzc5b5rrtulToVpFNJg1Gzmm9b7iDeg==, tarball: file:projects/server-gmail-resources.tgz} + name: '@rush-temp/server-gmail-resources' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.41.8 + '@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-gmail.tgz: + resolution: {integrity: sha512-fbSGo5g5Oj4P2Kx3WaFlK7VFitcjgi0eP/F9eQV4depiy16qscrIkEyZ8bjNPrQp/t3D5YGuM8fuDRF5CobU8g==, tarball: file:projects/server-gmail.tgz} + name: '@rush-temp/server-gmail' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.41.8 + '@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-inventory-resources.tgz: resolution: {integrity: sha512-sjdIccJzEDBaG+xhXk+s/B2IyWmuwQSDJCEQgcJe6IR66i6T2V9CTrcWLIZydAM5y4owNfzfc26oRO7KTMQ/lA==, tarball: file:projects/server-inventory-resources.tgz} name: '@rush-temp/server-inventory-resources' @@ -14006,6 +14169,47 @@ packages: - supports-color dev: false + file:projects/server-telegram-resources.tgz: + resolution: {integrity: sha512-IubqEDUrunYEfukzK6rPbAM8g0pfa9XrKkmPcfJkkXyTAoauERRYARIu3VO6BRfFJkF3DMbhkVpll0XIF/KCCA==, tarball: file:projects/server-telegram-resources.tgz} + name: '@rush-temp/server-telegram-resources' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.41.8 + '@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-telegram.tgz: + resolution: {integrity: sha512-3P5vaKSqx1AiQlRPibVWTeSdzB5RcdgKYRwUnYBpSM5lL5F+OYit8lrn/seMB7JI2sxnP9/upv7N8D4OEvQXmg==, tarball: file:projects/server-telegram.tgz} + name: '@rush-temp/server-telegram' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.41.8 + '@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-token.tgz: resolution: {integrity: sha512-IJbcJsJ0J+hUzEqSYDNfJfsfpvlHudLdAlMy7QFvzKgQiUoQLS7jJTrJVA8E2Dkr01kubQcS0ecHdCyhWMpQ6w==, tarball: file:projects/server-token.tgz} name: '@rush-temp/server-token' @@ -14291,7 +14495,7 @@ packages: dev: false file:projects/task-resources.tgz_6cae74ea501386c76c405ad0408e0339: - resolution: {integrity: sha512-UQiTYBFwDg7uwRpDwbEg6/e8VUalyDWw1q3o3i7w01fzjUd/R9QJn1NQKAoEh7Va49IjgahixNssz+wmu5Ukcg==, tarball: file:projects/task-resources.tgz} + resolution: {integrity: sha512-B2dPDxjqkN0iJEUHgwfbsfxQqRfgkl6B7yG5aKdzNho2e92EIKIc1FMgdXSeG9iM2CKIIMmJCp2CHMtnNqmjpw==, tarball: file:projects/task-resources.tgz} id: file:projects/task-resources.tgz name: '@rush-temp/task-resources' version: 0.0.0 @@ -14781,7 +14985,7 @@ packages: dev: false file:projects/workbench-resources.tgz_096c09b0b673a57c275d9767a12070b1: - resolution: {integrity: sha512-w9xPq0GyNU7TRnECyFb+tUZ2qME89s1O4E2TPuzxFRyPqqDUnb7josF+F04vN0jSxwNZ2MKEPOlhu7nTmflhfg==, tarball: file:projects/workbench-resources.tgz} + resolution: {integrity: sha512-wQczHUkFZDTIx4EQNnHNGsey2td9uOBKPCMIDUxbhUuwm1tX9MpWc7ztkjDv8nFRKK1r0pnYTepwGr5Rny4sDA==, tarball: file:projects/workbench-resources.tgz} id: file:projects/workbench-resources.tgz name: '@rush-temp/workbench-resources' version: 0.0.0 diff --git a/dev/prod/package.json b/dev/prod/package.json index 86a72ecbd9..1b4e558535 100644 --- a/dev/prod/package.json +++ b/dev/prod/package.json @@ -124,6 +124,12 @@ "@anticrm/server-task-resources": "~0.6.0", "@anticrm/calendar": "~0.6.0", "@anticrm/calendar-assets": "~0.6.0", - "@anticrm/calendar-resources": "~0.6.0" + "@anticrm/calendar-resources": "~0.6.0", + "@anticrm/server-calendar": "~0.6.0", + "@anticrm/server-calendar-resources": "~0.6.0", + "@anticrm/server-gmail": "~0.6.0", + "@anticrm/server-gmail-resources": "~0.6.0", + "@anticrm/server-telegram": "~0.6.0", + "@anticrm/server-telegram-resources": "~0.6.0" } } diff --git a/dev/prod/src/platform-dev.ts b/dev/prod/src/platform-dev.ts index 08da1ea233..e8f28584ca 100644 --- a/dev/prod/src/platform-dev.ts +++ b/dev/prod/src/platform-dev.ts @@ -27,6 +27,10 @@ import { serverLeadId } from '@anticrm/server-lead' import { serverRecruitId } from '@anticrm/server-recruit' import { serverTaskId } from '@anticrm/server-task' import { serverTagsId } from '@anticrm/server-tags' +import { serverCalendarId } from '@anticrm/server-calendar' +import { serverGmailId } from '@anticrm/server-gmail' +import { serverTelegramId } from '@anticrm/server-telegram' + import { setMetadata } from '@anticrm/platform' @@ -49,6 +53,9 @@ export function configurePlatformDev() { addLocation(serverRecruitId, () => import(/* webpackChunkName: "server-recruit" */ '@anticrm/server-recruit-resources')) addLocation(serverTaskId, () => import/* webpackChunkName: "server-task" */ ('@anticrm/server-task-resources')) addLocation(serverTagsId, () => import/* webpackChunkName: "server-tags" */ ('@anticrm/server-tags-resources')) + addLocation(serverCalendarId, () => import/* webpackChunkName: "server-calendar" */ ('@anticrm/server-calendar-resources')) + addLocation(serverGmailId, () => import/* webpackChunkName: "server-gmail" */ ('@anticrm/server-gmail-resources')) + addLocation(serverTelegramId, () => import/* webpackChunkName: "server-telegram" */ ('@anticrm/server-telegram-resources')) // Set devmodel to hook client to be able to present all activity enableDevModel() } diff --git a/dev/tool/package.json b/dev/tool/package.json index 0614834793..ff0c1fd5b7 100644 --- a/dev/tool/package.json +++ b/dev/tool/package.json @@ -93,6 +93,12 @@ "@anticrm/server-task-resources": "~0.6.0", "@anticrm/server-tags": "~0.6.0", "@anticrm/server-tags-resources": "~0.6.0", + "@anticrm/server-calendar": "~0.6.0", + "@anticrm/server-calendar-resources": "~0.6.0", + "@anticrm/server-gmail": "~0.6.0", + "@anticrm/server-gmail-resources": "~0.6.0", + "@anticrm/server-telegram": "~0.6.0", + "@anticrm/server-telegram-resources": "~0.6.0", "@anticrm/rekoni": "~0.6.0", "request": "~2.88.2", "@anticrm/tags": "~0.6.0" diff --git a/dev/tool/src/elastic.ts b/dev/tool/src/elastic.ts index fadf20af95..5cf304fc3e 100644 --- a/dev/tool/src/elastic.ts +++ b/dev/tool/src/elastic.ts @@ -57,6 +57,9 @@ import { serverLeadId } from '@anticrm/server-lead' import { serverRecruitId } from '@anticrm/server-recruit' import { serverTaskId } from '@anticrm/server-task' import { serverTagsId } from '@anticrm/server-tags' +import { serverCalendarId } from '@anticrm/server-calendar' +import { serverGmailId } from '@anticrm/server-gmail' +import { serverTelegramId } from '@anticrm/server-telegram' import { Client as ElasticClient } from '@elastic/elasticsearch' import { Client } from 'minio' import { Db, MongoClient } from 'mongodb' @@ -120,6 +123,9 @@ export class ElasticTool { addLocation(serverSettingId, () => import(/* webpackChunkName: "server-recruit" */ '@anticrm/server-setting-resources')) addLocation(serverTaskId, () => import/* webpackChunkName: "server-task" */ ('@anticrm/server-task-resources')) addLocation(serverTagsId, () => import/* webpackChunkName: "server-tags" */ ('@anticrm/server-tags-resources')) + addLocation(serverCalendarId, () => import/* webpackChunkName: "server-calendar" */ ('@anticrm/server-calendar-resources')) + addLocation(serverGmailId, () => import/* webpackChunkName: "server-gmail" */ ('@anticrm/server-gmail-resources')) + addLocation(serverTelegramId, () => import/* webpackChunkName: "server-telegram" */ ('@anticrm/server-telegram-resources')) this.mongoClient = new MongoClient(mongoUrl) } diff --git a/models/all/package.json b/models/all/package.json index e7694ff482..0a95f23680 100644 --- a/models/all/package.json +++ b/models/all/package.json @@ -63,6 +63,9 @@ "@anticrm/model-text-editor": "~0.6.0", "@anticrm/core": "~0.6.16", "@anticrm/model-tags": "~0.6.0", - "@anticrm/model-calendar": "~0.6.0" + "@anticrm/model-calendar": "~0.6.0", + "@anticrm/model-server-calendar": "~0.6.0", + "@anticrm/model-server-gmail": "~0.6.0", + "@anticrm/model-server-telegram": "~0.6.0" } } diff --git a/models/all/src/index.ts b/models/all/src/index.ts index 49740bac49..4949ea80cb 100644 --- a/models/all/src/index.ts +++ b/models/all/src/index.ts @@ -49,6 +49,9 @@ import { createModel as workbenchModel } from '@anticrm/model-workbench' import { createModel as notificationModel } from '@anticrm/model-notification' import { createModel as tagsModel } from '@anticrm/model-tags' import { createModel as calendarModel } from '@anticrm/model-calendar' +import { createModel as serverCalendarModel } from '@anticrm/model-server-calendar' +import { createModel as serverGmailModel } from '@anticrm/model-server-gmail' +import { createModel as serverTelegramModel } from '@anticrm/model-server-telegram' export const version: Data = jsonVersion as Data @@ -86,6 +89,9 @@ const builders = [ serverTagsModel, serverTaskModel, serverRecruitModel, + serverCalendarModel, + serverGmailModel, + serverTelegramModel, createDemo ] diff --git a/models/server-calendar/.eslintrc.js b/models/server-calendar/.eslintrc.js new file mode 100644 index 0000000000..c3c2c49417 --- /dev/null +++ b/models/server-calendar/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@anticrm/model-rig/profiles/default/config/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/models/server-calendar/.npmignore b/models/server-calendar/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/models/server-calendar/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/models/server-calendar/config/rig.json b/models/server-calendar/config/rig.json new file mode 100644 index 0000000000..e9a9ee9add --- /dev/null +++ b/models/server-calendar/config/rig.json @@ -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" +} diff --git a/models/server-calendar/package.json b/models/server-calendar/package.json new file mode 100644 index 0000000000..92e1806537 --- /dev/null +++ b/models/server-calendar/package.json @@ -0,0 +1,34 @@ +{ + "name": "@anticrm/model-server-calendar", + "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.41.1" + }, + "dependencies": { + "@anticrm/core": "~0.6.16", + "@anticrm/model": "~0.6.0", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-calendar": "~0.6.0", + "@anticrm/server-core": "~0.6.1" + } +} diff --git a/models/server-calendar/src/index.ts b/models/server-calendar/src/index.ts new file mode 100644 index 0000000000..7c9668c991 --- /dev/null +++ b/models/server-calendar/src/index.ts @@ -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 core, { Class, Doc } from '@anticrm/core' +import serverCore, { ObjectDDParticipant } from '@anticrm/server-core' +import serverCalendar from '@anticrm/server-calendar' + +export function createModel (builder: Builder): void { + builder.mixin, ObjectDDParticipant>(core.class.Doc, core.class.Class, serverCore.mixin.ObjectDDParticipant, { + collectDocs: serverCalendar.function.FindReminders + }) +} diff --git a/models/server-calendar/tsconfig.json b/models/server-calendar/tsconfig.json new file mode 100644 index 0000000000..1d60db76b4 --- /dev/null +++ b/models/server-calendar/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "./node_modules/@anticrm/model-rig/profiles/default/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + } +} \ No newline at end of file diff --git a/models/server-gmail/.eslintrc.js b/models/server-gmail/.eslintrc.js new file mode 100644 index 0000000000..c3c2c49417 --- /dev/null +++ b/models/server-gmail/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@anticrm/model-rig/profiles/default/config/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/models/server-gmail/.npmignore b/models/server-gmail/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/models/server-gmail/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/models/server-gmail/config/rig.json b/models/server-gmail/config/rig.json new file mode 100644 index 0000000000..e9a9ee9add --- /dev/null +++ b/models/server-gmail/config/rig.json @@ -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" +} diff --git a/models/server-gmail/package.json b/models/server-gmail/package.json new file mode 100644 index 0000000000..f136413643 --- /dev/null +++ b/models/server-gmail/package.json @@ -0,0 +1,35 @@ +{ + "name": "@anticrm/model-server-gmail", + "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.41.1" + }, + "dependencies": { + "@anticrm/core": "~0.6.16", + "@anticrm/model": "~0.6.0", + "@anticrm/contact": "~0.6.5", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-gmail": "~0.6.0", + "@anticrm/server-core": "~0.6.1" + } +} diff --git a/models/server-gmail/src/index.ts b/models/server-gmail/src/index.ts new file mode 100644 index 0000000000..5b92616757 --- /dev/null +++ b/models/server-gmail/src/index.ts @@ -0,0 +1,27 @@ +// +// 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 core, { Class, Doc } from '@anticrm/core' +import serverCore, { ObjectDDParticipant } from '@anticrm/server-core' +import contact from '@anticrm/contact' +import serverGmail from '@anticrm/server-gmail' + +export function createModel (builder: Builder): void { + builder.mixin, ObjectDDParticipant>(contact.class.Channel, core.class.Class, serverCore.mixin.ObjectDDParticipant, { + collectDocs: serverGmail.function.FindMessages + }) +} diff --git a/models/server-gmail/tsconfig.json b/models/server-gmail/tsconfig.json new file mode 100644 index 0000000000..1d60db76b4 --- /dev/null +++ b/models/server-gmail/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "./node_modules/@anticrm/model-rig/profiles/default/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + } +} \ No newline at end of file diff --git a/models/server-telegram/.eslintrc.js b/models/server-telegram/.eslintrc.js new file mode 100644 index 0000000000..c3c2c49417 --- /dev/null +++ b/models/server-telegram/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@anticrm/model-rig/profiles/default/config/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/models/server-telegram/.npmignore b/models/server-telegram/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/models/server-telegram/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/models/server-telegram/config/rig.json b/models/server-telegram/config/rig.json new file mode 100644 index 0000000000..e9a9ee9add --- /dev/null +++ b/models/server-telegram/config/rig.json @@ -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" +} diff --git a/models/server-telegram/package.json b/models/server-telegram/package.json new file mode 100644 index 0000000000..2b36917bb2 --- /dev/null +++ b/models/server-telegram/package.json @@ -0,0 +1,35 @@ +{ + "name": "@anticrm/model-server-telegram", + "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.41.1" + }, + "dependencies": { + "@anticrm/core": "~0.6.16", + "@anticrm/model": "~0.6.0", + "@anticrm/contact": "~0.6.5", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-telegram": "~0.6.0", + "@anticrm/server-core": "~0.6.1" + } +} diff --git a/models/server-telegram/src/index.ts b/models/server-telegram/src/index.ts new file mode 100644 index 0000000000..e460a48c0d --- /dev/null +++ b/models/server-telegram/src/index.ts @@ -0,0 +1,27 @@ +// +// 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 core, { Class, Doc } from '@anticrm/core' +import serverCore, { ObjectDDParticipant } from '@anticrm/server-core' +import contact from '@anticrm/contact' +import serverTelegram from '@anticrm/server-telegram' + +export function createModel (builder: Builder): void { + builder.mixin, ObjectDDParticipant>(contact.class.Channel, core.class.Class, serverCore.mixin.ObjectDDParticipant, { + collectDocs: serverTelegram.function.FindMessages + }) +} diff --git a/models/server-telegram/tsconfig.json b/models/server-telegram/tsconfig.json new file mode 100644 index 0000000000..1d60db76b4 --- /dev/null +++ b/models/server-telegram/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "./node_modules/@anticrm/model-rig/profiles/default/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + } +} \ No newline at end of file diff --git a/rush.json b/rush.json index 010ba67953..9a7990cd46 100644 --- a/rush.json +++ b/rush.json @@ -1166,5 +1166,50 @@ "projectFolder": "server-plugins/tags-resources", "shouldPublish": true }, + { + "packageName": "@anticrm/server-calendar", + "projectFolder": "server-plugins/calendar", + "shouldPublish": true + }, + { + "packageName": "@anticrm/model-server-calendar", + "projectFolder": "models/server-calendar", + "shouldPublish": true + }, + { + "packageName": "@anticrm/server-calendar-resources", + "projectFolder": "server-plugins/calendar-resources", + "shouldPublish": true + }, + { + "packageName": "@anticrm/server-gmail", + "projectFolder": "server-plugins/gmail", + "shouldPublish": true + }, + { + "packageName": "@anticrm/model-server-gmail", + "projectFolder": "models/server-gmail", + "shouldPublish": true + }, + { + "packageName": "@anticrm/server-gmail-resources", + "projectFolder": "server-plugins/gmail-resources", + "shouldPublish": true + }, + { + "packageName": "@anticrm/server-telegram", + "projectFolder": "server-plugins/telegram", + "shouldPublish": true + }, + { + "packageName": "@anticrm/model-server-telegram", + "projectFolder": "models/server-telegram", + "shouldPublish": true + }, + { + "packageName": "@anticrm/server-telegram-resources", + "projectFolder": "server-plugins/telegram-resources", + "shouldPublish": true + }, ] } diff --git a/server-plugins/calendar-resources/.eslintrc.js b/server-plugins/calendar-resources/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/server-plugins/calendar-resources/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@anticrm/platform-rig/profiles/default/config/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/server-plugins/calendar-resources/.npmignore b/server-plugins/calendar-resources/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/calendar-resources/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server-plugins/calendar-resources/config/rig.json b/server-plugins/calendar-resources/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/server-plugins/calendar-resources/config/rig.json @@ -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" +} diff --git a/server-plugins/calendar-resources/package.json b/server-plugins/calendar-resources/package.json new file mode 100644 index 0000000000..2bed33d3a4 --- /dev/null +++ b/server-plugins/calendar-resources/package.json @@ -0,0 +1,32 @@ +{ + "name": "@anticrm/server-calendar-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.41.1", + "typescript": "^4.3.5" + }, + "dependencies": { + "@anticrm/core": "~0.6.16", + "@anticrm/calendar": "~0.6.0" + } +} diff --git a/server-plugins/calendar-resources/src/index.ts b/server-plugins/calendar-resources/src/index.ts new file mode 100644 index 0000000000..4e36275cf9 --- /dev/null +++ b/server-plugins/calendar-resources/src/index.ts @@ -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 calendar from '@anticrm/calendar' +import { Class, Doc, DocumentQuery, FindOptions, FindResult, Hierarchy, Ref } from '@anticrm/core' + +/** + * @public + */ +export async function FindReminders (doc: Doc, hiearachy: Hierarchy, findAll: (clazz: Ref>, query: DocumentQuery, options?: FindOptions) => Promise>): Promise { + const result = await findAll(calendar.mixin.Reminder, { attachedTo: doc._id }) + return result +} + +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type +export default async () => ({ + function: { + FindReminders + } +}) diff --git a/server-plugins/calendar-resources/tsconfig.json b/server-plugins/calendar-resources/tsconfig.json new file mode 100644 index 0000000000..aeb0517b13 --- /dev/null +++ b/server-plugins/calendar-resources/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "./node_modules/@anticrm/platform-rig/profiles/default/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib" + } +} \ No newline at end of file diff --git a/server-plugins/calendar/.eslintrc.js b/server-plugins/calendar/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/server-plugins/calendar/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@anticrm/platform-rig/profiles/default/config/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/server-plugins/calendar/.npmignore b/server-plugins/calendar/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/calendar/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server-plugins/calendar/config/rig.json b/server-plugins/calendar/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/server-plugins/calendar/config/rig.json @@ -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" +} diff --git a/server-plugins/calendar/package.json b/server-plugins/calendar/package.json new file mode 100644 index 0000000000..56df344c82 --- /dev/null +++ b/server-plugins/calendar/package.json @@ -0,0 +1,33 @@ +{ + "name": "@anticrm/server-calendar", + "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.41.1", + "typescript": "^4.3.5" + }, + "dependencies": { + "@anticrm/core": "~0.6.16", + "@anticrm/platform": "~0.6.5" + } +} diff --git a/server-plugins/calendar/src/index.ts b/server-plugins/calendar/src/index.ts new file mode 100644 index 0000000000..05b1568c6c --- /dev/null +++ b/server-plugins/calendar/src/index.ts @@ -0,0 +1,33 @@ +// +// Copyright © 2020, 2021 Anticrm Platform Contributors. +// Copyright © 2021, 2022 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { Class, Doc, DocumentQuery, FindOptions, FindResult, Hierarchy, Ref } from '@anticrm/core' +import type { Plugin, Resource } from '@anticrm/platform' +import { plugin } from '@anticrm/platform' + +/** + * @public + */ +export const serverCalendarId = 'server-calendar' as Plugin + +/** + * @public + */ +export default plugin(serverCalendarId, { + function: { + FindReminders: '' as Resource<(doc: Doc, hiearachy: Hierarchy, findAll: (clazz: Ref>, query: DocumentQuery, options?: FindOptions) => Promise>) => Promise> + } +}) diff --git a/server-plugins/calendar/tsconfig.json b/server-plugins/calendar/tsconfig.json new file mode 100644 index 0000000000..fffbf4c341 --- /dev/null +++ b/server-plugins/calendar/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "./node_modules/@anticrm/platform-rig/profiles/default/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/server-plugins/gmail-resources/.eslintrc.js b/server-plugins/gmail-resources/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/server-plugins/gmail-resources/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@anticrm/platform-rig/profiles/default/config/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/server-plugins/gmail-resources/.npmignore b/server-plugins/gmail-resources/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/gmail-resources/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server-plugins/gmail-resources/config/rig.json b/server-plugins/gmail-resources/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/server-plugins/gmail-resources/config/rig.json @@ -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" +} diff --git a/server-plugins/gmail-resources/package.json b/server-plugins/gmail-resources/package.json new file mode 100644 index 0000000000..96cd5d3de8 --- /dev/null +++ b/server-plugins/gmail-resources/package.json @@ -0,0 +1,35 @@ +{ + "name": "@anticrm/server-gmail-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.41.1", + "typescript": "^4.3.5" + }, + "dependencies": { + "@anticrm/core": "~0.6.16", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-core": "~0.6.1", + "@anticrm/contact": "~0.6.5", + "@anticrm/gmail": "~0.6.0" + } +} diff --git a/server-plugins/gmail-resources/src/index.ts b/server-plugins/gmail-resources/src/index.ts new file mode 100644 index 0000000000..d1eb74dac8 --- /dev/null +++ b/server-plugins/gmail-resources/src/index.ts @@ -0,0 +1,38 @@ +// +// Copyright © 2022 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import contact, { Channel } from '@anticrm/contact' +import gmail from '@anticrm/gmail' +import { Class, Doc, DocumentQuery, FindOptions, FindResult, Hierarchy, Ref } from '@anticrm/core' + +/** + * @public + */ +export async function FindMessages (doc: Doc, hiearachy: Hierarchy, findAll: (clazz: Ref>, query: DocumentQuery, options?: FindOptions) => Promise>): Promise { + const channel = doc as Channel + if (channel.provider !== contact.channelProvider.Email) { + return [] + } + const messages = await findAll(gmail.class.Message, { attachedTo: doc._id }) + const newMessages = await findAll(gmail.class.NewMessage, { attachedTo: doc._id }) + return [...messages, ...newMessages] +} + +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type +export default async () => ({ + function: { + FindMessages + } +}) diff --git a/server-plugins/gmail-resources/tsconfig.json b/server-plugins/gmail-resources/tsconfig.json new file mode 100644 index 0000000000..aeb0517b13 --- /dev/null +++ b/server-plugins/gmail-resources/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "./node_modules/@anticrm/platform-rig/profiles/default/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib" + } +} \ No newline at end of file diff --git a/server-plugins/gmail/.eslintrc.js b/server-plugins/gmail/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/server-plugins/gmail/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@anticrm/platform-rig/profiles/default/config/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/server-plugins/gmail/.npmignore b/server-plugins/gmail/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/gmail/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server-plugins/gmail/config/rig.json b/server-plugins/gmail/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/server-plugins/gmail/config/rig.json @@ -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" +} diff --git a/server-plugins/gmail/package.json b/server-plugins/gmail/package.json new file mode 100644 index 0000000000..e65896043c --- /dev/null +++ b/server-plugins/gmail/package.json @@ -0,0 +1,33 @@ +{ + "name": "@anticrm/server-gmail", + "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.41.1", + "typescript": "^4.3.5" + }, + "dependencies": { + "@anticrm/core": "~0.6.16", + "@anticrm/platform": "~0.6.5" + } +} diff --git a/server-plugins/gmail/src/index.ts b/server-plugins/gmail/src/index.ts new file mode 100644 index 0000000000..7adaf36307 --- /dev/null +++ b/server-plugins/gmail/src/index.ts @@ -0,0 +1,33 @@ +// +// Copyright © 2020, 2021 Anticrm Platform Contributors. +// Copyright © 2021, 2022 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { Class, Doc, DocumentQuery, FindOptions, FindResult, Hierarchy, Ref } from '@anticrm/core' +import type { Plugin, Resource } from '@anticrm/platform' +import { plugin } from '@anticrm/platform' + +/** + * @public + */ +export const serverGmailId = 'server-gmail' as Plugin + +/** + * @public + */ +export default plugin(serverGmailId, { + function: { + FindMessages: '' as Resource<(doc: Doc, hiearachy: Hierarchy, findAll: (clazz: Ref>, query: DocumentQuery, options?: FindOptions) => Promise>) => Promise> + } +}) diff --git a/server-plugins/gmail/tsconfig.json b/server-plugins/gmail/tsconfig.json new file mode 100644 index 0000000000..fffbf4c341 --- /dev/null +++ b/server-plugins/gmail/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "./node_modules/@anticrm/platform-rig/profiles/default/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/server-plugins/telegram-resources/.eslintrc.js b/server-plugins/telegram-resources/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/server-plugins/telegram-resources/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@anticrm/platform-rig/profiles/default/config/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/server-plugins/telegram-resources/.npmignore b/server-plugins/telegram-resources/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/telegram-resources/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server-plugins/telegram-resources/config/rig.json b/server-plugins/telegram-resources/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/server-plugins/telegram-resources/config/rig.json @@ -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" +} diff --git a/server-plugins/telegram-resources/package.json b/server-plugins/telegram-resources/package.json new file mode 100644 index 0000000000..2b353bbf71 --- /dev/null +++ b/server-plugins/telegram-resources/package.json @@ -0,0 +1,35 @@ +{ + "name": "@anticrm/server-telegram-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.41.1", + "typescript": "^4.3.5" + }, + "dependencies": { + "@anticrm/core": "~0.6.16", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-core": "~0.6.1", + "@anticrm/contact": "~0.6.5", + "@anticrm/telegram": "~0.6.0" + } +} diff --git a/server-plugins/telegram-resources/src/index.ts b/server-plugins/telegram-resources/src/index.ts new file mode 100644 index 0000000000..1f00958c73 --- /dev/null +++ b/server-plugins/telegram-resources/src/index.ts @@ -0,0 +1,38 @@ +// +// Copyright © 2022 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import contact, { Channel } from '@anticrm/contact' +import telegram from '@anticrm/telegram' +import { Class, Doc, DocumentQuery, FindOptions, FindResult, Hierarchy, Ref } from '@anticrm/core' + +/** + * @public + */ +export async function FindMessages (doc: Doc, hiearachy: Hierarchy, findAll: (clazz: Ref>, query: DocumentQuery, options?: FindOptions) => Promise>): Promise { + const channel = doc as Channel + if (channel.provider !== contact.channelProvider.Telegram) { + return [] + } + const messages = await findAll(telegram.class.Message, { attachedTo: doc._id }) + const newMessages = await findAll(telegram.class.NewMessage, { attachedTo: doc._id }) + return [...messages, ...newMessages] +} + +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type +export default async () => ({ + function: { + FindMessages + } +}) diff --git a/server-plugins/telegram-resources/tsconfig.json b/server-plugins/telegram-resources/tsconfig.json new file mode 100644 index 0000000000..aeb0517b13 --- /dev/null +++ b/server-plugins/telegram-resources/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "./node_modules/@anticrm/platform-rig/profiles/default/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib" + } +} \ No newline at end of file diff --git a/server-plugins/telegram/.eslintrc.js b/server-plugins/telegram/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/server-plugins/telegram/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@anticrm/platform-rig/profiles/default/config/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/server-plugins/telegram/.npmignore b/server-plugins/telegram/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/telegram/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server-plugins/telegram/config/rig.json b/server-plugins/telegram/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/server-plugins/telegram/config/rig.json @@ -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" +} diff --git a/server-plugins/telegram/package.json b/server-plugins/telegram/package.json new file mode 100644 index 0000000000..996d3b8c7c --- /dev/null +++ b/server-plugins/telegram/package.json @@ -0,0 +1,33 @@ +{ + "name": "@anticrm/server-telegram", + "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.41.1", + "typescript": "^4.3.5" + }, + "dependencies": { + "@anticrm/core": "~0.6.16", + "@anticrm/platform": "~0.6.5" + } +} diff --git a/server-plugins/telegram/src/index.ts b/server-plugins/telegram/src/index.ts new file mode 100644 index 0000000000..c343316fb1 --- /dev/null +++ b/server-plugins/telegram/src/index.ts @@ -0,0 +1,33 @@ +// +// Copyright © 2020, 2021 Anticrm Platform Contributors. +// Copyright © 2021, 2022 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { Class, Doc, DocumentQuery, FindOptions, FindResult, Hierarchy, Ref } from '@anticrm/core' +import type { Plugin, Resource } from '@anticrm/platform' +import { plugin } from '@anticrm/platform' + +/** + * @public + */ +export const serverTelegramId = 'server-telegram' as Plugin + +/** + * @public + */ +export default plugin(serverTelegramId, { + function: { + FindMessages: '' as Resource<(doc: Doc, hiearachy: Hierarchy, findAll: (clazz: Ref>, query: DocumentQuery, options?: FindOptions) => Promise>) => Promise> + } +}) diff --git a/server-plugins/telegram/tsconfig.json b/server-plugins/telegram/tsconfig.json new file mode 100644 index 0000000000..fffbf4c341 --- /dev/null +++ b/server-plugins/telegram/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "./node_modules/@anticrm/platform-rig/profiles/default/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/server/server/package.json b/server/server/package.json index 13df5c3ac4..af3ea350e6 100644 --- a/server/server/package.json +++ b/server/server/package.json @@ -65,6 +65,12 @@ "@anticrm/server-task-resources": "~0.6.0", "@anticrm/server-tags": "~0.6.0", "@anticrm/server-tags-resources": "~0.6.0", + "@anticrm/server-calendar": "~0.6.0", + "@anticrm/server-calendar-resources": "~0.6.0", + "@anticrm/server-gmail": "~0.6.0", + "@anticrm/server-gmail-resources": "~0.6.0", + "@anticrm/server-telegram": "~0.6.0", + "@anticrm/server-telegram-resources": "~0.6.0", "@anticrm/server-token": "~0.6.0" } } diff --git a/server/server/src/server.ts b/server/server/src/server.ts index 3011797a27..409240a7df 100644 --- a/server/server/src/server.ts +++ b/server/server/src/server.ts @@ -33,6 +33,9 @@ import { serverLeadId } from '@anticrm/server-lead' import { serverRecruitId } from '@anticrm/server-recruit' import { serverTaskId } from '@anticrm/server-task' import { serverTagsId } from '@anticrm/server-tags' +import { serverCalendarId } from '@anticrm/server-calendar' +import { serverGmailId } from '@anticrm/server-gmail' +import { serverTelegramId } from '@anticrm/server-telegram' import { metricsContext } from './metrics' @@ -70,6 +73,9 @@ export function start (dbUrl: string, fullTextUrl: string, minioConf: MinioConfi addLocation(serverRecruitId, () => import('@anticrm/server-recruit-resources')) addLocation(serverTaskId, () => import('@anticrm/server-task-resources')) addLocation(serverTagsId, () => import('@anticrm/server-tags-resources')) + addLocation(serverCalendarId, () => import('@anticrm/server-calendar-resources')) + addLocation(serverGmailId, () => import('@anticrm/server-gmail-resources')) + addLocation(serverTelegramId, () => import('@anticrm/server-telegram-resources')) return startJsonRpc(metricsContext, (workspace: string) => { const conf: DbConfiguration = {