@ikas/storefront-config 4.5.0-beta.2 → 4.5.0-beta.3

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-config",
3
- "version": "4.5.0-beta.2",
3
+ "version": "4.5.0-beta.3",
4
4
  "description": "Common configuration for ikas storefront packages.",
5
5
  "main": "./build/index.js",
6
6
  "module": "./build/index.js",
@@ -17,7 +17,7 @@
17
17
  "license": "ISC",
18
18
  "dependencies": {},
19
19
  "devDependencies": {
20
- "@ikas/storefront-models": "^4.5.0-beta.2",
20
+ "@ikas/storefront-models": "^4.5.0-beta.3",
21
21
  "prettier": "^2.2.1",
22
22
  "rollup": "^2.75.6",
23
23
  "rollup-plugin-terser": "^7.0.2",
@@ -27,6 +27,6 @@
27
27
  "typescript-transform-paths": "^2.2.2"
28
28
  },
29
29
  "peerDependencies": {
30
- "@ikas/storefront-models": "^4.5.0-beta.2"
30
+ "@ikas/storefront-models": "^4.5.0-beta.3"
31
31
  }
32
32
  }
@@ -1 +0,0 @@
1
- var n=function(){return n=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n},n.apply(this,arguments)};function t(n,t,e,r){return new(e||(e=Promise))((function(o,a){function u(n){try{c(r.next(n))}catch(n){a(n)}}function l(n){try{c(r.throw(n))}catch(n){a(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,l)}c((r=r.apply(n,t||[])).next())}))}function e(n,t){var e,r,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(n,u)}catch(n){a=[6,n],r=0}finally{e=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}export{n as __assign,t as __awaiter,e as __generator};
package/build/index.d.ts DELETED
@@ -1,127 +0,0 @@
1
- import { IkasCustomerReviewSettings, IkasCustomerSettings, IkasMerchantSettings, IkasProductBackInStockSettings, IkasSalesChannelPaymentGateway, IkasStorefontMetaTemplates, IkasStorefrontRouting, IkasThemeJsonFavicon, IkasThemeJsonStockPreference } from "@ikas/storefront-models";
2
- export declare class IkasStorefrontConfig {
3
- private static themeId?;
4
- private static apiUrl?;
5
- private static cdnUrl?;
6
- private static apiKey?;
7
- private static customerToken?;
8
- private static storefrontId?;
9
- private static storefrontRoutingId?;
10
- private static priceListId?;
11
- private static stockLocationIds?;
12
- private static loginRequiredCallback?;
13
- private static domain?;
14
- private static storefrontThemeId?;
15
- private static salesChannelId?;
16
- private static routings;
17
- private static paymentGateways;
18
- private static gtmId?;
19
- private static fbpId?;
20
- private static analytics4Id?;
21
- private static universalAnalyticsId?;
22
- private static pickUpStockLocationIds?;
23
- private static tiktokPixelId?;
24
- private static favicon?;
25
- private static stockPreference?;
26
- private static translations;
27
- private static storefrontJSScripts;
28
- private static customerReviewSettings?;
29
- private static productBackInStockSettings?;
30
- private static merchantSettings?;
31
- private static currentPageComponents?;
32
- private static isEditor;
33
- private static customerSettings?;
34
- private static metaTemplates;
35
- private static sessionId?;
36
- private static visitorId?;
37
- private static observers;
38
- static addObserver(observer: IkasStorefrontConfigObserver): void;
39
- static init(config: Partial<IkasStorefrontConfigParams>): void;
40
- static initFromAPI(apiKey: string): Promise<void>;
41
- static getCurrentRouting(): IkasStorefrontRouting | undefined;
42
- static getCurrentLocale(): string;
43
- private static notify;
44
- static isCustomerReviewEnabled(): boolean;
45
- static isCustomerReviewLoginRequired(): boolean;
46
- static isBackInStockEnabled(): boolean;
47
- static isCustomerLoginRequiredForBackInStock(): boolean | null | undefined;
48
- static toJSON(): {};
49
- static getThemeId(): string | undefined;
50
- static getApiUrl(): string | undefined;
51
- static getCdnUrl(): string | undefined;
52
- static getApiKey(): string | undefined;
53
- static getCustomerToken(): string | undefined;
54
- static getStorefrontId(): string | undefined;
55
- static getStorefrontRoutingId(): string | undefined;
56
- static getPriceListId(): string | undefined;
57
- static getStockLocationIds(): string[] | undefined;
58
- static getLoginRequiredCallback(): LoginRequiredCallbackType | undefined;
59
- static getDomain(): string | undefined;
60
- static getStorefrontThemeId(): string | undefined;
61
- static getSalesChannelId(): string | undefined;
62
- static getRoutings(): IkasStorefrontRouting[];
63
- static getPaymentGateways(): IkasSalesChannelPaymentGateway[];
64
- static getGtmId(): string | undefined;
65
- static getFbpId(): string | undefined;
66
- static getAnalytics4Id(): string | undefined;
67
- static getUniversalAnalyticsId(): string | undefined;
68
- static getPickupStockLocationIds(): string[] | null | undefined;
69
- static getTiktokPixelId(): string | undefined;
70
- static getFavicon(): IkasThemeJsonFavicon | undefined;
71
- static getStockPreference(): IkasThemeJsonStockPreference | undefined;
72
- static getTranslations(): Record<string, any>;
73
- static getStorefrontJSScripts(): string[];
74
- static getCustomerReviewSettings(): IkasCustomerReviewSettings | null | undefined;
75
- static getProductBackInStockSettings(): IkasProductBackInStockSettings | null | undefined;
76
- static getMerchantSettings(): IkasMerchantSettings | null | undefined;
77
- static getCurrentPageComponents(): Record<string, any> | undefined;
78
- static getIsEditor(): boolean;
79
- static getSessionId(): string | undefined;
80
- static getVisitorId(): string | undefined;
81
- static getCustomerSettings(): IkasCustomerSettings | undefined;
82
- static getMetaTemplates(): IkasStorefontMetaTemplates[] | null;
83
- static getDefaultCurrencyCode(): string | null | undefined;
84
- static getDefaultCurrencySymbol(): string | null | undefined;
85
- }
86
- export declare type IkasStorefrontConfigObserver = {
87
- id: string;
88
- callback: (config: IkasStorefrontConfig) => void;
89
- };
90
- export declare type LoginRequiredCallbackType = () => Promise<void> | void;
91
- export declare type IkasStorefrontConfigParams = {
92
- themeId?: string;
93
- apiUrl?: string;
94
- cdnUrl?: string;
95
- apiKey?: string;
96
- token?: string;
97
- customerToken?: string;
98
- storefrontId?: string;
99
- storefrontRoutingId?: string;
100
- priceListId?: string;
101
- stockLocationIds?: string[];
102
- loginRequiredCallback?: LoginRequiredCallbackType;
103
- domain?: string;
104
- storefrontThemeId?: string;
105
- salesChannelId?: string;
106
- routings: IkasStorefrontRouting[];
107
- paymentGateways: IkasSalesChannelPaymentGateway[];
108
- gtmId?: string;
109
- fbpId?: string;
110
- analytics4Id?: string;
111
- universalAnalyticsId?: string;
112
- pickUpStockLocationIds?: string[] | null;
113
- tiktokPixelId?: string;
114
- favicon?: IkasThemeJsonFavicon;
115
- stockPreference?: IkasThemeJsonStockPreference;
116
- translations: Record<string, any>;
117
- storefrontJSScripts: string[];
118
- customerReviewSettings?: IkasCustomerReviewSettings | null;
119
- productBackInStockSettings?: IkasProductBackInStockSettings | null;
120
- merchantSettings?: IkasMerchantSettings | null;
121
- currentPageComponents?: Record<string, any>;
122
- isEditor: boolean;
123
- customerSettings?: IkasCustomerSettings;
124
- sessionId?: string;
125
- visitorId?: string;
126
- metaTemplates: IkasStorefontMetaTemplates[] | null;
127
- };
package/build/index.js DELETED
@@ -1 +0,0 @@
1
- import{__awaiter as t,__assign as n,__generator as e}from"./_virtual/_tslib.js";var r=function(){function r(){}return r.addObserver=function(t){var n=r.observers.find((function(n){return n.id===t.id}));n?n.callback=t.callback:r.observers.push(t),t.callback(r)},r.init=function(t){try{Object.entries(t).forEach((function(t){var n=t[0],e=t[1];r[n]=e})),t.token&&(r.apiKey=t.token),this.notify()}catch(t){console.error(t)}},r.initFromAPI=function(n){return t(this,void 0,void 0,(function(){return e(this,(function(t){return[2]}))}))},r.getCurrentRouting=function(){return r.routings.find((function(t){return t.id===r.storefrontRoutingId}))},r.getCurrentLocale=function(){var t=r.getCurrentRouting();return(null==t?void 0:t.locale)||"en"},r.notify=function(){var t=this;this.observers.forEach((function(n){return n.callback(t)}))},r.isCustomerReviewEnabled=function(){var t=r.getCustomerReviewSettings();return!!t&&!t.customerPurchaseRequired},r.isCustomerReviewLoginRequired=function(){var t=r.getCustomerReviewSettings();return!t||t.customerLoginRequired},r.isBackInStockEnabled=function(){return!!r.getProductBackInStockSettings()},r.isCustomerLoginRequiredForBackInStock=function(){var t=r.getProductBackInStockSettings();return t&&t.customerLoginRequired},r.toJSON=function(){var t=n({},this);return delete t.observers,t},r.getThemeId=function(){return r.themeId},r.getApiUrl=function(){return r.apiUrl},r.getCdnUrl=function(){return r.cdnUrl},r.getApiKey=function(){return r.apiKey},r.getCustomerToken=function(){return r.customerToken},r.getStorefrontId=function(){return r.storefrontId},r.getStorefrontRoutingId=function(){return r.storefrontRoutingId},r.getPriceListId=function(){return r.priceListId},r.getStockLocationIds=function(){return r.stockLocationIds},r.getLoginRequiredCallback=function(){return r.loginRequiredCallback},r.getDomain=function(){return r.domain},r.getStorefrontThemeId=function(){return r.storefrontThemeId},r.getSalesChannelId=function(){return r.salesChannelId},r.getRoutings=function(){return r.routings},r.getPaymentGateways=function(){return r.paymentGateways},r.getGtmId=function(){return r.gtmId},r.getFbpId=function(){return r.fbpId},r.getAnalytics4Id=function(){return r.analytics4Id},r.getUniversalAnalyticsId=function(){return r.universalAnalyticsId},r.getPickupStockLocationIds=function(){return r.pickUpStockLocationIds},r.getTiktokPixelId=function(){return r.tiktokPixelId},r.getFavicon=function(){return r.favicon},r.getStockPreference=function(){return r.stockPreference},r.getTranslations=function(){return r.translations},r.getStorefrontJSScripts=function(){return r.storefrontJSScripts},r.getCustomerReviewSettings=function(){return r.customerReviewSettings},r.getProductBackInStockSettings=function(){return r.productBackInStockSettings},r.getMerchantSettings=function(){return r.merchantSettings},r.getCurrentPageComponents=function(){return r.currentPageComponents},r.getIsEditor=function(){return r.isEditor},r.getSessionId=function(){return r.sessionId},r.getVisitorId=function(){return r.visitorId},r.getCustomerSettings=function(){return r.customerSettings},r.getMetaTemplates=function(){return r.metaTemplates},r.getDefaultCurrencyCode=function(){var t;return null===(t=r.getCurrentRouting())||void 0===t?void 0:t.currencyCode},r.getDefaultCurrencySymbol=function(){var t;return null===(t=r.getCurrentRouting())||void 0===t?void 0:t.currencySymbol},r.routings=[],r.paymentGateways=[],r.translations={},r.storefrontJSScripts=[],r.isEditor=!1,r.observers=[],r}();export{r as IkasStorefrontConfig};