@appdirect/sfb-toolkit 4.0.6 → 4.0.8

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.
Files changed (42) hide show
  1. package/Dockerfile +1 -1
  2. package/bin/index.js +12 -4
  3. package/config/index.js +1 -3
  4. package/coverage/clover.xml +166 -161
  5. package/coverage/coverage-final.json +7 -7
  6. package/coverage/lcov-report/constants/customUserAttributesMock.js.html +1 -1
  7. package/coverage/lcov-report/constants/index.html +1 -1
  8. package/coverage/lcov-report/constants/pageUrls.js.html +1 -1
  9. package/coverage/lcov-report/constants/userMock.js.html +1 -1
  10. package/coverage/lcov-report/controllers/controllers-utils/assetsUtils.js.html +1 -1
  11. package/coverage/lcov-report/controllers/controllers-utils/index.html +1 -1
  12. package/coverage/lcov-report/controllers/data-filters/bootstrap-data-filter.js.html +4 -4
  13. package/coverage/lcov-report/controllers/data-filters/call-to-actions-filter.js.html +4 -4
  14. package/coverage/lcov-report/controllers/data-filters/index.html +1 -1
  15. package/coverage/lcov-report/controllers/index.html +21 -21
  16. package/coverage/lcov-report/controllers/index.js.html +164 -128
  17. package/coverage/lcov-report/front-end-utils/src/components/base/ResultItem.js.html +7 -7
  18. package/coverage/lcov-report/front-end-utils/src/components/base/SearchBar.js.html +3 -3
  19. package/coverage/lcov-report/front-end-utils/src/components/base/index.html +1 -1
  20. package/coverage/lcov-report/front-end-utils/src/components/base/item.js.html +11 -11
  21. package/coverage/lcov-report/front-end-utils/src/components/container.js.html +1 -1
  22. package/coverage/lcov-report/front-end-utils/src/components/data-view.js.html +1 -1
  23. package/coverage/lcov-report/front-end-utils/src/components/header-view.js.html +1 -1
  24. package/coverage/lcov-report/front-end-utils/src/components/index.html +1 -1
  25. package/coverage/lcov-report/front-end-utils/src/components/search.js.html +13 -13
  26. package/coverage/lcov-report/front-end-utils/src/constants/index.html +1 -1
  27. package/coverage/lcov-report/front-end-utils/src/constants/pageUrl.js.html +1 -1
  28. package/coverage/lcov-report/front-end-utils/src/constants/roleType.js.html +1 -1
  29. package/coverage/lcov-report/front-end-utils/src/constants/searchType.js.html +1 -1
  30. package/coverage/lcov-report/front-end-utils/src/utils/debounce.js.html +1 -1
  31. package/coverage/lcov-report/front-end-utils/src/utils/index.html +1 -1
  32. package/coverage/lcov-report/index.html +20 -20
  33. package/coverage/lcov-report/middlewares/config.js.html +1 -1
  34. package/coverage/lcov-report/middlewares/index.html +1 -1
  35. package/coverage/lcov.info +341 -330
  36. package/npm-shrinkwrap.json +86 -180
  37. package/package.json +6 -7
  38. package/readme.md +6 -0
  39. package/src/api/cors.js +29 -20
  40. package/src/controllers/index.js +58 -46
  41. package/src/tools/prompt-questions.js +78 -68
  42. package/src/tools/toolkit-common-vars.js +1 -1
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@appdirect/sfb-toolkit",
3
- "version": "4.0.6",
3
+ "version": "4.0.8",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@appdirect/sfb-toolkit",
9
- "version": "4.0.6",
9
+ "version": "4.0.8",
10
10
  "license": "SEE LICENSE IN https://help.appdirect.com/sfb-eula.pdf",
