@scayle/storefront-core 8.4.0 → 8.5.0

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 (95) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/rpc/methods/checkout/checkout.mjs +1 -1
  3. package/dist/rpc/methods/search.d.ts +22 -0
  4. package/package.json +9 -19
  5. package/dist/api/customer.cjs +0 -164
  6. package/dist/api/oauth.cjs +0 -238
  7. package/dist/cache/cache.cjs +0 -1
  8. package/dist/cache/cached.cjs +0 -90
  9. package/dist/cache/index.cjs +0 -27
  10. package/dist/cache/providers/unstorage.cjs +0 -55
  11. package/dist/constants/basket.cjs +0 -26
  12. package/dist/constants/cache.cjs +0 -7
  13. package/dist/constants/hash.cjs +0 -11
  14. package/dist/constants/httpStatus.cjs +0 -634
  15. package/dist/constants/index.cjs +0 -93
  16. package/dist/constants/product.cjs +0 -10
  17. package/dist/constants/promotion.cjs +0 -12
  18. package/dist/constants/sorting.cjs +0 -22
  19. package/dist/constants/withParameters.cjs +0 -132
  20. package/dist/errors/errorResponse.cjs +0 -27
  21. package/dist/errors/index.cjs +0 -16
  22. package/dist/helpers/advancedAttributeHelpers.cjs +0 -30
  23. package/dist/helpers/arrayHelpers.cjs +0 -10
  24. package/dist/helpers/attributeHelpers.cjs +0 -24
  25. package/dist/helpers/basketHelpers.cjs +0 -12
  26. package/dist/helpers/categoryHelper.cjs +0 -61
  27. package/dist/helpers/filterHelper.cjs +0 -185
  28. package/dist/helpers/formHelpers.cjs +0 -114
  29. package/dist/helpers/imageHelpers.cjs +0 -20
  30. package/dist/helpers/index.cjs +0 -181
  31. package/dist/helpers/localization.cjs +0 -13
  32. package/dist/helpers/objectHelpers.cjs +0 -19
  33. package/dist/helpers/orderHelpers.cjs +0 -10
  34. package/dist/helpers/product.fixture.cjs +0 -766
  35. package/dist/helpers/productDisruptorHelper.cjs +0 -37
  36. package/dist/helpers/productHelpers.cjs +0 -156
  37. package/dist/helpers/sanitizationHelpers.cjs +0 -35
  38. package/dist/helpers/sortingHelper.cjs +0 -68
  39. package/dist/helpers/stringHelpers.cjs +0 -8
  40. package/dist/index.cjs +0 -100
  41. package/dist/rpc/methods/basket/basket.cjs +0 -270
  42. package/dist/rpc/methods/brands.cjs +0 -33
  43. package/dist/rpc/methods/categories.cjs +0 -129
  44. package/dist/rpc/methods/cbd.cjs +0 -38
  45. package/dist/rpc/methods/checkout/checkout.cjs +0 -48
  46. package/dist/rpc/methods/checkout/index.cjs +0 -49
  47. package/dist/rpc/methods/checkout/order.cjs +0 -42
  48. package/dist/rpc/methods/checkout/shopUser.cjs +0 -110
  49. package/dist/rpc/methods/checkout/shopUserAddresses.cjs +0 -12
  50. package/dist/rpc/methods/index.cjs +0 -225
  51. package/dist/rpc/methods/navigationTrees.cjs +0 -54
  52. package/dist/rpc/methods/oauth/idp.cjs +0 -59
  53. package/dist/rpc/methods/products.cjs +0 -309
  54. package/dist/rpc/methods/promotion.cjs +0 -51
  55. package/dist/rpc/methods/search.cjs +0 -40
  56. package/dist/rpc/methods/session.cjs +0 -257
  57. package/dist/rpc/methods/shopConfiguration.cjs +0 -15
  58. package/dist/rpc/methods/user.cjs +0 -103
  59. package/dist/rpc/methods/variants.cjs +0 -29
  60. package/dist/rpc/methods/wishlist.cjs +0 -104
  61. package/dist/server.cjs +0 -47
  62. package/dist/test/factories/index.cjs +0 -16
  63. package/dist/types/api/auth.cjs +0 -1
  64. package/dist/types/api/context.cjs +0 -15
  65. package/dist/types/api/rpc.cjs +0 -1
  66. package/dist/types/breadcrumb.cjs +0 -1
  67. package/dist/types/index.cjs +0 -267
  68. package/dist/types/promises.cjs +0 -1
  69. package/dist/types/sapi/basket.cjs +0 -1
  70. package/dist/types/sapi/brand.cjs +0 -1
  71. package/dist/types/sapi/campaign.cjs +0 -1
  72. package/dist/types/sapi/category.cjs +0 -1
  73. package/dist/types/sapi/filter.cjs +0 -1
  74. package/dist/types/sapi/navigation.cjs +0 -1
  75. package/dist/types/sapi/order.cjs +0 -1
  76. package/dist/types/sapi/product.cjs +0 -1
  77. package/dist/types/sapi/productFilter.cjs +0 -1
  78. package/dist/types/sapi/promotion.cjs +0 -1
  79. package/dist/types/sapi/redirects.cjs +0 -1
  80. package/dist/types/sapi/router.cjs +0 -1
  81. package/dist/types/sapi/search.cjs +0 -1
  82. package/dist/types/sapi/sorting.cjs +0 -1
  83. package/dist/types/sapi/variant.cjs +0 -1
  84. package/dist/types/sapi/wishlist.cjs +0 -1
  85. package/dist/types/user.cjs +0 -1
  86. package/dist/utils/basket.cjs +0 -14
  87. package/dist/utils/fetch.cjs +0 -19
  88. package/dist/utils/hash.cjs +0 -72
  89. package/dist/utils/index.cjs +0 -49
  90. package/dist/utils/keys.cjs +0 -67
  91. package/dist/utils/log.cjs +0 -93
  92. package/dist/utils/response.cjs +0 -13
  93. package/dist/utils/sapi.cjs +0 -26
  94. package/dist/utils/timeout.cjs +0 -18
  95. package/dist/utils/user.cjs +0 -90
