@eka-care/ekascribe-ts-sdk 1.5.44 → 1.5.45

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.
@@ -356,10 +356,13 @@ class VadWebClient {
356
356
  // if (this.micVad && typeof this.micVad.pause === 'function') {
357
357
  // this.micVad.pause(); // Stop recording first
358
358
  // }
359
+ console.log('rest vad web instance', this.micVad);
359
360
  // Properly destroy MicVAD instance
360
361
  if (this.micVad && typeof this.micVad.destroy === 'function') {
362
+ console.log('destroy vad web instance', this.micVad);
361
363
  this.micVad.destroy();
362
364
  }
365
+ console.log('reset vad web instance - 333', this.micVad);
363
366
  // Reset VAD state
364
367
  this.vad_past = [];
365
368
  this.last_clip_index = 0;
@@ -1,9 +1,10 @@
1
1
  import * as AWS from 'aws-sdk';
2
2
  import s3RetryWrapper from './s3-retry-wrapper';
3
+ import { GET_S3_BUCKET_NAME } from '../fetch-client/helper';
3
4
  export const getFilesS3 = async ({ fileName, maxPollingTime, }) => {
4
5
  try {
5
6
  const requestBody = {
6
- Bucket: 'm-prod-voice2rx',
7
+ Bucket: GET_S3_BUCKET_NAME(),
7
8
  Key: fileName,
8
9
  };
9
10
  const getFileCall = () => new Promise((resolve, reject) => {
@@ -1,11 +1,11 @@
1
1
  // @ts-nocheck
2
2
  import * as AWS from 'aws-sdk';
3
3
  import s3RetryWrapper from './s3-retry-wrapper';
4
- import { S3_BUCKET_NAME } from '../constants/constant';
4
+ import { GET_S3_BUCKET_NAME } from '../fetch-client/helper';
5
5
  const pushFileToS3 = async ({ fileBlob, fileName, txnID, businessID, is_shared_worker = false, }) => {
6
6
  try {
7
7
  const requestBody = {
8
- Bucket: S3_BUCKET_NAME,
8
+ Bucket: GET_S3_BUCKET_NAME(),
9
9
  Key: fileName,
10
10
  Body: fileBlob,
11
11
  Metadata: {
@@ -3,6 +3,7 @@ declare const setEnv: ({ env, clientId, auth_token, }: {
3
3
  clientId?: string;
4
4
  auth_token?: string;
5
5
  }) => void;
6
+ export declare const GET_S3_BUCKET_NAME: () => string;
6
7
  export declare const GET_CLIENT_ID: () => string;
7
8
  export declare const GET_AUTH_TOKEN: () => string;
8
9
  export declare const GET_EKA_VOICE_HOST_V1: () => string;
@@ -17,6 +17,8 @@ const PROD = {
17
17
  let envVar = PROD;
18
18
  let client_id = 'doc-web';
19
19
  let auth;
20
+ const s3_prod_bucket_name = 'm-prod-voice-record';
21
+ const s3_dev_bucket_name = 'm-pp-voice2rx';
20
22
  const setEnv = ({ env, clientId, auth_token, }) => {
21
23
  if (env) {
22
24
  envVar = env === 'PROD' ? PROD : DEV;
@@ -28,6 +30,7 @@ const setEnv = ({ env, clientId, auth_token, }) => {
28
30
  auth = auth_token;
29
31
  }
30
32
  };
33
+ export const GET_S3_BUCKET_NAME = () => envVar === PROD ? s3_prod_bucket_name : s3_dev_bucket_name;
31
34
  export const GET_CLIENT_ID = () => client_id;
32
35
  export const GET_AUTH_TOKEN = () => auth;
33
36
  export const GET_EKA_VOICE_HOST_V1 = () => envVar.EKA_VOICE_HOST_V1;
package/dist/index.js CHANGED
@@ -127,7 +127,9 @@ class EkaScribe {
127
127
  async patchSessionStatus({ sessionId, processing_status, processing_error, }) {
128
128
  try {
129
129
  const onEventCallback = EkaScribeStore.eventCallback;
130
+ console.log('mic vad', this.vadInstance.getMicVad());
130
131
  this.vadInstance.pauseVad();
132
+ console.log('mic vad paused', this.vadInstance.getMicVad());
131
133
  const patchTransactionResponse = await patchTransactionStatus({
132
134
  sessionId,
133
135
  processing_status,
@@ -1,6 +1,7 @@
1
1
  import postTransactionInit from '../api/transaction/post-transaction-init';
2
- import { S3_BUCKET_NAME, SDK_STATUS_CODE } from '../constants/constant';
2
+ import { SDK_STATUS_CODE } from '../constants/constant';
3
3
  import { CALLBACK_TYPE, ERROR_CODE } from '../constants/enums';
4
+ import { GET_S3_BUCKET_NAME } from '../fetch-client/helper';
4
5
  import EkaScribeStore from '../store/store';
5
6
  const initialiseTransaction = async (request) => {
6
7
  try {
@@ -26,7 +27,7 @@ const initialiseTransaction = async (request) => {
26
27
  EkaScribeStore.sessionBucketPath = filePath;
27
28
  const txnInitResponse = await postTransactionInit({
28
29
  ...request,
29
- s3Url: `s3://${S3_BUCKET_NAME}/${filePath}`,
30
+ s3Url: `s3://${GET_S3_BUCKET_NAME()}/${filePath}`,
30
31
  });
31
32
  const { code: txnInitStatusCode, b_id: businessId, oid, uuid, message: txnInitMessage, error: txnInitError, } = txnInitResponse;
32
33
  if (onEventCallback) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eka-care/ekascribe-ts-sdk",
3
- "version": "1.5.44",
3
+ "version": "1.5.45",
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>",