@ikas/storefront 0.0.47 → 0.0.48

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
@@ -11770,6 +11770,7 @@ var IkasPageDataProvider = /** @class */ (function () {
11770
11770
  this.pageParams = {};
11771
11771
  this.pageComponentPropValues = [];
11772
11772
  this.pageSpecificData = null;
11773
+ this.merchantSettings = null;
11773
11774
  this.theme = new IkasTheme(theme);
11774
11775
  this.pageParams = pageParams || {};
11775
11776
  this.pageType = pageType;
@@ -11794,7 +11795,9 @@ var IkasPageDataProvider = /** @class */ (function () {
11794
11795
  propValuesStr: JSON.stringify(this.pageComponentPropValues),
11795
11796
  page: toJS(this.page) || null,
11796
11797
  settingsStr: JSON.stringify(this.theme.settings || {}),
11797
- merchantSettings: JSON.stringify(this.merchantSettings),
11798
+ merchantSettings: this.merchantSettings
11799
+ ? JSON.stringify(this.merchantSettings)
11800
+ : null,
11798
11801
  },
11799
11802
  };
11800
11803
  },
@@ -11812,9 +11815,27 @@ var IkasPageDataProvider = /** @class */ (function () {
11812
11815
  enumerable: false,
11813
11816
  configurable: true
11814
11817
  });
11818
+ IkasPageDataProvider.prototype.getMerchantSettings = function () {
11819
+ return __awaiter(this, void 0, void 0, function () {
11820
+ var merchantId, merchantSettingsResponse;
11821
+ return __generator(this, function (_a) {
11822
+ switch (_a.label) {
11823
+ case 0:
11824
+ merchantId = decodeBase64(IkasStorefrontConfig.config.apiKey || "");
11825
+ return [4 /*yield*/, IkasMerchantAPI.listMerchantSettings(merchantId)];
11826
+ case 1:
11827
+ merchantSettingsResponse = _a.sent();
11828
+ if (merchantSettingsResponse) {
11829
+ this.merchantSettings = merchantSettingsResponse;
11830
+ }
11831
+ return [2 /*return*/];
11832
+ }
11833
+ });
11834
+ });
11835
+ };
11815
11836
  IkasPageDataProvider.prototype.getPageData = function () {
11816
11837
  return __awaiter(this, void 0, void 0, function () {
11817
- var merchantId, merchantSettingsResponse, _a;
11838
+ var _a;
11818
11839
  var _this = this;
11819
11840
  return __generator(this, function (_b) {
11820
11841
  switch (_b.label) {
@@ -11827,13 +11848,9 @@ var IkasPageDataProvider = /** @class */ (function () {
11827
11848
  case 2:
11828
11849
  if (!this.page)
11829
11850
  return [2 /*return*/];
11830
- merchantId = decodeBase64(IkasStorefrontConfig.config.apiKey || "");
11831
- return [4 /*yield*/, IkasMerchantAPI.listMerchantSettings(merchantId)];
11851
+ return [4 /*yield*/, this.getMerchantSettings()];
11832
11852
  case 3:
11833
- merchantSettingsResponse = _b.sent();
11834
- if (merchantSettingsResponse) {
11835
- this.merchantSettings = merchantSettingsResponse;
11836
- }
11853
+ _b.sent();
11837
11854
  _a = this;
11838
11855
  return [4 /*yield*/, Promise.all(this.page.components.map(function (pageComponent) {
11839
11856
  return _this.getPageComponentPropValues(pageComponent);
package/build/index.js CHANGED
@@ -11782,6 +11782,7 @@ var IkasPageDataProvider = /** @class */ (function () {
11782
11782
  this.pageParams = {};
11783
11783
  this.pageComponentPropValues = [];
11784
11784
  this.pageSpecificData = null;
11785
+ this.merchantSettings = null;
11785
11786
  this.theme = new IkasTheme(theme);
11786
11787
  this.pageParams = pageParams || {};
11787
11788
  this.pageType = pageType;
@@ -11806,7 +11807,9 @@ var IkasPageDataProvider = /** @class */ (function () {
11806
11807
  propValuesStr: JSON.stringify(this.pageComponentPropValues),
11807
11808
  page: mobx.toJS(this.page) || null,
11808
11809
  settingsStr: JSON.stringify(this.theme.settings || {}),
11809
- merchantSettings: JSON.stringify(this.merchantSettings),
11810
+ merchantSettings: this.merchantSettings
11811
+ ? JSON.stringify(this.merchantSettings)
11812
+ : null,
11810
11813
  },
11811
11814
  };
11812
11815
  },
@@ -11824,9 +11827,27 @@ var IkasPageDataProvider = /** @class */ (function () {
11824
11827
  enumerable: false,
11825
11828
  configurable: true
11826
11829
  });
11830
+ IkasPageDataProvider.prototype.getMerchantSettings = function () {
11831
+ return __awaiter(this, void 0, void 0, function () {
11832
+ var merchantId, merchantSettingsResponse;
11833
+ return __generator(this, function (_a) {
11834
+ switch (_a.label) {
11835
+ case 0:
11836
+ merchantId = decodeBase64(IkasStorefrontConfig.config.apiKey || "");
11837
+ return [4 /*yield*/, IkasMerchantAPI.listMerchantSettings(merchantId)];
11838
+ case 1:
11839
+ merchantSettingsResponse = _a.sent();
11840
+ if (merchantSettingsResponse) {
11841
+ this.merchantSettings = merchantSettingsResponse;
11842
+ }
11843
+ return [2 /*return*/];
11844
+ }
11845
+ });
11846
+ });
11847
+ };
11827
11848
  IkasPageDataProvider.prototype.getPageData = function () {
11828
11849
  return __awaiter(this, void 0, void 0, function () {
11829
- var merchantId, merchantSettingsResponse, _a;
11850
+ var _a;
11830
11851
  var _this = this;
11831
11852
  return __generator(this, function (_b) {
11832
11853
  switch (_b.label) {
@@ -11839,13 +11860,9 @@ var IkasPageDataProvider = /** @class */ (function () {
11839
11860
  case 2:
11840
11861
  if (!this.page)
11841
11862
  return [2 /*return*/];
11842
- merchantId = decodeBase64(IkasStorefrontConfig.config.apiKey || "");
11843
- return [4 /*yield*/, IkasMerchantAPI.listMerchantSettings(merchantId)];
11863
+ return [4 /*yield*/, this.getMerchantSettings()];
11844
11864
  case 3:
11845
- merchantSettingsResponse = _b.sent();
11846
- if (merchantSettingsResponse) {
11847
- this.merchantSettings = merchantSettingsResponse;
11848
- }
11865
+ _b.sent();
11849
11866
  _a = this;
11850
11867
  return [4 /*yield*/, Promise.all(this.page.components.map(function (pageComponent) {
11851
11868
  return _this.getPageComponentPropValues(pageComponent);
@@ -10,7 +10,7 @@ export declare class IkasPageDataProvider {
10
10
  pageParams: Record<string, any>;
11
11
  pageComponentPropValues: IkasPageComponentPropValue[];
12
12
  pageSpecificData?: any | null;
13
- merchantSettings?: IkasMerchantSettings;
13
+ merchantSettings?: IkasMerchantSettings | null;
14
14
  constructor(theme: IkasTheme, pageParams?: Record<string, any>, pageType?: IkasThemePageType);
15
15
  get page(): IkasThemePage | undefined;
16
16
  get nextPageData(): {
@@ -18,10 +18,11 @@ export declare class IkasPageDataProvider {
18
18
  propValuesStr: string;
19
19
  page: IkasThemePage | null;
20
20
  settingsStr: string;
21
- merchantSettings: string;
21
+ merchantSettings: string | null;
22
22
  };
23
23
  };
24
24
  get isStaticPage(): boolean | null | undefined;
25
+ getMerchantSettings(): Promise<void>;
25
26
  getPageData(): Promise<void>;
26
27
  getPageSpecificData(): Promise<void>;
27
28
  getPageSpecificProduct(): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.47",
3
+ "version": "0.0.48",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",