@swan-admin/swan-ai-measurements 1.1.78 → 1.1.81

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/constants.js CHANGED
@@ -51,8 +51,8 @@ exports.API_ENDPOINTS = {
51
51
  DEVICE_INFO: "/deviceinfo",
52
52
  TRY_ON_PRODUCT_IMAGE_ELIGIBILTY: "/tryon/product-image-eligibility"
53
53
  };
54
- exports.requiredMetaData = ["gender", "focal_length", "height", "customer_store_url", "callback_url", "clothes_fit"];
55
- exports.requiredFaceScanMetaData = ["gender", "focal_length", "customer_store_url", "scan_type", "callback_url", "face_scan_id"];
54
+ exports.requiredMetaData = ["gender", "focal_length", "height", "customer_store_url", "clothes_fit"];
55
+ exports.requiredFaceScanMetaData = ["gender", "focal_length", "customer_store_url", "scan_type", "face_scan_id"];
56
56
  exports.REQUIRED_MESSAGE = "Please verify required parameters";
57
57
  exports.REQUIRED_MESSAGE_FOR_META_DATA = "Please verify required parameters in meta data";
58
58
  exports.REQUIRED_ERROR_MESSAGE_INVALID_EMAIL = "Invalid Email";
@@ -48,8 +48,8 @@ export const API_ENDPOINTS = {
48
48
  DEVICE_INFO: "/deviceinfo",
49
49
  TRY_ON_PRODUCT_IMAGE_ELIGIBILTY: "/tryon/product-image-eligibility"
50
50
  };
51
- export const requiredMetaData = ["gender", "focal_length", "height", "customer_store_url", "callback_url", "clothes_fit"];
52
- export const requiredFaceScanMetaData = ["gender", "focal_length", "customer_store_url", "scan_type", "callback_url", "face_scan_id"];
51
+ export const requiredMetaData = ["gender", "focal_length", "height", "customer_store_url", "clothes_fit"];
52
+ export const requiredFaceScanMetaData = ["gender", "focal_length", "customer_store_url", "scan_type", "face_scan_id"];
53
53
  export const REQUIRED_MESSAGE = "Please verify required parameters";
54
54
  export const REQUIRED_MESSAGE_FOR_META_DATA = "Please verify required parameters in meta data";
55
55
  export const REQUIRED_ERROR_MESSAGE_INVALID_EMAIL = "Invalid Email";
package/dist/esm/utils.js CHANGED
@@ -12,7 +12,7 @@ import { APP_AUTH_BASE_URL, URLS, requiredMetaData } from "./constants.js";
12
12
  import { URLType } from "./enum.js";
