@swan-admin/swan-ai-measurements 1.1.35 → 1.1.36

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/Readme.md CHANGED
@@ -1,33 +1,33 @@
1
- ## SWAN Node.js Library
2
-
3
- Swan is an AI Fitting Room that lets shoppers size & try on clothes virtually. For clothing brands and online retailers, Swan powers completely personalised sales – increasing conversion & reducing expensive returns.
4
-
5
- ## Documentation
6
-
7
- See the <a href="https://www.swanvision.ai/docs">SWAN API docs</a> for Node.js.
8
-
9
- ## Requirements
10
-
11
- Node 20 or higher.
12
-
13
- ## Usage
14
-
15
- ##### Installation
16
-
17
- npm i @swan-admin/swan-ai-measurements
18
-
19
- ##### Create Customer
20
-
21
- swan.custom.createCustomer({name, store_url, location, email, emailsTier_1, emailsTier_2})
22
-
23
- ##### Upload file
24
-
25
- swan.fileUpload.uploadFile({ file, arrayMetaData, scanId })
26
-
27
- ##### Get measurements
28
-
29
- swan.measurement.getMeasurementResult(scanId)
30
-
31
- ## Support
32
-
33
- New features and bug fixes are released on the latest major version of the SWAN package. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.
1
+ ## SWAN Node.js Library
2
+
3
+ Swan is an AI Fitting Room that lets shoppers size & try on clothes virtually. For clothing brands and online retailers, Swan powers completely personalised sales – increasing conversion & reducing expensive returns.
4
+
5
+ ## Documentation
6
+
7
+ See the <a href="https://www.swanvision.ai/docs">SWAN API docs</a> for Node.js.
8
+
9
+ ## Requirements
10
+
11
+ Node 20 or higher.
12
+
13
+ ## Usage
14
+
15
+ ##### Installation
16
+
17
+ npm i @swan-admin/swan-ai-measurements
18
+
19
+ ##### Create Customer
20
+
21
+ swan.custom.createCustomer({name, store_url, location, email, emailsTier_1, emailsTier_2})
22
+
23
+ ##### Upload file
24
+
25
+ swan.fileUpload.uploadFile({ file, arrayMetaData, scanId })
26
+
27
+ ##### Get measurements
28
+
29
+ swan.measurement.getMeasurementResult(scanId)
30
+
31
+ ## Support
32
+
33
+ New features and bug fixes are released on the latest major version of the SWAN package. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.
package/dist/constants.js CHANGED
@@ -38,7 +38,6 @@ exports.API_ENDPOINTS = {
38
38
  SCANNING: "/scanning",
39
39
  RECOMMENDATION: "/recommendation",
40
40
  TRY_ON_SHARE: "/tryon/share",
41
- VARIANTS: "/variants",
42
41
  };
43
42
  exports.requiredMetaData = ["gender", "focal_length", "height", "customer_store_url", "callback_url", "clothes_fit"];
44
43
  exports.REQUIRED_MESSAGE = "Please verify required parameters";
@@ -35,7 +35,6 @@ export const API_ENDPOINTS = {
35
35
  SCANNING: "/scanning",
36
36
  RECOMMENDATION: "/recommendation",
37
37
  TRY_ON_SHARE: "/tryon/share",
38
- VARIANTS: "/variants",
39
38
  };
40
39
  export const requiredMetaData = ["gender", "focal_length", "height", "customer_store_url", "callback_url", "clothes_fit"];
41
40
  export const REQUIRED_MESSAGE = "Please verify required parameters";
@@ -8,6 +8,9 @@ interface ObjMetaData {
8
8
  clothes_fit: string;
9
9
  scan_type?: string;
10
10
  callback_url: string;
11
+ alpha?: string;
12
+ beta?: string;
13
+ gamma?: string;
11
14
  }