11
11
  "dependencies": {
12
12
  "@appdirect/public-custom-app-ui": "^0.0.17",
13
- "@appdirect/sfb-theme-classic": "0.0.26",
14
- "@appdirect/sfb-theme-plaza": "0.0.69",
13
+ "@appdirect/sfb-theme-classic": "TO_CHANGE",
14
+ "@appdirect/sfb-theme-plaza": "TO_CHANGE",
15
15
  "@appdirect/storefront-utils": "latest",
16
16
  "@babel/core": "^7.19.1",
17
17
  "@babel/plugin-proposal-class-properties": "^7.18.6",
@@ -25,7 +25,6 @@
25
25
  "@fortawesome/react-fontawesome": "0.2.0",
26
26
  "app-root-path": "^3.1.0",
27
27
  "archiver": "^5.3.1",
28
- "axios": "^0.27.2",
29
28
  "babel-loader": "^8.2.5",
30
29
  "babel-preset-minify": "^0.5.2",
31
30
  "body-parser": "^1.20.0",
@@ -53,7 +52,7 @@
53
52
  "mini-css-extract-plugin": "^2.6.1",
54
53
  "minimist": "^1.2.6",
55
54
  "moment": "^2.29.4",
56
- "node-fetch": "^3.2.10",
55
+ "node-fetch": "^2.7.0",
57
56
  "nodemon": "^2.0.20",
58
57
  "nunjucks": "^3.2.3",
59
58
  "nunjucks-intl": "^1.0.3",
@@ -111,8 +110,8 @@
111
110
  "redux-thunk": "^2.4.1"
112
111
  },
113
112
  "engines": {
114
- "node": "16",
115
- "npm": "8"
113
+ "node": "16|18",
114
+ "npm": "8|9"
116
115
  }
117
116
  },
118
117
  "node_modules/@ampproject/remapping": {
@@ -18187,14 +18186,14 @@
18187
18186
  }
18188
18187
  },
18189
18188
  "node_modules/@appdirect/sfb-theme-classic": {
18190
- "version": "0.0.26",
18191
- "resolved": "https://registry.npmjs.org/@appdirect/sfb-theme-classic/-/sfb-theme-classic-0.0.26.tgz",
18192
- "integrity": "sha512-Sawm4ERF6/CICvVA3Y5Sqi1a3jsNoIQ7D98DFfQy2pHhFckv6admdQd2siW3acJtJSuZyK+37LVjk7I3BZgRbA=="
18189
+ "version": "0.0.27",
18190
+ "resolved": "https://registry.npmjs.org/@appdirect/sfb-theme-classic/-/sfb-theme-classic-0.0.27.tgz",
18191
+ "integrity": "sha512-pmpAJwxaqMSUVTudBq/BXlD4MEEFsGkulR/v+baJYZ44lzvH0ZxlFakAXcZyxAwuM+S3YUNkdHqbC3fGyxYvDw=="
18193
18192
  },
18194
18193
  "node_modules/@appdirect/sfb-theme-plaza": {
18195
- "version": "0.0.69",
18196
- "resolved": "https://registry.npmjs.org/@appdirect/sfb-theme-plaza/-/sfb-theme-plaza-0.0.69.tgz",
18197
- "integrity": "sha512-VGg201dGuS1VghfFn12g2hf90PYHSLX4hjRVgDmeh37EWK5nzWj4IKt1Q+5iuFV3KfaQsQ+IU1qYCAKw8MX+wQ=="
18194
+ "version": "0.0.75",
18195
+ "resolved": "https://registry.npmjs.org/@appdirect/sfb-theme-plaza/-/sfb-theme-plaza-0.0.75.tgz",
18196
+ "integrity": "sha512-87hxgIAJAX/2q/f9zyF7kPi2nAJaNv2qEeQW7TRQm29OqO/h4AQ0llhIO/uktg8+8LWRnIMnkJw279yZV5qcIA=="
18198
18197
  },
18199
18198
  "node_modules/@appdirect/storefront-utils": {
18200
18199
  "version": "0.0.124",
@@ -22368,7 +22367,8 @@
22368
22367
  "node_modules/asynckit": {
22369
22368
  "version": "0.4.0",
22370
22369
  "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
22371
- "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
22370
+ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
22371
+ "dev": true
22372
22372
  },
22373
22373
  "node_modules/atob": {
22374
22374
  "version": "2.1.2",
@@ -22402,15 +22402,6 @@
22402
22402
  "node": ">=4"
22403
22403
  }
22404
22404
  },
