@nuskin/ns-product-lib 2.14.4 → 2.14.6-cx24-6388.1

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.14.4",
3
+ "version": "2.14.6-cx24-6388.1",
4
4
  "description": "This project contains shared Product models and code between the backend and frontend.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -24,13 +24,13 @@
24
24
  "@nuskin/ns-util": "4.5.3",
25
25
  "axios": ">=1.6.5",
26
26
  "axios-mock-adapter": "1.21.2",
27
- "eslint": "5.16.0",
28
- "eslint-config-google": "0.14.0",
29
- "eslint-config-prettier": "4.1.0",
30
- "eslint-plugin-json": "2.1.1",
31
- "eslint-plugin-prettier": "3.1.2",
32
- "jest": "29.2.2",
33
- "jest-environment-jsdom": "29.2.2",
27
+ "eslint": "^8.56.0",
28
+ "eslint-config-google": "^0.14.0",
29
+ "eslint-config-prettier": "^9.1.0",
30
+ "eslint-plugin-json": "^3.1.0",
31
+ "eslint-plugin-prettier": "^5.1.3",
32
+ "jest": "29.7.0",
33
+ "jest-environment-jsdom": "29.7.0",
34
34
  "jest-sonar-reporter": "2.0.0",
35
35
  "prettier": "1.19.1"
36
36
  },
@@ -43,6 +43,10 @@
43
43
  "dependencies": {
44
44
  "qs": "6.11.0"
45
45
  },
46
+ "resolutions": {
47
+ "word-wrap": "1.2.4",
48
+ "follow-redirects": "1.15.4"
49
+ },
46
50
  "files": [
47
51
  "src/"
48
52
  ]
@@ -7,7 +7,7 @@
7
7
  * @returns {number}
8
8
  */
9
9
  function backOrderDate(product) {
10
- if (product.inventoryProperties && product.inventoryProperties.hasOwnProperty('expectedBackOrderAvailabilityDate')) {
10
+ if (product.inventoryProperties && product.inventoryProperties.expectedBackOrderAvailabilityDate) {
11
11
  return product.inventoryProperties.expectedBackOrderAvailabilityDate;
12
12
  }
13
13
 
@@ -15,7 +15,7 @@ function mapVariantProperties(properties = {}) {
15
15
  model.title = mapTitle(properties.title);
16
16
  model.scanQualifiedCount = mapScanQualifiedCount(properties.scanQualifiedCount);
17
17
  model.division = mapDivision(properties.division);
18
- model.isExclusive = mapIsExclusive('false',);
18
+ model.isExclusive = mapIsExclusive('false');
19
19
  model.imageURL = mapImageURL(properties.imageURL);
20
20
  model.customerTypes = mapCustomerTypes(properties.customerTypes);
21
21
  model.ingredients = mapIngredients(properties.ingredients);
@@ -106,10 +106,12 @@ const ProductData = {
106
106
  },
107
107
 
108
108
  getProductFromLegacy: async function (skus, locale) {
109
- const marketConfig = await contentstack.getAEMConfig();
109
+ let marketConfig = await contentstack.getAEMConfig();
110
110
 
111
111
  if (marketConfig === null) {
112
- return null;
112
+ marketConfig = {
113
+ aws_url: "https://testapi.cloud.nuskin.com/"
114
+ }
113
115
  }
114
116
 
115
117
  const lambdaUrl = `${marketConfig.aws_url}/productData/v1`;
@@ -144,8 +146,10 @@ const ProductData = {
144
146
  * @returns {number} qty
145
147
  */
146
148
  getAvailableQty: function (inventory) {
147
- if (!inventory || (!inventory.hasOwnProperty('backOrdered')
148
- || !inventory.hasOwnProperty('atpQty') || !inventory.hasOwnProperty('backOrderedQty'))) {
149
+ if (!inventory || (!Object.prototype.hasOwnProperty.call(inventory, 'backOrdered')
150
+ || !Object.prototype.hasOwnProperty.call(inventory, 'atpQty')
151
+ || !Object.prototype.hasOwnProperty.call(inventory, 'backOrderedQty'))
152
+ ) {
149
153
  return 0;
150
154
  }
151
155