@scayle/storefront-core 7.22.1

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 (268) hide show
  1. package/CHANGELOG.md +480 -0
  2. package/LICENSE +21 -0
  3. package/README.md +29 -0
  4. package/dist/bapi/init.cjs +30 -0
  5. package/dist/bapi/init.d.ts +14 -0
  6. package/dist/bapi/init.mjs +23 -0
  7. package/dist/cache/cache.cjs +1 -0
  8. package/dist/cache/cache.d.ts +8 -0
  9. package/dist/cache/cache.mjs +0 -0
  10. package/dist/cache/cached.cjs +89 -0
  11. package/dist/cache/cached.d.ts +24 -0
  12. package/dist/cache/cached.mjs +92 -0
  13. package/dist/cache/index.cjs +38 -0
  14. package/dist/cache/index.d.ts +3 -0
  15. package/dist/cache/index.mjs +3 -0
  16. package/dist/cache/providers/redis.cjs +94 -0
  17. package/dist/cache/providers/redis.d.ts +28 -0
  18. package/dist/cache/providers/redis.mjs +86 -0
  19. package/dist/cache/providers/unstorage.cjs +54 -0
  20. package/dist/cache/providers/unstorage.d.ts +16 -0
  21. package/dist/cache/providers/unstorage.mjs +49 -0
  22. package/dist/cache/types.cjs +11 -0
  23. package/dist/cache/types.d.ts +6 -0
  24. package/dist/cache/types.mjs +4 -0
  25. package/dist/constants/basket.cjs +13 -0
  26. package/dist/constants/basket.d.ts +8 -0
  27. package/dist/constants/basket.mjs +6 -0
  28. package/dist/constants/cache.cjs +8 -0
  29. package/dist/constants/cache.d.ts +1 -0
  30. package/dist/constants/cache.mjs +1 -0
  31. package/dist/constants/hash.cjs +11 -0
  32. package/dist/constants/hash.d.ts +6 -0
  33. package/dist/constants/hash.mjs +4 -0
  34. package/dist/constants/httpStatus.cjs +636 -0
  35. package/dist/constants/httpStatus.d.ts +632 -0
  36. package/dist/constants/httpStatus.mjs +629 -0
  37. package/dist/constants/index.cjs +93 -0
  38. package/dist/constants/index.d.ts +8 -0
  39. package/dist/constants/index.mjs +8 -0
  40. package/dist/constants/product.cjs +11 -0
  41. package/dist/constants/product.d.ts +6 -0
  42. package/dist/constants/product.mjs +4 -0
  43. package/dist/constants/promotion.cjs +10 -0
  44. package/dist/constants/promotion.d.ts +2 -0
  45. package/dist/constants/promotion.mjs +2 -0
  46. package/dist/constants/sorting.cjs +24 -0
  47. package/dist/constants/sorting.d.ts +20 -0
  48. package/dist/constants/sorting.mjs +17 -0
  49. package/dist/constants/withParameters.cjs +138 -0
  50. package/dist/constants/withParameters.d.ts +30 -0
  51. package/dist/constants/withParameters.mjs +132 -0
  52. package/dist/errors/BAPIError.cjs +16 -0
  53. package/dist/errors/BAPIError.d.ts +6 -0
  54. package/dist/errors/BAPIError.mjs +9 -0
  55. package/dist/errors/baseError.cjs +17 -0
  56. package/dist/errors/baseError.d.ts +5 -0
  57. package/dist/errors/baseError.mjs +10 -0
  58. package/dist/errors/index.cjs +27 -0
  59. package/dist/errors/index.d.ts +2 -0
  60. package/dist/errors/index.mjs +2 -0
  61. package/dist/helpers/advancedAttributeHelpers.cjs +26 -0
  62. package/dist/helpers/advancedAttributeHelpers.d.ts +12 -0
  63. package/dist/helpers/advancedAttributeHelpers.mjs +21 -0
  64. package/dist/helpers/arrayHelpers.cjs +10 -0
  65. package/dist/helpers/arrayHelpers.d.ts +1 -0
  66. package/dist/helpers/arrayHelpers.mjs +3 -0
  67. package/dist/helpers/attributeHelpers.cjs +24 -0
  68. package/dist/helpers/attributeHelpers.d.ts +5 -0
  69. package/dist/helpers/attributeHelpers.mjs +17 -0
  70. package/dist/helpers/autobind.cjs +44 -0
  71. package/dist/helpers/autobind.d.ts +39 -0
  72. package/dist/helpers/autobind.mjs +35 -0
  73. package/dist/helpers/basketHelpers.cjs +12 -0
  74. package/dist/helpers/basketHelpers.d.ts +2 -0
  75. package/dist/helpers/basketHelpers.mjs +5 -0
  76. package/dist/helpers/categoryHelper.cjs +61 -0
  77. package/dist/helpers/categoryHelper.d.ts +7 -0
  78. package/dist/helpers/categoryHelper.mjs +44 -0
  79. package/dist/helpers/filterHelper.cjs +156 -0
  80. package/dist/helpers/filterHelper.d.ts +82 -0
  81. package/dist/helpers/filterHelper.mjs +147 -0
  82. package/dist/helpers/formHelpers.cjs +114 -0
  83. package/dist/helpers/formHelpers.d.ts +48 -0
  84. package/dist/helpers/formHelpers.mjs +106 -0
  85. package/dist/helpers/imageHelpers.cjs +20 -0
  86. package/dist/helpers/imageHelpers.d.ts +4 -0
  87. package/dist/helpers/imageHelpers.mjs +14 -0
  88. package/dist/helpers/index.cjs +192 -0
  89. package/dist/helpers/index.d.ts +17 -0
  90. package/dist/helpers/index.mjs +17 -0
  91. package/dist/helpers/localization.cjs +13 -0
  92. package/dist/helpers/localization.d.ts +7 -0
  93. package/dist/helpers/localization.mjs +6 -0
  94. package/dist/helpers/objectHelpers.cjs +19 -0
  95. package/dist/helpers/objectHelpers.d.ts +1 -0
  96. package/dist/helpers/objectHelpers.mjs +6 -0
  97. package/dist/helpers/orderHelpers.cjs +10 -0
  98. package/dist/helpers/orderHelpers.d.ts +67 -0
  99. package/dist/helpers/orderHelpers.mjs +4 -0
  100. package/dist/helpers/product.fixture.cjs +770 -0
  101. package/dist/helpers/product.fixture.d.ts +415 -0
  102. package/dist/helpers/product.fixture.mjs +838 -0
  103. package/dist/helpers/productDisruptorHelper.cjs +37 -0
  104. package/dist/helpers/productDisruptorHelper.d.ts +10 -0
  105. package/dist/helpers/productDisruptorHelper.mjs +23 -0
  106. package/dist/helpers/productHelpers.cjs +188 -0
  107. package/dist/helpers/productHelpers.d.ts +41 -0
  108. package/dist/helpers/productHelpers.mjs +170 -0
  109. package/dist/helpers/sanitizationHelpers.cjs +15 -0
  110. package/dist/helpers/sanitizationHelpers.d.ts +2 -0
  111. package/dist/helpers/sanitizationHelpers.mjs +6 -0
  112. package/dist/helpers/sortingHelper.cjs +67 -0
  113. package/dist/helpers/sortingHelper.d.ts +69 -0
  114. package/dist/helpers/sortingHelper.mjs +66 -0
  115. package/dist/helpers/stringHelpers.cjs +8 -0
  116. package/dist/helpers/stringHelpers.d.ts +2 -0
  117. package/dist/helpers/stringHelpers.mjs +2 -0
  118. package/dist/index.cjs +85 -0
  119. package/dist/index.d.ts +19 -0
  120. package/dist/index.mjs +8 -0
  121. package/dist/rpc/methods/basket/basket.cjs +183 -0
  122. package/dist/rpc/methods/basket/basket.d.ts +23 -0
  123. package/dist/rpc/methods/basket/basket.mjs +181 -0
  124. package/dist/rpc/methods/brands.cjs +34 -0
  125. package/dist/rpc/methods/brands.d.ts +5 -0
  126. package/dist/rpc/methods/brands.mjs +16 -0
  127. package/dist/rpc/methods/categories.cjs +102 -0
  128. package/dist/rpc/methods/categories.d.ts +21 -0
  129. package/dist/rpc/methods/categories.mjs +64 -0
  130. package/dist/rpc/methods/cbd.cjs +45 -0
  131. package/dist/rpc/methods/cbd.d.ts +4 -0
  132. package/dist/rpc/methods/cbd.mjs +36 -0
  133. package/dist/rpc/methods/checkout/index.cjs +38 -0
  134. package/dist/rpc/methods/checkout/index.d.ts +3 -0
  135. package/dist/rpc/methods/checkout/index.mjs +3 -0
  136. package/dist/rpc/methods/checkout/order.cjs +55 -0
  137. package/dist/rpc/methods/checkout/order.d.ts +4 -0
  138. package/dist/rpc/methods/checkout/order.mjs +43 -0
  139. package/dist/rpc/methods/checkout/shopUser.cjs +126 -0
  140. package/dist/rpc/methods/checkout/shopUser.d.ts +7 -0
  141. package/dist/rpc/methods/checkout/shopUser.mjs +109 -0
  142. package/dist/rpc/methods/checkout/shopUserAddresses.cjs +25 -0
  143. package/dist/rpc/methods/checkout/shopUserAddresses.d.ts +3 -0
  144. package/dist/rpc/methods/checkout/shopUserAddresses.mjs +19 -0
  145. package/dist/rpc/methods/index.cjs +159 -0
  146. package/dist/rpc/methods/index.d.ts +14 -0
  147. package/dist/rpc/methods/index.mjs +14 -0
  148. package/dist/rpc/methods/navigationTrees.cjs +33 -0
  149. package/dist/rpc/methods/navigationTrees.d.ts +5 -0
  150. package/dist/rpc/methods/navigationTrees.mjs +10 -0
  151. package/dist/rpc/methods/products.cjs +261 -0
  152. package/dist/rpc/methods/products.d.ts +13 -0
  153. package/dist/rpc/methods/products.mjs +217 -0
  154. package/dist/rpc/methods/promotion.cjs +53 -0
  155. package/dist/rpc/methods/promotion.d.ts +4 -0
  156. package/dist/rpc/methods/promotion.mjs +38 -0
  157. package/dist/rpc/methods/search.cjs +38 -0
  158. package/dist/rpc/methods/search.d.ts +10 -0
  159. package/dist/rpc/methods/search.mjs +22 -0
  160. package/dist/rpc/methods/session.cjs +274 -0
  161. package/dist/rpc/methods/session.d.ts +20 -0
  162. package/dist/rpc/methods/session.mjs +309 -0
  163. package/dist/rpc/methods/shopConfiguration.cjs +15 -0
  164. package/dist/rpc/methods/shopConfiguration.d.ts +4 -0
  165. package/dist/rpc/methods/shopConfiguration.mjs +6 -0
  166. package/dist/rpc/methods/user.cjs +89 -0
  167. package/dist/rpc/methods/user.d.ts +20 -0
  168. package/dist/rpc/methods/user.mjs +56 -0
  169. package/dist/rpc/methods/variants.cjs +29 -0
  170. package/dist/rpc/methods/variants.d.ts +8 -0
  171. package/dist/rpc/methods/variants.mjs +12 -0
  172. package/dist/rpc/methods/wishlist.cjs +85 -0
  173. package/dist/rpc/methods/wishlist.d.ts +13 -0
  174. package/dist/rpc/methods/wishlist.mjs +61 -0
  175. package/dist/server.cjs +39 -0
  176. package/dist/server.d.ts +5 -0
  177. package/dist/server.mjs +4 -0
  178. package/dist/types/api/auth.cjs +1 -0
  179. package/dist/types/api/auth.d.ts +63 -0
  180. package/dist/types/api/auth.mjs +0 -0
  181. package/dist/types/api/context.cjs +1 -0
  182. package/dist/types/api/context.d.ts +61 -0
  183. package/dist/types/api/context.mjs +0 -0
  184. package/dist/types/api/rpc.cjs +1 -0
  185. package/dist/types/api/rpc.d.ts +4 -0
  186. package/dist/types/api/rpc.mjs +0 -0
  187. package/dist/types/bapi/basket.cjs +1 -0
  188. package/dist/types/bapi/basket.d.ts +25 -0
  189. package/dist/types/bapi/basket.mjs +0 -0
  190. package/dist/types/bapi/brand.cjs +1 -0
  191. package/dist/types/bapi/brand.d.ts +2 -0
  192. package/dist/types/bapi/brand.mjs +0 -0
  193. package/dist/types/bapi/category.cjs +1 -0
  194. package/dist/types/bapi/category.d.ts +6 -0
  195. package/dist/types/bapi/category.mjs +0 -0
  196. package/dist/types/bapi/filter.cjs +1 -0
  197. package/dist/types/bapi/filter.d.ts +49 -0
  198. package/dist/types/bapi/filter.mjs +0 -0
  199. package/dist/types/bapi/navigation.cjs +1 -0
  200. package/dist/types/bapi/navigation.d.ts +10 -0
  201. package/dist/types/bapi/navigation.mjs +0 -0
  202. package/dist/types/bapi/order.cjs +1 -0
  203. package/dist/types/bapi/order.d.ts +554 -0
  204. package/dist/types/bapi/order.mjs +0 -0
  205. package/dist/types/bapi/pagination.cjs +1 -0
  206. package/dist/types/bapi/pagination.d.ts +13 -0
  207. package/dist/types/bapi/pagination.mjs +0 -0
  208. package/dist/types/bapi/product.cjs +1 -0
  209. package/dist/types/bapi/product.d.ts +84 -0
  210. package/dist/types/bapi/product.mjs +0 -0
  211. package/dist/types/bapi/productFilter.cjs +1 -0
  212. package/dist/types/bapi/productFilter.d.ts +7 -0
  213. package/dist/types/bapi/productFilter.mjs +0 -0
  214. package/dist/types/bapi/promotion.cjs +1 -0
  215. package/dist/types/bapi/promotion.d.ts +2 -0
  216. package/dist/types/bapi/promotion.mjs +0 -0
  217. package/dist/types/bapi/redirects.cjs +1 -0
  218. package/dist/types/bapi/redirects.d.ts +1 -0
  219. package/dist/types/bapi/redirects.mjs +0 -0
  220. package/dist/types/bapi/router.cjs +1 -0
  221. package/dist/types/bapi/router.d.ts +1 -0
  222. package/dist/types/bapi/router.mjs +0 -0
  223. package/dist/types/bapi/search.cjs +1 -0
  224. package/dist/types/bapi/search.d.ts +21 -0
  225. package/dist/types/bapi/search.mjs +0 -0
  226. package/dist/types/bapi/sorting.cjs +5 -0
  227. package/dist/types/bapi/sorting.d.ts +10 -0
  228. package/dist/types/bapi/sorting.mjs +1 -0
  229. package/dist/types/bapi/wishlist.cjs +1 -0
  230. package/dist/types/bapi/wishlist.d.ts +9 -0
  231. package/dist/types/bapi/wishlist.mjs +0 -0
  232. package/dist/types/breadcrumb.cjs +1 -0
  233. package/dist/types/breadcrumb.d.ts +4 -0
  234. package/dist/types/breadcrumb.mjs +0 -0
  235. package/dist/types/index.cjs +236 -0
  236. package/dist/types/index.d.ts +22 -0
  237. package/dist/types/index.mjs +21 -0
  238. package/dist/types/promises.cjs +1 -0
  239. package/dist/types/promises.d.ts +2 -0
  240. package/dist/types/promises.mjs +0 -0
  241. package/dist/types/user.cjs +1 -0
  242. package/dist/types/user.d.ts +100 -0
  243. package/dist/types/user.mjs +0 -0
  244. package/dist/utils/compression.cjs +24 -0
  245. package/dist/utils/compression.d.ts +2 -0
  246. package/dist/utils/compression.mjs +16 -0
  247. package/dist/utils/hash.cjs +68 -0
  248. package/dist/utils/hash.d.ts +8 -0
  249. package/dist/utils/hash.mjs +61 -0
  250. package/dist/utils/index.cjs +27 -0
  251. package/dist/utils/index.d.ts +2 -0
  252. package/dist/utils/index.mjs +2 -0
  253. package/dist/utils/keys.cjs +67 -0
  254. package/dist/utils/keys.d.ts +24 -0
  255. package/dist/utils/keys.mjs +56 -0
  256. package/dist/utils/log.cjs +93 -0
  257. package/dist/utils/log.d.ts +43 -0
  258. package/dist/utils/log.mjs +75 -0
  259. package/dist/utils/rpc.cjs +41 -0
  260. package/dist/utils/rpc.d.ts +6 -0
  261. package/dist/utils/rpc.mjs +35 -0
  262. package/dist/utils/timeout.cjs +17 -0
  263. package/dist/utils/timeout.d.ts +2 -0
  264. package/dist/utils/timeout.mjs +9 -0
  265. package/dist/utils/user.cjs +75 -0
  266. package/dist/utils/user.d.ts +14 -0
  267. package/dist/utils/user.mjs +65 -0
  268. package/package.json +97 -0
