Add getPhoneNumberForEmail
This commit is contained in:
parent
7d8c63f52d
commit
1c9c625bb6
@ -247,6 +247,33 @@ export class SDKSignerClient {
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
async getPhoneNumberForEmail(email: string): Promise<string | null> {
|
||||
const processesData = await this.getOwnedProcesses();
|
||||
console.log(processesData);
|
||||
|
||||
// Type guard to ensure data exists and is an object
|
||||
if (!processesData.data || typeof processesData.data !== 'object' || processesData.data === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (const [processId, processData] of Object.entries(processesData.data)) {
|
||||
// Type guard to ensure processData is an object with expected properties
|
||||
if (
|
||||
processData &&
|
||||
typeof processData === 'object' &&
|
||||
'email' in processData &&
|
||||
'phoneNumber' in processData &&
|
||||
typeof processData.email === 'string' &&
|
||||
typeof processData.phoneNumber === 'string' &&
|
||||
processData.email === email
|
||||
) {
|
||||
return processData.phoneNumber;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
async createProcess(processData: { [label: string]: any }, privateFields: string[], roles: any): Promise<ServerResponse> {
|
||||
const message: ClientMessage = {
|
||||
type: MessageType.CREATE_PROCESS,
|
||||
|
Loading…
x
Reference in New Issue
Block a user