@nuskin/ns-product-lib 2.7.0-cx24-3682.9 → 2.7.0-cx24-3682.11
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +15 -0
- package/package.json +1 -1
- package/src/equinox-helpers/index.js +49 -48
- package/src/equinox-helpers/mappers/variant.js +2 -1
- package/src/productData.js +3 -3
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
# [2.7.0-cx24-3682.11](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0-cx24-3682.10...v2.7.0-cx24-3682.11) (2023-03-27)
|
2
|
+
|
3
|
+
|
4
|
+
### New
|
5
|
+
|
6
|
+
* MySite product cards show blank data when users have setup AEM Base SKU's(55) in Admin #CX24-3682 ([140f1f0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/140f1f06c14b940851481ab8d4111728e760caad)), closes [#CX24-3682](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3682)
|
7
|
+
* MySite product cards show blank data when users have setup AEM Base SKU's(55) in Admin #CX24-3682 ([a9c1b38](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/a9c1b380ecb1e98a496be4628f6e4e4f32ff2a98)), closes [#CX24-3682](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3682)
|
8
|
+
|
9
|
+
# [2.7.0-cx24-3682.10](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0-cx24-3682.9...v2.7.0-cx24-3682.10) (2023-03-27)
|
10
|
+
|
11
|
+
|
12
|
+
### New
|
13
|
+
|
14
|
+
* MySite product cards show blank data when users have setup AEM Base SKU's(55) in Admin #CX24-3682 ([249f3b7](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/249f3b79b30a774c45e90886f01d8bd4d4874b4b)), closes [#CX24-3682](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3682)
|
15
|
+
|
1
16
|
# [2.7.0-cx24-3682.9](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0-cx24-3682.8...v2.7.0-cx24-3682.9) (2023-03-26)
|
2
17
|
|
3
18
|
|
package/package.json
CHANGED
@@ -45,7 +45,7 @@
|
|
45
45
|
* @description EquinoxNormalProduct represents an equinox Normal product type.
|
46
46
|
* @typedef EquinoxNormalProduct
|
47
47
|
* @type {object}
|
48
|
-
* @property {string} identifier
|
48
|
+
* @property {string} identifier e.g., Normal - "blt8b757df6dcaa199c" | Kit - "02001076"
|
49
49
|
* @property {EquinoxProductProperties} properties
|
50
50
|
* @property {EquinoxProductVariant[]} sku or varaints - available only when product is a normal product.
|
51
51
|
*/
|
@@ -71,40 +71,40 @@
|
|
71
71
|
* @property {string} benefits
|
72
72
|
* @property {string} usage
|
73
73
|
* @property {string} resources
|
74
|
-
* @property {string} scanQualifiedCount
|
75
|
-
* @property {string} status
|
76
|
-
* @property {string} size
|
77
|
-
* @property {string} productDetailsDescription
|
74
|
+
* @property {string} scanQualifiedCount e.g., "0"
|
75
|
+
* @property {string} status e.g., "active"
|
76
|
+
* @property {string} size e.g., "30 mL / 1 fl.oz"
|
77
|
+
* @property {string} productDetailsDescription e.g., "[]"
|
78
78
|
*/
|
79
79
|
|
80
80
|
/**
|
81
81
|
* @description These are the properties unique to Kit product type.
|
82
82
|
* @typedef EquinoxKitProductProperties
|
83
83
|
* @type {object}
|
84
|
-
* @property {string} skukits
|
85
|
-
* @property {string} productStatus
|
86
|
-
* @property {string} availableChannels
|
84
|
+
* @property {string} skukits e.g., "02002145~1,02002146~1,02002147~1,02002148~1,02002142~1,02002143~1"
|
85
|
+
* @property {string} productStatus e.g., "Sellable"
|
86
|
+
* @property {string} availableChannels e.g., "subscription,arsPhone,kiosk,mobile,web"
|
87
87
|
*/
|
88
88
|
|
89
89
|
/**
|
90
90
|
* @description These are the common properties between Normal and Kit product types
|
91
91
|
* @typedef EquinoxProductCommonProperties
|
92
92
|
* @type {object}
|
93
|
-
* @property {string} name
|
94
|
-
* @property {string} imageURL
|
95
|
-
* @property {string} market
|
96
|
-
* @property {string} description
|
97
|
-
* @property {string} customerTypes
|
98
|
-
* @property {string} division
|
93
|
+
* @property {string} name e.g., "180° Cell Renewal Fluid"
|
94
|
+
* @property {string} imageURL e.g., "https://nuskin.com/content/dam/global/...ule-refreshed.jpg"
|
95
|
+
* @property {string} market e.g., "CA"
|
96
|
+
* @property {string} description e.g., "180° Ampoule"
|
97
|
+
* @property {string} customerTypes e.g., "BrandAffiliate,Preferred,Retail"
|
98
|
+
* @property {string} division e.g., "Nu Skin"
|
99
99
|
*/
|
100
100
|
|
101
101
|
/**
|
102
102
|
* @typedef EquinoxProductVariant
|
103
103
|
* @type {object}
|
104
|
-
* @property {string} identifier
|
105
|
-
* @property {string} inventory
|
104
|
+
* @property {string} identifier e.g., "02002145"
|
105
|
+
* @property {string} inventory e.g., "IN STOCK"
|
106
106
|
* @property {EquinoxProductVariantProperties} properties
|
107
|
-
* @property {any[]} promotion
|
107
|
+
* @property {any[]} promotion e.g., ???
|
108
108
|
* @property {EquinoxProductPriceFacets} priceFacets
|
109
109
|
* @property {EquinoxProductInventoryProperties} inventoryProperties
|
110
110
|
* @property {EquinxProductTotalValue} totalValue
|
@@ -116,64 +116,65 @@
|
|
116
116
|
* @description This does not contain the full list of properties from the response.
|
117
117
|
* @typedef EquinoxProductVariantProperties
|
118
118
|
* @type {object}
|
119
|
-
* @property {string} availableChannels
|
120
|
-
* @property {string} imageURL
|
121
|
-
* @property {string} name
|
122
|
-
* @property {string} market
|
123
|
-
* @property {string} description
|
119
|
+
* @property {string} availableChannels e.g., "subscription,arsPhone,kiosk,mobile,web"
|
120
|
+
* @property {string} imageURL e.g., "https://nuskin.com/cont...21/ca-180-Ampoule-refreshed.jpg"
|
121
|
+
* @property {string} name e.g., "180° Cell Renewal Fluid"
|
122
|
+
* @property {string} market e.g., "CA"
|
123
|
+
* @property {string} description e.g., "180° Ampoule"
|
124
124
|
* @property {string} ingredients
|
125
125
|
* @property {string} benefits
|
126
126
|
* @property {string} usage
|
127
127
|
* @property {string} resources
|
128
|
-
* @property {string} scanQualifiedCount
|
129
|
-
* @property {string} customerTypes
|
130
|
-
* @property {string} division
|
131
|
-
* @property {string} status
|
132
|
-
* @property {string} size
|
128
|
+
* @property {string} scanQualifiedCount e.g., "0"
|
129
|
+
* @property {string} customerTypes e.g., "BrandAffiliate,Preferred,Retail"
|
130
|
+
* @property {string} division e.g., "Nu Skin"
|
131
|
+
* @property {string} status e.g., "active"
|
132
|
+
* @property {string} size e.g., "30 mL / 1 fl.oz"
|
133
133
|
* @property {string} globalProductId
|
134
134
|
* @property {string} excludeFromSearch
|
135
135
|
* @property {string} chargeShipping
|
136
136
|
* @property {string} title
|
137
|
+
* @property {string} productStatus e.g., "Sellable"
|
137
138
|
* @property {string} [variantLabel]
|
138
|
-
* @property {string} [isExclusive]
|
139
|
+
* @property {string} [isExclusive] e.g., "false" - Why is this a string??
|
139
140
|
*/
|
140
141
|
|
141
142
|
/**
|
142
143
|
* @description Why are properties not camelCase and type of string instead of number? Super weird!
|
143
144
|
* @typedef EquinoxProductPriceFacets
|
144
145
|
* @type {object}
|
145
|
-
* @property {string} CV
|
146
|
-
* @property {string} Regular Price
|
147
|
-
* @property {string} PV
|
148
|
-
* @property {string} Wholesale Price
|
149
|
-
* @property {string} SB
|
146
|
+
* @property {string} CV e.g., "76.0"
|
147
|
+
* @property {string} Regular Price e.g., "76.0"
|
148
|
+
* @property {string} PV e.g., "54.15"
|
149
|
+
* @property {string} Wholesale Price e.g., "88.0"
|
150
|
+
* @property {string} SB e.g., "4.25"
|
150
151
|
*/
|
151
152
|
|
152
153
|
/**
|
153
154
|
* @description
|
154
155
|
* @typedef EquinoxProductInventoryProperties
|
155
156
|
* @type {object}
|
156
|
-
* @property {boolean} available
|
157
|
-
* @property {boolean} lowStock
|
158
|
-
* @property {string} binName
|
159
|
-
* @property {boolean} backOrdered
|
160
|
-
* @property {number} expectedBackOrderAvailabilityDate
|
161
|
-
* @property {boolean} preOrdered
|
162
|
-
* @property {number} expectedPreOrderAvailabilityDate
|
163
|
-
* @property {number} atpQty
|
164
|
-
* @property {number} preOrderedQty
|
165
|
-
* @property {number} backOrderedQty
|
166
|
-
* @property {number|null} lowStockThreshold
|
167
|
-
* @property {number|null} outOfStockThreshold
|
157
|
+
* @property {boolean} available e.g., true
|
158
|
+
* @property {boolean} lowStock e.g., false
|
159
|
+
* @property {string} binName e.g., "1046_CA01"
|
160
|
+
* @property {boolean} backOrdered e.g., false
|
161
|
+
* @property {number} expectedBackOrderAvailabilityDate e.g., 0
|
162
|
+
* @property {boolean} preOrdered e.g., false
|
163
|
+
* @property {number} expectedPreOrderAvailabilityDate e.g., 0
|
164
|
+
* @property {number} atpQty e.g., 49882
|
165
|
+
* @property {number} preOrderedQty e.g., 0
|
166
|
+
* @property {number} backOrderedQty e.g., 0
|
167
|
+
* @property {number|null} lowStockThreshold e.g., null
|
168
|
+
* @property {number|null} outOfStockThreshold e.g., null
|
168
169
|
*/
|
169
170
|
|
170
171
|
/**
|
171
172
|
* @description
|
172
173
|
* @typedef EquinxProductTotalValue
|
173
174
|
* @type {object}
|
174
|
-
* @property {number} priceAfterDiscount
|
175
|
-
* @property {number} originalPrice
|
176
|
-
* @property {number} totaldiscount
|
175
|
+
* @property {number} priceAfterDiscount e.g., 2
|
176
|
+
* @property {number} originalPrice e.g., 2
|
177
|
+
* @property {number} totaldiscount e.g., 0
|
177
178
|
* @property {{
|
178
179
|
* CV: { CV: number },
|
179
180
|
* "Regular Price": {
|
package/src/productData.js
CHANGED
@@ -6,7 +6,7 @@ const Product = require("./product");
|
|
6
6
|
const CustomerTypes = require('./models/customerTypes');
|
7
7
|
const ProductStatus = require("./models/productStatus");
|
8
8
|
const { mapAvailableQuantity, mapChildSKU } = require('./equinox-helpers');
|
9
|
-
const { productNotFoundInterceptor } = require('./equinox-helpers/interceptors');
|
9
|
+
// const { productNotFoundInterceptor } = require('./equinox-helpers/interceptors');
|
10
10
|
|
11
11
|
const productTypes = {
|
12
12
|
kit: 'kit'
|
@@ -71,7 +71,7 @@ const ProductData = {
|
|
71
71
|
|
72
72
|
const url = `${config.API_Base_URLs}/orchestrationservices/storefront/catalogs/search/`;
|
73
73
|
const href = `${url}?filter='\\\\''${encodeURI(filter)}'\\''`;
|
74
|
-
axios.interceptors.response.use((res) => res, productNotFoundInterceptor);
|
74
|
+
// axios.interceptors.response.use((res) => res, productNotFoundInterceptor);
|
75
75
|
const response = await axios.request({
|
76
76
|
method: 'get',
|
77
77
|
url: href,
|
@@ -84,7 +84,7 @@ const ProductData = {
|
|
84
84
|
withCredentials: true
|
85
85
|
});
|
86
86
|
|
87
|
-
axios.interceptors.response.eject(productNotFoundInterceptor);
|
87
|
+
// axios.interceptors.response.eject(productNotFoundInterceptor);
|
88
88
|
return response;
|
89
89
|
},
|
90
90
|
|