13
13
  export function fetchData(options) {
14
14
  return __awaiter(this, void 0, void 0, function* () {
15
- const { path, body, queryParams, baseUrl = APP_AUTH_BASE_URL, apiKey = "", throwError = false, headers = { "X-Api-Key": apiKey, "Content-Type": "application/json" }, urlType = URLType.STAGING, } = options;
15
+ const { path, body, queryParams, baseUrl = APP_AUTH_BASE_URL, apiKey = "", throwError = false, headers = { "X-Api-Key": apiKey, "Content-Type": "application/json" }, urlType = URLType.PROD, } = options;
16
16
  const apiUrl = `${getUrl({ urlName: baseUrl, urlType })}${path}${queryParams ? `?${new URLSearchParams(queryParams)}` : ""}`;
17
17
  try {
18
18
  const res = yield axios.post(apiUrl, body, { headers });
@@ -95,7 +95,7 @@ export function getFileChunks(file, chunkSize = 5 * 1024 * 1024) {
95
95
  }
96
96
  return chunks;
97
97
  }
98
- export const getUrl = ({ urlName, urlType = URLType.STAGING }) => {
98
+ export const getUrl = ({ urlName, urlType = URLType.PROD }) => {
99
99
  return URLS[urlType][urlName];
100
100
  };
101
101
  export const isValidEmail = (email) => {
package/dist/utils.js CHANGED
@@ -8,7 +8,7 @@ const axios_1 = __importDefault(require("axios"));
8
8
  const constants_js_1 = require("./constants.js");
9
9
  const enum_js_1 = require("./enum.js");
10
10
  async function fetchData(options) {
11
- const { path, body, queryParams, baseUrl = constants_js_1.APP_AUTH_BASE_URL, apiKey = "", throwError = false, headers = { "X-Api-Key": apiKey, "Content-Type": "application/json" }, urlType = enum_js_1.URLType.STAGING, } = options;
11
+ const { path, body, queryParams, baseUrl = constants_js_1.APP_AUTH_BASE_URL, apiKey = "", throwError = false, headers = { "X-Api-Key": apiKey, "Content-Type": "application/json" }, urlType = enum_js_1.URLType.PROD, } = options;
12
12
  const apiUrl = `${(0, exports.getUrl)({ urlName: baseUrl, urlType })}${path}${queryParams ? `?${new URLSearchParams(queryParams)}` : ""}`;
13
13
  try {
14
14
  const res = await axios_1.default.post(apiUrl, body, { headers });
@@ -96,7 +96,7 @@ function getFileChunks(file, chunkSize = 5 * 1024 * 1024) {
96
96
  return chunks;
97
97
  }
98
98
  exports.getFileChunks = getFileChunks;
99
- const getUrl = ({ urlName, urlType = enum_js_1.URLType.STAGING }) => {
99
+ const getUrl = ({ urlName, urlType = enum_js_1.URLType.PROD }) => {
100
100
  return constants_js_1.URLS[urlType][urlName];
101
101
  };
102
102
  exports.getUrl = getUrl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swan-admin/swan-ai-measurements",
3
- "version": "1.1.78",
3
+ "version": "1.1.81",
4
4
  "description": "provides ai measurement suggestion",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -21,7 +21,8 @@
21
21
  "socket.io": "^4.7.5",
22
22
  "socket.io-client": "^4.7.5",
23
23
  "tslib": "^2.6.2",
24
- "typescript": "^5.4.5"
24
+ "typescript": "^5.4.5",
25
+ "whoami": "^0.0.3"
25
26
  },
26
27
  "scripts": {
27
28
  "start": "nodemon dist/index.js",
package/src/constants.ts CHANGED
@@ -83,8 +83,8 @@ export interface FaceScanObjMetaData {
83
83
  export type RequiredMetaDataKeys = "gender" | "focal_length" | "height" | "customer_store_url" | "callback_url" | "clothes_fit";
84
84
  export type RequiredFaceScanMetaDataKeys = "gender" | "focal_length" | "customer_store_url" | "scan_type" | "callback_url" | "face_scan_id";
85
85
 
86
- export const requiredMetaData: RequiredMetaDataKeys[] = ["gender", "focal_length", "height", "customer_store_url", "callback_url", "clothes_fit"];
87
- export const requiredFaceScanMetaData: RequiredFaceScanMetaDataKeys[] = ["gender", "focal_length", "customer_store_url","scan_type","callback_url","face_scan_id"];
86
+ export const requiredMetaData: RequiredMetaDataKeys[] = ["gender", "focal_length", "height", "customer_store_url", "clothes_fit"];
87
+ export const requiredFaceScanMetaData: RequiredFaceScanMetaDataKeys[] = ["gender", "focal_length", "customer_store_url","scan_type","face_scan_id"];
88
88
 
89
89
  export const REQUIRED_MESSAGE: string = "Please verify required parameters";
90
90
  export const REQUIRED_MESSAGE_FOR_META_DATA: string = "Please verify required parameters in meta data";
package/src/utils.ts CHANGED
@@ -22,7 +22,7 @@ export async function fetchData(options: FetchDataOptions): Promise<any> {
22
22
  apiKey = "",
23
23
  throwError = false,
24
24
  headers = { "X-Api-Key": apiKey, "Content-Type": "application/json" },
25
- urlType = URLType.STAGING,
25
+ urlType = URLType.PROD,
26
26
  } = options;
27
27
 
28
28
  const apiUrl = `${getUrl({ urlName: baseUrl, urlType })}${path}${queryParams ? `?${new URLSearchParams(queryParams)}` : ""}`;
@@ -113,7 +113,7 @@ export function getFileChunks(file: File, chunkSize = 5 * 1024 * 1024): Blob[] {
113
113
  return chunks;
114
114
  }
115
115
 
116
- export const getUrl = ({ urlName, urlType = URLType.STAGING }: { urlName: string; urlType: URLType }) => {
116
+ export const getUrl = ({ urlName, urlType = URLType.PROD }: { urlName: string; urlType: URLType }) => {
117
117
  return URLS[urlType][urlName]
118
118
 
119
119
  };