@eka-care/ekascribe-ts-sdk 2.1.39 → 2.1.41
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 +4 -1
- package/dist/index.mjs +53 -18
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -127,7 +127,9 @@ 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>;
|
|
132
|
+
publishDocument(request: TPostV1DocumentRequest): Promise<TPostV1DocumentResponse>;
|
|
131
133
|
getChunkTranscript(txnId: string, chunkNumber: string): Promise<TFetchChunkTranscriptResult>;
|
|
132
134
|
addSessionContext({ txn_id, context }: TPatchSessionContextRequest): Promise<TPatchSessionContextResponse>;
|
|
133
135
|
removeSessionContext({ txn_id, context }: TPatchSessionContextRequest): Promise<TPatchSessionContextResponse>;
|
|
@@ -705,8 +707,9 @@ export declare type TPostV1ConvertToTemplateResponse = {
|
|
|
705
707
|
|
|
706
708
|
export declare type TPostV1DocumentRequest = {
|
|
707
709
|
session_id: string;
|
|
708
|
-
document_name
|
|
710
|
+
document_name?: string;
|
|
709
711
|
type?: string;
|
|
712
|
+
document_id?: string;
|
|
710
713
|
};
|
|
711
714
|
|
|
712
715
|
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
|
|
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
|
}
|
|
@@ -31662,6 +31664,33 @@ async function deleteSessionContext({
|
|
|
31662
31664
|
};
|
|
31663
31665
|
}
|
|
31664
31666
|
}
|
|
31667
|
+
async function postV1SessionDocumentPublish({
|
|
31668
|
+
session_id: s,
|
|
31669
|
+
document_id: n
|
|
31670
|
+
}) {
|
|
31671
|
+
try {
|
|
31672
|
+
const i = new Headers();
|
|
31673
|
+
i.append("Content-Type", "application/json");
|
|
31674
|
+
const c = {
|
|
31675
|
+
method: "POST",
|
|
31676
|
+
headers: i,
|
|
31677
|
+
body: JSON.stringify({})
|
|
31678
|
+
}, l = await fetchWrapper(
|
|
31679
|
+
`${GET_EKA_VOICE_HOST_V1()}/sessions/${s}/documents/${n}/publish`,
|
|
31680
|
+
c
|
|
31681
|
+
);
|
|
31682
|
+
let f = await l.json();
|
|
31683
|
+
return f = {
|
|
31684
|
+
...f,
|
|
31685
|
+
code: l.status
|
|
31686
|
+
}, f;
|
|
31687
|
+
} catch (i) {
|
|
31688
|
+
return console.error("%c postV1Document -> error", "color:#f5ce50", i), {
|
|
31689
|
+
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
31690
|
+
message: `Something went wrong! ${i}`
|
|
31691
|
+
};
|
|
31692
|
+
}
|
|
31693
|
+
}
|
|
31665
31694
|
const _n = class _n {
|
|
31666
31695
|
// SystemCompatibilityManager Instance
|
|
31667
31696
|
// Private constructor to prevent direct instantiation
|
|
@@ -32022,9 +32051,15 @@ const _n = class _n {
|
|
|
32022
32051
|
async createDocument(n) {
|
|
32023
32052
|
return await postV1Document(n);
|
|
32024
32053
|
}
|
|
32054
|
+
async updateDocument(n) {
|
|
32055
|
+
return await postV1Document(n);
|
|
32056
|
+
}
|
|
32025
32057
|
async deleteDocument(n) {
|
|
32026
32058
|
return await deleteV1Document(n);
|
|
32027
32059
|
}
|
|
32060
|
+
async publishDocument(n) {
|
|
32061
|
+
return await postV1SessionDocumentPublish(n);
|
|
32062
|
+
}
|
|
32028
32063
|
async getChunkTranscript(n, i) {
|
|
32029
32064
|
return fetchChunkTranscript(n, i);
|
|
32030
32065
|
}
|