diff --git a/packages/api-client/src/client.ts b/packages/api-client/src/client.ts index db9bf10d44..be114b39bb 100644 --- a/packages/api-client/src/client.ts +++ b/packages/api-client/src/client.ts @@ -15,6 +15,7 @@ import { getClient as getAccountClient } from '@hcengineering/account-client' import client, { clientId } from '@hcengineering/client' import { + type Account, type Class, type Client, type Data, @@ -34,7 +35,6 @@ import { Mixin, MixinData, MixinUpdate, - PersonId, TxOperations, WorkspaceUuid, generateId, @@ -61,14 +61,22 @@ export async function connect (url: string, options: ConnectOptions): Promise si._id), + fullSocialIds: socialIds + } + + return await createClient(url, endpoint, token, wsLoginInfo.workspace, account, config, options) } async function createClient ( @@ -76,7 +84,7 @@ async function createClient ( endpoint: string, token: string, workspaceUuid: WorkspaceUuid, - user: PersonId, + account: Account, config: ServerConfig, options: ConnectOptions ): Promise { @@ -90,7 +98,7 @@ async function createClient ( connectionTimeout }) - return new PlatformClientImpl(url, workspaceUuid, token, config, connection, user) + return new PlatformClientImpl(url, workspaceUuid, token, config, connection, account) } class PlatformClientImpl implements PlatformClient { @@ -103,9 +111,9 @@ class PlatformClientImpl implements PlatformClient { private readonly token: string, private readonly config: ServerConfig, private readonly connection: Client, - private readonly user: PersonId + private readonly account: Account ) { - this.client = new TxOperations(connection, user) + this.client = new TxOperations(connection, account.primarySocialId) this.markup = createMarkupOperations(url, workspace, token, config) } @@ -119,6 +127,10 @@ class PlatformClientImpl implements PlatformClient { return this.client.getModel() } + async getAccount (): Promise { + return this.account + } + async findOne( _class: Ref>, query: DocumentQuery, diff --git a/packages/api-client/src/types.ts b/packages/api-client/src/types.ts index 4a7cd0a66a..0b509ceee1 100644 --- a/packages/api-client/src/types.ts +++ b/packages/api-client/src/types.ts @@ -16,6 +16,7 @@ import { type ClientSocketFactory } from '@hcengineering/client' import { CollaborativeDoc, + type Account, type AttachedData, type AttachedDoc, type Class, @@ -57,6 +58,8 @@ export type PlatformClient = { getModel: () => ModelDb + getAccount: () => Promise + close: () => Promise } & FindOperations & DocOperations & diff --git a/packages/core/.eslintrc.js b/packages/core/.eslintrc.js index ce90fb9646..72235dc283 100644 --- a/packages/core/.eslintrc.js +++ b/packages/core/.eslintrc.js @@ -1,5 +1,5 @@ module.exports = { - extends: ['./node_modules/@hcengineering/platform-rig/profiles/node/eslint.config.json'], + extends: ['./node_modules/@hcengineering/platform-rig/profiles/default/eslint.config.json'], parserOptions: { tsconfigRootDir: __dirname, project: './tsconfig.json' diff --git a/packages/core/config/rig.json b/packages/core/config/rig.json index 78cc5a1733..0110930f55 100644 --- a/packages/core/config/rig.json +++ b/packages/core/config/rig.json @@ -1,5 +1,4 @@ { "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", - "rigPackageName": "@hcengineering/platform-rig", - "rigProfile": "node" + "rigPackageName": "@hcengineering/platform-rig" } diff --git a/packages/core/package.json b/packages/core/package.json index fe94ee4852..7057e61a87 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -4,16 +4,20 @@ "main": "lib/index.js", "svelte": "src/index.ts", "types": "types/index.d.ts", + "files": [ + "lib/**/*", + "types/**/*", + "tsconfig.json" + ], "author": "Anticrm Platform Contributors", - "template": "@hcengineering/node-package", "license": "EPL-2.0", "scripts": { "build": "compile", "build:watch": "compile", - "test": "jest --passWithNoTests --silent --forceExit", + "test": "jest --passWithNoTests --silent", "format": "format src", "_phase:build": "compile transpile src", - "_phase:test": "jest --passWithNoTests --silent --forceExit", + "_phase:test": "jest --passWithNoTests --silent", "_phase:format": "format src", "_phase:validate": "compile validate" }, diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index c6a877cf6c..b5ae22f6e4 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "./node_modules/@hcengineering/platform-rig/profiles/node/tsconfig.json", + "extends": "./node_modules/@hcengineering/platform-rig/profiles/default/tsconfig.json", "compilerOptions": { "rootDir": "./src",