@eka-care/ekascribe-ts-sdk 1.4.9 → 1.4.10
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/config/get-voice-api-v2-config.d.ts +2 -0
- package/dist/api/config/get-voice-api-v2-config.js +26 -0
- package/dist/api/config/patch-voice-api-v2-config.d.ts +3 -0
- package/dist/api/config/patch-voice-api-v2-config.js +28 -0
- package/dist/constants/types.d.ts +14 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +6 -1
- package/package.json +1 -1
|
@@ -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 getConfigV2 = 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/`, 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 getConfigV2 api: ', error);
|
|
21
|
+
return {
|
|
22
|
+
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
23
|
+
message: `Failed to fetch initial configurations, ${error}`,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
const patchVoiceApiV2Config = async (request) => {
|
|
5
|
+
try {
|
|
6
|
+
const options = {
|
|
7
|
+
method: 'PATCH',
|
|
8
|
+
headers: {
|
|
9
|
+
'Content-Type': 'application/json',
|
|
10
|
+
},
|
|
11
|
+
body: JSON.stringify(request),
|
|
12
|
+
};
|
|
13
|
+
const response = await fetchWrapper(`${GET_EKA_VOICE_HOST_V2()}/config/`, options);
|
|
14
|
+
const res = await response.json();
|
|
15
|
+
return {
|
|
16
|
+
...res,
|
|
17
|
+
code: response.status,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
console.log('Error in getConfigV2 api: ', error);
|
|
22
|
+
return {
|
|
23
|
+
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
24
|
+
msg: `Failed to fetch initial configurations, ${error}`,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
export default patchVoiceApiV2Config;
|
|
@@ -288,3 +288,17 @@ export interface TGetV1TemplateSectionsResponse {
|
|
|
288
288
|
message: string;
|
|
289
289
|
};
|
|
290
290
|
}
|
|
291
|
+
export type TPatchVoiceApiV2ConfigRequest = {
|
|
292
|
+
auto_download?: boolean;
|
|
293
|
+
default_languages?: string[];
|
|
294
|
+
my_templates?: string[];
|
|
295
|
+
scribe_enabled?: boolean;
|
|
296
|
+
};
|
|
297
|
+
export interface TPatchVoiceApiV2ConfigResponse extends TPatchVoiceApiV2ConfigRequest {
|
|
298
|
+
msg: string;
|
|
299
|
+
code: number;
|
|
300
|
+
error?: {
|
|
301
|
+
code: string;
|
|
302
|
+
message: string;
|
|
303
|
+
};
|
|
304
|
+
}
|
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, TPostTransactionResponse, TPostV1TemplateRequest, TPostV1TemplateSectionRequest, TStartRecordingRequest } from './constants/types';
|
|
2
|
+
import { TEndRecordingResponse, TErrorCallback, TFileUploadProgressCallback, TGetTransactionHistoryResponse, TPatchTransactionRequest, TPatchVoiceApiV2ConfigRequest, TPostTransactionResponse, TPostV1TemplateRequest, TPostV1TemplateSectionRequest, TStartRecordingRequest } from './constants/types';
|
|
3
3
|
declare class EkaScribe {
|
|
4
4
|
private static instance;
|
|
5
5
|
private vadInstance;
|
|
@@ -55,6 +55,7 @@ declare class EkaScribe {
|
|
|
55
55
|
createTemplate(template: TPostV1TemplateRequest): Promise<import("./constants/types").TPostV1TemplateResponse>;
|
|
56
56
|
updateTemplate(template: TPostV1TemplateRequest): Promise<import("./constants/types").TPostV1TemplateResponse>;
|
|
57
57
|
deleteTemplate(template_id: string): Promise<import("./constants/types").TPostV1TemplateResponse>;
|
|
58
|
+
updateConfig(request: TPatchVoiceApiV2ConfigRequest): Promise<any>;
|
|
58
59
|
getAllTemplateSections(): Promise<import("./constants/types").TGetV1TemplateSectionsResponse>;
|
|
59
60
|
createTemplateSection(templateSection: TPostV1TemplateSectionRequest): Promise<import("./constants/types").TPostV1TemplateSectionResponse>;
|
|
60
61
|
updateTemplateSection(templateSection: TPostV1TemplateSectionRequest): Promise<import("./constants/types").TPostV1TemplateSectionResponse>;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ekascribe main Class having all the methods - Entry point
|
|
2
|
-
import { getConfigV2 } from './api/
|
|
2
|
+
import { getConfigV2 } from './api/config/get-voice-api-v2-config';
|
|
3
3
|
import { getVoiceApiV3Status } from './api/transaction/get-voice-api-v3-status';
|
|
4
4
|
import patchTransactionStatus from './api/transaction/patch-transaction-status';
|
|
5
5
|
import postTransactionCommit from './api/transaction/post-transaction-commit';
|
|
@@ -25,6 +25,7 @@ import getV1TemplateSections from './api/template-sections/get-v1-template-secti
|
|
|
25
25
|
import postV1TemplateSection from './api/template-sections/post-v1-template-section';
|
|
26
26
|
import patchV1TemplateSection from './api/template-sections/patch-v1-template-section';
|
|
27
27
|
import deleteV1TemplateSection from './api/template-sections/delete-v1-template-section';
|
|
28
|
+
import patchVoiceApiV2Config from './api/config/patch-voice-api-v2-config';
|
|
28
29
|
class EkaScribe {
|
|
29
30
|
// Private constructor to prevent direct instantiation
|
|
30
31
|
constructor() {
|
|
@@ -280,6 +281,10 @@ class EkaScribe {
|
|
|
280
281
|
const templatesResponse = await deleteV1Template(template_id);
|
|
281
282
|
return templatesResponse;
|
|
282
283
|
}
|
|
284
|
+
async updateConfig(request) {
|
|
285
|
+
const configResponse = await patchVoiceApiV2Config(request);
|
|
286
|
+
return configResponse;
|
|
287
|
+
}
|
|
283
288
|
// Template Section SDK methods
|
|
284
289
|
async getAllTemplateSections() {
|
|
285
290
|
const templateSectionsResponse = await getV1TemplateSections();
|