@swan-admin/swan-ai-measurements 1.1.83 → 1.1.84
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.d.ts +2 -1
- package/dist/esm/tryOn.js +2 -2
- package/dist/tryOn.d.ts +2 -1
- package/dist/tryOn.js +2 -1
- package/package.json +1 -1
- package/src/tryOn.ts +3 -1
package/dist/esm/tryOn.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ interface HandleForLatestImageParams {
|
|
|
37
37
|
openTryonId?: string;
|
|
38
38
|
selectedProductImageUrl?: string;
|
|
39
39
|
token: string;
|
|
40
|
+
requestedTryonViews?: string[];
|
|
40
41
|
}
|
|
41
42
|
interface GetTryOnResultParams {
|
|
42
43
|
tryonId: string;
|
|
@@ -48,7 +49,7 @@ declare class TryOn {
|
|
|
48
49
|
getUploadedFiles(userEmail: string): Promise<AxiosResponse<any>>;
|
|
49
50
|
deleteImage({ userEmail, fileName }: DeleteImageParams): Promise<AxiosResponse<any>>;
|
|
50
51
|
handleTryOnWebSocket: ({ tryonId, onError, onSuccess, onClose, onOpen }: HandleTryOnWebSocketParams) => void;
|
|
51
|
-
handleTryOnSubmit({ shopDomain, products, selectedUserImages, requestSource, callbackUrl, openTryonId, selectedProductImageUrl, token }: HandleForLatestImageParams): Promise<AxiosResponse<any>>;
|
|
52
|
+
handleTryOnSubmit({ shopDomain, products, selectedUserImages, requestSource, callbackUrl, openTryonId, selectedProductImageUrl, token, requestedTryonViews }: HandleForLatestImageParams): Promise<AxiosResponse<any>>;
|
|
52
53
|
getShareLink(tryonId: string): Promise<AxiosResponse<any, any>>;
|
|
53
54
|
getTryOnResult: ({ tryonId }: GetTryOnResultParams) => Promise<AxiosResponse<any>>;
|
|
54
55
|
getProductImageEligibility({ storeUrl, productHandle, imageURL, productDescription }: EligibiltyImageParams): Promise<AxiosResponse<any, any>>;
|
package/dist/esm/tryOn.js
CHANGED
|
@@ -182,11 +182,11 @@ class TryOn {
|
|
|
182
182
|
data: payload,
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
|
-
handleTryOnSubmit({ shopDomain, products, selectedUserImages, requestSource, callbackUrl, openTryonId, selectedProductImageUrl, token }) {
|
|
185
|
+
handleTryOnSubmit({ shopDomain, products, selectedUserImages, requestSource, callbackUrl, openTryonId, selectedProductImageUrl, token, requestedTryonViews }) {
|
|
186
186
|
if (checkParameters(shopDomain, products, token) === false) {
|
|
187
187
|
throw new Error(REQUIRED_MESSAGE);
|
|
188
188
|
}
|
|
189
|
-
const payload = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ products, customerStoreUrl: shopDomain }, (selectedUserImages !== undefined && selectedUserImages !== null && { selectedUserImages })), (requestSource !== undefined && requestSource !== null && { requestSource })), (callbackUrl !== undefined && callbackUrl !== null && { callbackUrl })), (openTryonId !== undefined && openTryonId !== null && { openTryonId })), (selectedProductImageUrl !== undefined && selectedProductImageUrl !== null && { selectedProductImageUrl }));
|
|
189
|
+
const payload = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ products, customerStoreUrl: shopDomain }, (selectedUserImages !== undefined && selectedUserImages !== null && { selectedUserImages })), (requestSource !== undefined && requestSource !== null && { requestSource })), (callbackUrl !== undefined && callbackUrl !== null && { callbackUrl })), (openTryonId !== undefined && openTryonId !== null && { openTryonId })), (selectedProductImageUrl !== undefined && selectedProductImageUrl !== null && { selectedProductImageUrl })), (requestedTryonViews && (requestedTryonViews === null || requestedTryonViews === void 0 ? void 0 : requestedTryonViews.length) > 0 && { requestedTryonViews }));
|
|
190
190
|
const url = `${getUrl({ urlName: APP_AUTH_BASE_URL, urlType: __classPrivateFieldGet(this, _TryOn_urlType, "f") })}${API_ENDPOINTS.TRY_ON}`;
|
|
191
191
|
const headers = { "X-Api-Key": __classPrivateFieldGet(this, _TryOn_accessKey, "f") };
|
|
192
192
|
if (token) {
|
package/dist/tryOn.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ interface HandleForLatestImageParams {
|
|
|
37
37
|
openTryonId?: string;
|
|
38
38
|
selectedProductImageUrl?: string;
|
|
39
39
|
token: string;
|
|
40
|
+
requestedTryonViews?: string[];
|
|
40
41
|
}
|
|
41
42
|
interface GetTryOnResultParams {
|
|
42
43
|
tryonId: string;
|
|
@@ -48,7 +49,7 @@ declare class TryOn {
|
|
|
48
49
|
getUploadedFiles(userEmail: string): Promise<AxiosResponse<any>>;
|
|
49
50
|
deleteImage({ userEmail, fileName }: DeleteImageParams): Promise<AxiosResponse<any>>;
|
|
50
51
|
handleTryOnWebSocket: ({ tryonId, onError, onSuccess, onClose, onOpen }: HandleTryOnWebSocketParams) => void;
|
|
51
|
-
handleTryOnSubmit({ shopDomain, products, selectedUserImages, requestSource, callbackUrl, openTryonId, selectedProductImageUrl, token }: HandleForLatestImageParams): Promise<AxiosResponse<any>>;
|
|
52
|
+
handleTryOnSubmit({ shopDomain, products, selectedUserImages, requestSource, callbackUrl, openTryonId, selectedProductImageUrl, token, requestedTryonViews }: HandleForLatestImageParams): Promise<AxiosResponse<any>>;
|
|
52
53
|
getShareLink(tryonId: string): Promise<AxiosResponse<any, any>>;
|
|
53
54
|
getTryOnResult: ({ tryonId }: GetTryOnResultParams) => Promise<AxiosResponse<any>>;
|
|
54
55
|
getProductImageEligibility({ storeUrl, productHandle, imageURL, productDescription }: EligibiltyImageParams): Promise<AxiosResponse<any, any>>;
|
package/dist/tryOn.js
CHANGED
|
@@ -166,7 +166,7 @@ class TryOn {
|
|
|
166
166
|
// this.#timerMap.delete(tryonId);
|
|
167
167
|
};
|
|
168
168
|
};
|
|
169
|
-
handleTryOnSubmit({ shopDomain, products, selectedUserImages, requestSource, callbackUrl, openTryonId, selectedProductImageUrl, token }) {
|
|
169
|
+
handleTryOnSubmit({ shopDomain, products, selectedUserImages, requestSource, callbackUrl, openTryonId, selectedProductImageUrl, token, requestedTryonViews }) {
|
|
170
170
|
if ((0, utils_js_1.checkParameters)(shopDomain, products, token) === false) {
|
|
171
171
|
throw new Error(constants_js_1.REQUIRED_MESSAGE);
|
|
172
172
|
}
|
|
@@ -178,6 +178,7 @@ class TryOn {
|
|
|
178
178
|
...(callbackUrl !== undefined && callbackUrl !== null && { callbackUrl }),
|
|
179
179
|
...(openTryonId !== undefined && openTryonId !== null && { openTryonId }),
|
|
180
180
|
...(selectedProductImageUrl !== undefined && selectedProductImageUrl !== null && { selectedProductImageUrl }),
|
|
181
|
+
...(requestedTryonViews && requestedTryonViews?.length > 0 && { requestedTryonViews }),
|
|
181
182
|
};
|
|
182
183
|
const url = `${(0, utils_js_1.getUrl)({ urlName: constants_js_1.APP_AUTH_BASE_URL, urlType: this.#urlType })}${constants_js_1.API_ENDPOINTS.TRY_ON}`;
|
|
183
184
|
const headers = { "X-Api-Key": this.#accessKey };
|
package/package.json
CHANGED
package/src/tryOn.ts
CHANGED
|
@@ -42,6 +42,7 @@ interface HandleForLatestImageParams {
|
|
|
42
42
|
openTryonId?: string;
|
|
43
43
|
selectedProductImageUrl?: string;
|
|
44
44
|
token: string;
|
|
45
|
+
requestedTryonViews?: string[];
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
interface HandleTimeOutParams {
|
|
@@ -233,7 +234,7 @@ class TryOn {
|
|
|
233
234
|
};
|
|
234
235
|
|
|
235
236
|
|
|
236
|
-
handleTryOnSubmit({ shopDomain, products, selectedUserImages, requestSource, callbackUrl, openTryonId, selectedProductImageUrl, token }: HandleForLatestImageParams): Promise<AxiosResponse<any>> {
|
|
237
|
+
handleTryOnSubmit({ shopDomain, products, selectedUserImages, requestSource, callbackUrl, openTryonId, selectedProductImageUrl, token ,requestedTryonViews}: HandleForLatestImageParams): Promise<AxiosResponse<any>> {
|
|
237
238
|
if (checkParameters(shopDomain, products, token) === false) {
|
|
238
239
|
throw new Error(REQUIRED_MESSAGE);
|
|
239
240
|
}
|
|
@@ -246,6 +247,7 @@ class TryOn {
|
|
|
246
247
|
...(callbackUrl !== undefined && callbackUrl !== null && { callbackUrl }),
|
|
247
248
|
...(openTryonId !== undefined && openTryonId !== null && { openTryonId }),
|
|
248
249
|
...(selectedProductImageUrl !== undefined && selectedProductImageUrl !== null && { selectedProductImageUrl }),
|
|
250
|
+
...(requestedTryonViews && requestedTryonViews?.length > 0 && { requestedTryonViews }),
|
|
249
251
|
};
|
|
250
252
|
const url = `${getUrl({ urlName: APP_AUTH_BASE_URL, urlType: this.#urlType })}${API_ENDPOINTS.TRY_ON}`;
|
|
251
253
|
const headers: Record<string, string> = { "X-Api-Key": this.#accessKey };
|