@eka-care/ekascribe-ts-sdk 2.1.38 → 2.1.40

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
@@ -127,6 +127,7 @@ declare class EkaScribe {
127
127
  getDoctorClinics(request: TGetDoctorClinicsRequest): Promise<TGetDoctorClinicsResponse>;
128
128
  getSuggestedMedications(txnId: string): Promise<TSuggestedMedicationResponse>;
129
129
  createDocument(request: TPostV1DocumentRequest): Promise<TPostV1DocumentResponse>;
130
+ updateDocument(request: TPostV1DocumentRequest): Promise<TPostV1DocumentResponse>;
130
131
  deleteDocument(document_id: string): Promise<TDeleteV1DocumentResponse>;
131
132
  getChunkTranscript(txnId: string, chunkNumber: string): Promise<TFetchChunkTranscriptResult>;
132
133
  addSessionContext({ txn_id, context }: TPatchSessionContextRequest): Promise<TPatchSessionContextResponse>;
@@ -438,8 +439,10 @@ declare type TGetStatusApiResponse = {
438
439
  };
439
440
  error?: {
440
441
  code: string;
441
- msg: string;
442
+ message: string;
443
+ display_message: string;
442
444
  };
445
+ status: string;
443
446
  };
444
447
 
445
448
  export declare type TGetStatusResponse = {
@@ -703,8 +706,9 @@ export declare type TPostV1ConvertToTemplateResponse = {
703
706
 
704
707
  export declare type TPostV1DocumentRequest = {
705
708
  session_id: string;
706
- document_name: string;
709
+ document_name?: string;
707
710
  type?: string;
711
+ document_id?: string;
708
712
  };
709
713
 
710
714
  export declare type TPostV1DocumentResponse = {
package/dist/index.mjs CHANGED
@@ -30856,7 +30856,7 @@ const decodeApiResponse = (s) => {
30856
30856
  poll_status: "in-progress"
30857
30857
  }), b >= 400) {
30858
30858
  if (a++, a >= 3) {
30859
- const S = g?.error?.msg || "We encountered a backend error while fetching results. Please try again.";
30859
+ const S = g?.error?.message || "We encountered a backend error while fetching results. Please try again.";
30860
30860
  return d(b, null, S, "failed");
30861
30861
  }
30862
30862
  } else
@@ -31548,29 +31548,31 @@ async function getV1SessionSuggestedMedications(s) {
31548
31548
  async function postV1Document({
31549
31549
  session_id: s,
31550
31550
  document_name: n,
31551
- type: i
31551
+ type: i,
31552
+ document_id: c
31552
31553
  }) {
31553
31554
  try {
31554
- const c = new Headers();
31555
- c.append("Content-Type", "application/json");
31555
+ const l = new Headers();
31556
+ l.append("Content-Type", "application/json");
31556
31557
  const f = {
31558
+ session_id: s,
31559
+ type: i,
31560
+ ...n ? { document_name: n } : {},
31561
+ ...c ? { document_id: c } : {}
31562
+ }, u = {
31557
31563
  method: "POST",
31558
- headers: c,
31559
- body: JSON.stringify({
31560
- session_id: s,
31561
- document_name: n,
31562
- type: i
31563
- })
31564
- }, u = await fetchWrapper(`${GET_EKA_VOICE_HOST_V1()}/documents`, f);
31565
- let d = await u.json();
31566
- return d = {
31567
- ...d,
31568
- code: u.status
31569
- }, d;
31570
- } catch (c) {
31571
- return console.error("%c postV1Document -> error", "color:#f5ce50", c), {
31564
+ headers: l,
31565
+ body: JSON.stringify(f)
31566
+ }, d = await fetchWrapper(`${GET_EKA_VOICE_HOST_V1()}/documents`, u);
31567
+ let _ = await d.json();
31568
+ return _ = {
31569
+ ..._,
31570
+ code: d.status
31571
+ }, _;
31572
+ } catch (l) {
31573
+ return console.error("%c postV1Document -> error", "color:#f5ce50", l), {
31572
31574
  code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
31573
- message: `Something went wrong! ${c}`
31575
+ message: `Something went wrong! ${l}`
31574
31576
  };
31575
31577
  }
31576
31578
  }
@@ -32022,6 +32024,9 @@ const _n = class _n {
32022
32024
  async createDocument(n) {
32023
32025
  return await postV1Document(n);
32024
32026
  }
32027
+ async updateDocument(n) {
32028
+ return await postV1Document(n);
32029
+ }
32025
32030
  async deleteDocument(n) {
32026
32031
  return await deleteV1Document(n);
32027
32032
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eka-care/ekascribe-ts-sdk",
3
- "version": "2.1.38",
3
+ "version": "2.1.40",
4
4
  "description": "EkaScribe TypeScript SDK - Modern ES2020 build",
5
5
  "main": "dist/index.mjs",
6
6
  "module": "dist/index.mjs",