@eka-care/ekascribe-ts-sdk 2.1.39 → 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>;
@@ -705,8 +706,9 @@ export declare type TPostV1ConvertToTemplateResponse = {
705
706
 
706
707
  export declare type TPostV1DocumentRequest = {
707
708
  session_id: string;
708
- document_name: string;
709
+ document_name?: string;
709
710
  type?: string;
711
+ document_id?: string;
710
712
  };
711
713
 
712
714
  export declare type TPostV1DocumentResponse = {
package/dist/index.mjs CHANGED
@@ -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.39",
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",