@@ -0,0 +1,2 @@
1
+ export type { PromotionsEndpointResponseData as PromotionsResponseData, PromotionsEndpointRequestParameters as PromotionsParams, } from '@aboutyou/backbone/endpoints/promotions/promotions';
2
+ export type * from '@aboutyou/backbone/types/Promotion';
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ export type { Redirect } from '@aboutyou/backbone/endpoints/redirects/redirects';
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ export type Query = string | (string | null)[];
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,21 @@
1
+ import type { ProductWith } from '@aboutyou/backbone/types/ProductWith';
2
+ import type { TypeaheadSuggestionsEndpointRequestParameters } from '@aboutyou/backbone/endpoints/typeahead/typeahead';
3
+ import { Query } from '../index';
4
+ export type { BrandOrCategorySuggestion, ProductSuggestion, TypeaheadSuggestion, TypeaheadBrandOrCategorySuggestion, TypeaheadProductSuggestion, TypeaheadSuggestionsEndpointResponseData, } from '@aboutyou/backbone/endpoints/typeahead/typeahead';
5
+ export type SearchInput = {
6
+ term?: Query;
7
+ slug?: string;
8
+ productLimit?: number;
9
+ };
10
+ export type CategoryWith = {
11
+ parents?: 'all';
12
+ children?: number;
13
+ };
14
+ export type SearchOptions = {
15
+ key?: string;
16
+ with?: {
17
+ products?: ProductWith;
18
+ categories?: CategoryWith;
19
+ };
20
+ };
21
+ export type SearchWith = TypeaheadSuggestionsEndpointRequestParameters['with'];
File without changes
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,10 @@
1
+ import type { APISortOption, APISortOrder } from '@aboutyou/backbone/endpoints/products/products';
2
+ import type { SortName, SortQuery } from '../../constants';
3
+ export { APISortOption, APISortOrder };
4
+ export type SortingValueKey = 'topSeller' | 'dateNewest' | 'priceDesc' | 'priceAsc' | 'reductionDesc' | 'reductionAsc';
5
+ export interface SortValue {
6
+ name: SortName;
7
+ query: SortQuery;
8
+ by: APISortOption;
9
+ direction?: APISortOrder;
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,9 @@
1
+ import type { WishlistResponseData, WishlistWith } from '@aboutyou/backbone/endpoints/wishlist/getWishlist';
2
+ export type { WishlistResponseData, WishlistWith };
3
+ export interface WishlistWithOptions extends WishlistWith {
4
+ pricePromotionKey?: string;
5
+ }
6
+ export interface UseWishlistParams {
7
+ key?: string;
8
+ with: WishlistWithOptions;
9
+ }
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,4 @@
1
+ export interface BreadcrumbItem {
2
+ value: string;
3
+ to: string;
4
+ }
File without changes
@@ -0,0 +1,236 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _promises = require("./promises.cjs");
7
+ Object.keys(_promises).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _promises[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _promises[key];
14
+ }
15
+ });
16
+ });
17
+ var _user = require("./user.cjs");
18
+ Object.keys(_user).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _user[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _user[key];
25
+ }
26
+ });
27
+ });
28
+ var _breadcrumb = require("./breadcrumb.cjs");
29
+ Object.keys(_breadcrumb).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _breadcrumb[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _breadcrumb[key];
36
+ }
37
+ });
38
+ });
39
+ var _rpc = require("./api/rpc.cjs");
40
+ Object.keys(_rpc).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _rpc[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _rpc[key];
47
+ }
48
+ });
49
+ });
50
+ var _context = require("./api/context.cjs");
51
+ Object.keys(_context).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (key in exports && exports[key] === _context[key]) return;
54
+ Object.defineProperty(exports, key, {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _context[key];
58
+ }
59
+ });
60
+ });
61
+ var _auth = require("./api/auth.cjs");
62
+ Object.keys(_auth).forEach(function (key) {
63
+ if (key === "default" || key === "__esModule") return;
64
+ if (key in exports && exports[key] === _auth[key]) return;
65
+ Object.defineProperty(exports, key, {
66
+ enumerable: true,
67
+ get: function () {
68
+ return _auth[key];
69
+ }
70
+ });
71
+ });
72
+ var _basket = require("./bapi/basket.cjs");
73
+ Object.keys(_basket).forEach(function (key) {
74
+ if (key === "default" || key === "__esModule") return;
75
+ if (key in exports && exports[key] === _basket[key]) return;
76
+ Object.defineProperty(exports, key, {
77
+ enumerable: true,
78
+ get: function () {
79
+ return _basket[key];
80
+ }
81
+ });
82
+ });
83
+ var _brand = require("./bapi/brand.cjs");
84
+ Object.keys(_brand).forEach(function (key) {
85
+ if (key === "default" || key === "__esModule") return;
86
+ if (key in exports && exports[key] === _brand[key]) return;
87
+ Object.defineProperty(exports, key, {
88
+ enumerable: true,
89
+ get: function () {
90
+ return _brand[key];
91
+ }
92
+ });
93
+ });
94
+ var _category = require("./bapi/category.cjs");
95
+ Object.keys(_category).forEach(function (key) {
96
+ if (key === "default" || key === "__esModule") return;
97
+ if (key in exports && exports[key] === _category[key]) return;
98
+ Object.defineProperty(exports, key, {
99
+ enumerable: true,
100
+ get: function () {
101
+ return _category[key];
102
+ }
103
+ });
104
+ });
105
+ var _filter = require("./bapi/filter.cjs");
106
+ Object.keys(_filter).forEach(function (key) {
107
+ if (key === "default" || key === "__esModule") return;
108
+ if (key in exports && exports[key] === _filter[key]) return;
109
+ Object.defineProperty(exports, key, {
110
+ enumerable: true,
111
+ get: function () {
112
+ return _filter[key];
113
+ }
114
+ });
115
+ });
116
+ var _navigation = require("./bapi/navigation.cjs");
117
+ Object.keys(_navigation).forEach(function (key) {
118
+ if (key === "default" || key === "__esModule") return;
119
+ if (key in exports && exports[key] === _navigation[key]) return;
120
+ Object.defineProperty(exports, key, {
121
+ enumerable: true,
122
+ get: function () {
123
+ return _navigation[key];
124
+ }
125
+ });
126
+ });
127
+ var _order = require("./bapi/order.cjs");
128
+ Object.keys(_order).forEach(function (key) {
129
+ if (key === "default" || key === "__esModule") return;
130
+ if (key in exports && exports[key] === _order[key]) return;
131
+ Object.defineProperty(exports, key, {
132
+ enumerable: true,
133
+ get: function () {
134
+ return _order[key];
135
+ }
136
+ });
137
+ });
138
+ var _product = require("./bapi/product.cjs");
139
+ Object.keys(_product).forEach(function (key) {
140
+ if (key === "default" || key === "__esModule") return;
141
+ if (key in exports && exports[key] === _product[key]) return;
142
+ Object.defineProperty(exports, key, {
143
+ enumerable: true,
144
+ get: function () {
145
+ return _product[key];
146
+ }
147
+ });
148
+ });
149
+ var _productFilter = require("./bapi/productFilter.cjs");
150
+ Object.keys(_productFilter).forEach(function (key) {
151
+ if (key === "default" || key === "__esModule") return;
152
+ if (key in exports && exports[key] === _productFilter[key]) return;
153
+ Object.defineProperty(exports, key, {
154
+ enumerable: true,
155
+ get: function () {
156
+ return _productFilter[key];
157
+ }
158
+ });
159
+ });
160
+ var _redirects = require("./bapi/redirects.cjs");
161
+ Object.keys(_redirects).forEach(function (key) {
162
+ if (key === "default" || key === "__esModule") return;
163
+ if (key in exports && exports[key] === _redirects[key]) return;
164
+ Object.defineProperty(exports, key, {
165
+ enumerable: true,
166
+ get: function () {
167
+ return _redirects[key];
168
+ }
169
+ });
170
+ });
171
+ var _router = require("./bapi/router.cjs");
172
+ Object.keys(_router).forEach(function (key) {
173
+ if (key === "default" || key === "__esModule") return;
174
+ if (key in exports && exports[key] === _router[key]) return;
175
+ Object.defineProperty(exports, key, {
176
+ enumerable: true,
177
+ get: function () {
178
+ return _router[key];
179
+ }
180
+ });
181
+ });
182
+ var _search = require("./bapi/search.cjs");
183
+ Object.keys(_search).forEach(function (key) {
184
+ if (key === "default" || key === "__esModule") return;
185
+ if (key in exports && exports[key] === _search[key]) return;
186
+ Object.defineProperty(exports, key, {
187
+ enumerable: true,
188
+ get: function () {
189
+ return _search[key];
190
+ }
191
+ });
192
+ });
193
+ var _sorting = require("./bapi/sorting.cjs");
194
+ Object.keys(_sorting).forEach(function (key) {
195
+ if (key === "default" || key === "__esModule") return;
196
+ if (key in exports && exports[key] === _sorting[key]) return;
197
+ Object.defineProperty(exports, key, {
198
+ enumerable: true,
199
+ get: function () {
200
+ return _sorting[key];
201
+ }
202
+ });
203
+ });
204
+ var _wishlist = require("./bapi/wishlist.cjs");
205
+ Object.keys(_wishlist).forEach(function (key) {
206
+ if (key === "default" || key === "__esModule") return;
207
+ if (key in exports && exports[key] === _wishlist[key]) return;
208
+ Object.defineProperty(exports, key, {
209
+ enumerable: true,
210
+ get: function () {
211
+ return _wishlist[key];
212
+ }
213
+ });
214
+ });
215
+ var _pagination = require("./bapi/pagination.cjs");
216
+ Object.keys(_pagination).forEach(function (key) {
217
+ if (key === "default" || key === "__esModule") return;
218
+ if (key in exports && exports[key] === _pagination[key]) return;
219
+ Object.defineProperty(exports, key, {
220
+ enumerable: true,
221
+ get: function () {
222
+ return _pagination[key];
223
+ }
224
+ });
225
+ });
226
+ var _promotion = require("./bapi/promotion.cjs");
227
+ Object.keys(_promotion).forEach(function (key) {
228
+ if (key === "default" || key === "__esModule") return;
229
+ if (key in exports && exports[key] === _promotion[key]) return;
230
+ Object.defineProperty(exports, key, {
231
+ enumerable: true,
232
+ get: function () {
233
+ return _promotion[key];
234
+ }
235
+ });
236
+ });
@@ -0,0 +1,22 @@
1
+ export * from './promises';
2
+ export * from './user';
3
+ export * from './breadcrumb';
4
+ export * from './api/rpc';
5
+ export * from './api/context';
6
+ export * from './api/auth';
7
+ export type { BapiClient } from '@aboutyou/backbone';
8
+ export * from './bapi/basket';
9
+ export * from './bapi/brand';
10
+ export * from './bapi/category';
11
+ export * from './bapi/filter';
12
+ export * from './bapi/navigation';
13
+ export * from './bapi/order';
14
+ export * from './bapi/product';
15
+ export * from './bapi/productFilter';
16
+ export * from './bapi/redirects';
17
+ export * from './bapi/router';
18
+ export * from './bapi/search';
19
+ export * from './bapi/sorting';
20
+ export * from './bapi/wishlist';
21
+ export * from './bapi/pagination';
22
+ export * from './bapi/promotion';
@@ -0,0 +1,21 @@
1
+ export * from "./promises.mjs";
2
+ export * from "./user.mjs";
3
+ export * from "./breadcrumb.mjs";
4
+ export * from "./api/rpc.mjs";
5
+ export * from "./api/context.mjs";
6
+ export * from "./api/auth.mjs";
7
+ export * from "./bapi/basket.mjs";
8
+ export * from "./bapi/brand.mjs";
9
+ export * from "./bapi/category.mjs";
10
+ export * from "./bapi/filter.mjs";
11
+ export * from "./bapi/navigation.mjs";
12
+ export * from "./bapi/order.mjs";
13
+ export * from "./bapi/product.mjs";
14
+ export * from "./bapi/productFilter.mjs";
15
+ export * from "./bapi/redirects.mjs";
16
+ export * from "./bapi/router.mjs";
17
+ export * from "./bapi/search.mjs";
18
+ export * from "./bapi/sorting.mjs";
19
+ export * from "./bapi/wishlist.mjs";
20
+ export * from "./bapi/pagination.mjs";
21
+ export * from "./bapi/promotion.mjs";
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,2 @@
1
+ export type Awaited<T> = T extends PromiseLike<infer U> ? Awaited<U> : T;
2
+ export type PromiseReturnType<T extends (...args: any) => Promise<any>> = Awaited<ReturnType<T>>;
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,100 @@
1
+ import { UseBasketParams } from './bapi/basket';
2
+ import { UseWishlistParams } from './bapi/wishlist';
3
+ export type Gender = 'm' | 'f' | 'd';
4
+ export type UpdatePasswordParams = {
5
+ oldPassword: string;
6
+ newPassword: string;
7
+ };
8
+ export interface UseUserParams {
9
+ key?: string;
10
+ autoFetch?: boolean;
11
+ }
12
+ interface MemberRole {
13
+ discountVisibility: string;
14
+ memberPriority: number;
15
+ memberRoleSap: string;
16
+ }
17
+ type AuthenticationType = 'facebook' | 'password' | 'apple';
18
+ interface UserAuthentication {
19
+ data?: {
20
+ accessToken?: string;
21
+ userId?: string;
22
+ };
23
+ storefrontAccessToken?: string;
24
+ type: AuthenticationType;
25
+ }
26
+ export interface OrderSummary {
27
+ id: number;
28
+ confirmedAt?: string;
29
+ itemCount: number | undefined;
30
+ shopId: number;
31
+ status?: string;
32
+ }
33
+ export interface ShopUserStatus {
34
+ isActive: boolean;
35
+ isGuestCustomer: boolean;
36
+ isTestCustomer: boolean;
37
+ }
38
+ export interface ShopUserAddress {
39
+ id: number;
40
+ referenceKey?: string;
41
+ street: string;
42
+ houseNumber?: string;
43
+ additional?: string;
44
+ zipCode: string;
45
+ city: string;
46
+ countryCode: string;
47
+ collectionPoint?: {
48
+ customerKey?: string;
49
+ description?: string;
50
+ key: string;
51
+ type: string;
52
+ };
53
+ isBillingAddress: boolean;
54
+ isShippingAddress: boolean;
55
+ isDefault: {
56
+ billing: boolean;
57
+ shipping: boolean;
58
+ };
59
+ recipient: {
60
+ firstName?: string;
61
+ lastName: string;
62
+ gender?: Gender;
63
+ title?: string;
64
+ };
65
+ }
66
+ export interface ShopUser {
67
+ app_id: number;
68
+ completed_orders: number;
69
+ created_date?: Date;
70
+ zip_code?: number | undefined;
71
+ authentication?: UserAuthentication;
72
+ firstName: string;
73
+ lastName?: string;
74
+ groups?: string[];
75
+ birthDate?: string;
76
+ phone?: string;
77
+ publicKey: string;
78
+ referenceKey: string;
79
+ createdAt: string;
80
+ updatedAt: string;
81
+ email?: string;
82
+ fbook?: boolean;
83
+ id: number;
84
+ isGuest: boolean;
85
+ isReturningCustomer: boolean;
86
+ gender?: Gender;
87
+ orderSummary?: OrderSummary[];
88
+ status?: ShopUserStatus;
89
+ title?: string;
90
+ customData?: {
91
+ memberRoles?: MemberRole[];
92
+ };
93
+ loginShopId?: number;
94
+ }
95
+ export type UseUserFacetParams = {
96
+ userParams: UseUserParams;
97
+ basketParams: UseBasketParams;
98
+ wishlistParams: UseWishlistParams;
99
+ };
100
+ export {};
File without changes
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.decompress = exports.compress = void 0;
7
+ var _util = require("util");
8
+ var _zlib = require("zlib");
9
+ const asyncDeflate = (0, _util.promisify)(_zlib.gzip);
10
+ const asyncUnzip = (0, _util.promisify)(_zlib.gunzip);
11
+ const compress = async data => {
12
+ const buffer = await asyncDeflate(data);
13
+ return buffer.toString("base64");
14
+ };
15
+ exports.compress = compress;
16
+ const decompress = async data => {
17
+ try {
18
+ const buffer = Buffer.from(data, "base64");
19
+ return (await asyncUnzip(buffer)).toString();
20
+ } catch (e) {
21
+ return data;
22
+ }
23
+ };
24
+ exports.decompress = decompress;
@@ -0,0 +1,2 @@
1
+ export declare const compress: (data: string) => Promise<string>;
2
+ export declare const decompress: (data: string) => Promise<string>;
@@ -0,0 +1,16 @@
1
+ import { promisify } from "util";
2
+ import { gzip, gunzip } from "zlib";
3
+ const asyncDeflate = promisify(gzip);
4
+ const asyncUnzip = promisify(gunzip);
5
+ export const compress = async (data) => {
6
+ const buffer = await asyncDeflate(data);
7
+ return buffer.toString("base64");
8
+ };
9
+ export const decompress = async (data) => {
10
+ try {
11
+ const buffer = Buffer.from(data, "base64");
12
+ return (await asyncUnzip(buffer)).toString();
13
+ } catch (e) {
14
+ return data;
15
+ }
16
+ };
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.verifyToken = exports.sha256 = exports.md5 = exports.hmac = exports.encodeBase64 = exports.decodeBase64 = exports.buildSignature = exports.buildHashPayload = void 0;
7
+ var _uncrypto = require("uncrypto");
8
+ const md5 = async value => {
9
+ if (!process.env.SFC_OMIT_MD5) {
10
+ const md5EncryptImport = await Promise.resolve().then(() => require("crypto-js/md5"));
11
+ const hexImport = await Promise.resolve().then(() => require("crypto-js/enc-hex"));
12
+ const md5Encrypt = md5EncryptImport.default && typeof md5EncryptImport.default === "function" ? md5EncryptImport.default : md5EncryptImport;
13
+ const hex = hexImport.default && typeof hexImport.default === "function" ? hexImport.default : hexImport;
14
+ return hex.stringify(md5Encrypt(value));
15
+ } else {
16
+ throw Error("SFC was built without support for MD5");
17
+ }
18
+ };
19
+ exports.md5 = md5;
20
+ const sha256 = async value => Array.from(new Uint8Array(await _uncrypto.subtle.digest("SHA-256", new TextEncoder().encode(value)))).map(b => b.toString(16).padStart(2, "0")).join("");
21
+ exports.sha256 = sha256;
22
+ const hmac = async (value, secret, algorithm = "SHA-256") => {
23
+ const encoder = new TextEncoder();
24
+ const messageUint8Array = encoder.encode(value);
25
+ const keyUint8Array = encoder.encode(secret);
26
+ const cryptoKey = await _uncrypto.subtle.importKey("raw", keyUint8Array, {
27
+ name: "HMAC",
28
+ hash: algorithm
29
+ }, false, ["sign"]);
30
+ const signature = await _uncrypto.subtle.sign("HMAC", cryptoKey, messageUint8Array);
31
+ const hashArray = Array.from(new Uint8Array(signature));
32
+ return hashArray.map(b => b.toString(16).padStart(2, "0")).join("");
33
+ };
34
+ exports.hmac = hmac;
35
+ function base64ToBytes(base64) {
36
+ const binString = atob(base64);
37
+ return Uint8Array.from(binString, m => m.codePointAt(0));
38
+ }
39
+ function bytesToBase64(bytes) {
40
+ const binString = Array.from(bytes, x => String.fromCodePoint(x)).join("");
41
+ return btoa(binString);
42
+ }
43
+ const encodeBase64 = string => {
44
+ if (typeof Buffer === "function") {
45
+ return Buffer.from(string).toString("base64");
46
+ }
47
+ return bytesToBase64(new TextEncoder().encode(string));
48
+ };
49
+ exports.encodeBase64 = encodeBase64;
50
+ const decodeBase64 = string => {
51
+ if (typeof Buffer === "function") {
52
+ return Buffer.from(string, "base64").toString("utf-8");
53
+ }
54
+ return new TextDecoder().decode(base64ToBytes(string));
55
+ };
56
+ exports.decodeBase64 = decodeBase64;
57
+ const verifyToken = async (token, secret) => {
58
+ const [encodedPayload, signature] = token.split(".", 2);
59
+ const expectedSignature = encodeBase64(await hmac(encodedPayload, secret));
60
+ if (expectedSignature === signature) {
61
+ return decodeBase64(encodedPayload);
62
+ }
63
+ };
64
+ exports.verifyToken = verifyToken;
65
+ const buildHashPayload = payload => encodeBase64(JSON.stringify(payload));
66
+ exports.buildHashPayload = buildHashPayload;
67
+ const buildSignature = async (payloadHash, secret) => encodeBase64(await hmac(payloadHash, secret));
68
+ exports.buildSignature = buildSignature;
@@ -0,0 +1,8 @@
1
+ export declare const md5: (value: string) => Promise<any>;
2
+ export declare const sha256: (value: string) => Promise<string>;
3
+ export declare const hmac: (value: string, secret: string, algorithm?: string) => Promise<string>;
4
+ export declare const encodeBase64: (string: string) => string;
5
+ export declare const decodeBase64: (string: string) => string;
6
+ export declare const verifyToken: (token: string, secret: string) => Promise<string | undefined>;
7
+ export declare const buildHashPayload: (payload: unknown) => string;
8
+ export declare const buildSignature: (payloadHash: string, secret: string) => Promise<string>;