@swan-admin/swan-ai-measurements 1.1.48 → 1.1.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.
- package/dist/esm/fileUpload.d.ts +2 -0
- package/dist/esm/fileUpload.js +3 -3
- package/dist/fileUpload.d.ts +2 -0
- package/dist/fileUpload.js +3 -3
- package/package.json +1 -1
- package/src/fileUpload.ts +4 -4
package/dist/esm/fileUpload.d.ts
CHANGED
package/dist/esm/fileUpload.js
CHANGED
|
@@ -67,7 +67,7 @@ class FileUpload {
|
|
|
67
67
|
getChunkSize: () => CHUNK_SIZE,
|
|
68
68
|
createMultipartUpload: (file) => {
|
|
69
69
|
const totalChunks = Math.ceil(file.size / CHUNK_SIZE);
|
|
70
|
-
callBack === null || callBack === void 0 ? void 0 : callBack({ eventName: "uploading_start", message: `File ${file.name} will be divided into ${totalChunks} chunks
|
|
70
|
+
callBack === null || callBack === void 0 ? void 0 : callBack({ eventName: "uploading_start", message: `File ${file.name} will be divided into ${totalChunks} chunks`, scanId, email });
|
|
71
71
|
const objectKey = `${scanId}.${file.extension}`;
|
|
72
72
|
return fetchData({
|
|
73
73
|
path: FILE_UPLOAD_ENDPOINT.UPLOAD_START,
|
|
@@ -81,7 +81,7 @@ class FileUpload {
|
|
|
81
81
|
});
|
|
82
82
|
},
|
|
83
83
|
completeMultipartUpload: (file, { uploadId, key, parts }) => {
|
|
84
|
-
callBack === null || callBack === void 0 ? void 0 : callBack({ eventName: "uploading_complete_start", message: `${parts.length} chunks of file, uploaded
|
|
84
|
+
callBack === null || callBack === void 0 ? void 0 : callBack({ eventName: "uploading_complete_start", message: `${parts.length} chunks of file, uploaded`, scanId, email });
|
|
85
85
|
return fetchData({
|
|
86
86
|
path: FILE_UPLOAD_ENDPOINT.UPLOAD_COMPLETE,
|
|
87
87
|
apiKey: __classPrivateFieldGet(this, _FileUpload_accessKey, "f"),
|
|
@@ -93,7 +93,7 @@ class FileUpload {
|
|
|
93
93
|
originalFileName: file.name,
|
|
94
94
|
},
|
|
95
95
|
}).then((response) => {
|
|
96
|
-
callBack === null || callBack === void 0 ? void 0 : callBack({ eventName: "uploading_complete_end", message: `Multipart upload completed successfully
|
|
96
|
+
callBack === null || callBack === void 0 ? void 0 : callBack({ eventName: "uploading_complete_end", message: `Multipart upload completed successfully`, scanId, email });
|
|
97
97
|
return response;
|
|
98
98
|
});
|
|
99
99
|
},
|
package/dist/fileUpload.d.ts
CHANGED
package/dist/fileUpload.js
CHANGED
|
@@ -39,7 +39,7 @@ class FileUpload {
|
|
|
39
39
|
getChunkSize: () => constants_js_1.CHUNK_SIZE,
|
|
40
40
|
createMultipartUpload: (file) => {
|
|
41
41
|
const totalChunks = Math.ceil(file.size / constants_js_1.CHUNK_SIZE);
|
|
42
|
-
callBack?.({ eventName: "uploading_start", message: `File ${file.name} will be divided into ${totalChunks} chunks
|
|
42
|
+
callBack?.({ eventName: "uploading_start", message: `File ${file.name} will be divided into ${totalChunks} chunks`, scanId, email });
|
|
43
43
|
const objectKey = `${scanId}.${file.extension}`;
|
|
44
44
|
return (0, utils_js_1.fetchData)({
|
|
45
45
|
path: constants_js_1.FILE_UPLOAD_ENDPOINT.UPLOAD_START,
|
|
@@ -53,7 +53,7 @@ class FileUpload {
|
|
|
53
53
|
});
|
|
54
54
|
},
|
|
55
55
|
completeMultipartUpload: (file, { uploadId, key, parts }) => {
|
|
56
|
-
callBack?.({ eventName: "uploading_complete_start", message: `${parts.length} chunks of file, uploaded
|
|
56
|
+
callBack?.({ eventName: "uploading_complete_start", message: `${parts.length} chunks of file, uploaded`, scanId, email });
|
|
57
57
|
return (0, utils_js_1.fetchData)({
|
|
58
58
|
path: constants_js_1.FILE_UPLOAD_ENDPOINT.UPLOAD_COMPLETE,
|
|
59
59
|
apiKey: this.#accessKey,
|
|
@@ -65,7 +65,7 @@ class FileUpload {
|
|
|
65
65
|
originalFileName: file.name,
|
|
66
66
|
},
|
|
67
67
|
}).then((response) => {
|
|
68
|
-
callBack?.({ eventName: "uploading_complete_end", message: `Multipart upload completed successfully
|
|
68
|
+
callBack?.({ eventName: "uploading_complete_end", message: `Multipart upload completed successfully`, scanId, email });
|
|
69
69
|
return response;
|
|
70
70
|
});
|
|
71
71
|
},
|
package/package.json
CHANGED
package/src/fileUpload.ts
CHANGED
|
@@ -27,7 +27,7 @@ interface UploadOptions {
|
|
|
27
27
|
arrayMetaData: Partial<ObjMetaData>[];
|
|
28
28
|
scanId: string;
|
|
29
29
|
email: string;
|
|
30
|
-
callBack?: (a: { eventName: string; message: string }) => void;
|
|
30
|
+
callBack?: (a: { eventName: string; message: string,scanId:string,email?:string }) => void;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export default class FileUpload {
|
|
@@ -63,7 +63,7 @@ export default class FileUpload {
|
|
|
63
63
|
getChunkSize: () => CHUNK_SIZE,
|
|
64
64
|
createMultipartUpload: (file: any) => {
|
|
65
65
|
const totalChunks = Math.ceil(file.size / CHUNK_SIZE);
|
|
66
|
-
callBack?.({eventName:"uploading_start",message:`File ${file.name} will be divided into ${totalChunks} chunks
|
|
66
|
+
callBack?.({eventName:"uploading_start",message:`File ${file.name} will be divided into ${totalChunks} chunks`,scanId,email})
|
|
67
67
|
const objectKey = `${scanId}.${file.extension}`;
|
|
68
68
|
return fetchData({
|
|
69
69
|
path: FILE_UPLOAD_ENDPOINT.UPLOAD_START,
|
|
@@ -77,7 +77,7 @@ export default class FileUpload {
|
|
|
77
77
|
});
|
|
78
78
|
},
|
|
79
79
|
completeMultipartUpload: (file: any, { uploadId, key, parts }: { uploadId: string | number; key: string | number; parts: any }) => {
|
|
80
|
-
callBack?.({eventName:"uploading_complete_start",message:`${parts.length} chunks of file, uploaded
|
|
80
|
+
callBack?.({eventName:"uploading_complete_start",message:`${parts.length} chunks of file, uploaded`,scanId,email})
|
|
81
81
|
return fetchData({
|
|
82
82
|
path: FILE_UPLOAD_ENDPOINT.UPLOAD_COMPLETE,
|
|
83
83
|
apiKey: this.#accessKey,
|
|
@@ -89,7 +89,7 @@ export default class FileUpload {
|
|
|
89
89
|
originalFileName: file.name,
|
|
90
90
|
},
|
|
91
91
|
}).then((response) => {
|
|
92
|
-
callBack?.({eventName:"uploading_complete_end",message:`Multipart upload completed successfully
|
|
92
|
+
callBack?.({eventName:"uploading_complete_end",message:`Multipart upload completed successfully`,scanId,email})
|
|
93
93
|
return response;
|
|
94
94
|
});
|
|
95
95
|
},
|