@eka-care/ekascribe-ts-sdk 1.5.58 → 1.5.59
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.
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SDK_STATUS_CODE } from '../../constants/constant';
|
|
2
|
+
import fetchWrapper from '../../fetch-client';
|
|
3
|
+
import { GET_EKA_VOICE_HOST_V2 } from '../../fetch-client/helper';
|
|
4
|
+
export const getConfigV2MyTemplates = async () => {
|
|
5
|
+
try {
|
|
6
|
+
const options = {
|
|
7
|
+
method: 'GET',
|
|
8
|
+
headers: {
|
|
9
|
+
'Content-Type': 'application/json',
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
const response = await fetchWrapper(`${GET_EKA_VOICE_HOST_V2()}/config/?my_templates=true`, options);
|
|
13
|
+
const res = await response.json();
|
|
14
|
+
return {
|
|
15
|
+
...res,
|
|
16
|
+
code: response.status,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
console.log('Error in getConfigV2MyTemplates api: ', error);
|
|
21
|
+
return {
|
|
22
|
+
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
23
|
+
message: `Failed to fetch initial configurations, ${error}`,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -71,6 +71,7 @@ declare class EkaScribe {
|
|
|
71
71
|
searchSessionsBySessionId(request: TSearchSessionsByPatientRequest): Promise<import("./constants/types").TSessionHistoryData[]>;
|
|
72
72
|
uploadAudioWithPresignedUrl(request: TPostV1UploadAudioFilesRequest): Promise<import("./main/upload-full-audio-with-presigned-url").TFullAudioUploadResponse>;
|
|
73
73
|
updateResultSummary(request: TPatchVoiceApiV3StatusRequest): Promise<import("./constants/types").TPatchVoiceApiV3StatusResponse>;
|
|
74
|
+
getConfigMyTemplates(): Promise<import("./constants/types").TGetConfigV2Response>;
|
|
74
75
|
}
|
|
75
76
|
export declare const getEkaScribeInstance: ({ access_token, env, clientId, }: {
|
|
76
77
|
access_token?: string;
|
package/dist/index.js
CHANGED
|
@@ -31,6 +31,7 @@ import postV1ConvertToTemplate from './api/templates/post-transaction-convert-to
|
|
|
31
31
|
import { postV1UploadAudioFiles } from './main/upload-full-audio-with-presigned-url';
|
|
32
32
|
import { patchVoiceApiV3Status } from './api/transaction/patch-voice-api-v3-status';
|
|
33
33
|
import searchSessions, { searchSessionsByPatient, searchSessionsBySessionId, } from './utils/search-past-sessions';
|
|
34
|
+
import { getConfigV2MyTemplates } from './api/config/get-voice-api-v2-config-my-templates';
|
|
34
35
|
class EkaScribe {
|
|
35
36
|
// Private constructor to prevent direct instantiation
|
|
36
37
|
constructor() {
|
|
@@ -356,6 +357,10 @@ class EkaScribe {
|
|
|
356
357
|
const updateResultSummaryResponse = await patchVoiceApiV3Status(request);
|
|
357
358
|
return updateResultSummaryResponse;
|
|
358
359
|
}
|
|
360
|
+
async getConfigMyTemplates() {
|
|
361
|
+
const configMyTemplatesResponse = await getConfigV2MyTemplates();
|
|
362
|
+
return configMyTemplatesResponse;
|
|
363
|
+
}
|
|
359
364
|
}
|
|
360
365
|
Object.defineProperty(EkaScribe, "instance", {
|
|
361
366
|
enumerable: true,
|