@eka-care/ekascribe-ts-sdk 3.0.40 → 3.0.42
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 +7 -4
- package/dist/index.mjs +46 -42
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -137,12 +137,13 @@ declare class EkaScribe {
|
|
|
137
137
|
* chunks beyond the default cap.
|
|
138
138
|
*/
|
|
139
139
|
forceAllowMoreChunks(): void;
|
|
140
|
-
endRecording(): Promise<TEndRecordingResponse>;
|
|
140
|
+
endRecording(version?: string): Promise<TEndRecordingResponse>;
|
|
141
141
|
getSessionStatus(sessionId?: string, options?: {
|
|
142
142
|
poll?: PollOptions;
|
|
143
143
|
templateId?: string;
|
|
144
|
+
version?: string;
|
|
144
145
|
}): Promise<SDKResult<GetSessionStatusResponse>>;
|
|
145
|
-
retryUploadRecording(): Promise<TEndRecordingResponse>;
|
|
146
|
+
retryUploadRecording(version?: string): Promise<TEndRecordingResponse>;
|
|
146
147
|
cancelSession(sessionId?: string): Promise<SDKResult<PatchSessionResponse>>;
|
|
147
148
|
/**
|
|
148
149
|
* Upload a pre-recorded audio file to an existing session's upload URL.
|
|
@@ -288,7 +289,7 @@ declare class SessionUtils {
|
|
|
288
289
|
txn_id: string;
|
|
289
290
|
}): Promise<TDeleteTransactionResponse>;
|
|
290
291
|
patchSessionStatus(request: PatchSessionRequest, sessionId?: string): Promise<SDKResult<PatchSessionResponse>>;
|
|
291
|
-
getSessionDetails({ session_id, presigned, }: TGetV1SessionDetailsRequest): Promise<TGetV1SessionDetailsResponse>;
|
|
292
|
+
getSessionDetails({ session_id, presigned, version, }: TGetV1SessionDetailsRequest): Promise<TGetV1SessionDetailsResponse>;
|
|
292
293
|
getSuggestedMedications(txnId: string): Promise<TSuggestedMedicationResponse>;
|
|
293
294
|
addSessionContext({ txn_id, context, }: TPatchSessionContextRequest): Promise<TPatchSessionContextResponse>;
|
|
294
295
|
removeSessionContext({ txn_id, context, }: TPatchSessionContextRequest): Promise<TPatchSessionContextResponse>;
|
|
@@ -299,7 +300,7 @@ declare class SessionUtils {
|
|
|
299
300
|
updateConfig(request: TPatchVoiceApiV2ConfigRequest): Promise<TPatchVoiceApiV2ConfigResponse>;
|
|
300
301
|
getDoctorHeaderFooter({ doctor_oid, clinic_id, }: TGetDoctorHeaderFooterRequest): Promise<TGetDoctorHeaderFooterResponse>;
|
|
301
302
|
getDoctorClinics({ doctor_id, }: TGetDoctorClinicsRequest): Promise<TGetDoctorClinicsResponse>;
|
|
302
|
-
createSession(request: CreateSessionRequest): Promise<SDKResult<CreateSessionResponse>>;
|
|
303
|
+
createSession(request: CreateSessionRequest, version?: string): Promise<SDKResult<CreateSessionResponse>>;
|
|
303
304
|
endSession(request: EndSessionRequest, sessionId?: string): Promise<SDKResult<EndSessionResponse>>;
|
|
304
305
|
getDiscoveryDocument(): DiscoveryDocument | null;
|
|
305
306
|
getDiscoveryConfig(): SDKResult<ResolvedConfig>;
|
|
@@ -630,6 +631,7 @@ export declare type TGetV1SessionDetailsData = {
|
|
|
630
631
|
export declare type TGetV1SessionDetailsRequest = {
|
|
631
632
|
session_id: string;
|
|
632
633
|
presigned?: boolean;
|
|
634
|
+
version?: string;
|
|
633
635
|
};
|
|
634
636
|
|
|
635
637
|
export declare type TGetV1SessionDetailsResponse = {
|
|
@@ -834,6 +836,7 @@ export declare type TPostTransactionInitRequest = {
|
|
|
834
836
|
patient_details?: TPatientDetails;
|
|
835
837
|
model_type: string;
|
|
836
838
|
version?: string;
|
|
839
|
+
api_version?: string;
|
|
837
840
|
flavour?: string;
|
|
838
841
|
batch_s3_url?: string;
|
|
839
842
|
audio_file_names?: string[];
|
package/dist/index.mjs
CHANGED
|
@@ -5127,19 +5127,22 @@ class Ql {
|
|
|
5127
5127
|
}
|
|
5128
5128
|
async getSessionDetails({
|
|
5129
5129
|
session_id: e,
|
|
5130
|
-
presigned: n = !1
|
|
5130
|
+
presigned: n = !1,
|
|
5131
|
+
version: r
|
|
5131
5132
|
}) {
|
|
5132
5133
|
try {
|
|
5133
|
-
const
|
|
5134
|
+
const s = new URLSearchParams({ presigned: String(n) });
|
|
5135
|
+
r && s.append("version", r);
|
|
5136
|
+
const i = await this.transport.request({
|
|
5134
5137
|
method: "GET",
|
|
5135
|
-
url: `${this.hosts.voiceV1}/sessions/${e}
|
|
5138
|
+
url: `${this.hosts.voiceV1}/sessions/${e}?${s.toString()}`
|
|
5136
5139
|
});
|
|
5137
|
-
return { ...
|
|
5138
|
-
} catch (
|
|
5139
|
-
const
|
|
5140
|
+
return { ...i.data, status_code: i.status };
|
|
5141
|
+
} catch (s) {
|
|
5142
|
+
const i = S(s, "Failed to fetch session details,");
|
|
5140
5143
|
return {
|
|
5141
|
-
status_code:
|
|
5142
|
-
message:
|
|
5144
|
+
status_code: i.status_code,
|
|
5145
|
+
message: i.message
|
|
5143
5146
|
};
|
|
5144
5147
|
}
|
|
5145
5148
|
}
|
|
@@ -5340,8 +5343,8 @@ class Ql {
|
|
|
5340
5343
|
}
|
|
5341
5344
|
}
|
|
5342
5345
|
// --- Alliance SDK methods ---
|
|
5343
|
-
async createSession(e) {
|
|
5344
|
-
return this.allianceClient.createSession(e);
|
|
5346
|
+
async createSession(e, n) {
|
|
5347
|
+
return this.allianceClient.createSession(e, n);
|
|
5345
5348
|
}
|
|
5346
5349
|
async endSession(e, n) {
|
|
5347
5350
|
return this.allianceClient.endSession(e, n);
|
|
@@ -5441,7 +5444,8 @@ class eu {
|
|
|
5441
5444
|
...e.additional_data || {}
|
|
5442
5445
|
}
|
|
5443
5446
|
}, r = await this.allianceClient.createSession(
|
|
5444
|
-
n
|
|
5447
|
+
n,
|
|
5448
|
+
e.api_version
|
|
5445
5449
|
);
|
|
5446
5450
|
return r.success ? (this.storedSession = r.data, this.txnID = r.data.session_id, this.tracker.setTransactionId(this.txnID), this.tracker.captureEvent("Session started", {
|
|
5447
5451
|
txn_id: this.txnID,
|
|
@@ -5589,37 +5593,37 @@ class eu {
|
|
|
5589
5593
|
};
|
|
5590
5594
|
}
|
|
5591
5595
|
}
|
|
5592
|
-
async endRecording() {
|
|
5596
|
+
async endRecording(e) {
|
|
5593
5597
|
try {
|
|
5594
5598
|
this.tracker.addBreadcrumb("recording", "endRecording", { txn_id: this.txnID });
|
|
5595
|
-
const
|
|
5596
|
-
return
|
|
5599
|
+
const n = await this.allianceClient.endRecording(e);
|
|
5600
|
+
return n.success ? (this.tracker.captureEvent("Session ended", {
|
|
5597
5601
|
txn_id: this.txnID,
|
|
5598
|
-
total_files:
|
|
5599
|
-
failed_files:
|
|
5600
|
-
}), this.storedSession = null,
|
|
5602
|
+
total_files: n.data.totalFiles,
|
|
5603
|
+
failed_files: n.data.failedUploads.length
|
|
5604
|
+
}), this.storedSession = null, n.data.failedUploads.length > 0 ? {
|
|
5601
5605
|
error_code: E.AUDIO_UPLOAD_FAILED,
|
|
5602
|
-
status_code:
|
|
5603
|
-
message: `Recording ended but ${
|
|
5604
|
-
failed_files:
|
|
5605
|
-
total_audio_files:
|
|
5606
|
+
status_code: n.httpStatus ?? _.AUDIO_ERROR,
|
|
5607
|
+
message: `Recording ended but ${n.data.failedUploads.length} audio file(s) failed to upload.`,
|
|
5608
|
+
failed_files: n.data.failedUploads,
|
|
5609
|
+
total_audio_files: n.data.endSessionResponse?.audio_files
|
|
5606
5610
|
} : {
|
|
5607
|
-
status_code:
|
|
5611
|
+
status_code: n.httpStatus ?? _.SUCCESS,
|
|
5608
5612
|
message: "Recording ended successfully.",
|
|
5609
|
-
total_audio_files:
|
|
5613
|
+
total_audio_files: n.data.endSessionResponse?.audio_files
|
|
5610
5614
|
}) : (this.tracker.captureEvent("Session end failed", {
|
|
5611
5615
|
txn_id: this.txnID,
|
|
5612
|
-
error:
|
|
5616
|
+
error: n.error.message
|
|
5613
5617
|
}), {
|
|
5614
5618
|
error_code: E.END_RECORDING_FAILED,
|
|
5615
|
-
status_code:
|
|
5616
|
-
message:
|
|
5619
|
+
status_code: n.error.httpStatus ?? _.INTERNAL_SERVER_ERROR,
|
|
5620
|
+
message: n.error.message || "Failed to end recording."
|
|
5617
5621
|
});
|
|
5618
|
-
} catch (
|
|
5622
|
+
} catch (n) {
|
|
5619
5623
|
return {
|
|
5620
5624
|
error_code: E.INTERNAL_SERVER_ERROR,
|
|
5621
5625
|
status_code: _.INTERNAL_SERVER_ERROR,
|
|
5622
|
-
message: `Failed to end recording. ${
|
|
5626
|
+
message: `Failed to end recording. ${n}`
|
|
5623
5627
|
};
|
|
5624
5628
|
}
|
|
5625
5629
|
}
|
|
@@ -5640,23 +5644,23 @@ class eu {
|
|
|
5640
5644
|
status_code: s.success ? s.httpStatus ?? _.SUCCESS : s.error.httpStatus ?? _.INTERNAL_SERVER_ERROR
|
|
5641
5645
|
};
|
|
5642
5646
|
}
|
|
5643
|
-
async retryUploadRecording() {
|
|
5647
|
+
async retryUploadRecording(e) {
|
|
5644
5648
|
try {
|
|
5645
|
-
const
|
|
5646
|
-
return
|
|
5647
|
-
status_code:
|
|
5648
|
-
message: `Retried ${
|
|
5649
|
-
failed_files:
|
|
5649
|
+
const n = await this.allianceClient.retryFailedUploads(e);
|
|
5650
|
+
return n.success ? {
|
|
5651
|
+
status_code: n.httpStatus ?? _.SUCCESS,
|
|
5652
|
+
message: `Retried ${n.data.retried} files. ${n.data.succeeded} succeeded.`,
|
|
5653
|
+
failed_files: n.data.stillFailed
|
|
5650
5654
|
} : {
|
|
5651
5655
|
error_code: E.AUDIO_UPLOAD_FAILED,
|
|
5652
|
-
status_code:
|
|
5653
|
-
message:
|
|
5656
|
+
status_code: n.error.httpStatus ?? _.INTERNAL_SERVER_ERROR,
|
|
5657
|
+
message: n.error.message || "Retry upload failed."
|
|
5654
5658
|
};
|
|
5655
|
-
} catch (
|
|
5659
|
+
} catch (n) {
|
|
5656
5660
|
return {
|
|
5657
5661
|
error_code: E.INTERNAL_SERVER_ERROR,
|
|
5658
5662
|
status_code: _.INTERNAL_SERVER_ERROR,
|
|
5659
|
-
message: `Failed to retry upload. ${
|
|
5663
|
+
message: `Failed to retry upload. ${n}`
|
|
5660
5664
|
};
|
|
5661
5665
|
}
|
|
5662
5666
|
}
|
|
@@ -8286,14 +8290,14 @@ const O = class O {
|
|
|
8286
8290
|
forceAllowMoreChunks() {
|
|
8287
8291
|
return this.recording.forceAllowMoreChunks();
|
|
8288
8292
|
}
|
|
8289
|
-
endRecording() {
|
|
8290
|
-
return this.recording.endRecording();
|
|
8293
|
+
endRecording(e) {
|
|
8294
|
+
return this.recording.endRecording(e);
|
|
8291
8295
|
}
|
|
8292
8296
|
getSessionStatus(e, n) {
|
|
8293
8297
|
return this.recording.getSessionStatus(e, n);
|
|
8294
8298
|
}
|
|
8295
|
-
retryUploadRecording() {
|
|
8296
|
-
return this.recording.retryUploadRecording();
|
|
8299
|
+
retryUploadRecording(e) {
|
|
8300
|
+
return this.recording.retryUploadRecording(e);
|
|
8297
8301
|
}
|
|
8298
8302
|
cancelSession(e) {
|
|
8299
8303
|
return this.recording.cancelSession(e);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eka-care/ekascribe-ts-sdk",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.42",
|
|
4
4
|
"description": "EkaScribe TypeScript SDK - Modern ES2020 build",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"marked": "^18.0.4",
|
|
41
|
-
"med-scribe-alliance-ts-sdk": "
|
|
41
|
+
"med-scribe-alliance-ts-sdk": "2.0.40"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"vite-bundle-analyzer": "^1.3.6"
|