@swan-admin/swan-ai-measurements 1.1.74 → 1.1.76

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.
@@ -80,7 +80,7 @@ _Measurement_socketRefs = new WeakMap(), _Measurement_waitingTimers = new WeakMa
80
80
  __classPrivateFieldGet(this, _Measurement_waitingTimers, "f")[key] = setTimeout(() => {
81
81
  __classPrivateFieldGet(this, _Measurement_instances, "m", _Measurement_handlePolling).call(this, { scanId, onSuccess, onError }, key);
82
82
  __classPrivateFieldGet(this, _Measurement_instances, "m", _Measurement_disconnectSocket).call(this, key);
83
- }, 2 * 60000);
83
+ }, 1.5 * 60000);
84
84
  }, _Measurement_handlePolling = function _Measurement_handlePolling(options, key) {
85
85
  const { scanId, onSuccess, onError } = options;
86
86
  if (__classPrivateFieldGet(this, _Measurement_pollingTimers, "f")[key]) {
@@ -117,7 +117,7 @@ _Measurement_socketRefs = new WeakMap(), _Measurement_waitingTimers = new WeakMa
117
117
  }
118
118
  });
119
119
  }, _Measurement_handleSocket = function _Measurement_handleSocket({ onOpen, isFallback, scanId, onSuccess, onError, onClose, paramsKey, faceScanId, delay }) {
120
- const key = isFallback ? "measurement" : "faceScan";
120
+ const key = isFallback ? `measurement-${scanId}` : `faceScan-${faceScanId}`;
121
121
  setTimeout(() => {
122
122
  __classPrivateFieldGet(this, _Measurement_instances, "m", _Measurement_disconnectSocket).call(this, key);
123
123
  const url = `${getUrl({ urlName: APP_BASE_WEBSOCKET_URL, stagingUrl: __classPrivateFieldGet(this, _Measurement_stagingUrl, "f") })}${API_ENDPOINTS.SCANNING}?${paramsKey}=${scanId || faceScanId}`;
@@ -48,7 +48,7 @@ class Measurement {
48
48
  this.#waitingTimers[key] = setTimeout(() => {
49
49
  this.#handlePolling({ scanId, onSuccess, onError }, key);
50
50
  this.#disconnectSocket(key);
51
- }, 2 * 60000);
51
+ }, 1.5 * 60000);
52
52
  }
53
53
  #handlePolling(options, key) {
54
54
  const { scanId, onSuccess, onError } = options;
@@ -99,7 +99,7 @@ class Measurement {
99
99
  this.#handleSocket({ onOpen, faceScanId, onSuccess, onError, onClose, paramsKey: "faceScanId", isFallback: false, delay: 1000 });
100
100
  }
101
101
  #handleSocket({ onOpen, isFallback, scanId, onSuccess, onError, onClose, paramsKey, faceScanId, delay }) {
102
- const key = isFallback ? "measurement" : "faceScan";
102
+ const key = isFallback ? `measurement-${scanId}` : `faceScan-${faceScanId}`;
103
103
  setTimeout(() => {
104
104
  this.#disconnectSocket(key);
105
105
  const url = `${(0, utils_js_1.getUrl)({ urlName: constants_js_1.APP_BASE_WEBSOCKET_URL, stagingUrl: this.#stagingUrl })}${constants_js_1.API_ENDPOINTS.SCANNING}?${paramsKey}=${scanId || faceScanId}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swan-admin/swan-ai-measurements",
3
- "version": "1.1.74",
3
+ "version": "1.1.76",
4
4
  "description": "provides ai measurement suggestion",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -91,7 +91,7 @@ class Measurement {
91
91
  this.#waitingTimers[key] = setTimeout(() => {
92
92
  this.#handlePolling({ scanId, onSuccess, onError }, key);
93
93
  this.#disconnectSocket(key);
94
- }, 2 * 60000);
94
+ }, 1.5 * 60000);
95
95
  }
96
96
 
97
97
  #handlePolling(options: HandlePollingOptions, key: string): void {
@@ -144,7 +144,7 @@ class Measurement {
144
144
  }
145
145
 
146
146
  #handleSocket({ onOpen, isFallback, scanId, onSuccess, onError, onClose, paramsKey, faceScanId, delay }: HandleSocket) {
147
- const key = isFallback ? "measurement" : "faceScan";
147
+ const key = isFallback ? `measurement-${scanId}` : `faceScan-${faceScanId}`;
148
148
  setTimeout(() => {
149
149
  this.#disconnectSocket(key);
150
150
  const url = `${getUrl({ urlName: APP_BASE_WEBSOCKET_URL, stagingUrl: this.#stagingUrl })}${API_ENDPOINTS.SCANNING}?${paramsKey}=${scanId || faceScanId}`;