diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 12f7dd46c4..a515c4b701 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -67,6 +67,7 @@ jobs: plugins pods server + server-plugins templates tests rush.json @@ -96,6 +97,7 @@ jobs: plugins pods server + server-plugins templates tests rush.json @@ -128,6 +130,7 @@ jobs: plugins pods server + server-plugins templates tests rush.json @@ -160,6 +163,7 @@ jobs: plugins pods server + server-plugins templates tests rush.json @@ -204,6 +208,7 @@ jobs: plugins pods server + server-plugins templates tests rush.json diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index bb0166cfcb..99c6158dd8 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -62,9 +62,14 @@ 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-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-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 + '@rush-temp/model-server-recruit': file:./projects/model-server-recruit.tgz + '@rush-temp/model-server-task': file:./projects/model-server-task.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 @@ -91,11 +96,21 @@ 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-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-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 + '@rush-temp/server-lead-resources': file:./projects/server-lead-resources.tgz '@rush-temp/server-notification': file:./projects/server-notification.tgz '@rush-temp/server-notification-resources': file:./projects/server-notification-resources.tgz + '@rush-temp/server-recruit': file:./projects/server-recruit.tgz + '@rush-temp/server-recruit-resources': file:./projects/server-recruit-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-token': file:./projects/server-token.tgz '@rush-temp/server-tool': file:./projects/server-tool.tgz '@rush-temp/server-ws': file:./projects/server-ws.tgz @@ -272,9 +287,14 @@ 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-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-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 + '@rush-temp/model-server-recruit': file:projects/model-server-recruit.tgz_typescript@4.5.4 + '@rush-temp/model-server-task': file:projects/model-server-task.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 @@ -301,11 +321,21 @@ 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-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-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 + '@rush-temp/server-lead-resources': file:projects/server-lead-resources.tgz '@rush-temp/server-notification': file:projects/server-notification.tgz '@rush-temp/server-notification-resources': file:projects/server-notification-resources.tgz + '@rush-temp/server-recruit': file:projects/server-recruit.tgz + '@rush-temp/server-recruit-resources': file:projects/server-recruit-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-token': file:projects/server-token.tgz '@rush-temp/server-tool': file:projects/server-tool.tgz '@rush-temp/server-ws': file:projects/server-ws.tgz @@ -11364,7 +11394,7 @@ packages: dev: false file:projects/chunter-resources.tgz_096c09b0b673a57c275d9767a12070b1: - resolution: {integrity: sha512-Ah0rr5uVXgAWSijLuVIxdtLjpc//rR4gw6AwtdF0adV89ZA70k/B7mKpjHAw2kIRkMjfgS5P30bRhx83Fh2CdQ==, tarball: file:projects/chunter-resources.tgz} + resolution: {integrity: sha512-Md1h3nCkA2oUfOAP3oAABH2W8boFJODkrjbPyxccaay48TEkZN7BJLE3UoexttqCxQa4+4PL3zWWjMLlMrJ/Kw==, tarball: file:projects/chunter-resources.tgz} id: file:projects/chunter-resources.tgz name: '@rush-temp/chunter-resources' version: 0.0.0 @@ -11993,7 +12023,7 @@ packages: dev: false file:projects/inventory-resources.tgz_096c09b0b673a57c275d9767a12070b1: - resolution: {integrity: sha512-QPMUPTMuvahinsVH8OO3BUj9lpAq2cITHPgk/EL8XlZ0xEq497JjXy3N8KW4gHSwrM8kGBPfpwD2bRbXI4V7Vg==, tarball: file:projects/inventory-resources.tgz} + resolution: {integrity: sha512-XFicFpfQR9nWoYlVHWCt+gHjwN3MybHXwNrxQ3g03Pir85+ROEF0ArGmxZa5BsIWjHWDfv1xMcLA/ryt3QKcKQ==, tarball: file:projects/inventory-resources.tgz} id: file:projects/inventory-resources.tgz name: '@rush-temp/inventory-resources' version: 0.0.0 @@ -12070,7 +12100,7 @@ packages: dev: false file:projects/lead-resources.tgz_096c09b0b673a57c275d9767a12070b1: - resolution: {integrity: sha512-gd3fCKU/E1ZrIFQBm966XaGVIH/RB0C4XyfWQFueKhy95cUbjiEe88Jf6Xh+4a7hkF96VMKc3z51SH1pLGtnFA==, tarball: file:projects/lead-resources.tgz} + resolution: {integrity: sha512-9FpuEornHpauniIpp79200ur4mvE5PmPSLSx5fUDvkVl+jl/HM+GYLodRKtE++YsgYHuS0dncqF8Qe92ltCpUQ==, tarball: file:projects/lead-resources.tgz} id: file:projects/lead-resources.tgz name: '@rush-temp/lead-resources' version: 0.0.0 @@ -12223,7 +12253,7 @@ packages: dev: false file:projects/model-all.tgz_typescript@4.5.4: - resolution: {integrity: sha512-MnTIVPbt9yvy+dNZaMUPScfjYp12cF1P8GXay1jUizfZyTaeMsb+uN3Z2jnzQPhrAJxW4DDjAoCLO+yK7xGbRA==, tarball: file:projects/model-all.tgz} + resolution: {integrity: sha512-eR9zQnuCAirRYMRife5HzyLfg8oDLAz1YZffs2tyK4fb6++U7q9RfNYfaPHEGkcVVscJ8MvWYI6CcHk5khOc4g==, tarball: file:projects/model-all.tgz} id: file:projects/model-all.tgz name: '@rush-temp/model-all' version: 0.0.0 @@ -12290,7 +12320,7 @@ packages: dev: false file:projects/model-contact.tgz_typescript@4.5.4: - resolution: {integrity: sha512-a2k6USkc9xrm3ba78A0pOps3X4Ox8A+uHm3cdNpfrSA8ihdfU9p6imeFr+ZotWF8YCcnwagz9sVHpT5dtmH4Mg==, tarball: file:projects/model-contact.tgz} + resolution: {integrity: sha512-SCSm1wH4jXL45vpA1013yTbU7mE8VsXilHHxF5dMWJT/lyHFiRkn0D0NEqA15tm37KF0bGXuvn9/jTSSG+hFqA==, tarball: file:projects/model-contact.tgz} id: file:projects/model-contact.tgz name: '@rush-temp/model-contact' version: 0.0.0 @@ -12416,7 +12446,7 @@ packages: dev: false file:projects/model-notification.tgz_typescript@4.5.4: - resolution: {integrity: sha512-oXjmLAI4ablTqm5zdk23LYWTRRdqLGxshn164t87FLm4T/6sFK7xlikIuxGNn+XED0/m1T9ShPXEwXcYFJ/YQw==, tarball: file:projects/model-notification.tgz} + resolution: {integrity: sha512-WhD1VyRSZ7EB9HYyGawyxHxuKkfogkfdibpRcSXkJ9SPy+MNmnABMhG5Jj2d9Man/3FRqiAwJhSxsHYoKpwkNQ==, tarball: file:projects/model-notification.tgz} id: file:projects/model-notification.tgz name: '@rush-temp/model-notification' version: 0.0.0 @@ -12518,8 +12548,29 @@ packages: - typescript dev: false + file:projects/model-server-chunter.tgz_typescript@4.5.4: + resolution: {integrity: sha512-pZ0hgyMtDyGJopCGoeZXNCazD74U19JDyouKTIb8ATvmQt93TTjtH74urp6EomfuWzoxBRPprSAs8csuE7tBSw==, tarball: file:projects/model-server-chunter.tgz} + id: file:projects/model-server-chunter.tgz + name: '@rush-temp/model-server-chunter' + 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-contact.tgz_typescript@4.5.4: - resolution: {integrity: sha512-cS09KWx82ek8kc0tutF538kEZMRkOMLnY0sQSUScOPEYHb4cLR4M94PrIhsY8DiP6TJctkT0ddnvwXMApAwyGA==, tarball: file:projects/model-server-contact.tgz} + resolution: {integrity: sha512-EUI1TgMMuwfrCoZPz63atVRrb+7uNnoqxuWrxHiRNeGvHb7F5/cPOg0MyT/i2juOBTyfkzJbraDZMrRd04Ymwg==, tarball: file:projects/model-server-contact.tgz} id: file:projects/model-server-contact.tgz name: '@rush-temp/model-server-contact' version: 0.0.0 @@ -12560,6 +12611,48 @@ packages: - typescript dev: false + file:projects/model-server-inventory.tgz_typescript@4.5.4: + resolution: {integrity: sha512-5oAiV68Hl0v9mlQ7wa6/RAG0KazJRdu1BD71w60NBhh97qGhrSi/GDDNs8bdYaqB6uxUE9xNWVC1NulRuL1crA==, tarball: file:projects/model-server-inventory.tgz} + id: file:projects/model-server-inventory.tgz + name: '@rush-temp/model-server-inventory' + 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-lead.tgz_typescript@4.5.4: + resolution: {integrity: sha512-9bqF5Che49x6QLONfohycz76v2viNTq93TtAczUXMsimgxK7yEWMdKQda7qY2bH8rtkwV58XSgbMWfX14L1l4g==, tarball: file:projects/model-server-lead.tgz} + id: file:projects/model-server-lead.tgz + name: '@rush-temp/model-server-lead' + 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-notification.tgz_typescript@4.5.4: resolution: {integrity: sha512-bO0DgNGdJGxJjDU05x1HPNHfprIFhRYhauMT9eH4zKMlsQZNO5Rx5h77SxepW2HiAxVYMqjOR2GwsTN3h7C8wQ==, tarball: file:projects/model-server-notification.tgz} id: file:projects/model-server-notification.tgz @@ -12581,6 +12674,48 @@ packages: - typescript dev: false + file:projects/model-server-recruit.tgz_typescript@4.5.4: + resolution: {integrity: sha512-yidHAiSSXgFfl990q/d3A9KkucgEmMQ3pkp0HISrOIEJHUoazU5A4VgqDR2B/STjLpgH8ZhgOD3VMSNv5D6NKg==, tarball: file:projects/model-server-recruit.tgz} + id: file:projects/model-server-recruit.tgz + name: '@rush-temp/model-server-recruit' + 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-task.tgz_typescript@4.5.4: + resolution: {integrity: sha512-UGeEby4x4ZUjOO3ECPvg3wVKQUAXjNMw8zQFiQmCemiMQk+6NNvGhwkHgV674dt5rGDCNBjKJfFaShTj7jcDlw==, tarball: file:projects/model-server-task.tgz} + id: file:projects/model-server-task.tgz + name: '@rush-temp/model-server-task' + 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-zwbVN3PDOfDeqGcL36IHQIufdePTd68yLUm83rfIg4v8+uilseid981y/BrAysmxTXAfhVYWlDmtYXvNPS4DMQ==, tarball: file:projects/model-setting.tgz} id: file:projects/model-setting.tgz @@ -12817,7 +12952,7 @@ packages: dev: false file:projects/notification-resources.tgz_096c09b0b673a57c275d9767a12070b1: - resolution: {integrity: sha512-saNzTGP0Bz7u0f2qimEbhL3w9xhZb8pgenUpAuDpeT6fMPmG7CNYpkwefhayEeIUmU4frbIC5kjAOMSPUxsg6A==, tarball: file:projects/notification-resources.tgz} + resolution: {integrity: sha512-XFpqe60nZYFgS9+a5fMJSJeBIyb8tsmHawXI1Ee0B5eb38R7oUmnE6ezb2hYXl/EKPabYL/Pt1cxMjkRMz4Njw==, tarball: file:projects/notification-resources.tgz} id: file:projects/notification-resources.tgz name: '@rush-temp/notification-resources' version: 0.0.0 @@ -12832,6 +12967,7 @@ packages: eslint-plugin-node: 11.1.0_eslint@7.32.0 eslint-plugin-promise: 5.2.0_eslint@7.32.0 eslint-plugin-svelte3: 3.2.1_eslint@7.32.0+svelte@3.44.3 + just-clone: 3.2.1 prettier: 2.5.1 prettier-plugin-svelte: 2.5.1_prettier@2.5.1+svelte@3.44.3 sass: 1.45.0 @@ -13025,7 +13161,7 @@ packages: dev: false file:projects/prod.tgz_sass@1.45.0+typescript@4.5.4: - resolution: {integrity: sha512-a6wHdZhYC1h8QOrfCkS6HQz4L0llPz8YJqJaJPH/tkMHanaUSixCiCcjr+T+ANBfacXQf8GjTqvPBir/Hd3FzQ==, tarball: file:projects/prod.tgz} + resolution: {integrity: sha512-oVRjx2sc3JPmU3Q2PFONILjWWm9cxER23AgY+wHq4BX+H1zcsriCbRruGDNEwchO3PddlB1QhvlUZtC+grCNZQ==, tarball: file:projects/prod.tgz} id: file:projects/prod.tgz name: '@rush-temp/prod' version: 0.0.0 @@ -13117,7 +13253,7 @@ packages: dev: false file:projects/recruit-resources.tgz_096c09b0b673a57c275d9767a12070b1: - resolution: {integrity: sha512-nZLvaOr850iq0AQidGvnFlzPWLdwosv9ORArSA5ihRGea8X+RpzD/pjDswtJp6nF7G2ctmL8tFLN9cvFA45lDw==, tarball: file:projects/recruit-resources.tgz} + resolution: {integrity: sha512-T1NOP+NczA00alZvYaKQBqG34P72zCy5RwowxbViP31o8ahRH8CS0msHAGeJXZPrF/E2XeMXY2xgAFKn9ywRCg==, tarball: file:projects/recruit-resources.tgz} id: file:projects/recruit-resources.tgz name: '@rush-temp/recruit-resources' version: 0.0.0 @@ -13154,7 +13290,7 @@ packages: dev: false file:projects/recruit.tgz: - resolution: {integrity: sha512-vvQ892DoJCDRaRuVWx+DBpuKPtCic0O0PdgPDtbKxl+pWk31MVdEhO6m+ySpqkPsu297ot/D7lpYXcK/775fow==, tarball: file:projects/recruit.tgz} + resolution: {integrity: sha512-d/Wv2gldoJfJnyC5d318UhRa+iqzh7r2+CsBHHEPDAabL73kdQsbkyPNEqoTOapyMdGwIPbnF3R3tSNP7TFH4g==, tarball: file:projects/recruit.tgz} name: '@rush-temp/recruit' version: 0.0.0 dependencies: @@ -13241,8 +13377,49 @@ packages: - supports-color dev: false + file:projects/server-chunter-resources.tgz: + resolution: {integrity: sha512-9xWukPv4zWMIAampn8JogHVzz/r0YZXMx/6Dobyp1YdZLAFfMRdey5dPJ2FOSTvIztwZhmzddYrlmVlOw/gK/g==, tarball: file:projects/server-chunter-resources.tgz} + name: '@rush-temp/server-chunter-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-chunter.tgz: + resolution: {integrity: sha512-kpo3OPoldUkUrnRvxa/xZYRIyKd12a5q1XcdXlPkPN1ZDiJVp6PFF8fuwc5hjjf8T6/jKOYmLw+JCafTb7rSOA==, tarball: file:projects/server-chunter.tgz} + name: '@rush-temp/server-chunter' + 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-contact-resources.tgz: - resolution: {integrity: sha512-4yOcy58wmHdLoBsIlawD4KAe5I+q9NtlKXnZRvuyF0Gdb8UZcEvL2NjxHZNJkDmTGvvmmr2ihwYKJE+g4N//jg==, tarball: file:projects/server-contact-resources.tgz} + resolution: {integrity: sha512-0wv176Ajvj6Hh72NgA3j3LY4To7FkWv9f/U8P5oCJadU9kEPz0H8GsUaaAhSEtmYaXdsisiuKzTIVVFORrmVCQ==, tarball: file:projects/server-contact-resources.tgz} name: '@rush-temp/server-contact-resources' version: 0.0.0 dependencies: @@ -13306,8 +13483,90 @@ packages: - supports-color dev: false + file:projects/server-inventory-resources.tgz: + resolution: {integrity: sha512-ihg8bdAMvtJ3pZvpK4Gv/PjvQJqvoIKaGfzWOvTFQhcf2PsIWXSu7B2/gB8ekBTC20jkrjEJxHyobhZtGmH53g==, tarball: file:projects/server-inventory-resources.tgz} + name: '@rush-temp/server-inventory-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-inventory.tgz: + resolution: {integrity: sha512-gO3q96c7gOS29+NmDAOORJ9eMzBHCnIqo9udZUt8TsTHm4r2v1faCYJw57toSnU1PJ60RtXxmqBQTXXFQtdBKA==, tarball: file:projects/server-inventory.tgz} + name: '@rush-temp/server-inventory' + 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-lead-resources.tgz: + resolution: {integrity: sha512-YhcEDAOqvt8LiaS+cXUj4NnuN4bqRdtIj10c0qBFPiLU2Csr753Ef5g5gtNeztZRNtnRJK2T4K/c+Fk7oKGEkA==, tarball: file:projects/server-lead-resources.tgz} + name: '@rush-temp/server-lead-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-lead.tgz: + resolution: {integrity: sha512-gjRjRrQT8bxy4CEd1vs3hiIccdR1j2x8xvveoue+MxNu1IRaxws0KE7ggk9AOn7KmZl2Cl2UtktlXEJkZ7tvOQ==, tarball: file:projects/server-lead.tgz} + name: '@rush-temp/server-lead' + 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-notification-resources.tgz: - resolution: {integrity: sha512-9EXWxHdVb5DvmZORxWPquKpxThiRV6zaEtpFbat4drf5i/br5cERKka5+oBJK27WyYYeB8rUGjjQ7AFx/dJzbQ==, tarball: file:projects/server-notification-resources.tgz} + resolution: {integrity: sha512-t5tHG0WoQJPHnXjZMkXJXXGMo6Xzz02ah4GJC/fnox0WpgyFh5iw3F33jDdIf8tRFRSifNg/bp4ZbZ9lDh+ARQ==, tarball: file:projects/server-notification-resources.tgz} name: '@rush-temp/server-notification-resources' version: 0.0.0 dependencies: @@ -13347,6 +13606,88 @@ packages: - supports-color dev: false + file:projects/server-recruit-resources.tgz: + resolution: {integrity: sha512-8UTVnSBjVhuf5Qvp80Z7iZ+IO1jSRVG2czLgNL/GMbtjFZw8b5dE3USi9vv9Q2AtAGpbWUgSUqODW24qkYjiUQ==, tarball: file:projects/server-recruit-resources.tgz} + name: '@rush-temp/server-recruit-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-recruit.tgz: + resolution: {integrity: sha512-UrQBEwX6cZgSk+HMfhJort5tzGaCe1cv0Thg3sITzNaB4yb3FExUTeVphI16hgh6Hcv/2m53zsdcNscnpoTROg==, tarball: file:projects/server-recruit.tgz} + name: '@rush-temp/server-recruit' + 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-task-resources.tgz: + resolution: {integrity: sha512-3HkiHH62jBO6wGrvum0PMVDiAavRHud0u/BExVz15exJRm9YzXK3bklmm8XZr5BsS3vhTqb+q1XwdDXUv0n5Fg==, tarball: file:projects/server-task-resources.tgz} + name: '@rush-temp/server-task-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-task.tgz: + resolution: {integrity: sha512-qaB/cZSAPKuvTUfBv5wsqD0r/YoQO/hy7rD7WBC0lx2TOWIp0/aacYKVkEltinbYjJzP4gg9cQQNful4Mvpp5Q==, tarball: file:projects/server-task.tgz} + name: '@rush-temp/server-task' + 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-74lvKW1J8vMQI7r+UUFCO8KDItftmBVTc9ecLL9kbWHdFT/kfR1ua57O8XG7MMJDmBVsWylHmM1kr6lxwNpNBA==, tarball: file:projects/server-token.tgz} name: '@rush-temp/server-token' @@ -13426,7 +13767,7 @@ packages: dev: false file:projects/server.tgz: - resolution: {integrity: sha512-SuwXbo0xvalgyA3m9i/bbm9ae2I3Tx548KKj8wDffAJxDq0t0tqncuVtUmhrwG06HD9p5myf165I6apGZZocSg==, tarball: file:projects/server.tgz} + resolution: {integrity: sha512-h1M/Y+zV/J0wUEgDj+iHeyMbS/otfYdWS8l2APj78c38/Hso/hi70cB5A1VUq2NsB/hKEE3bywIyn2yuJRnDug==, tarball: file:projects/server.tgz} name: '@rush-temp/server' version: 0.0.0 dependencies: @@ -13945,7 +14286,7 @@ packages: dev: false file:projects/tool.tgz: - resolution: {integrity: sha512-g3G79v0AQpHzqbZpmFsGU4wNu3BIcTMgR/Rod6Cfi9w0TpNS1XnSSckZeHB0LtTOovvFbj82x5ESBEwq1g0hFA==, tarball: file:projects/tool.tgz} + resolution: {integrity: sha512-3L/wr78VWV79qjSBCDWg37qMPdsEzAf5STbeXuHPOaMCvkhij64Nv0wN3vzj8CRwWRuKrX0o3Ts0NLw2SSl7hQ==, tarball: file:projects/tool.tgz} name: '@rush-temp/tool' version: 0.0.0 dependencies: diff --git a/dev/docker-compose.yaml b/dev/docker-compose.yaml index 20763fe5d4..17fe333a99 100644 --- a/dev/docker-compose.yaml +++ b/dev/docker-compose.yaml @@ -65,6 +65,7 @@ services: - 8081:8080 environment: - ACCOUNTS_URL=http://localhost:3000 + - FRONT_URL=http://localhost:8081 - UPLOAD_URL=/files - TRANSACTOR_URL=ws://localhost:3333 - ELASTIC_URL=http://elastic:9200 diff --git a/dev/prod/.env b/dev/prod/.env index debea509c3..b47965b311 100644 --- a/dev/prod/.env +++ b/dev/prod/.env @@ -5,5 +5,6 @@ LOGIN_TOKEN_DEV=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6InJvc2FtdW5kQGh LOGIN_ENDPOINT_DEV=wss://transactor.hc.engineering/ TELEGRAM_URL=http://localhost:8086 +FRONT_URL=http://localhost:8080 REKONI_URL=http://localhost:4004 diff --git a/dev/prod/package.json b/dev/prod/package.json index 2c3483391a..adb1c7c3ea 100644 --- a/dev/prod/package.json +++ b/dev/prod/package.json @@ -106,6 +106,16 @@ "@anticrm/rekoni": "~0.6.0", "@anticrm/tags-assets": "~0.6.0", "@anticrm/tags": "~0.6.0", - "@anticrm/tags-resources": "~0.6.0" + "@anticrm/tags-resources": "~0.6.0", + "@anticrm/server-chunter": "~0.6.0", + "@anticrm/server-chunter-resources": "~0.6.0", + "@anticrm/server-inventory": "~0.6.0", + "@anticrm/server-inventory-resources": "~0.6.0", + "@anticrm/server-lead": "~0.6.0", + "@anticrm/server-lead-resources": "~0.6.0", + "@anticrm/server-recruit": "~0.6.0", + "@anticrm/server-recruit-resources": "~0.6.0", + "@anticrm/server-task": "~0.6.0", + "@anticrm/server-task-resources": "~0.6.0" } } diff --git a/dev/prod/src/platform-dev.ts b/dev/prod/src/platform-dev.ts index d5dbc5df06..61f7fd44a4 100644 --- a/dev/prod/src/platform-dev.ts +++ b/dev/prod/src/platform-dev.ts @@ -20,6 +20,11 @@ import { clientId } from '@anticrm/client' import { serverAttachmentId } from '@anticrm/server-attachment' import { serverContactId } from '@anticrm/server-contact' import { serverNotificationId } from '@anticrm/server-notification' +import { serverChunterId } from '@anticrm/server-chunter' +import { serverInventoryId } from '@anticrm/server-inventory' +import { serverLeadId } from '@anticrm/server-lead' +import { serverRecruitId } from '@anticrm/server-recruit' +import { serverTaskId } from '@anticrm/server-task' import { setMetadata } from '@anticrm/platform' @@ -35,7 +40,11 @@ export function configurePlatformDev() { addLocation(serverAttachmentId, () => import(/* webpackChunkName: "server-attachment" */ '@anticrm/server-attachment-resources')) addLocation(serverContactId, () => import(/* webpackChunkName: "server-contact" */ '@anticrm/server-contact-resources')) addLocation(serverNotificationId, () => import(/* webpackChunkName: "server-notification" */ '@anticrm/server-notification-resources')) - + addLocation(serverChunterId, () => import(/* webpackChunkName: "server-chunter" */ '@anticrm/server-chunter-resources')) + addLocation(serverInventoryId, () => import(/* webpackChunkName: "server-inventory" */ '@anticrm/server-inventory-resources')) + addLocation(serverLeadId, () => import(/* webpackChunkName: "server-lead" */ '@anticrm/server-lead-resources')) + addLocation(serverRecruitId, () => import(/* webpackChunkName: "server-recruit" */ '@anticrm/server-recruit-resources')) + addLocation(serverTaskId, () => import/* webpackChunkName: "server-task" */ ('@anticrm/server-task-resources')) // Set devmodel to hook client to be able to present all activity enableDevModel() } diff --git a/dev/prod/src/platform.ts b/dev/prod/src/platform.ts index 21f5d91b5f..38dcd3c363 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -69,6 +69,7 @@ export async function configurePlatform() { setMetadata(login.metadata.TelegramUrl, process.env.TELEGRAM_URL ?? 'http://localhost:8086') setMetadata(login.metadata.GmailUrl, process.env.GMAIL_URL ?? 'http://localhost:8087') setMetadata(login.metadata.OverrideEndpoint, process.env.LOGIN_ENDPOINT) + setMetadata(login.metadata.FrontUrl, process.env.FRONT_URL) setMetadata(rekoni.metadata.RekoniUrl, process.env.REKONI_URL) diff --git a/dev/tool/package.json b/dev/tool/package.json index 14fa4685e4..956db5bb9a 100644 --- a/dev/tool/package.json +++ b/dev/tool/package.json @@ -75,6 +75,16 @@ "@anticrm/server-contact-resources": "~0.6.0", "@anticrm/server-notification": "~0.6.0", "@anticrm/server-notification-resources": "~0.6.0", - "@anticrm/server-tool": "~0.6.0" + "@anticrm/server-tool": "~0.6.0", + "@anticrm/server-chunter": "~0.6.0", + "@anticrm/server-chunter-resources": "~0.6.0", + "@anticrm/server-inventory": "~0.6.0", + "@anticrm/server-inventory-resources": "~0.6.0", + "@anticrm/server-lead": "~0.6.0", + "@anticrm/server-lead-resources": "~0.6.0", + "@anticrm/server-recruit": "~0.6.0", + "@anticrm/server-recruit-resources": "~0.6.0", + "@anticrm/server-task": "~0.6.0", + "@anticrm/server-task-resources": "~0.6.0" } } diff --git a/dev/tool/src/elastic.ts b/dev/tool/src/elastic.ts index 196f8eef8d..a1a54caa77 100644 --- a/dev/tool/src/elastic.ts +++ b/dev/tool/src/elastic.ts @@ -50,6 +50,11 @@ import { import { serverAttachmentId } from '@anticrm/server-attachment' import { serverContactId } from '@anticrm/server-contact' import { serverNotificationId } from '@anticrm/server-notification' +import { serverChunterId } from '@anticrm/server-chunter' +import { serverInventoryId } from '@anticrm/server-inventory' +import { serverLeadId } from '@anticrm/server-lead' +import { serverRecruitId } from '@anticrm/server-recruit' +import { serverTaskId } from '@anticrm/server-task' import { Client as ElasticClient } from '@elastic/elasticsearch' import { Client } from 'minio' import { Db, MongoClient } from 'mongodb' @@ -106,6 +111,11 @@ export class ElasticTool { addLocation(serverAttachmentId, () => import('@anticrm/server-attachment-resources')) addLocation(serverContactId, () => import('@anticrm/server-contact-resources')) addLocation(serverNotificationId, () => import('@anticrm/server-notification-resources')) + addLocation(serverChunterId, () => import(/* webpackChunkName: "server-chunter" */ '@anticrm/server-chunter-resources')) + addLocation(serverInventoryId, () => import(/* webpackChunkName: "server-inventory" */ '@anticrm/server-inventory-resources')) + addLocation(serverLeadId, () => import(/* webpackChunkName: "server-lead" */ '@anticrm/server-lead-resources')) + addLocation(serverRecruitId, () => import(/* webpackChunkName: "server-recruit" */ '@anticrm/server-recruit-resources')) + addLocation(serverTaskId, () => import/* webpackChunkName: "server-task" */ ('@anticrm/server-task-resources')) this.mongoClient = new MongoClient(mongoUrl) } diff --git a/models/all/package.json b/models/all/package.json index ceb8314bd2..611325d56a 100644 --- a/models/all/package.json +++ b/models/all/package.json @@ -46,6 +46,11 @@ "@anticrm/model-server-attachment": "~0.6.0", "@anticrm/model-server-contact": "~0.6.0", "@anticrm/model-server-notification": "~0.6.0", + "@anticrm/model-server-chunter": "~0.6.0", + "@anticrm/model-server-task": "~0.6.0", + "@anticrm/model-server-recruit": "~0.6.0", + "@anticrm/model-server-lead": "~0.6.0", + "@anticrm/model-server-inventory": "~0.6.0", "@anticrm/model-activity": "~0.6.0", "@anticrm/model-attachment": "~0.6.0", "@anticrm/model-gmail": "~0.6.0", diff --git a/models/all/src/index.ts b/models/all/src/index.ts index 77e005709a..2b1aa62ee1 100644 --- a/models/all/src/index.ts +++ b/models/all/src/index.ts @@ -31,6 +31,11 @@ import { createModel as recruitModel } from '@anticrm/model-recruit' import { createModel as serverAttachmentModel } from '@anticrm/model-server-attachment' 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' +import { createModel as serverInventoryModel } from '@anticrm/model-server-inventory' +import { createModel as serverLeadModel } from '@anticrm/model-server-lead' +import { createModel as serverTaskModel } from '@anticrm/model-server-task' +import { createModel as serverRecruitModel } from '@anticrm/model-server-recruit' import { createModel as serverCoreModel } from '@anticrm/model-server-core' import { createModel as settingModel } from '@anticrm/model-setting' import { createModel as taskModel } from '@anticrm/model-task' @@ -70,7 +75,11 @@ const builders = [ serverContactModel, serverNotificationModel, tagsModel, - + serverChunterModel, + serverInventoryModel, + serverLeadModel, + serverTaskModel, + serverRecruitModel, createDemo ] diff --git a/models/all/src/migration.ts b/models/all/src/migration.ts index 7ded8b3270..7d59ed8c71 100644 --- a/models/all/src/migration.ts +++ b/models/all/src/migration.ts @@ -20,6 +20,7 @@ import { coreOperation } from '@anticrm/model-core' import { taskOperation } from '@anticrm/model-task' import { attachmentOperation } from '@anticrm/model-attachment' import { leadOperation } from '@anticrm/model-lead' +import { notificationOperation } from '@anticrm/model-notification' import { recruitOperation } from '@anticrm/model-recruit' import { viewOperation } from '@anticrm/model-view' import { contactOperation } from '@anticrm/model-contact' @@ -33,5 +34,6 @@ export const migrateOperations: MigrateOperation[] = [ recruitOperation, viewOperation, contactOperation, - tagsOperation + tagsOperation, + notificationOperation ] diff --git a/models/contact/package.json b/models/contact/package.json index 1a5352d498..73b352a021 100644 --- a/models/contact/package.json +++ b/models/contact/package.json @@ -36,6 +36,6 @@ "@anticrm/ui": "~0.6.0", "@anticrm/platform": "~0.6.5", "@anticrm/contact": "~0.6.2", - "@anticrm/workbench": "~0.6.1" + "@anticrm/contact-resources": "~0.6.0" } } diff --git a/models/contact/src/index.ts b/models/contact/src/index.ts index 670c81d3a1..16f81e1eec 100644 --- a/models/contact/src/index.ts +++ b/models/contact/src/index.ts @@ -29,7 +29,7 @@ import presentation from '@anticrm/model-presentation' import view from '@anticrm/model-view' import workbench from '@anticrm/model-workbench' import type { Asset, IntlString } from '@anticrm/platform' -import { ids as contact } from './plugin' +import contact from './plugin' export const DOMAIN_CONTACT = 'contact' as Domain export const DOMAIN_CHANNEL = 'channel' as Domain diff --git a/models/contact/src/plugin.ts b/models/contact/src/plugin.ts index 0ce2023dd7..85f57ccace 100644 --- a/models/contact/src/plugin.ts +++ b/models/contact/src/plugin.ts @@ -15,16 +15,13 @@ import { IntlString, mergeIds, Resource } from '@anticrm/platform' import type { Ref } from '@anticrm/core' -import contact, { contactId } from '@anticrm/contact' +import { contactId } from '@anticrm/contact' +import contact from '@anticrm/contact-resources/src/plugin' import type { AnyComponent } from '@anticrm/ui' import {} from '@anticrm/core' -import { Application } from '@anticrm/workbench' import { ObjectSearchCategory, ObjectSearchFactory } from '@anticrm/model-presentation' -export const ids = mergeIds(contactId, contact, { - app: { - Contacts: '' as Ref - }, +export default mergeIds(contactId, contact, { component: { PersonPresenter: '' as AnyComponent, ContactPresenter: '' as AnyComponent, @@ -39,13 +36,7 @@ export const ids = mergeIds(contactId, contact, { Contacts: '' as AnyComponent }, string: { - Organizations: '' as IntlString, - OrganizationsFolder: '' as IntlString, - PersonsFolder: '' as IntlString, Persons: '' as IntlString, - Contacts: '' as IntlString, - CreatePersons: '' as IntlString, - CreateOrganizations: '' as IntlString, SearchEmployee: '' as IntlString, SearchPerson: '' as IntlString, SearchOrganization: '' as IntlString, diff --git a/models/inventory/src/plugin.ts b/models/inventory/src/plugin.ts index 68f1670120..c2b53e719c 100644 --- a/models/inventory/src/plugin.ts +++ b/models/inventory/src/plugin.ts @@ -20,12 +20,8 @@ import inventory from '@anticrm/inventory-resources/src/plugin' import { mergeIds, Resource } from '@anticrm/platform' import type { AnyComponent } from '@anticrm/ui' import { Action } from '@anticrm/view' -import { Application } from '@anticrm/workbench' export default mergeIds(inventoryId, inventory, { - app: { - Inventory: '' as Ref - }, action: { CreateSubcategory: '' as Ref }, diff --git a/models/lead/src/plugin.ts b/models/lead/src/plugin.ts index d01432f513..463806a516 100644 --- a/models/lead/src/plugin.ts +++ b/models/lead/src/plugin.ts @@ -21,12 +21,8 @@ import type { IntlString } from '@anticrm/platform' import { mergeIds } from '@anticrm/platform' import { KanbanTemplate } from '@anticrm/task' import type { AnyComponent } from '@anticrm/ui' -import { Application } from '@anticrm/workbench' export default mergeIds(leadId, lead, { - app: { - Lead: '' as Ref - }, string: { Funnel: '' as IntlString, Funnels: '' as IntlString, diff --git a/models/notification/package.json b/models/notification/package.json index c468986fb8..65caf43ba1 100644 --- a/models/notification/package.json +++ b/models/notification/package.json @@ -30,6 +30,7 @@ "@anticrm/ui": "~0.6.0", "@anticrm/platform": "~0.6.5", "@anticrm/model-core": "~0.6.0", - "@anticrm/notification": "~0.6.0" + "@anticrm/notification": "~0.6.0", + "@anticrm/setting": "~0.6.0" } } diff --git a/models/notification/src/index.ts b/models/notification/src/index.ts index 3395d42bb3..00cc131059 100644 --- a/models/notification/src/index.ts +++ b/models/notification/src/index.ts @@ -14,25 +14,26 @@ // limitations under the License. // -import type { Account, Doc, Domain, Ref, Timestamp, TxCUD } from '@anticrm/core' -import { Builder, Model, Prop, TypeRef, TypeString, TypeTimestamp } from '@anticrm/model' -import core, { TAttachedDoc } from '@anticrm/model-core' -import type { LastView, Notification, NotificationStatus } from '@anticrm/notification' -import notificaton from './plugin' +import { Account, Doc, Domain, DOMAIN_MODEL, Ref, Timestamp, TxCUD } from '@anticrm/core' +import { ArrOf, Builder, Model, Prop, TypeRef, TypeString, TypeTimestamp } from '@anticrm/model' +import core, { TAttachedDoc, TDoc } from '@anticrm/model-core' +import type { EmailNotification, LastView, NotificationType, NotificationProvider, NotificationSetting, Notification, NotificationStatus } from '@anticrm/notification' import type { IntlString } from '@anticrm/platform' +import notification from './plugin' +import setting from '@anticrm/setting' export const DOMAIN_NOTIFICATION = 'notification' as Domain -@Model(notificaton.class.LastView, core.class.AttachedDoc, DOMAIN_NOTIFICATION) +@Model(notification.class.LastView, core.class.AttachedDoc, DOMAIN_NOTIFICATION) export class TLastView extends TAttachedDoc implements LastView { - @Prop(TypeTimestamp(), notificaton.string.LastView) + @Prop(TypeTimestamp(), notification.string.LastView) lastView!: Timestamp @Prop(TypeRef(core.class.Account), 'Modified By' as IntlString) user!: Ref } -@Model(notificaton.class.Notification, core.class.AttachedDoc, DOMAIN_NOTIFICATION) +@Model(notification.class.Notification, core.class.AttachedDoc, DOMAIN_NOTIFICATION) export class TNotification extends TAttachedDoc implements Notification { @Prop(TypeRef(core.class.Tx), 'TX' as IntlString) tx!: Ref> @@ -41,6 +42,66 @@ export class TNotification extends TAttachedDoc implements Notification { status!: NotificationStatus } -export function createModel (builder: Builder): void { - builder.createModel(TLastView, TNotification) +@Model(notification.class.EmailNotification, core.class.Doc, DOMAIN_NOTIFICATION) +export class TEmaiNotification extends TDoc implements EmailNotification { + @Prop(TypeString(), 'Sender' as IntlString) + sender!: string + + @Prop(ArrOf(TypeString()), 'Receivers' as IntlString) + receivers!: string[] + + @Prop(TypeString(), 'Subject' as IntlString) + subject!: string + + @Prop(TypeString(), 'Text' as IntlString) + text!: string + + @Prop(TypeString(), 'Html' as IntlString) + html?: string + + @Prop(TypeString(), 'Status' as IntlString) + status!: 'new' | 'sent' } + +@Model(notification.class.NotificationType, core.class.Doc, DOMAIN_MODEL) +export class TNotificationType extends TDoc implements NotificationType { + label!: IntlString +} + +@Model(notification.class.NotificationProvider, core.class.Doc, DOMAIN_MODEL) +export class TNotificationProvider extends TDoc implements NotificationProvider { + label!: IntlString +} + +@Model(notification.class.NotificationSetting, core.class.Doc, DOMAIN_NOTIFICATION) +export class TNotificationSetting extends TDoc implements NotificationSetting { + type!: Ref + provider!: Ref + enabled!: boolean +} + +export function createModel (builder: Builder): void { + builder.createModel(TLastView, TNotification, TEmaiNotification, TNotificationType, TNotificationProvider, TNotificationSetting) + + builder.createDoc(notification.class.NotificationType, core.space.Model, { + label: notification.string.MentionNotification + }, notification.ids.MentionNotification) + + builder.createDoc(notification.class.NotificationProvider, core.space.Model, { + label: notification.string.PlatformNotification + }, notification.ids.PlatformNotification) + + builder.createDoc(notification.class.NotificationProvider, core.space.Model, { + label: notification.string.EmailNotification + }, notification.ids.EmailNotification) + + builder.createDoc(setting.class.SettingsCategory, core.space.Model, { + name: 'notifications', + label: notification.string.Notifications, + icon: notification.icon.Notifications, + component: notification.component.NotificationSettings, + order: 2500 + }, notification.ids.NotificationSettings) +} + +export { notificationOperation } from './migration' diff --git a/models/notification/src/migration.ts b/models/notification/src/migration.ts new file mode 100644 index 0000000000..98eafa9c55 --- /dev/null +++ b/models/notification/src/migration.ts @@ -0,0 +1,31 @@ +// +// 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 { Doc, DOMAIN_TX, TxCUD } from '@anticrm/core' +import { MigrateOperation, MigrationClient, MigrationUpgradeClient } from '@anticrm/model' +import notification from './plugin' + +export const notificationOperation: MigrateOperation = { + async migrate (client: MigrationClient): Promise { + const txes = await client.find>(DOMAIN_TX, { + objectClass: notification.class.LastView + }) + await Promise.all(txes.map(async (tx) => { + await client.delete(DOMAIN_TX, tx._id) + })) + }, + async upgrade (client: MigrationUpgradeClient): Promise { + } +} diff --git a/models/notification/src/plugin.ts b/models/notification/src/plugin.ts index 4c88f4bbd1..ba81088122 100644 --- a/models/notification/src/plugin.ts +++ b/models/notification/src/plugin.ts @@ -14,12 +14,18 @@ // limitations under the License. // -import { IntlString, mergeIds } from '@anticrm/platform' import notification, { notificationId } from '@anticrm/notification' -import {} from '@anticrm/ui' +import { IntlString, mergeIds } from '@anticrm/platform' +import { AnyComponent } from '@anticrm/ui' export default mergeIds(notificationId, notification, { string: { - LastView: '' as IntlString + LastView: '' as IntlString, + MentionNotification: '' as IntlString, + PlatformNotification: '' as IntlString, + EmailNotification: '' as IntlString + }, + component: { + NotificationSettings: '' as AnyComponent } }) diff --git a/models/recruit/src/plugin.ts b/models/recruit/src/plugin.ts index c2bb39a12a..dad4f801f1 100644 --- a/models/recruit/src/plugin.ts +++ b/models/recruit/src/plugin.ts @@ -21,13 +21,9 @@ import recruit from '@anticrm/recruit-resources/src/plugin' import { KanbanTemplate } from '@anticrm/task' import type { AnyComponent } from '@anticrm/ui' import type { Action } from '@anticrm/view' -import { Application } from '@anticrm/workbench' import { ObjectSearchFactory, ObjectSearchCategory } from '@anticrm/model-presentation' export default mergeIds(recruitId, recruit, { - app: { - Recruit: '' as Ref - }, action: { CreateApplication: '' as Ref }, diff --git a/models/server-chunter/.eslintrc.js b/models/server-chunter/.eslintrc.js new file mode 100644 index 0000000000..c3c2c49417 --- /dev/null +++ b/models/server-chunter/.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/server/attachment-resources/.npmignore b/models/server-chunter/.npmignore similarity index 100% rename from server/attachment-resources/.npmignore rename to models/server-chunter/.npmignore diff --git a/models/server-chunter/config/rig.json b/models/server-chunter/config/rig.json new file mode 100644 index 0000000000..e9a9ee9add --- /dev/null +++ b/models/server-chunter/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-chunter/package.json b/models/server-chunter/package.json new file mode 100644 index 0000000000..535b4f6bb6 --- /dev/null +++ b/models/server-chunter/package.json @@ -0,0 +1,36 @@ +{ + "name": "@anticrm/model-server-chunter", + "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.11", + "@anticrm/model": "~0.6.0", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-chunter": "~0.6.0", + "@anticrm/server-core": "~0.6.0", + "@anticrm/chunter": "~0.6.0", + "@anticrm/view": "~0.6.0" + } +} diff --git a/models/server-chunter/src/index.ts b/models/server-chunter/src/index.ts new file mode 100644 index 0000000000..327c76ef22 --- /dev/null +++ b/models/server-chunter/src/index.ts @@ -0,0 +1,31 @@ +// +// 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 from '@anticrm/core' +import chunter from '@anticrm/chunter' +import view from '@anticrm/view' +import serverChunter from '@anticrm/server-chunter' + +export function createModel (builder: Builder): void { + builder.mixin(chunter.class.Channel, core.class.Class, view.mixin.HTMLPresenter, { + presenter: serverChunter.function.ChannelHTMLPresenter + }) + + builder.mixin(chunter.class.Channel, core.class.Class, view.mixin.TextPresenter, { + presenter: serverChunter.function.ChannelTextPresenter + }) +} diff --git a/models/server-chunter/tsconfig.json b/models/server-chunter/tsconfig.json new file mode 100644 index 0000000000..1d60db76b4 --- /dev/null +++ b/models/server-chunter/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-contact/package.json b/models/server-contact/package.json index 712aafe855..0df954088f 100644 --- a/models/server-contact/package.json +++ b/models/server-contact/package.json @@ -29,6 +29,8 @@ "@anticrm/model": "~0.6.0", "@anticrm/platform": "~0.6.5", "@anticrm/server-contact": "~0.6.0", - "@anticrm/server-core": "~0.6.0" + "@anticrm/server-core": "~0.6.0", + "@anticrm/contact": "~0.6.2", + "@anticrm/view": "~0.6.0" } } diff --git a/models/server-contact/src/index.ts b/models/server-contact/src/index.ts index 22fe45d859..39c381858b 100644 --- a/models/server-contact/src/index.ts +++ b/models/server-contact/src/index.ts @@ -18,9 +18,27 @@ import { Builder } from '@anticrm/model' import serverCore from '@anticrm/server-core' import core from '@anticrm/core' +import contact from '@anticrm/contact' +import view from '@anticrm/view' import serverContact from '@anticrm/server-contact' export function createModel (builder: Builder): void { + builder.mixin(contact.class.Person, core.class.Class, view.mixin.HTMLPresenter, { + presenter: serverContact.function.PersonHTMLPresenter + }) + + builder.mixin(contact.class.Person, core.class.Class, view.mixin.TextPresenter, { + presenter: serverContact.function.PersonTextPresenter + }) + + builder.mixin(contact.class.Organization, core.class.Class, view.mixin.HTMLPresenter, { + presenter: serverContact.function.OrganizationHTMLPresenter + }) + + builder.mixin(contact.class.Organization, core.class.Class, view.mixin.TextPresenter, { + presenter: serverContact.function.OrganizationTextPresenter + }) + builder.createDoc(serverCore.class.Trigger, core.space.Model, { trigger: serverContact.trigger.OnContactDelete }) diff --git a/models/server-inventory/.eslintrc.js b/models/server-inventory/.eslintrc.js new file mode 100644 index 0000000000..c3c2c49417 --- /dev/null +++ b/models/server-inventory/.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/server/attachment/.npmignore b/models/server-inventory/.npmignore similarity index 100% rename from server/attachment/.npmignore rename to models/server-inventory/.npmignore diff --git a/models/server-inventory/config/rig.json b/models/server-inventory/config/rig.json new file mode 100644 index 0000000000..e9a9ee9add --- /dev/null +++ b/models/server-inventory/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-inventory/package.json b/models/server-inventory/package.json new file mode 100644 index 0000000000..1abbd02775 --- /dev/null +++ b/models/server-inventory/package.json @@ -0,0 +1,36 @@ +{ + "name": "@anticrm/model-server-inventory", + "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.11", + "@anticrm/model": "~0.6.0", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-inventory": "~0.6.0", + "@anticrm/server-core": "~0.6.0", + "@anticrm/inventory": "~0.6.0", + "@anticrm/view": "~0.6.0" + } +} diff --git a/models/server-inventory/src/index.ts b/models/server-inventory/src/index.ts new file mode 100644 index 0000000000..70b1f10d65 --- /dev/null +++ b/models/server-inventory/src/index.ts @@ -0,0 +1,31 @@ +// +// 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 from '@anticrm/core' +import inventory from '@anticrm/inventory' +import view from '@anticrm/view' +import serverInventory from '@anticrm/server-inventory' + +export function createModel (builder: Builder): void { + builder.mixin(inventory.class.Product, core.class.Class, view.mixin.HTMLPresenter, { + presenter: serverInventory.function.ProductHTMLPresenter + }) + + builder.mixin(inventory.class.Product, core.class.Class, view.mixin.TextPresenter, { + presenter: serverInventory.function.ProductTextPresenter + }) +} diff --git a/models/server-inventory/tsconfig.json b/models/server-inventory/tsconfig.json new file mode 100644 index 0000000000..1d60db76b4 --- /dev/null +++ b/models/server-inventory/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-lead/.eslintrc.js b/models/server-lead/.eslintrc.js new file mode 100644 index 0000000000..c3c2c49417 --- /dev/null +++ b/models/server-lead/.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/server/contact-resources/.npmignore b/models/server-lead/.npmignore similarity index 100% rename from server/contact-resources/.npmignore rename to models/server-lead/.npmignore diff --git a/models/server-lead/config/rig.json b/models/server-lead/config/rig.json new file mode 100644 index 0000000000..e9a9ee9add --- /dev/null +++ b/models/server-lead/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-lead/package.json b/models/server-lead/package.json new file mode 100644 index 0000000000..11ac1a8a06 --- /dev/null +++ b/models/server-lead/package.json @@ -0,0 +1,36 @@ +{ + "name": "@anticrm/model-server-lead", + "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.11", + "@anticrm/model": "~0.6.0", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-lead": "~0.6.0", + "@anticrm/server-core": "~0.6.0", + "@anticrm/lead": "~0.6.0", + "@anticrm/view": "~0.6.0" + } +} diff --git a/models/server-lead/src/index.ts b/models/server-lead/src/index.ts new file mode 100644 index 0000000000..bf7c0a07e4 --- /dev/null +++ b/models/server-lead/src/index.ts @@ -0,0 +1,31 @@ +// +// 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 from '@anticrm/core' +import lead from '@anticrm/lead' +import view from '@anticrm/view' +import serverLead from '@anticrm/server-lead' + +export function createModel (builder: Builder): void { + builder.mixin(lead.class.Lead, core.class.Class, view.mixin.HTMLPresenter, { + presenter: serverLead.function.LeadHTMLPresenter + }) + + builder.mixin(lead.class.Lead, core.class.Class, view.mixin.TextPresenter, { + presenter: serverLead.function.LeadTextPresenter + }) +} diff --git a/models/server-lead/tsconfig.json b/models/server-lead/tsconfig.json new file mode 100644 index 0000000000..1d60db76b4 --- /dev/null +++ b/models/server-lead/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-recruit/.eslintrc.js b/models/server-recruit/.eslintrc.js new file mode 100644 index 0000000000..c3c2c49417 --- /dev/null +++ b/models/server-recruit/.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/server/contact/.npmignore b/models/server-recruit/.npmignore similarity index 100% rename from server/contact/.npmignore rename to models/server-recruit/.npmignore diff --git a/models/server-recruit/config/rig.json b/models/server-recruit/config/rig.json new file mode 100644 index 0000000000..e9a9ee9add --- /dev/null +++ b/models/server-recruit/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-recruit/package.json b/models/server-recruit/package.json new file mode 100644 index 0000000000..edec4c8ff2 --- /dev/null +++ b/models/server-recruit/package.json @@ -0,0 +1,36 @@ +{ + "name": "@anticrm/model-server-recruit", + "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.11", + "@anticrm/model": "~0.6.0", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-recruit": "~0.6.0", + "@anticrm/server-core": "~0.6.0", + "@anticrm/recruit": "~0.6.0", + "@anticrm/view": "~0.6.0" + } +} diff --git a/models/server-recruit/src/index.ts b/models/server-recruit/src/index.ts new file mode 100644 index 0000000000..d0c360d1ed --- /dev/null +++ b/models/server-recruit/src/index.ts @@ -0,0 +1,39 @@ +// +// 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 from '@anticrm/core' +import recruit from '@anticrm/recruit' +import view from '@anticrm/view' +import serverRecruit from '@anticrm/server-recruit' + +export function createModel (builder: Builder): void { + builder.mixin(recruit.class.Applicant, core.class.Class, view.mixin.HTMLPresenter, { + presenter: serverRecruit.function.ApplicationHTMLPresenter + }) + + builder.mixin(recruit.class.Applicant, core.class.Class, view.mixin.TextPresenter, { + presenter: serverRecruit.function.ApplicationTextPresenter + }) + + builder.mixin(recruit.class.Vacancy, core.class.Class, view.mixin.HTMLPresenter, { + presenter: serverRecruit.function.VacancyHTMLPresenter + }) + + builder.mixin(recruit.class.Vacancy, core.class.Class, view.mixin.TextPresenter, { + presenter: serverRecruit.function.VacancyTextPresenter + }) +} diff --git a/models/server-recruit/tsconfig.json b/models/server-recruit/tsconfig.json new file mode 100644 index 0000000000..1d60db76b4 --- /dev/null +++ b/models/server-recruit/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-task/.eslintrc.js b/models/server-task/.eslintrc.js new file mode 100644 index 0000000000..c3c2c49417 --- /dev/null +++ b/models/server-task/.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/server/notification-resources/.npmignore b/models/server-task/.npmignore similarity index 100% rename from server/notification-resources/.npmignore rename to models/server-task/.npmignore diff --git a/models/server-task/config/rig.json b/models/server-task/config/rig.json new file mode 100644 index 0000000000..e9a9ee9add --- /dev/null +++ b/models/server-task/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-task/package.json b/models/server-task/package.json new file mode 100644 index 0000000000..20d71615eb --- /dev/null +++ b/models/server-task/package.json @@ -0,0 +1,36 @@ +{ + "name": "@anticrm/model-server-task", + "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.11", + "@anticrm/model": "~0.6.0", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-task": "~0.6.0", + "@anticrm/server-core": "~0.6.0", + "@anticrm/task": "~0.6.0", + "@anticrm/view": "~0.6.0" + } +} diff --git a/models/server-task/src/index.ts b/models/server-task/src/index.ts new file mode 100644 index 0000000000..18c2284325 --- /dev/null +++ b/models/server-task/src/index.ts @@ -0,0 +1,31 @@ +// +// 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 from '@anticrm/core' +import task from '@anticrm/task' +import view from '@anticrm/view' +import serverTask from '@anticrm/server-task' + +export function createModel (builder: Builder): void { + builder.mixin(task.class.Issue, core.class.Class, view.mixin.HTMLPresenter, { + presenter: serverTask.function.IssueHTMLPresenter + }) + + builder.mixin(task.class.Issue, core.class.Class, view.mixin.TextPresenter, { + presenter: serverTask.function.IssueTextPresenter + }) +} diff --git a/models/server-task/tsconfig.json b/models/server-task/tsconfig.json new file mode 100644 index 0000000000..1d60db76b4 --- /dev/null +++ b/models/server-task/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/task/src/plugin.ts b/models/task/src/plugin.ts index 51a5f667a9..96178cdfc5 100644 --- a/models/task/src/plugin.ts +++ b/models/task/src/plugin.ts @@ -20,14 +20,10 @@ import { mergeIds } from '@anticrm/platform' import { KanbanTemplate, taskId } from '@anticrm/task' import task from '@anticrm/task-resources/src/plugin' import type { AnyComponent } from '@anticrm/ui' -import { Application } from '@anticrm/workbench' import type { Action } from '@anticrm/view' import { ObjectSearchCategory, ObjectSearchFactory } from '@anticrm/model-presentation' export default mergeIds(taskId, task, { - app: { - Tasks: '' as Ref - }, action: { CreateTask: '' as Ref, EditStatuses: '' as Ref, diff --git a/models/view/src/index.ts b/models/view/src/index.ts index 24efec4c2b..47c5a81f5a 100644 --- a/models/view/src/index.ts +++ b/models/view/src/index.ts @@ -30,6 +30,8 @@ import type { ObjectFactory, ObjectValidator, Viewlet, + HTMLPresenter, + TextPresenter, ViewletDescriptor } from '@anticrm/view' import view from './plugin' @@ -98,6 +100,16 @@ export class TActionTarget extends TDoc implements ActionTarget { action!: Ref } +@Mixin(view.mixin.HTMLPresenter, core.class.Class) +export class THTMLPresenter extends TClass implements HTMLPresenter { + presenter!: Resource<(doc: Doc) => string> +} + +@Mixin(view.mixin.TextPresenter, core.class.Class) +export class TTextPresenter extends TClass implements TextPresenter { + presenter!: Resource<(doc: Doc) => string> +} + export function createModel (builder: Builder): void { builder.createModel( TAttributeEditor, @@ -110,7 +122,9 @@ export function createModel (builder: Builder): void { TObjectValidator, TObjectFactory, TObjectEditorHeader, - TObjectDDParticipant + TObjectDDParticipant, + THTMLPresenter, + TTextPresenter ) builder.mixin(core.class.TypeString, core.class.Class, view.mixin.AttributeEditor, { diff --git a/packages/ui/src/components/Grid.svelte b/packages/ui/src/components/Grid.svelte index 6b4db78196..53726189f0 100755 --- a/packages/ui/src/components/Grid.svelte +++ b/packages/ui/src/components/Grid.svelte @@ -17,7 +17,7 @@ export let rowGap: number = 2.5 export let columnGap: number = 1.5 - const style = `grid-template-columns: repeat(${column}, 1fr); row-gap: ${rowGap}rem; column-gap: ${columnGap}rem;` + $: style = `grid-template-columns: repeat(${column}, 1fr); row-gap: ${rowGap}rem; column-gap: ${columnGap}rem;`
diff --git a/packages/ui/src/components/Toggle.svelte b/packages/ui/src/components/Toggle.svelte index cee9180e8c..42c68a7358 100644 --- a/packages/ui/src/components/Toggle.svelte +++ b/packages/ui/src/components/Toggle.svelte @@ -18,7 +18,7 @@ diff --git a/packages/ui/src/components/ToggleWithLabel.svelte b/packages/ui/src/components/ToggleWithLabel.svelte index 3b1d151383..c66550d531 100644 --- a/packages/ui/src/components/ToggleWithLabel.svelte +++ b/packages/ui/src/components/ToggleWithLabel.svelte @@ -16,13 +16,16 @@
@@ -32,7 +35,7 @@ {/if}
- + {dispatch('change', on)}} />
+ diff --git a/plugins/notification-resources/src/index.ts b/plugins/notification-resources/src/index.ts index e3187abb62..b60c3561e1 100644 --- a/plugins/notification-resources/src/index.ts +++ b/plugins/notification-resources/src/index.ts @@ -16,11 +16,13 @@ import { Resources } from '@anticrm/platform' import NotificationsPopup from './components/NotificationsPopup.svelte' +import NotificationSettings from './components/NotificationSettings.svelte' export * from './utils' export default async (): Promise => ({ component: { - NotificationsPopup + NotificationsPopup, + NotificationSettings } }) diff --git a/plugins/notification/src/index.ts b/plugins/notification/src/index.ts index cf391bbecb..143bab9d21 100644 --- a/plugins/notification/src/index.ts +++ b/plugins/notification/src/index.ts @@ -35,15 +35,49 @@ export interface Notification extends AttachedDoc { status: NotificationStatus } +/** + * @public + */ +export interface EmailNotification extends Doc { + sender: string + receivers: string[] + subject: string + text: string + html?: string + status: 'new' | 'sent' +} + /** * @public */ export enum NotificationStatus { New, - EmailSent, Read } +/** + * @public + */ +export interface NotificationType extends Doc { + label: IntlString +} + +/** + * @public + */ +export interface NotificationProvider extends Doc { + label: IntlString +} + +/** + * @public + */ +export interface NotificationSetting extends Doc { + type: Ref + provider: Ref + enabled: boolean +} + /** * @public */ @@ -55,7 +89,17 @@ export const notificationId = 'notification' as Plugin const notification = plugin(notificationId, { class: { LastView: '' as Ref>, - Notification: '' as Ref> + Notification: '' as Ref>, + EmailNotification: '' as Ref>, + NotificationType: '' as Ref>, + NotificationProvider: '' as Ref>, + NotificationSetting: '' as Ref> + }, + ids: { + MentionNotification: '' as Ref, + PlatformNotification: '' as Ref, + EmailNotification: '' as Ref, + NotificationSettings: '' as Ref }, component: { NotificationsPopup: '' as AnyComponent diff --git a/plugins/recruit-resources/package.json b/plugins/recruit-resources/package.json index 3cdf14f051..411e1f9509 100644 --- a/plugins/recruit-resources/package.json +++ b/plugins/recruit-resources/package.json @@ -41,6 +41,7 @@ "@anticrm/chunter": "~0.6.0", "@anticrm/contact": "~0.6.2", "@anticrm/login": "~0.6.1", + "@anticrm/workbench": "~0.6.1", "deep-equal": "^2.0.5", "@anticrm/panel": "~0.6.0", "@anticrm/activity": "~0.6.0", diff --git a/plugins/recruit-resources/src/index.ts b/plugins/recruit-resources/src/index.ts index e162059adf..3e59296aa1 100644 --- a/plugins/recruit-resources/src/index.ts +++ b/plugins/recruit-resources/src/index.ts @@ -14,8 +14,8 @@ // import type { Client, Doc } from '@anticrm/core' -import { IntlString, OK, Resources, Severity, Status, translate } from '@anticrm/platform' -import { Applicant } from '@anticrm/recruit' +import { getMetadata, IntlString, OK, Resources, Severity, Status, translate } from '@anticrm/platform' +import { Applicant, Vacancy } from '@anticrm/recruit' import { showPopup } from '@anticrm/ui' import ApplicationPresenter from './components/ApplicationPresenter.svelte' import Applications from './components/Applications.svelte' @@ -34,6 +34,9 @@ import task from '@anticrm/task' import ApplicationItem from './components/ApplicationItem.svelte' import VacancyPresenter from './components/VacancyPresenter.svelte' import SkillsView from './components/SkillsView.svelte' +import login from '@anticrm/login' +import workbench from '@anticrm/workbench' +import view from '@anticrm/view' async function createApplication (object: Doc): Promise { showPopup(CreateApplication, { candidate: object._id, preserveCandidate: true }) diff --git a/plugins/recruit-resources/src/plugin.ts b/plugins/recruit-resources/src/plugin.ts index 469b66fd11..44d944c5f2 100644 --- a/plugins/recruit-resources/src/plugin.ts +++ b/plugins/recruit-resources/src/plugin.ts @@ -17,7 +17,6 @@ import { Ref, Space } from '@anticrm/core' import type { IntlString, StatusCode } from '@anticrm/platform' import { mergeIds } from '@anticrm/platform' import recruit, { recruitId } from '@anticrm/recruit' -import { AnyComponent } from '@anticrm/ui' export default mergeIds(recruitId, recruit, { status: { @@ -63,8 +62,5 @@ export default mergeIds(recruitId, recruit, { }, space: { CandidatesPublic: '' as Ref - }, - component: { - EditVacancy: '' as AnyComponent } }) diff --git a/plugins/recruit/package.json b/plugins/recruit/package.json index cd1ba19025..151be019d3 100644 --- a/plugins/recruit/package.json +++ b/plugins/recruit/package.json @@ -30,6 +30,7 @@ "@anticrm/core": "~0.6.11", "@anticrm/contact": "~0.6.2", "@anticrm/chunter": "~0.6.0", - "@anticrm/task": "~0.6.0" + "@anticrm/task": "~0.6.0", + "@anticrm/ui": "~0.6.0" } } diff --git a/plugins/recruit/src/index.ts b/plugins/recruit/src/index.ts index 4299c3c154..0740c563c4 100644 --- a/plugins/recruit/src/index.ts +++ b/plugins/recruit/src/index.ts @@ -14,10 +14,11 @@ // import type { Person } from '@anticrm/contact' -import type { Class, Mixin, Ref, Space, Timestamp } from '@anticrm/core' +import type { Class, Doc, Mixin, Ref, Space, Timestamp } from '@anticrm/core' import type { Asset, Plugin } from '@anticrm/platform' import { plugin } from '@anticrm/platform' import type { KanbanTemplateSpace, SpaceWithStates, Task } from '@anticrm/task' +import { AnyComponent } from '@anticrm/ui' /** * @public @@ -64,6 +65,9 @@ export const recruitId = 'recruit' as Plugin * @public */ const recruit = plugin(recruitId, { + app: { + Recruit: '' as Ref + }, class: { Applicant: '' as Ref>, Candidates: '' as Ref>, @@ -72,6 +76,9 @@ const recruit = plugin(recruitId, { mixin: { Candidate: '' as Ref> }, + component: { + EditVacancy: '' as AnyComponent + }, icon: { RecruitApplication: '' as Asset, Vacancy: '' as Asset, diff --git a/plugins/task-resources/src/index.ts b/plugins/task-resources/src/index.ts index 126f21b561..9e859101a4 100644 --- a/plugins/task-resources/src/index.ts +++ b/plugins/task-resources/src/index.ts @@ -15,32 +15,35 @@ // import { Class, Client, Doc, Ref } from '@anticrm/core' -import { IntlString, Resources, translate } from '@anticrm/platform' +import login from '@anticrm/login' +import { getMetadata, IntlString, Resources, translate } from '@anticrm/platform' import { getClient, MessageBox, ObjectSearchResult } from '@anticrm/presentation' -import task, { SpaceWithStates, Task, TodoItem } from '@anticrm/task' +import { Issue, SpaceWithStates, Task, TodoItem } from '@anticrm/task' +import task from './plugin' import { showPopup } from '@anticrm/ui' -import TaskItem from './components/TaskItem.svelte' +import view from '@anticrm/view' +import workbench from '@anticrm/workbench' import CreateProject from './components/CreateProject.svelte' import CreateTask from './components/CreateTask.svelte' import EditIssue from './components/EditIssue.svelte' +import KanbanTemplateEditor from './components/kanban/KanbanTemplateEditor.svelte' +import KanbanTemplateSelector from './components/kanban/KanbanTemplateSelector.svelte' import KanbanView from './components/kanban/KanbanView.svelte' import KanbanCard from './components/KanbanCard.svelte' -import DoneStatePresenter from './components/state/DoneStatePresenter.svelte' import DoneStateEditor from './components/state/DoneStateEditor.svelte' +import DoneStatePresenter from './components/state/DoneStatePresenter.svelte' import EditStatuses from './components/state/EditStatuses.svelte' import StateEditor from './components/state/StateEditor.svelte' import StatePresenter from './components/state/StatePresenter.svelte' import StatusTableView from './components/StatusTableView.svelte' import TaskHeader from './components/TaskHeader.svelte' +import TaskItem from './components/TaskItem.svelte' import TaskPresenter from './components/TaskPresenter.svelte' import TemplatesIcon from './components/TemplatesIcon.svelte' import TodoItemPresenter from './components/todos/TodoItemPresenter.svelte' import Todos from './components/todos/Todos.svelte' import TodoStatePresenter from './components/todos/TodoStatePresenter.svelte' -import KanbanTemplateEditor from './components/kanban/KanbanTemplateEditor.svelte' -import KanbanTemplateSelector from './components/kanban/KanbanTemplateSelector.svelte' - async function createTask (object: Doc): Promise { showPopup(CreateTask, { parent: object._id, space: object.space }) } diff --git a/plugins/task/src/index.ts b/plugins/task/src/index.ts index e96b4083a5..a85c22e90b 100644 --- a/plugins/task/src/index.ts +++ b/plugins/task/src/index.ts @@ -29,7 +29,6 @@ import type { Asset, IntlString, Plugin } from '@anticrm/platform' import { plugin } from '@anticrm/platform' import type { AnyComponent } from '@anticrm/ui' import { ViewletDescriptor } from '@anticrm/view' - import { genRanks } from './utils' /** @@ -176,6 +175,9 @@ export const taskId = 'task' as Plugin * @public */ const task = plugin(taskId, { + app: { + Tasks: '' as Ref + }, mixin: { KanbanCard: '' as Ref> }, diff --git a/plugins/view/src/index.ts b/plugins/view/src/index.ts index 31d0cecbf1..28b03fdec4 100644 --- a/plugins/view/src/index.ts +++ b/plugins/view/src/index.ts @@ -88,6 +88,20 @@ export interface ActionTarget extends Doc { query?: DocumentQuery } +/** + * @public + */ +export interface HTMLPresenter extends Class { + presenter: Resource<(doc: Doc) => string> +} + +/** + * @public + */ +export interface TextPresenter extends Class { + presenter: Resource<(doc: Doc) => string> +} + /** * @public */ @@ -164,7 +178,9 @@ const view = plugin(viewId, { ObjectEditorHeader: '' as Ref>, ObjectValidator: '' as Ref>, ObjectFactory: '' as Ref>, - ObjectDDParticipant: '' as Ref + ObjectDDParticipant: '' as Ref, + HTMLPresenter: '' as Ref>, + TextPresenter: '' as Ref> }, class: { ViewletDescriptor: '' as Ref>, diff --git a/plugins/workbench-resources/src/components/Workbench.svelte b/plugins/workbench-resources/src/components/Workbench.svelte index a8657375a7..2b952122a5 100644 --- a/plugins/workbench-resources/src/components/Workbench.svelte +++ b/plugins/workbench-resources/src/components/Workbench.svelte @@ -205,7 +205,7 @@ notification.class.Notification, { attachedTo: (getCurrentAccount() as EmployeeAccount).employee, - status: { $in: [NotificationStatus.New, NotificationStatus.EmailSent] } + status: NotificationStatus.New }, (res) => { hasNotification = res.length > 0 diff --git a/rush.json b/rush.json index f54e4a815c..b6ae3a1b27 100644 --- a/rush.json +++ b/rush.json @@ -723,7 +723,7 @@ }, { "packageName": "@anticrm/server-attachment", - "projectFolder": "server/attachment", + "projectFolder": "server-plugins/attachment", "shouldPublish": true }, { @@ -733,12 +733,12 @@ }, { "packageName": "@anticrm/server-attachment-resources", - "projectFolder": "server/attachment-resources", + "projectFolder": "server-plugins/attachment-resources", "shouldPublish": true }, { "packageName": "@anticrm/server-contact", - "projectFolder": "server/contact", + "projectFolder": "server-plugins/contact", "shouldPublish": true }, { @@ -748,7 +748,7 @@ }, { "packageName": "@anticrm/server-contact-resources", - "projectFolder": "server/contact-resources", + "projectFolder": "server-plugins/contact-resources", "shouldPublish": true }, { @@ -1008,7 +1008,7 @@ }, { "packageName": "@anticrm/server-notification", - "projectFolder": "server/notification", + "projectFolder": "server-plugins/notification", "shouldPublish": true }, { @@ -1018,7 +1018,7 @@ }, { "packageName": "@anticrm/server-notification-resources", - "projectFolder": "server/notification-resources", + "projectFolder": "server-plugins/notification-resources", "shouldPublish": true }, { @@ -1041,5 +1041,80 @@ "projectFolder": "models/tags", "shouldPublish": true }, + { + "packageName": "@anticrm/server-chunter", + "projectFolder": "server-plugins/chunter", + "shouldPublish": true + }, + { + "packageName": "@anticrm/model-server-chunter", + "projectFolder": "models/server-chunter", + "shouldPublish": true + }, + { + "packageName": "@anticrm/server-chunter-resources", + "projectFolder": "server-plugins/chunter-resources", + "shouldPublish": true + }, + { + "packageName": "@anticrm/server-inventory", + "projectFolder": "server-plugins/inventory", + "shouldPublish": true + }, + { + "packageName": "@anticrm/model-server-inventory", + "projectFolder": "models/server-inventory", + "shouldPublish": true + }, + { + "packageName": "@anticrm/server-inventory-resources", + "projectFolder": "server-plugins/inventory-resources", + "shouldPublish": true + }, + { + "packageName": "@anticrm/server-lead", + "projectFolder": "server-plugins/lead", + "shouldPublish": true + }, + { + "packageName": "@anticrm/model-server-lead", + "projectFolder": "models/server-lead", + "shouldPublish": true + }, + { + "packageName": "@anticrm/server-lead-resources", + "projectFolder": "server-plugins/lead-resources", + "shouldPublish": true + }, + { + "packageName": "@anticrm/server-recruit", + "projectFolder": "server-plugins/recruit", + "shouldPublish": true + }, + { + "packageName": "@anticrm/model-server-recruit", + "projectFolder": "models/server-recruit", + "shouldPublish": true + }, + { + "packageName": "@anticrm/server-recruit-resources", + "projectFolder": "server-plugins/recruit-resources", + "shouldPublish": true + }, + { + "packageName": "@anticrm/server-task", + "projectFolder": "server-plugins/task", + "shouldPublish": true + }, + { + "packageName": "@anticrm/model-server-task", + "projectFolder": "models/server-task", + "shouldPublish": true + }, + { + "packageName": "@anticrm/server-task-resources", + "projectFolder": "server-plugins/task-resources", + "shouldPublish": true + }, ] } diff --git a/server/attachment-resources/.eslintrc.js b/server-plugins/attachment-resources/.eslintrc.js similarity index 100% rename from server/attachment-resources/.eslintrc.js rename to server-plugins/attachment-resources/.eslintrc.js diff --git a/server/notification/.npmignore b/server-plugins/attachment-resources/.npmignore similarity index 100% rename from server/notification/.npmignore rename to server-plugins/attachment-resources/.npmignore diff --git a/server/attachment-resources/config/rig.json b/server-plugins/attachment-resources/config/rig.json similarity index 100% rename from server/attachment-resources/config/rig.json rename to server-plugins/attachment-resources/config/rig.json diff --git a/server/attachment-resources/package.json b/server-plugins/attachment-resources/package.json similarity index 100% rename from server/attachment-resources/package.json rename to server-plugins/attachment-resources/package.json diff --git a/server/attachment-resources/src/index.ts b/server-plugins/attachment-resources/src/index.ts similarity index 100% rename from server/attachment-resources/src/index.ts rename to server-plugins/attachment-resources/src/index.ts diff --git a/server/attachment-resources/tsconfig.json b/server-plugins/attachment-resources/tsconfig.json similarity index 100% rename from server/attachment-resources/tsconfig.json rename to server-plugins/attachment-resources/tsconfig.json diff --git a/server/attachment/.eslintrc.js b/server-plugins/attachment/.eslintrc.js similarity index 100% rename from server/attachment/.eslintrc.js rename to server-plugins/attachment/.eslintrc.js diff --git a/server-plugins/attachment/.npmignore b/server-plugins/attachment/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/attachment/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server/attachment/config/rig.json b/server-plugins/attachment/config/rig.json similarity index 100% rename from server/attachment/config/rig.json rename to server-plugins/attachment/config/rig.json diff --git a/server/attachment/package.json b/server-plugins/attachment/package.json similarity index 100% rename from server/attachment/package.json rename to server-plugins/attachment/package.json diff --git a/server/attachment/src/index.ts b/server-plugins/attachment/src/index.ts similarity index 100% rename from server/attachment/src/index.ts rename to server-plugins/attachment/src/index.ts diff --git a/server/attachment/tsconfig.json b/server-plugins/attachment/tsconfig.json similarity index 100% rename from server/attachment/tsconfig.json rename to server-plugins/attachment/tsconfig.json diff --git a/server/contact-resources/.eslintrc.js b/server-plugins/chunter-resources/.eslintrc.js similarity index 100% rename from server/contact-resources/.eslintrc.js rename to server-plugins/chunter-resources/.eslintrc.js diff --git a/server-plugins/chunter-resources/.npmignore b/server-plugins/chunter-resources/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/chunter-resources/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server/contact-resources/config/rig.json b/server-plugins/chunter-resources/config/rig.json similarity index 100% rename from server/contact-resources/config/rig.json rename to server-plugins/chunter-resources/config/rig.json diff --git a/server-plugins/chunter-resources/package.json b/server-plugins/chunter-resources/package.json new file mode 100644 index 0000000000..4b09dc1d48 --- /dev/null +++ b/server-plugins/chunter-resources/package.json @@ -0,0 +1,37 @@ +{ + "name": "@anticrm/server-chunter-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.11", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-core": "~0.6.0", + "@anticrm/chunter": "~0.6.0", + "@anticrm/view": "~0.6.0", + "@anticrm/login": "~0.6.1", + "@anticrm/workbench": "~0.6.1" + } +} diff --git a/server-plugins/chunter-resources/src/index.ts b/server-plugins/chunter-resources/src/index.ts new file mode 100644 index 0000000000..ef7d2ee72a --- /dev/null +++ b/server-plugins/chunter-resources/src/index.ts @@ -0,0 +1,45 @@ +// +// 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 chunter, { Channel } from '@anticrm/chunter' +import { Doc } from '@anticrm/core' +import login from '@anticrm/login' +import { getMetadata } from '@anticrm/platform' +import workbench from '@anticrm/workbench' + +/** + * @public + */ +export function channelHTMLPresenter (doc: Doc): string { + const channel = doc as Channel + const front = getMetadata(login.metadata.FrontUrl) ?? '' + return `${channel.name}` +} + +/** + * @public + */ +export function channelTextPresenter (doc: Doc): string { + const channel = doc as Channel + return `${channel.name}` +} + +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type +export default async () => ({ + function: { + ChannelHTMLPresenter: channelHTMLPresenter, + ChannelTextPresenter: channelTextPresenter + } +}) diff --git a/server/contact-resources/tsconfig.json b/server-plugins/chunter-resources/tsconfig.json similarity index 100% rename from server/contact-resources/tsconfig.json rename to server-plugins/chunter-resources/tsconfig.json diff --git a/server/contact/.eslintrc.js b/server-plugins/chunter/.eslintrc.js similarity index 100% rename from server/contact/.eslintrc.js rename to server-plugins/chunter/.eslintrc.js diff --git a/server-plugins/chunter/.npmignore b/server-plugins/chunter/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/chunter/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server/contact/config/rig.json b/server-plugins/chunter/config/rig.json similarity index 100% rename from server/contact/config/rig.json rename to server-plugins/chunter/config/rig.json diff --git a/server/contact-resources/package.json b/server-plugins/chunter/package.json similarity index 88% rename from server/contact-resources/package.json rename to server-plugins/chunter/package.json index 9ab83d8d88..fd26930952 100644 --- a/server/contact-resources/package.json +++ b/server-plugins/chunter/package.json @@ -1,5 +1,5 @@ { - "name": "@anticrm/server-contact-resources", + "name": "@anticrm/server-chunter", "version": "0.6.0", "main": "lib/index.js", "author": "Anticrm Platform Contributors", @@ -14,6 +14,7 @@ "devDependencies": { "@anticrm/platform-rig": "~0.6.0", "@types/heft-jest": "^1.0.2", + "@types/node": "^16.4.10", "@typescript-eslint/eslint-plugin": "^5.4.0", "eslint-plugin-import": "^2.25.3", "eslint-plugin-promise": "^5.1.1", @@ -28,7 +29,6 @@ "dependencies": { "@anticrm/core": "~0.6.11", "@anticrm/platform": "~0.6.5", - "@anticrm/server-core": "~0.6.0", - "@anticrm/contact": "~0.6.0" + "@anticrm/server-core": "~0.6.0" } } diff --git a/server-plugins/chunter/src/index.ts b/server-plugins/chunter/src/index.ts new file mode 100644 index 0000000000..fd9629905c --- /dev/null +++ b/server-plugins/chunter/src/index.ts @@ -0,0 +1,33 @@ +// +// 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 { Doc } from '@anticrm/core' + +/** + * @public + */ +export const serverChunterId = 'server-chunter' as Plugin + +/** + * @public + */ +export default plugin(serverChunterId, { + function: { + ChannelHTMLPresenter: '' as Resource<(doc: Doc) => string>, + ChannelTextPresenter: '' as Resource<(doc: Doc) => string> + } +}) diff --git a/server/contact/tsconfig.json b/server-plugins/chunter/tsconfig.json similarity index 100% rename from server/contact/tsconfig.json rename to server-plugins/chunter/tsconfig.json diff --git a/server/notification-resources/.eslintrc.js b/server-plugins/contact-resources/.eslintrc.js similarity index 100% rename from server/notification-resources/.eslintrc.js rename to server-plugins/contact-resources/.eslintrc.js diff --git a/server-plugins/contact-resources/.npmignore b/server-plugins/contact-resources/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/contact-resources/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server/notification-resources/config/rig.json b/server-plugins/contact-resources/config/rig.json similarity index 100% rename from server/notification-resources/config/rig.json rename to server-plugins/contact-resources/config/rig.json diff --git a/server-plugins/contact-resources/package.json b/server-plugins/contact-resources/package.json new file mode 100644 index 0000000000..d6cc12a534 --- /dev/null +++ b/server-plugins/contact-resources/package.json @@ -0,0 +1,37 @@ +{ + "name": "@anticrm/server-contact-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.11", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-core": "~0.6.0", + "@anticrm/contact": "~0.6.0", + "@anticrm/view": "~0.6.0", + "@anticrm/login": "~0.6.1", + "@anticrm/workbench": "~0.6.1" + } +} diff --git a/server/contact-resources/src/index.ts b/server-plugins/contact-resources/src/index.ts similarity index 53% rename from server/contact-resources/src/index.ts rename to server-plugins/contact-resources/src/index.ts index 2b749e3236..abeff5b282 100644 --- a/server/contact-resources/src/index.ts +++ b/server-plugins/contact-resources/src/index.ts @@ -14,11 +14,13 @@ // limitations under the License. // -import type { Tx, TxCreateDoc, TxRemoveDoc, TxUpdateDoc } from '@anticrm/core' -import core from '@anticrm/core' +import core, { Doc, Tx, TxCreateDoc, TxRemoveDoc, TxUpdateDoc } from '@anticrm/core' import type { TriggerControl } from '@anticrm/server-core' -import type { Contact } from '@anticrm/contact' -import contact from '@anticrm/contact' +import contact, { Contact, formatName, Organization, Person } from '@anticrm/contact' +import { getMetadata } from '@anticrm/platform' +import login from '@anticrm/login' +import workbench from '@anticrm/workbench' +import view from '@anticrm/view' /** * @public @@ -55,9 +57,49 @@ export async function OnContactDelete (tx: Tx, { findAll, hierarchy, storageFx } return [] } +/** + * @public + */ +export function personHTMLPresenter (doc: Doc): string { + const person = doc as Person + const front = getMetadata(login.metadata.FrontUrl) ?? '' + return `${formatName(person.name)}` +} + +/** + * @public + */ +export function personTextPresenter (doc: Doc): string { + const person = doc as Person + return `${formatName(person.name)}` +} + +/** + * @public + */ +export function organizationHTMLPresenter (doc: Doc): string { + const organization = doc as Organization + const front = getMetadata(login.metadata.FrontUrl) ?? '' + return `${organization.name}` +} + +/** + * @public + */ +export function organizationTextPresenter (doc: Doc): string { + const organization = doc as Organization + return `${organization.name}` +} + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type export default async () => ({ trigger: { OnContactDelete + }, + function: { + PersonHTMLPresenter: personHTMLPresenter, + PersonTextPresenter: personTextPresenter, + OrganizationHTMLPresenter: organizationHTMLPresenter, + OrganizationTextPresenter: organizationTextPresenter } }) diff --git a/server/notification-resources/tsconfig.json b/server-plugins/contact-resources/tsconfig.json similarity index 100% rename from server/notification-resources/tsconfig.json rename to server-plugins/contact-resources/tsconfig.json diff --git a/server/notification/.eslintrc.js b/server-plugins/contact/.eslintrc.js similarity index 100% rename from server/notification/.eslintrc.js rename to server-plugins/contact/.eslintrc.js diff --git a/server-plugins/contact/.npmignore b/server-plugins/contact/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/contact/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server/notification/config/rig.json b/server-plugins/contact/config/rig.json similarity index 100% rename from server/notification/config/rig.json rename to server-plugins/contact/config/rig.json diff --git a/server/contact/package.json b/server-plugins/contact/package.json similarity index 100% rename from server/contact/package.json rename to server-plugins/contact/package.json diff --git a/server/contact/src/index.ts b/server-plugins/contact/src/index.ts similarity index 76% rename from server/contact/src/index.ts rename to server-plugins/contact/src/index.ts index d937419047..344c091cf0 100644 --- a/server/contact/src/index.ts +++ b/server-plugins/contact/src/index.ts @@ -17,6 +17,7 @@ import type { Resource, Plugin } from '@anticrm/platform' import { plugin } from '@anticrm/platform' import type { TriggerFunc } from '@anticrm/server-core' +import { Doc } from '@anticrm/core' /** * @public @@ -29,5 +30,11 @@ export const serverContactId = 'server-contact' as Plugin export default plugin(serverContactId, { trigger: { OnContactDelete: '' as Resource + }, + function: { + PersonHTMLPresenter: '' as Resource<(doc: Doc) => string>, + PersonTextPresenter: '' as Resource<(doc: Doc) => string>, + OrganizationHTMLPresenter: '' as Resource<(doc: Doc) => string>, + OrganizationTextPresenter: '' as Resource<(doc: Doc) => string> } }) diff --git a/server/notification/tsconfig.json b/server-plugins/contact/tsconfig.json similarity index 100% rename from server/notification/tsconfig.json rename to server-plugins/contact/tsconfig.json diff --git a/server-plugins/inventory-resources/.eslintrc.js b/server-plugins/inventory-resources/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/server-plugins/inventory-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/inventory-resources/.npmignore b/server-plugins/inventory-resources/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/inventory-resources/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server-plugins/inventory-resources/config/rig.json b/server-plugins/inventory-resources/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/server-plugins/inventory-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/inventory-resources/package.json b/server-plugins/inventory-resources/package.json new file mode 100644 index 0000000000..3adccb24ce --- /dev/null +++ b/server-plugins/inventory-resources/package.json @@ -0,0 +1,37 @@ +{ + "name": "@anticrm/server-inventory-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.11", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-core": "~0.6.0", + "@anticrm/inventory": "~0.6.0", + "@anticrm/view": "~0.6.0", + "@anticrm/login": "~0.6.1", + "@anticrm/workbench": "~0.6.1" + } +} diff --git a/server-plugins/inventory-resources/src/index.ts b/server-plugins/inventory-resources/src/index.ts new file mode 100644 index 0000000000..f5e54a2563 --- /dev/null +++ b/server-plugins/inventory-resources/src/index.ts @@ -0,0 +1,46 @@ +// +// 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 { Doc } from '@anticrm/core' +import inventory, { Product } from '@anticrm/inventory' +import login from '@anticrm/login' +import { getMetadata } from '@anticrm/platform' +import view from '@anticrm/view' +import workbench from '@anticrm/workbench' + +/** + * @public + */ +export function productHTMLPresenter (doc: Doc): string { + const product = doc as Product + const front = getMetadata(login.metadata.FrontUrl) ?? '' + return `${product.name}` +} + +/** + * @public + */ +export function productTextPresenter (doc: Doc): string { + const product = doc as Product + return `${product.name}` +} + +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type +export default async () => ({ + function: { + ProductHTMLPresenter: productHTMLPresenter, + ProductTextPresenter: productTextPresenter + } +}) diff --git a/server-plugins/inventory-resources/tsconfig.json b/server-plugins/inventory-resources/tsconfig.json new file mode 100644 index 0000000000..aeb0517b13 --- /dev/null +++ b/server-plugins/inventory-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/inventory/.eslintrc.js b/server-plugins/inventory/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/server-plugins/inventory/.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/inventory/.npmignore b/server-plugins/inventory/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/inventory/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server-plugins/inventory/config/rig.json b/server-plugins/inventory/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/server-plugins/inventory/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/inventory/package.json b/server-plugins/inventory/package.json new file mode 100644 index 0000000000..23f47d8e81 --- /dev/null +++ b/server-plugins/inventory/package.json @@ -0,0 +1,34 @@ +{ + "name": "@anticrm/server-inventory", + "version": "0.6.1", + "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.4.10", + "@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.11", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-core": "~0.6.0" + } +} diff --git a/server-plugins/inventory/src/index.ts b/server-plugins/inventory/src/index.ts new file mode 100644 index 0000000000..bad59f6561 --- /dev/null +++ b/server-plugins/inventory/src/index.ts @@ -0,0 +1,33 @@ +// +// 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 { Doc } from '@anticrm/core' + +/** + * @public + */ +export const serverInventoryId = 'server-inventory' as Plugin + +/** + * @public + */ +export default plugin(serverInventoryId, { + function: { + ProductHTMLPresenter: '' as Resource<(doc: Doc) => string>, + ProductTextPresenter: '' as Resource<(doc: Doc) => string> + } +}) diff --git a/server-plugins/inventory/tsconfig.json b/server-plugins/inventory/tsconfig.json new file mode 100644 index 0000000000..fffbf4c341 --- /dev/null +++ b/server-plugins/inventory/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/lead-resources/.eslintrc.js b/server-plugins/lead-resources/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/server-plugins/lead-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/lead-resources/.npmignore b/server-plugins/lead-resources/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/lead-resources/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server-plugins/lead-resources/config/rig.json b/server-plugins/lead-resources/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/server-plugins/lead-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/lead-resources/package.json b/server-plugins/lead-resources/package.json new file mode 100644 index 0000000000..df676994fc --- /dev/null +++ b/server-plugins/lead-resources/package.json @@ -0,0 +1,37 @@ +{ + "name": "@anticrm/server-lead-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.11", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-core": "~0.6.0", + "@anticrm/lead": "~0.6.0", + "@anticrm/view": "~0.6.0", + "@anticrm/login": "~0.6.1", + "@anticrm/workbench": "~0.6.1" + } +} diff --git a/server-plugins/lead-resources/src/index.ts b/server-plugins/lead-resources/src/index.ts new file mode 100644 index 0000000000..c679d20c3e --- /dev/null +++ b/server-plugins/lead-resources/src/index.ts @@ -0,0 +1,46 @@ +// +// 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 { Doc } from '@anticrm/core' +import leadP, { Lead } from '@anticrm/lead' +import login from '@anticrm/login' +import { getMetadata } from '@anticrm/platform' +import view from '@anticrm/view' +import workbench from '@anticrm/workbench' + +/** + * @public + */ +export function leadHTMLPresenter (doc: Doc): string { + const lead = doc as Lead + const front = getMetadata(login.metadata.FrontUrl) ?? '' + return `${lead.title}` +} + +/** + * @public + */ +export function leadTextPresenter (doc: Doc): string { + const lead = doc as Lead + return `${lead.title}` +} + +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type +export default async () => ({ + function: { + LeadHTMLPresenter: leadHTMLPresenter, + LeadTextPresenter: leadTextPresenter + } +}) diff --git a/server-plugins/lead-resources/tsconfig.json b/server-plugins/lead-resources/tsconfig.json new file mode 100644 index 0000000000..aeb0517b13 --- /dev/null +++ b/server-plugins/lead-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/lead/.eslintrc.js b/server-plugins/lead/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/server-plugins/lead/.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/lead/.npmignore b/server-plugins/lead/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/lead/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server-plugins/lead/config/rig.json b/server-plugins/lead/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/server-plugins/lead/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/lead/package.json b/server-plugins/lead/package.json new file mode 100644 index 0000000000..e95429ab3a --- /dev/null +++ b/server-plugins/lead/package.json @@ -0,0 +1,34 @@ +{ + "name": "@anticrm/server-lead", + "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.4.10", + "@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.11", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-core": "~0.6.0" + } +} diff --git a/server-plugins/lead/src/index.ts b/server-plugins/lead/src/index.ts new file mode 100644 index 0000000000..51776d3baa --- /dev/null +++ b/server-plugins/lead/src/index.ts @@ -0,0 +1,33 @@ +// +// 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 { Doc } from '@anticrm/core' + +/** + * @public + */ +export const serverLeadId = 'server-lead' as Plugin + +/** + * @public + */ +export default plugin(serverLeadId, { + function: { + LeadHTMLPresenter: '' as Resource<(doc: Doc) => string>, + LeadTextPresenter: '' as Resource<(doc: Doc) => string> + } +}) diff --git a/server-plugins/lead/tsconfig.json b/server-plugins/lead/tsconfig.json new file mode 100644 index 0000000000..fffbf4c341 --- /dev/null +++ b/server-plugins/lead/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/notification-resources/.eslintrc.js b/server-plugins/notification-resources/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/server-plugins/notification-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/notification-resources/.npmignore b/server-plugins/notification-resources/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/notification-resources/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server-plugins/notification-resources/config/rig.json b/server-plugins/notification-resources/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/server-plugins/notification-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/notification-resources/package.json b/server-plugins/notification-resources/package.json similarity index 97% rename from server/notification-resources/package.json rename to server-plugins/notification-resources/package.json index 5571a04e1b..f443681f41 100644 --- a/server/notification-resources/package.json +++ b/server-plugins/notification-resources/package.json @@ -31,6 +31,7 @@ "@anticrm/server-core": "~0.6.0", "@anticrm/notification": "~0.6.0", "@anticrm/chunter": "~0.6.1", + "@anticrm/view": "~0.6.0", "@anticrm/contact": "~0.6.4" } } diff --git a/server-plugins/notification-resources/src/index.ts b/server-plugins/notification-resources/src/index.ts new file mode 100644 index 0000000000..1fcf6dda19 --- /dev/null +++ b/server-plugins/notification-resources/src/index.ts @@ -0,0 +1,184 @@ +// +// 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 chunter, { Backlink } from '@anticrm/chunter' +import contact, { Employee, EmployeeAccount, formatName } from '@anticrm/contact' +import core, { Class, Data, Doc, generateId, Hierarchy, Obj, Ref, Space, Tx, TxCollectionCUD, TxCreateDoc, TxProcessor } from '@anticrm/core' +import notification, { EmailNotification, Notification, NotificationStatus } from '@anticrm/notification' +import { getResource } from '@anticrm/platform' +import type { TriggerControl } from '@anticrm/server-core' +import view, { HTMLPresenter, TextPresenter } from '@anticrm/view' + +/** + * @public + */ +export async function OnBacklinkCreate (tx: Tx, control: TriggerControl): Promise { + const hierarchy = control.hierarchy + if (tx._class !== core.class.TxCollectionCUD) { + return [] + } + + const ptx = tx as TxCollectionCUD + + if ( + ptx.tx._class !== core.class.TxCreateDoc || + !hierarchy.isDerived(ptx.tx.objectClass, chunter.class.Backlink) || + !hierarchy.isDerived(ptx.objectClass, contact.class.Employee) + ) { + return [] + } + + const result: Tx[] = [] + + const createNotificationTx = await getPlatformNotificationTx(ptx, control) + + if (createNotificationTx !== undefined) { + result.push(createNotificationTx) + } + + const emailTx = await getEmailTx(ptx, control) + if (emailTx !== undefined) { + result.push(emailTx) + } + return result +} + +async function getPlatformNotificationTx (ptx: TxCollectionCUD, control: TriggerControl): Promise | undefined> { + const attached = (await control.modelDb.findAll(contact.class.EmployeeAccount, { + employee: ptx.objectId as Ref + }, { limit: 1 }))[0] + if (attached === undefined) return undefined + + const setting = (await control.findAll(notification.class.NotificationSetting, { + provider: notification.ids.PlatformNotification, + type: notification.ids.MentionNotification, + space: attached._id as unknown as Ref + }, { limit: 1 }))[0] + if (setting === undefined || !setting.enabled) return + + const createTx: TxCreateDoc = { + objectClass: notification.class.Notification, + objectSpace: notification.space.Notifications, + objectId: generateId(), + modifiedOn: ptx.modifiedOn, + modifiedBy: ptx.modifiedBy, + space: ptx.space, + _id: generateId(), + _class: core.class.TxCreateDoc, + attributes: { + tx: ptx._id, + status: NotificationStatus.New + } as unknown as Data + } + + const createNotificationTx: TxCollectionCUD = { + ...ptx, + _id: generateId(), + collection: 'notifications', + tx: createTx + } + + return createNotificationTx +} + +async function getEmailTx (ptx: TxCollectionCUD, control: TriggerControl): Promise | undefined> { + const hierarchy = control.hierarchy + const backlink = TxProcessor.createDoc2Doc(ptx.tx as TxCreateDoc) + const account = (await control.modelDb.findAll(contact.class.EmployeeAccount, { + _id: ptx.modifiedBy as Ref + }, { limit: 1 }))[0] + if (account === undefined) return undefined + + const sender = formatName(account.name) + const attached = (await control.modelDb.findAll(contact.class.EmployeeAccount, { + employee: ptx.objectId as Ref + }, { limit: 1 }))[0] + if (attached === undefined) return undefined + + const setting = (await control.findAll(notification.class.NotificationSetting, { + provider: notification.ids.EmailNotification, + type: notification.ids.MentionNotification, + space: attached._id as unknown as Ref + }, { limit: 1 }))[0] + if (setting === undefined || !setting.enabled) return + + const receiver = attached.email + let doc: Doc | undefined + if (hierarchy.isDerived(backlink.backlinkClass, core.class.Space)) { + doc = (await control.modelDb.findAll(backlink.backlinkClass, { + _id: backlink.backlinkId + }, { limit: 1 }))[0] + } else { + doc = (await control.findAll(backlink.backlinkClass, { + _id: backlink.backlinkId + }, { limit: 1 }))[0] + } + if (doc === undefined) return undefined + + const TextPresenter = getTextPresenter(doc._class, hierarchy) + if (TextPresenter === undefined) return + + const HTMLPresenter = getHTMLPresenter(doc._class, hierarchy) + const htmlPart = HTMLPresenter !== undefined ? (await getResource(HTMLPresenter.presenter))(doc) : undefined + const textPart = (await getResource(TextPresenter.presenter))(doc) + const html = `

${sender} mentioned you in ${htmlPart !== undefined ? htmlPart : textPart}

${backlink.message}` + const text = `${sender} mentioned you in ${textPart}` + return { + _id: generateId(), + objectId: generateId(), + _class: core.class.TxCreateDoc, + space: core.space.DerivedTx, + objectClass: notification.class.EmailNotification, + objectSpace: notification.space.Notifications, + modifiedOn: ptx.modifiedOn, + modifiedBy: ptx.modifiedBy, + attributes: { + status: 'new', + sender, + receivers: [receiver], + subject: `You was mentioned in ${textPart}`, + text, + html + } + } +} + +function getHTMLPresenter (_class: Ref>, hierarchy: Hierarchy): HTMLPresenter | undefined { + let clazz: Ref> | undefined = _class + while (clazz !== undefined) { + const _class = hierarchy.getClass(clazz) + const presenter = hierarchy.as(_class, view.mixin.HTMLPresenter) + if (presenter.presenter != null) return presenter + clazz = _class.extends + } +} + +function getTextPresenter (_class: Ref>, hierarchy: Hierarchy): TextPresenter | undefined { + let clazz: Ref> | undefined = _class + while (clazz !== undefined) { + const _class = hierarchy.getClass(clazz) + const presenter = hierarchy.as(_class, view.mixin.TextPresenter) + if (presenter.presenter != null) return presenter + clazz = _class.extends + } +} + +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type +export default async () => ({ + trigger: { + OnBacklinkCreate + } +}) diff --git a/server-plugins/notification-resources/tsconfig.json b/server-plugins/notification-resources/tsconfig.json new file mode 100644 index 0000000000..aeb0517b13 --- /dev/null +++ b/server-plugins/notification-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/notification/.eslintrc.js b/server-plugins/notification/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/server-plugins/notification/.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/notification/.npmignore b/server-plugins/notification/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/notification/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server-plugins/notification/config/rig.json b/server-plugins/notification/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/server-plugins/notification/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/notification/package.json b/server-plugins/notification/package.json similarity index 100% rename from server/notification/package.json rename to server-plugins/notification/package.json diff --git a/server/notification/src/index.ts b/server-plugins/notification/src/index.ts similarity index 100% rename from server/notification/src/index.ts rename to server-plugins/notification/src/index.ts diff --git a/server-plugins/notification/tsconfig.json b/server-plugins/notification/tsconfig.json new file mode 100644 index 0000000000..fffbf4c341 --- /dev/null +++ b/server-plugins/notification/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/recruit-resources/.eslintrc.js b/server-plugins/recruit-resources/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/server-plugins/recruit-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/recruit-resources/.npmignore b/server-plugins/recruit-resources/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/recruit-resources/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server-plugins/recruit-resources/config/rig.json b/server-plugins/recruit-resources/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/server-plugins/recruit-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/recruit-resources/package.json b/server-plugins/recruit-resources/package.json new file mode 100644 index 0000000000..18cb17a034 --- /dev/null +++ b/server-plugins/recruit-resources/package.json @@ -0,0 +1,37 @@ +{ + "name": "@anticrm/server-recruit-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.11", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-core": "~0.6.0", + "@anticrm/recruit": "~0.6.0", + "@anticrm/view": "~0.6.0", + "@anticrm/login": "~0.6.1", + "@anticrm/workbench": "~0.6.1" + } +} diff --git a/server-plugins/recruit-resources/src/index.ts b/server-plugins/recruit-resources/src/index.ts new file mode 100644 index 0000000000..7811d86694 --- /dev/null +++ b/server-plugins/recruit-resources/src/index.ts @@ -0,0 +1,65 @@ +// +// 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 recruit, { Applicant, Vacancy } from '@anticrm/recruit' +import { Doc } from '@anticrm/core' +import login from '@anticrm/login' +import { getMetadata } from '@anticrm/platform' +import workbench from '@anticrm/workbench' +import view from '@anticrm/view' + +/** + * @public + */ +export function vacancyHTMLPresenter (doc: Doc): string { + const vacancy = doc as Vacancy + const front = getMetadata(login.metadata.FrontUrl) ?? '' + return `${vacancy.name}` +} + +/** + * @public + */ +export function vacancyTextPresenter (doc: Doc): string { + const vacancy = doc as Vacancy + return `${vacancy.name}` +} + +/** + * @public + */ +export function applicationHTMLPresenter (doc: Doc): string { + const applicant = doc as Applicant + const front = getMetadata(login.metadata.FrontUrl) ?? '' + return `APP-${applicant.number}` +} + +/** + * @public + */ +export function applicationTextPresenter (doc: Doc): string { + const applicant = doc as Applicant + return `APP-${applicant.number}` +} + +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type +export default async () => ({ + function: { + VacancyHTMLPresenter: vacancyHTMLPresenter, + VacancyTextPresenter: vacancyTextPresenter, + ApplicationHTMLPresenter: applicationHTMLPresenter, + ApplicationTextPresenter: applicationTextPresenter + } +}) diff --git a/server-plugins/recruit-resources/tsconfig.json b/server-plugins/recruit-resources/tsconfig.json new file mode 100644 index 0000000000..aeb0517b13 --- /dev/null +++ b/server-plugins/recruit-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/recruit/.eslintrc.js b/server-plugins/recruit/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/server-plugins/recruit/.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/recruit/.npmignore b/server-plugins/recruit/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/recruit/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server-plugins/recruit/config/rig.json b/server-plugins/recruit/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/server-plugins/recruit/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/recruit/package.json b/server-plugins/recruit/package.json new file mode 100644 index 0000000000..a3cfae2efe --- /dev/null +++ b/server-plugins/recruit/package.json @@ -0,0 +1,34 @@ +{ + "name": "@anticrm/server-recruit", + "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.4.10", + "@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.11", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-core": "~0.6.0" + } +} diff --git a/server-plugins/recruit/src/index.ts b/server-plugins/recruit/src/index.ts new file mode 100644 index 0000000000..729caab6e9 --- /dev/null +++ b/server-plugins/recruit/src/index.ts @@ -0,0 +1,35 @@ +// +// 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 { Doc } from '@anticrm/core' + +/** + * @public + */ +export const serverRecruitId = 'server-recruit' as Plugin + +/** + * @public + */ +export default plugin(serverRecruitId, { + function: { + ApplicationHTMLPresenter: '' as Resource<(doc: Doc) => string>, + ApplicationTextPresenter: '' as Resource<(doc: Doc) => string>, + VacancyHTMLPresenter: '' as Resource<(doc: Doc) => string>, + VacancyTextPresenter: '' as Resource<(doc: Doc) => string> + } +}) diff --git a/server-plugins/recruit/tsconfig.json b/server-plugins/recruit/tsconfig.json new file mode 100644 index 0000000000..fffbf4c341 --- /dev/null +++ b/server-plugins/recruit/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/task-resources/.eslintrc.js b/server-plugins/task-resources/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/server-plugins/task-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/task-resources/.npmignore b/server-plugins/task-resources/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/task-resources/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server-plugins/task-resources/config/rig.json b/server-plugins/task-resources/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/server-plugins/task-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/task-resources/package.json b/server-plugins/task-resources/package.json new file mode 100644 index 0000000000..9877fcf1bc --- /dev/null +++ b/server-plugins/task-resources/package.json @@ -0,0 +1,37 @@ +{ + "name": "@anticrm/server-task-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.11", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-core": "~0.6.0", + "@anticrm/task": "~0.6.0", + "@anticrm/view": "~0.6.0", + "@anticrm/login": "~0.6.1", + "@anticrm/workbench": "~0.6.1" + } +} diff --git a/server-plugins/task-resources/src/index.ts b/server-plugins/task-resources/src/index.ts new file mode 100644 index 0000000000..2b19bb98a6 --- /dev/null +++ b/server-plugins/task-resources/src/index.ts @@ -0,0 +1,46 @@ +// +// 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 task, { Issue } from '@anticrm/task' +import { Doc } from '@anticrm/core' +import login from '@anticrm/login' +import { getMetadata } from '@anticrm/platform' +import workbench from '@anticrm/workbench' +import view from '@anticrm/view' + +/** + * @public + */ +export function issueHTMLPresenter (doc: Doc): string { + const issue = doc as Issue + const front = getMetadata(login.metadata.FrontUrl) ?? '' + return `Task-${issue.number}` +} + +/** + * @public + */ +export function issueTextPresenter (doc: Doc): string { + const issue = doc as Issue + return `Task-${issue.number}` +} + +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type +export default async () => ({ + function: { + IssueHTMLPresenter: issueHTMLPresenter, + IssueTextPresenter: issueTextPresenter + } +}) diff --git a/server-plugins/task-resources/tsconfig.json b/server-plugins/task-resources/tsconfig.json new file mode 100644 index 0000000000..aeb0517b13 --- /dev/null +++ b/server-plugins/task-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/task/.eslintrc.js b/server-plugins/task/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/server-plugins/task/.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/task/.npmignore b/server-plugins/task/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/task/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server-plugins/task/config/rig.json b/server-plugins/task/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/server-plugins/task/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/task/package.json b/server-plugins/task/package.json new file mode 100644 index 0000000000..d82d11bf64 --- /dev/null +++ b/server-plugins/task/package.json @@ -0,0 +1,34 @@ +{ + "name": "@anticrm/server-task", + "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.4.10", + "@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.11", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-core": "~0.6.0" + } +} diff --git a/server-plugins/task/src/index.ts b/server-plugins/task/src/index.ts new file mode 100644 index 0000000000..0956f9572e --- /dev/null +++ b/server-plugins/task/src/index.ts @@ -0,0 +1,33 @@ +// +// 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 { Doc } from '@anticrm/core' + +/** + * @public + */ +export const serverTaskId = 'server-task' as Plugin + +/** + * @public + */ +export default plugin(serverTaskId, { + function: { + IssueHTMLPresenter: '' as Resource<(doc: Doc) => string>, + IssueTextPresenter: '' as Resource<(doc: Doc) => string> + } +}) diff --git a/server-plugins/task/tsconfig.json b/server-plugins/task/tsconfig.json new file mode 100644 index 0000000000..fffbf4c341 --- /dev/null +++ b/server-plugins/task/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/core/src/storage.ts b/server/core/src/storage.ts index a88eefccdf..b6ef3bd3a8 100644 --- a/server/core/src/storage.ts +++ b/server/core/src/storage.ts @@ -237,6 +237,7 @@ class TServerStorage implements ServerStorage { triggerFx.fx(() => f(adapter, this.workspace)) }, findAll: fAll(ctx), + modelDb: this.modelDb, hierarchy: this.hierarchy }) )) diff --git a/server/core/src/types.ts b/server/core/src/types.ts index 1e3bf52ce1..49be48725b 100644 --- a/server/core/src/types.ts +++ b/server/core/src/types.ts @@ -15,7 +15,7 @@ // import type { Client as MinioClient } from 'minio' -import type { Tx, Ref, Doc, Class, Storage, Space, Timestamp, Account, FindResult, DocumentQuery, FindOptions, TxResult, MeasureContext } from '@anticrm/core' +import type { Tx, Ref, Doc, Class, Storage, Space, Timestamp, Account, FindResult, DocumentQuery, FindOptions, TxResult, MeasureContext, ModelDb } from '@anticrm/core' import { TxFactory, Hierarchy } from '@anticrm/core' import type { Resource } from '@anticrm/platform' @@ -26,6 +26,7 @@ export interface TriggerControl { txFactory: TxFactory findAll: Storage['findAll'] hierarchy: Hierarchy + modelDb: ModelDb fulltextFx: (f: (adapter: FullTextAdapter) => Promise) => void // Since we don't have other storages let's consider adapter is MinioClient diff --git a/server/front/kube/front.yml b/server/front/kube/front.yml index 04379efb64..75997fd0f2 100644 --- a/server/front/kube/front.yml +++ b/server/front/kube/front.yml @@ -26,6 +26,8 @@ spec: value: /files - name: TRANSACTOR_URL value: wss://transactor.hc.engineering/ + - name: FRONT_URL + value: https://front.hc.engineering/ - name: GMAIL_URL value: gmail.hc.engineering - name: ELASTIC_URL diff --git a/server/notification-resources/src/index.ts b/server/notification-resources/src/index.ts deleted file mode 100644 index b63f0fe33c..0000000000 --- a/server/notification-resources/src/index.ts +++ /dev/null @@ -1,71 +0,0 @@ -// -// Copyright © 2020, 2021 Anticrm Platform Contributors. -// Copyright © 2021, 2022 Hardcore Engineering Inc. -// -// Licensed under the Eclipse Public License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. You may -// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import chunter, { Backlink } from '@anticrm/chunter' -import contact from '@anticrm/contact' -import core, { Data, Doc, generateId, Tx, TxCollectionCUD, TxCreateDoc } from '@anticrm/core' -import notification, { Notification, NotificationStatus } from '@anticrm/notification' -import type { TriggerControl } from '@anticrm/server-core' - -/** - * @public - */ -export async function OnBacklinkCreate (tx: Tx, { findAll, hierarchy, storageFx }: TriggerControl): Promise { - if (tx._class !== core.class.TxCollectionCUD) { - return [] - } - - const ptx = tx as TxCollectionCUD - - if ( - ptx.tx._class !== core.class.TxCreateDoc || - !hierarchy.isDerived(ptx.tx.objectClass, chunter.class.Backlink) || - !hierarchy.isDerived(ptx.objectClass, contact.class.Employee) - ) { - return [] - } - - const createTx: TxCreateDoc = { - objectClass: notification.class.Notification, - objectSpace: notification.space.Notifications, - objectId: generateId(), - modifiedOn: ptx.modifiedOn, - modifiedBy: ptx.modifiedBy, - space: ptx.space, - _id: generateId(), - _class: core.class.TxCreateDoc, - attributes: { - tx: ptx._id, - status: NotificationStatus.New - } as unknown as Data - } - - const result: TxCollectionCUD = { - ...ptx, - _id: generateId(), - collection: 'notifications', - tx: createTx - } - - return [result] -} - -// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -export default async () => ({ - trigger: { - OnBacklinkCreate - } -}) diff --git a/server/server/kube/transactor.yml b/server/server/kube/transactor.yml index ef9ff67fda..3ca628f3f1 100644 --- a/server/server/kube/transactor.yml +++ b/server/server/kube/transactor.yml @@ -20,6 +20,8 @@ spec: - containerPort: 3333 imagePullPolicy: Always env: + - name: FRONT_URL + value: https://front.hc.engineering/ - name: MONGO_URL valueFrom: secretKeyRef: diff --git a/server/server/package.json b/server/server/package.json index c86d690909..3316b701e4 100644 --- a/server/server/package.json +++ b/server/server/package.json @@ -5,7 +5,7 @@ "author": "Anticrm Platform Contributors", "license": "EPL-2.0", "scripts": { - "start": "cross-env MONGO_URL=mongodb://localhost:27017 ELASTIC_URL=http://localhost:9200 MINIO_ENDPOINT=localhost MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin ts-node src/__start.ts", + "start": "cross-env MONGO_URL=mongodb://localhost:27017 ELASTIC_URL=http://localhost:9200 FRONT_URL=http://localhost:8081 MINIO_ENDPOINT=localhost MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin ts-node src/__start.ts", "build": "heft build", "lint:fix": "eslint --fix src", "bundle": "esbuild src/__start.ts --bundle --platform=node > bundle.js", @@ -49,6 +49,16 @@ "@anticrm/server-contact": "~0.6.1", "@anticrm/server-contact-resources": "~0.6.0", "@anticrm/server-notification": "~0.6.0", - "@anticrm/server-notification-resources": "~0.6.0" + "@anticrm/server-notification-resources": "~0.6.0", + "@anticrm/server-chunter": "~0.6.0", + "@anticrm/server-chunter-resources": "~0.6.0", + "@anticrm/server-inventory": "~0.6.0", + "@anticrm/server-inventory-resources": "~0.6.0", + "@anticrm/server-lead": "~0.6.0", + "@anticrm/server-lead-resources": "~0.6.0", + "@anticrm/server-recruit": "~0.6.0", + "@anticrm/server-recruit-resources": "~0.6.0", + "@anticrm/server-task": "~0.6.0", + "@anticrm/server-task-resources": "~0.6.0" } } diff --git a/server/server/src/server.ts b/server/server/src/server.ts index c8d5a7667c..21cf042656 100644 --- a/server/server/src/server.ts +++ b/server/server/src/server.ts @@ -26,6 +26,11 @@ import { addLocation } from '@anticrm/platform' import { serverAttachmentId } from '@anticrm/server-attachment' import { serverContactId } from '@anticrm/server-contact' import { serverNotificationId } from '@anticrm/server-notification' +import { serverChunterId } from '@anticrm/server-chunter' +import { serverInventoryId } from '@anticrm/server-inventory' +import { serverLeadId } from '@anticrm/server-lead' +import { serverRecruitId } from '@anticrm/server-recruit' +import { serverTaskId } from '@anticrm/server-task' import { metricsContext } from './metrics' @@ -56,6 +61,11 @@ export function start (dbUrl: string, fullTextUrl: string, minioConf: MinioConfi addLocation(serverAttachmentId, () => import('@anticrm/server-attachment-resources')) addLocation(serverContactId, () => import('@anticrm/server-contact-resources')) addLocation(serverNotificationId, () => import('@anticrm/server-notification-resources')) + addLocation(serverChunterId, () => import('@anticrm/server-chunter-resources')) + addLocation(serverInventoryId, () => import('@anticrm/server-inventory-resources')) + addLocation(serverLeadId, () => import('@anticrm/server-lead-resources')) + addLocation(serverRecruitId, () => import('@anticrm/server-recruit-resources')) + addLocation(serverTaskId, () => import('@anticrm/server-task-resources')) return startJsonRpc(metricsContext, (workspace: string) => { const conf: DbConfiguration = {