@eka-care/ekascribe-ts-sdk 2.1.51 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,22 @@
1
+ import { CallbackMap } from 'med-scribe-alliance-ts-sdk';
2
+ import { CallbackName as CallbackName_2 } from 'med-scribe-alliance-ts-sdk';
3
+ import { CreateSessionRequest } from 'med-scribe-alliance-ts-sdk';
4
+ import { CreateSessionResponse } from 'med-scribe-alliance-ts-sdk';
5
+ import { createWorkerBlobUrl } from 'med-scribe-alliance-ts-sdk';
6
+ import { DiscoveryDocument } from 'med-scribe-alliance-ts-sdk';
7
+ import { EndSessionRequest } from 'med-scribe-alliance-ts-sdk';
8
+ import { EndSessionResponse } from 'med-scribe-alliance-ts-sdk';
9
+ import { GetSessionStatusResponse } from 'med-scribe-alliance-ts-sdk';
10
+ import { getWorkerUrl } from 'med-scribe-alliance-ts-sdk';
11
+ import { IpcBridge as IpcBridge_2 } from 'med-scribe-alliance-ts-sdk';
12
+ import { PatchSessionRequest } from 'med-scribe-alliance-ts-sdk';
13
+ import { PatchSessionResponse } from 'med-scribe-alliance-ts-sdk';
14
+ import { PollOptions } from 'med-scribe-alliance-ts-sdk';
15
+ import { ProcessTemplateResponse } from 'med-scribe-alliance-ts-sdk';
16
+ import { ResolvedConfig } from 'med-scribe-alliance-ts-sdk';
17
+ import { ScribeClient } from 'med-scribe-alliance-ts-sdk';
18
+ import { SDKResult } from 'med-scribe-alliance-ts-sdk';
19
+
1
20
  export declare enum API_STATUS {
2
21
  NOT_INITIALIZED = "na",
3
22
  INIT = "init",
@@ -15,6 +34,8 @@ export declare enum CALLBACK_TYPE {
15
34
  STORAGE_STATUS = "storage_status"
16
35
  }
17
36
 
37
+ export declare type CallbackName = 'onRecordingStateChange' | 'onAudioEvent' | 'onUploadEvent' | 'onSessionEvent' | 'onError' | 'onTokenRequired';
38
+
18
39
  export declare enum COMPATIBILITY_TEST_STATUS {
19
40
  SUCCESS = "success",
20
41
  ERROR = "error",
@@ -29,47 +50,101 @@ export declare enum COMPATIBILITY_TEST_TYPE {
29
50
  NETWORK_API = "NETWORK_API"
30
51
  }
31
52
 
53
+ export { CreateSessionRequest }
54
+
55
+ export { CreateSessionResponse }
56
+
57
+ export { createWorkerBlobUrl }
58
+
59
+ export { DiscoveryDocument }
60
+
61
+ declare class DocumentManager {
62
+ private transport;
63
+ private hosts;
64
+ private allianceClient;
65
+ constructor(transport: ITransport, hosts: EkaHosts, allianceClient: ScribeClient);
66
+ getAllTemplates(): Promise<TGetV1TemplatesResponse>;
67
+ createTemplate({ title, desc, section_ids, }: TPostV1TemplateRequest): Promise<TPostV1TemplateResponse>;
68
+ updateTemplate({ template_id, title, desc, section_ids, }: TPostV1TemplateRequest): Promise<TPostV1TemplateResponse>;
69
+ deleteTemplate(templateId: string): Promise<TPostV1TemplateResponse>;
70
+ aiGenerateTemplate(formData: FormData): Promise<TPostCookV1MediaAiCreateTemplateResponse>;
71
+ convertToTemplate({ txn_id, template_id, }: {
72
+ txn_id: string;
73
+ template_id: string;
74
+ }): Promise<SDKResult<ProcessTemplateResponse>>;
75
+ convertTranscriptionToTemplate({ txn_id, template_id, transcript, target_language, }: TPostV1ConvertToTemplateRequest): Promise<TPostV1ConvertToTemplateResponse>;
76
+ getAllTemplateSections(): Promise<TGetV1TemplateSectionsResponse>;
77
+ createTemplateSection({ title, desc, format, example, }: TPostV1TemplateSectionRequest): Promise<TPostV1TemplateSectionResponse>;
78
+ updateTemplateSection({ section_id, title, desc, format, example, }: TPostV1TemplateSectionRequest): Promise<TPostV1TemplateSectionResponse>;
79
+ deleteTemplateSection(sectionId: string): Promise<TPostV1TemplateSectionResponse>;
80
+ getDocument(documentId: string): Promise<TPostV1DocumentResponse>;
81
+ createDocument({ session_id, document_name, type, document_id, publish, }: TPostV1DocumentRequest): Promise<TPostV1DocumentResponse>;
82
+ updateDocument({ session_id, document_name, type, document_id, publish, }: TPostV1DocumentRequest): Promise<TPostV1DocumentResponse>;
83
+ deleteDocument(documentId: string): Promise<TDeleteV1DocumentResponse>;
84
+ publishDocument({ session_id, document_id, }: TPostV1DocumentRequest): Promise<TPostV1DocumentResponse>;
85
+ }
86
+
87
+ declare type EkaHosts = {
88
+ voiceV1: string;
89
+ voiceV2: string;
90
+ voiceV3: string;
91
+ cookV1: string;
92
+ ekaHost: string;
93
+ parchiHost: string;
94
+ };
95
+
32
96
  declare class EkaScribe {
33
97
  private static instance;
34
- private vadInstance;
35
- private audioFileManagerInstance;
36
- private audioBufferInstance;
37
- private compatibilityManager;
98
+ private transport;
99
+ private hosts;
100
+ private callbackRegistry;
101
+ private tracker;
102
+ private config;
103
+ private allianceClient;
104
+ private recording;
105
+ private output;
106
+ readonly documents: DocumentManager;
107
+ readonly sessions: SessionUtils;
38
108
  private constructor();
39
- static getInstance({ access_token, env, clientId, flavour, enableSentryLogs, }: {
40
- access_token?: string;
41
- env?: 'PROD' | 'DEV';
42
- clientId?: string;
43
- flavour?: string;
44
- enableSentryLogs?: boolean;
45
- }): EkaScribe;
46
- resetInstance(): void;
47
- getEkascribeConfig(): Promise<TGetConfigV2Response>;
48
- updateAuthTokens({ access_token }: {
49
- access_token: string;
50
- }): void;
51
- initTransaction(request: TPostTransactionInitRequest, sharedWorkerUrl?: string): Promise<TStartRecordingResponse>;
109
+ static getInstance(config: EkaScribeConfig): EkaScribe;
110
+ /** @deprecated Backward compatible */
111
+ initTransaction(request: TPostTransactionInitRequest): Promise<TStartRecordingResponse>;
52
112
  startRecording(microphoneID?: string): Promise<TStartRecordingResponse>;
53
113
  startRecordingForExistingSession(request: TStartRecordingForExistingSessionRequest): Promise<TStartRecordingResponse>;
54
- reinitializeVad(): Promise<void>;
55
- destroyVad(): void;
56
- pauseVad(): void;
57
114
  pauseRecording(): TPauseRecordingResponse;
58
115
  resumeRecording(): TPauseRecordingResponse;
59
116
  endRecording(): Promise<TEndRecordingResponse>;
60
- retryUploadRecording({ force_commit }: {
61
- force_commit?: boolean;
62
- }): Promise<TEndRecordingResponse>;
63
- patchSessionStatus(request: TPatchTransactionRequest): Promise<TPostTransactionResponse>;
64
- discardSession(request: TPatchTransactionRequest): Promise<TPostTransactionResponse>;
117
+ getSessionStatus(sessionId?: string, options?: {
118
+ poll?: PollOptions;
119
+ }): Promise<SDKResult<GetSessionStatusResponse>>;
120
+ retryUploadRecording(): Promise<TEndRecordingResponse>;
121
+ cancelSession(sessionId?: string): Promise<SDKResult<PatchSessionResponse>>;
122
+ /**
123
+ * Upload a pre-recorded audio file to an existing session's upload URL.
124
+ *
125
+ * Client flow:
126
+ * 1. createSession() — via sessions.createSession()
127
+ * 2. processPreRecordedAudio(uploadUrl, audioFile, audioFileName) — this method
128
+ * 3. endSession — via sessions.endSession()
129
+ */
130
+ processPreRecordedAudio(request: {
131
+ uploadUrl: string;
132
+ audioFile: File | Blob;
133
+ }): Promise<TStartRecordingResponse>;
134
+ /** @deprecated Backward compatible */
65
135
  commitTransactionCall(): Promise<TEndRecordingResponse>;
136
+ /** @deprecated Backward compatible */
66
137
  stopTransactionCall(): Promise<TEndRecordingResponse>;
67
- getTemplateOutput({ txn_id }: {
138
+ /** @deprecated Backward compatible */
139
+ getTemplateOutput(request: {
68
140
  txn_id: string;
69
141
  }): Promise<TGetStatusResponse>;
70
- getOutputTranscription({ txn_id }: {
142
+ /** @deprecated Backward compatible */
143
+ getOutputTranscription(request: {
71
144
  txn_id: string;
72
145
  }): Promise<TGetStatusResponse>;
146
+ getChunkTranscript(txnId: string, chunkNumber: string): Promise<TFetchChunkTranscriptResult>;
147
+ /** @deprecated Backward compatible */
73
148
  pollSessionOutput(request: {
74
149
  txn_id: string;
75
150
  max_polling_time?: number;
@@ -78,66 +153,37 @@ declare class EkaScribe {
78
153
  dlp?: boolean;
79
154
  onPartialResultCb?: TPartialResultCallback;
80
155
  }): Promise<TPollingResponse>;
81
- getSessionHistory({ txn_count, oid }: {
82
- txn_count: number;
83
- oid?: string;
84
- }): Promise<TGetTransactionHistoryResponse>;
85
- deleteSession({ txn_id }: {
86
- txn_id: string;
87
- }): Promise<TDeleteTransactionResponse>;
88
- getSuccessFiles(): string[];
89
- getFailedFiles(): string[];
90
- getTotalAudioFiles(): TAudioChunksInfo[];
91
- resetEkaScribe(): void;
92
- onUserSpeechCallback(callback: (isSpeech: boolean) => void): void;
93
- onEventCallback(callback: TEventCallback): void;
94
- onVadFramesCallback(callback: TVadFramesCallback): void;
95
- onVadFrameProcessedCallback(callback: TVadFrameProcessedCallback): void;
96
- onPartialResultCallback(callback: TPartialResultCallback): void;
97
- configureVadConstants({ pref_length, desp_length, max_length, sr, frame_size, pre_speech_pad_frames, short_thsld, long_thsld, }: {
98
- pref_length: number;
99
- desp_length: number;
100
- max_length: number;
101
- sr: number;
102
- frame_size: number;
103
- pre_speech_pad_frames: number;
104
- short_thsld: number;
105
- long_thsld: number;
156
+ registerCallback<K extends CallbackName_2>(name: K, handler: CallbackMap[K]): void;
157
+ removeCallback<K extends CallbackName_2>(name: K, handler: CallbackMap[K]): void;
158
+ /** @future Rename to setAccessToken(token: string) once existing clients migrate */
159
+ updateAuthTokens({ access_token }: {
160
+ access_token: string;
106
161
  }): void;
107
- getAllTemplates(): Promise<TGetV1TemplatesResponse>;
108
- createTemplate(template: TPostV1TemplateRequest): Promise<TPostV1TemplateResponse>;
109
- updateTemplate(template: TPostV1TemplateRequest): Promise<TPostV1TemplateResponse>;
110
- deleteTemplate(template_id: string): Promise<TPostV1TemplateResponse>;
111
- aiGenerateTemplate(formData: FormData): Promise<TPostCookV1MediaAiCreateTemplateResponse>;
112
- updateConfig(request: TPatchVoiceApiV2ConfigRequest): Promise<any>;
113
- getAllTemplateSections(): Promise<TGetV1TemplateSectionsResponse>;
114
- createTemplateSection(templateSection: TPostV1TemplateSectionRequest): Promise<TPostV1TemplateSectionResponse>;
115
- updateTemplateSection(templateSection: TPostV1TemplateSectionRequest): Promise<TPostV1TemplateSectionResponse>;
116
- deleteTemplateSection(section_id: string): Promise<TPostV1TemplateSectionResponse>;
117
- postTransactionConvertToTemplate(request: TPostV1ConvertToTemplateRequest): Promise<TPostV1ConvertToTemplateResponse>;
118
- convertTranscriptionToTemplate(request: TPostV1ConvertToTemplateRequest): Promise<TPostV1ConvertToTemplateResponse>;
119
- searchPastSessions(request: TSearchSessionsRequest): Promise<TSessionHistoryData[]>;
120
- searchSessionsByPatientName(request: TSearchSessionsByPatientRequest): Promise<TSessionHistoryData[]>;
121
- searchSessionsBySessionId(request: TSearchSessionsByPatientRequest): Promise<TSessionHistoryData[]>;
122
- uploadAudioWithPresignedUrl(request: TPostV1UploadAudioFilesRequest): Promise<TFullAudioUploadResponse>;
123
- updateResultSummary(request: TPatchVoiceApiV3StatusRequest): Promise<TPatchVoiceApiV3StatusResponse>;
124
- getConfigMyTemplates(): Promise<TGetConfigV2Response>;
125
162
  runSystemCompatibilityTest(callback: TCompatibilityCallback, sharedWorker?: SharedWorker): Promise<TCompatibilityTestSummary>;
126
- destroySharedWorker(): Promise<void>;
127
- getDoctorHeaderFooter(request: TGetDoctorHeaderFooterRequest): Promise<TGetDoctorHeaderFooterResponse>;
128
- getDoctorClinics(request: TGetDoctorClinicsRequest): Promise<TGetDoctorClinicsResponse>;
129
- getSuggestedMedications(txnId: string): Promise<TSuggestedMedicationResponse>;
130
- createDocument(request: TPostV1DocumentRequest): Promise<TPostV1DocumentResponse>;
131
- updateDocument(request: TPostV1DocumentRequest): Promise<TPostV1DocumentResponse>;
132
- getDocument(document_id: string): Promise<TPostV1DocumentResponse>;
133
- deleteDocument(document_id: string): Promise<TDeleteV1DocumentResponse>;
134
- publishDocument(request: TPostV1DocumentRequest): Promise<TPostV1DocumentResponse>;
135
- getChunkTranscript(txnId: string, chunkNumber: string): Promise<TFetchChunkTranscriptResult>;
136
- addSessionContext({ txn_id, context }: TPatchSessionContextRequest): Promise<TPatchSessionContextResponse>;
137
- removeSessionContext({ txn_id, context }: TPatchSessionContextRequest): Promise<TPatchSessionContextResponse>;
138
- getSessionDetails({ session_id, presigned }: TGetV1SessionDetailsRequest): Promise<TGetV1SessionDetailsResponse>;
163
+ resetInstance(): Promise<void>;
164
+ private handleUnauthorized;
165
+ }
166
+
167
+ export declare interface EkaScribeConfig {
168
+ access_token: string;
169
+ env: 'PROD' | 'DEV';
170
+ clientId?: string;
171
+ mode?: 'http' | 'ipc';
172
+ ipcBridge?: IpcBridge_2;
173
+ enableTracking?: boolean;
174
+ flavour?: string;
175
+ sharedWorkerUrl?: string;
176
+ allianceConfig?: {
177
+ baseUrl?: string;
178
+ useWorker?: boolean | 'auto';
179
+ debug?: boolean;
180
+ };
139
181
  }
140
182
 
183
+ export { EndSessionRequest }
184
+
185
+ export { EndSessionResponse }
186
+
141
187
  export declare enum ERROR_CODE {
142
188
  MICROPHONE = "microphone",
143
189
  TXN_INIT_FAILED = "txn_init_failed",
@@ -155,17 +201,36 @@ export declare enum ERROR_CODE {
155
201
  GET_PRESIGNED_URL_FAILED = "get_presigned_url_failed",
156
202
  UPLOAD_FULL_AUDIO = "upload_full_audio",
157
203
  FETCH_WRAPPER_RESPONSE = "fetch_wrapper_response",
158
- FETCH_WRAPPER_ERROR = "fetch_wrapper_error"
204
+ FETCH_WRAPPER_ERROR = "fetch_wrapper_error",
205
+ NETWORK_ERROR = "network_error",
206
+ UNKNOWN_ERROR = "unknown_error",
207
+ UNAUTHORIZED = "unauthorized",
208
+ FORBIDDEN = "forbidden"
159
209
  }
160
210
 
161
211
  declare type Gender = 'M' | 'F' | 'O';
162
212
 
163
- export declare const getEkaScribeInstance: ({ access_token, env, clientId, flavour, }: {
164
- access_token?: string;
165
- env?: "PROD" | "DEV";
166
- clientId?: string;
167
- flavour?: string;
168
- }) => EkaScribe;
213
+ export declare const getEkaScribeInstance: (config: EkaScribeConfig) => EkaScribe;
214
+
215
+ export { GetSessionStatusResponse }
216
+
217
+ export { getWorkerUrl }
218
+
219
+ export declare interface IpcBridge {
220
+ send(message: unknown): void;
221
+ onResponse(handler: (message: unknown) => void): void;
222
+ }
223
+
224
+ declare interface ITransport {
225
+ request<T = unknown>(config: TransportRequest): Promise<TransportResponse<T>>;
226
+ setAuthToken(token: string): void;
227
+ }
228
+
229
+ export { PatchSessionRequest }
230
+
231
+ export { PatchSessionResponse }
232
+
233
+ export { PollOptions }
169
234
 
170
235
  export declare enum PROCESSING_STATUS {
171
236
  SUCCESS = "success",
@@ -174,6 +239,10 @@ export declare enum PROCESSING_STATUS {
174
239
  CANCELLED = "cancelled"
175
240
  }
176
241
 
242
+ export { ProcessTemplateResponse }
243
+
244
+ export { ResolvedConfig }
245
+
177
246
  export declare enum RESULT_STATUS {
178
247
  SUCCESS = "success",
179
248
  FAILURE = "failure",
@@ -181,26 +250,39 @@ export declare enum RESULT_STATUS {
181
250
  IN_PROGRESS = "in-progress"
182
251
  }
183
252
 
184
- declare type TAudioChunksInfo = {
185
- fileName: string;
186
- timestamp: {
187
- st: string;
188
- et: string;
189
- };
190
- response?: string;
191
- } & ({
192
- status: 'pending';
193
- audioFrames: Float32Array;
194
- fileBlob?: undefined;
195
- } | {
196
- status: 'success';
197
- audioFrames?: undefined;
198
- fileBlob?: undefined;
199
- } | {
200
- status: 'failure';
201
- fileBlob: Blob;
202
- audioFrames?: undefined;
203
- });
253
+ export { SDKResult }
254
+
255
+ declare class SessionUtils {
256
+ private transport;
257
+ private hosts;
258
+ private allianceClient;
259
+ constructor(transport: ITransport, hosts: EkaHosts, allianceClient: ScribeClient);
260
+ getSessionHistory({ txn_count, oid, }: {
261
+ txn_count: number;
262
+ oid?: string;
263
+ }): Promise<TGetTransactionHistoryResponse>;
264
+ deleteSession({ txn_id }: {
265
+ txn_id: string;
266
+ }): Promise<TDeleteTransactionResponse>;
267
+ patchSessionStatus(request: PatchSessionRequest, sessionId?: string): Promise<SDKResult<PatchSessionResponse>>;
268
+ getSessionDetails({ session_id, presigned, }: TGetV1SessionDetailsRequest): Promise<TGetV1SessionDetailsResponse>;
269
+ getSuggestedMedications(txnId: string): Promise<TSuggestedMedicationResponse>;
270
+ addSessionContext({ txn_id, context, }: TPatchSessionContextRequest): Promise<TPatchSessionContextResponse>;
271
+ removeSessionContext({ txn_id, context, }: TPatchSessionContextRequest): Promise<TPatchSessionContextResponse>;
272
+ updateResultSummary({ txnId, data, }: TPatchVoiceApiV3StatusRequest): Promise<TPatchVoiceApiV3StatusResponse>;
273
+ getConfig(): Promise<TGetConfigV2Response>;
274
+ getConfigMyTemplates(): Promise<TGetConfigV2Response>;
275
+ updateConfig(request: TPatchVoiceApiV2ConfigRequest): Promise<TPatchVoiceApiV2ConfigResponse>;
276
+ getDoctorHeaderFooter({ doctor_oid, clinic_id, }: TGetDoctorHeaderFooterRequest): Promise<TGetDoctorHeaderFooterResponse>;
277
+ getDoctorClinics({ doctor_id, }: TGetDoctorClinicsRequest): Promise<TGetDoctorClinicsResponse>;
278
+ createSession(request: CreateSessionRequest): Promise<SDKResult<CreateSessionResponse>>;
279
+ endSession(request: EndSessionRequest, sessionId?: string): Promise<SDKResult<EndSessionResponse>>;
280
+ getDiscoveryDocument(): DiscoveryDocument | null;
281
+ getDiscoveryConfig(): SDKResult<ResolvedConfig>;
282
+ refreshDiscovery(): Promise<SDKResult<ResolvedConfig>>;
283
+ private getDefaultHeaderFooterInfo;
284
+ private extractHeaderFooterInfo;
285
+ }
204
286
 
205
287
  export declare type TChunkTranscriptResponse = {
206
288
  text: string;
@@ -251,7 +333,7 @@ export declare type TConfigSettings = {
251
333
  };
252
334
 
253
335
  declare type TDeleteTransactionResponse = {
254
- code: number;
336
+ status_code: number;
255
337
  message?: string;
256
338
  status?: string;
257
339
  txn_id?: string;
@@ -263,7 +345,7 @@ declare type TDeleteTransactionResponse = {
263
345
  };
264
346
 
265
347
  export declare type TDeleteV1DocumentResponse = {
266
- code: number;
348
+ status_code: number;
267
349
  message?: string;
268
350
  [key: string]: unknown;
269
351
  };
@@ -345,12 +427,6 @@ export declare type TFetchChunkTranscriptResult = {
345
427
  error: string;
346
428
  };
347
429
 
348
- declare type TFullAudioUploadResponse = {
349
- error_code?: ERROR_CODE;
350
- status_code: number;
351
- message: string;
352
- };
353
-
354
430
  export declare type TGetConfigItem = {
355
431
  id: string;
356
432
  name: string;
@@ -399,7 +475,15 @@ export declare type TGetConfigV2Response = {
399
475
  onboarding_step?: string;
400
476
  };
401
477
  message?: string;
402
- code: number;
478
+ status_code: number;
479
+ };
480
+
481
+ export declare type TGetConfigV2TimezoneResponse = {
482
+ timezone: string;
483
+ current_time_utc: string;
484
+ timestamp: number;
485
+ status_code: number;
486
+ message?: string;
403
487
  };
404
488
 
405
489
  export declare type TGetDoctorClinicsRequest = {
@@ -408,7 +492,7 @@ export declare type TGetDoctorClinicsRequest = {
408
492
 
409
493
  export declare type TGetDoctorClinicsResponse = {
410
494
  data: TClinicInfo[] | null;
411
- code: number;
495
+ status_code: number;
412
496
  message?: string;
413
497
  };
414
498
 
@@ -419,11 +503,11 @@ export declare type TGetDoctorHeaderFooterRequest = {
419
503
 
420
504
  export declare type TGetDoctorHeaderFooterResponse = {
421
505
  data: TDoctorHeaderFooterInfo;
422
- code: number;
506
+ status_code: number;
423
507
  message?: string;
424
508
  };
425
509
 
426
- declare type TGetStatusApiResponse = {
510
+ export declare type TGetStatusApiResponse = {
427
511
  data: {
428
512
  output: TOutputSummary[];
429
513
  audio_matrix?: {
@@ -486,14 +570,14 @@ export declare type TGetV1SessionDetailsRequest = {
486
570
 
487
571
  export declare type TGetV1SessionDetailsResponse = {
488
572
  data?: TGetV1SessionDetailsData;
489
- code: number;
573
+ status_code: number;
490
574
  message?: string;
491
575
  [key: string]: unknown;
492
576
  };
493
577
 
494
578
  export declare interface TGetV1TemplateSectionsResponse {
495
579
  items: TSection[];
496
- code: number;
580
+ status_code: number;
497
581
  error?: {
498
582
  code: string;
499
583
  message: string;
@@ -502,7 +586,7 @@ export declare interface TGetV1TemplateSectionsResponse {
502
586
 
503
587
  export declare interface TGetV1TemplatesResponse {
504
588
  items: TTemplate[];
505
- code: number;
589
+ status_code: number;
506
590
  error?: {
507
591
  code: string;
508
592
  message: string;
@@ -516,7 +600,7 @@ declare type TNetworkInfo = {
516
600
  connection_type: String;
517
601
  };
518
602
 
519
- declare type TOutputSummary = {
603
+ export declare type TOutputSummary = {
520
604
  template_id: string;
521
605
  value?: any;
522
606
  type: string;
@@ -554,7 +638,7 @@ export declare type TPatchSessionContextRequest = {
554
638
  };
555
639
 
556
640
  export declare type TPatchSessionContextResponse = {
557
- code: number;
641
+ status_code: number;
558
642
  message?: string;
559
643
  [key: string]: unknown;
560
644
  };
@@ -601,7 +685,7 @@ export declare type TPatchVoiceApiV2ConfigRequest = {
601
685
 
602
686
  export declare interface TPatchVoiceApiV2ConfigResponse extends TPatchVoiceApiV2ConfigRequest {
603
687
  msg: string;
604
- code: number;
688
+ status_code: number;
605
689
  error?: {
606
690
  code: string;
607
691
  message: string;
@@ -621,7 +705,7 @@ export declare type TPatchVoiceApiV3StatusResponse = {
621
705
  message: string;
622
706
  txn_id: string;
623
707
  b_id: string;
624
- code: number;
708
+ status_code: number;
625
709
  error?: {
626
710
  code: string;
627
711
  message: string;
@@ -645,7 +729,7 @@ export declare type TPauseRecordingResponse = {
645
729
  is_paused?: boolean;
646
730
  };
647
731
 
648
- declare type TPollingResponse = {
732
+ export declare type TPollingResponse = {
649
733
  response?: TGetStatusApiResponse | null;
650
734
  status_code: number;
651
735
  errorMessage?: string;
@@ -669,7 +753,7 @@ declare type TPostCookV1MediaAiCreateTemplateResponse = {
669
753
  title: string;
670
754
  desc: string;
671
755
  sections: TSection[];
672
- code: number;
756
+ status_code: number;
673
757
  message: string;
674
758
  };
675
759
 
@@ -707,7 +791,7 @@ export declare type TPostTransactionResponse = {
707
791
  oid: string;
708
792
  uuid: string;
709
793
  data: unknown;
710
- code: number;
794
+ status_code: number;
711
795
  error?: {
712
796
  code: string;
713
797
  message: string;
@@ -729,7 +813,7 @@ export declare type TPostV1ConvertToTemplateResponse = {
729
813
  template_id: string;
730
814
  document_id: string;
731
815
  b_id: string;
732
- code: number;
816
+ status_code: number;
733
817
  msg: string;
734
818
  error?: {
735
819
  code: string;
@@ -747,7 +831,7 @@ export declare type TPostV1DocumentRequest = {
747
831
  };
748
832
 
749
833
  export declare type TPostV1DocumentResponse = {
750
- code: number;
834
+ status_code: number;
751
835
  status?: string;
752
836
  message?: string;
753
837
  data?: {
@@ -780,7 +864,7 @@ export declare interface TPostV1TemplateRequest {
780
864
  }
781
865
 
782
866
  export declare interface TPostV1TemplateResponse {
783
- code: number;
867
+ status_code: number;
784
868
  msg: string;
785
869
  template_id?: string;
786
870
  message?: string;
@@ -801,7 +885,7 @@ export declare interface TPostV1TemplateSectionRequest {
801
885
  export declare interface TPostV1TemplateSectionResponse {
802
886
  msg: string;
803
887
  section_id: string;
804
- code: number;
888
+ status_code: number;
805
889
  action: 'updated' | 'created_custom';
806
890
  error?: {
807
891
  code: string;
@@ -810,26 +894,23 @@ export declare interface TPostV1TemplateSectionResponse {
810
894
  }
811
895
 
812
896
  export declare interface TPostV1UploadAudioFilesRequest extends TPostTransactionInitRequest {
813
- action: string;
814
- audioFiles: File[] | Blob[];
815
- audioFileNames: string[];
897
+ audioFile: File | Blob;
898
+ audioFileName: string;
816
899
  }
817
900
 
818
- declare type TSearchCriteria = {
819
- patientName?: string;
820
- sessionId?: string;
821
- };
822
-
823
- declare type TSearchSessionsByPatientRequest = {
824
- sessions: TSessionHistoryData[];
825
- patientName?: string;
826
- sessionId?: string;
827
- };
901
+ declare interface TransportRequest {
902
+ method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
903
+ url: string;
904
+ headers?: Record<string, string>;
905
+ body?: unknown;
906
+ timeout?: number;
907
+ }
828
908
 
829
- declare type TSearchSessionsRequest = {
830
- sessions: TSessionHistoryData[];
831
- searchCriteria: TSearchCriteria;
832
- };
909
+ declare interface TransportResponse<T = unknown> {
910
+ status: number;
911
+ data: T;
912
+ headers?: Record<string, string>;
913
+ }
833
914
 
834
915
  export declare interface TSection {
835
916
  id: string;
@@ -910,13 +991,11 @@ export declare type TSessionStatus = {
910
991
  };
911
992
  };
912
993
 
913
- declare type TStartRecordingForExistingSessionRequest = {
994
+ export declare type TStartRecordingForExistingSessionRequest = {
914
995
  txn_id: string;
915
996
  business_id: string;
916
997
  created_at: number;
917
998
  microphoneID?: string;
918
- sharedWorkerUrl?: string;
919
- flavour?: string;
920
999
  };
921
1000
 
922
1001
  export declare type TStartRecordingResponse = {
@@ -953,7 +1032,7 @@ export declare type TSuggestedMedication = {
953
1032
  };
954
1033
 
955
1034
  declare type TSuggestedMedicationResponse = {
956
- code: number;
1035
+ status_code: number;
957
1036
  message?: string;
958
1037
  session_id?: string;
959
1038
  medications?: TSuggestedMedication[];
@@ -977,13 +1056,13 @@ export declare interface TTemplate {
977
1056
  is_favorite?: boolean;
978
1057
  }
979
1058
 
980
- declare type TTemplateMessage = {
1059
+ export declare type TTemplateMessage = {
981
1060
  type: 'warning' | 'error';
982
1061
  code?: string;
983
1062
  msg: string;
984
1063
  };
985
1064
 
986
- declare type TTemplateStatus = 'success' | 'partial_success' | 'failure';
1065
+ export declare type TTemplateStatus = 'success' | 'partial_success' | 'failure';
987
1066
 
988
1067
  export declare type TVadFrameProcessedCallback = (args: {
989
1068
  probabilities: {