@eka-care/ekascribe-ts-sdk 1.5.87 → 1.5.88

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.
Files changed (54) hide show
  1. package/dist/api/config/get-voice-api-v2-config-my-templates.js +22 -12
  2. package/dist/api/config/get-voice-api-v2-config.js +22 -12
  3. package/dist/api/config/patch-voice-api-v2-config.js +21 -13
  4. package/dist/api/post-cog-init.js +28 -15
  5. package/dist/api/post-v1-file-upload.js +38 -28
  6. package/dist/api/template-sections/delete-v1-template-section.js +37 -27
  7. package/dist/api/template-sections/get-v1-template-sections.js +37 -27
  8. package/dist/api/template-sections/patch-v1-template-section.js +46 -36
  9. package/dist/api/template-sections/post-v1-template-section.js +45 -35
  10. package/dist/api/templates/cook-v1-medai-ai-create-template.js +35 -25
  11. package/dist/api/templates/delete-v1-template.js +37 -27
  12. package/dist/api/templates/get-v1-templates.js +37 -27
  13. package/dist/api/templates/patch-v1-template.js +44 -33
  14. package/dist/api/templates/post-convert-transcription-to-template.js +41 -31
  15. package/dist/api/templates/post-transaction-convert-to-template.js +38 -28
  16. package/dist/api/templates/post-v1-template.js +43 -33
  17. package/dist/api/transaction/get-transaction-history.js +20 -9
  18. package/dist/api/transaction/get-voice-api-v3-status-transcript.js +21 -8
  19. package/dist/api/transaction/get-voice-api-v3-status.js +21 -8
  20. package/dist/api/transaction/patch-transaction-status.js +23 -14
  21. package/dist/api/transaction/patch-voice-api-v3-status.js +22 -12
  22. package/dist/api/transaction/post-transaction-commit.js +41 -31
  23. package/dist/api/transaction/post-transaction-init.js +52 -47
  24. package/dist/api/transaction/post-transaction-stop.js +41 -31
  25. package/dist/api/upload-audio-with-presigned-url.js +67 -55
  26. package/dist/audio-chunker/audio-buffer-manager.js +5 -3
  27. package/dist/audio-chunker/audio-file-manager.js +353 -350
  28. package/dist/audio-chunker/vad-web.js +116 -97
  29. package/dist/aws-services/configure-aws.js +5 -2
  30. package/dist/aws-services/get-files-s3.js +20 -7
  31. package/dist/aws-services/s3-retry-wrapper.js +44 -31
  32. package/dist/aws-services/translate-text-to-target-language.js +28 -15
  33. package/dist/aws-services/upload-file-to-s3.js +17 -6
  34. package/dist/constants/constant.js +22 -19
  35. package/dist/constants/enums.js +15 -12
  36. package/dist/constants/setup-config.js +10 -7
  37. package/dist/constants/types.js +2 -1
  38. package/dist/fetch-client/helper.js +24 -11
  39. package/dist/fetch-client/index.js +61 -52
  40. package/dist/index.js +321 -254
  41. package/dist/main/end-recording.js +56 -53
  42. package/dist/main/init-transaction.js +36 -27
  43. package/dist/main/pause-recording.js +17 -18
  44. package/dist/main/poll-output-summary.js +21 -7
  45. package/dist/main/resume-recording.js +13 -14
  46. package/dist/main/retry-upload-recording.js +39 -30
  47. package/dist/main/start-recording.js +34 -26
  48. package/dist/main/upload-full-audio-with-presigned-url.js +84 -69
  49. package/dist/shared-worker/s3-file-upload.js +88 -79
  50. package/dist/store/store.js +3 -1
  51. package/dist/utils/compress-mp3-audio.js +6 -4
  52. package/dist/utils/get-worker-url.js +12 -7
  53. package/dist/utils/search-past-sessions.js +23 -9
  54. package/package.json +1 -1
