@eka-care/ekascribe-ts-sdk 2.1.32 → 2.1.35

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
@@ -59,7 +59,7 @@ declare class EkaScribe {
59
59
  retryUploadRecording({ force_commit }: {
60
60
  force_commit?: boolean;
61
61
  }): Promise<TEndRecordingResponse>;
62
- patchSessionStatus({ sessionId, processing_status, processing_error, }: TPatchTransactionRequest): Promise<TPostTransactionResponse>;
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: string;
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 c = new Headers();
319
- c.append("Content-Type", "application/json");
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: c,
323
- body: JSON.stringify({
324
- processing_status: n,
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
- f
331
+ u
330
332
  );
331
- if (!u.ok)
332
- throw new Error(`Error: ${u.statusText}`);
333
- let d = await u.json();
334
- return d = {
335
- ...d,
336
- code: u.status
337
- }, d;
338
- } catch (c) {
339
- return console.error("Patch transaction status api failed", c), {
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! ${c}`
343
+ message: `Something went wrong! ${l}`
342
344
  };
343
345
  }
344
346
  };
@@ -30877,7 +30879,7 @@ const decodeApiResponse = (s) => {
30877
30879
  a = 0;
30878
30880
  await new Promise((S) => setTimeout(S, 1e3));
30879
30881
  const m = [];
30880
- return i && m.push(`template_id=${i}`), c && m.push(`document_id=${c}`), l && m.push("_dlp=true"), t(m.join("&"));
30882
+ return i && m.push(`template_id=${i}`), c && m.push(`document_id=${c}`), l && m.push("dlp=true"), t(m.join("&"));
30881
30883
  }
30882
30884
  return d(
30883
30885
  b,
@@ -30894,7 +30896,7 @@ const decodeApiResponse = (s) => {
30894
30896
  );
30895
30897
  }
30896
30898
  }, e = [];
30897
- i && e.push(`template_id=${i}`), c && e.push(`document_id=${c}`), l && e.push("_dlp=true");
30899
+ i && e.push(`template_id=${i}`), c && e.push(`document_id=${c}`), l && e.push("dlp=true");
30898
30900
  const r = e.join("&");
30899
30901
  return console.log(r, "query params"), t(r);
30900
30902
  } catch (_) {
@@ -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 l = EkaScribeStore$1.eventCallback;
31785
+ const i = EkaScribeStore$1.eventCallback;
31788
31786
  this.vadInstance.pauseVad(), this.vadInstance.destroyVad();
31789
- const f = await patchTransactionStatus({
31790
- sessionId: n,
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: ${f.code}`,
31791
+ message: `Transaction cancel status: ${c.code}`,
31798
31792
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
31799
- }), f;
31800
- } catch (l) {
31793
+ }), c;
31794
+ } catch (i) {
31801
31795
  return {
31802
31796
  code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
31803
- message: `Failed to cancel recording session, ${l}`
31797
+ message: `Failed to cancel recording session, ${i}`
31804
31798
  };
31805
31799
  }
31806
31800
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eka-care/ekascribe-ts-sdk",
3
- "version": "2.1.32",
3
+ "version": "2.1.35",
4
4
  "description": "EkaScribe TypeScript SDK - Modern ES2020 build",
5
5
  "main": "dist/index.mjs",
6
6
  "module": "dist/index.mjs",