@swan-admin/swan-ai-measurements 1.1.25 → 1.1.26
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.js +1 -0
- package/dist/esm/tryOn.js +2 -4
- package/dist/tryOn.js +2 -4
- package/package.json +1 -1
- package/src/tryOn.ts +2 -4
package/dist/esm/fileUpload.js
CHANGED
|
@@ -22,6 +22,7 @@ var _FileUpload_uppyIns, _FileUpload_accessKey, _FileUpload_stagingUrl;
|
|
|
22
22
|
import axios from "axios";
|
|
23
23
|
import { REQUIRED_MESSAGE, REQUIRED_MESSAGE_FOR_META_DATA, FILE_UPLOAD_ENDPOINT, APP_AUTH_BASE_URL, REQUIRED_ERROR_MESSAGE_INVALID_EMAIL, } from "./constants.js";
|
|
24
24
|
import { addScanType, checkMetaDataValue, checkParameters, fetchData, getFileChunks, getUrl, isValidEmail } from "./utils.js";
|
|
25
|
+
const Uppy = require("fix-esm").require("@uppy/core");
|
|
25
26
|
import Uppy from "@uppy/core";
|
|
26
27
|
import AwsS3Multipart from "@uppy/aws-s3-multipart";
|
|
27
28
|
class FileUpload {
|
package/dist/esm/tryOn.js
CHANGED
|
@@ -127,11 +127,10 @@ class TryOn {
|
|
|
127
127
|
payload.userImages.push(files[1].name);
|
|
128
128
|
}
|
|
129
129
|
const signedUrlRes = yield __classPrivateFieldGet(this, _TryOn_instances, "m", _TryOn_getSignedUrl).call(this, payload);
|
|
130
|
-
let s3UploadResult;
|
|
131
130
|
for (const file of files) {
|
|
132
|
-
|
|
131
|
+
yield __classPrivateFieldGet(this, _TryOn_instances, "m", _TryOn_s3Upload).call(this, signedUrlRes.data.uploadUrls[file.name].url, file);
|
|
133
132
|
}
|
|
134
|
-
return `uploaded successfully
|
|
133
|
+
return `uploaded successfully!`;
|
|
135
134
|
}
|
|
136
135
|
catch (error) {
|
|
137
136
|
throw error;
|
|
@@ -204,7 +203,6 @@ _TryOn_tryOnSocketRef = new WeakMap(), _TryOn_timerWaitingRef = new WeakMap(), _
|
|
|
204
203
|
if (checkParameters(url, file) === false) {
|
|
205
204
|
throw new Error(REQUIRED_MESSAGE);
|
|
206
205
|
}
|
|
207
|
-
console.log("s3 being called========", url, file);
|
|
208
206
|
return axios.put(url, file, {
|
|
209
207
|
headers: {
|
|
210
208
|
"Content-Type": file.type,
|
package/dist/tryOn.js
CHANGED
|
@@ -35,11 +35,10 @@ class TryOn {
|
|
|
35
35
|
payload.userImages.push(files[1].name);
|
|
36
36
|
}
|
|
37
37
|
const signedUrlRes = await this.#getSignedUrl(payload);
|
|
38
|
-
let s3UploadResult;
|
|
39
38
|
for (const file of files) {
|
|
40
|
-
|
|
39
|
+
await this.#s3Upload(signedUrlRes.data.uploadUrls[file.name].url, file);
|
|
41
40
|
}
|
|
42
|
-
return `uploaded successfully
|
|
41
|
+
return `uploaded successfully!`;
|
|
43
42
|
}
|
|
44
43
|
catch (error) {
|
|
45
44
|
throw error;
|
|
@@ -60,7 +59,6 @@ class TryOn {
|
|
|
60
59
|
if ((0, utils_js_1.checkParameters)(url, file) === false) {
|
|
61
60
|
throw new Error(constants_js_1.REQUIRED_MESSAGE);
|
|
62
61
|
}
|
|
63
|
-
console.log("s3 being called========", url, file);
|
|
64
62
|
return axios_1.default.put(url, file, {
|
|
65
63
|
headers: {
|
|
66
64
|
"Content-Type": file.type,
|
package/package.json
CHANGED
package/src/tryOn.ts
CHANGED
|
@@ -78,11 +78,10 @@ class TryOn {
|
|
|
78
78
|
payload.userImages.push(files[1].name);
|
|
79
79
|
}
|
|
80
80
|
const signedUrlRes = await this.#getSignedUrl(payload);
|
|
81
|
-
let s3UploadResult;
|
|
82
81
|
for (const file of files) {
|
|
83
|
-
|
|
82
|
+
await this.#s3Upload(signedUrlRes.data.uploadUrls[file.name].url, file);
|
|
84
83
|
}
|
|
85
|
-
return `uploaded successfully
|
|
84
|
+
return `uploaded successfully!`;
|
|
86
85
|
} catch (error) {
|
|
87
86
|
throw error;
|
|
88
87
|
}
|
|
@@ -104,7 +103,6 @@ class TryOn {
|
|
|
104
103
|
if (checkParameters(url, file) === false) {
|
|
105
104
|
throw new Error(REQUIRED_MESSAGE);
|
|
106
105
|
}
|
|
107
|
-
console.log("s3 being called========",url,file)
|
|
108
106
|
return axios.put(url, file, {
|
|
109
107
|
headers: {
|
|
110
108
|
"Content-Type": file.type,
|