@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 +6 -2
- package/dist/index.mjs +24 -19
- package/package.json +1 -1
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
|
-
|
|
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
|
|
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?.
|
|
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
|
|
31555
|
-
|
|
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:
|
|
31559
|
-
body: JSON.stringify(
|
|
31560
|
-
|
|
31561
|
-
|
|
31562
|
-
|
|
31563
|
-
|
|
31564
|
-
|
|
31565
|
-
|
|
31566
|
-
|
|
31567
|
-
|
|
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! ${
|
|
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
|
}
|