@eka-care/ekascribe-ts-sdk 1.4.0 → 1.4.2

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.
@@ -9,11 +9,13 @@ export default async function fetchWrapper(url, options = {}, timeoutMs = API_TI
9
9
  controller.abort();
10
10
  }, timeoutMs);
11
11
  const newHeaders = new Headers(options.headers);
12
+ console.log('GET_CLIENT_ID()', GET_CLIENT_ID());
12
13
  if (!newHeaders.get('client-id')) {
13
14
  newHeaders.set('client-id', GET_CLIENT_ID());
14
15
  }
15
- if (!newHeaders.get('auth') && GET_AUTH_TOKEN()) {
16
- newHeaders.set('auth', GET_AUTH_TOKEN());
16
+ console.log('GET_AUTH_TOKEN()', GET_AUTH_TOKEN());
17
+ if (!newHeaders.get('Authorization') && GET_AUTH_TOKEN()) {
18
+ newHeaders.set('Authorization', GET_AUTH_TOKEN());
17
19
  }
18
20
  const response = await fetch(url, {
19
21
  ...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,16 +50,18 @@ 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
+ setEnv({
57
+ auth_token: access_token,
58
+ env,
59
+ clientId,
60
+ });
53
61
  if (!EkaScribe.instance) {
54
62
  EkaScribe.instance = new EkaScribe();
63
+ console.log('EkaScribe.instance', EkaScribe.instance);
55
64
  // Initialize if params are provided
56
- if (access_token) {
57
- setEnv({
58
- auth_token: access_token,
59
- env,
60
- clientId,
61
- });
62
- }
63
65
  }
64
66
  return EkaScribe.instance;
65
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eka-care/ekascribe-ts-sdk",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
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>",