@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.
- package/dist/api/config/get-voice-api-v2-config-my-templates.js +22 -12
- package/dist/api/config/get-voice-api-v2-config.js +22 -12
- package/dist/api/config/patch-voice-api-v2-config.js +21 -13
- package/dist/api/post-cog-init.js +28 -15
- package/dist/api/post-v1-file-upload.js +38 -28
- package/dist/api/template-sections/delete-v1-template-section.js +37 -27
- package/dist/api/template-sections/get-v1-template-sections.js +37 -27
- package/dist/api/template-sections/patch-v1-template-section.js +46 -36
- package/dist/api/template-sections/post-v1-template-section.js +45 -35
- package/dist/api/templates/cook-v1-medai-ai-create-template.js +35 -25
- package/dist/api/templates/delete-v1-template.js +37 -27
- package/dist/api/templates/get-v1-templates.js +37 -27
- package/dist/api/templates/patch-v1-template.js +44 -33
- package/dist/api/templates/post-convert-transcription-to-template.js +41 -31
- package/dist/api/templates/post-transaction-convert-to-template.js +38 -28
- package/dist/api/templates/post-v1-template.js +43 -33
- package/dist/api/transaction/get-transaction-history.js +20 -9
- package/dist/api/transaction/get-voice-api-v3-status-transcript.js +21 -8
- package/dist/api/transaction/get-voice-api-v3-status.js +21 -8
- package/dist/api/transaction/patch-transaction-status.js +23 -14
- package/dist/api/transaction/patch-voice-api-v3-status.js +22 -12
- package/dist/api/transaction/post-transaction-commit.js +41 -31
- package/dist/api/transaction/post-transaction-init.js +52 -47
- package/dist/api/transaction/post-transaction-stop.js +41 -31
- package/dist/api/upload-audio-with-presigned-url.js +67 -55
- package/dist/audio-chunker/audio-buffer-manager.js +5 -3
- package/dist/audio-chunker/audio-file-manager.js +353 -350
- package/dist/audio-chunker/vad-web.js +116 -97
- package/dist/aws-services/configure-aws.js +5 -2
- package/dist/aws-services/get-files-s3.js +20 -7
- package/dist/aws-services/s3-retry-wrapper.js +44 -31
- package/dist/aws-services/translate-text-to-target-language.js +28 -15
- package/dist/aws-services/upload-file-to-s3.js +17 -6
- package/dist/constants/constant.js +22 -19
- package/dist/constants/enums.js +15 -12
- package/dist/constants/setup-config.js +10 -7
- package/dist/constants/types.js +2 -1
- package/dist/fetch-client/helper.js +24 -11
- package/dist/fetch-client/index.js +61 -52
- package/dist/index.js +321 -254
- package/dist/main/end-recording.js +56 -53
- package/dist/main/init-transaction.js +36 -27
- package/dist/main/pause-recording.js +17 -18
- package/dist/main/poll-output-summary.js +21 -7
- package/dist/main/resume-recording.js +13 -14
- package/dist/main/retry-upload-recording.js +39 -30
- package/dist/main/start-recording.js +34 -26
- package/dist/main/upload-full-audio-with-presigned-url.js +84 -69
- package/dist/shared-worker/s3-file-upload.js +88 -79
- package/dist/store/store.js +3 -1
- package/dist/utils/compress-mp3-audio.js +6 -4
- package/dist/utils/get-worker-url.js +12 -7
- package/dist/utils/search-past-sessions.js +23 -9
- package/package.json +1 -1
|
@@ -1,28 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
38
|
+
exports.default = deleteV1Template;
|
|
@@ -1,28 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
38
|
+
exports.default = getV1Templates;
|
|
@@ -1,34 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
45
|
+
exports.default = patchV1Template;
|
|
@@ -1,32 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
42
|
+
exports.default = postConvertTranscriptionToTemplate;
|
|
@@ -1,29 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
39
|
+
exports.default = postV1ConvertToTemplate;
|
|
@@ -1,34 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
44
|
+
exports.default = postV1Template;
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 =
|
|
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 =
|
|
14
|
-
const response =
|
|
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
|
-
|
|
38
|
+
});
|
|
39
|
+
exports.default = getTransactionHistory;
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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 =
|
|
14
|
-
const response =
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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 =
|
|
14
|
-
const response =
|
|
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;
|