22405
- "node_modules/axios": {
22406
- "version": "0.27.2",
22407
- "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz",
22408
- "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==",
22409
- "dependencies": {
22410
- "follow-redirects": "^1.14.9",
22411
- "form-data": "^4.0.0"
22412
- }
22413
- },
22414
22405
  "node_modules/axobject-query": {
22415
22406
  "version": "3.1.1",
22416
22407
  "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz",
@@ -23942,6 +23933,7 @@
23942
23933
  "version": "1.0.8",
23943
23934
  "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
23944
23935
  "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
23936
+ "dev": true,
23945
23937
  "dependencies": {
23946
23938
  "delayed-stream": "~1.0.0"
23947
23939
  },
@@ -24619,14 +24611,6 @@
24619
24611
  "integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==",
24620
24612
  "dev": true
24621
24613
  },
24622
- "node_modules/data-uri-to-buffer": {
24623
- "version": "4.0.1",
24624
- "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
24625
- "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==",
24626
- "engines": {
24627
- "node": ">= 12"
24628
- }
24629
- },
24630
24614
  "node_modules/data-urls": {
24631
24615
  "version": "3.0.2",
24632
24616
  "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz",
@@ -24866,6 +24850,7 @@
24866
24850
  "version": "1.0.0",
24867
24851
  "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
24868
24852
  "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
24853
+ "dev": true,
24869
24854
  "engines": {
24870
24855
  "node": ">=0.4.0"
24871
24856
  }
@@ -26677,28 +26662,6 @@
26677
26662
  "resolved": "https://registry.npmjs.org/fbjs-css-vars/-/fbjs-css-vars-1.0.2.tgz",
26678
26663
  "integrity": "sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ=="
26679
26664
  },
26680
- "node_modules/fetch-blob": {
26681
- "version": "3.2.0",
26682
- "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
26683
- "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
26684
- "funding": [
26685
- {
26686
- "type": "github",
26687
- "url": "https://github.com/sponsors/jimmywarting"
26688
- },
26689
- {
26690
- "type": "paypal",
26691
- "url": "https://paypal.me/jimmywarting"
26692
- }
26693
- ],
26694
- "dependencies": {
26695
- "node-domexception": "^1.0.0",
26696
- "web-streams-polyfill": "^3.0.3"
26697
- },
26698
- "engines": {
26699
- "node": "^12.20 || >= 14.13"
26700
- }
26701
- },
26702
26665
  "node_modules/figures": {
26703
26666
  "version": "3.2.0",
26704
26667
  "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz",
@@ -27113,25 +27076,6 @@
27113
27076
  "react": "^15.0.2 || ^16.0.0 || ^17.0.0"
27114
27077
  }
27115
27078
  },
27116
- "node_modules/follow-redirects": {
27117
- "version": "1.15.2",
27118
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
27119
- "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
27120
- "funding": [
27121
- {
27122
- "type": "individual",
27123
- "url": "https://github.com/sponsors/RubenVerborgh"
27124
- }
27125
- ],
27126
- "engines": {
27127
- "node": ">=4.0"
27128
- },
27129
- "peerDependenciesMeta": {
27130
- "debug": {
27131
- "optional": true
27132
- }
27133
- }
27134
- },
27135
27079
  "node_modules/for-each": {
27136
27080
  "version": "0.3.3",
27137
27081
  "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
@@ -27164,6 +27108,7 @@
27164
27108
  "version": "4.0.0",
27165
27109
  "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
27166
27110
  "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
27111
+ "dev": true,
27167
27112
  "dependencies": {
27168
27113
  "asynckit": "^0.4.0",
27169
27114
  "combined-stream": "^1.0.8",
@@ -27181,17 +27126,6 @@
27181
27126
  "node": ">=0.4.x"
27182
27127
  }
27183
27128
  },
