diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 0da7bdf721..f786c8b4cc 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -80,6 +80,7 @@ specifiers: '@rush-temp/recruit': file:./projects/recruit.tgz '@rush-temp/recruit-assets': file:./projects/recruit-assets.tgz '@rush-temp/recruit-resources': file:./projects/recruit-resources.tgz + '@rush-temp/rekoni': file:./projects/rekoni.tgz '@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 @@ -274,6 +275,7 @@ dependencies: '@rush-temp/recruit': file:projects/recruit.tgz '@rush-temp/recruit-assets': file:projects/recruit-assets.tgz '@rush-temp/recruit-resources': file:projects/recruit-resources.tgz_096c09b0b673a57c275d9767a12070b1 + '@rush-temp/rekoni': file:projects/rekoni.tgz_096c09b0b673a57c275d9767a12070b1 '@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 @@ -10136,6 +10138,12 @@ packages: resolution: {integrity: sha1-fRh9tcbNu9ZNdaMvkbiZi94yc8M=} dev: false + /svelte-hmr/0.14.7: + resolution: {integrity: sha512-pDrzgcWSoMaK6AJkBWkmgIsecW0GChxYZSZieIYfCP0v2oPyx2CYU/zm7TBIcjLVUPP714WxmViE9Thht4etog==} + peerDependencies: + svelte: '>=3.19.0' + dev: false + /svelte-hmr/0.14.7_svelte@3.44.3: resolution: {integrity: sha512-pDrzgcWSoMaK6AJkBWkmgIsecW0GChxYZSZieIYfCP0v2oPyx2CYU/zm7TBIcjLVUPP714WxmViE9Thht4etog==} peerDependencies: @@ -10144,6 +10152,16 @@ packages: svelte: 3.44.3 dev: false + /svelte-loader/3.1.2: + resolution: {integrity: sha512-RhVIvitb+mtIwKNyvNQoDQ0EhXg2KH8LhQiiqeJh8u6vqJyGWoMoFcYCar69TT+1iaK5IYe0wPNYJ6TILcsurw==} + peerDependencies: + svelte: '>3.0.0' + dependencies: + loader-utils: 2.0.2 + svelte-dev-helper: 1.1.9 + svelte-hmr: 0.14.7 + dev: false + /svelte-loader/3.1.2_svelte@3.44.3: resolution: {integrity: sha512-RhVIvitb+mtIwKNyvNQoDQ0EhXg2KH8LhQiiqeJh8u6vqJyGWoMoFcYCar69TT+1iaK5IYe0wPNYJ6TILcsurw==} peerDependencies: @@ -11983,7 +12001,7 @@ packages: dev: false file:projects/front.tgz: - resolution: {integrity: sha512-Nto3Qer5qe5YaIELZhEaJugu6x/1SbThjaKd0Yyc5BCo6UfjeyvQyKz0iHmTtIVfbBfzQSqj+MMBGL0k6zW3dg==, tarball: file:projects/front.tgz} + resolution: {integrity: sha512-RXsa4jlZB6UdPjSIAHmf07BEcWlH6N26QnAVFQ3QL5VdqLi73ohsPQV9seKz36c5jGsA//Z0BS9QYVCETuHdgA==, tarball: file:projects/front.tgz} name: '@rush-temp/front' version: 0.0.0 dependencies: @@ -13065,7 +13083,7 @@ packages: dev: false file:projects/prod.tgz_sass@1.45.0+typescript@4.5.4: - resolution: {integrity: sha512-E5QAAHRWBXbn+0MENtAgD6sM4IVzdCzqJHYlEzaw5TUIUZkcyCs+NRLEFBSW/uP1nfOmScrJOyFPiG59FFCeDQ==, tarball: file:projects/prod.tgz} + resolution: {integrity: sha512-mb0NOzQOQI/mZjzWLO+zp8F57x5koGPRF0qdrONOBHgKJ+wKpbSrVyW911S0nM8b/mVimVqaXCI2XdjAvYO1mg==, tarball: file:projects/prod.tgz} id: file:projects/prod.tgz name: '@rush-temp/prod' version: 0.0.0 @@ -13195,6 +13213,41 @@ packages: - supports-color dev: false + file:projects/rekoni.tgz_096c09b0b673a57c275d9767a12070b1: + resolution: {integrity: sha512-y0ghO9RbY5FeFqBM/g2AE2GWIxvfbXXDZUFgl9/QDSKfX6/G3xr2JdsSXMXUr82YAi7xRRpnIkUHmU4Zws7z1Q==, tarball: file:projects/rekoni.tgz} + id: file:projects/rekoni.tgz + name: '@rush-temp/rekoni' + version: 0.0.0 + dependencies: + '@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 + eslint-plugin-svelte3: 3.2.1_eslint@7.32.0 + prettier: 2.5.1 + prettier-plugin-svelte: 2.5.1_prettier@2.5.1 + sass: 1.45.0 + svelte-check: 2.3.0_ac194b5590200ebf8338e0f86ec190f4 + svelte-loader: 3.1.2 + svelte-preprocess: 4.10.1_3ae2e5fc7d8fb60bbcea513ad0b15c0f + typescript: 4.5.4 + transitivePeerDependencies: + - '@babel/core' + - coffeescript + - less + - node-sass + - postcss + - postcss-load-config + - pug + - stylus + - sugarss + - supports-color + - svelte + dev: false + file:projects/server-attachment-resources.tgz: resolution: {integrity: sha512-V/H2gWfte5sRJYj91+6StCv/+q2vAp6iHQRBcwBjcFJwMyuFqAQMhaGsWvJtAgtIENRY/22/I8KWiwg8O74XCg==, tarball: file:projects/server-attachment-resources.tgz} name: '@rush-temp/server-attachment-resources' diff --git a/dev/prod/.env b/dev/prod/.env index 0c57ea2fed..debea509c3 100644 --- a/dev/prod/.env +++ b/dev/prod/.env @@ -5,3 +5,5 @@ LOGIN_TOKEN_DEV=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6InJvc2FtdW5kQGh LOGIN_ENDPOINT_DEV=wss://transactor.hc.engineering/ TELEGRAM_URL=http://localhost:8086 + +REKONI_URL=http://localhost:4004 diff --git a/dev/prod/.env-prod b/dev/prod/.env-prod index c4909a28d2..02b77fd49c 100644 --- a/dev/prod/.env-prod +++ b/dev/prod/.env-prod @@ -1,2 +1,3 @@ TELEGRAM_URL = https://telegram.hc.engineering +REKONI_URL = https://rekini.hc.engineering \ No newline at end of file diff --git a/dev/prod/config.json b/dev/prod/config.json index d915d990f8..9a68daead4 100644 --- a/dev/prod/config.json +++ b/dev/prod/config.json @@ -1 +1,5 @@ -{"ACCOUNTS_URL":"http://localhost:3000","UPLOAD_URL":"/files"} \ No newline at end of file +{ + "ACCOUNTS_URL":"http://localhost:3000", + "UPLOAD_URL":"/files", + "REKONI_URL": "http://localhost:4004" +} \ No newline at end of file diff --git a/dev/prod/package.json b/dev/prod/package.json index 5a3bfbc4db..182dab0de6 100644 --- a/dev/prod/package.json +++ b/dev/prod/package.json @@ -97,6 +97,7 @@ "@anticrm/templates": "~0.6.0", "@anticrm/templates-assets": "~0.6.0", "@anticrm/templates-resources": "~0.6.0", - "@anticrm/core": "~0.6.16" + "@anticrm/core": "~0.6.16", + "@anticrm/rekoni": "~0.6.0" } } diff --git a/dev/prod/src/platform.ts b/dev/prod/src/platform.ts index 0d19c6f107..69290d2fa7 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -33,6 +33,7 @@ import { gmailId } from '@anticrm/gmail' import { imageCropperId } from '@anticrm/image-cropper' import { inventoryId } from '@anticrm/inventory' import { templatesId } from '@anticrm/templates' +import rekoni from '@anticrm/rekoni' import '@anticrm/login-assets' import '@anticrm/task-assets' @@ -57,6 +58,7 @@ export async function configurePlatform() { setMetadata(login.metadata.AccountsUrl, config.ACCOUNTS_URL) setMetadata(login.metadata.UploadUrl, config.UPLOAD_URL) + if( config.MODEL_VERSION != null) { console.log('Minimal Model version requirement', config.MODEL_VERSION) setMetadata(workbench.metadata.RequiredVersion, config.MODEL_VERSION) @@ -65,6 +67,8 @@ export async function configurePlatform() { setMetadata(login.metadata.GmailUrl, process.env.GMAIL_URL ?? 'http://localhost:8087') setMetadata(login.metadata.OverrideEndpoint, process.env.LOGIN_ENDPOINT) + setMetadata(rekoni.metadata.RekoniUrl, process.env.REKONI_URL) + addLocation(clientId, () => import(/* webpackChunkName: "client" */ '@anticrm/client-resources')) addLocation(loginId, () => import(/* webpackChunkName: "login" */ '@anticrm/login-resources')) addLocation(workbenchId, () => import(/* webpackChunkName: "workbench" */ '@anticrm/workbench-resources')) diff --git a/packages/presentation/src/components/Channels.svelte b/packages/presentation/src/components/Channels.svelte index 389fdafd1a..13b5bb530d 100644 --- a/packages/presentation/src/components/Channels.svelte +++ b/packages/presentation/src/components/Channels.svelte @@ -14,7 +14,7 @@ // limitations under the License. --> diff --git a/packages/rekoni/.eslintrc.js b/packages/rekoni/.eslintrc.js new file mode 100644 index 0000000000..a327214967 --- /dev/null +++ b/packages/rekoni/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@anticrm/platform-rig/profiles/ui/config/eslint.config.json'], + parserOptions: { tsconfigRootDir: __dirname }, + settings: { + 'svelte3/ignore-styles': () => true + } +} diff --git a/packages/rekoni/package.json b/packages/rekoni/package.json new file mode 100644 index 0000000000..c51c86660c --- /dev/null +++ b/packages/rekoni/package.json @@ -0,0 +1,37 @@ +{ + "name": "@anticrm/rekoni", + "version": "0.6.0", + "main": "src/index.ts", + "author": "Anticrm Platform Contributors", + "license": "EPL-2.0", + "scripts": { + "build": "echo 'no build for ui'", + "build:docs": "api-extractor run --local", + "lint": "svelte-check && eslint", + "lint:fix": "eslint --fix src", + "format": "prettier --write --plugin-search-dir=. src && eslint --fix src", + "svelte-check": "svelte-check" + }, + "devDependencies": { + "svelte-loader": "^3.1.2", + "sass": "^1.37.5", + "svelte-preprocess": "^4.7.4", + "@anticrm/platform-rig": "~0.6.0", + "@typescript-eslint/eslint-plugin": "^5.4.0", + "@typescript-eslint/parser": "^5.4.0", + "eslint-config-standard-with-typescript": "^21.0.1", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^5.1.1", + "eslint-plugin-svelte3": "~3.2.1", + "prettier-plugin-svelte": "^2.2.0", + "eslint": "^7.32.0", + "prettier": "^2.4.1", + "svelte-check": "^2.2.10", + "typescript": "^4.3.5" + }, + "dependencies": { + "@anticrm/platform": "~0.6.5", + "@anticrm/core": "~0.6.11" + } +} diff --git a/packages/rekoni/postcss.config.js b/packages/rekoni/postcss.config.js new file mode 100644 index 0000000000..88752c6cb0 --- /dev/null +++ b/packages/rekoni/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: [ + require('autoprefixer') + ] +} diff --git a/packages/rekoni/src/index.ts b/packages/rekoni/src/index.ts new file mode 100644 index 0000000000..262a3b1f98 --- /dev/null +++ b/packages/rekoni/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 { getMetadata, PlatformError, unknownError } from '@anticrm/platform' +import plugin from './plugin' +import { ReconiDocument } from './types' + +export { default } from './plugin' +export * from './types' + +export async function recognizeDocument (token: string, url: string): Promise { + const rekoniUrl = getMetadata(plugin.metadata.RekoniUrl) + if (rekoniUrl === undefined) { + // We could try use recognition service to find some document properties. + throw new PlatformError(unknownError('recognition framework is not configured')) + } + return await (await fetch(rekoniUrl + '/recognize?format=pdf', { + method: 'POST', + headers: { + Authorization: 'Bearer ' + token, + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + fileUrl: url + }) + })).json() as ReconiDocument +} diff --git a/packages/rekoni/src/plugin.ts b/packages/rekoni/src/plugin.ts new file mode 100644 index 0000000000..52f3d4fe03 --- /dev/null +++ b/packages/rekoni/src/plugin.ts @@ -0,0 +1,28 @@ +// +// 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 { Metadata, Plugin } from '@anticrm/platform' +import { plugin } from '@anticrm/platform' + +/** + * @public + */ +export const rekoniId = 'rekoni' as Plugin + +export default plugin(rekoniId, { + metadata: { + RekoniUrl: '' as Metadata + } +}) diff --git a/packages/rekoni/src/types.ts b/packages/rekoni/src/types.ts new file mode 100644 index 0000000000..e2ac84eb3f --- /dev/null +++ b/packages/rekoni/src/types.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. +// + +/** + * @public + */ +export interface ReconiDocument { + firstName: string + lastName: string + avatar?: string + email?: string + phone?: string + city?: string + skype?: string + linkedin?: string + gmail?: string + github?: string + facebook?: string + telegram?: string + twitter?: string +} diff --git a/packages/rekoni/tsconfig.json b/packages/rekoni/tsconfig.json new file mode 100644 index 0000000000..cabe5aefad --- /dev/null +++ b/packages/rekoni/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "moduleResolution": "node", + "target": "esnext", + "module": "esnext", + "declaration": true, + "outDir": "./lib", + "strict": true, + "esModuleInterop": true, + "lib": [ + "esnext", + "dom" + ] + } +} \ No newline at end of file diff --git a/plugins/contact-resources/src/components/Channels.svelte b/plugins/contact-resources/src/components/Channels.svelte index 9f21e7e98c..14365d4832 100644 --- a/plugins/contact-resources/src/components/Channels.svelte +++ b/plugins/contact-resources/src/components/Channels.svelte @@ -15,20 +15,20 @@ --> -{#if !channels.length} +{#if channels?.length === 0} - - 0 && lastName.length > 0} - space={contact.space.Contacts} - on:close={() => { dispatch('close') }}> - + 0 && lastName.length > 0} + space={contact.space.Contacts} + on:close={() => { + dispatch('close') + }} +>
- +
-
-
-
-
+
+
+
+
- { channels = e.detail }} /> + { + channels = e.detail + }} + />
-
{ dragover = true } } - on:dragleave={ () => { dragover = false } } - on:drop|preventDefault|stopPropagation={drop}> +
{ + dragover = true + }} + on:dragleave={() => { + dragover = false + }} + on:drop|preventDefault|stopPropagation={drop} + > {#if resume.uuid} - { showPopup(PDFViewer, { file: resume.uuid, name: resume.name }, 'right') } }/> + { + showPopup(PDFViewer, { file: resume.uuid, name: resume.name }, 'right') + }} + /> {:else} {#if loading} {:else} - { inputFile.click() } } /> + { + inputFile.click() + }} + /> {/if} - + {/if}
@@ -195,9 +314,9 @@ .locations { span { - margin-bottom: .125rem; + margin-bottom: 0.125rem; font-weight: 500; - font-size: .75rem; + font-size: 0.75rem; color: var(--theme-content-accent-color); } @@ -205,7 +324,7 @@ display: flex; justify-content: space-between; align-items: center; - margin-top: .75rem; + margin-top: 0.75rem; color: var(--theme-caption-color); } } @@ -218,11 +337,13 @@ .resume { margin-top: 1rem; - padding: .75rem; + padding: 0.75rem; background: var(--theme-zone-bg); border: 1px dashed var(--theme-zone-border); - border-radius: .5rem; + border-radius: 0.5rem; backdrop-filter: blur(10px); - &.solid { border-style: solid; } + &.solid { + border-style: solid; + } } diff --git a/rush.json b/rush.json index af2c7a5ba7..eb0eae23ac 100644 --- a/rush.json +++ b/rush.json @@ -981,6 +981,10 @@ "projectFolder": "tests/sanity", "shouldPublish": false }, - + { + "packageName": "@anticrm/rekoni", + "projectFolder": "packages/rekoni", + "shouldPublish": true + }, ] }