@eka-care/ekascribe-ts-sdk 1.5.67 → 1.5.69
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/api/templates/post-convert-transaction-to-template.d.ts +3 -0
- package/dist/api/templates/post-convert-transaction-to-template.js +32 -0
- package/dist/api/templates/post-convert-transcription-to-template.d.ts +3 -0
- package/dist/api/templates/post-convert-transcription-to-template.js +32 -0
- package/dist/constants/types.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TPostV1ConvertToTemplateRequest, TPostV1ConvertToTemplateResponse } from '../../constants/types';
|
|
2
|
+
declare function postConvertTransactionToTemplate({ txn_id, template_id, transcript, }: TPostV1ConvertToTemplateRequest): Promise<TPostV1ConvertToTemplateResponse>;
|
|
3
|
+
export default postConvertTransactionToTemplate;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SDK_STATUS_CODE } from '../../constants/constant';
|
|
2
|
+
import fetchWrapper from '../../fetch-client';
|
|
3
|
+
import { GET_EKA_VOICE_HOST_V1 } from '../../fetch-client/helper';
|
|
4
|
+
async function postConvertTransactionToTemplate({ txn_id, template_id, transcript, }) {
|
|
5
|
+
try {
|
|
6
|
+
const headers = new Headers();
|
|
7
|
+
headers.append('Content-Type', 'application/json');
|
|
8
|
+
const options = {
|
|
9
|
+
method: 'POST',
|
|
10
|
+
headers,
|
|
11
|
+
body: JSON.stringify({
|
|
12
|
+
transcript,
|
|
13
|
+
template_id,
|
|
14
|
+
}),
|
|
15
|
+
};
|
|
16
|
+
const response = await fetchWrapper(`${GET_EKA_VOICE_HOST_V1()}/transaction/${txn_id}/convert-to-template`, options, 60000);
|
|
17
|
+
let res = await response.json();
|
|
18
|
+
res = {
|
|
19
|
+
...res,
|
|
20
|
+
code: response.status,
|
|
21
|
+
};
|
|
22
|
+
return res;
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
console.log('%c postV1ConvertToTemplate -> error', 'color:#f5ce50', error);
|
|
26
|
+
return {
|
|
27
|
+
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
28
|
+
message: `Something went wrong! ${error}`,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export default postConvertTransactionToTemplate;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TPostV1ConvertToTemplateRequest, TPostV1ConvertToTemplateResponse } from '../../constants/types';
|
|
2
|
+
declare function postConvertTranscriptionToTemplate({ txn_id, template_id, transcript, }: TPostV1ConvertToTemplateRequest): Promise<TPostV1ConvertToTemplateResponse>;
|
|
3
|
+
export default postConvertTranscriptionToTemplate;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SDK_STATUS_CODE } from '../../constants/constant';
|
|
2
|
+
import fetchWrapper from '../../fetch-client';
|
|
3
|
+
import { GET_EKA_VOICE_HOST_V1 } from '../../fetch-client/helper';
|
|
4
|
+
async function postConvertTranscriptionToTemplate({ txn_id, template_id, transcript, }) {
|
|
5
|
+
try {
|
|
6
|
+
const headers = new Headers();
|
|
7
|
+
headers.append('Content-Type', 'application/json');
|
|
8
|
+
const options = {
|
|
9
|
+
method: 'POST',
|
|
10
|
+
headers,
|
|
11
|
+
body: JSON.stringify({
|
|
12
|
+
transcript,
|
|
13
|
+
template_id,
|
|
14
|
+
}),
|
|
15
|
+
};
|
|
16
|
+
const response = await fetchWrapper(`${GET_EKA_VOICE_HOST_V1()}/transaction/${txn_id}/convert-to-template`, options, 60000);
|
|
17
|
+
let res = await response.json();
|
|
18
|
+
res = {
|
|
19
|
+
...res,
|
|
20
|
+
code: response.status,
|
|
21
|
+
};
|
|
22
|
+
return res;
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
console.log('%c postV1ConvertToTemplate -> error', 'color:#f5ce50', error);
|
|
26
|
+
return {
|
|
27
|
+
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
28
|
+
message: `Something went wrong! ${error}`,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export default postConvertTranscriptionToTemplate;
|
|
@@ -371,6 +371,7 @@ export interface TPatchVoiceApiV2ConfigResponse extends TPatchVoiceApiV2ConfigRe
|
|
|
371
371
|
export type TPostV1ConvertToTemplateRequest = {
|
|
372
372
|
txn_id: string;
|
|
373
373
|
template_id: string;
|
|
374
|
+
transcript?: string;
|
|
374
375
|
};
|
|
375
376
|
export type TPostV1ConvertToTemplateResponse = {
|
|
376
377
|
status: 'success' | 'failed';
|
package/dist/index.d.ts
CHANGED
|
@@ -66,6 +66,7 @@ declare class EkaScribe {
|
|
|
66
66
|
updateTemplateSection(templateSection: TPostV1TemplateSectionRequest): Promise<import("./constants/types").TPostV1TemplateSectionResponse>;
|
|
67
67
|
deleteTemplateSection(section_id: string): Promise<import("./constants/types").TPostV1TemplateSectionResponse>;
|
|
68
68
|
postTransactionConvertToTemplate({ txn_id, template_id }: TPostV1ConvertToTemplateRequest): Promise<import("./constants/types").TPostV1ConvertToTemplateResponse>;
|
|
69
|
+
convertTranscriptionToTemplate(request: TPostV1ConvertToTemplateRequest): Promise<import("./constants/types").TPostV1ConvertToTemplateResponse>;
|
|
69
70
|
searchPastSessions(request: TSearchSessionsRequest): Promise<import("./constants/types").TSessionHistoryData[]>;
|
|
70
71
|
searchSessionsByPatientName(request: TSearchSessionsByPatientRequest): Promise<import("./constants/types").TSessionHistoryData[]>;
|
|
71
72
|
searchSessionsBySessionId(request: TSearchSessionsByPatientRequest): Promise<import("./constants/types").TSessionHistoryData[]>;
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,7 @@ import { patchVoiceApiV3Status } from './api/transaction/patch-voice-api-v3-stat
|
|
|
32
32
|
import searchSessions, { searchSessionsByPatient, searchSessionsBySessionId, } from './utils/search-past-sessions';
|
|
33
33
|
import { getConfigV2MyTemplates } from './api/config/get-voice-api-v2-config-my-templates';
|
|
34
34
|
import putVoiceApiV2Config from './api/config/patch-voice-api-v2-config';
|
|
35
|
+
import postConvertTranscriptionToTemplate from './api/templates/post-convert-transcription-to-template';
|
|
35
36
|
class EkaScribe {
|
|
36
37
|
// Private constructor to prevent direct instantiation
|
|
37
38
|
constructor() {
|
|
@@ -337,6 +338,10 @@ class EkaScribe {
|
|
|
337
338
|
const convertToTemplateResponse = await postV1ConvertToTemplate({ txn_id, template_id });
|
|
338
339
|
return convertToTemplateResponse;
|
|
339
340
|
}
|
|
341
|
+
async convertTranscriptionToTemplate(request) {
|
|
342
|
+
const convertToTemplateResponse = await postConvertTranscriptionToTemplate(request);
|
|
343
|
+
return convertToTemplateResponse;
|
|
344
|
+
}
|
|
340
345
|
async searchPastSessions(request) {
|
|
341
346
|
const searchSessionsResponse = await searchSessions(request);
|
|
342
347
|
return searchSessionsResponse;
|