@lana-commerce/core 14.0.0-alpha.2 → 14.0.0-alpha.20
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 +10 -0
- package/cjs/addEmptyListItem.js +1 -2
- package/cjs/aggregateOptions.js +5 -6
- package/cjs/analytics.js +12 -13
- package/cjs/analyticsProductData.js +2 -3
- package/cjs/arrayToDict.js +1 -2
- package/cjs/asyncModuleWrapper.js +2 -3
- package/cjs/averageReviewScore.js +1 -2
- package/cjs/cartOperation.js +6 -7
- package/cjs/categorySEO.js +1 -2
- package/cjs/compact.js +1 -2
- package/cjs/configLoader.js +4 -5
- package/cjs/convertImageURL.js +1 -2
- package/cjs/dataLoader.js +5 -8
- package/cjs/defaultVariant.js +1 -2
- package/cjs/effector/clearOnChangeAfterDelay.js +1 -2
- package/cjs/effector/combineEvery.js +1 -2
- package/cjs/effector/combineSome.js +1 -2
- package/cjs/effector/debounced.js +1 -2
- package/cjs/effector/form.js +5 -6
- package/cjs/effector/hideOnChangeAfterDelay.js +1 -2
- package/cjs/effector/requestResponse.js +3 -4
- package/cjs/effector/requestResponseMulti.js +1 -2
- package/cjs/effector/restoreNamed.js +1 -2
- package/cjs/effector/split.js +1 -2
- package/cjs/effector/validator.js +3 -3
- package/cjs/effector/wrapSignInRequired.js +1 -2
- package/cjs/fetchAllItems.js +5 -6
- package/cjs/file.js +2 -3
- package/cjs/fileWebsocket.js +1 -2
- package/cjs/filterFunc.js +2 -3
- package/cjs/filterFuncPreprocess.js +2 -3
- package/cjs/formatAbbrevNumber.js +1 -2
- package/cjs/formatCurrency.js +2 -2
- package/cjs/formatToJSX.js +3 -51
- package/cjs/fulfillmentNumber.js +1 -2
- package/cjs/generateRandomToken.js +1 -2
- package/cjs/generateUUID.js +1 -2
- package/cjs/generated/codes.js +1 -1
- package/cjs/genericFile.js +2 -3
- package/cjs/getSalesChannelID.js +1 -2
- package/cjs/getSessionID.js +1 -2
- package/cjs/getTimezone.js +1 -2
- package/cjs/graphql/fragments/CommonCartVariant.js +1 -1
- package/cjs/graphql/fragments/CurrencyPrice.js +1 -1
- package/cjs/graphql/fragments/ProductReviewsSummary.js +3 -0
- package/cjs/graphql/operations/LoadProductNoCustomerQuery.js +3 -1
- package/cjs/graphql/operations/LoadProductQuery.js +3 -1
- package/cjs/hierarchicalSearchOption.js +1 -2
- package/cjs/idgen.js +1 -2
- package/cjs/ignoreQueue.js +1 -2
- package/cjs/imageAltProps.js +1 -2
- package/cjs/invoiceFormat.js +2 -3
- package/cjs/isShippingRequired.js +1 -2
- package/cjs/isoStripTrailingZeros.js +1 -2
- package/cjs/json/common.js +6 -7
- package/cjs/json/fetchAllItems.js +2 -3
- package/cjs/json/mutator.js +19 -15
- package/cjs/lastValue.js +1 -2
- package/cjs/lineItemPrice.js +35 -55
- package/cjs/loadJWT.js +1 -2
- package/cjs/mapInvalidInput.js +2 -3
- package/cjs/mapResponseData.js +2 -3
- package/cjs/mapResponseMultiData.js +1 -2
- package/cjs/meanBy.js +1 -2
- package/cjs/media.js +2 -2
- package/cjs/modules/advancedSearch.js +5 -5
- package/cjs/modules/cart.js +6 -7
- package/cjs/modules/customer.js +17 -14
- package/cjs/modules/helpers/cartInitOption.js +1 -2
- package/cjs/modules/helpers/cookieConsent.js +1 -2
- package/cjs/modules/helpers/customerOauth2.js +4 -4
- package/cjs/modules/helpers/getOAuth2Hook.js +1 -2
- package/cjs/modules/helpers/hookUpAnalytics.js +1 -2
- package/cjs/modules/helpers/loadJWT.js +1 -2
- package/cjs/modules/helpers/misc.js +4 -5
- package/cjs/modules/imageDialog.js +4 -5
- package/cjs/modules/persist.js +3 -4
- package/cjs/modules/popupMessage.js +1 -2
- package/cjs/modules/product.js +13 -8
- package/cjs/modules/recentlyVisitedProducts.js +2 -3
- package/cjs/modules/search.js +2 -3
- package/cjs/multiResponseToResponse.js +1 -2
- package/cjs/nonNull.js +1 -2
- package/cjs/oauthState.js +2 -3
- package/cjs/orderShippingAddress.js +1 -2
- package/cjs/parseFormat.js +51 -0
- package/cjs/pender.js +1 -2
- package/cjs/percentageOff.js +1 -2
- package/cjs/popupConnectQueue.js +4 -4
- package/cjs/preact/components/SixDigitInput.js +7 -3
- package/cjs/preact/effector.js +2 -3
- package/cjs/preact/transition/CSSTransition.js +0 -1
- package/cjs/preact/translateLocalStatic.js +2 -7
- package/cjs/productFiltering.js +7 -8
- package/cjs/productSEO.js +1 -2
- package/cjs/productSorting.js +3 -3
- package/cjs/promiseAll.js +1 -2
- package/cjs/rdsToInitialScores.js +1 -2
- package/cjs/react/components/SixDigitInput.js +7 -3
- package/cjs/react/contains.js +1 -2
- package/cjs/react/translateLocalStatic.js +1 -2
- package/cjs/react/useAsyncCachedValue.js +1 -2
- package/cjs/refreshTimeout.js +1 -2
- package/cjs/remoteAuth.js +3 -4
- package/cjs/request.js +13 -13
- package/cjs/requestDetails.js +4 -5
- package/cjs/rfc3339Normalize.js +1 -2
- package/cjs/script.js +3 -4
- package/cjs/shopDomain.js +1 -2
- package/cjs/shopLinks.js +14 -15
- package/cjs/slate.js +87 -115
- package/cjs/sleep.js +1 -2
- package/cjs/splitBy.js +1 -2
- package/cjs/splitName.js +2 -3
- package/cjs/stripZeros.js +1 -2
- package/cjs/stripeError.js +8 -9
- package/cjs/tailSplit.js +1 -2
- package/cjs/tieredPrice.js +1 -2
- package/cjs/timeIt.js +1 -2
- package/cjs/toMajor.js +1 -2
- package/cjs/toMinor.js +1 -2
- package/cjs/trace.js +4 -4
- package/cjs/translateLocale.js +2 -3
- package/cjs/traverse.js +1 -2
- package/cjs/truncate.js +1 -2
- package/cjs/typedLocalStorage.js +2 -3
- package/cjs/variantImage.js +1 -2
- package/cjs/variantImageURL.js +1 -2
- package/cjs/variantImages.js +1 -2
- package/cjs/variantInventory.js +1 -2
- package/cjs/variantOptions.js +3 -4
- package/cjs/variantPrice.js +66 -34
- package/cjs/variantPriceCommerce.js +24 -22
- package/cjs/variantTitle.js +1 -2
- package/cjs/variantTitleFull.js +1 -2
- package/cjs/variantURL.js +1 -2
- package/cjs/websocket.js +5 -5
- package/esm/analyticsProductData.js +1 -1
- package/esm/cartOperation.js +4 -4
- package/esm/dataLoader.js +3 -5
- package/esm/fetchAllItems.js +1 -1
- package/esm/file.js +1 -1
- package/esm/formatToJSX.js +1 -48
- package/esm/generated/codes.js +1 -1
- package/esm/graphql/fragments/CommonCartVariant.js +1 -1
- package/esm/graphql/fragments/CurrencyPrice.js +1 -1
- package/esm/graphql/fragments/ProductReviewsSummary.js +1 -0
- package/esm/graphql/operations/LoadProductNoCustomerQuery.js +3 -1
- package/esm/graphql/operations/LoadProductQuery.js +3 -1
- package/esm/json/commerce.js +1 -1
- package/esm/json/common.js +1 -1
- package/esm/json/mutator.js +6 -3
- package/esm/json/storefront.js +1 -1
- package/esm/lineItemPrice.js +33 -52
- package/esm/modules/advancedSearch.js +2 -2
- package/esm/modules/cart.js +3 -3
- package/esm/modules/customer.js +12 -8
- package/esm/modules/product.js +9 -3
- package/esm/modules/recentlyVisitedProducts.js +1 -1
- package/esm/modules/search.js +2 -2
- package/esm/parseFormat.js +48 -0
- package/esm/preact/components/SixDigitInput.js +7 -3
- package/esm/preact/transition/CSSTransition.js +0 -1
- package/esm/preact/translateLocalStatic.js +1 -5
- package/esm/productFiltering.js +1 -1
- package/esm/productSorting.js +1 -1
- package/esm/react/components/SixDigitInput.js +7 -3
- package/esm/request.js +2 -2
- package/esm/slate.js +79 -106
- package/esm/variantPrice.js +65 -32
- package/esm/variantPriceCommerce.js +25 -19
- package/package.json +11 -11
- package/types/analyticsProductData.d.ts +1 -1
- package/types/dataLoader.d.ts +16 -9
- package/types/effector/clearOnChangeAfterDelay.d.ts +1 -1
- package/types/effector/combineEvery.d.ts +1 -1
- package/types/effector/combineSome.d.ts +1 -1
- package/types/effector/debounced.d.ts +1 -1
- package/types/effector/form.d.ts +2 -2
- package/types/effector/hideOnChangeAfterDelay.d.ts +1 -1
- package/types/effector/requestResponse.d.ts +1 -1
- package/types/effector/requestResponseMulti.d.ts +2 -2
- package/types/effector/restoreNamed.d.ts +1 -1
- package/types/effector/split.d.ts +1 -1
- package/types/effector/validator.d.ts +1 -1
- package/types/effector/wrapSignInRequired.d.ts +1 -1
- package/types/fetchAllItems.d.ts +1 -1
- package/types/file.d.ts +2 -2
- package/types/formatToJSX.d.ts +0 -10
- package/types/generated/codes.d.ts +3 -3
- package/types/graphql/fragments/CommonCartVariant.d.ts +1 -1
- package/types/graphql/fragments/CurrencyPrice.d.ts +1 -1
- package/types/graphql/fragments/ProductReviewsSummary.d.ts +2 -0
- package/types/graphql/types.d.ts +14 -6
- package/types/json/commerce.d.ts +2 -1
- package/types/json/commerceFileUpload.d.ts +1 -1
- package/types/json/commerceTypes.d.ts +503 -142
- package/types/json/fetchAllItems.d.ts +1 -1
- package/types/json/mutator.d.ts +7 -3
- package/types/json/storefront.d.ts +2 -1
- package/types/json/storefrontTypes.d.ts +37 -12
- package/types/lineItemPrice.d.ts +1 -2
- package/types/mapInvalidInput.d.ts +1 -1
- package/types/modules/advancedSearch.d.ts +3 -3
- package/types/modules/cart.d.ts +2 -2
- package/types/modules/customer.d.ts +8 -6
- package/types/modules/helpers/customerOauth2.d.ts +1 -1
- package/types/modules/helpers/hookUpAnalytics.d.ts +1 -1
- package/types/modules/popupMessage.d.ts +1 -1
- package/types/modules/product.d.ts +7 -4
- package/types/modules/recentlyVisitedProducts.d.ts +1 -1
- package/types/modules/search.d.ts +2 -2
- package/types/multiResponseToResponse.d.ts +1 -1
- package/types/parseFormat.d.ts +9 -0
- package/types/preact/components/SixDigitInput.d.ts +1 -0
- package/types/preact/effector.d.ts +1 -1
- package/types/preact/transition/CSSTransition.d.ts +3 -2
- package/types/preact/transition/Transition.d.ts +0 -1
- package/types/preact/translateLocalStatic.d.ts +1 -2
- package/types/productFiltering.d.ts +2 -2
- package/types/productSEO.d.ts +2 -4
- package/types/productSorting.d.ts +1 -1
- package/types/react/components/SixDigitInput.d.ts +2 -1
- package/types/react/popperBinder.d.ts +2 -1
- package/types/react/translateLocalStatic.d.ts +1 -2
- package/types/request.d.ts +3 -2
- package/types/shopLinks.d.ts +1 -1
- package/types/slate.d.ts +105 -31
- package/types/variantImageURL.d.ts +1 -1
- package/types/variantPrice.d.ts +16 -5
- package/types/variantPriceCommerce.d.ts +7 -12
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,9 @@ This project adheres to [Semantic Versioning][semantic versioning].
|
|
|
9
9
|
### Major Changes
|
|
10
10
|
|
|
11
11
|
- OAuth APIs of "customer" module were changed in backwards incompatible way. To delete oauth provider you need to specify its type. This is due to the fact that you can connect multiple providers now.
|
|
12
|
+
- Do not export "parseFormat" from "formatToJSX".
|
|
13
|
+
- Use new data format for "slate" module. Bringing "slate" lib based editor up to date with upstream.
|
|
14
|
+
- New variant pricing model using pricing rules.
|
|
12
15
|
|
|
13
16
|
### Minor Changes
|
|
14
17
|
|
|
@@ -20,6 +23,9 @@ This project adheres to [Semantic Versioning][semantic versioning].
|
|
|
20
23
|
- Add "webauthn" logic to "customer" module.
|
|
21
24
|
- Add webauthn related fields to customer/shop fragments.
|
|
22
25
|
- "Customer" module: now all signin forms share the custom error type. When custom error happens, it is set on all forms.
|
|
26
|
+
- Add "jobs" option to Mutator. Limits the number of simultaneously running jobs.
|
|
27
|
+
- Add "reviewsSummary" to "product" module.
|
|
28
|
+
- Add "wrapperClassName" to react/preact SixDigitInput component. Using this class wraps individual input DOM nodes with div nodes.
|
|
23
29
|
|
|
24
30
|
### Patch Changes
|
|
25
31
|
|
|
@@ -28,6 +34,10 @@ This project adheres to [Semantic Versioning][semantic versioning].
|
|
|
28
34
|
- Fix broken ESM import paths in "json/commerce" and "json/storefront".
|
|
29
35
|
- Do not discard unhandled messages in "websocket" lib.
|
|
30
36
|
- Fix awaiters being dispatched before promise registeration in "websocket" lib.
|
|
37
|
+
- Use `"verbatimModuleSyntax": true` when compiling ESM version of the package.
|
|
38
|
+
- Increase verbosity on pretty printed error text in "json" client (sendUnwrap() method).
|
|
39
|
+
- Add LICENSE file to the repo.
|
|
40
|
+
- Add more methods to mutator.
|
|
31
41
|
|
|
32
42
|
## [Released]
|
|
33
43
|
|
package/cjs/addEmptyListItem.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addEmptyListItem =
|
|
3
|
+
exports.addEmptyListItem = addEmptyListItem;
|
|
4
4
|
function addEmptyListItem(list) {
|
|
5
5
|
return [{ value: "", label: "" }, ...list];
|
|
6
6
|
}
|
|
7
|
-
exports.addEmptyListItem = addEmptyListItem;
|
package/cjs/aggregateOptions.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.matchVariant = matchVariant;
|
|
4
|
+
exports.closestVariantIDs = closestVariantIDs;
|
|
5
|
+
exports.restrictSelected = restrictSelected;
|
|
6
|
+
exports.selectVariantID = selectVariantID;
|
|
7
|
+
exports.aggregateOptions = aggregateOptions;
|
|
4
8
|
function buildEnabledValues(perOptionValues) {
|
|
5
9
|
const out = {};
|
|
6
10
|
const keys = Object.keys(perOptionValues);
|
|
@@ -82,7 +86,6 @@ function matchVariant(variants, selected) {
|
|
|
82
86
|
}
|
|
83
87
|
return undefined;
|
|
84
88
|
}
|
|
85
|
-
exports.matchVariant = matchVariant;
|
|
86
89
|
function closestVariantIDs(opts, selected) {
|
|
87
90
|
const keys = Object.keys(selected);
|
|
88
91
|
const variants = [];
|
|
@@ -108,7 +111,6 @@ function closestVariantIDs(opts, selected) {
|
|
|
108
111
|
});
|
|
109
112
|
return variants.map((v) => v.variantID);
|
|
110
113
|
}
|
|
111
|
-
exports.closestVariantIDs = closestVariantIDs;
|
|
112
114
|
function restrictValues(opts, key, value) {
|
|
113
115
|
return buildPerOptionValues(opts.uniqueOptionIDs, opts.sets, (set) => value
|
|
114
116
|
? !!set.options.find((opt) => opt.key === key && opt.value === value)
|
|
@@ -135,7 +137,6 @@ function restrictSelected(opts, selected, key, val) {
|
|
|
135
137
|
variantID: matchVariantID(opts, newSelected),
|
|
136
138
|
};
|
|
137
139
|
}
|
|
138
|
-
exports.restrictSelected = restrictSelected;
|
|
139
140
|
function selectVariantID(opts, variantID) {
|
|
140
141
|
const set = opts.sets.find((set) => set.variantID === variantID);
|
|
141
142
|
if (!set)
|
|
@@ -154,7 +155,6 @@ function selectVariantID(opts, variantID) {
|
|
|
154
155
|
variantID,
|
|
155
156
|
};
|
|
156
157
|
}
|
|
157
|
-
exports.selectVariantID = selectVariantID;
|
|
158
158
|
function aggregateOptions(variants) {
|
|
159
159
|
const allOptIDs = {};
|
|
160
160
|
for (const v of variants) {
|
|
@@ -175,4 +175,3 @@ function aggregateOptions(variants) {
|
|
|
175
175
|
enabledValues: buildEnabledValues(perOptionValues),
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
-
exports.aggregateOptions = aggregateOptions;
|
package/cjs/analytics.js
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// type safe wrapper for calling analytics.js
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.identify = identify;
|
|
5
|
+
exports.promotionClicked = promotionClicked;
|
|
6
|
+
exports.productClicked = productClicked;
|
|
7
|
+
exports.productsSearched = productsSearched;
|
|
8
|
+
exports.cartViewed = cartViewed;
|
|
9
|
+
exports.productListViewed = productListViewed;
|
|
10
|
+
exports.productViewed = productViewed;
|
|
11
|
+
exports.wishlistAdded = wishlistAdded;
|
|
12
|
+
exports.wishlistRemoved = wishlistRemoved;
|
|
13
|
+
exports.productAdded = productAdded;
|
|
14
|
+
exports.productRemoved = productRemoved;
|
|
15
|
+
exports.page = page;
|
|
5
16
|
function analyticsDo(cb) {
|
|
6
17
|
if (typeof document !== "undefined") {
|
|
7
18
|
const a = window.analytics;
|
|
@@ -14,25 +25,21 @@ function identify(id) {
|
|
|
14
25
|
a.identify(id);
|
|
15
26
|
});
|
|
16
27
|
}
|
|
17
|
-
exports.identify = identify;
|
|
18
28
|
function promotionClicked(promotion) {
|
|
19
29
|
analyticsDo((a) => {
|
|
20
30
|
a.track("Promotion Clicked", promotion);
|
|
21
31
|
});
|
|
22
32
|
}
|
|
23
|
-
exports.promotionClicked = promotionClicked;
|
|
24
33
|
function productClicked(product) {
|
|
25
34
|
analyticsDo((a) => {
|
|
26
35
|
a.track("Product Clicked", product);
|
|
27
36
|
});
|
|
28
37
|
}
|
|
29
|
-
exports.productClicked = productClicked;
|
|
30
38
|
function productsSearched(query) {
|
|
31
39
|
analyticsDo((a) => {
|
|
32
40
|
a.track("Products Searched", { query });
|
|
33
41
|
});
|
|
34
42
|
}
|
|
35
|
-
exports.productsSearched = productsSearched;
|
|
36
43
|
function cartViewed(orderID, products) {
|
|
37
44
|
analyticsDo((a) => {
|
|
38
45
|
a.track("Cart Viewed", {
|
|
@@ -41,7 +48,6 @@ function cartViewed(orderID, products) {
|
|
|
41
48
|
});
|
|
42
49
|
});
|
|
43
50
|
}
|
|
44
|
-
exports.cartViewed = cartViewed;
|
|
45
51
|
function productListViewed(categoryID, categoryName, products) {
|
|
46
52
|
analyticsDo((a) => {
|
|
47
53
|
a.track("Product List Viewed", {
|
|
@@ -51,40 +57,33 @@ function productListViewed(categoryID, categoryName, products) {
|
|
|
51
57
|
});
|
|
52
58
|
});
|
|
53
59
|
}
|
|
54
|
-
exports.productListViewed = productListViewed;
|
|
55
60
|
function productViewed(product) {
|
|
56
61
|
analyticsDo((a) => {
|
|
57
62
|
a.track("Product Viewed", product);
|
|
58
63
|
});
|
|
59
64
|
}
|
|
60
|
-
exports.productViewed = productViewed;
|
|
61
65
|
function wishlistAdded(product) {
|
|
62
66
|
analyticsDo((a) => {
|
|
63
67
|
a.track("Product Added to Wishlist", Object.assign({}, product));
|
|
64
68
|
});
|
|
65
69
|
}
|
|
66
|
-
exports.wishlistAdded = wishlistAdded;
|
|
67
70
|
function wishlistRemoved(product) {
|
|
68
71
|
analyticsDo((a) => {
|
|
69
72
|
a.track("Product Removed from Wishlist", Object.assign({}, product));
|
|
70
73
|
});
|
|
71
74
|
}
|
|
72
|
-
exports.wishlistRemoved = wishlistRemoved;
|
|
73
75
|
function productAdded(orderID, quantity, product) {
|
|
74
76
|
analyticsDo((a) => {
|
|
75
77
|
a.track("Product Added", Object.assign(Object.assign({}, product), { cart_id: orderID, quantity }));
|
|
76
78
|
});
|
|
77
79
|
}
|
|
78
|
-
exports.productAdded = productAdded;
|
|
79
80
|
function productRemoved(orderID, quantity, product) {
|
|
80
81
|
analyticsDo((a) => {
|
|
81
82
|
a.track("Product Removed", Object.assign(Object.assign({}, product), { cart_id: orderID, quantity }));
|
|
82
83
|
});
|
|
83
84
|
}
|
|
84
|
-
exports.productRemoved = productRemoved;
|
|
85
85
|
function page() {
|
|
86
86
|
analyticsDo((a) => {
|
|
87
87
|
a.page();
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
-
exports.page = page;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.analyticsProductData =
|
|
4
|
-
const variantPrice_js_1 = require("./variantPrice.js");
|
|
3
|
+
exports.analyticsProductData = analyticsProductData;
|
|
5
4
|
const convertImageURL_js_1 = require("./convertImageURL.js");
|
|
6
5
|
const toMajor_js_1 = require("./toMajor.js");
|
|
7
6
|
const variantImage_js_1 = require("./variantImage.js");
|
|
7
|
+
const variantPrice_js_1 = require("./variantPrice.js");
|
|
8
8
|
function analyticsProductData(env, variant, variantID) {
|
|
9
9
|
var _a, _b;
|
|
10
10
|
const priceInfo = (0, variantPrice_js_1.variantPriceInfo)(env, variant);
|
|
@@ -30,4 +30,3 @@ function analyticsProductData(env, variant, variantID) {
|
|
|
30
30
|
}),
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
exports.analyticsProductData = analyticsProductData;
|
package/cjs/arrayToDict.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.arrayToDict =
|
|
3
|
+
exports.arrayToDict = arrayToDict;
|
|
4
4
|
function arrayToDict(array, key) {
|
|
5
5
|
const out = {};
|
|
6
6
|
for (const v of array) {
|
|
@@ -9,4 +9,3 @@ function arrayToDict(array, key) {
|
|
|
9
9
|
}
|
|
10
10
|
return out;
|
|
11
11
|
}
|
|
12
|
-
exports.arrayToDict = arrayToDict;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.asyncImportWrapper = asyncImportWrapper;
|
|
4
|
+
exports.asyncModuleWrapper = asyncModuleWrapper;
|
|
4
5
|
function asyncImportWrapper(load) {
|
|
5
6
|
return asyncModuleWrapper((cfg) => load().then((m) => m.load(cfg)));
|
|
6
7
|
}
|
|
7
|
-
exports.asyncImportWrapper = asyncImportWrapper;
|
|
8
8
|
function asyncModuleWrapper(load) {
|
|
9
9
|
let promise;
|
|
10
10
|
let loaded;
|
|
@@ -49,4 +49,3 @@ function asyncModuleWrapper(load) {
|
|
|
49
49
|
},
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
exports.asyncModuleWrapper = asyncModuleWrapper;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.averageReviewScore =
|
|
3
|
+
exports.averageReviewScore = averageReviewScore;
|
|
4
4
|
const meanBy_js_1 = require("./meanBy.js");
|
|
5
5
|
function averageReviewScore(product, reviewSettings) {
|
|
6
6
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -42,4 +42,3 @@ function averageReviewScore(product, reviewSettings) {
|
|
|
42
42
|
return (0, meanBy_js_1.meanBy)(scores, (s) => s.score);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
exports.averageReviewScore = averageReviewScore;
|
package/cjs/cartOperation.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.filterOutNonCreateOpertions = filterOutNonCreateOpertions;
|
|
4
|
+
exports.compactCartOperations = compactCartOperations;
|
|
4
5
|
const compact_js_1 = require("./compact.js");
|
|
5
6
|
// Filter out all operations that are not relevant for create API.
|
|
6
7
|
// This includes remove operations and non-positive quantity operations.
|
|
@@ -27,7 +28,6 @@ function filterOutNonCreateOpertions(ops) {
|
|
|
27
28
|
}
|
|
28
29
|
return out;
|
|
29
30
|
}
|
|
30
|
-
exports.filterOutNonCreateOpertions = filterOutNonCreateOpertions;
|
|
31
31
|
function normalizeSetOperation(op) {
|
|
32
32
|
if (op.quantity <= 0) {
|
|
33
33
|
return {
|
|
@@ -67,10 +67,10 @@ function compactCartOperations(operations) {
|
|
|
67
67
|
// change -> change, accumulate
|
|
68
68
|
const quantityDelta = last.op.quantityDelta + op.quantityDelta;
|
|
69
69
|
perVariant[id] = {
|
|
70
|
-
order: last.order,
|
|
70
|
+
order: last.order, // order is preserved
|
|
71
71
|
op: {
|
|
72
72
|
kind: "change",
|
|
73
|
-
variant: op.variant,
|
|
73
|
+
variant: op.variant, // update variant info to latest known
|
|
74
74
|
variantID: op.variantID,
|
|
75
75
|
fieldSetID: op.fieldSetID || last.op.fieldSetID,
|
|
76
76
|
fields: op.fields || last.op.fields,
|
|
@@ -84,10 +84,10 @@ function compactCartOperations(operations) {
|
|
|
84
84
|
// set -> change, accumulate
|
|
85
85
|
const quantity = last.op.quantity + op.quantityDelta;
|
|
86
86
|
perVariant[id] = {
|
|
87
|
-
order: last.order,
|
|
87
|
+
order: last.order, // order is preserved
|
|
88
88
|
op: {
|
|
89
89
|
kind: "set",
|
|
90
|
-
variant: op.variant,
|
|
90
|
+
variant: op.variant, // update variant info to latest known
|
|
91
91
|
variantID: op.variantID,
|
|
92
92
|
fieldSetID: op.fieldSetID || last.op.fieldSetID,
|
|
93
93
|
fields: op.fields || last.op.fields,
|
|
@@ -129,4 +129,3 @@ function compactCartOperations(operations) {
|
|
|
129
129
|
items.sort((a, b) => a.order - b.order);
|
|
130
130
|
return items.map((v) => v.op);
|
|
131
131
|
}
|
|
132
|
-
exports.compactCartOperations = compactCartOperations;
|
package/cjs/categorySEO.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.categorySEO =
|
|
3
|
+
exports.categorySEO = categorySEO;
|
|
4
4
|
const compact_js_1 = require("./compact.js");
|
|
5
5
|
function categorySEO(category) {
|
|
6
6
|
const images = (0, compact_js_1.compact)(category.image_files);
|
|
@@ -17,4 +17,3 @@ function categorySEO(category) {
|
|
|
17
17
|
],
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
exports.categorySEO = categorySEO;
|
package/cjs/compact.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.compact =
|
|
3
|
+
exports.compact = compact;
|
|
4
4
|
function compact(v) {
|
|
5
5
|
// type override is safe here, because we get rid of said values in filter function
|
|
6
6
|
return ((v === null || v === void 0 ? void 0 : v.filter((v) => v !== null && v !== undefined)) || []);
|
|
7
7
|
}
|
|
8
|
-
exports.compact = compact;
|
package/cjs/configLoader.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.anyVar = anyVar;
|
|
4
|
+
exports.stringVar = stringVar;
|
|
5
|
+
exports.booleanVar = booleanVar;
|
|
6
|
+
exports.loadConfig = loadConfig;
|
|
4
7
|
function anyVar(mandatory) {
|
|
5
8
|
const v = { kind: "any", __type: undefined, mandatory };
|
|
6
9
|
return mandatory ? { kind: "mandatory", mandatory: v } : v;
|
|
7
10
|
}
|
|
8
|
-
exports.anyVar = anyVar;
|
|
9
11
|
// prettier-ignore
|
|
10
12
|
function stringVar(envVars, defaultValue, mandatory) {
|
|
11
13
|
const v = { kind: "string", envVars, defaultValue, mandatory };
|
|
12
14
|
return defaultValue !== undefined ? { kind: "default", default: v } : mandatory ? { kind: "mandatory", mandatory: v } : v;
|
|
13
15
|
}
|
|
14
|
-
exports.stringVar = stringVar;
|
|
15
16
|
// prettier-ignore
|
|
16
17
|
function booleanVar(envVars, defaultValue, mandatory) {
|
|
17
18
|
const v = { kind: "boolean", envVars, defaultValue, mandatory };
|
|
18
19
|
return defaultValue !== undefined ? { kind: "default", default: v } : mandatory ? { kind: "mandatory", mandatory: v } : v;
|
|
19
20
|
}
|
|
20
|
-
exports.booleanVar = booleanVar;
|
|
21
21
|
function varToBaseBar(v) {
|
|
22
22
|
if (v.kind === "default") {
|
|
23
23
|
return v.default;
|
|
@@ -66,4 +66,3 @@ function loadConfig(confDef, input) {
|
|
|
66
66
|
}
|
|
67
67
|
return out;
|
|
68
68
|
}
|
|
69
|
-
exports.loadConfig = loadConfig;
|
package/cjs/convertImageURL.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertImageURL =
|
|
3
|
+
exports.convertImageURL = convertImageURL;
|
|
4
4
|
const compact_js_1 = require("./compact.js");
|
|
5
5
|
function convertImageURL(cdnBaseURL, url, p) {
|
|
6
6
|
if (!url) {
|
|
@@ -16,4 +16,3 @@ function convertImageURL(cdnBaseURL, url, p) {
|
|
|
16
16
|
const params = (0, compact_js_1.compact)([p.size, p.crop, p.low ? "low" : undefined]);
|
|
17
17
|
return params.length === 0 ? url : noext + "_" + params.join("_") + (p.scale ? `@${p.scale}x` : "") + ext;
|
|
18
18
|
}
|
|
19
|
-
exports.convertImageURL = convertImageURL;
|
package/cjs/dataLoader.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadData =
|
|
3
|
+
exports.loadData = loadData;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const request_js_1 = require("./request.js");
|
|
6
|
-
const script_js_1 = require("./script.js");
|
|
7
5
|
const arrayToDict_js_1 = require("./arrayToDict.js");
|
|
8
6
|
const compact_js_1 = require("./compact.js");
|
|
7
|
+
const script_js_1 = require("./script.js");
|
|
9
8
|
const fetchAllItems_js_1 = require("./fetchAllItems.js");
|
|
10
9
|
const nonNull_js_1 = require("./nonNull.js");
|
|
10
|
+
const request_js_1 = require("./request.js");
|
|
11
11
|
const promiseAll_js_1 = require("./promiseAll.js");
|
|
12
12
|
const timeIt_js_1 = require("./timeIt.js");
|
|
13
13
|
function throwOnFailure(resp) {
|
|
@@ -95,7 +95,6 @@ function createProductBriefs(products) {
|
|
|
95
95
|
variants: (0, compact_js_1.compact)((_a = p.variants) === null || _a === void 0 ? void 0 : _a.map((v) => v
|
|
96
96
|
? {
|
|
97
97
|
currency_prices: v.currency_prices,
|
|
98
|
-
customer_group_price: v.customer_group_price,
|
|
99
98
|
id: v.id,
|
|
100
99
|
inventory: v.inventory,
|
|
101
100
|
inventory_policy: v.inventory_policy,
|
|
@@ -108,10 +107,9 @@ function createProductBriefs(products) {
|
|
|
108
107
|
})),
|
|
109
108
|
price: v.price,
|
|
110
109
|
retail_price: v.retail_price,
|
|
111
|
-
sale_price: v.sale_price,
|
|
112
|
-
sale_price_eligible: v.sale_price_eligible,
|
|
113
110
|
sku: v.sku,
|
|
114
111
|
tiered_pricing: v.tiered_pricing,
|
|
112
|
+
previous_pricing: v.previous_pricing,
|
|
115
113
|
}
|
|
116
114
|
: undefined)),
|
|
117
115
|
};
|
|
@@ -119,8 +117,8 @@ function createProductBriefs(products) {
|
|
|
119
117
|
return out;
|
|
120
118
|
}
|
|
121
119
|
function loadDataForLanguage(config, locale, isDefault) {
|
|
122
|
-
var _a;
|
|
123
120
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
var _a;
|
|
124
122
|
const opts = locale ? Object.assign(Object.assign({}, config.opts), { locale }) : config.opts;
|
|
125
123
|
const ltimeIt = (name, cb) => {
|
|
126
124
|
const prefix = locale ? `[${locale}] ` : "";
|
|
@@ -182,4 +180,3 @@ function loadData(config) {
|
|
|
182
180
|
}
|
|
183
181
|
});
|
|
184
182
|
}
|
|
185
|
-
exports.loadData = loadData;
|
package/cjs/defaultVariant.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultVariant =
|
|
3
|
+
exports.defaultVariant = defaultVariant;
|
|
4
4
|
function defaultVariant(product) {
|
|
5
5
|
var _a;
|
|
6
6
|
if (!product)
|
|
@@ -27,4 +27,3 @@ function defaultVariant(product) {
|
|
|
27
27
|
}
|
|
28
28
|
return out;
|
|
29
29
|
}
|
|
30
|
-
exports.defaultVariant = defaultVariant;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.clearOnChangeAfterDelay =
|
|
3
|
+
exports.clearOnChangeAfterDelay = clearOnChangeAfterDelay;
|
|
4
4
|
const effector_1 = require("effector");
|
|
5
5
|
function clearOnChangeAfterDelay(store, timeout) {
|
|
6
6
|
const clear = (0, effector_1.createEvent)();
|
|
@@ -14,4 +14,3 @@ function clearOnChangeAfterDelay(store, timeout) {
|
|
|
14
14
|
}, timeout);
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
exports.clearOnChangeAfterDelay = clearOnChangeAfterDelay;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.combineEvery =
|
|
3
|
+
exports.combineEvery = combineEvery;
|
|
4
4
|
const effector_1 = require("effector");
|
|
5
5
|
function combineEvery(...stores) {
|
|
6
6
|
return (0, effector_1.combine)(stores, (stores) => stores.every(Boolean));
|
|
7
7
|
}
|
|
8
|
-
exports.combineEvery = combineEvery;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.combineSome =
|
|
3
|
+
exports.combineSome = combineSome;
|
|
4
4
|
const effector_1 = require("effector");
|
|
5
5
|
function combineSome(...stores) {
|
|
6
6
|
return (0, effector_1.combine)(stores, (stores) => stores.some(Boolean));
|
|
7
7
|
}
|
|
8
|
-
exports.combineSome = combineSome;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.debounced =
|
|
3
|
+
exports.debounced = debounced;
|
|
4
4
|
const effector_1 = require("effector");
|
|
5
5
|
function debounced(src, dst, delay) {
|
|
6
6
|
const setDst = (0, effector_1.createEvent)();
|
|
@@ -15,4 +15,3 @@ function debounced(src, dst, delay) {
|
|
|
15
15
|
}, delay);
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
exports.debounced = debounced;
|
package/cjs/effector/form.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createBooleanField = createBooleanField;
|
|
4
|
+
exports.createStringField = createStringField;
|
|
5
|
+
exports.createEnumField = createEnumField;
|
|
6
|
+
exports.createForm = createForm;
|
|
7
|
+
exports.createFormWithCustomError = createFormWithCustomError;
|
|
4
8
|
const effector_1 = require("effector");
|
|
5
9
|
const validator_js_1 = require("./validator.js");
|
|
6
10
|
const restoreNamed_js_1 = require("./restoreNamed.js");
|
|
@@ -43,15 +47,12 @@ function createBooleanField(name, initialValueArg) {
|
|
|
43
47
|
initialValue,
|
|
44
48
|
};
|
|
45
49
|
}
|
|
46
|
-
exports.createBooleanField = createBooleanField;
|
|
47
50
|
function createStringField(name, initialValueArg, validators) {
|
|
48
51
|
return createCommonStringField(name, initialValueArg, validators);
|
|
49
52
|
}
|
|
50
|
-
exports.createStringField = createStringField;
|
|
51
53
|
function createEnumField(name, initialValueArg, validators) {
|
|
52
54
|
return createCommonStringField(name, initialValueArg, validators);
|
|
53
55
|
}
|
|
54
|
-
exports.createEnumField = createEnumField;
|
|
55
56
|
function createCommonStringField(name, initialValueArg, validators) {
|
|
56
57
|
const { apiError, setAPIError } = commonFields(name);
|
|
57
58
|
const change = (0, effector_1.createEvent)(`${name}.change`);
|
|
@@ -155,7 +156,6 @@ function createForm(obj) {
|
|
|
155
156
|
propagateInitialValues,
|
|
156
157
|
errorPropagationFailed });
|
|
157
158
|
}
|
|
158
|
-
exports.createForm = createForm;
|
|
159
159
|
function createFormWithCustomError(obj, err) {
|
|
160
160
|
const form = createForm(obj);
|
|
161
161
|
const setError = (0, effector_1.createEvent)("setError");
|
|
@@ -165,4 +165,3 @@ function createFormWithCustomError(obj, err) {
|
|
|
165
165
|
return Object.assign(Object.assign({}, form), { error,
|
|
166
166
|
setError });
|
|
167
167
|
}
|
|
168
|
-
exports.createFormWithCustomError = createFormWithCustomError;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hideOnChangeAfterDelay =
|
|
3
|
+
exports.hideOnChangeAfterDelay = hideOnChangeAfterDelay;
|
|
4
4
|
const effector_1 = require("effector");
|
|
5
5
|
function hideOnChangeAfterDelay(store, timeout) {
|
|
6
6
|
const clear = (0, effector_1.createEvent)();
|
|
@@ -14,4 +14,3 @@ function hideOnChangeAfterDelay(store, timeout) {
|
|
|
14
14
|
}, timeout);
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
exports.hideOnChangeAfterDelay = hideOnChangeAfterDelay;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.requestResponseSplitGeneric = requestResponseSplitGeneric;
|
|
4
|
+
exports.requestResponseSplit = requestResponseSplit;
|
|
5
|
+
exports.requestResponseSplitFirst = requestResponseSplitFirst;
|
|
4
6
|
const effector_1 = require("effector");
|
|
5
7
|
function requestResponseSplitGeneric(ev, fn) {
|
|
6
8
|
const dataSink = (0, effector_1.createEvent)();
|
|
@@ -19,12 +21,9 @@ function requestResponseSplitGeneric(ev, fn) {
|
|
|
19
21
|
});
|
|
20
22
|
return { data, error };
|
|
21
23
|
}
|
|
22
|
-
exports.requestResponseSplitGeneric = requestResponseSplitGeneric;
|
|
23
24
|
function requestResponseSplit(ev) {
|
|
24
25
|
return requestResponseSplitGeneric(ev, (v) => v);
|
|
25
26
|
}
|
|
26
|
-
exports.requestResponseSplit = requestResponseSplit;
|
|
27
27
|
function requestResponseSplitFirst(ev) {
|
|
28
28
|
return requestResponseSplitGeneric(ev, (v) => v[0]);
|
|
29
29
|
}
|
|
30
|
-
exports.requestResponseSplitFirst = requestResponseSplitFirst;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.requestResponseSplitMulti =
|
|
3
|
+
exports.requestResponseSplitMulti = requestResponseSplitMulti;
|
|
4
4
|
const effector_1 = require("effector");
|
|
5
5
|
const request_js_1 = require("../request.js");
|
|
6
6
|
const split_js_1 = require("./split.js");
|
|
@@ -48,4 +48,3 @@ function requestResponseSplitMulti(ev) {
|
|
|
48
48
|
}, data);
|
|
49
49
|
return { data, error };
|
|
50
50
|
}
|
|
51
|
-
exports.requestResponseSplitMulti = requestResponseSplitMulti;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.restoreNamed =
|
|
3
|
+
exports.restoreNamed = restoreNamed;
|
|
4
4
|
const effector_1 = require("effector");
|
|
5
5
|
function restoreNamed(event, defaultState, name) {
|
|
6
6
|
return (0, effector_1.createStore)(defaultState, { name }).on(event, (_, v) => v);
|
|
7
7
|
}
|
|
8
|
-
exports.restoreNamed = restoreNamed;
|
package/cjs/effector/split.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.splitMap =
|
|
3
|
+
exports.splitMap = splitMap;
|
|
4
4
|
const effector_1 = require("effector");
|
|
5
5
|
function splitMap(source) {
|
|
6
6
|
let lastSource = source;
|
|
@@ -26,4 +26,3 @@ function splitMap(source) {
|
|
|
26
26
|
};
|
|
27
27
|
return builder;
|
|
28
28
|
}
|
|
29
|
-
exports.splitMap = splitMap;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.validEmail = exports.validNonEmpty = exports.validMaxLength32 = exports.validMaxLength80 = exports.validMaxLength160 = exports.validMaxLength190 = exports.validMaxLength250 = exports.validMaxLengthLongText = void 0;
|
|
4
|
+
exports.applyValidators = applyValidators;
|
|
5
|
+
exports.combineValidators = combineValidators;
|
|
4
6
|
const effector_1 = require("effector");
|
|
5
7
|
function makeValidator(k, fn) {
|
|
6
8
|
return (v) => (fn(v) ? null : k);
|
|
@@ -15,7 +17,6 @@ function applyValidators(store, validators) {
|
|
|
15
17
|
return null;
|
|
16
18
|
});
|
|
17
19
|
}
|
|
18
|
-
exports.applyValidators = applyValidators;
|
|
19
20
|
const nonEmpty = (v) => !!v;
|
|
20
21
|
const isEmpty = (v) => !v;
|
|
21
22
|
exports.validMaxLengthLongText = makeValidator("max_length_exceeded", (v) => v.length <= 100000);
|
|
@@ -30,4 +31,3 @@ exports.validEmail = makeValidator("invalid_email", (v) => isEmpty(v) || /^[a-zA
|
|
|
30
31
|
function combineValidators(validStates) {
|
|
31
32
|
return (0, effector_1.combine)(validStates, (v) => v.every((v) => v === null));
|
|
32
33
|
}
|
|
33
|
-
exports.combineValidators = combineValidators;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.wrapSignInRequired =
|
|
3
|
+
exports.wrapSignInRequired = wrapSignInRequired;
|
|
4
4
|
const effector_1 = require("effector");
|
|
5
5
|
const split_js_1 = require("./split.js");
|
|
6
6
|
function wrapSignInRequired(jwt, signInRequired, orig) {
|
|
@@ -10,4 +10,3 @@ function wrapSignInRequired(jwt, signInRequired, orig) {
|
|
|
10
10
|
.map((v) => (!v.jwt ? true : undefined), signInRequired);
|
|
11
11
|
return wrappedEvent;
|
|
12
12
|
}
|
|
13
|
-
exports.wrapSignInRequired = wrapSignInRequired;
|