@eka-care/ekascribe-ts-sdk 2.1.32 → 2.1.34
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 +3 -2
- package/dist/index.mjs +30 -36
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ declare class EkaScribe {
|
|
|
59
59
|
retryUploadRecording({ force_commit }: {
|
|
60
60
|
force_commit?: boolean;
|
|
61
61
|
}): Promise<TEndRecordingResponse>;
|
|
62
|
-
patchSessionStatus(
|
|
62
|
+
patchSessionStatus(request: TPatchTransactionRequest): Promise<TPostTransactionResponse>;
|
|
63
63
|
commitTransactionCall(): Promise<TEndRecordingResponse>;
|
|
64
64
|
stopTransactionCall(): Promise<TEndRecordingResponse>;
|
|
65
65
|
getTemplateOutput({ txn_id }: {
|
|
@@ -530,8 +530,9 @@ declare type TPatchTransactionError = {
|
|
|
530
530
|
|
|
531
531
|
export declare type TPatchTransactionRequest = {
|
|
532
532
|
sessionId: string;
|
|
533
|
-
processing_status
|
|
533
|
+
processing_status?: string;
|
|
534
534
|
processing_error?: TPatchTransactionError;
|
|
535
|
+
patient_details?: TPatientDetails;
|
|
535
536
|
};
|
|
536
537
|
|
|
537
538
|
export declare type TPatchVoiceApiV2ConfigRequest = {
|
package/dist/index.mjs
CHANGED
|
@@ -312,33 +312,35 @@ const getConfigV2 = async () => {
|
|
|
312
312
|
}, patchTransactionStatus = async ({
|
|
313
313
|
sessionId: s,
|
|
314
314
|
processing_status: n,
|
|
315
|
-
processing_error: i
|
|
315
|
+
processing_error: i,
|
|
316
|
+
patient_details: c
|
|
316
317
|
}) => {
|
|
317
318
|
try {
|
|
318
|
-
const
|
|
319
|
-
|
|
319
|
+
const l = new Headers();
|
|
320
|
+
l.append("Content-Type", "application/json");
|
|
320
321
|
const f = {
|
|
322
|
+
...n ? { processing_status: n } : {},
|
|
323
|
+
...c ? { patient_details: c } : {},
|
|
324
|
+
...i ? { processing_error: i } : {}
|
|
325
|
+
}, u = {
|
|
321
326
|
method: "PATCH",
|
|
322
|
-
headers:
|
|
323
|
-
body: JSON.stringify(
|
|
324
|
-
|
|
325
|
-
processing_error: i
|
|
326
|
-
})
|
|
327
|
-
}, u = await fetchWrapper(
|
|
327
|
+
headers: l,
|
|
328
|
+
body: JSON.stringify(f)
|
|
329
|
+
}, d = await fetchWrapper(
|
|
328
330
|
`${GET_EKA_VOICE_HOST_V2()}/transaction/${s}`,
|
|
329
|
-
|
|
331
|
+
u
|
|
330
332
|
);
|
|
331
|
-
if (!
|
|
332
|
-
throw new Error(`Error: ${
|
|
333
|
-
let
|
|
334
|
-
return
|
|
335
|
-
...
|
|
336
|
-
code:
|
|
337
|
-
},
|
|
338
|
-
} catch (
|
|
339
|
-
return console.error("Patch transaction status api failed",
|
|
333
|
+
if (!d.ok)
|
|
334
|
+
throw new Error(`Error: ${d.statusText}`);
|
|
335
|
+
let _ = await d.json();
|
|
336
|
+
return _ = {
|
|
337
|
+
..._,
|
|
338
|
+
code: d.status
|
|
339
|
+
}, _;
|
|
340
|
+
} catch (l) {
|
|
341
|
+
return console.error("Patch transaction status api failed", l), {
|
|
340
342
|
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
341
|
-
message: `Something went wrong! ${
|
|
343
|
+
message: `Something went wrong! ${l}`
|
|
342
344
|
};
|
|
343
345
|
}
|
|
344
346
|
};
|
|
@@ -31778,29 +31780,21 @@ const _n = class _n {
|
|
|
31778
31780
|
const i = await retryUploadFailedFiles({ force_commit: n });
|
|
31779
31781
|
return console.log("%c Line:138 🍖 retryUploadResponse", "color:#3f7cff", i), i;
|
|
31780
31782
|
}
|
|
31781
|
-
async patchSessionStatus({
|
|
31782
|
-
sessionId: n,
|
|
31783
|
-
processing_status: i,
|
|
31784
|
-
processing_error: c
|
|
31785
|
-
}) {
|
|
31783
|
+
async patchSessionStatus(n) {
|
|
31786
31784
|
try {
|
|
31787
|
-
const
|
|
31785
|
+
const i = EkaScribeStore$1.eventCallback;
|
|
31788
31786
|
this.vadInstance.pauseVad(), this.vadInstance.destroyVad();
|
|
31789
|
-
const
|
|
31790
|
-
|
|
31791
|
-
processing_status: i,
|
|
31792
|
-
processing_error: c
|
|
31793
|
-
});
|
|
31794
|
-
return this.resetEkaScribe(), l && l({
|
|
31787
|
+
const c = await patchTransactionStatus(n);
|
|
31788
|
+
return this.resetEkaScribe(), i && i({
|
|
31795
31789
|
callback_type: CALLBACK_TYPE.TRANSACTION_STATUS,
|
|
31796
31790
|
status: "info",
|
|
31797
|
-
message: `Transaction cancel status: ${
|
|
31791
|
+
message: `Transaction cancel status: ${c.code}`,
|
|
31798
31792
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
31799
|
-
}),
|
|
31800
|
-
} catch (
|
|
31793
|
+
}), c;
|
|
31794
|
+
} catch (i) {
|
|
31801
31795
|
return {
|
|
31802
31796
|
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
31803
|
-
message: `Failed to cancel recording session, ${
|
|
31797
|
+
message: `Failed to cancel recording session, ${i}`
|
|
31804
31798
|
};
|
|
31805
31799
|
}
|
|
31806
31800
|
}
|