12
15
  interface UploadOptions {
13
16
  file: File;
@@ -1,219 +1,177 @@
1
- var __awaiter =
2
- (this && this.__awaiter) ||
3
- function (thisArg, _arguments, P, generator) {
4
- function adopt(value) {
5
- return value instanceof P
6
- ? value
7
- : new P(function (resolve) {
8
- resolve(value);
9
- });
10
- }
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
11
3
  return new (P || (P = Promise))(function (resolve, reject) {
12
- function fulfilled(value) {
13
- try {
14
- step(generator.next(value));
15
- } catch (e) {
16
- reject(e);
17
- }
18
- }
19
- function rejected(value) {
20
- try {
21
- step(generator["throw"](value));
22
- } catch (e) {
23
- reject(e);
24
- }
25
- }
26
- function step(result) {
27
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
28
- }
29
- step((generator = generator.apply(thisArg, _arguments || [])).next());
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
30
8
  });
31
- };
32
- var __classPrivateFieldSet =
33
- (this && this.__classPrivateFieldSet) ||
34
- function (receiver, state, value, kind, f) {
9
+ };
10
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
35
11
  if (kind === "m") throw new TypeError("Private method is not writable");
36
12
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
37
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
38
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
39
- return kind === "a" ? f.call(receiver, value) : f ? (f.value = value) : state.set(receiver, value), value;
40
- };
41
- var __classPrivateFieldGet =
42
- (this && this.__classPrivateFieldGet) ||
43
- function (receiver, state, kind, f) {
13
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
14
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
15
+ };
16
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
44
17
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
45
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
46
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
18
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
47
19
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
48
- };
20
+ };
49
21
  var _FileUpload_uppyIns, _FileUpload_accessKey, _FileUpload_stagingUrl;
50
22
  import axios from "axios";
51
- import {
52
- REQUIRED_MESSAGE,
53
- REQUIRED_MESSAGE_FOR_META_DATA,
54
- FILE_UPLOAD_ENDPOINT,
55
- APP_AUTH_BASE_URL,
56
- REQUIRED_ERROR_MESSAGE_INVALID_EMAIL,
57
- } from "./constants.js";
23
+ import { REQUIRED_MESSAGE, REQUIRED_MESSAGE_FOR_META_DATA, FILE_UPLOAD_ENDPOINT, APP_AUTH_BASE_URL, REQUIRED_ERROR_MESSAGE_INVALID_EMAIL, } from "./constants.js";
58
24
  import { addScanType, checkMetaDataValue, checkParameters, fetchData, getFileChunks, getUrl, isValidEmail } from "./utils.js";
