@eka-care/ekascribe-ts-sdk 1.5.8 → 1.5.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.
@@ -0,0 +1,2 @@
1
+ import { TPatchVoiceApiV3StatusRequest, TPatchVoiceApiV3StatusResponse } from '../../constants/types';
2
+ export declare const patchVoiceApiV3Status: ({ txnId, data, }: TPatchVoiceApiV3StatusRequest) => Promise<TPatchVoiceApiV3StatusResponse>;
@@ -0,0 +1,27 @@
1
+ import { SDK_STATUS_CODE } from '../../constants/constant';
2
+ import fetchWrapper from '../../fetch-client';
3
+ import { GET_EKA_VOICE_HOST_V3 } from '../../fetch-client/helper';
4
+ export const patchVoiceApiV3Status = async ({ txnId, data, }) => {
5
+ try {
6
+ const headers = new Headers();
7
+ headers.append('Content-Type', 'application/json');
8
+ const options = {
9
+ method: 'PATCH',
10
+ headers,
11
+ body: JSON.stringify(data),
12
+ };
13
+ // Use custom timeout for this API (16 seconds instead of default 5 seconds)
14
+ const getResponse = await fetchWrapper(`${GET_EKA_VOICE_HOST_V3()}/status/${txnId}`, options, 30000);
15
+ const response = await getResponse.json();
16
+ return {
17
+ ...response,
18
+ status_code: getResponse.status,
19
+ };
20
+ }
21
+ catch (error) {
22
+ return {
23
+ code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
24
+ message: `Something went wrong! ${error}`,
25
+ };
26
+ }
27
+ };
@@ -382,3 +382,22 @@ export type TPostV1FileUploadResponse = {
382
382
  message: string;
383
383
  };
384
384
  };
385
+ export type TPatchVoiceApiV3StatusResponse = {
386
+ status: string;
387
+ message: string;
388
+ txn_id: string;
389
+ b_id: string;
390
+ code: number;
391
+ error?: {
392
+ code: string;
393
+ message: string;
394
+ display_message: string;
395
+ };
396
+ };
397
+ export type TPatchVoiceApiV3StatusRequest = {
398
+ txnId: string;
399
+ data: {
400
+ 'template-id': string;
401
+ data: string;
402
+ }[];
403
+ };
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, TPostV1ConvertToTemplateRequest, TPostV1TemplateRequest, TPostV1TemplateSectionRequest, TPostV1UploadAudioFilesRequest, TStartRecordingRequest } from './constants/types';
2
+ import { TEndRecordingResponse, TErrorCallback, TFileUploadProgressCallback, TGetTransactionHistoryResponse, TPatchTransactionRequest, TPatchVoiceApiV2ConfigRequest, TPatchVoiceApiV3StatusRequest, TPostTransactionResponse, TPostV1ConvertToTemplateRequest, TPostV1TemplateRequest, TPostV1TemplateSectionRequest, TPostV1UploadAudioFilesRequest, TStartRecordingRequest } from './constants/types';
3
3
  import { TSearchSessionsByPatientRequest } from './utils/search-sessions-by-patient-name';
4
4
  declare class EkaScribe {
5
5
  private static instance;
@@ -67,6 +67,7 @@ declare class EkaScribe {
67
67
  postTransactionConvertToTemplate({ txn_id, template_id }: TPostV1ConvertToTemplateRequest): Promise<import("./constants/types").TPostV1ConvertToTemplateResponse>;
68
68
  searchSessionsByPatientName(request: TSearchSessionsByPatientRequest): Promise<unknown>;
69
69
  uploadAudioWithPresignedUrl(request: TPostV1UploadAudioFilesRequest): Promise<import("./main/upload-full-audio-with-presigned-url").TFullAudioUploadResponse>;
70
+ updateResultSummary(request: TPatchVoiceApiV3StatusRequest): Promise<import("./constants/types").TPatchVoiceApiV3StatusResponse>;
70
71
  }
71
72
  export declare const getEkaScribeInstance: ({ access_token, env, clientId, }: {
72
73
  access_token?: string;
package/dist/index.js CHANGED
@@ -30,6 +30,7 @@ import cookV1MediaAiCreateTemplate from './api/templates/cook-v1-medai-ai-create
30
30
  import postV1ConvertToTemplate from './api/templates/post-transaction-convert-to-template';
31
31
  import searchSessionsByPatient from './utils/search-sessions-by-patient-name';
32
32
  import { postV1UploadAudioFiles } from './main/upload-full-audio-with-presigned-url';
33
+ import { patchVoiceApiV3Status } from './api/transaction/patch-voice-api-v3-status';
33
34
  class EkaScribe {
34
35
  // Private constructor to prevent direct instantiation
35
36
  constructor() {
@@ -317,6 +318,10 @@ class EkaScribe {
317
318
  const uploadAudioFilesResponse = await postV1UploadAudioFiles(request);
318
319
  return uploadAudioFilesResponse;
319
320
  }
321
+ async updateResultSummary(request) {
322
+ const updateResultSummaryResponse = await patchVoiceApiV3Status(request);
323
+ return updateResultSummaryResponse;
324
+ }
320
325
  }
321
326
  Object.defineProperty(EkaScribe, "instance", {
322
327
  enumerable: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eka-care/ekascribe-ts-sdk",
3
- "version": "1.5.8",
3
+ "version": "1.5.10",
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>",