@eka-care/ekascribe-ts-sdk 1.4.23 → 1.4.25
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-transaction-convert-to-template.d.ts +3 -0
- package/dist/api/templates/post-transaction-convert-to-template.js +29 -0
- package/dist/api/transaction/get-voice-api-v3-status.d.ts +3 -0
- package/dist/constants/types.d.ts +18 -0
- package/dist/index.d.ts +2 -1
- 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 postV1ConvertToTemplate({ txn_id, template_id, }: TPostV1ConvertToTemplateRequest): Promise<TPostV1ConvertToTemplateResponse>;
|
|
3
|
+
export default postV1ConvertToTemplate;
|
|
@@ -0,0 +1,29 @@
|
|
|
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 postV1ConvertToTemplate({ txn_id, template_id, }) {
|
|
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
|
+
};
|
|
13
|
+
const response = await fetchWrapper(`${GET_EKA_VOICE_HOST_V1()}/transaction/${txn_id}/convert-to-template/${template_id}`, options);
|
|
14
|
+
let res = await response.json();
|
|
15
|
+
res = {
|
|
16
|
+
...res,
|
|
17
|
+
code: response.status,
|
|
18
|
+
};
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
console.log('%c postV1ConvertToTemplate -> error', 'color:#f5ce50', error);
|
|
23
|
+
return {
|
|
24
|
+
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
25
|
+
message: `Something went wrong! ${error}`,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export default postV1ConvertToTemplate;
|
|
@@ -310,3 +310,21 @@ export interface TPatchVoiceApiV2ConfigResponse extends TPatchVoiceApiV2ConfigRe
|
|
|
310
310
|
message: string;
|
|
311
311
|
};
|
|
312
312
|
}
|
|
313
|
+
export type TPostV1ConvertToTemplateRequest = {
|
|
314
|
+
txn_id: string;
|
|
315
|
+
template_id: string;
|
|
316
|
+
};
|
|
317
|
+
export type TPostV1ConvertToTemplateResponse = {
|
|
318
|
+
status: 'success' | 'failed';
|
|
319
|
+
message: string;
|
|
320
|
+
txn_id: string;
|
|
321
|
+
template_id: string;
|
|
322
|
+
b_id: string;
|
|
323
|
+
code: number;
|
|
324
|
+
msg: string;
|
|
325
|
+
error?: {
|
|
326
|
+
code: string;
|
|
327
|
+
message: string;
|
|
328
|
+
display_message: string;
|
|
329
|
+
};
|
|
330
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TGetStatusResponse } from './api/transaction/get-voice-api-v3-status';
|
|
2
|
-
import { TEndRecordingResponse, TErrorCallback, TFileUploadProgressCallback, TGetTransactionHistoryResponse, TPatchTransactionRequest, TPatchVoiceApiV2ConfigRequest, TPostTransactionResponse, TPostV1TemplateRequest, TPostV1TemplateSectionRequest, TStartRecordingRequest } from './constants/types';
|
|
2
|
+
import { TEndRecordingResponse, TErrorCallback, TFileUploadProgressCallback, TGetTransactionHistoryResponse, TPatchTransactionRequest, TPatchVoiceApiV2ConfigRequest, TPostTransactionResponse, TPostV1ConvertToTemplateRequest, TPostV1TemplateRequest, TPostV1TemplateSectionRequest, TStartRecordingRequest } from './constants/types';
|
|
3
3
|
declare class EkaScribe {
|
|
4
4
|
private static instance;
|
|
5
5
|
private vadInstance;
|
|
@@ -61,6 +61,7 @@ declare class EkaScribe {
|
|
|
61
61
|
createTemplateSection(templateSection: TPostV1TemplateSectionRequest): Promise<import("./constants/types").TPostV1TemplateSectionResponse>;
|
|
62
62
|
updateTemplateSection(templateSection: TPostV1TemplateSectionRequest): Promise<import("./constants/types").TPostV1TemplateSectionResponse>;
|
|
63
63
|
deleteTemplateSection(section_id: string): Promise<import("./constants/types").TPostV1TemplateSectionResponse>;
|
|
64
|
+
postTransactionConvertToTemplate({ txn_id, template_id }: TPostV1ConvertToTemplateRequest): Promise<import("./constants/types").TPostV1ConvertToTemplateResponse>;
|
|
64
65
|
}
|
|
65
66
|
export declare const getEkaScribeInstance: ({ access_token, env, clientId, }: {
|
|
66
67
|
access_token?: string;
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,7 @@ import patchV1TemplateSection from './api/template-sections/patch-v1-template-se
|
|
|
27
27
|
import deleteV1TemplateSection from './api/template-sections/delete-v1-template-section';
|
|
28
28
|
import patchVoiceApiV2Config from './api/config/patch-voice-api-v2-config';
|
|
29
29
|
import cookV1MediaAiCreateTemplate from './api/templates/cook-v1-medai-ai-create-template';
|
|
30
|
+
import postV1ConvertToTemplate from './api/templates/post-transaction-convert-to-template';
|
|
30
31
|
class EkaScribe {
|
|
31
32
|
// Private constructor to prevent direct instantiation
|
|
32
33
|
constructor() {
|
|
@@ -307,6 +308,10 @@ class EkaScribe {
|
|
|
307
308
|
const templateSectionsResponse = await deleteV1TemplateSection(section_id);
|
|
308
309
|
return templateSectionsResponse;
|
|
309
310
|
}
|
|
311
|
+
async postTransactionConvertToTemplate({ txn_id, template_id }) {
|
|
312
|
+
const convertToTemplateResponse = await postV1ConvertToTemplate({ txn_id, template_id });
|
|
313
|
+
return convertToTemplateResponse;
|
|
314
|
+
}
|
|
310
315
|
}
|
|
311
316
|
Object.defineProperty(EkaScribe, "instance", {
|
|
312
317
|
enumerable: true,
|