@swan-admin/swan-ai-measurements 1.1.84 → 1.1.85

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 CHANGED
@@ -76,10 +76,10 @@ class TryOn {
76
76
  console.log("Invalid JSON:", event.data);
77
77
  return;
78
78
  }
79
- if ((data === null || data === void 0 ? void 0 : data.status) === "success") {
79
+ if ((data === null || data === void 0 ? void 0 : data.eventType) === "tryon.completed") {
80
80
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(data);
81
81
  }
82
- else {
82
+ else if ((data === null || data === void 0 ? void 0 : data.eventType) == "tryon.failed") {
83
83
  onError === null || onError === void 0 ? void 0 : onError(data);
84
84
  }
85
85
  const timer = __classPrivateFieldGet(this, _TryOn_timerMap, "f").get(tryonId);
package/dist/tryOn.js CHANGED
@@ -144,10 +144,10 @@ class TryOn {
144
144
  console.log("Invalid JSON:", event.data);
145
145
  return;
146
146
  }
147
- if (data?.status === "success") {
147
+ if (data?.eventType === "tryon.completed") {
148
148
  onSuccess?.(data);
149
149
  }
150
- else {
150
+ else if (data?.eventType == "tryon.failed") {
151
151
  onError?.(data);
152
152
  }
153
153
  const timer = this.#timerMap.get(tryonId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swan-admin/swan-ai-measurements",
3
- "version": "1.1.84",
3
+ "version": "1.1.85",
4
4
  "description": "provides ai measurement suggestion",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/tryOn.ts CHANGED
@@ -209,11 +209,11 @@ class TryOn {
209
209
  return;
210
210
  }
211
211
 
212
- if (data?.status === "success") {
212
+ if (data?.eventType === "tryon.completed") {
213
213
  onSuccess?.(data);
214
- } else {
215
- onError?.(data);
216
- }
214
+ } else if (data?.eventType=="tryon.failed") {
215
+ onError?.(data);
216
+ }
217
217
 
218
218
  const timer = this.#timerMap.get(tryonId);
219
219
  if (timer) clearTimeout(timer);