@swan-admin/swan-ai-measurements 1.1.59 → 1.1.60
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/tryOn.js +1 -4
- package/dist/tryOn.js +1 -4
- package/package.json +1 -1
- package/src/tryOn.ts +2 -15
package/dist/esm/tryOn.js
CHANGED
|
@@ -40,15 +40,12 @@ class TryOn {
|
|
|
40
40
|
__classPrivateFieldSet(this, _TryOn_timerWaitingRef, setTimeout(() => {
|
|
41
41
|
__classPrivateFieldGet(this, _TryOn_handleGetTryOnResult, "f").call(this, { onSuccess, onError, tryonId });
|
|
42
42
|
__classPrivateFieldGet(this, _TryOn_disconnectSocket, "f").call(this);
|
|
43
|
-
},
|
|
43
|
+
}, 150000), "f");
|
|
44
44
|
});
|
|
45
45
|
this.handleTryOnWebSocket = ({ tryonId, onError, onSuccess, onClose, onOpen }) => {
|
|
46
46
|
if (checkParameters(tryonId) === false) {
|
|
47
47
|
throw new Error(REQUIRED_MESSAGE);
|
|
48
48
|
}
|
|
49
|
-
// if (!isValidEmail(userEmail.trim())) {
|
|
50
|
-
// throw new Error(REQUIRED_ERROR_MESSAGE_INVALID_EMAIL);
|
|
51
|
-
// }
|
|
52
49
|
__classPrivateFieldGet(this, _TryOn_disconnectSocket, "f").call(this);
|
|
53
50
|
const url = `${getUrl({ urlName: APP_BASE_WEBSOCKET_URL, stagingUrl: __classPrivateFieldGet(this, _TryOn_stagingUrl, "f") })}${API_ENDPOINTS.TRY_ON}?tryonId=${tryonId}`;
|
|
54
51
|
__classPrivateFieldSet(this, _TryOn_tryOnSocketRef, new WebSocket(url), "f");
|
package/dist/tryOn.js
CHANGED
|
@@ -107,15 +107,12 @@ class TryOn {
|
|
|
107
107
|
this.#timerWaitingRef = setTimeout(() => {
|
|
108
108
|
this.#handleGetTryOnResult({ onSuccess, onError, tryonId });
|
|
109
109
|
this.#disconnectSocket();
|
|
110
|
-
},
|
|
110
|
+
}, 150000);
|
|
111
111
|
};
|
|
112
112
|
handleTryOnWebSocket = ({ tryonId, onError, onSuccess, onClose, onOpen }) => {
|
|
113
113
|
if ((0, utils_js_1.checkParameters)(tryonId) === false) {
|
|
114
114
|
throw new Error(constants_js_1.REQUIRED_MESSAGE);
|
|
115
115
|
}
|
|
116
|
-
// if (!isValidEmail(userEmail.trim())) {
|
|
117
|
-
// throw new Error(REQUIRED_ERROR_MESSAGE_INVALID_EMAIL);
|
|
118
|
-
// }
|
|
119
116
|
this.#disconnectSocket();
|
|
120
117
|
const url = `${(0, utils_js_1.getUrl)({ urlName: constants_js_1.APP_BASE_WEBSOCKET_URL, stagingUrl: this.#stagingUrl })}${constants_js_1.API_ENDPOINTS.TRY_ON}?tryonId=${tryonId}`;
|
|
121
118
|
this.#tryOnSocketRef = new WebSocket(url);
|
package/package.json
CHANGED
package/src/tryOn.ts
CHANGED
|
@@ -18,11 +18,7 @@ interface DeleteImageParams {
|
|
|
18
18
|
}
|
|
19
19
|
interface EligibiltyImageParams {storeUrl:string,productHandle:string,imageURL:string,productDescription:string}
|
|
20
20
|
interface HandleTryOnWebSocketParams {
|
|
21
|
-
tryonId:string
|
|
22
|
-
// userEmail: string;
|
|
23
|
-
// shopDomain: string;
|
|
24
|
-
// tryonId: string;
|
|
25
|
-
// products: Products[];
|
|
21
|
+
tryonId:string;
|
|
26
22
|
onError?: (error: any) => void;
|
|
27
23
|
onSuccess?: (data: any) => void;
|
|
28
24
|
onClose?: () => void;
|
|
@@ -51,15 +47,9 @@ interface HandleTimeOutParams {
|
|
|
51
47
|
onSuccess?: (data: any) => void;
|
|
52
48
|
onError?: (error: any) => void;
|
|
53
49
|
tryonId:string
|
|
54
|
-
// shopDomain: string;
|
|
55
|
-
// userEmail: string;
|
|
56
|
-
// products: Products[];
|
|
57
50
|
}
|
|
58
51
|
|
|
59
52
|
interface GetTryOnResultParams {
|
|
60
|
-
// shopDomain: string;
|
|
61
|
-
// userEmail: string;
|
|
62
|
-
// products: Products[];
|
|
63
53
|
tryonId :string
|
|
64
54
|
}
|
|
65
55
|
|
|
@@ -173,16 +163,13 @@ class TryOn {
|
|
|
173
163
|
this.#timerWaitingRef = setTimeout(() => {
|
|
174
164
|
this.#handleGetTryOnResult({ onSuccess, onError,tryonId });
|
|
175
165
|
this.#disconnectSocket();
|
|
176
|
-
},
|
|
166
|
+
}, 150000);
|
|
177
167
|
};
|
|
178
168
|
|
|
179
169
|
handleTryOnWebSocket = ({ tryonId, onError, onSuccess, onClose, onOpen }: HandleTryOnWebSocketParams): void => {
|
|
180
170
|
if (checkParameters(tryonId) === false) {
|
|
181
171
|
throw new Error(REQUIRED_MESSAGE);
|
|
182
172
|
}
|
|
183
|
-
// if (!isValidEmail(userEmail.trim())) {
|
|
184
|
-
// throw new Error(REQUIRED_ERROR_MESSAGE_INVALID_EMAIL);
|
|
185
|
-
// }
|
|
186
173
|
this.#disconnectSocket();
|
|
187
174
|
const url = `${getUrl({ urlName: APP_BASE_WEBSOCKET_URL, stagingUrl: this.#stagingUrl })}${API_ENDPOINTS.TRY_ON}?tryonId=${tryonId}`;
|
|
188
175
|
this.#tryOnSocketRef = new WebSocket(url);
|