27184
- "node_modules/formdata-polyfill": {
27185
- "version": "4.0.10",
27186
- "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
27187
- "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
27188
- "dependencies": {
27189
- "fetch-blob": "^3.1.2"
27190
- },
27191
- "engines": {
27192
- "node": ">=12.20.0"
27193
- }
27194
- },
27195
27129
  "node_modules/forwarded": {
27196
27130
  "version": "0.2.0",
27197
27131
  "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
@@ -31799,39 +31733,42 @@
31799
31733
  "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
31800
31734
  "dev": true
31801
31735
  },
31802
- "node_modules/node-domexception": {
31803
- "version": "1.0.0",
31804
- "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
31805
- "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
31806
- "funding": [
31807
- {
31808
- "type": "github",
31809
- "url": "https://github.com/sponsors/jimmywarting"
31810
- },
31811
- {
31812
- "type": "github",
31813
- "url": "https://paypal.me/jimmywarting"
31814
- }
31815
- ],
31816
- "engines": {
31817
- "node": ">=10.5.0"
31818
- }
31819
- },
31820
31736
  "node_modules/node-fetch": {
31821
- "version": "3.3.1",
31822
- "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz",
31823
- "integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==",
31737
+ "version": "2.7.0",
31738
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
31739
+ "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
31824
31740
  "dependencies": {
31825
- "data-uri-to-buffer": "^4.0.0",
31826
- "fetch-blob": "^3.1.4",
31827
- "formdata-polyfill": "^4.0.10"
31741
+ "whatwg-url": "^5.0.0"
31828
31742
  },
31829
31743
  "engines": {
31830
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
31744
+ "node": "4.x || >=6.0.0"
31831
31745
  },
31832
- "funding": {
31833
- "type": "opencollective",
31834
- "url": "https://opencollective.com/node-fetch"
31746
+ "peerDependencies": {
31747
+ "encoding": "^0.1.0"
31748
+ },
31749
+ "peerDependenciesMeta": {
31750
+ "encoding": {
31751
+ "optional": true
31752
+ }
31753
+ }
31754
+ },
31755
+ "node_modules/node-fetch/node_modules/tr46": {
31756
+ "version": "0.0.3",
31757
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
31758
+ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
31759
+ },
31760
+ "node_modules/node-fetch/node_modules/webidl-conversions": {
31761
+ "version": "3.0.1",
31762
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
31763
+ "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
31764
+ },
31765
+ "node_modules/node-fetch/node_modules/whatwg-url": {
31766
+ "version": "5.0.0",
31767
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
31768
+ "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
31769
+ "dependencies": {
31770
+ "tr46": "~0.0.3",
31771
+ "webidl-conversions": "^3.0.0"
31835
31772
  }
31836
31773
  },
31837
31774
  "node_modules/node-int64": {
@@ -37350,14 +37287,6 @@
37350
37287
  "defaults": "^1.0.3"
37351
37288
  }
37352
37289
  },
37353
- "node_modules/web-streams-polyfill": {
37354
- "version": "3.2.1",
37355
- "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz",
37356
- "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==",
37357
- "engines": {
37358
- "node": ">= 8"
37359
- }
37360
- },
37361
37290
  "node_modules/webidl-conversions": {
37362
37291
  "version": "7.0.0",
37363
37292
  "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",
@@ -51626,14 +51555,14 @@
51626
51555
  }
51627
51556
  },
51628
51557
  "@appdirect/sfb-theme-classic": {
51629
- "version": "0.0.26",
51630
- "resolved": "https://registry.npmjs.org/@appdirect/sfb-theme-classic/-/sfb-theme-classic-0.0.26.tgz",
51631
- "integrity": "sha512-Sawm4ERF6/CICvVA3Y5Sqi1a3jsNoIQ7D98DFfQy2pHhFckv6admdQd2siW3acJtJSuZyK+37LVjk7I3BZgRbA=="
51558
+ "version": "0.0.27",
51559
+ "resolved": "https://registry.npmjs.org/@appdirect/sfb-theme-classic/-/sfb-theme-classic-0.0.27.tgz",
51560
+ "integrity": "sha512-pmpAJwxaqMSUVTudBq/BXlD4MEEFsGkulR/v+baJYZ44lzvH0ZxlFakAXcZyxAwuM+S3YUNkdHqbC3fGyxYvDw=="
51632
51561
  },
