uberf-9691: expose full social ids in own account (#8340)

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev 2025-03-25 13:48:28 +04:00 committed by GitHub
parent 3d9c9aa8b7
commit b37c119628
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 19 additions and 9 deletions

View File

@ -74,6 +74,7 @@ export interface Account {
role: AccountRole
primarySocialId: PersonId
socialIds: PersonId[]
fullSocialIds: SocialId[]
}
/**

View File

@ -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

View File

@ -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) {

View File

@ -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

View File

@ -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') {

View File

@ -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))
}

View File

@ -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,