59
- import Uppy from "@uppy/core";
60
- import AwsS3Multipart from "@uppy/aws-s3-multipart";
25
+ const Uppy = require("fix-esm").require("@uppy/core");
26
+ const AwsS3Multipart = require("fix-esm").require("@uppy/aws-s3-multipart");
61
27
  class FileUpload {
62
- constructor(accessKey, stagingUrl = false) {
63
- _FileUpload_uppyIns.set(this, void 0);
64
- _FileUpload_accessKey.set(this, void 0);
65
- _FileUpload_stagingUrl.set(this, void 0);
66
- __classPrivateFieldSet(this, _FileUpload_accessKey, accessKey, "f");
67
- __classPrivateFieldSet(this, _FileUpload_stagingUrl, stagingUrl, "f");
68
- }
69
- uploadFileFrontend(_a) {
70
- return __awaiter(this, arguments, void 0, function* ({ file, arrayMetaData, scanId, email }) {
71
- if (!checkParameters(file, arrayMetaData, scanId, email)) {
72
- throw new Error(REQUIRED_MESSAGE);
73
- }
74
- if (!isValidEmail(email.trim())) {
75
- throw new Error(REQUIRED_ERROR_MESSAGE_INVALID_EMAIL);
76
- }
77
- if (!checkMetaDataValue(arrayMetaData)) {
78
- throw new Error(REQUIRED_MESSAGE_FOR_META_DATA);
79
- }
80
- arrayMetaData = addScanType(arrayMetaData, scanId, email);
81
- return new Promise((resolve, reject) => {
82
- if (__classPrivateFieldGet(this, _FileUpload_uppyIns, "f")) {
83
- __classPrivateFieldGet(this, _FileUpload_uppyIns, "f").close();
84
- }
85
- __classPrivateFieldSet(this, _FileUpload_uppyIns, new Uppy({ autoProceed: true }), "f");
86
- __classPrivateFieldGet(this, _FileUpload_uppyIns, "f").use(AwsS3Multipart, {
87
- limit: 10,
88
- retryDelays: [0, 1000, 3000, 5000],
89
- companionUrl: getUrl({ urlName: APP_AUTH_BASE_URL, stagingUrl: __classPrivateFieldGet(this, _FileUpload_stagingUrl, "f") }),
90
- getChunkSize: () => 5 * 1024 * 1024,
91
- createMultipartUpload: (file) => {
92
- const objectKey = `${scanId}.${file.extension}`;
93
- return fetchData({
94
- path: FILE_UPLOAD_ENDPOINT.UPLOAD_START,
95
- apiKey: __classPrivateFieldGet(this, _FileUpload_accessKey, "f"),
96
- stagingUrl: __classPrivateFieldGet(this, _FileUpload_stagingUrl, "f"),
97
- body: {
98
- objectKey,
99
- contentType: file.type,
100
- objectMetadata: arrayMetaData,
101
- },
28
+ constructor(accessKey, stagingUrl = false) {
29
+ _FileUpload_uppyIns.set(this, void 0);
30
+ _FileUpload_accessKey.set(this, void 0);
31
+ _FileUpload_stagingUrl.set(this, void 0);
32
+ __classPrivateFieldSet(this, _FileUpload_accessKey, accessKey, "f");
33
+ __classPrivateFieldSet(this, _FileUpload_stagingUrl, stagingUrl, "f");
34
+ }
35
+ uploadFileFrontend(_a) {
36
+ return __awaiter(this, arguments, void 0, function* ({ file, arrayMetaData, scanId, email }) {
37
+ if (!checkParameters(file, arrayMetaData, scanId, email)) {
38
+ throw new Error(REQUIRED_MESSAGE);
39
+ }
40
+ if (!isValidEmail(email.trim())) {
41
+ throw new Error(REQUIRED_ERROR_MESSAGE_INVALID_EMAIL);
42
+ }
43
+ if (!checkMetaDataValue(arrayMetaData)) {
44
+ throw new Error(REQUIRED_MESSAGE_FOR_META_DATA);
45
+ }
46
+ arrayMetaData = addScanType(arrayMetaData, scanId, email);
47
+ return new Promise((resolve, reject) => {
48
+ if (__classPrivateFieldGet(this, _FileUpload_uppyIns, "f")) {
49
+ __classPrivateFieldGet(this, _FileUpload_uppyIns, "f").close();
50
+ }
51
+ __classPrivateFieldSet(this, _FileUpload_uppyIns, new Uppy.default({ autoProceed: true }), "f");
52
+ __classPrivateFieldGet(this, _FileUpload_uppyIns, "f").use(AwsS3Multipart.default, {
53
+ limit: 10,
54
+ retryDelays: [0, 1000, 3000, 5000],
55
+ companionUrl: getUrl({ urlName: APP_AUTH_BASE_URL, stagingUrl: __classPrivateFieldGet(this, _FileUpload_stagingUrl, "f") }),
56
+ getChunkSize: () => 5 * 1024 * 1024,
57
+ createMultipartUpload: (file) => {
58
+ const objectKey = `${scanId}.${file.extension}`;
59
+ return fetchData({
60
+ path: FILE_UPLOAD_ENDPOINT.UPLOAD_START,
61
+ apiKey: __classPrivateFieldGet(this, _FileUpload_accessKey, "f"),
62
+ stagingUrl: __classPrivateFieldGet(this, _FileUpload_stagingUrl, "f"),
63
+ body: {
64
+ objectKey,
65
+ contentType: file.type,
66
+ objectMetadata: arrayMetaData,
67
+ },
68
+ });
69
+ },
70
+ completeMultipartUpload: (file, { uploadId, key, parts }) => fetchData({
71
+ path: FILE_UPLOAD_ENDPOINT.UPLOAD_COMPLETE,
72
+ apiKey: __classPrivateFieldGet(this, _FileUpload_accessKey, "f"),
73
+ stagingUrl: __classPrivateFieldGet(this, _FileUpload_stagingUrl, "f"),
74
+ body: {
75
+ uploadId,
76
+ objectKey: key,
77
+ parts,
78
+ originalFileName: file.name,
79
+ },
80
+ }),
81
+ signPart: (file, partData) => fetchData({
82
+ path: FILE_UPLOAD_ENDPOINT.UPLOAD_SIGN_PART,
83
+ stagingUrl: __classPrivateFieldGet(this, _FileUpload_stagingUrl, "f"),
84
+ apiKey: __classPrivateFieldGet(this, _FileUpload_accessKey, "f"),
85
+ body: {
86
+ objectKey: partData.key,
87
+ uploadId: partData.uploadId,
88
+ partNumber: partData.partNumber,
89
+ },
90
+ }),
91
+ });
92
+ __classPrivateFieldGet(this, _FileUpload_uppyIns, "f").addFile({
93
+ source: "manual",
94
+ name: file.name,
95
+ type: file.type,
96
+ data: file,
97
+ });
98
+ __classPrivateFieldGet(this, _FileUpload_uppyIns, "f").on("upload-error", (file, error, response) => {
99
+ reject(error);
100
+ });
101
+ __classPrivateFieldGet(this, _FileUpload_uppyIns, "f").on("upload-success", () => {
102
+ resolve({ message: "file uploaded successfully" });
103
+ });
104
+ __classPrivateFieldGet(this, _FileUpload_uppyIns, "f").on("complete", (result) => {
105
+ if (__classPrivateFieldGet(this, _FileUpload_uppyIns, "f")) {
106
+ __classPrivateFieldGet(this, _FileUpload_uppyIns, "f").close();
107
+ }
108
+ });
102
109
  });
103
- },
104
- completeMultipartUpload: (file, { uploadId, key, parts }) =>
105
- fetchData({
106
- path: FILE_UPLOAD_ENDPOINT.UPLOAD_COMPLETE,
107
- apiKey: __classPrivateFieldGet(this, _FileUpload_accessKey, "f"),
108
- stagingUrl: __classPrivateFieldGet(this, _FileUpload_stagingUrl, "f"),
109
- body: {
110
- uploadId,
111
- objectKey: key,
112
- parts,
113
- originalFileName: file.name,
114
- },
115
- }),
116
- signPart: (file, partData) =>
117
- fetchData({
118
- path: FILE_UPLOAD_ENDPOINT.UPLOAD_SIGN_PART,
119
- stagingUrl: __classPrivateFieldGet(this, _FileUpload_stagingUrl, "f"),
120
- apiKey: __classPrivateFieldGet(this, _FileUpload_accessKey, "f"),
121
- body: {
122
- objectKey: partData.key,
123
- uploadId: partData.uploadId,
124
- partNumber: partData.partNumber,
125
- },
126
- }),
127
- });
128
- __classPrivateFieldGet(this, _FileUpload_uppyIns, "f").addFile({
129
- source: "manual",
130
- name: file.name,
131
- type: file.type,
132
- data: file,
133
- });
134
- __classPrivateFieldGet(this, _FileUpload_uppyIns, "f").on("upload-error", (file, error, response) => {
135
- reject(error);
136
- });
137
- __classPrivateFieldGet(this, _FileUpload_uppyIns, "f").on("upload-success", () => {
138
- resolve({ message: "file uploaded successfully" });
139
- });
140
- __classPrivateFieldGet(this, _FileUpload_uppyIns, "f").on("complete", (result) => {
141
- if (__classPrivateFieldGet(this, _FileUpload_uppyIns, "f")) {
142
- __classPrivateFieldGet(this, _FileUpload_uppyIns, "f").close();
143
- }
144
110
  });
145
- });
146
- });
147
- }
148
- uploadFile(_a) {
149
- return __awaiter(this, arguments, void 0, function* ({ file, arrayMetaData, scanId, email }) {
150
- if (!checkParameters(file, arrayMetaData, scanId, email)) {
151
- throw new Error(REQUIRED_MESSAGE);
152
- }
153
- if (!isValidEmail(email.trim())) {
154
- throw new Error(REQUIRED_ERROR_MESSAGE_INVALID_EMAIL);
155
- }
156
- if (!checkMetaDataValue(arrayMetaData)) {
157
- throw new Error(REQUIRED_MESSAGE_FOR_META_DATA);
158
- }
159
- arrayMetaData = addScanType(arrayMetaData, scanId, email);
160
- return new Promise((resolve, reject) =>
161
- __awaiter(this, void 0, void 0, function* () {
162
- var _b;
163
- try {
164
- const res = yield fetchData({
165
- path: FILE_UPLOAD_ENDPOINT.UPLOAD_START,
166
- apiKey: __classPrivateFieldGet(this, _FileUpload_accessKey, "f"),
167
- stagingUrl: __classPrivateFieldGet(this, _FileUpload_stagingUrl, "f"),
168
- body: {
169
- objectKey: file.name,
170
- contentType: file.type,
171
- objectMetadata: arrayMetaData,
172
- },
173
- throwError: true,
174
- });
175
- const totalChunks = getFileChunks(file);
176
- const parts = [];
177
- for (let i = 0; i < totalChunks.length; i++) {
178
- const data = yield fetchData({
179
- path: FILE_UPLOAD_ENDPOINT.UPLOAD_SIGN_PART,
180
- apiKey: __classPrivateFieldGet(this, _FileUpload_accessKey, "f"),
181
- stagingUrl: __classPrivateFieldGet(this, _FileUpload_stagingUrl, "f"),
182
- body: {
183
- objectKey: res === null || res === void 0 ? void 0 : res.key,
184
- uploadId: res === null || res === void 0 ? void 0 : res.uploadId,
185
- partNumber: i + 1,
186
- },
187
- throwError: true,
188
- });
189
- const val = yield axios.put(data === null || data === void 0 ? void 0 : data.url, totalChunks[i], {
190
- headers: { "Content-Type": file.type, "X-Api-Key": __classPrivateFieldGet(this, _FileUpload_accessKey, "f") },
191
- });
192
- parts.push({
193
- PartNumber: i + 1,
194
- ETag: (_b = val === null || val === void 0 ? void 0 : val.headers) === null || _b === void 0 ? void 0 : _b.etag,
195
- });
111
+ }
112
+ uploadFile(_a) {
113
+ return __awaiter(this, arguments, void 0, function* ({ file, arrayMetaData, scanId, email }) {
114
+ if (!checkParameters(file, arrayMetaData, scanId, email)) {
115
+ throw new Error(REQUIRED_MESSAGE);
196
116
  }
197
- const completeValue = yield fetchData({
198
- path: FILE_UPLOAD_ENDPOINT.UPLOAD_COMPLETE,
199
- apiKey: __classPrivateFieldGet(this, _FileUpload_accessKey, "f"),
200
- stagingUrl: __classPrivateFieldGet(this, _FileUpload_stagingUrl, "f"),
201
- body: {
202
- uploadId: res === null || res === void 0 ? void 0 : res.uploadId,
203
- objectKey: res === null || res === void 0 ? void 0 : res.key,
204
- parts,
205
- originalFileName: file.name,
206
- },
207
- throwError: true,
208
- });
209
- resolve({ message: "successfully uploaded", data: completeValue });
210
- } catch (error) {
211
- reject(error);
212
- }
213
- })
214
- );
215
- });
216
- }
117
+ if (!isValidEmail(email.trim())) {
118
+ throw new Error(REQUIRED_ERROR_MESSAGE_INVALID_EMAIL);
119
+ }
120
+ if (!checkMetaDataValue(arrayMetaData)) {
121
+ throw new Error(REQUIRED_MESSAGE_FOR_META_DATA);
122
+ }
123
+ arrayMetaData = addScanType(arrayMetaData, scanId, email);
124
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
125
+ var _b;
126
+ try {
127
+ const res = yield fetchData({
128
+ path: FILE_UPLOAD_ENDPOINT.UPLOAD_START,
129
+ apiKey: __classPrivateFieldGet(this, _FileUpload_accessKey, "f"),
130
+ stagingUrl: __classPrivateFieldGet(this, _FileUpload_stagingUrl, "f"),
131
+ body: {
132
+ objectKey: file.name,
133
+ contentType: file.type,
134
+ objectMetadata: arrayMetaData,
135
+ },
136
+ throwError: true,
137
+ });
138
+ const totalChunks = getFileChunks(file);
139
+ const parts = [];
140
+ for (let i = 0; i < totalChunks.length; i++) {
141
+ const data = yield fetchData({
142
+ path: FILE_UPLOAD_ENDPOINT.UPLOAD_SIGN_PART,
143
+ apiKey: __classPrivateFieldGet(this, _FileUpload_accessKey, "f"),
144
+ stagingUrl: __classPrivateFieldGet(this, _FileUpload_stagingUrl, "f"),
145
+ body: {
146
+ objectKey: res === null || res === void 0 ? void 0 : res.key,
147
+ uploadId: res === null || res === void 0 ? void 0 : res.uploadId,
148
+ partNumber: i + 1,
149
+ },
150
+ throwError: true,
151
+ });
152
+ const val = yield axios.put(data === null || data === void 0 ? void 0 : data.url, totalChunks[i], { headers: { "Content-Type": file.type, "X-Api-Key": __classPrivateFieldGet(this, _FileUpload_accessKey, "f") } });
153
+ parts.push({ PartNumber: i + 1, ETag: (_b = val === null || val === void 0 ? void 0 : val.headers) === null || _b === void 0 ? void 0 : _b.etag });
154
+ }
155
+ const completeValue = yield fetchData({
156
+ path: FILE_UPLOAD_ENDPOINT.UPLOAD_COMPLETE,
157
+ apiKey: __classPrivateFieldGet(this, _FileUpload_accessKey, "f"),
158
+ stagingUrl: __classPrivateFieldGet(this, _FileUpload_stagingUrl, "f"),
159
+ body: {
160
+ uploadId: res === null || res === void 0 ? void 0 : res.uploadId,
161
+ objectKey: res === null || res === void 0 ? void 0 : res.key,
162
+ parts,
163
+ originalFileName: file.name,
164
+ },
165
+ throwError: true,
166
+ });
167
+ resolve({ message: "successfully uploaded", data: completeValue });
168
+ }
169
+ catch (error) {
170
+ reject(error);
171
+ }
172
+ }));
173
+ });
174
+ }
217
175
  }
218
- (_FileUpload_uppyIns = new WeakMap()), (_FileUpload_accessKey = new WeakMap()), (_FileUpload_stagingUrl = new WeakMap());
176
+ _FileUpload_uppyIns = new WeakMap(), _FileUpload_accessKey = new WeakMap(), _FileUpload_stagingUrl = new WeakMap();
219
177
  export default FileUpload;
@@ -28,9 +28,5 @@ declare class Measurement {
28
28
  getTryOnMeasurements({ scanId, shopDomain, productName }: TryOnSocketOptions): Promise<AxiosResponse<any>>;
29
29
  handleTryOnSocket(options: TryOnSocketOptions): void;
30
30
  handleMeasurementSocket(options: MeasurementSocketOptions): void;
31
- getProductVariants({ shopDomain, productName }: {
32
- shopDomain: string;
33
- productName: string;
34
- }): Promise<AxiosResponse<any, any>>;
35
31
  }
36
32
  export default Measurement;
@@ -121,12 +121,6 @@ class Measurement {
121
121
  };
122
122
  }, 5000);