51633
51562
  "@appdirect/sfb-theme-plaza": {
51634
- "version": "0.0.69",
51635
- "resolved": "https://registry.npmjs.org/@appdirect/sfb-theme-plaza/-/sfb-theme-plaza-0.0.69.tgz",
51636
- "integrity": "sha512-VGg201dGuS1VghfFn12g2hf90PYHSLX4hjRVgDmeh37EWK5nzWj4IKt1Q+5iuFV3KfaQsQ+IU1qYCAKw8MX+wQ=="
51563
+ "version": "0.0.75",
51564
+ "resolved": "https://registry.npmjs.org/@appdirect/sfb-theme-plaza/-/sfb-theme-plaza-0.0.75.tgz",
51565
+ "integrity": "sha512-87hxgIAJAX/2q/f9zyF7kPi2nAJaNv2qEeQW7TRQm29OqO/h4AQ0llhIO/uktg8+8LWRnIMnkJw279yZV5qcIA=="
51637
51566
  },
51638
51567
  "@appdirect/storefront-utils": {
51639
51568
  "version": "0.0.124",
@@ -54838,7 +54767,8 @@
54838
54767
  "asynckit": {
54839
54768
  "version": "0.4.0",
54840
54769
  "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
54841
- "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
54770
+ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
54771
+ "dev": true
54842
54772
  },
54843
54773
  "atob": {
54844
54774
  "version": "2.1.2",
@@ -54857,15 +54787,6 @@
54857
54787
  "integrity": "sha512-/BQzOX780JhsxDnPpH4ZiyrJAzcd8AfzFPkv+89veFSr1rcMjuq2JDCwypKaPeB6ljHp9KjXhPpjgCvQlWYuqg==",
54858
54788
  "dev": true
54859
54789
  },
54860
- "axios": {
54861
- "version": "0.27.2",
54862
- "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz",
54863
- "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==",
54864
- "requires": {
54865
- "follow-redirects": "^1.14.9",
54866
- "form-data": "^4.0.0"
54867
- }
54868
- },
54869
54790
  "axobject-query": {
54870
54791
  "version": "3.1.1",
54871
54792
  "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz",
@@ -56079,6 +56000,7 @@
56079
56000
  "version": "1.0.8",
56080
56001
  "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
56081
56002
  "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
56003
+ "dev": true,
56082
56004
  "requires": {
56083
56005
  "delayed-stream": "~1.0.0"
56084
56006
  }
@@ -56610,11 +56532,6 @@
56610
56532
  "integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==",
56611
56533
  "dev": true
56612
56534
  },
56613
- "data-uri-to-buffer": {
56614
- "version": "4.0.1",
56615
- "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
56616
- "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A=="
56617
- },
56618
56535
  "data-urls": {
56619
56536
  "version": "3.0.2",
56620
56537
  "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz",
@@ -56790,7 +56707,8 @@
56790
56707
  "delayed-stream": {
56791
56708
  "version": "1.0.0",
56792
56709
  "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
56793
- "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="
56710
+ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
56711
+ "dev": true
56794
56712
  },
56795
56713
  "delegates": {
56796
56714
  "version": "1.0.0",
@@ -58218,15 +58136,6 @@
58218
58136
  "resolved": "https://registry.npmjs.org/fbjs-css-vars/-/fbjs-css-vars-1.0.2.tgz",
58219
58137
  "integrity": "sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ=="
58220
58138
  },
58221
- "fetch-blob": {
58222
- "version": "3.2.0",
58223
- "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
58224
- "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
58225
- "requires": {
58226
- "node-domexception": "^1.0.0",
58227
- "web-streams-polyfill": "^3.0.3"
58228
- }
58229
- },
58230
58139
  "figures": {
58231
58140
  "version": "3.2.0",
58232
58141
  "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz",
@@ -58560,11 +58469,6 @@
58560
58469
  "fbjs": "^3.0.1"
58561
58470
  }
58562
58471
  },
58563
- "follow-redirects": {
58564
- "version": "1.15.2",
58565
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
58566
- "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA=="
58567
- },
58568
58472
  "for-each": {
58569
58473
  "version": "0.3.3",
58570
58474
  "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
@@ -58591,6 +58495,7 @@
58591
58495
  "version": "4.0.0",
58592
58496
  "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
58593
58497
  "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
58498
+ "dev": true,
58594
58499
  "requires": {
58595
58500
  "asynckit": "^0.4.0",
58596
58501
  "combined-stream": "^1.0.8",
@@ -58602,14 +58507,6 @@
58602
58507
  "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz",
58603
58508
  "integrity": "sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww=="
58604
58509
  },
58605
- "formdata-polyfill": {
58606
- "version": "4.0.10",
58607
- "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
58608
- "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
58609
- "requires": {
58610
- "fetch-blob": "^3.1.2"
58611
- }
58612
- },
58613
58510
  "forwarded": {
58614
58511
  "version": "0.2.0",
58615
58512
  "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
@@ -62124,19 +62021,33 @@
62124
62021
  "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
62125
62022
  "dev": true
62126
62023
  },
62127
- "node-domexception": {
62128
- "version": "1.0.0",
62129
- "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
62130
- "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ=="
62131
- },
62132
62024
  "node-fetch": {
62133
- "version": "3.3.1",
62134
- "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz",
62135
- "integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==",
62025
+ "version": "2.7.0",
62026
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
62027
+ "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
62136
62028
  "requires": {
62137
- "data-uri-to-buffer": "^4.0.0",
62138
- "fetch-blob": "^3.1.4",
62139
- "formdata-polyfill": "^4.0.10"
62029
+ "whatwg-url": "^5.0.0"
62030
+ },
62031
+ "dependencies": {
62032
+ "tr46": {
62033
+ "version": "0.0.3",
62034
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
62035
+ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
62036
+ },
62037
+ "webidl-conversions": {
62038
+ "version": "3.0.1",
62039
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
62040
+ "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
62041
+ },
62042
+ "whatwg-url": {
62043
+ "version": "5.0.0",
62044
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
62045
+ "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
62046
+ "requires": {
62047
+ "tr46": "~0.0.3",
62048
+ "webidl-conversions": "^3.0.0"
62049
+ }
62050
+ }
62140
62051
  }
62141
62052
  },
62142
62053
  "node-int64": {
@@ -66331,11 +66242,6 @@
66331
66242
  "defaults": "^1.0.3"
66332
66243
  }
66333
66244
  },
66334
- "web-streams-polyfill": {
66335
- "version": "3.2.1",
66336
- "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz",
66337
- "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q=="
66338
- },
66339
66245
  "webidl-conversions": {
66340
66246
  "version": "7.0.0",
66341
66247
  "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appdirect/sfb-toolkit",
3
- "version": "4.0.6",
3
+ "version": "4.0.8",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -56,8 +56,8 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@appdirect/public-custom-app-ui": "^0.0.17",
59
- "@appdirect/sfb-theme-classic": "0.0.26",
60
- "@appdirect/sfb-theme-plaza": "0.0.69",
59
+ "@appdirect/sfb-theme-classic": "TO_CHANGE",
60
+ "@appdirect/sfb-theme-plaza": "TO_CHANGE",
61
61
  "@appdirect/storefront-utils": "latest",
62
62
  "@babel/core": "^7.19.1",
63
63
  "@babel/plugin-proposal-class-properties": "^7.18.6",
@@ -71,7 +71,6 @@
71
71
  "@fortawesome/react-fontawesome": "0.2.0",
72
72
  "app-root-path": "^3.1.0",
73
73
  "archiver": "^5.3.1",
74
- "axios": "^0.27.2",
75
74
  "babel-loader": "^8.2.5",
76
75
  "babel-preset-minify": "^0.5.2",
77
76
  "body-parser": "^1.20.0",
@@ -99,7 +98,7 @@
99
98
  "mini-css-extract-plugin": "^2.6.1",
100
99
  "minimist": "^1.2.6",
101
100
  "moment": "^2.29.4",
102
- "node-fetch": "^3.2.10",
101
+ "node-fetch": "^2.7.0",
103
102
  "nodemon": "^2.0.20",
104
103
  "nunjucks": "^3.2.3",
105
104
  "nunjucks-intl": "^1.0.3",
@@ -154,7 +153,7 @@
154
153
  "redux-thunk": "^2.4.1"
155
154
  },
156
155
  "engines": {
157
- "node": "16",
158
- "npm": "8"
156
+ "node": "16|18",
157
+ "npm": "8|9"
159
158
  }
160
159
  }
