@eka-care/ekascribe-ts-sdk 1.4.47 → 1.4.49
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.
|
@@ -14,6 +14,7 @@ async function uploadSingleFile(uploadData, folderPath, file, fileName) {
|
|
|
14
14
|
method: 'POST',
|
|
15
15
|
body: formData,
|
|
16
16
|
});
|
|
17
|
+
console.log('upload single audio file response ', response);
|
|
17
18
|
if (response.status === 204) {
|
|
18
19
|
// S3 returns 204 No Content on successful upload
|
|
19
20
|
return {
|
|
@@ -22,7 +22,6 @@ export default async function fetchWrapper(url, options = {}, timeoutMs = API_TI
|
|
|
22
22
|
signal: controller.signal,
|
|
23
23
|
credentials: 'include',
|
|
24
24
|
});
|
|
25
|
-
console.log(response, response.status, 'response in fetch wrapper - SDK');
|
|
26
25
|
if (response.status === 401 || response.status === 403) {
|
|
27
26
|
console.log('unauthorized - fetch wrapper - SDK', response.status);
|
|
28
27
|
}
|
|
@@ -5,4 +5,4 @@ export type TFullAudioUploadResponse = {
|
|
|
5
5
|
status_code: number;
|
|
6
6
|
message: string;
|
|
7
7
|
};
|
|
8
|
-
export declare function postV1UploadAudioFiles({ audioFiles, txn_id, action, transfer, mode,
|
|
8
|
+
export declare function postV1UploadAudioFiles({ audioFiles, txn_id, action, transfer, mode, input_language, output_format_template, model_training_consent, auto_download, system_info, patient_details, model_type, version, flavour, }: TPostV1UploadAudioFilesRequest): Promise<TFullAudioUploadResponse>;
|
|
@@ -3,10 +3,11 @@ import postTransactionInit from '../api/transaction/post-transaction-init';
|
|
|
3
3
|
import uploadFilesWithPresignedUrl from '../api/upload-audio-with-presigned-url';
|
|
4
4
|
import { SDK_STATUS_CODE } from '../constants/constant';
|
|
5
5
|
import { ERROR_CODE } from '../constants/enums';
|
|
6
|
-
export async function postV1UploadAudioFiles({ audioFiles, txn_id, action, transfer, mode,
|
|
6
|
+
export async function postV1UploadAudioFiles({ audioFiles, txn_id, action, transfer, mode, input_language, output_format_template, model_training_consent, auto_download, system_info, patient_details, model_type, version, flavour, }) {
|
|
7
7
|
try {
|
|
8
8
|
// Step 1: Get presigned URL
|
|
9
9
|
const presignedUrlResponse = await postV1FileUpload({ txn_id, action });
|
|
10
|
+
console.log('upload full audio -> presignedUrlResponse ', presignedUrlResponse);
|
|
10
11
|
if (presignedUrlResponse.code !== 200) {
|
|
11
12
|
return {
|
|
12
13
|
error_code: ERROR_CODE.GET_PRESIGNED_URL_FAILED,
|
|
@@ -19,6 +20,7 @@ export async function postV1UploadAudioFiles({ audioFiles, txn_id, action, trans
|
|
|
19
20
|
audioFiles,
|
|
20
21
|
presignedUrlResponse,
|
|
21
22
|
});
|
|
23
|
+
console.log('upload full audio -> uploadResponse ', uploadResponse);
|
|
22
24
|
if (uploadResponse.code !== 200) {
|
|
23
25
|
return {
|
|
24
26
|
error_code: ERROR_CODE.AUDIO_UPLOAD_FAILED,
|
|
@@ -30,7 +32,6 @@ export async function postV1UploadAudioFiles({ audioFiles, txn_id, action, trans
|
|
|
30
32
|
const initTransactionResponse = await postTransactionInit({
|
|
31
33
|
mode,
|
|
32
34
|
txn_id,
|
|
33
|
-
s3Url,
|
|
34
35
|
input_language,
|
|
35
36
|
output_format_template,
|
|
36
37
|
model_training_consent,
|
|
@@ -43,6 +44,7 @@ export async function postV1UploadAudioFiles({ audioFiles, txn_id, action, trans
|
|
|
43
44
|
flavour,
|
|
44
45
|
batch_s3_url,
|
|
45
46
|
});
|
|
47
|
+
console.log('upload full audio -> initTransactionResponse ', initTransactionResponse);
|
|
46
48
|
if (initTransactionResponse.code >= 400) {
|
|
47
49
|
return {
|
|
48
50
|
error_code: ERROR_CODE.TXN_INIT_FAILED,
|