@ikas/storefront 0.0.113 → 0.0.114

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/index.es.js CHANGED
@@ -17854,7 +17854,6 @@ var CheckoutViewModel = /** @class */ (function () {
17854
17854
  return __generator(this, function (_a) {
17855
17855
  switch (_a.label) {
17856
17856
  case 0:
17857
- console.log(IkasStorefrontConfig.paymentGateways);
17858
17857
  isLocal = process.env.NEXT_PUBLIC_ENV === "local";
17859
17858
  idList = IkasStorefrontConfig.paymentGateways.map(function (pg) { return pg.id; });
17860
17859
  return [4 /*yield*/, IkasCheckoutAPI.listPaymentGateway(isLocal ? undefined : idList)];
@@ -17872,7 +17871,6 @@ var CheckoutViewModel = /** @class */ (function () {
17872
17871
  if (_pg)
17873
17872
  orderedPaymentGateways.push(_pg);
17874
17873
  });
17875
- console.log(orderedPaymentGateways);
17876
17874
  this.paymentGateways = orderedPaymentGateways;
17877
17875
  if (!this.paymentGatewayId)
17878
17876
  this.setPaymentGateway(0);
@@ -29015,15 +29013,16 @@ var CheckoutPage = function (_a) {
29015
29013
  };
29016
29014
  var _id_ = observer(CheckoutPage);
29017
29015
  var getServerSideProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
29018
- var id, locale, settings, storefront, themeLocalization, routing, redirect, checkout, checkoutSettings;
29019
- return __generator(this, function (_a) {
29020
- switch (_a.label) {
29016
+ var id, locale, settings, storefront, themeLocalization, salesChannel, routing, redirect, checkout, checkoutSettings;
29017
+ var _a;
29018
+ return __generator(this, function (_b) {
29019
+ switch (_b.label) {
29021
29020
  case 0:
29022
29021
  id = context.query.id;
29023
29022
  locale = context.locale || context.defaultLocale || "en";
29024
29023
  return [4 /*yield*/, SettingsHelper.getSettings(locale)];
29025
29024
  case 1:
29026
- settings = _a.sent();
29025
+ settings = _b.sent();
29027
29026
  // TODO maybe remove this and convert this page to static
29028
29027
  if (!settings ||
29029
29028
  !settings.storefront.mainStorefrontThemeId ||
@@ -29033,11 +29032,17 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
29033
29032
  notFound: true,
29034
29033
  }];
29035
29034
  }
29036
- storefront = settings.storefront, themeLocalization = settings.themeLocalization, routing = settings.routing;
29035
+ storefront = settings.storefront, themeLocalization = settings.themeLocalization, salesChannel = settings.salesChannel, routing = settings.routing;
29037
29036
  IkasStorefrontConfig.storefrontId = storefront.id;
29038
29037
  IkasStorefrontConfig.storefrontRoutingId = routing.id;
29039
29038
  IkasStorefrontConfig.storefrontThemeId = storefront.mainStorefrontThemeId;
29040
29039
  IkasStorefrontConfig.salesChannelId = storefront.salesChannelId;
29040
+ IkasStorefrontConfig.priceListId = routing.priceListId || undefined;
29041
+ IkasStorefrontConfig.stockLocationIds = (_a = salesChannel.stockLocations) === null || _a === void 0 ? void 0 : _a.map(function (sl) { return sl.id; });
29042
+ IkasStorefrontConfig.routings = storefront.routings;
29043
+ IkasStorefrontConfig.paymentGateways = salesChannel.paymentGateways || [];
29044
+ IkasStorefrontConfig.gtmId = storefront.gtmId || undefined;
29045
+ IkasStorefrontConfig.fbpId = storefront.fbpId || undefined;
29041
29046
  redirect = function () {
29042
29047
  context.res.writeHead(302, { Location: "/" });
29043
29048
  context.res.end();
@@ -29048,11 +29053,11 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
29048
29053
  }
29049
29054
  return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(id)];
29050
29055
  case 2:
29051
- checkout = _a.sent();
29056
+ checkout = _b.sent();
29052
29057
  if (!checkout) return [3 /*break*/, 4];
29053
29058
  return [4 /*yield*/, IkasCheckoutAPI.listCheckoutSettings()];
29054
29059
  case 3:
29055
- checkoutSettings = _a.sent();
29060
+ checkoutSettings = _b.sent();
29056
29061
  return [2 /*return*/, {
29057
29062
  props: {
29058
29063
  checkoutStr: JSON.stringify(checkout),
package/build/index.js CHANGED
@@ -17860,7 +17860,6 @@ var CheckoutViewModel = /** @class */ (function () {
17860
17860
  return __generator(this, function (_a) {
17861
17861
  switch (_a.label) {
17862
17862
  case 0:
17863
- console.log(IkasStorefrontConfig.paymentGateways);
17864
17863
  isLocal = process.env.NEXT_PUBLIC_ENV === "local";
17865
17864
  idList = IkasStorefrontConfig.paymentGateways.map(function (pg) { return pg.id; });
17866
17865
  return [4 /*yield*/, IkasCheckoutAPI.listPaymentGateway(isLocal ? undefined : idList)];
@@ -17878,7 +17877,6 @@ var CheckoutViewModel = /** @class */ (function () {
17878
17877
  if (_pg)
17879
17878
  orderedPaymentGateways.push(_pg);
17880
17879
  });
17881
- console.log(orderedPaymentGateways);
17882
17880
  this.paymentGateways = orderedPaymentGateways;
17883
17881
  if (!this.paymentGatewayId)
17884
17882
  this.setPaymentGateway(0);
@@ -28995,15 +28993,16 @@ var CheckoutPage = function (_a) {
28995
28993
  };
28996
28994
  var _id_ = mobxReactLite.observer(CheckoutPage);
28997
28995
  var getServerSideProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28998
- var id, locale, settings, storefront, themeLocalization, routing, redirect, checkout, checkoutSettings;
28999
- return __generator(this, function (_a) {
29000
- switch (_a.label) {
28996
+ var id, locale, settings, storefront, themeLocalization, salesChannel, routing, redirect, checkout, checkoutSettings;
28997
+ var _a;
28998
+ return __generator(this, function (_b) {
28999
+ switch (_b.label) {
29001
29000
  case 0:
29002
29001
  id = context.query.id;
29003
29002
  locale = context.locale || context.defaultLocale || "en";
29004
29003
  return [4 /*yield*/, SettingsHelper.getSettings(locale)];
29005
29004
  case 1:
29006
- settings = _a.sent();
29005
+ settings = _b.sent();
29007
29006
  // TODO maybe remove this and convert this page to static
29008
29007
  if (!settings ||
29009
29008
  !settings.storefront.mainStorefrontThemeId ||
@@ -29013,11 +29012,17 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
29013
29012
  notFound: true,
29014
29013
  }];
29015
29014
  }
29016
- storefront = settings.storefront, themeLocalization = settings.themeLocalization, routing = settings.routing;
29015
+ storefront = settings.storefront, themeLocalization = settings.themeLocalization, salesChannel = settings.salesChannel, routing = settings.routing;
29017
29016
  IkasStorefrontConfig.storefrontId = storefront.id;
29018
29017
  IkasStorefrontConfig.storefrontRoutingId = routing.id;
29019
29018
  IkasStorefrontConfig.storefrontThemeId = storefront.mainStorefrontThemeId;
29020
29019
  IkasStorefrontConfig.salesChannelId = storefront.salesChannelId;
29020
+ IkasStorefrontConfig.priceListId = routing.priceListId || undefined;
29021
+ IkasStorefrontConfig.stockLocationIds = (_a = salesChannel.stockLocations) === null || _a === void 0 ? void 0 : _a.map(function (sl) { return sl.id; });
29022
+ IkasStorefrontConfig.routings = storefront.routings;
29023
+ IkasStorefrontConfig.paymentGateways = salesChannel.paymentGateways || [];
29024
+ IkasStorefrontConfig.gtmId = storefront.gtmId || undefined;
29025
+ IkasStorefrontConfig.fbpId = storefront.fbpId || undefined;
29021
29026
  redirect = function () {
29022
29027
  context.res.writeHead(302, { Location: "/" });
29023
29028
  context.res.end();
@@ -29028,11 +29033,11 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
29028
29033
  }
29029
29034
  return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(id)];
29030
29035
  case 2:
29031
- checkout = _a.sent();
29036
+ checkout = _b.sent();
29032
29037
  if (!checkout) return [3 /*break*/, 4];
29033
29038
  return [4 /*yield*/, IkasCheckoutAPI.listCheckoutSettings()];
29034
29039
  case 3:
29035
- checkoutSettings = _a.sent();
29040
+ checkoutSettings = _b.sent();
29036
29041
  return [2 /*return*/, {
29037
29042
  props: {
29038
29043
  checkoutStr: JSON.stringify(checkout),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.113",
3
+ "version": "0.0.114",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",