From 7d8c63f52dd8c2c8ec55035ce11f6ecce1197be6 Mon Sep 17 00:00:00 2001 From: Sosthene Date: Tue, 9 Sep 2025 11:14:55 +0200 Subject: [PATCH] Add getOfficeProcessByIdnot --- src/client.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/client.ts b/src/client.ts index ebc3279..e7651c9 100644 --- a/src/client.ts +++ b/src/client.ts @@ -295,6 +295,30 @@ export class SDKSignerClient { } } + async getOfficeProcessByIdnot(idNot: string): Promise<{ processId: string, processData: any } | null> { + console.log('Getting office process by idnot:', idNot); + try { + const signerResponse: ServerResponse = await this.getOwnedProcesses(); + // We are interested in the data + const processesData: any = signerResponse.data; + for (const [processId, processData] of Object.entries(processesData)) { + if (processData + && typeof processData === 'object' + && 'utype' in processData + && 'idNot' in processData + && (processData as any).utype === 'office' + && (processData as any).idNot === idNot + ) { + console.log('Found matching process:', processId); + return { processId, processData }; + } + } + return null; + } catch (error) { + console.error('Error getting user process by idnot:', error); + throw error; + } + } /** * Notify an update for a process