@swan-admin/swan-ai-measurements 1.1.9 → 1.1.11

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/custom.js CHANGED
@@ -14,7 +14,7 @@ class Custom {
14
14
  this.#stagingUrl = stagingUrl;
15
15
  }
16
16
  createCustomer(payload) {
17
- if ((0, utils_js_1.checkParameters)(payload.name, payload.storeUrl, payload.email, payload.location)) {
17
+ if ((0, utils_js_1.checkParameters)(payload.name, payload.storeUrl, payload.email, payload.location) === false) {
18
18
  throw new Error(constants_js_1.REQUIRED_MESSAGE);
19
19
  }
20
20
  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.CREATE_CUSTOMER}`, {
@@ -41,7 +41,7 @@ class Custom {
41
41
  __classPrivateFieldSet(this, _Custom_stagingUrl, stagingUrl, "f");
42
42
  }
43
43
  createCustomer(payload) {
44
- if (checkParameters(payload.name, payload.storeUrl, payload.email, payload.location)) {
44
+ if (checkParameters(payload.name, payload.storeUrl, payload.email, payload.location) === false) {
45
45
  throw new Error(REQUIRED_MESSAGE);
46
46
  }
47
47
  return axios.post(`${getUrl({ urlName: APP_AUTH_BASE_URL, stagingUrl: __classPrivateFieldGet(this, _Custom_stagingUrl, "f") })}${API_ENDPOINTS.CREATE_CUSTOMER}`, Object.assign(Object.assign({}, payload), { headers: { "X-Api-Key": __classPrivateFieldGet(this, _Custom_accessKey, "f") } }));
@@ -144,6 +144,7 @@ class FileUpload {
144
144
  if (!checkMetaDataValue(arrayMetaData)) {
145
145
  throw new Error(REQUIRED_MESSAGE_FOR_META_DATA);
146
146
  }
147
+ arrayMetaData = addScanType(arrayMetaData, scanId);
147
148
  return new Promise((resolve, reject) =>
148
149
  __awaiter(this, void 0, void 0, function* () {
149
150
  var _b;
package/dist/esm/utils.js CHANGED
@@ -14,6 +14,7 @@ export function fetchData(options) {
14
14
  const { path, body, queryParams, baseUrl = APP_AUTH_BASE_URL, apiKey = "", throwError = false, headers = { "X-Api-Key": apiKey, "Content-Type": "application/json" }, stagingUrl = false, } = options;
15
15
  const apiUrl = `${getUrl({ urlName: baseUrl, stagingUrl: stagingUrl })}${path}${queryParams ? `?${new URLSearchParams(queryParams)}` : ""}`;
16
16
  try {
17
+ console.log(body);
17
18
  const res = yield axios.post(apiUrl, body, { headers });
18
19
  if (res.status >= 200 && res.status < 300) {
19
20
  return res.data;
@@ -95,6 +95,7 @@ class FileUpload {
95
95
  if (!(0, utils_js_1.checkMetaDataValue)(arrayMetaData)) {
96
96
  throw new Error(constants_js_1.REQUIRED_MESSAGE_FOR_META_DATA);
97
97
  }
98
+ arrayMetaData = (0, utils_js_1.addScanType)(arrayMetaData, scanId);
98
99
  return new Promise(async (resolve, reject) => {
99
100
  try {
100
101
  const res = await (0, utils_js_1.fetchData)({
package/dist/utils.js CHANGED
@@ -10,6 +10,7 @@ async function fetchData(options) {
10
10
  const { path, body, queryParams, baseUrl = constants_js_1.APP_AUTH_BASE_URL, apiKey = "", throwError = false, headers = { "X-Api-Key": apiKey, "Content-Type": "application/json" }, stagingUrl = false, } = options;
11
11
  const apiUrl = `${(0, exports.getUrl)({ urlName: baseUrl, stagingUrl: stagingUrl })}${path}${queryParams ? `?${new URLSearchParams(queryParams)}` : ""}`;
12
12
  try {
13
+ console.log(body);
13
14
  const res = await axios_1.default.post(apiUrl, body, { headers });
14
15
  if (res.status >= 200 && res.status < 300) {
15
16
  return res.data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swan-admin/swan-ai-measurements",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
4
4
  "description": "provides ai measurement suggestion",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/custom.ts CHANGED
@@ -19,7 +19,7 @@ class Custom {
19
19
  }
20
20
 
21
21
  createCustomer(payload: CreateCustomer): Promise<AxiosResponse<any>> {
22
- if (checkParameters(payload.name, payload.storeUrl, payload.email, payload.location)) {
22
+ if (checkParameters(payload.name, payload.storeUrl, payload.email, payload.location) === false) {
23
23
  throw new Error(REQUIRED_MESSAGE);
24
24
  }
25
25
  return axios.post(`${getUrl({ urlName: APP_AUTH_BASE_URL, stagingUrl: this.#stagingUrl })}${API_ENDPOINTS.CREATE_CUSTOMER}`, {
package/src/fileUpload.ts CHANGED
@@ -116,7 +116,7 @@ export default class FileUpload {
116
116
  if (!checkMetaDataValue(arrayMetaData)) {
117
117
  throw new Error(REQUIRED_MESSAGE_FOR_META_DATA);
118
118
  }
119
-
119
+ arrayMetaData = addScanType(arrayMetaData, scanId);
120
120
  return new Promise(async (resolve, reject) => {
121
121
  try {
122
122
  const res: { key: string; uploadId: string } = await fetchData({
package/src/utils.ts CHANGED
@@ -26,6 +26,7 @@ export async function fetchData(options: FetchDataOptions): Promise<any> {
26
26
 
27
27
  const apiUrl = `${getUrl({ urlName: baseUrl, stagingUrl: stagingUrl })}${path}${queryParams ? `?${new URLSearchParams(queryParams)}` : ""}`;
28
28
  try {
29
+ console.log(body);
29
30
  const res: AxiosResponse<any> = await axios.post(apiUrl, body, { headers });
30
31
  if (res.status >= 200 && res.status < 300) {
31
32
  return res.data;