@ikas/storefront 0.0.112 → 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
@@ -17697,7 +17697,6 @@ var CheckoutViewModel = /** @class */ (function () {
17697
17697
  return __generator(this, function (_b) {
17698
17698
  switch (_b.label) {
17699
17699
  case 0:
17700
- console.log(IkasStorefrontConfig);
17701
17700
  this.createCustomer();
17702
17701
  this.createShippingAddress();
17703
17702
  this.createBillingAddress();
@@ -29014,15 +29013,16 @@ var CheckoutPage = function (_a) {
29014
29013
  };
29015
29014
  var _id_ = observer(CheckoutPage);
29016
29015
  var getServerSideProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
29017
- var id, locale, settings, storefront, themeLocalization, routing, redirect, checkout, checkoutSettings;
29018
- return __generator(this, function (_a) {
29019
- 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) {
29020
29020
  case 0:
29021
29021
  id = context.query.id;
29022
29022
  locale = context.locale || context.defaultLocale || "en";
29023
29023
  return [4 /*yield*/, SettingsHelper.getSettings(locale)];
29024
29024
  case 1:
29025
- settings = _a.sent();
29025
+ settings = _b.sent();
29026
29026
  // TODO maybe remove this and convert this page to static
29027
29027
  if (!settings ||
29028
29028
  !settings.storefront.mainStorefrontThemeId ||
@@ -29032,11 +29032,17 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
29032
29032
  notFound: true,
29033
29033
  }];
29034
29034
  }
29035
- storefront = settings.storefront, themeLocalization = settings.themeLocalization, routing = settings.routing;
29035
+ storefront = settings.storefront, themeLocalization = settings.themeLocalization, salesChannel = settings.salesChannel, routing = settings.routing;
29036
29036
  IkasStorefrontConfig.storefrontId = storefront.id;
29037
29037
  IkasStorefrontConfig.storefrontRoutingId = routing.id;
29038
29038
  IkasStorefrontConfig.storefrontThemeId = storefront.mainStorefrontThemeId;
29039
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;
29040
29046
  redirect = function () {
29041
29047
  context.res.writeHead(302, { Location: "/" });
29042
29048
  context.res.end();
@@ -29047,11 +29053,11 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
29047
29053
  }
29048
29054
  return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(id)];
29049
29055
  case 2:
29050
- checkout = _a.sent();
29056
+ checkout = _b.sent();
29051
29057
  if (!checkout) return [3 /*break*/, 4];
29052
29058
  return [4 /*yield*/, IkasCheckoutAPI.listCheckoutSettings()];
29053
29059
  case 3:
29054
- checkoutSettings = _a.sent();
29060
+ checkoutSettings = _b.sent();
29055
29061
  return [2 /*return*/, {
29056
29062
  props: {
29057
29063
  checkoutStr: JSON.stringify(checkout),
package/build/index.js CHANGED
@@ -17703,7 +17703,6 @@ var CheckoutViewModel = /** @class */ (function () {
17703
17703
  return __generator(this, function (_b) {
17704
17704
  switch (_b.label) {
17705
17705
  case 0:
17706
- console.log(IkasStorefrontConfig);
17707
17706
  this.createCustomer();
17708
17707
  this.createShippingAddress();
17709
17708
  this.createBillingAddress();
@@ -28994,15 +28993,16 @@ var CheckoutPage = function (_a) {
28994
28993
  };
28995
28994
  var _id_ = mobxReactLite.observer(CheckoutPage);
28996
28995
  var getServerSideProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28997
- var id, locale, settings, storefront, themeLocalization, routing, redirect, checkout, checkoutSettings;
28998
- return __generator(this, function (_a) {
28999
- 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) {
29000
29000
  case 0:
29001
29001
  id = context.query.id;
29002
29002
  locale = context.locale || context.defaultLocale || "en";
29003
29003
  return [4 /*yield*/, SettingsHelper.getSettings(locale)];
29004
29004
  case 1:
29005
- settings = _a.sent();
29005
+ settings = _b.sent();
29006
29006
  // TODO maybe remove this and convert this page to static
29007
29007
  if (!settings ||
29008
29008
  !settings.storefront.mainStorefrontThemeId ||
@@ -29012,11 +29012,17 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
29012
29012
  notFound: true,
29013
29013
  }];
29014
29014
  }
29015
- storefront = settings.storefront, themeLocalization = settings.themeLocalization, routing = settings.routing;
29015
+ storefront = settings.storefront, themeLocalization = settings.themeLocalization, salesChannel = settings.salesChannel, routing = settings.routing;
29016
29016
  IkasStorefrontConfig.storefrontId = storefront.id;
29017
29017
  IkasStorefrontConfig.storefrontRoutingId = routing.id;
29018
29018
  IkasStorefrontConfig.storefrontThemeId = storefront.mainStorefrontThemeId;
29019
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;
29020
29026
  redirect = function () {
29021
29027
  context.res.writeHead(302, { Location: "/" });
29022
29028
  context.res.end();
@@ -29027,11 +29033,11 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
29027
29033
  }
29028
29034
  return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(id)];
29029
29035
  case 2:
29030
- checkout = _a.sent();
29036
+ checkout = _b.sent();
29031
29037
  if (!checkout) return [3 /*break*/, 4];
29032
29038
  return [4 /*yield*/, IkasCheckoutAPI.listCheckoutSettings()];
29033
29039
  case 3:
29034
- checkoutSettings = _a.sent();
29040
+ checkoutSettings = _b.sent();
29035
29041
  return [2 /*return*/, {
29036
29042
  props: {
29037
29043
  checkoutStr: JSON.stringify(checkout),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.112",
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",