@eka-care/ekascribe-ts-sdk 1.4.34 → 1.4.36

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.
@@ -10,14 +10,15 @@ export const getConfigV2 = async () => {
10
10
  },
11
11
  };
12
12
  const response = await fetchWrapper(`${GET_EKA_VOICE_HOST_V2()}/config/`, options);
13
+ console.log(response, 'response in getConfigV2');
13
14
  const res = await response.json();
15
+ console.log(res, 'res in getConfigV2');
14
16
  return {
15
17
  ...res,
16
18
  code: response.status,
17
19
  };
18
20
  }
19
21
  catch (error) {
20
- // This catch block now only handles actual network errors, timeouts, etc.
21
22
  console.log('Error in getConfigV2 api: ', error);
22
23
  return {
23
24
  code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
@@ -1,13 +1,15 @@
1
1
  import { GET_CLIENT_ID, GET_AUTH_TOKEN } from './helper';
2
2
  const API_TIMEOUT_MS = 10000;
3
3
  export default async function fetchWrapper(url, options = {}, timeoutMs = API_TIMEOUT_MS) {
4
- const controller = new AbortController();
5
- let timeoutId = null;
4
+ // const controller = new AbortController();
5
+ // let timeoutId: NodeJS.Timeout | null = null;
6
+ console.log('fetchWrapper - SDK', timeoutMs);
6
7
  try {
7
8
  // Set up timeout
8
- timeoutId = setTimeout(() => {
9
- controller.abort();
10
- }, timeoutMs);
9
+ // timeoutId = setTimeout(() => {
10
+ // console.log('request aborted due to timeout');
11
+ // controller.abort();
12
+ // }, timeoutMs);
11
13
  const newHeaders = new Headers(options.headers);
12
14
  if (!newHeaders.get('client-id')) {
13
15
  newHeaders.set('client-id', GET_CLIENT_ID());
@@ -18,24 +20,23 @@ export default async function fetchWrapper(url, options = {}, timeoutMs = API_TI
18
20
  const response = await fetch(url, {
19
21
  ...options,
20
22
  headers: newHeaders,
21
- signal: controller.signal,
23
+ // signal: controller.signal,
22
24
  credentials: 'include',
23
25
  });
24
- console.log(response, 'response in fetch wrapper');
26
+ console.log(response, response.status, 'response in fetch wrapper - SDK');
25
27
  if (response.status === 401 || response.status === 403) {
26
- console.log('unauthorized - fetch wrapper ', response.status);
28
+ console.log('unauthorized - fetch wrapper - SDK', response.status);
27
29
  }
28
- // Always return the response, even for error status codes
29
30
  return response;
30
31
  }
31
32
  catch (error) {
32
- console.error(error, 'error in fetch wrapper');
33
+ console.error(error, 'error in fetch wrapper - SDK');
33
34
  throw error;
34
35
  }
35
36
  finally {
36
- if (timeoutId) {
37
- clearTimeout(timeoutId);
38
- timeoutId = null;
39
- }
37
+ // if (timeoutId) {
38
+ // clearTimeout(timeoutId);
39
+ // timeoutId = null;
40
+ // }
40
41
  }
41
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eka-care/ekascribe-ts-sdk",
3
- "version": "1.4.34",
3
+ "version": "1.4.36",
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>",