123
123
  }
124
- getProductVariants({ shopDomain, productName }) {
125
- if (!checkParameters(shopDomain, productName)) {
126
- throw new Error(REQUIRED_MESSAGE);
127
- }
128
- return axios.get(`${getUrl({ urlName: APP_AUTH_BASE_URL, stagingUrl: __classPrivateFieldGet(this, _Measurement_stagingUrl, "f") })}/customers/${shopDomain}/products/${productName}${API_ENDPOINTS.VARIANTS}`);
129
- }
130
124
  }
131
125
  _Measurement_tryOnSocketRef = new WeakMap(), _Measurement_measurementSocketRef = new WeakMap(), _Measurement_timerPollingRef = new WeakMap(), _Measurement_timerWaitingRef = new WeakMap(), _Measurement_count = new WeakMap(), _Measurement_accessKey = new WeakMap(), _Measurement_stagingUrl = new WeakMap(), _Measurement_instances = new WeakSet(), _Measurement_getMeasurementsCheck = function _Measurement_getMeasurementsCheck(options) {
132
126
  return __awaiter(this, void 0, void 0, function* () {
package/dist/esm/tryOn.js CHANGED
@@ -187,9 +187,6 @@ class TryOn {
187
187
  });
188
188
  }
189
189
  getShareLink(tryonId) {
190
- if (checkParameters(tryonId.trim()) === false) {
191
- throw new Error(REQUIRED_MESSAGE);
192
- }
193
190
  return axios.post(`${getUrl({ urlName: APP_AUTH_BASE_URL, stagingUrl: __classPrivateFieldGet(this, _TryOn_stagingUrl, "f") })}${API_ENDPOINTS.TRY_ON_SHARE}`, { tryonId }, {
194
191
  headers: { "X-Api-Key": __classPrivateFieldGet(this, _TryOn_accessKey, "f") },
195
192
  });
@@ -8,6 +8,9 @@ interface ObjMetaData {
8
8
  clothes_fit: string;
9
9
  scan_type?: string;
10
10
  callback_url: string;
11
+ alpha?: string;
12
+ beta?: string;
13
+ gamma?: string;
11
14
  }
12
15
  interface UploadOptions {
13
16
  file: File;
@@ -28,9 +28,5 @@ declare class Measurement {
28
28
  getTryOnMeasurements({ scanId, shopDomain, productName }: TryOnSocketOptions): Promise<AxiosResponse<any>>;
29
29
  handleTryOnSocket(options: TryOnSocketOptions): void;
30
30
  handleMeasurementSocket(options: MeasurementSocketOptions): void;
31
- getProductVariants({ shopDomain, productName }: {
32
- shopDomain: string;
33
- productName: string;
34
- }): Promise<AxiosResponse<any, any>>;
35
31
  }
36
32
  export default Measurement;
@@ -157,11 +157,5 @@ class Measurement {
157
157
  };
158
158
  }, 5000);
159
159
  }
