@ikas/storefront 0.0.94 → 0.0.96
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/build/__generated__/global-types.d.ts +7 -1
- package/build/api/cart/__generated__/getCart.d.ts +4 -0
- package/build/api/cart/__generated__/saveItemToCart.d.ts +4 -0
- package/build/api/checkout/__generated__/checkStocks.d.ts +3 -3
- package/build/api/checkout/index.d.ts +1 -1
- package/build/api/country/__generated__/getAvailableShippingCountries.d.ts +3 -0
- package/build/api/country/index.d.ts +1 -1
- package/build/api/index.d.ts +0 -2
- package/build/components/checkout/index.d.ts +3 -0
- package/build/components/checkout/model.d.ts +4 -3
- package/build/index.es.js +426 -409
- package/build/index.js +427 -412
- package/build/models/data/cart/index.d.ts +9 -0
- package/build/models/data/sales-channel/index.d.ts +12 -0
- package/build/models/data/storefront/{storefront-domain → domain}/index.d.ts +1 -0
- package/build/models/data/storefront/index.d.ts +19 -6
- package/build/models/data/storefront/localization/index.d.ts +7 -0
- package/build/models/data/storefront/routing/index.d.ts +9 -0
- package/build/models/data/storefront/theme/index.d.ts +13 -0
- package/build/models/data/storefront/theme-localization/index.d.ts +11 -0
- package/build/models/ui/product-list/index.d.ts +1 -1
- package/build/pages/checkout/[id].d.ts +3 -0
- package/build/storefront/index.d.ts +6 -0
- package/build/utils/settings.d.ts +82 -0
- package/package.json +1 -1
- package/build/api/product-stock-location/__generated__/listProductStockLocation.d.ts +0 -13
- package/build/api/product-stock-location/index.d.ts +0 -4
- package/build/api/storefront/__generated__/getStorefront.d.ts +0 -23
- package/build/api/storefront/index.d.ts +0 -4
- package/build/api/theme/index.d.ts +0 -4
- package/build/models/data/storefront/stockfront-location/index.d.ts +0 -5
- package/build/models/data/storefront/stockfront-route/index.d.ts +0 -5
- package/build/models/data/storefront/storefront-region/index.d.ts +0 -18
package/build/index.js
CHANGED
|
@@ -3,24 +3,24 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var mobx = require('mobx');
|
|
6
|
-
var fs = require('fs');
|
|
7
|
-
var getConfig = require('next/config');
|
|
8
6
|
var React = require('react');
|
|
7
|
+
var getConfig = require('next/config');
|
|
9
8
|
var mobxReactLite = require('mobx-react-lite');
|
|
10
9
|
var router = require('next/router');
|
|
11
10
|
var Image$1 = require('next/image');
|
|
12
11
|
var Link = require('next/link');
|
|
13
12
|
var Head = require('next/head');
|
|
13
|
+
var fs = require('fs');
|
|
14
14
|
var dynamic = require('next/dynamic');
|
|
15
15
|
|
|
16
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
17
|
|
|
18
|
-
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
19
|
-
var getConfig__default = /*#__PURE__*/_interopDefaultLegacy(getConfig);
|
|
20
18
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
|
+
var getConfig__default = /*#__PURE__*/_interopDefaultLegacy(getConfig);
|
|
21
20
|
var Image__default = /*#__PURE__*/_interopDefaultLegacy(Image$1);
|
|
22
21
|
var Link__default = /*#__PURE__*/_interopDefaultLegacy(Link);
|
|
23
22
|
var Head__default = /*#__PURE__*/_interopDefaultLegacy(Head);
|
|
23
|
+
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
24
24
|
var dynamic__default = /*#__PURE__*/_interopDefaultLegacy(dynamic);
|
|
25
25
|
|
|
26
26
|
/*! *****************************************************************************
|
|
@@ -11017,6 +11017,7 @@ var IkasProductDetailPropValueProvider = /** @class */ (function () {
|
|
|
11017
11017
|
return [2 /*return*/, null];
|
|
11018
11018
|
return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
11019
11019
|
productIdList: [this.productDetailPropValue.productId],
|
|
11020
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
11020
11021
|
})];
|
|
11021
11022
|
case 1:
|
|
11022
11023
|
productSearchResponse = _b.sent();
|
|
@@ -12046,6 +12047,7 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12046
12047
|
return [2 /*return*/];
|
|
12047
12048
|
return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
12048
12049
|
productIdList: [metaDataResponse.metaData.targetId],
|
|
12050
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
12049
12051
|
})];
|
|
12050
12052
|
case 2:
|
|
12051
12053
|
productsResponse = _b.sent();
|
|
@@ -12803,6 +12805,10 @@ var IkasCart = /** @class */ (function () {
|
|
|
12803
12805
|
: [];
|
|
12804
12806
|
this.merchantId = data.merchantId || "";
|
|
12805
12807
|
this.totalPrice = data.totalPrice || 0;
|
|
12808
|
+
this.salesChannelId = data.salesChannelId || "";
|
|
12809
|
+
this.storefrontId = data.storefrontId || null;
|
|
12810
|
+
this.storefrontRoutingId = data.storefrontRoutingId || null;
|
|
12811
|
+
this.storefrontThemeId = data.storefrontThemeId || null;
|
|
12806
12812
|
mobx.makeAutoObservable(this);
|
|
12807
12813
|
}
|
|
12808
12814
|
Object.defineProperty(IkasCart.prototype, "totalTax", {
|
|
@@ -15822,7 +15828,7 @@ var MAX_CVC_LENGTH = 4;
|
|
|
15822
15828
|
var USE_DIFFERENT_ADDRESS_KEY = "sAddr";
|
|
15823
15829
|
var isServer$1 = typeof localStorage === "undefined";
|
|
15824
15830
|
var CheckoutViewModel = /** @class */ (function () {
|
|
15825
|
-
function CheckoutViewModel(checkout, queryParams, router) {
|
|
15831
|
+
function CheckoutViewModel(checkout, queryParams, router, returnPolicy, privacyPolicy, termsOfService) {
|
|
15826
15832
|
var _this = this;
|
|
15827
15833
|
this.checkout = new IkasCheckout();
|
|
15828
15834
|
this.storefront = null;
|
|
@@ -15928,7 +15934,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
15928
15934
|
variantId: i.variant.id,
|
|
15929
15935
|
productId: i.variant.productId,
|
|
15930
15936
|
}); });
|
|
15931
|
-
return [4 /*yield*/, IkasCheckoutAPI.checkStocks(lines)];
|
|
15937
|
+
return [4 /*yield*/, IkasCheckoutAPI.checkStocks(lines, IkasStorefrontConfig.stockLocationIds || [])];
|
|
15932
15938
|
case 1:
|
|
15933
15939
|
result = _b.sent();
|
|
15934
15940
|
if (!result) {
|
|
@@ -15941,7 +15947,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
15941
15947
|
data = unavailableItems.map(function (item) { return ({
|
|
15942
15948
|
variant: _this.cart.items.find(function (i) { return i.variant.id === item.variantId; })
|
|
15943
15949
|
.variant,
|
|
15944
|
-
availableQuantity: item.
|
|
15950
|
+
availableQuantity: item.stockCount,
|
|
15945
15951
|
}); });
|
|
15946
15952
|
throw {
|
|
15947
15953
|
type: ErrorType.STOCK_ERROR,
|
|
@@ -15958,7 +15964,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
15958
15964
|
switch (_b.label) {
|
|
15959
15965
|
case 0:
|
|
15960
15966
|
_a = this;
|
|
15961
|
-
return [4 /*yield*/, IkasCountryAPI.listShippingCountries()];
|
|
15967
|
+
return [4 /*yield*/, IkasCountryAPI.listShippingCountries(IkasStorefrontConfig.storefrontId)];
|
|
15962
15968
|
case 1:
|
|
15963
15969
|
_a.shippingCountryIds = _b.sent();
|
|
15964
15970
|
return [2 /*return*/];
|
|
@@ -16034,30 +16040,6 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16034
16040
|
}
|
|
16035
16041
|
});
|
|
16036
16042
|
}); };
|
|
16037
|
-
this.getStorefront = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16038
|
-
var storefront;
|
|
16039
|
-
return __generator(this, function (_a) {
|
|
16040
|
-
switch (_a.label) {
|
|
16041
|
-
case 0:
|
|
16042
|
-
if (!IkasStorefrontConfig.config.storefrontId || !!this.storefront)
|
|
16043
|
-
return [2 /*return*/];
|
|
16044
|
-
_a.label = 1;
|
|
16045
|
-
case 1:
|
|
16046
|
-
_a.trys.push([1, 3, , 4]);
|
|
16047
|
-
return [4 /*yield*/, IkasStorefrontAPI.getStorefront(IkasStorefrontConfig.config.storefrontId)];
|
|
16048
|
-
case 2:
|
|
16049
|
-
storefront = _a.sent();
|
|
16050
|
-
if (storefront) {
|
|
16051
|
-
this.storefront = storefront;
|
|
16052
|
-
}
|
|
16053
|
-
return [3 /*break*/, 4];
|
|
16054
|
-
case 3:
|
|
16055
|
-
_a.sent();
|
|
16056
|
-
return [3 /*break*/, 4];
|
|
16057
|
-
case 4: return [2 /*return*/];
|
|
16058
|
-
}
|
|
16059
|
-
});
|
|
16060
|
-
}); };
|
|
16061
16043
|
this.createCustomer = function () {
|
|
16062
16044
|
if (_this.customerStore.customer) {
|
|
16063
16045
|
_this.checkout.customer = _this.customerStore.customer;
|
|
@@ -16189,7 +16171,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16189
16171
|
_this.router.push("/");
|
|
16190
16172
|
};
|
|
16191
16173
|
this.onProceedToShippingClick = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16192
|
-
var newAddress, customer,
|
|
16174
|
+
var newAddress, customer, err_2;
|
|
16193
16175
|
return __generator(this, function (_a) {
|
|
16194
16176
|
switch (_a.label) {
|
|
16195
16177
|
case 0:
|
|
@@ -16219,12 +16201,12 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16219
16201
|
this.changeStep(CheckoutStep.SHIPPING);
|
|
16220
16202
|
return [3 /*break*/, 7];
|
|
16221
16203
|
case 6:
|
|
16222
|
-
|
|
16223
|
-
if (
|
|
16224
|
-
this.error =
|
|
16204
|
+
err_2 = _a.sent();
|
|
16205
|
+
if (err_2.type) {
|
|
16206
|
+
this.error = err_2;
|
|
16225
16207
|
}
|
|
16226
16208
|
else {
|
|
16227
|
-
console.log(
|
|
16209
|
+
console.log(err_2);
|
|
16228
16210
|
this.error = {
|
|
16229
16211
|
type: ErrorType.UNKNOWN,
|
|
16230
16212
|
};
|
|
@@ -16236,7 +16218,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16236
16218
|
});
|
|
16237
16219
|
}); };
|
|
16238
16220
|
this.onProceedToPaymentClick = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16239
|
-
var
|
|
16221
|
+
var err_3;
|
|
16240
16222
|
return __generator(this, function (_a) {
|
|
16241
16223
|
switch (_a.label) {
|
|
16242
16224
|
case 0:
|
|
@@ -16256,12 +16238,12 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16256
16238
|
this.changeStep(CheckoutStep.PAYMENT);
|
|
16257
16239
|
return [3 /*break*/, 4];
|
|
16258
16240
|
case 3:
|
|
16259
|
-
|
|
16260
|
-
if (
|
|
16261
|
-
this.error =
|
|
16241
|
+
err_3 = _a.sent();
|
|
16242
|
+
if (err_3.type) {
|
|
16243
|
+
this.error = err_3;
|
|
16262
16244
|
}
|
|
16263
16245
|
else {
|
|
16264
|
-
console.log(
|
|
16246
|
+
console.log(err_3);
|
|
16265
16247
|
this.error = {
|
|
16266
16248
|
type: ErrorType.UNKNOWN,
|
|
16267
16249
|
};
|
|
@@ -16273,7 +16255,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16273
16255
|
});
|
|
16274
16256
|
}); };
|
|
16275
16257
|
this.performPayment = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16276
|
-
var response, transactionStatus,
|
|
16258
|
+
var response, transactionStatus, err_4;
|
|
16277
16259
|
return __generator(this, function (_a) {
|
|
16278
16260
|
switch (_a.label) {
|
|
16279
16261
|
case 0:
|
|
@@ -16319,10 +16301,10 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16319
16301
|
}
|
|
16320
16302
|
return [3 /*break*/, 6];
|
|
16321
16303
|
case 5:
|
|
16322
|
-
|
|
16323
|
-
if (
|
|
16324
|
-
console.log(
|
|
16325
|
-
this.error =
|
|
16304
|
+
err_4 = _a.sent();
|
|
16305
|
+
if (err_4.type) {
|
|
16306
|
+
console.log(err_4);
|
|
16307
|
+
this.error = err_4;
|
|
16326
16308
|
}
|
|
16327
16309
|
else {
|
|
16328
16310
|
this.error = {
|
|
@@ -16401,6 +16383,9 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16401
16383
|
}); };
|
|
16402
16384
|
this.checkout = checkout;
|
|
16403
16385
|
this.router = router;
|
|
16386
|
+
this.returnPolicy = returnPolicy;
|
|
16387
|
+
this.privacyPolicy = privacyPolicy;
|
|
16388
|
+
this.termsOfService = termsOfService;
|
|
16404
16389
|
this.init(queryParams);
|
|
16405
16390
|
mobx.makeAutoObservable(this);
|
|
16406
16391
|
}
|
|
@@ -16411,15 +16396,6 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16411
16396
|
enumerable: false,
|
|
16412
16397
|
configurable: true
|
|
16413
16398
|
});
|
|
16414
|
-
Object.defineProperty(CheckoutViewModel.prototype, "storefrontRegion", {
|
|
16415
|
-
get: function () {
|
|
16416
|
-
var _a;
|
|
16417
|
-
return ((_a = this.storefront) === null || _a === void 0 ? void 0 : _a.regions.length) ? this.storefront.regions[0]
|
|
16418
|
-
: undefined;
|
|
16419
|
-
},
|
|
16420
|
-
enumerable: false,
|
|
16421
|
-
configurable: true
|
|
16422
|
-
});
|
|
16423
16399
|
Object.defineProperty(CheckoutViewModel.prototype, "selectedPaymentGatewayIndex", {
|
|
16424
16400
|
get: function () {
|
|
16425
16401
|
var _this = this;
|
|
@@ -17083,6 +17059,7 @@ var IkasCustomerStore = /** @class */ (function () {
|
|
|
17083
17059
|
return [2 /*return*/, []];
|
|
17084
17060
|
return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
17085
17061
|
productIdList: favoriteProductsResult.map(function (fP) { return fP.productId; }),
|
|
17062
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
17086
17063
|
})];
|
|
17087
17064
|
case 2:
|
|
17088
17065
|
productsResult = _b.sent();
|
|
@@ -21917,7 +21894,10 @@ var IkasProductList = /** @class */ (function () {
|
|
|
21917
21894
|
Object.defineProperty(IkasProductList.prototype, "isFiltered", {
|
|
21918
21895
|
get: function () {
|
|
21919
21896
|
var _a;
|
|
21920
|
-
return (((_a = this.filters) === null || _a === void 0 ? void 0 : _a.some(function (f) { return !!f.valueList.length; })) ||
|
|
21897
|
+
return (((_a = this.filters) === null || _a === void 0 ? void 0 : _a.some(function (f) { return !!f.valueList.length; })) ||
|
|
21898
|
+
!!this._searchKeyword ||
|
|
21899
|
+
(this._pageType !== exports.IkasThemePageType.CATEGORY &&
|
|
21900
|
+
!!this._filterCategoryId));
|
|
21921
21901
|
},
|
|
21922
21902
|
enumerable: false,
|
|
21923
21903
|
configurable: true
|
|
@@ -21980,13 +21960,20 @@ var IkasProductList = /** @class */ (function () {
|
|
|
21980
21960
|
});
|
|
21981
21961
|
Object.defineProperty(IkasProductList.prototype, "filterQueryParams", {
|
|
21982
21962
|
get: function () {
|
|
21983
|
-
var
|
|
21963
|
+
var _this = this;
|
|
21964
|
+
var _a, _b, _c;
|
|
21984
21965
|
var queryParams = {};
|
|
21985
21966
|
(_a = this.filters) === null || _a === void 0 ? void 0 : _a.forEach(function (f) {
|
|
21986
21967
|
queryParams[f.key] = f.keyList;
|
|
21987
21968
|
});
|
|
21988
21969
|
if (this._searchKeyword)
|
|
21989
21970
|
queryParams.s = this._searchKeyword;
|
|
21971
|
+
if (this._pageType !== exports.IkasThemePageType.CATEGORY &&
|
|
21972
|
+
this._filterCategoryId) {
|
|
21973
|
+
var slug = (_c = (_b = this.filterCategories) === null || _b === void 0 ? void 0 : _b.find(function (fc) { return fc.id === _this._filterCategoryId; })) === null || _c === void 0 ? void 0 : _c.slug;
|
|
21974
|
+
if (slug)
|
|
21975
|
+
queryParams.c = slug;
|
|
21976
|
+
}
|
|
21990
21977
|
return queryString.stringify(queryParams, { arrayFormat: "comma" });
|
|
21991
21978
|
},
|
|
21992
21979
|
enumerable: false,
|
|
@@ -22041,6 +22028,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
22041
22028
|
categoryIdList: this._filterCategoryId
|
|
22042
22029
|
? [this._filterCategoryId]
|
|
22043
22030
|
: undefined,
|
|
22031
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
22044
22032
|
query: this._searchKeyword,
|
|
22045
22033
|
})];
|
|
22046
22034
|
case 1: return [2 /*return*/, _c.sent()];
|
|
@@ -22068,6 +22056,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
22068
22056
|
};
|
|
22069
22057
|
IkasProductList.prototype.applyQueryParamFilters = function (queryParams) {
|
|
22070
22058
|
var _this = this;
|
|
22059
|
+
var _a;
|
|
22071
22060
|
try {
|
|
22072
22061
|
queryParams === null || queryParams === void 0 ? void 0 : queryParams.forEach(function (value, key) {
|
|
22073
22062
|
var _a;
|
|
@@ -22079,6 +22068,15 @@ var IkasProductList = /** @class */ (function () {
|
|
|
22079
22068
|
var querySearch = queryParams === null || queryParams === void 0 ? void 0 : queryParams.get("s");
|
|
22080
22069
|
if (querySearch)
|
|
22081
22070
|
this._searchKeyword = querySearch;
|
|
22071
|
+
if (this._pageType !== exports.IkasThemePageType.CATEGORY) {
|
|
22072
|
+
var queryCategory_1 = queryParams === null || queryParams === void 0 ? void 0 : queryParams.get("c");
|
|
22073
|
+
if (queryCategory_1) {
|
|
22074
|
+
var filterCategory = (_a = this.filterCategories) === null || _a === void 0 ? void 0 : _a.find(function (fc) { return fc.slug === queryCategory_1; });
|
|
22075
|
+
if (filterCategory) {
|
|
22076
|
+
this._filterCategoryId = filterCategory.id;
|
|
22077
|
+
}
|
|
22078
|
+
}
|
|
22079
|
+
}
|
|
22082
22080
|
}
|
|
22083
22081
|
catch (err) {
|
|
22084
22082
|
console.log(err);
|
|
@@ -22125,12 +22123,32 @@ var IkasProductList = /** @class */ (function () {
|
|
|
22125
22123
|
var _a;
|
|
22126
22124
|
(_a = this.filters) === null || _a === void 0 ? void 0 : _a.forEach(function (filter) { return filter.clear(); });
|
|
22127
22125
|
this._searchKeyword = "";
|
|
22126
|
+
if (this._pageType !== exports.IkasThemePageType.CATEGORY) {
|
|
22127
|
+
this._filterCategoryId = undefined;
|
|
22128
|
+
}
|
|
22128
22129
|
this.applyFilters();
|
|
22129
22130
|
};
|
|
22130
|
-
IkasProductList.prototype.onFilterCategoryClick = function (filterCategory) {
|
|
22131
|
+
IkasProductList.prototype.onFilterCategoryClick = function (filterCategory, disableRoute) {
|
|
22131
22132
|
var _a;
|
|
22132
|
-
(
|
|
22133
|
-
|
|
22133
|
+
if (disableRoute === void 0) { disableRoute = false; }
|
|
22134
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
22135
|
+
return __generator(this, function (_b) {
|
|
22136
|
+
switch (_b.label) {
|
|
22137
|
+
case 0:
|
|
22138
|
+
if (!disableRoute) return [3 /*break*/, 2];
|
|
22139
|
+
this._filterCategoryId = filterCategory.id;
|
|
22140
|
+
return [4 /*yield*/, this.applyFilters()];
|
|
22141
|
+
case 1:
|
|
22142
|
+
_b.sent();
|
|
22143
|
+
return [3 /*break*/, 3];
|
|
22144
|
+
case 2:
|
|
22145
|
+
(_a = this.router) === null || _a === void 0 ? void 0 : _a.push(filterCategory.href +
|
|
22146
|
+
(this.filterQueryParams ? "?" + this.filterQueryParams : ""));
|
|
22147
|
+
_b.label = 3;
|
|
22148
|
+
case 3: return [2 /*return*/];
|
|
22149
|
+
}
|
|
22150
|
+
});
|
|
22151
|
+
});
|
|
22134
22152
|
};
|
|
22135
22153
|
IkasProductList.prototype.toJSON = function () {
|
|
22136
22154
|
return {
|
|
@@ -24215,7 +24233,7 @@ var IkasCartAPI = /** @class */ (function () {
|
|
|
24215
24233
|
return __generator(this, function (_b) {
|
|
24216
24234
|
switch (_b.label) {
|
|
24217
24235
|
case 0:
|
|
24218
|
-
MUTATION = src(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n mutation saveItemToCart($input: SaveItemToCartInput!) {\n saveItemToCart(input: $input) {\n id\n createdAt\n updatedAt\n dueDate\n currencyCode\n customerId\n merchantId\n itemCount\n totalPrice\n items {\n createdAt\n currencyCode\n deleted\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n id\n name\n sku\n slug\n barcodeList\n mainImageId\n productId\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n }\n }\n "], ["\n mutation saveItemToCart($input: SaveItemToCartInput!) {\n saveItemToCart(input: $input) {\n id\n createdAt\n updatedAt\n dueDate\n currencyCode\n customerId\n merchantId\n itemCount\n totalPrice\n items {\n createdAt\n currencyCode\n deleted\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n id\n name\n sku\n slug\n barcodeList\n mainImageId\n productId\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n }\n }\n "])));
|
|
24236
|
+
MUTATION = src(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n mutation saveItemToCart($input: SaveItemToCartInput!) {\n saveItemToCart(input: $input) {\n id\n createdAt\n updatedAt\n dueDate\n currencyCode\n customerId\n merchantId\n itemCount\n totalPrice\n salesChannelId\n storefrontId\n storefrontRoutingId\n storefrontThemeId\n items {\n createdAt\n currencyCode\n deleted\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n id\n name\n sku\n slug\n barcodeList\n mainImageId\n productId\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n }\n }\n "], ["\n mutation saveItemToCart($input: SaveItemToCartInput!) {\n saveItemToCart(input: $input) {\n id\n createdAt\n updatedAt\n dueDate\n currencyCode\n customerId\n merchantId\n itemCount\n totalPrice\n salesChannelId\n storefrontId\n storefrontRoutingId\n storefrontThemeId\n items {\n createdAt\n currencyCode\n deleted\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n id\n name\n sku\n slug\n barcodeList\n mainImageId\n productId\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n }\n }\n "])));
|
|
24219
24237
|
_b.label = 1;
|
|
24220
24238
|
case 1:
|
|
24221
24239
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -24250,7 +24268,7 @@ var IkasCartAPI = /** @class */ (function () {
|
|
|
24250
24268
|
return __generator(this, function (_b) {
|
|
24251
24269
|
switch (_b.label) {
|
|
24252
24270
|
case 0:
|
|
24253
|
-
QUERY = src(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n query getCart($cartId: String, $customerId: String) {\n getCart(id: $cartId, customerId: $customerId) {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n slug\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n }\n "], ["\n query getCart($cartId: String, $customerId: String) {\n getCart(id: $cartId, customerId: $customerId) {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n slug\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n }\n "])));
|
|
24271
|
+
QUERY = src(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n query getCart($cartId: String, $customerId: String) {\n getCart(id: $cartId, customerId: $customerId) {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n salesChannelId\n storefrontId\n storefrontRoutingId\n storefrontThemeId\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n slug\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n }\n "], ["\n query getCart($cartId: String, $customerId: String) {\n getCart(id: $cartId, customerId: $customerId) {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n salesChannelId\n storefrontId\n storefrontRoutingId\n storefrontThemeId\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n slug\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n }\n "])));
|
|
24254
24272
|
_b.label = 1;
|
|
24255
24273
|
case 1:
|
|
24256
24274
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -24722,13 +24740,13 @@ var IkasCheckoutAPI = /** @class */ (function () {
|
|
|
24722
24740
|
});
|
|
24723
24741
|
});
|
|
24724
24742
|
};
|
|
24725
|
-
IkasCheckoutAPI.checkStocks = function (lines) {
|
|
24743
|
+
IkasCheckoutAPI.checkStocks = function (lines, stockLocationIdList) {
|
|
24726
24744
|
return __awaiter(this, void 0, void 0, function () {
|
|
24727
24745
|
var QUERY, _a, data, errors, err_7;
|
|
24728
24746
|
return __generator(this, function (_b) {
|
|
24729
24747
|
switch (_b.label) {
|
|
24730
24748
|
case 0:
|
|
24731
|
-
QUERY = src(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n query checkStocks($lines: [CheckStocksLineInput!]!) {\n checkStocks(lines: $lines) {\n lines {\n
|
|
24749
|
+
QUERY = src(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n query checkStocks(\n $lines: [CheckStocksLineInput!]!\n $stockLocationIdList: [String!]\n ) {\n checkStocks(lines: $lines, stockLocationIdList: $stockLocationIdList) {\n lines {\n stockCount\n isAvailable\n variantId\n }\n }\n }\n "], ["\n query checkStocks(\n $lines: [CheckStocksLineInput!]!\n $stockLocationIdList: [String!]\n ) {\n checkStocks(lines: $lines, stockLocationIdList: $stockLocationIdList) {\n lines {\n stockCount\n isAvailable\n variantId\n }\n }\n }\n "])));
|
|
24732
24750
|
_b.label = 1;
|
|
24733
24751
|
case 1:
|
|
24734
24752
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -24738,6 +24756,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
|
|
|
24738
24756
|
query: QUERY,
|
|
24739
24757
|
variables: {
|
|
24740
24758
|
lines: lines,
|
|
24759
|
+
stockLocationIdList: stockLocationIdList,
|
|
24741
24760
|
},
|
|
24742
24761
|
})];
|
|
24743
24762
|
case 2:
|
|
@@ -24849,13 +24868,13 @@ var IkasCountryAPI = /** @class */ (function () {
|
|
|
24849
24868
|
});
|
|
24850
24869
|
});
|
|
24851
24870
|
};
|
|
24852
|
-
IkasCountryAPI.listShippingCountries = function () {
|
|
24871
|
+
IkasCountryAPI.listShippingCountries = function (storefrontId) {
|
|
24853
24872
|
return __awaiter(this, void 0, void 0, function () {
|
|
24854
24873
|
var QUERY, _a, data, errors, err_2;
|
|
24855
24874
|
return __generator(this, function (_b) {
|
|
24856
24875
|
switch (_b.label) {
|
|
24857
24876
|
case 0:
|
|
24858
|
-
QUERY = src(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n query getAvailableShippingCountries {\n getAvailableShippingCountries\n }\n "], ["\n query getAvailableShippingCountries {\n getAvailableShippingCountries\n }\n "])));
|
|
24877
|
+
QUERY = src(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n query getAvailableShippingCountries($storefrontId: String!) {\n getAvailableShippingCountries(storefrontId: $storefrontId)\n }\n "], ["\n query getAvailableShippingCountries($storefrontId: String!) {\n getAvailableShippingCountries(storefrontId: $storefrontId)\n }\n "])));
|
|
24859
24878
|
_b.label = 1;
|
|
24860
24879
|
case 1:
|
|
24861
24880
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -24863,6 +24882,9 @@ var IkasCountryAPI = /** @class */ (function () {
|
|
|
24863
24882
|
.getClient()
|
|
24864
24883
|
.query({
|
|
24865
24884
|
query: QUERY,
|
|
24885
|
+
variables: {
|
|
24886
|
+
storefrontId: storefrontId,
|
|
24887
|
+
},
|
|
24866
24888
|
})];
|
|
24867
24889
|
case 2:
|
|
24868
24890
|
_a = _b.sent(), data = _a.data, errors = _a.errors;
|
|
@@ -25856,150 +25878,6 @@ var IkasStateAPI = /** @class */ (function () {
|
|
|
25856
25878
|
}());
|
|
25857
25879
|
var templateObject_1$e;
|
|
25858
25880
|
|
|
25859
|
-
var IkasStorefrontDomain = /** @class */ (function () {
|
|
25860
|
-
function IkasStorefrontDomain(data) {
|
|
25861
|
-
if (data === void 0) { data = {}; }
|
|
25862
|
-
this.id = data.id || "";
|
|
25863
|
-
this.merchantDomainId = data.merchantDomainId || "";
|
|
25864
|
-
this.name = data.name || "";
|
|
25865
|
-
this.redirectDomainName = data.redirectDomainName || null;
|
|
25866
|
-
mobx.makeAutoObservable(this);
|
|
25867
|
-
}
|
|
25868
|
-
return IkasStorefrontDomain;
|
|
25869
|
-
}());
|
|
25870
|
-
|
|
25871
|
-
var IkasStorefrontLocation = /** @class */ (function () {
|
|
25872
|
-
function IkasStorefrontLocation(data) {
|
|
25873
|
-
if (data === void 0) { data = {}; }
|
|
25874
|
-
this.countryId = data.countryId || "";
|
|
25875
|
-
this.stateId = data.stateId || null;
|
|
25876
|
-
mobx.makeAutoObservable(this);
|
|
25877
|
-
}
|
|
25878
|
-
return IkasStorefrontLocation;
|
|
25879
|
-
}());
|
|
25880
|
-
|
|
25881
|
-
var IkasStorefrontRoute = /** @class */ (function () {
|
|
25882
|
-
function IkasStorefrontRoute(data) {
|
|
25883
|
-
if (data === void 0) { data = {}; }
|
|
25884
|
-
this.domainId = data.domainId || "";
|
|
25885
|
-
this.useSubPath = data.useSubPath || false;
|
|
25886
|
-
mobx.makeAutoObservable(this);
|
|
25887
|
-
}
|
|
25888
|
-
return IkasStorefrontRoute;
|
|
25889
|
-
}());
|
|
25890
|
-
|
|
25891
|
-
var IkasStorefrontRegion = /** @class */ (function () {
|
|
25892
|
-
function IkasStorefrontRegion(data) {
|
|
25893
|
-
if (data === void 0) { data = {}; }
|
|
25894
|
-
// Extra
|
|
25895
|
-
this.theme = new IkasTheme();
|
|
25896
|
-
this.id = data.id || "";
|
|
25897
|
-
this.locale = data.locale || "";
|
|
25898
|
-
this.themeJSON = data.themeJSON || "";
|
|
25899
|
-
this.shipping = data.shipping || null;
|
|
25900
|
-
this.paymentSettingsId = data.paymentSettingsId || null;
|
|
25901
|
-
this.priceListId = data.priceListId || null;
|
|
25902
|
-
this.locations = data.locations
|
|
25903
|
-
? data.locations.map(function (o) { return new IkasStorefrontLocation(o); })
|
|
25904
|
-
: [];
|
|
25905
|
-
this.routes = data.routes
|
|
25906
|
-
? data.routes.map(function (o) { return new IkasStorefrontRoute(o); })
|
|
25907
|
-
: null;
|
|
25908
|
-
this.termsOfService = data.termsOfService || "";
|
|
25909
|
-
this.privacyPolicy = data.privacyPolicy || "";
|
|
25910
|
-
this.returnPolicy = data.returnPolicy || "";
|
|
25911
|
-
try {
|
|
25912
|
-
this.theme = this.themeJSON
|
|
25913
|
-
? new IkasTheme(JSON.parse(this.themeJSON))
|
|
25914
|
-
: new IkasTheme();
|
|
25915
|
-
}
|
|
25916
|
-
catch (err) { }
|
|
25917
|
-
mobx.makeAutoObservable(this);
|
|
25918
|
-
}
|
|
25919
|
-
return IkasStorefrontRegion;
|
|
25920
|
-
}());
|
|
25921
|
-
|
|
25922
|
-
var IkasStorefront = /** @class */ (function () {
|
|
25923
|
-
function IkasStorefront(data) {
|
|
25924
|
-
if (data === void 0) { data = {}; }
|
|
25925
|
-
this.id = data.id || "";
|
|
25926
|
-
this.name = data.name || "";
|
|
25927
|
-
this.themeId = data.themeId || "";
|
|
25928
|
-
this.themeVersionId = data.themeVersionId || "";
|
|
25929
|
-
this.userId = data.userId || "";
|
|
25930
|
-
this.domains = data.domains
|
|
25931
|
-
? data.domains.map(function (o) { return new IkasStorefrontDomain(o); })
|
|
25932
|
-
: [];
|
|
25933
|
-
this.regions = data.regions
|
|
25934
|
-
? data.regions.map(function (o) { return new IkasStorefrontRegion(o); })
|
|
25935
|
-
: [];
|
|
25936
|
-
mobx.makeAutoObservable(this);
|
|
25937
|
-
}
|
|
25938
|
-
return IkasStorefront;
|
|
25939
|
-
}());
|
|
25940
|
-
|
|
25941
|
-
var IkasStorefrontAPI = /** @class */ (function () {
|
|
25942
|
-
function IkasStorefrontAPI() {
|
|
25943
|
-
}
|
|
25944
|
-
IkasStorefrontAPI.getStorefront = function (storefrontId) {
|
|
25945
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
25946
|
-
var QUERY, _a, data, errors;
|
|
25947
|
-
return __generator(this, function (_b) {
|
|
25948
|
-
switch (_b.label) {
|
|
25949
|
-
case 0:
|
|
25950
|
-
QUERY = src(templateObject_1$f || (templateObject_1$f = __makeTemplateObject(["\n query getStorefront($storefrontId: String!) {\n getStorefront(id: $storefrontId) {\n id\n name\n themeId\n themeVersionId\n userId\n # domains {\n # id\n # merchantDomainId\n # name\n # redirectDomainName\n # }\n regions {\n id\n locale\n # themeJSON\n privacyPolicy\n returnPolicy\n termsOfService\n }\n }\n }\n "], ["\n query getStorefront($storefrontId: String!) {\n getStorefront(id: $storefrontId) {\n id\n name\n themeId\n themeVersionId\n userId\n # domains {\n # id\n # merchantDomainId\n # name\n # redirectDomainName\n # }\n regions {\n id\n locale\n # themeJSON\n privacyPolicy\n returnPolicy\n termsOfService\n }\n }\n }\n "])));
|
|
25951
|
-
_b.label = 1;
|
|
25952
|
-
case 1:
|
|
25953
|
-
_b.trys.push([1, 3, , 4]);
|
|
25954
|
-
return [4 /*yield*/, apollo
|
|
25955
|
-
.getClient()
|
|
25956
|
-
.query({
|
|
25957
|
-
query: QUERY,
|
|
25958
|
-
variables: {
|
|
25959
|
-
storefrontId: storefrontId,
|
|
25960
|
-
},
|
|
25961
|
-
})];
|
|
25962
|
-
case 2:
|
|
25963
|
-
_a = _b.sent(), data = _a.data, errors = _a.errors;
|
|
25964
|
-
if (errors && errors.length) {
|
|
25965
|
-
console.log(errors);
|
|
25966
|
-
}
|
|
25967
|
-
if (data)
|
|
25968
|
-
return [2 /*return*/, new IkasStorefront(data.getStorefront)];
|
|
25969
|
-
return [3 /*break*/, 4];
|
|
25970
|
-
case 3:
|
|
25971
|
-
_b.sent();
|
|
25972
|
-
return [3 /*break*/, 4];
|
|
25973
|
-
case 4: return [2 /*return*/, new IkasStorefront()];
|
|
25974
|
-
}
|
|
25975
|
-
});
|
|
25976
|
-
});
|
|
25977
|
-
};
|
|
25978
|
-
return IkasStorefrontAPI;
|
|
25979
|
-
}());
|
|
25980
|
-
var templateObject_1$f;
|
|
25981
|
-
|
|
25982
|
-
var IkasThemeAPI = /** @class */ (function () {
|
|
25983
|
-
function IkasThemeAPI() {
|
|
25984
|
-
}
|
|
25985
|
-
IkasThemeAPI.fetchTheme = function () {
|
|
25986
|
-
return new Promise(function (resolve, reject) {
|
|
25987
|
-
var serverRuntimeConfig = getConfig__default['default']().serverRuntimeConfig;
|
|
25988
|
-
var themeJSONPath = serverRuntimeConfig.THEME_JSON_PATH || "./src/theme.json";
|
|
25989
|
-
fs__default['default'].readFile(themeJSONPath, {
|
|
25990
|
-
flag: "a+",
|
|
25991
|
-
}, function (err, file) {
|
|
25992
|
-
if (err) {
|
|
25993
|
-
return reject(err);
|
|
25994
|
-
}
|
|
25995
|
-
var result = file.length ? JSON.parse(file.toString()) : {};
|
|
25996
|
-
resolve(new IkasTheme(result));
|
|
25997
|
-
});
|
|
25998
|
-
});
|
|
25999
|
-
};
|
|
26000
|
-
return IkasThemeAPI;
|
|
26001
|
-
}());
|
|
26002
|
-
|
|
26003
25881
|
var IkasVariantTypeAPI = /** @class */ (function () {
|
|
26004
25882
|
function IkasVariantTypeAPI() {
|
|
26005
25883
|
}
|
|
@@ -26009,7 +25887,7 @@ var IkasVariantTypeAPI = /** @class */ (function () {
|
|
|
26009
25887
|
return __generator(this, function (_b) {
|
|
26010
25888
|
switch (_b.label) {
|
|
26011
25889
|
case 0:
|
|
26012
|
-
LIST_VARIANT_TYPE = src(templateObject_1$
|
|
25890
|
+
LIST_VARIANT_TYPE = src(templateObject_1$f || (templateObject_1$f = __makeTemplateObject(["\n query listVariantType($id: StringFilterInput!) {\n listVariantType(id: $id) {\n id\n createdAt\n updatedAt\n deleted\n name\n selectionType\n values {\n id\n createdAt\n updatedAt\n deleted\n name\n thumbnailImageId\n colorCode\n }\n }\n }\n "], ["\n query listVariantType($id: StringFilterInput!) {\n listVariantType(id: $id) {\n id\n createdAt\n updatedAt\n deleted\n name\n selectionType\n values {\n id\n createdAt\n updatedAt\n deleted\n name\n thumbnailImageId\n colorCode\n }\n }\n }\n "])));
|
|
26013
25891
|
_b.label = 1;
|
|
26014
25892
|
case 1:
|
|
26015
25893
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -26055,7 +25933,7 @@ var IkasVariantTypeAPI = /** @class */ (function () {
|
|
|
26055
25933
|
};
|
|
26056
25934
|
return IkasVariantTypeAPI;
|
|
26057
25935
|
}());
|
|
26058
|
-
var templateObject_1$
|
|
25936
|
+
var templateObject_1$f;
|
|
26059
25937
|
|
|
26060
25938
|
function styleInject(css, ref) {
|
|
26061
25939
|
if ( ref === void 0 ) ref = {};
|
|
@@ -27245,6 +27123,11 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
27245
27123
|
name: product.name,
|
|
27246
27124
|
},
|
|
27247
27125
|
},
|
|
27126
|
+
priceListId: IkasStorefrontConfig.priceListId || null,
|
|
27127
|
+
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
27128
|
+
storefrontId: IkasStorefrontConfig.storefrontId,
|
|
27129
|
+
storefrontRoutingId: IkasStorefrontConfig.storefrontRoutingId,
|
|
27130
|
+
storefrontThemeId: IkasStorefrontConfig.storefrontThemeId,
|
|
27248
27131
|
};
|
|
27249
27132
|
return [4 /*yield*/, IkasCartAPI.saveItemToCart(input)];
|
|
27250
27133
|
case 1:
|
|
@@ -27285,6 +27168,11 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
27285
27168
|
name: item.variant.name,
|
|
27286
27169
|
},
|
|
27287
27170
|
},
|
|
27171
|
+
priceListId: IkasStorefrontConfig.priceListId || null,
|
|
27172
|
+
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
27173
|
+
storefrontId: IkasStorefrontConfig.storefrontId,
|
|
27174
|
+
storefrontRoutingId: IkasStorefrontConfig.storefrontRoutingId,
|
|
27175
|
+
storefrontThemeId: IkasStorefrontConfig.storefrontThemeId,
|
|
27288
27176
|
};
|
|
27289
27177
|
return [4 /*yield*/, IkasCartAPI.saveItemToCart(input)];
|
|
27290
27178
|
case 1:
|
|
@@ -27647,9 +27535,11 @@ function createCategoryBreadcrumbSchema(pageSpecificDataStr) {
|
|
|
27647
27535
|
|
|
27648
27536
|
var IkasCheckoutPage = mobxReactLite.observer(function (_a) {
|
|
27649
27537
|
var _b, _c, _d;
|
|
27650
|
-
var checkout = _a.checkout, queryParams = _a.queryParams;
|
|
27538
|
+
var checkout = _a.checkout, returnPolicy = _a.returnPolicy, privacyPolicy = _a.privacyPolicy, termsOfService = _a.termsOfService, queryParams = _a.queryParams;
|
|
27651
27539
|
var router$1 = router.useRouter();
|
|
27652
|
-
var vm = React.useState(function () {
|
|
27540
|
+
var vm = React.useState(function () {
|
|
27541
|
+
return new CheckoutViewModel(checkout, queryParams, router$1, returnPolicy, privacyPolicy, termsOfService);
|
|
27542
|
+
})[0];
|
|
27653
27543
|
React.useEffect(function () {
|
|
27654
27544
|
Analytics.beginCheckout(vm.checkout);
|
|
27655
27545
|
Analytics.checkoutStep(vm.checkout, vm.step);
|
|
@@ -27674,46 +27564,18 @@ var IkasCheckoutPage = mobxReactLite.observer(function (_a) {
|
|
|
27674
27564
|
var onPolicyModalClose = function () {
|
|
27675
27565
|
setPolicyModalText("");
|
|
27676
27566
|
};
|
|
27677
|
-
var onReturnPolicyClick = function () {
|
|
27678
|
-
|
|
27679
|
-
|
|
27680
|
-
|
|
27681
|
-
|
|
27682
|
-
|
|
27683
|
-
|
|
27684
|
-
|
|
27685
|
-
|
|
27686
|
-
|
|
27687
|
-
|
|
27688
|
-
|
|
27689
|
-
});
|
|
27690
|
-
}); };
|
|
27691
|
-
var onPrivacyPolicyClick = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
27692
|
-
var _a;
|
|
27693
|
-
return __generator(this, function (_b) {
|
|
27694
|
-
switch (_b.label) {
|
|
27695
|
-
case 0: return [4 /*yield*/, vm.getStorefront()];
|
|
27696
|
-
case 1:
|
|
27697
|
-
_b.sent();
|
|
27698
|
-
setPolicyModalTitle("Gizlilik Politikası");
|
|
27699
|
-
setPolicyModalText(((_a = vm.storefrontRegion) === null || _a === void 0 ? void 0 : _a.privacyPolicy) || "");
|
|
27700
|
-
return [2 /*return*/];
|
|
27701
|
-
}
|
|
27702
|
-
});
|
|
27703
|
-
}); };
|
|
27704
|
-
var onTermsOfServiceClick = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
27705
|
-
var _a;
|
|
27706
|
-
return __generator(this, function (_b) {
|
|
27707
|
-
switch (_b.label) {
|
|
27708
|
-
case 0: return [4 /*yield*/, vm.getStorefront()];
|
|
27709
|
-
case 1:
|
|
27710
|
-
_b.sent();
|
|
27711
|
-
setPolicyModalTitle("Hizmet Şartları");
|
|
27712
|
-
setPolicyModalText(((_a = vm.storefrontRegion) === null || _a === void 0 ? void 0 : _a.termsOfService) || "");
|
|
27713
|
-
return [2 /*return*/];
|
|
27714
|
-
}
|
|
27715
|
-
});
|
|
27716
|
-
}); };
|
|
27567
|
+
var onReturnPolicyClick = function () {
|
|
27568
|
+
setPolicyModalTitle("Para İade Politikası");
|
|
27569
|
+
setPolicyModalText(vm.returnPolicy);
|
|
27570
|
+
};
|
|
27571
|
+
var onPrivacyPolicyClick = function () {
|
|
27572
|
+
setPolicyModalTitle("Gizlilik Politikası");
|
|
27573
|
+
setPolicyModalText(vm.privacyPolicy);
|
|
27574
|
+
};
|
|
27575
|
+
var onTermsOfServiceClick = function () {
|
|
27576
|
+
setPolicyModalTitle("Hizmet Şartları");
|
|
27577
|
+
setPolicyModalText(vm.termsOfService);
|
|
27578
|
+
};
|
|
27717
27579
|
var onErrorClose = function () {
|
|
27718
27580
|
vm.error = undefined;
|
|
27719
27581
|
};
|
|
@@ -28333,6 +28195,230 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
28333
28195
|
Image: Image
|
|
28334
28196
|
});
|
|
28335
28197
|
|
|
28198
|
+
var IkasStorefrontLocalization = /** @class */ (function () {
|
|
28199
|
+
function IkasStorefrontLocalization(data) {
|
|
28200
|
+
this.id = data.id || "";
|
|
28201
|
+
this.isDefault = data.isDefault || false;
|
|
28202
|
+
this.locale = data.locale || "";
|
|
28203
|
+
this.name = data.name || "";
|
|
28204
|
+
}
|
|
28205
|
+
return IkasStorefrontLocalization;
|
|
28206
|
+
}());
|
|
28207
|
+
|
|
28208
|
+
var IkasStorefrontDomain = /** @class */ (function () {
|
|
28209
|
+
function IkasStorefrontDomain(data) {
|
|
28210
|
+
if (data === void 0) { data = {}; }
|
|
28211
|
+
this.id = data.id || "";
|
|
28212
|
+
this.merchantDomainId = data.merchantDomainId || "";
|
|
28213
|
+
this.name = data.name || "";
|
|
28214
|
+
this.redirectDomainName = data.redirectDomainName || null;
|
|
28215
|
+
this.isDefault = data.isDefault || false;
|
|
28216
|
+
mobx.makeAutoObservable(this);
|
|
28217
|
+
}
|
|
28218
|
+
return IkasStorefrontDomain;
|
|
28219
|
+
}());
|
|
28220
|
+
|
|
28221
|
+
var IkasStorefrontRouting = /** @class */ (function () {
|
|
28222
|
+
function IkasStorefrontRouting(data) {
|
|
28223
|
+
this.id = data.id || "";
|
|
28224
|
+
this.countryCodes = data.countryCodes || null;
|
|
28225
|
+
this.domain = data.domain || null;
|
|
28226
|
+
this.locale = data.locale || "";
|
|
28227
|
+
this.path = data.path || null;
|
|
28228
|
+
this.priceListId = data.priceListId || null;
|
|
28229
|
+
}
|
|
28230
|
+
return IkasStorefrontRouting;
|
|
28231
|
+
}());
|
|
28232
|
+
|
|
28233
|
+
var IkasStorefrontThemeStatus;
|
|
28234
|
+
(function (IkasStorefrontThemeStatus) {
|
|
28235
|
+
IkasStorefrontThemeStatus["WAITING"] = "WAITING";
|
|
28236
|
+
IkasStorefrontThemeStatus["READY"] = "READY";
|
|
28237
|
+
})(IkasStorefrontThemeStatus || (IkasStorefrontThemeStatus = {}));
|
|
28238
|
+
var IkasStorefrontTheme = /** @class */ (function () {
|
|
28239
|
+
function IkasStorefrontTheme(data) {
|
|
28240
|
+
this.id = data.id || "";
|
|
28241
|
+
this.isMainTheme = data.isMainTheme || false;
|
|
28242
|
+
this.name = data.name || "";
|
|
28243
|
+
this.status = data.status || IkasStorefrontThemeStatus.WAITING;
|
|
28244
|
+
this.themeId = data.themeId || "";
|
|
28245
|
+
this.themeVersionId = data.themeVersionId || "";
|
|
28246
|
+
}
|
|
28247
|
+
return IkasStorefrontTheme;
|
|
28248
|
+
}());
|
|
28249
|
+
|
|
28250
|
+
var IkasStorefrontThemeLocalization = /** @class */ (function () {
|
|
28251
|
+
function IkasStorefrontThemeLocalization(data) {
|
|
28252
|
+
this.id = data.id || "";
|
|
28253
|
+
this.locale = data.locale || "";
|
|
28254
|
+
this.storefrontId = data.storefrontId || "";
|
|
28255
|
+
this.storefrontThemeId = data.storefrontThemeId || "";
|
|
28256
|
+
this.themeJson = data.themeJson || "";
|
|
28257
|
+
this.privacyPolicy = data.privacyPolicy || null;
|
|
28258
|
+
this.returnPolicy = data.returnPolicy || null;
|
|
28259
|
+
this.termsOfService = data.termsOfService || null;
|
|
28260
|
+
}
|
|
28261
|
+
return IkasStorefrontThemeLocalization;
|
|
28262
|
+
}());
|
|
28263
|
+
|
|
28264
|
+
var StorefrontStatus;
|
|
28265
|
+
(function (StorefrontStatus) {
|
|
28266
|
+
StorefrontStatus["WAITING"] = "WAITING";
|
|
28267
|
+
StorefrontStatus["READY"] = "READY";
|
|
28268
|
+
})(StorefrontStatus || (StorefrontStatus = {}));
|
|
28269
|
+
var IkasStorefront = /** @class */ (function () {
|
|
28270
|
+
function IkasStorefront(data) {
|
|
28271
|
+
if (data === void 0) { data = {}; }
|
|
28272
|
+
this.id = data.id || "";
|
|
28273
|
+
this.name = data.name || "";
|
|
28274
|
+
this.status = data.status || StorefrontStatus.WAITING;
|
|
28275
|
+
this.mainStorefrontThemeId = data.mainStorefrontThemeId || null;
|
|
28276
|
+
this.emailSettingsId = data.emailSettingsId || null;
|
|
28277
|
+
this.salesChannelId = data.salesChannelId || null;
|
|
28278
|
+
this.gtmId = data.gtmId || null;
|
|
28279
|
+
this.fbpId = data.fbpId || null;
|
|
28280
|
+
// Sub Models
|
|
28281
|
+
this.localizations = data.localizations
|
|
28282
|
+
? data.localizations.map(function (l) { return new IkasStorefrontLocalization(l); })
|
|
28283
|
+
: [];
|
|
28284
|
+
this.routings = data.routings
|
|
28285
|
+
? data.routings.map(function (r) { return new IkasStorefrontRouting(r); })
|
|
28286
|
+
: [];
|
|
28287
|
+
this.domains = data.domains
|
|
28288
|
+
? data.domains.map(function (o) { return new IkasStorefrontDomain(o); })
|
|
28289
|
+
: [];
|
|
28290
|
+
this.themes = data.themes
|
|
28291
|
+
? data.themes.map(function (t) { return new IkasStorefrontTheme(t); })
|
|
28292
|
+
: [];
|
|
28293
|
+
this.regions = data.regions
|
|
28294
|
+
? data.regions.map(function (r) { return new IkasStorefrontThemeLocalization(r); })
|
|
28295
|
+
: [];
|
|
28296
|
+
}
|
|
28297
|
+
return IkasStorefront;
|
|
28298
|
+
}());
|
|
28299
|
+
|
|
28300
|
+
var IkasSalesChannel = /** @class */ (function () {
|
|
28301
|
+
function IkasSalesChannel(data) {
|
|
28302
|
+
var _a;
|
|
28303
|
+
this.id = data.id || "";
|
|
28304
|
+
this.name = data.name || "";
|
|
28305
|
+
this.priceListId = data.priceListId || "";
|
|
28306
|
+
this.stockLocations =
|
|
28307
|
+
((_a = data.stockLocations) === null || _a === void 0 ? void 0 : _a.map(function (sl) { return new IkasSalesChannelStockLocation(sl); })) ||
|
|
28308
|
+
[];
|
|
28309
|
+
}
|
|
28310
|
+
return IkasSalesChannel;
|
|
28311
|
+
}());
|
|
28312
|
+
var IkasSalesChannelStockLocation = /** @class */ (function () {
|
|
28313
|
+
function IkasSalesChannelStockLocation(data) {
|
|
28314
|
+
this.id = data.id || "";
|
|
28315
|
+
this.order = data.order || 0;
|
|
28316
|
+
}
|
|
28317
|
+
return IkasSalesChannelStockLocation;
|
|
28318
|
+
}());
|
|
28319
|
+
|
|
28320
|
+
var SettingsHelper = /** @class */ (function () {
|
|
28321
|
+
function SettingsHelper() {
|
|
28322
|
+
}
|
|
28323
|
+
SettingsHelper.getSettings = function (locale) {
|
|
28324
|
+
return new Promise(function (resolve) {
|
|
28325
|
+
var serverRuntimeConfig = getConfig__default['default']().serverRuntimeConfig;
|
|
28326
|
+
var settings = serverRuntimeConfig.SETTINGS;
|
|
28327
|
+
var storefront = new IkasStorefront(settings.storefront);
|
|
28328
|
+
var salesChannel = new IkasSalesChannel(settings.salesChannel);
|
|
28329
|
+
var localizationMap = settings.localizationMap;
|
|
28330
|
+
var themeJSONPath = localizationMap[locale];
|
|
28331
|
+
var routing = storefront.routings.find(function (r) { return r.id === locale || r.path === locale; });
|
|
28332
|
+
if (!themeJSONPath || !routing) {
|
|
28333
|
+
return resolve(null);
|
|
28334
|
+
}
|
|
28335
|
+
fs__default['default'].readFile(themeJSONPath, {
|
|
28336
|
+
flag: "a+",
|
|
28337
|
+
}, function (err, file) {
|
|
28338
|
+
if (err) {
|
|
28339
|
+
return resolve(null);
|
|
28340
|
+
}
|
|
28341
|
+
var result = file.length ? JSON.parse(file.toString()) : {};
|
|
28342
|
+
resolve({
|
|
28343
|
+
storefront: storefront,
|
|
28344
|
+
theme: new IkasTheme(result),
|
|
28345
|
+
salesChannel: salesChannel,
|
|
28346
|
+
routing: routing,
|
|
28347
|
+
});
|
|
28348
|
+
});
|
|
28349
|
+
});
|
|
28350
|
+
};
|
|
28351
|
+
SettingsHelper.getPageData = function (context, isServer, pageType) {
|
|
28352
|
+
var _a;
|
|
28353
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
28354
|
+
var locale, settings, storefront, theme, salesChannel, routing, provider;
|
|
28355
|
+
return __generator(this, function (_b) {
|
|
28356
|
+
switch (_b.label) {
|
|
28357
|
+
case 0:
|
|
28358
|
+
locale = context.locale || context.defaultLocale || "en";
|
|
28359
|
+
return [4 /*yield*/, SettingsHelper.getSettings(locale)];
|
|
28360
|
+
case 1:
|
|
28361
|
+
settings = _b.sent();
|
|
28362
|
+
if (!settings ||
|
|
28363
|
+
!settings.storefront.mainStorefrontThemeId ||
|
|
28364
|
+
!settings.storefront.salesChannelId ||
|
|
28365
|
+
!settings.routing.priceListId) {
|
|
28366
|
+
return [2 /*return*/, {
|
|
28367
|
+
props: {},
|
|
28368
|
+
notFound: true,
|
|
28369
|
+
}];
|
|
28370
|
+
}
|
|
28371
|
+
storefront = settings.storefront, theme = settings.theme, salesChannel = settings.salesChannel, routing = settings.routing;
|
|
28372
|
+
IkasStorefrontConfig.storefrontId = storefront.id;
|
|
28373
|
+
IkasStorefrontConfig.storefrontRoutingId = routing.id;
|
|
28374
|
+
IkasStorefrontConfig.storefrontThemeId = storefront.mainStorefrontThemeId;
|
|
28375
|
+
IkasStorefrontConfig.salesChannelId = storefront.salesChannelId;
|
|
28376
|
+
IkasStorefrontConfig.priceListId = routing.priceListId;
|
|
28377
|
+
IkasStorefrontConfig.stockLocationIds = (_a = salesChannel.stockLocations) === null || _a === void 0 ? void 0 : _a.map(function (sl) { return sl.id; });
|
|
28378
|
+
provider = new IkasPageDataProvider(theme, context.params, pageType);
|
|
28379
|
+
return [4 /*yield*/, provider.getPageData()];
|
|
28380
|
+
case 2:
|
|
28381
|
+
_b.sent();
|
|
28382
|
+
if (!provider.page) {
|
|
28383
|
+
return [2 /*return*/, {
|
|
28384
|
+
props: {},
|
|
28385
|
+
notFound: true,
|
|
28386
|
+
}];
|
|
28387
|
+
}
|
|
28388
|
+
if (isServer)
|
|
28389
|
+
return [2 /*return*/, provider.nextPageData];
|
|
28390
|
+
else
|
|
28391
|
+
return [2 /*return*/, {
|
|
28392
|
+
props: __assign(__assign({}, provider.nextPageData.props), { pageSpecificDataStr: JSON.stringify(provider.pageSpecificData || {}) }),
|
|
28393
|
+
revalidate: 60,
|
|
28394
|
+
}];
|
|
28395
|
+
}
|
|
28396
|
+
});
|
|
28397
|
+
});
|
|
28398
|
+
};
|
|
28399
|
+
SettingsHelper.getStaticProps = function (context, pageType) {
|
|
28400
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
28401
|
+
return __generator(this, function (_a) {
|
|
28402
|
+
switch (_a.label) {
|
|
28403
|
+
case 0: return [4 /*yield*/, SettingsHelper.getPageData(context, false, pageType)];
|
|
28404
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28405
|
+
}
|
|
28406
|
+
});
|
|
28407
|
+
});
|
|
28408
|
+
};
|
|
28409
|
+
SettingsHelper.getServerSideProps = function (context, pageType) {
|
|
28410
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
28411
|
+
return __generator(this, function (_a) {
|
|
28412
|
+
switch (_a.label) {
|
|
28413
|
+
case 0: return [4 /*yield*/, SettingsHelper.getPageData(context, false, pageType)];
|
|
28414
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28415
|
+
}
|
|
28416
|
+
});
|
|
28417
|
+
});
|
|
28418
|
+
};
|
|
28419
|
+
return SettingsHelper;
|
|
28420
|
+
}());
|
|
28421
|
+
|
|
28336
28422
|
var Page = function (_a) {
|
|
28337
28423
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings;
|
|
28338
28424
|
var router$1 = router.useRouter();
|
|
@@ -28340,17 +28426,10 @@ var Page = function (_a) {
|
|
|
28340
28426
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
|
|
28341
28427
|
};
|
|
28342
28428
|
var getStaticProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28343
|
-
var theme, provider;
|
|
28344
28429
|
return __generator(this, function (_a) {
|
|
28345
28430
|
switch (_a.label) {
|
|
28346
|
-
case 0: return [4 /*yield*/,
|
|
28347
|
-
case 1:
|
|
28348
|
-
theme = _a.sent();
|
|
28349
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.INDEX);
|
|
28350
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28351
|
-
case 2:
|
|
28352
|
-
_a.sent();
|
|
28353
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28431
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.INDEX)];
|
|
28432
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28354
28433
|
}
|
|
28355
28434
|
});
|
|
28356
28435
|
}); };
|
|
@@ -28392,6 +28471,7 @@ var getStaticPaths = function (context) { return __awaiter(void 0, void 0, void
|
|
|
28392
28471
|
productMetaData = metaData.filter(function (m) { return m.targetType && m.targetType === exports.IkasHTMLMetaDataTargetType.PRODUCT; });
|
|
28393
28472
|
return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
28394
28473
|
productIdList: productMetaData.map(function (p) { return p.targetId; }),
|
|
28474
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
28395
28475
|
})];
|
|
28396
28476
|
case 2:
|
|
28397
28477
|
productsResponse = _b.sent();
|
|
@@ -28438,25 +28518,10 @@ var getStaticPaths = function (context) { return __awaiter(void 0, void 0, void
|
|
|
28438
28518
|
});
|
|
28439
28519
|
}); };
|
|
28440
28520
|
var getStaticProps$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28441
|
-
var theme, provider;
|
|
28442
28521
|
return __generator(this, function (_a) {
|
|
28443
28522
|
switch (_a.label) {
|
|
28444
|
-
case 0: return [4 /*yield*/,
|
|
28445
|
-
case 1:
|
|
28446
|
-
theme = _a.sent();
|
|
28447
|
-
provider = new IkasPageDataProvider(theme, context.params, undefined);
|
|
28448
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28449
|
-
case 2:
|
|
28450
|
-
_a.sent();
|
|
28451
|
-
if (!provider.page) {
|
|
28452
|
-
return [2 /*return*/, {
|
|
28453
|
-
notFound: true,
|
|
28454
|
-
}];
|
|
28455
|
-
}
|
|
28456
|
-
return [2 /*return*/, {
|
|
28457
|
-
props: __assign(__assign({}, provider.nextPageData.props), { pageSpecificDataStr: JSON.stringify(provider.pageSpecificData || {}) }),
|
|
28458
|
-
revalidate: 60,
|
|
28459
|
-
}];
|
|
28523
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context)];
|
|
28524
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28460
28525
|
}
|
|
28461
28526
|
});
|
|
28462
28527
|
}); };
|
|
@@ -28501,19 +28566,38 @@ var Page$2 = function (_a) {
|
|
|
28501
28566
|
return (React.createElement(IkasPage, { page: page, settingsStr: settingsStr, propValues: propValues }));
|
|
28502
28567
|
};
|
|
28503
28568
|
var getStaticPaths$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28504
|
-
var
|
|
28569
|
+
var allSettings, customPagePaths;
|
|
28505
28570
|
return __generator(this, function (_a) {
|
|
28506
28571
|
switch (_a.label) {
|
|
28507
|
-
case 0:
|
|
28572
|
+
case 0:
|
|
28573
|
+
if (!context.locales)
|
|
28574
|
+
return [2 /*return*/, {
|
|
28575
|
+
paths: [],
|
|
28576
|
+
fallback: "blocking",
|
|
28577
|
+
}];
|
|
28578
|
+
return [4 /*yield*/, Promise.all(context.locales.map(function (locale) { return SettingsHelper.getSettings(locale); }))];
|
|
28508
28579
|
case 1:
|
|
28509
|
-
|
|
28510
|
-
|
|
28511
|
-
|
|
28512
|
-
|
|
28513
|
-
|
|
28580
|
+
allSettings = (_a.sent());
|
|
28581
|
+
customPagePaths = [];
|
|
28582
|
+
allSettings.forEach(function (_a) {
|
|
28583
|
+
var theme = _a.theme, routing = _a.routing;
|
|
28584
|
+
if (!theme)
|
|
28585
|
+
return;
|
|
28586
|
+
var customPages = theme.pages.filter(function (p) { return p.type === exports.IkasThemePageType.CUSTOM; });
|
|
28587
|
+
customPages.forEach(function (customPage) {
|
|
28588
|
+
if (customPage.slug &&
|
|
28589
|
+
!customPagePaths.some(function (p) { return p.params.slug === customPage.slug; })) {
|
|
28590
|
+
customPagePaths.push({
|
|
28591
|
+
params: { slug: customPage.slug },
|
|
28592
|
+
locale: routing.locale,
|
|
28593
|
+
});
|
|
28594
|
+
}
|
|
28595
|
+
});
|
|
28596
|
+
});
|
|
28514
28597
|
return [2 /*return*/, {
|
|
28515
28598
|
paths: customPagePaths.map(function (p) { return ({
|
|
28516
|
-
params: p,
|
|
28599
|
+
params: p.params,
|
|
28600
|
+
locale: p.locale,
|
|
28517
28601
|
}); }),
|
|
28518
28602
|
fallback: "blocking",
|
|
28519
28603
|
}];
|
|
@@ -28521,17 +28605,10 @@ var getStaticPaths$1 = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
28521
28605
|
});
|
|
28522
28606
|
}); };
|
|
28523
28607
|
var getStaticProps$2 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28524
|
-
var theme, provider;
|
|
28525
28608
|
return __generator(this, function (_a) {
|
|
28526
28609
|
switch (_a.label) {
|
|
28527
|
-
case 0: return [4 /*yield*/,
|
|
28528
|
-
case 1:
|
|
28529
|
-
theme = _a.sent();
|
|
28530
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.CUSTOM);
|
|
28531
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28532
|
-
case 2:
|
|
28533
|
-
_a.sent();
|
|
28534
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28610
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.CUSTOM)];
|
|
28611
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28535
28612
|
}
|
|
28536
28613
|
});
|
|
28537
28614
|
}); };
|
|
@@ -28544,18 +28621,38 @@ var _slug_ = /*#__PURE__*/Object.freeze({
|
|
|
28544
28621
|
});
|
|
28545
28622
|
|
|
28546
28623
|
var CheckoutPage = function (_a) {
|
|
28547
|
-
var checkoutStr = _a.checkoutStr,
|
|
28624
|
+
var checkoutStr = _a.checkoutStr, others = __rest(_a, ["checkoutStr"]);
|
|
28548
28625
|
Analytics.disableHTML();
|
|
28549
28626
|
var checkout = new IkasCheckout(JSON.parse(checkoutStr));
|
|
28550
|
-
return React.createElement(IkasCheckoutPage, { checkout: checkout,
|
|
28627
|
+
return React.createElement(IkasCheckoutPage, __assign({ checkout: checkout }, others));
|
|
28551
28628
|
};
|
|
28552
28629
|
var _id_ = mobxReactLite.observer(CheckoutPage);
|
|
28553
28630
|
var getServerSideProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28554
|
-
var id, redirect, checkout;
|
|
28631
|
+
var id, locale, settings, storefront, routing, redirect, checkout, region;
|
|
28555
28632
|
return __generator(this, function (_a) {
|
|
28556
28633
|
switch (_a.label) {
|
|
28557
28634
|
case 0:
|
|
28558
28635
|
id = context.query.id;
|
|
28636
|
+
locale = context.locale || context.defaultLocale || "en";
|
|
28637
|
+
return [4 /*yield*/, SettingsHelper.getSettings(locale)];
|
|
28638
|
+
case 1:
|
|
28639
|
+
settings = _a.sent();
|
|
28640
|
+
// TODO maybe remove this and convert this page to static
|
|
28641
|
+
if (!settings ||
|
|
28642
|
+
!settings.storefront.mainStorefrontThemeId ||
|
|
28643
|
+
!settings.storefront.salesChannelId ||
|
|
28644
|
+
!settings.routing.priceListId) {
|
|
28645
|
+
return [2 /*return*/, {
|
|
28646
|
+
props: {},
|
|
28647
|
+
notFound: true,
|
|
28648
|
+
}];
|
|
28649
|
+
}
|
|
28650
|
+
storefront = settings.storefront, routing = settings.routing;
|
|
28651
|
+
IkasStorefrontConfig.storefrontId = storefront.id;
|
|
28652
|
+
IkasStorefrontConfig.storefrontRoutingId = routing.id;
|
|
28653
|
+
IkasStorefrontConfig.storefrontThemeId = storefront.mainStorefrontThemeId;
|
|
28654
|
+
IkasStorefrontConfig.salesChannelId = storefront.salesChannelId;
|
|
28655
|
+
IkasStorefrontConfig.priceListId = routing.priceListId;
|
|
28559
28656
|
redirect = function () {
|
|
28560
28657
|
context.res.writeHead(302, { Location: "/" });
|
|
28561
28658
|
context.res.end();
|
|
@@ -28565,12 +28662,16 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
|
|
|
28565
28662
|
return [2 /*return*/, redirect()];
|
|
28566
28663
|
}
|
|
28567
28664
|
return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(id)];
|
|
28568
|
-
case
|
|
28665
|
+
case 2:
|
|
28569
28666
|
checkout = _a.sent();
|
|
28570
28667
|
if (checkout) {
|
|
28668
|
+
region = settings.storefront.regions.find(function (r) { return r.id === storefront.mainStorefrontThemeId; });
|
|
28571
28669
|
return [2 /*return*/, {
|
|
28572
28670
|
props: {
|
|
28573
28671
|
checkoutStr: JSON.stringify(checkout),
|
|
28672
|
+
returnPolicy: (region === null || region === void 0 ? void 0 : region.returnPolicy) || "",
|
|
28673
|
+
privacyPolicy: (region === null || region === void 0 ? void 0 : region.privacyPolicy) || "",
|
|
28674
|
+
termsOfService: (region === null || region === void 0 ? void 0 : region.termsOfService) || "",
|
|
28574
28675
|
queryParams: context.query,
|
|
28575
28676
|
},
|
|
28576
28677
|
}];
|
|
@@ -28595,17 +28696,10 @@ var Page$3 = function (_a) {
|
|
|
28595
28696
|
return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28596
28697
|
};
|
|
28597
28698
|
var getStaticProps$3 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28598
|
-
var theme, provider;
|
|
28599
28699
|
return __generator(this, function (_a) {
|
|
28600
28700
|
switch (_a.label) {
|
|
28601
|
-
case 0: return [4 /*yield*/,
|
|
28602
|
-
case 1:
|
|
28603
|
-
theme = _a.sent();
|
|
28604
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.ACCOUNT);
|
|
28605
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28606
|
-
case 2:
|
|
28607
|
-
_a.sent();
|
|
28608
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28701
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.ACCOUNT)];
|
|
28702
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28609
28703
|
}
|
|
28610
28704
|
});
|
|
28611
28705
|
}); };
|
|
@@ -28623,17 +28717,10 @@ var Page$4 = function (_a) {
|
|
|
28623
28717
|
return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28624
28718
|
};
|
|
28625
28719
|
var getStaticProps$4 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28626
|
-
var theme, provider;
|
|
28627
28720
|
return __generator(this, function (_a) {
|
|
28628
28721
|
switch (_a.label) {
|
|
28629
|
-
case 0: return [4 /*yield*/,
|
|
28630
|
-
case 1:
|
|
28631
|
-
theme = _a.sent();
|
|
28632
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.ADDRESSES);
|
|
28633
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28634
|
-
case 2:
|
|
28635
|
-
_a.sent();
|
|
28636
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28722
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.ADDRESSES)];
|
|
28723
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28637
28724
|
}
|
|
28638
28725
|
});
|
|
28639
28726
|
}); };
|
|
@@ -28651,17 +28738,10 @@ var Page$5 = function (_a) {
|
|
|
28651
28738
|
return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28652
28739
|
};
|
|
28653
28740
|
var getStaticProps$5 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28654
|
-
var theme, provider;
|
|
28655
28741
|
return __generator(this, function (_a) {
|
|
28656
28742
|
switch (_a.label) {
|
|
28657
|
-
case 0: return [4 /*yield*/,
|
|
28658
|
-
case 1:
|
|
28659
|
-
theme = _a.sent();
|
|
28660
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.ORDERS);
|
|
28661
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28662
|
-
case 2:
|
|
28663
|
-
_a.sent();
|
|
28664
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28743
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.ORDERS)];
|
|
28744
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28665
28745
|
}
|
|
28666
28746
|
});
|
|
28667
28747
|
}); };
|
|
@@ -28679,17 +28759,10 @@ var Page$6 = function (_a) {
|
|
|
28679
28759
|
return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28680
28760
|
};
|
|
28681
28761
|
var getServerSideProps$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28682
|
-
var theme, provider;
|
|
28683
28762
|
return __generator(this, function (_a) {
|
|
28684
28763
|
switch (_a.label) {
|
|
28685
|
-
case 0: return [4 /*yield*/,
|
|
28686
|
-
case 1:
|
|
28687
|
-
theme = _a.sent();
|
|
28688
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.ORDER_DETAIL);
|
|
28689
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28690
|
-
case 2:
|
|
28691
|
-
_a.sent();
|
|
28692
|
-
return [2 /*return*/, provider.nextPageData];
|
|
28764
|
+
case 0: return [4 /*yield*/, SettingsHelper.getServerSideProps(context, exports.IkasThemePageType.ORDER_DETAIL)];
|
|
28765
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28693
28766
|
}
|
|
28694
28767
|
});
|
|
28695
28768
|
}); };
|
|
@@ -28707,17 +28780,10 @@ var Page$7 = function (_a) {
|
|
|
28707
28780
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28708
28781
|
};
|
|
28709
28782
|
var getStaticProps$6 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28710
|
-
var theme, provider;
|
|
28711
28783
|
return __generator(this, function (_a) {
|
|
28712
28784
|
switch (_a.label) {
|
|
28713
|
-
case 0: return [4 /*yield*/,
|
|
28714
|
-
case 1:
|
|
28715
|
-
theme = _a.sent();
|
|
28716
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.LOGIN);
|
|
28717
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28718
|
-
case 2:
|
|
28719
|
-
_a.sent();
|
|
28720
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28785
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.LOGIN)];
|
|
28786
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28721
28787
|
}
|
|
28722
28788
|
});
|
|
28723
28789
|
}); };
|
|
@@ -28735,17 +28801,10 @@ var Page$8 = function (_a) {
|
|
|
28735
28801
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28736
28802
|
};
|
|
28737
28803
|
var getStaticProps$7 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28738
|
-
var theme, provider;
|
|
28739
28804
|
return __generator(this, function (_a) {
|
|
28740
28805
|
switch (_a.label) {
|
|
28741
|
-
case 0: return [4 /*yield*/,
|
|
28742
|
-
case 1:
|
|
28743
|
-
theme = _a.sent();
|
|
28744
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.REGISTER);
|
|
28745
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28746
|
-
case 2:
|
|
28747
|
-
_a.sent();
|
|
28748
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28806
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.REGISTER)];
|
|
28807
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28749
28808
|
}
|
|
28750
28809
|
});
|
|
28751
28810
|
}); };
|
|
@@ -28763,17 +28822,10 @@ var Page$9 = function (_a) {
|
|
|
28763
28822
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28764
28823
|
};
|
|
28765
28824
|
var getStaticProps$8 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28766
|
-
var theme, provider;
|
|
28767
28825
|
return __generator(this, function (_a) {
|
|
28768
28826
|
switch (_a.label) {
|
|
28769
|
-
case 0: return [4 /*yield*/,
|
|
28770
|
-
case 1:
|
|
28771
|
-
theme = _a.sent();
|
|
28772
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.FORGOT_PASSWORD);
|
|
28773
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28774
|
-
case 2:
|
|
28775
|
-
_a.sent();
|
|
28776
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28827
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.FORGOT_PASSWORD)];
|
|
28828
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28777
28829
|
}
|
|
28778
28830
|
});
|
|
28779
28831
|
}); };
|
|
@@ -28791,17 +28843,10 @@ var Page$a = function (_a) {
|
|
|
28791
28843
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28792
28844
|
};
|
|
28793
28845
|
var getStaticProps$9 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28794
|
-
var theme, provider;
|
|
28795
28846
|
return __generator(this, function (_a) {
|
|
28796
28847
|
switch (_a.label) {
|
|
28797
|
-
case 0: return [4 /*yield*/,
|
|
28798
|
-
case 1:
|
|
28799
|
-
theme = _a.sent();
|
|
28800
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.RECOVER_PASSWORD);
|
|
28801
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28802
|
-
case 2:
|
|
28803
|
-
_a.sent();
|
|
28804
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28848
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.RECOVER_PASSWORD)];
|
|
28849
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28805
28850
|
}
|
|
28806
28851
|
});
|
|
28807
28852
|
}); };
|
|
@@ -28823,17 +28868,10 @@ var Page$b = function (_a) {
|
|
|
28823
28868
|
return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28824
28869
|
};
|
|
28825
28870
|
var getStaticProps$a = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28826
|
-
var theme, provider;
|
|
28827
28871
|
return __generator(this, function (_a) {
|
|
28828
28872
|
switch (_a.label) {
|
|
28829
|
-
case 0: return [4 /*yield*/,
|
|
28830
|
-
case 1:
|
|
28831
|
-
theme = _a.sent();
|
|
28832
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.CART);
|
|
28833
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28834
|
-
case 2:
|
|
28835
|
-
_a.sent();
|
|
28836
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28873
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.CART)];
|
|
28874
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28837
28875
|
}
|
|
28838
28876
|
});
|
|
28839
28877
|
}); };
|
|
@@ -28862,17 +28900,10 @@ var Page$d = function (_a) {
|
|
|
28862
28900
|
return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28863
28901
|
};
|
|
28864
28902
|
var getStaticProps$b = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28865
|
-
var theme, provider;
|
|
28866
28903
|
return __generator(this, function (_a) {
|
|
28867
28904
|
switch (_a.label) {
|
|
28868
|
-
case 0: return [4 /*yield*/,
|
|
28869
|
-
case 1:
|
|
28870
|
-
theme = _a.sent();
|
|
28871
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.FAVORITE_PRODUCTS);
|
|
28872
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28873
|
-
case 2:
|
|
28874
|
-
_a.sent();
|
|
28875
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28905
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.FAVORITE_PRODUCTS)];
|
|
28906
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28876
28907
|
}
|
|
28877
28908
|
});
|
|
28878
28909
|
}); };
|
|
@@ -28898,17 +28929,10 @@ var Page$e = function (_a) {
|
|
|
28898
28929
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
|
|
28899
28930
|
};
|
|
28900
28931
|
var getStaticProps$c = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28901
|
-
var theme, provider;
|
|
28902
28932
|
return __generator(this, function (_a) {
|
|
28903
28933
|
switch (_a.label) {
|
|
28904
|
-
case 0: return [4 /*yield*/,
|
|
28905
|
-
case 1:
|
|
28906
|
-
theme = _a.sent();
|
|
28907
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.SEARCH);
|
|
28908
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28909
|
-
case 2:
|
|
28910
|
-
_a.sent();
|
|
28911
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28934
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.SEARCH)];
|
|
28935
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28912
28936
|
}
|
|
28913
28937
|
});
|
|
28914
28938
|
}); };
|
|
@@ -28926,17 +28950,10 @@ var Page$f = function (_a) {
|
|
|
28926
28950
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28927
28951
|
};
|
|
28928
28952
|
var getStaticProps$d = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28929
|
-
var theme, provider;
|
|
28930
28953
|
return __generator(this, function (_a) {
|
|
28931
28954
|
switch (_a.label) {
|
|
28932
|
-
case 0: return [4 /*yield*/,
|
|
28933
|
-
case 1:
|
|
28934
|
-
theme = _a.sent();
|
|
28935
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.NOT_FOUND);
|
|
28936
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28937
|
-
case 2:
|
|
28938
|
-
_a.sent();
|
|
28939
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28955
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.NOT_FOUND)];
|
|
28956
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28940
28957
|
}
|
|
28941
28958
|
});
|
|
28942
28959
|
}); };
|
|
@@ -29036,10 +29053,8 @@ exports.IkasProductSearchAPI = IkasProductSearchAPI;
|
|
|
29036
29053
|
exports.IkasProductVariant = IkasProductVariant;
|
|
29037
29054
|
exports.IkasProductVariantType = IkasProductVariantType;
|
|
29038
29055
|
exports.IkasStateAPI = IkasStateAPI;
|
|
29039
|
-
exports.IkasStorefrontAPI = IkasStorefrontAPI;
|
|
29040
29056
|
exports.IkasStorefrontConfig = IkasStorefrontConfig;
|
|
29041
29057
|
exports.IkasTheme = IkasTheme;
|
|
29042
|
-
exports.IkasThemeAPI = IkasThemeAPI;
|
|
29043
29058
|
exports.IkasThemeComponent = IkasThemeComponent;
|
|
29044
29059
|
exports.IkasThemeComponentProp = IkasThemeComponentProp;
|
|
29045
29060
|
exports.IkasThemeCustomData = IkasThemeCustomData;
|