@ikas/storefront 4.0.0-alpha.19 → 4.0.0-alpha.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "4.0.0-alpha.19",
3
+ "version": "4.0.0-alpha.20",
4
4
  "description": "Storefront functionality for ikas storefront themes.",
5
5
  "author": "Umut Ozan Yıldırım",
6
6
  "license": "ISC",
@@ -24,11 +24,11 @@
24
24
  "libphonenumber-js": "^1.10.6"
25
25
  },
26
26
  "devDependencies": {
27
- "@ikas/storefront-api": "^4.0.0-alpha.19",
28
- "@ikas/storefront-config": "^4.0.0-alpha.19",
29
- "@ikas/storefront-model-functions": "^4.0.0-alpha.19",
30
- "@ikas/storefront-models": "^4.0.0-alpha.19",
31
- "@ikas/storefront-providers": "^4.0.0-alpha.19",
27
+ "@ikas/storefront-api": "^4.0.0-alpha.20",
28
+ "@ikas/storefront-config": "^4.0.0-alpha.20",
29
+ "@ikas/storefront-model-functions": "^4.0.0-alpha.20",
30
+ "@ikas/storefront-models": "^4.0.0-alpha.20",
31
+ "@ikas/storefront-providers": "^4.0.0-alpha.20",
32
32
  "@rollup/plugin-commonjs": "^22.0.0",
33
33
  "@rollup/plugin-json": "^4.1.0",
34
34
  "@rollup/plugin-node-resolve": "^13.3.0",
@@ -52,11 +52,11 @@
52
52
  "html-react-parser": "^1.4.0"
53
53
  },
54
54
  "peerDependencies": {
55
- "@ikas/storefront-api": "^4.0.0-alpha.19",
56
- "@ikas/storefront-config": "^4.0.0-alpha.19",
57
- "@ikas/storefront-model-functions": "^4.0.0-alpha.19",
58
- "@ikas/storefront-models": "^4.0.0-alpha.19",
59
- "@ikas/storefront-providers": "^4.0.0-alpha.19",
55
+ "@ikas/storefront-api": "^4.0.0-alpha.20",
56
+ "@ikas/storefront-config": "^4.0.0-alpha.20",
57
+ "@ikas/storefront-model-functions": "^4.0.0-alpha.20",
58
+ "@ikas/storefront-models": "^4.0.0-alpha.20",
59
+ "@ikas/storefront-providers": "^4.0.0-alpha.20",
60
60
  "mobx": "^6.1.3",
61
61
  "mobx-react-lite": "^3.1.5",
62
62
  "next": "12.0.7",
@@ -23,6 +23,7 @@ import HtmlMetaDataStore from "../../store/html-meta-data";
23
23
  import BlogStore from "../../store/blog";
24
24
  import RaffleStore from "../../store/raffle";
25
25
  import ProductStore from "../../store/product";
26
+ import { IkasAPIClientConfig } from "@ikas/storefront-api";
26
27
 
27
28
  const PACKAGE_VERSION = "2.0.20";
28
29
  // import { version as PACKAGE_VERSION } from "../../../package.json";
@@ -535,6 +536,8 @@ export default class IkasPageEditorViewModel {
535
536
 
536
537
  // Message Handlers
537
538
 
539
+ static setAPIClientConfig() {}
540
+
538
541
  handleUpdateFrameData = async (data: any) => {
539
542
  this.theme = new IkasThemeJson(data.theme);
540
543
  this.page = this.theme?.pages.find((p) => p.id === data.selectedPage.id);
@@ -569,6 +572,20 @@ export default class IkasPageEditorViewModel {
569
572
  adminApiUrl: data.adminApiUrl,
570
573
  cdnUrl: data.cdnUrl,
571
574
  });
575
+
576
+ console.log(data);
577
+
578
+ IkasAPIClientConfig.URL = IkasStorefrontConfig.getApiUrl() || "";
579
+ IkasAPIClientConfig.HEADERS = {
580
+ "x-api-key": IkasStorefrontConfig.getApiKey() || "",
581
+ "x-sfid": IkasStorefrontConfig.getStorefrontId() || "",
582
+ "x-sfrid": IkasStorefrontConfig.getStorefrontRoutingId() || "",
583
+ };
584
+
585
+ if (IkasStorefrontConfig.getCustomerToken()) {
586
+ IkasAPIClientConfig.TOKEN =
587
+ IkasStorefrontConfig.getCustomerToken() || "";
588
+ }
572
589
  }
573
590
 
574
591
  // (window as any).editorApiKey = data.apiKey;