@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.
- package/CHANGELOG.md +16 -0
- package/dist/rpc/methods/checkout/checkout.mjs +1 -1
- package/dist/rpc/methods/search.d.ts +22 -0
- package/package.json +9 -19
- package/dist/api/customer.cjs +0 -164
- package/dist/api/oauth.cjs +0 -238
- package/dist/cache/cache.cjs +0 -1
- package/dist/cache/cached.cjs +0 -90
- package/dist/cache/index.cjs +0 -27
- package/dist/cache/providers/unstorage.cjs +0 -55
- package/dist/constants/basket.cjs +0 -26
- package/dist/constants/cache.cjs +0 -7
- package/dist/constants/hash.cjs +0 -11
- package/dist/constants/httpStatus.cjs +0 -634
- package/dist/constants/index.cjs +0 -93
- package/dist/constants/product.cjs +0 -10
- package/dist/constants/promotion.cjs +0 -12
- package/dist/constants/sorting.cjs +0 -22
- package/dist/constants/withParameters.cjs +0 -132
- package/dist/errors/errorResponse.cjs +0 -27
- package/dist/errors/index.cjs +0 -16
- package/dist/helpers/advancedAttributeHelpers.cjs +0 -30
- package/dist/helpers/arrayHelpers.cjs +0 -10
- package/dist/helpers/attributeHelpers.cjs +0 -24
- package/dist/helpers/basketHelpers.cjs +0 -12
- package/dist/helpers/categoryHelper.cjs +0 -61
- package/dist/helpers/filterHelper.cjs +0 -185
- package/dist/helpers/formHelpers.cjs +0 -114
- package/dist/helpers/imageHelpers.cjs +0 -20
- package/dist/helpers/index.cjs +0 -181
- package/dist/helpers/localization.cjs +0 -13
- package/dist/helpers/objectHelpers.cjs +0 -19
- package/dist/helpers/orderHelpers.cjs +0 -10
- package/dist/helpers/product.fixture.cjs +0 -766
- package/dist/helpers/productDisruptorHelper.cjs +0 -37
- package/dist/helpers/productHelpers.cjs +0 -156
- package/dist/helpers/sanitizationHelpers.cjs +0 -35
- package/dist/helpers/sortingHelper.cjs +0 -68
- package/dist/helpers/stringHelpers.cjs +0 -8
- package/dist/index.cjs +0 -100
- package/dist/rpc/methods/basket/basket.cjs +0 -270
- package/dist/rpc/methods/brands.cjs +0 -33
- package/dist/rpc/methods/categories.cjs +0 -129
- package/dist/rpc/methods/cbd.cjs +0 -38
- package/dist/rpc/methods/checkout/checkout.cjs +0 -48
- package/dist/rpc/methods/checkout/index.cjs +0 -49
- package/dist/rpc/methods/checkout/order.cjs +0 -42
- package/dist/rpc/methods/checkout/shopUser.cjs +0 -110
- package/dist/rpc/methods/checkout/shopUserAddresses.cjs +0 -12
- package/dist/rpc/methods/index.cjs +0 -225
- package/dist/rpc/methods/navigationTrees.cjs +0 -54
- package/dist/rpc/methods/oauth/idp.cjs +0 -59
- package/dist/rpc/methods/products.cjs +0 -309
- package/dist/rpc/methods/promotion.cjs +0 -51
- package/dist/rpc/methods/search.cjs +0 -40
- package/dist/rpc/methods/session.cjs +0 -257
- package/dist/rpc/methods/shopConfiguration.cjs +0 -15
- package/dist/rpc/methods/user.cjs +0 -103
- package/dist/rpc/methods/variants.cjs +0 -29
- package/dist/rpc/methods/wishlist.cjs +0 -104
- package/dist/server.cjs +0 -47
- package/dist/test/factories/index.cjs +0 -16
- package/dist/types/api/auth.cjs +0 -1
- package/dist/types/api/context.cjs +0 -15
- package/dist/types/api/rpc.cjs +0 -1
- package/dist/types/breadcrumb.cjs +0 -1
- package/dist/types/index.cjs +0 -267
- package/dist/types/promises.cjs +0 -1
- package/dist/types/sapi/basket.cjs +0 -1
- package/dist/types/sapi/brand.cjs +0 -1
- package/dist/types/sapi/campaign.cjs +0 -1
- package/dist/types/sapi/category.cjs +0 -1
- package/dist/types/sapi/filter.cjs +0 -1
- package/dist/types/sapi/navigation.cjs +0 -1
- package/dist/types/sapi/order.cjs +0 -1
- package/dist/types/sapi/product.cjs +0 -1
- package/dist/types/sapi/productFilter.cjs +0 -1
- package/dist/types/sapi/promotion.cjs +0 -1
- package/dist/types/sapi/redirects.cjs +0 -1
- package/dist/types/sapi/router.cjs +0 -1
- package/dist/types/sapi/search.cjs +0 -1
- package/dist/types/sapi/sorting.cjs +0 -1
- package/dist/types/sapi/variant.cjs +0 -1
- package/dist/types/sapi/wishlist.cjs +0 -1
- package/dist/types/user.cjs +0 -1
- package/dist/utils/basket.cjs +0 -14
- package/dist/utils/fetch.cjs +0 -19
- package/dist/utils/hash.cjs +0 -72
- package/dist/utils/index.cjs +0 -49
- package/dist/utils/keys.cjs +0 -67
- package/dist/utils/log.cjs +0 -93
- package/dist/utils/response.cjs +0 -13
- package/dist/utils/sapi.cjs +0 -26
- package/dist/utils/timeout.cjs +0 -18
- 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
|
-
};
|
package/dist/constants/cache.cjs
DELETED
package/dist/constants/hash.cjs
DELETED