mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-11 01:40:32 +00:00
uberf-9691: expose full social ids in own account (#8340)
Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
parent
3d9c9aa8b7
commit
b37c119628
@ -74,6 +74,7 @@ export interface Account {
|
||||
role: AccountRole
|
||||
primarySocialId: PersonId
|
||||
socialIds: PersonId[]
|
||||
fullSocialIds: SocialId[]
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -90,7 +90,8 @@ export const systemAccount: Account = {
|
||||
uuid: systemAccountUuid,
|
||||
role: AccountRole.Owner,
|
||||
primarySocialId: '' as PersonId,
|
||||
socialIds: []
|
||||
socialIds: [],
|
||||
fullSocialIds: []
|
||||
}
|
||||
|
||||
export const configUserAccountUuid = '0d94731c-0787-4bcd-aefe-304efc3706b1' as AccountUuid
|
||||
|
@ -185,7 +185,8 @@ export async function connect (title: string): Promise<Client | undefined> {
|
||||
uuid: account,
|
||||
role: workspaceLoginInfo.role,
|
||||
primarySocialId: '' as PersonId,
|
||||
socialIds: []
|
||||
socialIds: [],
|
||||
fullSocialIds: []
|
||||
}
|
||||
|
||||
if (me !== undefined) {
|
||||
|
@ -348,7 +348,8 @@ export async function connect (title: string): Promise<Client | undefined> {
|
||||
uuid: account,
|
||||
role: workspaceLoginInfo.role,
|
||||
primarySocialId: pickPrimarySocialId(socialIds)._id,
|
||||
socialIds: socialIds.map((si) => si._id)
|
||||
socialIds: socialIds.map((si) => si._id),
|
||||
fullSocialIds: socialIds
|
||||
}
|
||||
|
||||
// Ensure employee and social identifiers
|
||||
|
@ -339,7 +339,8 @@ export class TSessionManager implements SessionManager {
|
||||
uuid: loginInfo.account,
|
||||
role: loginInfo.role,
|
||||
primarySocialId: '' as PersonId,
|
||||
socialIds: []
|
||||
socialIds: [],
|
||||
fullSocialIds: []
|
||||
}
|
||||
}
|
||||
|
||||
@ -348,7 +349,8 @@ export class TSessionManager implements SessionManager {
|
||||
uuid: loginInfo.account,
|
||||
role: loginInfo.role,
|
||||
primarySocialId: core.account.System,
|
||||
socialIds: []
|
||||
socialIds: [core.account.System],
|
||||
fullSocialIds: []
|
||||
}
|
||||
}
|
||||
|
||||
@ -358,7 +360,8 @@ export class TSessionManager implements SessionManager {
|
||||
uuid: loginInfo.account,
|
||||
role: loginInfo.role,
|
||||
primarySocialId: pickPrimarySocialId(socialIds)._id,
|
||||
socialIds: socialIds.map((si) => si._id)
|
||||
socialIds: socialIds.map((si) => si._id),
|
||||
fullSocialIds: socialIds
|
||||
}
|
||||
} catch (err: any) {
|
||||
if (err?.cause?.code === 'ECONNRESET' || err?.cause?.code === 'ECONNREFUSED') {
|
||||
|
@ -111,7 +111,8 @@ export class WorkspaceClient {
|
||||
uuid: this.personUuid,
|
||||
role: AccountRole.User,
|
||||
primarySocialId: this.primarySocialId._id,
|
||||
socialIds: this.socialIds.map((it) => it._id)
|
||||
socialIds: this.socialIds.map((it) => it._id),
|
||||
fullSocialIds: this.socialIds
|
||||
}
|
||||
await ensureEmployee(this.ctx, me, client, this.socialIds, async () => await getGlobalPerson(this.token))
|
||||
}
|
||||
|
@ -78,7 +78,8 @@ describe('rest-api-server', () => {
|
||||
uuid: apiWorkspace1.info.account,
|
||||
role: apiWorkspace1.info.role,
|
||||
primarySocialId: pickPrimarySocialId(socialIds)._id,
|
||||
socialIds: socialIds.map((si) => si._id)
|
||||
socialIds: socialIds.map((si) => si._id),
|
||||
fullSocialIds: socialIds
|
||||
},
|
||||
connect(),
|
||||
socialIds,
|
||||
@ -91,7 +92,8 @@ describe('rest-api-server', () => {
|
||||
uuid: apiWorkspace2.info.account,
|
||||
role: apiWorkspace2.info.role,
|
||||
primarySocialId: pickPrimarySocialId(socialIds)._id,
|
||||
socialIds: socialIds.map((si) => si._id)
|
||||
socialIds: socialIds.map((si) => si._id),
|
||||
fullSocialIds: socialIds
|
||||
},
|
||||
connect(apiWorkspace2),
|
||||
socialIds,
|
||||
|
Loading…
Reference in New Issue
Block a user