@ikas/storefront-config 5.0.0-beta.4 → 5.0.0-beta.40
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.d.ts +142 -127
- package/build/index.js +1 -1
- package/package.json +11 -10
- package/build/_virtual/_tslib.js +0 -1
package/build/index.d.ts
CHANGED
|
@@ -1,127 +1,142 @@
|
|
|
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
|
|
11
|
-
private static
|
|
12
|
-
private static
|
|
13
|
-
private static
|
|
14
|
-
private static
|
|
15
|
-
private static
|
|
16
|
-
private static
|
|
17
|
-
private static
|
|
18
|
-
private static
|
|
19
|
-
private static
|
|
20
|
-
private static
|
|
21
|
-
private static
|
|
22
|
-
private static
|
|
23
|
-
private static
|
|
24
|
-
private static
|
|
25
|
-
private static
|
|
26
|
-
private static
|
|
27
|
-
private static
|
|
28
|
-
private static
|
|
29
|
-
private static
|
|
30
|
-
private static
|
|
31
|
-
private static
|
|
32
|
-
private static
|
|
33
|
-
private static
|
|
34
|
-
private static
|
|
35
|
-
private static
|
|
36
|
-
private static
|
|
37
|
-
private static
|
|
38
|
-
static
|
|
39
|
-
static
|
|
40
|
-
static
|
|
41
|
-
static
|
|
42
|
-
static
|
|
43
|
-
|
|
44
|
-
static
|
|
45
|
-
static
|
|
46
|
-
static
|
|
47
|
-
static
|
|
48
|
-
static
|
|
49
|
-
static
|
|
50
|
-
static
|
|
51
|
-
static
|
|
52
|
-
static
|
|
53
|
-
static
|
|
54
|
-
static
|
|
55
|
-
static
|
|
56
|
-
static
|
|
57
|
-
static
|
|
58
|
-
static
|
|
59
|
-
static
|
|
60
|
-
static
|
|
61
|
-
static
|
|
62
|
-
static
|
|
63
|
-
static
|
|
64
|
-
static
|
|
65
|
-
static
|
|
66
|
-
static
|
|
67
|
-
static
|
|
68
|
-
static
|
|
69
|
-
static
|
|
70
|
-
static
|
|
71
|
-
static
|
|
72
|
-
static
|
|
73
|
-
static
|
|
74
|
-
static
|
|
75
|
-
static
|
|
76
|
-
static
|
|
77
|
-
static
|
|
78
|
-
static
|
|
79
|
-
static
|
|
80
|
-
static
|
|
81
|
-
static
|
|
82
|
-
static
|
|
83
|
-
static
|
|
84
|
-
static
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
1
|
+
import { IkasCustomerReviewSettings, IkasCustomerSettings, IkasIndexPageSeoSetting, IkasMerchantSettings, IkasProductBackInStockSettings, IkasSalesChannelPaymentGateway, IkasStorefontMetaTemplates, IkasStorefrontB2BSettings, IkasStorefrontRouting, IkasStorefrontType, 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 storefrontType?;
|
|
11
|
+
private static storefrontB2BSettings?;
|
|
12
|
+
private static priceListId?;
|
|
13
|
+
private static stockLocationIds?;
|
|
14
|
+
private static loginRequiredCallback?;
|
|
15
|
+
private static domain?;
|
|
16
|
+
private static storefrontThemeId?;
|
|
17
|
+
private static salesChannelId?;
|
|
18
|
+
private static routings;
|
|
19
|
+
private static paymentGateways;
|
|
20
|
+
private static gtmId?;
|
|
21
|
+
private static fbpId?;
|
|
22
|
+
private static analytics4Id?;
|
|
23
|
+
private static universalAnalyticsId?;
|
|
24
|
+
private static pickUpStockLocationIds?;
|
|
25
|
+
private static tiktokPixelId?;
|
|
26
|
+
private static favicon?;
|
|
27
|
+
private static stockPreference?;
|
|
28
|
+
private static translations;
|
|
29
|
+
private static storefrontJSScripts;
|
|
30
|
+
private static highPriorityStoreFrontJSScripts;
|
|
31
|
+
private static customerReviewSettings?;
|
|
32
|
+
private static productBackInStockSettings?;
|
|
33
|
+
private static merchantSettings?;
|
|
34
|
+
private static currentPageComponents?;
|
|
35
|
+
private static isEditor;
|
|
36
|
+
private static customerSettings?;
|
|
37
|
+
private static metaTemplates;
|
|
38
|
+
private static custom?;
|
|
39
|
+
private static indexPageSeoSettings?;
|
|
40
|
+
private static sessionId?;
|
|
41
|
+
private static visitorId?;
|
|
42
|
+
private static observers;
|
|
43
|
+
static addObserver(observer: IkasStorefrontConfigObserver): void;
|
|
44
|
+
static init(config: Partial<IkasStorefrontConfigParams>): void;
|
|
45
|
+
static initFromAPI(apiKey: string): Promise<void>;
|
|
46
|
+
static getCurrentRouting(): IkasStorefrontRouting | undefined;
|
|
47
|
+
static getCurrentLocale(): string;
|
|
48
|
+
private static notify;
|
|
49
|
+
static isCustomerReviewEnabled(): boolean;
|
|
50
|
+
static isCustomerReviewLoginRequired(): boolean;
|
|
51
|
+
static isBackInStockEnabled(): boolean;
|
|
52
|
+
static isCustomerLoginRequiredForBackInStock(): boolean | null | undefined;
|
|
53
|
+
static toJSON(): {};
|
|
54
|
+
static getThemeId(): string | undefined;
|
|
55
|
+
static getApiUrl(): string | undefined;
|
|
56
|
+
static getCdnUrl(): string | undefined;
|
|
57
|
+
static getApiKey(): string | undefined;
|
|
58
|
+
static getCustomerToken(): string | undefined;
|
|
59
|
+
static getStorefrontId(): string | undefined;
|
|
60
|
+
static getStorefrontRoutingId(): string | undefined;
|
|
61
|
+
static getStorefrontType(): IkasStorefrontType | undefined;
|
|
62
|
+
static getStorefrontB2BSettings(): IkasStorefrontB2BSettings | undefined;
|
|
63
|
+
static isB2BStorefront(): boolean;
|
|
64
|
+
static getPriceListId(): string | undefined;
|
|
65
|
+
static getStockLocationIds(): string[] | undefined;
|
|
66
|
+
static getLoginRequiredCallback(): LoginRequiredCallbackType | undefined;
|
|
67
|
+
static getDomain(): string | undefined;
|
|
68
|
+
static getStorefrontThemeId(): string | undefined;
|
|
69
|
+
static getSalesChannelId(): string | undefined;
|
|
70
|
+
static getRoutings(): IkasStorefrontRouting[];
|
|
71
|
+
static getPaymentGateways(): IkasSalesChannelPaymentGateway[];
|
|
72
|
+
static getGtmId(): string | undefined;
|
|
73
|
+
static getFbpId(): string | undefined;
|
|
74
|
+
static getAnalytics4Id(): string | undefined;
|
|
75
|
+
static getUniversalAnalyticsId(): string | undefined;
|
|
76
|
+
static getPickupStockLocationIds(): string[] | null | undefined;
|
|
77
|
+
static getTiktokPixelId(): string | undefined;
|
|
78
|
+
static getFavicon(): IkasThemeJsonFavicon | undefined;
|
|
79
|
+
static getStockPreference(): IkasThemeJsonStockPreference | undefined;
|
|
80
|
+
static getTranslations(): Record<string, any>;
|
|
81
|
+
static getStorefrontJSScripts(): string[];
|
|
82
|
+
static getHighPriorityStorefrontJSScripts(): string[];
|
|
83
|
+
static getCustomerReviewSettings(): IkasCustomerReviewSettings | null | undefined;
|
|
84
|
+
static getProductBackInStockSettings(): IkasProductBackInStockSettings | null | undefined;
|
|
85
|
+
static getMerchantSettings(): IkasMerchantSettings | null | undefined;
|
|
86
|
+
static getCurrentPageComponents(): Record<string, any> | undefined;
|
|
87
|
+
static getIsEditor(): boolean;
|
|
88
|
+
static getSessionId(): string | undefined;
|
|
89
|
+
static getVisitorId(): string | undefined;
|
|
90
|
+
static getCustomerSettings(): IkasCustomerSettings | undefined;
|
|
91
|
+
static getMetaTemplates(): IkasStorefontMetaTemplates[] | null;
|
|
92
|
+
static getDefaultCurrencyCode(): string | null | undefined;
|
|
93
|
+
static getDefaultCurrencySymbol(): string | null | undefined;
|
|
94
|
+
static getCustom(): Record<string, any> | null | undefined;
|
|
95
|
+
static getIndexPageSeoSettings(): IkasIndexPageSeoSetting[] | null | undefined;
|
|
96
|
+
}
|
|
97
|
+
export type IkasStorefrontConfigObserver = {
|
|
98
|
+
id: string;
|
|
99
|
+
callback: (config: IkasStorefrontConfig) => void;
|
|
100
|
+
};
|
|
101
|
+
export type LoginRequiredCallbackType = () => Promise<void> | void;
|
|
102
|
+
export type IkasStorefrontConfigParams = {
|
|
103
|
+
themeId?: string;
|
|
104
|
+
apiUrl?: string;
|
|
105
|
+
cdnUrl?: string;
|
|
106
|
+
apiKey?: string;
|
|
107
|
+
token?: string;
|
|
108
|
+
customerToken?: string;
|
|
109
|
+
storefrontId?: string;
|
|
110
|
+
storefrontRoutingId?: string;
|
|
111
|
+
storefrontType?: IkasStorefrontType;
|
|
112
|
+
storefrontB2BSettings?: IkasStorefrontB2BSettings;
|
|
113
|
+
priceListId?: string;
|
|
114
|
+
stockLocationIds?: string[];
|
|
115
|
+
loginRequiredCallback?: LoginRequiredCallbackType;
|
|
116
|
+
domain?: string;
|
|
117
|
+
storefrontThemeId?: string;
|
|
118
|
+
salesChannelId?: string;
|
|
119
|
+
routings: IkasStorefrontRouting[];
|
|
120
|
+
paymentGateways: IkasSalesChannelPaymentGateway[];
|
|
121
|
+
gtmId?: string;
|
|
122
|
+
fbpId?: string;
|
|
123
|
+
analytics4Id?: string;
|
|
124
|
+
universalAnalyticsId?: string;
|
|
125
|
+
pickUpStockLocationIds?: string[] | null;
|
|
126
|
+
tiktokPixelId?: string;
|
|
127
|
+
favicon?: IkasThemeJsonFavicon;
|
|
128
|
+
stockPreference?: IkasThemeJsonStockPreference;
|
|
129
|
+
translations: Record<string, any>;
|
|
130
|
+
storefrontJSScripts: string[];
|
|
131
|
+
customerReviewSettings?: IkasCustomerReviewSettings | null;
|
|
132
|
+
productBackInStockSettings?: IkasProductBackInStockSettings | null;
|
|
133
|
+
merchantSettings?: IkasMerchantSettings | null;
|
|
134
|
+
currentPageComponents?: Record<string, any>;
|
|
135
|
+
isEditor: boolean;
|
|
136
|
+
customerSettings?: IkasCustomerSettings;
|
|
137
|
+
sessionId?: string;
|
|
138
|
+
visitorId?: string;
|
|
139
|
+
metaTemplates: IkasStorefontMetaTemplates[] | null;
|
|
140
|
+
custom?: Record<string, any> | null;
|
|
141
|
+
indexPageSeoSettings?: IkasIndexPageSeoSetting[] | null;
|
|
142
|
+
};
|
package/build/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{IkasStorefrontType as t}from"@ikas/storefront-models";class e{static addObserver(t){const r=e.observers.find((e=>e.id===t.id));r?r.callback=t.callback:e.observers.push(t),t.callback(e)}static init(t){try{const r=["themeSecret"];Object.entries(t).forEach((([t,n])=>{r.includes(t)||(e[t]=n)})),t.token&&(e.apiKey=t.token),this.notify()}catch(t){console.error(t)}}static async initFromAPI(t){}static getCurrentRouting(){return e.routings.find((t=>t.id===e.storefrontRoutingId))}static getCurrentLocale(){const t=e.getCurrentRouting();return t?.locale||"en"}static notify(){this.observers.forEach((t=>t.callback(this)))}static isCustomerReviewEnabled(){const t=e.getCustomerReviewSettings();return!!t&&!t.customerPurchaseRequired}static isCustomerReviewLoginRequired(){const t=e.getCustomerReviewSettings();return!t||t.customerLoginRequired}static isBackInStockEnabled(){return!!e.getProductBackInStockSettings()}static isCustomerLoginRequiredForBackInStock(){const t=e.getProductBackInStockSettings();return t&&t.customerLoginRequired}static toJSON(){const t={...this};return delete t.observers,t}static getThemeId(){return e.themeId}static getApiUrl(){return e.apiUrl}static getCdnUrl(){return e.cdnUrl}static getApiKey(){return e.apiKey}static getCustomerToken(){return e.customerToken}static getStorefrontId(){return e.storefrontId}static getStorefrontRoutingId(){return e.storefrontRoutingId}static getStorefrontType(){return e.storefrontType}static getStorefrontB2BSettings(){return e.storefrontB2BSettings}static isB2BStorefront(){return e.storefrontType===t.B2B_STOREFRONT}static getPriceListId(){return e.priceListId}static getStockLocationIds(){return e.stockLocationIds}static getLoginRequiredCallback(){return e.loginRequiredCallback}static getDomain(){return e.domain}static getStorefrontThemeId(){return e.storefrontThemeId}static getSalesChannelId(){return e.salesChannelId}static getRoutings(){return e.routings}static getPaymentGateways(){return e.paymentGateways}static getGtmId(){return e.gtmId}static getFbpId(){return e.fbpId}static getAnalytics4Id(){return e.analytics4Id}static getUniversalAnalyticsId(){return e.universalAnalyticsId}static getPickupStockLocationIds(){return e.pickUpStockLocationIds}static getTiktokPixelId(){return e.tiktokPixelId}static getFavicon(){return e.favicon}static getStockPreference(){return e.stockPreference}static getTranslations(){return e.translations}static getStorefrontJSScripts(){return e.storefrontJSScripts}static getHighPriorityStorefrontJSScripts(){return e.highPriorityStoreFrontJSScripts||[]}static getCustomerReviewSettings(){return e.customerReviewSettings}static getProductBackInStockSettings(){return e.productBackInStockSettings}static getMerchantSettings(){return e.merchantSettings}static getCurrentPageComponents(){return e.currentPageComponents}static getIsEditor(){return e.isEditor}static getSessionId(){return e.sessionId}static getVisitorId(){return e.visitorId}static getCustomerSettings(){return e.customerSettings}static getMetaTemplates(){return e.metaTemplates}static getDefaultCurrencyCode(){return e.getCurrentRouting()?.currencyCode}static getDefaultCurrencySymbol(){return e.getCurrentRouting()?.currencySymbol}static getCustom(){return this.custom}static getIndexPageSeoSettings(){return e.indexPageSeoSettings}}e.routings=[],e.paymentGateways=[],e.translations={},e.storefrontJSScripts=[],e.highPriorityStoreFrontJSScripts=[],e.isEditor=!1,e.observers=[];export{e as IkasStorefrontConfig};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront-config",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.40",
|
|
4
4
|
"description": "Common configuration for ikas storefront packages.",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"module": "./build/index.js",
|
|
@@ -10,23 +10,24 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"scripts": {
|
|
12
12
|
"pack": "npm pack",
|
|
13
|
-
"release": "npm publish",
|
|
14
|
-
"build": "rm -rf build && rm -rf build-cjs && rollup -c"
|
|
13
|
+
"release": "npm run build && npm publish",
|
|
14
|
+
"build": "rm -rf node_modules && npm install && rm -rf build && rm -rf build-cjs && rollup -c --bundleConfigAsCjs"
|
|
15
15
|
},
|
|
16
16
|
"author": "ikas",
|
|
17
17
|
"license": "ISC",
|
|
18
18
|
"dependencies": {},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@ikas/storefront-models": "^5.0.0-beta.
|
|
20
|
+
"@ikas/storefront-models": "^5.0.0-beta.40",
|
|
21
21
|
"prettier": "^2.2.1",
|
|
22
|
-
"rollup": "^
|
|
23
|
-
"rollup
|
|
24
|
-
"rollup-plugin-typescript2": "^0.
|
|
25
|
-
"
|
|
22
|
+
"rollup": "^4.5.1",
|
|
23
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
24
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
25
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
26
|
+
"typescript": "^5.1.6",
|
|
26
27
|
"ttypescript": "^1.5.12",
|
|
27
|
-
"typescript-transform-paths": "^
|
|
28
|
+
"typescript-transform-paths": "^3.4.6"
|
|
28
29
|
},
|
|
29
30
|
"peerDependencies": {
|
|
30
|
-
"@ikas/storefront-models": "^5.0.0-beta.
|
|
31
|
+
"@ikas/storefront-models": "^5.0.0-beta.40"
|
|
31
32
|
}
|
|
32
33
|
}
|
package/build/_virtual/_tslib.js
DELETED
|
@@ -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};
|