@@ -555,7 +555,7 @@ export async function getPersonInfo (
555
555
) : Promise < PersonInfo > {
556
556
const { account } = params
557
557
const { extra } = decodeTokenVerbose ( ctx , token )
558
- verifyAllowedServices ( [ 'workspace' , 'tool' ] , extra )
558
+ verifyAllowedServices ( [ 'workspace' , 'tool' , 'gmail' ] , extra )
559
559
560
560
if ( account == null || account === '' ) {
561
561
throw new PlatformError ( new Status ( Severity . ERROR , platform . status . BadRequest , { } ) )
@@ -908,6 +908,24 @@ export async function findFullSocialIdBySocialKey (
908
908
return await db . socialId . findOne ( { key : socialKey } )
909
909
}
910
910
911
+ export async function findFullSocialIds (
912
+ ctx : MeasureContext ,
913
+ db : AccountDB ,
914
+ branding : Branding | null ,
915
+ token : string ,
916
+ params : { socialIds : PersonId [ ] }
917
+ ) : Promise < SocialId [ ] > {
918
+ const { socialIds } = params
919
+ const { extra } = decodeTokenVerbose ( ctx , token )
920
+ verifyAllowedServices ( [ 'gmail' , 'tool' , 'workspace' ] , extra )
921
+
922
+ if ( socialIds == null || socialIds . length === 0 ) {
923
+ throw new PlatformError ( new Status ( Severity . ERROR , platform . status . BadRequest , { } ) )
924
+ }
925
+
926
+ return await db . socialId . find ( { _id : { $in : socialIds } } )
927
+ }
928
+
911
929
export async function mergeSpecifiedPersons (
912
930
ctx : MeasureContext ,
913
931
db : AccountDB ,
@@ -1009,6 +1027,7 @@ export type AccountServiceMethods =
1009
1027
| 'mergeSpecifiedAccounts'
1010
1028
| 'findPersonBySocialKey'
1011
1029
| 'listAccounts'
1030
+ | 'findFullSocialIds'
1012
1031
1013
1032
/**
1014
1033
* @public
@@ -1037,6 +1056,7 @@ export function getServiceMethods (): Partial<Record<AccountServiceMethods, Acco
1037
1056
getIntegrationSecret : wrap ( getIntegrationSecret ) ,
1038
1057
listIntegrationsSecrets : wrap ( listIntegrationsSecrets ) ,
1039
1058
findFullSocialIdBySocialKey : wrap ( findFullSocialIdBySocialKey ) ,
1059
+ findFullSocialIds : wrap ( findFullSocialIds ) ,
1040
1060
mergeSpecifiedPersons : wrap ( mergeSpecifiedPersons ) ,
1041
1061
mergeSpecifiedAccounts : wrap ( mergeSpecifiedAccounts ) ,
1042
1062
findPersonBySocialKey : wrap ( findPersonBySocialKey ) ,
0 commit comments