package/readme.md CHANGED
@@ -9,6 +9,12 @@ It can be easily mixed with eg. HTML, CSS, JavaScript, jQuery, SASS.
9
9
  * Node 16.x for versions 4.x.x
10
10
 
11
11
  ### Release Notes:
12
+
13
+ **4.0.8**
14
+ - Update `@appdirect/sfb-theme-plaza` to version 0.0.64 ([sfb-theme-mp2@0.0.75](https://www.npmjs.com/package/@appdirect/sfb-theme-plaza/v/0.0.75))
15
+ - Update `@appdirect/sfb-theme-classic` to version 0.0.27 ([sfb-theme-classic@0.0.27](https://www.npmjs.com/package/@appdirect/sfb-theme-classic/v/0.0.27))
16
+ - Update `sfb-theme-components` library to version [0.0.338](https://www.npmjs.com/package/@appdirect/sfb-theme-components/v/0.0.3.5)
17
+
12
18
  **4.0.4**
13
19
  - Update `@appdirect/sfb-theme-plaza` to version 0.0.64 ([sfb-theme-mp2@0.0.64](https://www.npmjs.com/package/@appdirect/sfb-theme-plaza/v/0.0.64))
14
20
  - Update `sfb-theme-components` library to version [0.0.321](https://www.npmjs.com/package/@appdirect/sfb-theme-components/v/0.0.321)
package/src/api/cors.js CHANGED
@@ -1,26 +1,35 @@
1
- const axios = require("axios")
1
+ const fetch = require("node-fetch");
2
2
 
3
3
  const cors = {
4
- callApi(req, res, requestType = "get") {
5
- const options = {}
4
+ async callApi(req, res, requestType = "get") {
5
+ const options = {
6
+ method: requestType,
7
+ redirect: "follow",
8
+ follow: 20,
9
+ headers: {},
10
+ };
11
+
12
+ if (["post", "put"].includes(requestType.toLowerCase())) {
13
+ options.body = JSON.stringify(req.body);
14
+ }
15
+
6
16
  if (req.headers.authorization) {
7
- options.Authorization = req.headers.authorization
17
+ options.headers.Authorization = req.headers.authorization;
8
18
  } else if (req.headers.cookie) {
9
- options.cookie = req.headers.cookie
19
+ options.headers.cookie = req.headers.cookie;
10
20
  }
11
- axios({
12
- method: requestType,
13
- url: `${req.config.marketplacePath}${req.originalUrl}`,
14
- headers: options,
15
- data: req.body
16
- })
17
- .then(response => {
18
- res.send(response.data)
19
- })
20
- .catch(error => {
21
- res.sendStatus(error.response.status)
22
- })
23
- }
24
- }
25
21
 
26
- module.exports = cors
22
+ try {
23
+ const response = await fetch(
24
+ `${req.config.marketplacePath}${req.originalUrl}`,
25
+ options
26
+ );
27
+ const data = await response.json();
28
+ res.send(data);
29
+ } catch (error) {
30
+ console.log(error);
31
+ res.sendStatus(500);
32
+ }
33
+ },
34
+ };
35
+ module.exports = cors;