@@ -1,28 +1,38 @@
1
- import { SDK_STATUS_CODE } from '../../constants/constant';
2
- import fetchWrapper from '../../fetch-client';
3
- import { GET_EKA_VOICE_HOST_V1 } from '../../fetch-client/helper';
4
- async function deleteV1Template(template_id) {
5
- try {
6
- const headers = new Headers();
7
- headers.append('Content-Type', 'application/json');
8
- const options = {
9
- method: 'DELETE',
10
- headers,
11
- };
12
- const response = await fetchWrapper(`${GET_EKA_VOICE_HOST_V1()}/template/${template_id}`, options);
13
- let res = await response.json();
14
- res = {
15
- ...res,
16
- code: response.status,
17
- };
18
- return res;
19
- }
20
- catch (error) {
21
- console.log('%c deleteV1Template -> error', 'color:#f5ce50', error);
22
- return {
23
- code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
24
- msg: `Something went wrong! ${error}`,
25
- };
26
- }
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const constant_1 = require("../../constants/constant");
13
+ const fetch_client_1 = require("../../fetch-client");
14
+ const helper_1 = require("../../fetch-client/helper");
15
+ function deleteV1Template(template_id) {
16
+ return __awaiter(this, void 0, void 0, function* () {
17
+ try {
18
+ const headers = new Headers();
19
+ headers.append('Content-Type', 'application/json');
20
+ const options = {
21
+ method: 'DELETE',
22
+ headers,
23
+ };
24
+ const response = yield (0, fetch_client_1.default)(`${(0, helper_1.GET_EKA_VOICE_HOST_V1)()}/template/${template_id}`, options);
25
+ let res = yield response.json();
26
+ res = Object.assign(Object.assign({}, res), { code: response.status });
27
+ return res;
28
+ }
29
+ catch (error) {
30
+ console.log('%c deleteV1Template -> error', 'color:#f5ce50', error);
31
+ return {
32
+ code: constant_1.SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
33
+ msg: `Something went wrong! ${error}`,
34
+ };
35
+ }
36
+ });
27
37
  }
28
- export default deleteV1Template;
38
+ exports.default = deleteV1Template;
@@ -1,28 +1,38 @@
1
- import { SDK_STATUS_CODE } from '../../constants/constant';
2
- import fetchWrapper from '../../fetch-client';
3
- import { GET_EKA_VOICE_HOST_V1 } from '../../fetch-client/helper';
4
- async function getV1Templates() {
5
- try {
6
- const headers = new Headers();
7
- headers.append('Content-Type', 'application/json');
8
- const options = {
9
- method: 'GET',
10
- headers,
11
- };
12
- const response = await fetchWrapper(`${GET_EKA_VOICE_HOST_V1()}/template`, options);
13
- let res = await response.json();
14
- res = {
15
- ...res,
16
- code: response.status,
17
- };
18
- return res;
19
- }
20
- catch (error) {
21
- console.log('%c getV1Templates -> error', 'color:#f5ce50', error);
22
- return {
23
- code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
24
- items: [],
25
- };
26
- }
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const constant_1 = require("../../constants/constant");
13
+ const fetch_client_1 = require("../../fetch-client");
14
+ const helper_1 = require("../../fetch-client/helper");
15
+ function getV1Templates() {
16
+ return __awaiter(this, void 0, void 0, function* () {
17
+ try {
18
+ const headers = new Headers();
19
+ headers.append('Content-Type', 'application/json');
20
+ const options = {
21
+ method: 'GET',
22
+ headers,
23
+ };
24
+ const response = yield (0, fetch_client_1.default)(`${(0, helper_1.GET_EKA_VOICE_HOST_V1)()}/template`, options);
25
+ let res = yield response.json();
26
+ res = Object.assign(Object.assign({}, res), { code: response.status });
27
+ return res;
28
+ }
29
+ catch (error) {
30
+ console.log('%c getV1Templates -> error', 'color:#f5ce50', error);
31
+ return {
32
+ code: constant_1.SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
33
+ items: [],
34
+ };
35
+ }
36
+ });
27
37
  }
28
- export default getV1Templates;
38
+ exports.default = getV1Templates;
@@ -1,34 +1,45 @@
1
- import { SDK_STATUS_CODE } from '../../constants/constant';
2
- import fetchWrapper from '../../fetch-client';
3
- import { GET_EKA_VOICE_HOST_V1 } from '../../fetch-client/helper';
4
- export async function patchV1Template({ template_id, title, desc, section_ids, }) {
5
- try {
6
- const headers = new Headers();
7
- headers.append('Content-Type', 'application/json');
8
- const raw = {
9
- title,
10
- desc,
11
- section_ids,
12
- };
13
- const options = {
14
- method: 'PATCH',
15
- headers,
16
- body: JSON.stringify(raw),
17
- };
18
- const response = await fetchWrapper(`${GET_EKA_VOICE_HOST_V1()}/template/${template_id}`, options);
19
- let res = await response.json();
20
- res = {
21
- ...res,
22
- code: response.status,
23
- };
24
- return res;
25
- }
26
- catch (error) {
27
- console.log('%c patchV1Template -> error', 'color:#f5ce50', error);
28
- return {
29
- code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
30
- msg: `Something went wrong! ${error}`,
31
- };
32
- }
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.patchV1Template = patchV1Template;
13
+ const constant_1 = require("../../constants/constant");
14
+ const fetch_client_1 = require("../../fetch-client");
15
+ const helper_1 = require("../../fetch-client/helper");
16
+ function patchV1Template(_a) {
17
+ return __awaiter(this, arguments, void 0, function* ({ template_id, title, desc, section_ids, }) {
18
+ try {
19
+ const headers = new Headers();
20
+ headers.append('Content-Type', 'application/json');
21
+ const raw = {
22
+ title,
23
+ desc,
24
+ section_ids,
25
+ };
26
+ const options = {
27
+ method: 'PATCH',
28
+ headers,
29
+ body: JSON.stringify(raw),
30
+ };
31
+ const response = yield (0, fetch_client_1.default)(`${(0, helper_1.GET_EKA_VOICE_HOST_V1)()}/template/${template_id}`, options);
32
+ let res = yield response.json();
33
+ res = Object.assign(Object.assign({}, res), { code: response.status });
34
+ return res;
35
+ }
36
+ catch (error) {
37
+ console.log('%c patchV1Template -> error', 'color:#f5ce50', error);
38
+ return {
39
+ code: constant_1.SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
40
+ msg: `Something went wrong! ${error}`,
41
+ };
42
+ }
43
+ });
33
44
  }
34
- export default patchV1Template;
45
+ exports.default = patchV1Template;
@@ -1,32 +1,42 @@
1
- import { SDK_STATUS_CODE } from '../../constants/constant';
2
- import fetchWrapper from '../../fetch-client';
3
- import { GET_EKA_VOICE_HOST_V1 } from '../../fetch-client/helper';
4
- async function postConvertTranscriptionToTemplate({ txn_id, template_id, transcript, }) {
5
- try {
6
- const headers = new Headers();
7
- headers.append('Content-Type', 'application/json');
8
- const options = {
9
- method: 'POST',
10
- headers,
11
- body: JSON.stringify({
12
- transcript,
13
- template_id,
14
- }),
15
- };
16
- const response = await fetchWrapper(`${GET_EKA_VOICE_HOST_V1()}/transaction/${txn_id}/convert-to-template`, options, 60000);
17
- let res = await response.json();
18
- res = {
19
- ...res,
20
- code: response.status,
21
- };
22
- return res;
23
- }
24
- catch (error) {
25
- console.log('%c postV1ConvertToTemplate -> error', 'color:#f5ce50', error);
26
- return {
27
- code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
28
- message: `Something went wrong! ${error}`,
29
- };
30
- }
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const constant_1 = require("../../constants/constant");
13
+ const fetch_client_1 = require("../../fetch-client");
14
+ const helper_1 = require("../../fetch-client/helper");
15
+ function postConvertTranscriptionToTemplate(_a) {
16
+ return __awaiter(this, arguments, void 0, function* ({ txn_id, template_id, transcript, }) {
17
+ try {
18
+ const headers = new Headers();
19
+ headers.append('Content-Type', 'application/json');
20
+ const options = {
21
+ method: 'POST',
22
+ headers,
23
+ body: JSON.stringify({
24
+ transcript,
25
+ template_id,
26
+ }),
27
+ };
28
+ const response = yield (0, fetch_client_1.default)(`${(0, helper_1.GET_EKA_VOICE_HOST_V1)()}/transaction/${txn_id}/convert-to-template`, options, 60000);
29
+ let res = yield response.json();
30
+ res = Object.assign(Object.assign({}, res), { code: response.status });
31
+ return res;
32
+ }
33
+ catch (error) {
34
+ console.log('%c postV1ConvertToTemplate -> error', 'color:#f5ce50', error);
35
+ return {
36
+ code: constant_1.SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
37
+ message: `Something went wrong! ${error}`,
38
+ };
39
+ }
40
+ });
31
41
  }
32
- export default postConvertTranscriptionToTemplate;
42
+ exports.default = postConvertTranscriptionToTemplate;
@@ -1,29 +1,39 @@
1
- import { SDK_STATUS_CODE } from '../../constants/constant';
2
- import fetchWrapper from '../../fetch-client';
3
- import { GET_EKA_VOICE_HOST_V1 } from '../../fetch-client/helper';
4
- async function postV1ConvertToTemplate({ txn_id, template_id, }) {
5
- try {
6
- const headers = new Headers();
7
- headers.append('Content-Type', 'application/json');
8
- const options = {
9
- method: 'POST',
10
- headers,
11
- body: JSON.stringify({}),
12
- };
13
- const response = await fetchWrapper(`${GET_EKA_VOICE_HOST_V1()}/transaction/${txn_id}/convert-to-template/${template_id}`, options, 60000);
14
- let res = await response.json();
15
- res = {
16
- ...res,
17
- code: response.status,
18
- };
19
- return res;
20
- }
21
- catch (error) {
22
- console.log('%c postV1ConvertToTemplate -> error', 'color:#f5ce50', error);
23
- return {
24
- code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
25
- message: `Something went wrong! ${error}`,
26
- };
27
- }
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const constant_1 = require("../../constants/constant");
13
+ const fetch_client_1 = require("../../fetch-client");
14
+ const helper_1 = require("../../fetch-client/helper");
15
+ function postV1ConvertToTemplate(_a) {
16
+ return __awaiter(this, arguments, void 0, function* ({ txn_id, template_id, }) {
17
+ try {
18
+ const headers = new Headers();
19
+ headers.append('Content-Type', 'application/json');
20
+ const options = {
21
+ method: 'POST',
22
+ headers,
23
+ body: JSON.stringify({}),
24
+ };
25
+ const response = yield (0, fetch_client_1.default)(`${(0, helper_1.GET_EKA_VOICE_HOST_V1)()}/transaction/${txn_id}/convert-to-template/${template_id}`, options, 60000);
26
+ let res = yield response.json();
27
+ res = Object.assign(Object.assign({}, res), { code: response.status });
28
+ return res;
29
+ }
30
+ catch (error) {
31
+ console.log('%c postV1ConvertToTemplate -> error', 'color:#f5ce50', error);
32
+ return {
33
+ code: constant_1.SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
34
+ message: `Something went wrong! ${error}`,
35
+ };
36
+ }
37
+ });
28
38
  }
29
- export default postV1ConvertToTemplate;
39
+ exports.default = postV1ConvertToTemplate;
@@ -1,34 +1,44 @@
1
- import { SDK_STATUS_CODE } from '../../constants/constant';
2
- import fetchWrapper from '../../fetch-client';
3
- import { GET_EKA_VOICE_HOST_V1 } from '../../fetch-client/helper';
4
- async function postV1Template({ title, desc, section_ids, }) {
5
- try {
6
- const headers = new Headers();
7
- headers.append('Content-Type', 'application/json');
8
- const raw = {
9
- title,
10
- desc,
11
- section_ids,
12
- };
13
- const options = {
14
- method: 'POST',
15
- headers,
16
- body: JSON.stringify(raw),
17
- };
18
- const response = await fetchWrapper(`${GET_EKA_VOICE_HOST_V1()}/template`, options);
19
- let res = await response.json();
20
- res = {
21
- ...res,
22
- code: response.status,
23
- };
24
- return res;
25
- }
26
- catch (error) {
27
- console.log('%c postV1Template -> error', 'color:#f5ce50', error);
28
- return {
29
- code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
30
- message: `Something went wrong! ${error}`,
31
- };
32
- }
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const constant_1 = require("../../constants/constant");
13
+ const fetch_client_1 = require("../../fetch-client");
14
+ const helper_1 = require("../../fetch-client/helper");
15
+ function postV1Template(_a) {
16
+ return __awaiter(this, arguments, void 0, function* ({ title, desc, section_ids, }) {
17
+ try {
18
+ const headers = new Headers();
19
+ headers.append('Content-Type', 'application/json');
20
+ const raw = {
21
+ title,
22
+ desc,
23
+ section_ids,
24
+ };
25
+ const options = {
26
+ method: 'POST',
27
+ headers,
28
+ body: JSON.stringify(raw),
29
+ };
30
+ const response = yield (0, fetch_client_1.default)(`${(0, helper_1.GET_EKA_VOICE_HOST_V1)()}/template`, options);
31
+ let res = yield response.json();
32
+ res = Object.assign(Object.assign({}, res), { code: response.status });
33
+ return res;
34
+ }
35
+ catch (error) {
36
+ console.log('%c postV1Template -> error', 'color:#f5ce50', error);
37
+ return {
38
+ code: constant_1.SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
39
+ message: `Something went wrong! ${error}`,
40
+ };
41
+ }
42
+ });
33
43
  }
34
- export default postV1Template;
44
+ exports.default = postV1Template;
@@ -1,8 +1,19 @@
1
- import { SDK_STATUS_CODE } from '../../constants/constant';
2
- import fetchWrapper from '../../fetch-client';
3
- import { GET_EKA_VOICE_HOST_V2 } from '../../fetch-client/helper';
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const constant_1 = require("../../constants/constant");
13
+ const fetch_client_1 = require("../../fetch-client");
14
+ const helper_1 = require("../../fetch-client/helper");
4
15
  // TODO: pagination changes
5
- const getTransactionHistory = async ({ txn_count, }) => {
16
+ const getTransactionHistory = (_a) => __awaiter(void 0, [_a], void 0, function* ({ txn_count, }) {
6
17
  try {
7
18
  const headers = new Headers();
8
19
  headers.append('Content-Type', 'application/json');
@@ -10,8 +21,8 @@ const getTransactionHistory = async ({ txn_count, }) => {
10
21
  method: 'GET',
11
22
  headers,
12
23
  };
13
- const responseJson = await fetchWrapper(`${GET_EKA_VOICE_HOST_V2()}/transaction/history?count=${txn_count}`, options);
14
- const response = await responseJson.json();
24
+ const responseJson = yield (0, fetch_client_1.default)(`${(0, helper_1.GET_EKA_VOICE_HOST_V2)()}/transaction/history?count=${txn_count}`, options);
25
+ const response = yield responseJson.json();
15
26
  return {
16
27
  data: response.data,
17
28
  status_code: responseJson.status,
@@ -20,9 +31,9 @@ const getTransactionHistory = async ({ txn_count, }) => {
20
31
  }
21
32
  catch (error) {
22
33
  return {
23
- status_code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
34
+ status_code: constant_1.SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
24
35
  message: `Something went wrong in fetching transactions. ${error}`,
25
36
  };
26
37
  }
27
- };
28
- export default getTransactionHistory;
38
+ });
39
+ exports.default = getTransactionHistory;
@@ -1,7 +1,19 @@
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 getVoiceApiV3StatusTranscript = async ({ txnId, }) => {
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.getVoiceApiV3StatusTranscript = void 0;
13
+ const constant_1 = require("../../constants/constant");
14
+ const fetch_client_1 = require("../../fetch-client");
15
+ const helper_1 = require("../../fetch-client/helper");
16
+ const getVoiceApiV3StatusTranscript = (_a) => __awaiter(void 0, [_a], void 0, function* ({ txnId, }) {
5
17
  try {
6
18
  const headers = new Headers();
7
19
  headers.append('Content-Type', 'application/json');
@@ -10,8 +22,8 @@ export const getVoiceApiV3StatusTranscript = async ({ txnId, }) => {
10
22
  headers,
11
23
  };
12
24
  // Use custom timeout for this API (16 seconds instead of default 5 seconds)
13
- const getResponse = await fetchWrapper(`${GET_EKA_VOICE_HOST_V3()}/status/transcript/${txnId}`, options, 16000);
14
- const response = await getResponse.json();
25
+ const getResponse = yield (0, fetch_client_1.default)(`${(0, helper_1.GET_EKA_VOICE_HOST_V3)()}/status/transcript/${txnId}`, options, 16000);
26
+ const response = yield getResponse.json();
15
27
  return {
16
28
  response,
17
29
  status_code: getResponse.status,
@@ -19,8 +31,9 @@ export const getVoiceApiV3StatusTranscript = async ({ txnId, }) => {
19
31
  }
20
32
  catch (error) {
21
33
  return {
22
- status_code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
34
+ status_code: constant_1.SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
23
35
  message: `Something went wrong! ${error}`,
24
36
  };
25
37
  }
26
- };
38
+ });
39
+ exports.getVoiceApiV3StatusTranscript = getVoiceApiV3StatusTranscript;
@@ -1,7 +1,19 @@
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 getVoiceApiV3Status = async ({ txnId, }) => {
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.getVoiceApiV3Status = void 0;
13
+ const constant_1 = require("../../constants/constant");
14
+ const fetch_client_1 = require("../../fetch-client");
15
+ const helper_1 = require("../../fetch-client/helper");
16
+ const getVoiceApiV3Status = (_a) => __awaiter(void 0, [_a], void 0, function* ({ txnId, }) {
5
17
  try {
6
18
  const headers = new Headers();
7
19
  headers.append('Content-Type', 'application/json');
@@ -10,8 +22,8 @@ export const getVoiceApiV3Status = async ({ txnId, }) => {
10
22
  headers,
11
23
  };
12
24
  // Use custom timeout for this API (16 seconds instead of default 5 seconds)
13
- const getResponse = await fetchWrapper(`${GET_EKA_VOICE_HOST_V3()}/status/${txnId}`, options, 16000);
14
- const response = await getResponse.json();
25
+ const getResponse = yield (0, fetch_client_1.default)(`${(0, helper_1.GET_EKA_VOICE_HOST_V3)()}/status/${txnId}`, options, 16000);
26
+ const response = yield getResponse.json();
15
27
  return {
16
28
  response,
17
29
  status_code: getResponse.status,
@@ -19,8 +31,9 @@ export const getVoiceApiV3Status = async ({ txnId, }) => {
19
31
  }
20
32
  catch (error) {
21
33
  return {
22
- status_code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
34
+ status_code: constant_1.SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
23
35
  message: `Something went wrong! ${error}`,
24
36
  };
25
37
  }
26
- };
38
+ });
39
+ exports.getVoiceApiV3Status = getVoiceApiV3Status;