@@ -1,55 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.UnstorageCache = void 0;
7
- class UnstorageCache {
8
- storage;
9
- prefix;
10
- constructor(storage, prefix = "") {
11
- this.storage = storage;
12
- this.prefix = prefix;
13
- }
14
- async get(key) {
15
- const value = await this.storage.getItem(this.getKey(key));
16
- if (value === null) {
17
- return null;
18
- }
19
- return value;
20
- }
21
- async has(key) {
22
- return await this.storage.hasItem(this.getKey(key));
23
- }
24
- async purgeTags(tags) {
25
- await Promise.all(tags.map(tag => this.purgeTag(tag)));
26
- }
27
- async purgeTag(tag) {
28
- const keys = await this.storage.getItem(this.getKey(`tag:${tag}`));
29
- await this.purgeKeys(keys ?? []);
30
- await this.storage.removeItem(this.getKey(`tag:${tag}`));
31
- }
32
- async purgeKeys(keys) {
33
- await Promise.all(keys.map(k => this.storage.removeItem(k)));
34
- }
35
- async purgeAll() {
36
- const keys = await this.storage.getKeys(this.prefix);
37
- await Promise.all(keys.map(k => this.storage.removeItem(k)));
38
- }
39
- async set(key, value, ttl, tags = []) {
40
- await this.storage.setItem(this.getKey(key), value, {
41
- ttl
42
- });
43
- await Promise.all(tags.map(tag => this.addKeyToTag(tag, this.getKey(key))));
44
- }
45
- async addKeyToTag(tag, key) {
46
- const keys = await this.storage.getItem(tag);
47
- const set = new Set(keys ?? []);
48
- set.add(key);
49
- await this.storage.setItem(this.getKey(`tag:${tag}`), Array.from(set));
50
- }
51
- getKey(key) {
52
- return [this.prefix, key].join(":");
53
- }
54
- }
55
- exports.UnstorageCache = UnstorageCache;
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.UpdateBasketItemFailureKind = exports.ExistingItemHandling = exports.AddToBasketFailureKind = void 0;
7
- const ExistingItemHandling = exports.ExistingItemHandling = {
8
- KeepExisting: 0,
9
- AddQuantityToExisting: 1,
10
- ReplaceExisting: 2,
11
- ReplaceExistingWithCombinedQuantity: 3
12
- };
13
- const AddToBasketFailureKind = exports.AddToBasketFailureKind = {
14
- VariantAlreadyPresent: "VariantAlreadyPresent",
15
- ItemUnvailable: "ItemUnvailable",
16
- MaximumItemCountReached: "MaximumItemCountReached",
17
- ItemDataNotFound: "ItemDataNotFound",
18
- ItemAddedWithReducedQuantity: "ItemAddedWithReducedQuantity",
19
- Unknown: "Unknown"
20
- };
21
- const UpdateBasketItemFailureKind = exports.UpdateBasketItemFailureKind = {
22
- ItemUnvailable: "ItemUnvailable",
23
- BasketItemNotFound: "BasketItemNotFound",
24
- ItemAddedWithReducedQuantity: "ItemAddedWithReducedQuantity",
25
- Unknown: "Unknown"
26
- };
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.CACHE_TIMEOUT = void 0;
7
- const CACHE_TIMEOUT = exports.CACHE_TIMEOUT = 500;
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.HashAlgorithm = void 0;
7
- const HashAlgorithm = exports.HashAlgorithm = {
8
- MD5: "md5",
9
- SHA256: "sha256",
10
- NONE: "none"
11
- };