@eka-care/ekascribe-ts-sdk 1.5.58 → 1.5.60

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,2 @@
1
+ import { TGetConfigV2Response } from '../../constants/types';
2
+ export declare const getConfigV2MyTemplates: () => Promise<TGetConfigV2Response>;
@@ -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
+ };
@@ -1,3 +1,3 @@
1
1
  import { TPatchVoiceApiV2ConfigRequest } from '../../constants/types';
2
- declare const patchVoiceApiV2Config: (request: TPatchVoiceApiV2ConfigRequest) => Promise<any>;
3
- export default patchVoiceApiV2Config;
2
+ declare const putVoiceApiV2Config: (request: TPatchVoiceApiV2ConfigRequest) => Promise<any>;
3
+ export default putVoiceApiV2Config;
@@ -1,10 +1,10 @@
1
1
  import { SDK_STATUS_CODE } from '../../constants/constant';
2
2
  import fetchWrapper from '../../fetch-client';
3
3
  import { GET_EKA_VOICE_HOST_V2 } from '../../fetch-client/helper';
4
- const patchVoiceApiV2Config = async (request) => {
4
+ const putVoiceApiV2Config = async (request) => {
5
5
  try {
6
6
  const options = {
7
- method: 'PATCH',
7
+ method: 'PUT',
8
8
  headers: {
9
9
  'Content-Type': 'application/json',
10
10
  },
@@ -25,4 +25,4 @@ const patchVoiceApiV2Config = async (request) => {
25
25
  };
26
26
  }
27
27
  };
28
- export default patchVoiceApiV2Config;
28
+ export default putVoiceApiV2Config;
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
@@ -25,12 +25,13 @@ 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';
29
28
  import cookV1MediaAiCreateTemplate from './api/templates/cook-v1-medai-ai-create-template';
30
29
  import postV1ConvertToTemplate from './api/templates/post-transaction-convert-to-template';
31
30
  import { postV1UploadAudioFiles } from './main/upload-full-audio-with-presigned-url';
32
31
  import { patchVoiceApiV3Status } from './api/transaction/patch-voice-api-v3-status';
33
32
  import searchSessions, { searchSessionsByPatient, searchSessionsBySessionId, } from './utils/search-past-sessions';
33
+ import { getConfigV2MyTemplates } from './api/config/get-voice-api-v2-config-my-templates';
34
+ import putVoiceApiV2Config from './api/config/patch-voice-api-v2-config';
34
35
  class EkaScribe {
35
36
  // Private constructor to prevent direct instantiation
36
37
  constructor() {
@@ -312,7 +313,7 @@ class EkaScribe {
312
313
  return templatesResponse;
313
314
  }
314
315
  async updateConfig(request) {
315
- const configResponse = await patchVoiceApiV2Config(request);
316
+ const configResponse = await putVoiceApiV2Config(request);
316
317
  return configResponse;
317
318
  }
318
319
  // Template Section SDK methods
@@ -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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eka-care/ekascribe-ts-sdk",
3
- "version": "1.5.58",
3
+ "version": "1.5.60",
4
4
  "main": "dist/index.js",
5
5
  "repository": "git@github.com:eka-care/eka-js-sdk.git",
6
6
  "author": "Sanikagoyal28 <sanikagoyal9@gmail.com>",