160
- getProductVariants({ shopDomain, productName }) {
161
- if (!(0, utils_js_1.checkParameters)(shopDomain, productName)) {
162
- throw new Error(constants_js_1.REQUIRED_MESSAGE);
163
- }
164
- return axios_1.default.get(`${(0, utils_js_1.getUrl)({ urlName: constants_js_1.APP_AUTH_BASE_URL, stagingUrl: this.#stagingUrl })}/customers/${shopDomain}/products/${productName}${constants_js_1.API_ENDPOINTS.VARIANTS}`);
165
- }
166
160
  }
167
161
  exports.default = Measurement;
package/dist/tryOn.js CHANGED
@@ -170,9 +170,6 @@ class TryOn {
170
170
  }
171
171
  };
172
172
  getShareLink(tryonId) {
173
- if ((0, utils_js_1.checkParameters)(tryonId.trim()) === false) {
174
- throw new Error(constants_js_1.REQUIRED_MESSAGE);
175
- }
176
173
  return axios_1.default.post(`${(0, utils_js_1.getUrl)({ urlName: constants_js_1.APP_AUTH_BASE_URL, stagingUrl: this.#stagingUrl })}${constants_js_1.API_ENDPOINTS.TRY_ON_SHARE}`, { tryonId }, {
177
174
  headers: { "X-Api-Key": this.#accessKey },
178
175
  });