@swan-admin/swan-ai-measurements 1.1.62 → 1.1.63
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/package.json +1 -1
- package/src/measurement.ts +1 -4
- package/src/tryOn.ts +0 -14
package/package.json
CHANGED
package/src/measurement.ts
CHANGED
|
@@ -2,9 +2,6 @@ import axios, { AxiosResponse } from "axios";
|
|
|
2
2
|
import { API_ENDPOINTS, APP_AUTH_BASE_URL, APP_BASE_WEBSOCKET_URL, REQUIRED_MESSAGE } from "./constants.js";
|
|
3
3
|
import { checkParameters, getUrl } from "./utils.js";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
5
|
interface MeasurementRecommendation {
|
|
9
6
|
shopDomain: string;
|
|
10
7
|
scanId: string;
|
|
@@ -154,7 +151,7 @@ class Measurement {
|
|
|
154
151
|
} else {
|
|
155
152
|
onError?.(data);
|
|
156
153
|
}
|
|
157
|
-
if (this.#timerWaitingRef) {
|
|
154
|
+
if (this.#timerWaitingRef && data?.code === 200 && data?.scanStatus === "success" && data?.resultType === "final" ) {
|
|
158
155
|
clearTimeout(this.#timerWaitingRef);
|
|
159
156
|
}
|
|
160
157
|
};
|
package/src/tryOn.ts
CHANGED
|
@@ -224,9 +224,6 @@ class TryOn {
|
|
|
224
224
|
if (checkParameters(shopDomain, userEmail, products) === false) {
|
|
225
225
|
throw new Error(REQUIRED_MESSAGE);
|
|
226
226
|
}
|
|
227
|
-
// if (!selectedUserImages.length) {
|
|
228
|
-
// throw new Error("No user images found!");
|
|
229
|
-
// }
|
|
230
227
|
if (!isValidEmail(userEmail.trim())) {
|
|
231
228
|
throw new Error(REQUIRED_ERROR_MESSAGE_INVALID_EMAIL);
|
|
232
229
|
}
|
|
@@ -269,17 +266,6 @@ class TryOn {
|
|
|
269
266
|
if (checkParameters(tryonId) === false) {
|
|
270
267
|
throw new Error(REQUIRED_MESSAGE);
|
|
271
268
|
}
|
|
272
|
-
|
|
273
|
-
// if (!isValidEmail(userEmail.trim())) {
|
|
274
|
-
// throw new Error(REQUIRED_ERROR_MESSAGE_INVALID_EMAIL);
|
|
275
|
-
// }
|
|
276
|
-
|
|
277
|
-
// const payload = {
|
|
278
|
-
// products,
|
|
279
|
-
// userEmail,
|
|
280
|
-
// customerStoreUrl: shopDomain,
|
|
281
|
-
// };
|
|
282
|
-
|
|
283
269
|
const url = `${getUrl({ urlName: APP_AUTH_BASE_URL, stagingUrl: this.#stagingUrl })}${API_ENDPOINTS.TRY_ON_RESULT_IMAGE_DOWNLOAD}/${tryonId}`;
|
|
284
270
|
return axios.post(url, null,{
|
|
285
271
|
headers: { "X-Api-Key": this.#accessKey },
|