@swan-admin/swan-ai-measurements 1.1.89 → 1.1.91

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/auth.d.ts CHANGED
@@ -29,6 +29,8 @@ export default class Auth {
29
29
  registerUser({ email, appVerifyUrl, gender, height, username }: RegisterUserParams): Promise<AxiosResponse>;
30
30
  verifyToken(token: string): Promise<AxiosResponse>;
31
31
  addUser({ scanId, email, name, height, gender, offsetMarketingConsent }: AddUserParams): Promise<AxiosResponse>;
32
+ userProfile(): Promise<AxiosResponse>;
33
+ userExists(): Promise<AxiosResponse>;
32
34
  getUserDetail(email: string): Promise<AxiosResponse>;
33
35
  handleAuthSocket({ email, scanId, onError, onSuccess, onClose, onOpen }: AuthSocketParams): void;
34
36
  }
package/dist/auth.js CHANGED
@@ -50,6 +50,16 @@ class Auth {
50
50
  }
51
51
  return axios_1.default.post(`${(0, utils_js_1.getUrl)({ urlName: constants_js_1.APP_AUTH_BASE_URL, urlType: this.#urlType })}${constants_js_1.API_ENDPOINTS.ADD_USER}`, { scan_id: scanId, email, name, offsetMarketingConsent, attributes: JSON.stringify({ height, gender }) }, { headers: this.#getHeaders() });
52
52
  }
53
+ userProfile() {
54
+ return axios_1.default.get(`${(0, utils_js_1.getUrl)({ urlName: constants_js_1.APP_AUTH_BASE_URL, urlType: this.#urlType })}${constants_js_1.API_ENDPOINTS.USER_PROFILE}`, {
55
+ headers: this.#getHeaders(),
56
+ });
57
+ }
58
+ userExists() {
59
+ return axios_1.default.get(`${(0, utils_js_1.getUrl)({ urlName: constants_js_1.APP_AUTH_BASE_URL, urlType: this.#urlType })}${constants_js_1.API_ENDPOINTS.USER_EXISTS}`, {
60
+ headers: this.#getHeaders(),
61
+ });
62
+ }
53
63
  getUserDetail(email) {
54
64
  if (!(0, utils_js_1.checkParameters)(email)) {
55
65
  throw new Error(constants_js_1.REQUIRED_MESSAGE);
@@ -35,8 +35,8 @@ export interface FaceScanObjMetaData {
35
35
  callback_url?: string;
36
36
  body_scan_id?: string;
37
37
  }
38
- export type RequiredMetaDataKeys = "gender" | "focal_length" | "height" | "customer_store_url" | "callback_url" | "clothes_fit";
39
- export type RequiredFaceScanMetaDataKeys = "gender" | "focal_length" | "customer_store_url" | "scan_type" | "callback_url" | "face_scan_id";
38
+ export type RequiredMetaDataKeys = "gender" | "focal_length" | "height" | "customer_store_url" | "clothes_fit";
39
+ export type RequiredFaceScanMetaDataKeys = "gender" | "focal_length" | "customer_store_url" | "scan_type" | "face_scan_id";
40
40
  export declare const requiredMetaData: RequiredMetaDataKeys[];
41
41
  export declare const requiredFaceScanMetaData: RequiredFaceScanMetaDataKeys[];
42
42
  export declare const REQUIRED_MESSAGE: string;
package/dist/constants.js CHANGED
@@ -49,7 +49,9 @@ exports.API_ENDPOINTS = {
49
49
  RECOMMENDATION: "/recommendation",
50
50
  TRY_ON_SHARE: "/tryon/share",
51
51
  DEVICE_INFO: "/deviceinfo",
52
- TRY_ON_PRODUCT_IMAGE_ELIGIBILTY: "/tryon/product-image-eligibility"
52
+ TRY_ON_PRODUCT_IMAGE_ELIGIBILTY: "/tryon/product-image-eligibility",
53
+ USER_PROFILE: "/user/profile",
54
+ USER_EXISTS: "/user/exists"
53
55
  };
54
56
  exports.requiredMetaData = ["gender", "focal_length", "height", "customer_store_url", "clothes_fit"];
55
57
  exports.requiredFaceScanMetaData = ["gender", "focal_length", "customer_store_url", "scan_type", "face_scan_id"];
@@ -29,6 +29,8 @@ export default class Auth {
29
29
  registerUser({ email, appVerifyUrl, gender, height, username }: RegisterUserParams): Promise<AxiosResponse>;
30
30
  verifyToken(token: string): Promise<AxiosResponse>;
31
31
  addUser({ scanId, email, name, height, gender, offsetMarketingConsent }: AddUserParams): Promise<AxiosResponse>;
32
+ userProfile(): Promise<AxiosResponse>;
33
+ userExists(): Promise<AxiosResponse>;
32
34
  getUserDetail(email: string): Promise<AxiosResponse>;
33
35
  handleAuthSocket({ email, scanId, onError, onSuccess, onClose, onOpen }: AuthSocketParams): void;
34
36
  }
package/dist/esm/auth.js CHANGED
@@ -52,6 +52,16 @@ class Auth {
52
52
  }
53
53
  return axios.post(`${getUrl({ urlName: APP_AUTH_BASE_URL, urlType: __classPrivateFieldGet(this, _Auth_urlType, "f") })}${API_ENDPOINTS.ADD_USER}`, { scan_id: scanId, email, name, offsetMarketingConsent, attributes: JSON.stringify({ height, gender }) }, { headers: __classPrivateFieldGet(this, _Auth_instances, "m", _Auth_getHeaders).call(this) });
54
54
  }
55
+ userProfile() {
56
+ return axios.get(`${getUrl({ urlName: APP_AUTH_BASE_URL, urlType: __classPrivateFieldGet(this, _Auth_urlType, "f") })}${API_ENDPOINTS.USER_PROFILE}`, {
57
+ headers: __classPrivateFieldGet(this, _Auth_instances, "m", _Auth_getHeaders).call(this),
58
+ });
59
+ }
60
+ userExists() {
61
+ return axios.get(`${getUrl({ urlName: APP_AUTH_BASE_URL, urlType: __classPrivateFieldGet(this, _Auth_urlType, "f") })}${API_ENDPOINTS.USER_EXISTS}`, {
62
+ headers: __classPrivateFieldGet(this, _Auth_instances, "m", _Auth_getHeaders).call(this),
63
+ });
64
+ }
55
65
  getUserDetail(email) {
56
66
  if (!checkParameters(email)) {
57
67
  throw new Error(REQUIRED_MESSAGE);
@@ -35,8 +35,8 @@ export interface FaceScanObjMetaData {
35
35
  callback_url?: string;
36
36
  body_scan_id?: string;
37
37
  }
38
- export type RequiredMetaDataKeys = "gender" | "focal_length" | "height" | "customer_store_url" | "callback_url" | "clothes_fit";
39
- export type RequiredFaceScanMetaDataKeys = "gender" | "focal_length" | "customer_store_url" | "scan_type" | "callback_url" | "face_scan_id";
38
+ export type RequiredMetaDataKeys = "gender" | "focal_length" | "height" | "customer_store_url" | "clothes_fit";
39
+ export type RequiredFaceScanMetaDataKeys = "gender" | "focal_length" | "customer_store_url" | "scan_type" | "face_scan_id";
40
40
  export declare const requiredMetaData: RequiredMetaDataKeys[];
41
41
  export declare const requiredFaceScanMetaData: RequiredFaceScanMetaDataKeys[];
42
42
  export declare const REQUIRED_MESSAGE: string;
@@ -46,7 +46,9 @@ export const API_ENDPOINTS = {
46
46
  RECOMMENDATION: "/recommendation",
47
47
  TRY_ON_SHARE: "/tryon/share",
48
48
  DEVICE_INFO: "/deviceinfo",
49
- TRY_ON_PRODUCT_IMAGE_ELIGIBILTY: "/tryon/product-image-eligibility"
49
+ TRY_ON_PRODUCT_IMAGE_ELIGIBILTY: "/tryon/product-image-eligibility",
50
+ USER_PROFILE: "/user/profile",
51
+ USER_EXISTS: "/user/exists"
50
52
  };
51
53
  export const requiredMetaData = ["gender", "focal_length", "height", "customer_store_url", "clothes_fit"];
52
54
  export const requiredFaceScanMetaData = ["gender", "focal_length", "customer_store_url", "scan_type", "face_scan_id"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swan-admin/swan-ai-measurements",
3
- "version": "1.1.89",
3
+ "version": "1.1.91",
4
4
  "description": "provides ai measurement suggestion",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/auth.ts CHANGED
@@ -88,6 +88,18 @@ export default class Auth {
88
88
  );
89
89
  }
90
90
 
91
+ userProfile(): Promise<AxiosResponse> {
92
+ return axios.get(`${getUrl({ urlName: APP_AUTH_BASE_URL, urlType: this.#urlType })}${API_ENDPOINTS.USER_PROFILE}`, {
93
+ headers: this.#getHeaders(),
94
+ });
95
+ }
96
+
97
+ userExists(): Promise<AxiosResponse> {
98
+ return axios.get(`${getUrl({ urlName: APP_AUTH_BASE_URL, urlType: this.#urlType })}${API_ENDPOINTS.USER_EXISTS}`, {
99
+ headers: this.#getHeaders(),
100
+ });
101
+ }
102
+
91
103
  getUserDetail(email: string): Promise<AxiosResponse> {
92
104
  if (!checkParameters(email)) {
93
105
  throw new Error(REQUIRED_MESSAGE);
package/src/constants.ts CHANGED
@@ -58,7 +58,9 @@ export const API_ENDPOINTS: {
58
58
  RECOMMENDATION: "/recommendation",
59
59
  TRY_ON_SHARE: "/tryon/share",
60
60
  DEVICE_INFO:"/deviceinfo",
61
- TRY_ON_PRODUCT_IMAGE_ELIGIBILTY:"/tryon/product-image-eligibility"
61
+ TRY_ON_PRODUCT_IMAGE_ELIGIBILTY:"/tryon/product-image-eligibility",
62
+ USER_PROFILE: "/user/profile",
63
+ USER_EXISTS: "/user/exists"
62
64
  };
63
65
  export interface BodyScanObjMetaData {
64
66
  gender: string;
@@ -81,8 +83,8 @@ export interface FaceScanObjMetaData {
81
83
  callback_url?:string
82
84
  body_scan_id?:string;
83
85
  }
84
- export type RequiredMetaDataKeys = "gender" | "focal_length" | "height" | "customer_store_url" | "callback_url" | "clothes_fit";
85
- export type RequiredFaceScanMetaDataKeys = "gender" | "focal_length" | "customer_store_url" | "scan_type" | "callback_url" | "face_scan_id";
86
+ export type RequiredMetaDataKeys = "gender" | "focal_length" | "height" | "customer_store_url" | "clothes_fit";
87
+ export type RequiredFaceScanMetaDataKeys = "gender" | "focal_length" | "customer_store_url" | "scan_type" | "face_scan_id";
86
88
 
87
89
  export const requiredMetaData: RequiredMetaDataKeys[] = ["gender", "focal_length", "height", "customer_store_url", "clothes_fit"];
88
90
  export const requiredFaceScanMetaData: RequiredFaceScanMetaDataKeys[] = ["gender", "focal_length", "customer_store_url","scan_type","face_scan_id"];