@eka-care/ekascribe-ts-sdk 1.4.3 → 1.4.5

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.
@@ -125,9 +125,6 @@ class VadWebClient {
125
125
  this.frame_size = FRAME_SIZE;
126
126
  this.speech_pad_frames = PRE_SPEECH_PAD_FRAMES;
127
127
  this.micVad = {};
128
- // instantiate MicVad
129
- // TODO: initialise this in start recording
130
- // this.initVad();
131
128
  }
132
129
  /**
133
130
  * Check for continuous silence and trigger periodic warnings
@@ -1,7 +1,7 @@
1
1
  declare const setEnv: ({ env, clientId, auth_token, }: {
2
2
  env?: "PROD" | "DEV";
3
3
  clientId?: string;
4
- auth_token: string;
4
+ auth_token?: string;
5
5
  }) => void;
6
6
  export declare const GET_EKA_HOST: () => string;
7
7
  export declare const GET_CLIENT_ID: () => string;
@@ -18,7 +18,9 @@ const setEnv = ({ env, clientId, auth_token, }) => {
18
18
  if (clientId) {
19
19
  client_id = clientId;
20
20
  }
21
- auth = auth_token;
21
+ if (auth_token) {
22
+ auth = auth_token;
23
+ }
22
24
  };
23
25
  export const GET_EKA_HOST = () => envVar.EKA_HOST;
24
26
  export const GET_CLIENT_ID = () => client_id;
@@ -12,8 +12,8 @@ export default async function fetchWrapper(url, options = {}, timeoutMs = API_TI
12
12
  if (!newHeaders.get('client-id')) {
13
13
  newHeaders.set('client-id', GET_CLIENT_ID());
14
14
  }
15
- if (!newHeaders.get('Authorization') && GET_AUTH_TOKEN()) {
16
- newHeaders.set('Authorization', `Bearer ${GET_AUTH_TOKEN()}`);
15
+ if (!newHeaders.get('auth') && GET_AUTH_TOKEN()) {
16
+ newHeaders.set('auth', GET_AUTH_TOKEN());
17
17
  }
18
18
  const response = await fetch(url, {
19
19
  ...options,
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ declare class EkaScribe {
7
7
  private audioBufferInstance;
8
8
  private constructor();
9
9
  static getInstance({ access_token, env, clientId, }: {
10
- access_token: string;
10
+ access_token?: string;
11
11
  env?: 'PROD' | 'DEV';
12
12
  clientId?: string;
13
13
  }): EkaScribe;
@@ -53,7 +53,7 @@ declare class EkaScribe {
53
53
  }): void;
54
54
  }
55
55
  export declare const getEkaScribeInstance: ({ access_token, env, clientId, }: {
56
- access_token: string;
56
+ access_token?: string;
57
57
  env?: "PROD" | "DEV";
58
58
  clientId?: string;
59
59
  }) => EkaScribe;
package/dist/index.js CHANGED
@@ -50,13 +50,10 @@ class EkaScribe {
50
50
  }
51
51
  // Static method to get the singleton instance with optional initialization
52
52
  static getInstance({ access_token, env, clientId, }) {
53
- console.log('access_token', access_token);
54
- console.log('env', env);
55
- console.log('clientId', clientId);
56
53
  setEnv({
57
- auth_token: access_token,
58
- env,
59
- clientId,
54
+ ...(access_token ? { auth_token: access_token } : {}),
55
+ ...(env ? { env } : {}),
56
+ ...(clientId ? { clientId } : {}),
60
57
  });
61
58
  if (!EkaScribe.instance) {
62
59
  EkaScribe.instance = new EkaScribe();
@@ -14,7 +14,7 @@ const startVoiceRecording = async () => {
14
14
  message: 'Microphone access is required to start recording. Please recheck access.',
15
15
  };
16
16
  }
17
- console.log('%c Line:22 🍇 vadInstance', 'color:#fca650', vadInstance);
17
+ await vadInstance?.initVad();
18
18
  const micVad = vadInstance?.getMicVad();
19
19
  const isVadLoading = vadInstance?.isVadLoading();
20
20
  if (isVadLoading || !micVad || Object.keys(micVad).length === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eka-care/ekascribe-ts-sdk",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
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>",