@one-commerce/sdk-core 1.7.0 → 1.11.0

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.
Files changed (47) hide show
  1. package/lib/bundles/bundle.esm.js +943 -0
  2. package/lib/bundles/bundle.esm.js.map +1 -0
  3. package/lib/bundles/bundle.esm.min.js +2 -0
  4. package/lib/bundles/bundle.esm.min.js.map +1 -0
  5. package/lib/bundles/bundle.umd.js +954 -0
  6. package/lib/bundles/bundle.umd.js.map +1 -0
  7. package/lib/bundles/bundle.umd.min.js +2 -0
  8. package/lib/bundles/bundle.umd.min.js.map +1 -0
  9. package/lib/cjs/backofficeServices.js +180 -28
  10. package/lib/cjs/backofficeServices.js.map +1 -0
  11. package/lib/cjs/events.js +56 -22
  12. package/lib/cjs/events.js.map +1 -0
  13. package/lib/cjs/index.js +289 -121
  14. package/lib/cjs/index.js.map +1 -0
  15. package/lib/cjs/shopServices.js +248 -54
  16. package/lib/cjs/shopServices.js.map +1 -0
  17. package/lib/cjs/utils.js +63 -28
  18. package/lib/cjs/utils.js.map +1 -0
  19. package/lib/esm/backofficeServices.js +59 -16
  20. package/lib/esm/backofficeServices.js.map +1 -0
  21. package/lib/esm/events.js +30 -22
  22. package/lib/esm/events.js.map +1 -0
  23. package/lib/esm/index.js +150 -108
  24. package/lib/esm/index.js.map +1 -0
  25. package/lib/esm/shopServices.js +125 -67
  26. package/lib/esm/shopServices.js.map +1 -0
  27. package/lib/esm/utils.js +34 -25
  28. package/lib/esm/utils.js.map +1 -0
  29. package/lib/{cjs → types}/backofficeServices.d.ts +7 -0
  30. package/lib/types/backofficeServices.d.ts.map +1 -0
  31. package/lib/{cjs → types}/events.d.ts +1 -0
  32. package/lib/types/events.d.ts.map +1 -0
  33. package/lib/types/iframe-channel.d.ts +19 -0
  34. package/lib/{esm → types}/index.d.ts +6 -2
  35. package/lib/types/index.d.ts.map +1 -0
  36. package/lib/{esm → types}/shopServices.d.ts +1 -0
  37. package/lib/types/shopServices.d.ts.map +1 -0
  38. package/lib/{esm → types}/utils.d.ts +1 -0
  39. package/lib/types/utils.d.ts.map +1 -0
  40. package/package.json +42 -16
  41. package/lib/cjs/index.d.ts +0 -74
  42. package/lib/cjs/shopServices.d.ts +0 -98
  43. package/lib/cjs/utils.d.ts +0 -8
  44. package/lib/esm/backofficeServices.d.ts +0 -21
  45. package/lib/esm/events.d.ts +0 -7
  46. package/lib/tsconfig.module.tsbuildinfo +0 -1
  47. package/lib/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,19 @@
1
+ declare module 'iframe-channel' {
2
+ interface ChannelOptions {
3
+ targetOrigin?: string
4
+ target?: typeof window.parent
5
+ subscribes?: { [k: string]: any }
6
+ attemptInterval?: number
7
+ maxAttempts?: number
8
+ }
9
+ class Channel {
10
+ constructor(options: ChannelOptions);
11
+ postMessage(type: string | number, data: any, opts?: { hasFunction: boolean, functionKeys: Array<string> }): Promise<void>;
12
+ connect(): Promise<void>;
13
+ clearQueue(): void;
14
+ destory(): void;
15
+ subscribe(type: string | number, fun?: Function): void;
16
+ unsubscribe(type: string | number, fun?: Function): void;
17
+ }
18
+ export default Channel
19
+ }
@@ -1,5 +1,5 @@
1
1
  import { Backoffice, Route, Shop } from "@one-commerce/sdk-shared";
2
- import { BackofficeCatalog, BackofficeLayout, BackofficeOrderpath, BackofficeUser } from "./backofficeServices";
2
+ import { BackofficeCatalog, BackofficeLayout, BackofficeOrderpath, BackofficeTenant, BackofficeUser } from "./backofficeServices";
3
3
  import Events from "./events";
4
4
  import { ShopAccount, ShopCart, ShopCatalog, ShopConfig, ShopUtils } from "./shopServices";
5
5
  export declare enum SdkEvents {
@@ -25,10 +25,11 @@ declare abstract class Sdk<T> extends Events {
25
25
  isInitialized: boolean;
26
26
  instances: T;
27
27
  private static log;
28
+ private static warn;
28
29
  private initializeServiceGetters;
29
30
  constructor(options: SdkOptions);
30
31
  private setupOptions;
31
- protected callFunction(service: string, fun: string, ...payload: any): Promise<unknown>;
32
+ protected callFunction(service: string, fun: string, ...payload: any): Promise<any>;
32
33
  navigate(event: NamedNavigationPayload | PathNavigationPayload): void;
33
34
  }
34
35
  export interface BackofficeInstances extends Backoffice.Api {
@@ -36,6 +37,7 @@ export interface BackofficeInstances extends Backoffice.Api {
36
37
  orderpath: BackofficeOrderpath;
37
38
  catalog: BackofficeCatalog;
38
39
  user: BackofficeUser;
40
+ tenant: BackofficeTenant;
39
41
  layout: BackofficeLayout;
40
42
  }
41
43
  export interface ShopInstances extends Shop.Api {
@@ -55,6 +57,7 @@ export declare class BackofficeSdk extends Sdk<BackofficeInstances> {
55
57
  orderpath: BackofficeOrderpath;
56
58
  catalog: BackofficeCatalog;
57
59
  user: BackofficeUser;
60
+ tenant: BackofficeTenant;
58
61
  layout: BackofficeLayout;
59
62
  };
60
63
  }
@@ -72,3 +75,4 @@ export declare class ShopSdk extends Sdk<ShopInstances> {
72
75
  };
73
76
  }
74
77
  export {};
78
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAW,KAAK,EAAE,IAAI,EAAC,MAAM,0BAA0B,CAAC;AAG1E,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EACL,WAAW,EACX,QAAQ,EACR,WAAW,EAAE,UAAU,EAAE,SAAS,EACnC,MAAM,gBAAgB,CAAC;AAOxB,oBAAY,SAAS;IACnB,IAAI,SAAO;IACX,MAAM,WAAS;CAChB;AACD,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACf;AAED,UAAU,sBAAsB;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,MAA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AG,CAAC,aAAa,CAAC;IAC7C,SAAS;;;;;;;;;;MAUR;CACF"}
@@ -96,3 +96,4 @@ export declare class ShopConfig extends BaseCallClass implements Shop.Config {
96
96
  isRegistrationEnabled: boolean;
97
97
  currency: any;
98
98
  }
99
+ //# sourceMappingURL=shopServices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shopServices.d.ts","sourceRoot":"","sources":["../../src/shopServices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAC,aAAa,EAAC,MAAM,SAAS,CAAC;AAEtC,qBAAa,WAAY,SAAQ,aAAc,YAAW,IAAI,CAAC,OAAO;IACpE,WAAW,SAAY;IACvB,UAAU,EAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IACxB,kBAAkB,EAAG,MAAM,GAAG,IAAI,CAAC;IAEnC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAI7C,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;CAKlD;AAED,qBAAa,WAAY,SAAQ,aAAc,YAAW,IAAI,CAAC,OAAO;IACpE,WAAW,SAAY;IACvB,MAAM,EAAG;QACP,IAAI,EAAE,MAAM,CAAC;QACb,cAAc,CAAC,EAAE;YACf,IAAI,EAAE,MAAM,CAAC;YACb,OAAO,EAAE,MAAM,CAAC;YAChB,EAAE,EAAE,MAAM,CAAC;YACX,SAAS,EAAE,OAAO,CAAC;YACnB,IAAI,EAAE,MAAM,CAAC;YACb,KAAK,EAAE,MAAM,CAAC;YACd,MAAM,EAAE,MAAM,CAAC;YACf,IAAI,EAAE,MAAM,CAAC;YACb,OAAO,EAAE,MAAM,CAAA;SAChB,CAAA;KACF,CAAC;IACF,eAAe,EAAG,OAAO,CAAC;IAC1B,IAAI,EAAG;QACL,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM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target: Record<string, any>, payload: Record<string, any>): void;
7
7
  update(payload: any): void;
8
8
  }
9
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAKA,wBAAgB,cAAc,WAI7B;AAED,qBAAa,aAAa;IACxB,WAAW,SAAK;IAChB,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;gBACvC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC;IAK7E,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAKvE,MAAM,CAAC,OAAO,EAAE,GAAG;CAMpB"}
package/package.json CHANGED
@@ -1,14 +1,30 @@
1
1
  {
2
2
  "name": "@one-commerce/sdk-core",
3
- "version": "1.7.0",
3
+ "version": "1.11.0",
4
4
  "description": "Core package for One Plugins",
5
- "main": "lib/cjs/index.js",
6
- "typings": "lib/cjs/index.d.ts",
7
5
  "module": "lib/esm/index.js",
6
+ "main": "lib/cjs/index.js",
7
+ "types": "lib/types/index.d.ts",
8
+ "files": [
9
+ "lib",
10
+ "CHANGELOG.md",
11
+ "LICENSE",
12
+ "README.md"
13
+ ],
14
+ "exports": {
15
+ "import": "./lib/esm/index.js",
16
+ "require": "./lib/cjs/index.js",
17
+ "types": "./types/index.d.ts"
18
+ },
8
19
  "license": "MIT",
9
20
  "keywords": [],
10
21
  "scripts": {
11
- "build": "run-p build:*",
22
+ "clean": "rimraf lib",
23
+ "build:esm": "cross-env BABEL_ENV=esmUnbundled babel src --extensions '.ts' --out-dir 'lib/esm' --source-maps",
24
+ "build:cjs": "cross-env BABEL_ENV=cjs babel src --extensions '.ts' --out-dir 'lib/cjs' --source-maps",
25
+ "build:bundles": "cross-env BABEL_ENV=esmBundled rollup -c",
26
+ "declarations": "tsc -p tsconfig.json",
27
+ "build": "npm-run-all -l clean -p build:esm build:cjs build:bundles declarations",
12
28
  "build:main": "tsc -p tsconfig.json",
13
29
  "build:module": "tsc -p tsconfig.module.json",
14
30
  "fix": "run-s fix:*",
@@ -39,16 +55,26 @@
39
55
  "node": ">=14"
40
56
  },
41
57
  "dependencies": {
42
- "@one-commerce/sdk-shared": "^1.7.0",
58
+ "@one-commerce/sdk-shared": "^1.11.0",
43
59
  "iframe-channel": "^1.2.5"
44
60
  },
45
61
  "devDependencies": {
46
62
  "@ava/typescript": "^1.1.1",
63
+ "@babel/cli": "^7.16.7",
64
+ "@babel/core": "^7.16.7",
65
+ "@babel/plugin-proposal-class-properties": "^7.16.7",
66
+ "@babel/plugin-proposal-optional-chaining": "^7.16.7",
67
+ "@babel/preset-env": "^7.16.7",
68
+ "@babel/preset-typescript": "^7.16.7",
47
69
  "@istanbuljs/nyc-config-typescript": "^1.0.1",
48
- "@typescript-eslint/eslint-plugin": "^4.0.1",
49
- "@typescript-eslint/parser": "^4.0.1",
70
+ "@rollup/plugin-babel": "^5.3.0",
71
+ "@rollup/plugin-commonjs": "^21.0.1",
72
+ "@rollup/plugin-node-resolve": "^11.1.1",
73
+ "@typescript-eslint/eslint-plugin": "^4.18.0",
74
+ "@typescript-eslint/parser": "^4.18.0",
50
75
  "ava": "^3.12.1",
51
76
  "codecov": "^3.5.0",
77
+ "cross-env": "^7.0.3",
52
78
  "cspell": "^4.1.0",
53
79
  "cz-conventional-changelog": "^3.3.0",
54
80
  "eslint": "^7.8.0",
@@ -56,23 +82,23 @@
56
82
  "eslint-plugin-eslint-comments": "^3.2.0",
57
83
  "eslint-plugin-functional": "^3.0.2",
58
84
  "eslint-plugin-import": "^2.22.0",
85
+ "eslint-plugin-prettier": "^3.3.1",
86
+ "eslint-plugin-vue": "^7.0.0",
59
87
  "gh-pages": "^3.1.0",
60
88
  "nodemon": "^2.0.7",
61
89
  "npm-run-all": "^4.1.5",
62
90
  "nyc": "^15.1.0",
63
91
  "open-cli": "^6.0.1",
64
- "prettier": "^2.1.1",
92
+ "prettier": "^2.2.1",
93
+ "rimraf": "^3.0.2",
94
+ "rollup": "^2.38.4",
95
+ "rollup-plugin-copy": "^3.4.0",
96
+ "rollup-plugin-terser": "^7.0.2",
65
97
  "standard-version": "^9.0.0",
66
98
  "ts-node": "^9.0.0",
67
99
  "typedoc": "^0.19.0",
68
- "typescript": "^4.0.2"
100
+ "typescript": "~4.1.5"
69
101
  },
70
- "files": [
71
- "lib/",
72
- "CHANGELOG.md",
73
- "LICENSE",
74
- "README.md"
75
- ],
76
102
  "ava": {
77
103
  "failFast": true,
78
104
  "timeout": "60s",
@@ -99,5 +125,5 @@
99
125
  "**/*.spec.js"
100
126
  ]
101
127
  },
102
- "gitHead": "d307caf7d0a1827ad9d7a04d284303cac5f93f8b"
128
+ "gitHead": "86bf9cec3569f01a17f2f44b17bd383e3806cd2c"
103
129
  }
@@ -1,74 +0,0 @@
1
- import { Backoffice, Route, Shop } from "@one-commerce/sdk-shared";
2
- import { BackofficeCatalog, BackofficeLayout, BackofficeOrderpath, BackofficeUser } from "./backofficeServices";
3
- import Events from "./events";
4
- import { ShopAccount, ShopCart, ShopCatalog, ShopConfig, ShopUtils } from "./shopServices";
5
- export declare enum SdkEvents {
6
- INIT = "INIT",
7
- UPDATE = "UPDATE"
8
- }
9
- export interface SdkOptions {
10
- debug?: boolean;
11
- origin: string;
12
- }
13
- interface NamedNavigationPayload {
14
- name: string;
15
- params: any;
16
- }
17
- interface PathNavigationPayload {
18
- path: string;
19
- params: any;
20
- }
21
- declare abstract class Sdk<T> extends Events {
22
- private channel;
23
- private static debug;
24
- origin: string;
25
- isInitialized: boolean;
26
- instances: T;
27
- private static log;
28
- private initializeServiceGetters;
29
- constructor(options: SdkOptions);
30
- private setupOptions;
31
- protected callFunction(service: string, fun: string, ...payload: any): Promise<unknown>;
32
- navigate(event: NamedNavigationPayload | PathNavigationPayload): void;
33
- }
34
- export interface BackofficeInstances extends Backoffice.Api {
35
- route: Route;
36
- orderpath: BackofficeOrderpath;
37
- catalog: BackofficeCatalog;
38
- user: BackofficeUser;
39
- layout: BackofficeLayout;
40
- }
41
- export interface ShopInstances extends Shop.Api {
42
- route: Route;
43
- cart: ShopCart;
44
- catalog: ShopCatalog;
45
- account: ShopAccount;
46
- utils: ShopUtils;
47
- config: ShopConfig;
48
- }
49
- export declare class BackofficeSdk extends Sdk<BackofficeInstances> {
50
- instances: {
51
- route: {
52
- hash: string;
53
- query: {};
54
- };
55
- orderpath: BackofficeOrderpath;
56
- catalog: BackofficeCatalog;
57
- user: BackofficeUser;
58
- layout: BackofficeLayout;
59
- };
60
- }
61
- export declare class ShopSdk extends Sdk<ShopInstances> {
62
- instances: {
63
- route: {
64
- hash: string;
65
- query: {};
66
- };
67
- cart: ShopCart;
68
- catalog: ShopCatalog;
69
- account: ShopAccount;
70
- utils: ShopUtils;
71
- config: ShopConfig;
72
- };
73
- }
74
- export {};
@@ -1,98 +0,0 @@
1
- import { Shop } from "@one-commerce/sdk-shared";
2
- import { BaseCallClass } from "./utils";
3
- export declare class ShopCatalog extends BaseCallClass implements Shop.Catalog {
4
- serviceName: string;
5
- categories: Array<any>;
6
- selectedCategoryId: string | null;
7
- fetchProduct(productId: string): Promise<any>;
8
- getCategoryById(categoryId: string): Promise<any>;
9
- }
10
- export declare class ShopAccount extends BaseCallClass implements Shop.Account {
11
- serviceName: string;
12
- client: {
13
- name: string;
14
- billingAddress?: {
15
- city: string;
16
- country: string;
17
- id: string;
18
- isDefault: boolean;
19
- name: string;
20
- phone: string;
21
- street: string;
22
- type: string;
23
- zipCode: string;
24
- };
25
- };
26
- isAuthenticated: boolean;
27
- user: {
28
- email?: string;
29
- name?: string;
30
- phone?: string;
31
- /**
32
- * @deprecated Use non-nested function instead
33
- */
34
- hasSegment(name: string): Promise<boolean>;
35
- };
36
- hasSegment(name: string): Promise<boolean>;
37
- manager: {
38
- additionalEmail?: string;
39
- email: string;
40
- id: string;
41
- landlinePhone?: string;
42
- mobilePhone?: string;
43
- name: string;
44
- photo?: string;
45
- };
46
- logout(): void;
47
- }
48
- export declare class ShopCart extends BaseCallClass implements Shop.Cart {
49
- serviceName: string;
50
- carts: Array<any>;
51
- currentCart: any;
52
- totalCartPrice: number;
53
- addToCart(productId: string, amount: number, where: string, cartId?: string): Promise<void>;
54
- }
55
- export declare class ShopUtils extends BaseCallClass implements Shop.Utils {
56
- serviceName: string;
57
- currency: any;
58
- isAnonymousAndPurchaseDisabled: boolean;
59
- isB2B: boolean;
60
- isB2BAndPlatformIsNotOpened: boolean;
61
- isIndexPage: boolean;
62
- isPurchaseEnabledOrAuthenticated: boolean;
63
- constructor(call: (service: string, fun: string, ...arg: any) => Promise<any>);
64
- getCategoryPath(id?: string): Promise<string | null>;
65
- getManufacturerSearchUrl(manufacturer: string): Promise<string>;
66
- getProductUrl(product: any): Promise<string | null>;
67
- isExternalUrl(url: string): Promise<boolean>;
68
- routes: {
69
- /**
70
- * @deprecated Use non-nested function instead
71
- */
72
- getCategoryPath(id?: string): (Promise<string | null> | string | null);
73
- /**
74
- * @deprecated Use non-nested function instead
75
- */
76
- getManufacturerSearchUrl(manufacturer: string): (Promise<string> | string);
77
- /**
78
- * @deprecated Use non-nested function instead
79
- */
80
- getProductUrl(product: any): (Promise<string | null> | string | null);
81
- /**
82
- * @deprecated Use non-nested function instead
83
- */
84
- isExternalUrl(url: string): (Promise<boolean> | boolean);
85
- };
86
- }
87
- export declare class ShopConfig extends BaseCallClass implements Shop.Config {
88
- serviceName: string;
89
- accessMode: string;
90
- isB2CRegistrationEnabled: boolean;
91
- isCatalogOpened: boolean;
92
- isGrossSelected: boolean;
93
- isPlatformClosed: boolean;
94
- isPlatformOpened: boolean;
95
- isPurchaseEnabled: boolean;
96
- isRegistrationEnabled: boolean;
97
- currency: any;
98
- }
@@ -1,8 +0,0 @@
1
- export declare function generateCallId(): string;
2
- export declare class BaseCallClass {
3
- serviceName: string;
4
- call: (fun: string, ...arg: any[]) => Promise<any>;
5
- constructor(call: (service: string, fun: string, ...arg: any) => Promise<any>);
6
- static update(target: Record<string, any>, payload: Record<string, any>): void;
7
- update(payload: any): void;
8
- }
@@ -1,21 +0,0 @@
1
- import { Backoffice } from "@one-commerce/sdk-shared";
2
- import { BaseCallClass } from "./utils";
3
- export declare class BackofficeCatalog extends BaseCallClass implements Backoffice.Catalog {
4
- serviceName: string;
5
- fetchCategories(): Promise<Array<unknown>>;
6
- fetchProduct(id: string): Promise<unknown>;
7
- }
8
- export declare class BackofficeUser extends BaseCallClass implements Backoffice.User {
9
- serviceName: string;
10
- email?: string;
11
- id: string;
12
- name?: string;
13
- authorities: Array<string>;
14
- }
15
- export declare class BackofficeOrderpath extends BaseCallClass implements Backoffice.Orderpath {
16
- serviceName: string;
17
- }
18
- export declare class BackofficeLayout extends BaseCallClass implements Backoffice.Layout {
19
- serviceName: string;
20
- isAsideOpened: boolean;
21
- }
@@ -1,7 +0,0 @@
1
- declare class Events {
2
- _callbacks: Record<string, any>;
3
- constructor();
4
- on<T>(key: string, callback: (arg: T) => void): void;
5
- emit(key: string, ...params: Array<any>): void;
6
- }
7
- export default Events;
@@ -1 +0,0 @@
1
- {"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../shared/build/main/shared/messages.d.ts","../../shared/build/main/shared/api.d.ts","../../shared/build/main/index.d.ts","../src/utils.ts","../src/backofficeServices.ts","../src/events.ts","../src/shopServices.ts","../src/index.ts","../src/types/iframe-channel.d.ts"],"fileInfos":[{"version":"ac3a8c4040e183ce38da69d23b96939112457d1936198e6542672b7963cf0fce","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9",{"version":"1dad4fe1561d99dfd6709127608b99a76e5c2643626c800434f99c48038567ee","affectsGlobalScope":true},{"version":"cce43d02223f8049864f8568bed322c39424013275cd3bcc3f51492d8b546cb3","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"8dff1b4c2df638fcd976cbb0e636f23ab5968e836cd45084cc31d47d1ab19c49","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"8f4c9f651c8294a2eb1cbd12581fe25bfb901ab1d474bb93cd38c7e2f4be7a30","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},"3488caee78be66bee1a74cb1406f0b8371bf0dfc2bd146e6aae9232d9669ba75","0ebe84431b92c2b40372bd0b83d461effd59feb8a70973e13f46754a98843199","3f880625520675cc8daad4ba3d539a1a77d9b8f89fe9bf440e9ebab83788c43e",{"version":"ff9ad3f1527551804ed950a6900a6d5dc54d8ec3565c27086c64cfcf8a804dd7","signature":"524e2b5a7ccf30019badc11c794760649e0f1e12c95b7c5b20fcbdc170f78165"},{"version":"133d7a4f81f4c097e5ab156e8e8cd549a8394ec0bdaca7dc01612e88608a74bb","signature":"3749f25abbeae9ec3b941c3c8410980e463cb6741d128b4c80f95f6c2c6e95ac"},"bbc149a0a418d7a59e9cd4a47e8de5debae5593b7009f1b9819d83809ef9dfe3",{"version":"f82d1c83bcf590847137e48f6144d0b3ef8134f8fce00b4bd15f562076803887","signature":"a1d18f27a7f925a5f6b032e80e65c99d3f2a0bd5b3b0775170bbd25871711520"},{"version":"69e62b148429c169f64ed482d6169b043ee85d9299841a2c5d45058d52f42772","signature":"147046d9b86498fd43c03df6f42afcfbecb3162d68b0fd27c2a925e0d93a651f"},"5e5710e2206d60011b0bb246ecf6ae76c1649928d40c58ba443e679ccd450f13"],"options":{"declaration":true,"esModuleInterop":true,"inlineSourceMap":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./esm","rootDir":"../src","strict":true,"target":99},"fileIdsList":[[23,24],[23,24,25,26,27,29],[21,22],[23,25,26,27]],"referencedMap":[[25,1],[28,2],[27,1],[23,3]],"exportedModulesMap":[[25,1],[28,4],[27,1],[23,3]],"semanticDiagnosticsPerFile":[5,7,6,2,8,9,10,11,12,13,14,15,3,4,19,16,17,18,20,1,25,26,28,27,29,24,23,22,21]},"version":"4.3.5"}
@@ -1 +0,0 @@
1
- {"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../shared/build/main/shared/messages.d.ts","../../shared/build/main/shared/api.d.ts","../../shared/build/main/index.d.ts","../src/utils.ts","../src/backofficeServices.ts","../src/events.ts","../src/shopServices.ts","../src/index.ts","../src/types/iframe-channel.d.ts"],"fileInfos":[{"version":"ac3a8c4040e183ce38da69d23b96939112457d1936198e6542672b7963cf0fce","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9",{"version":"1dad4fe1561d99dfd6709127608b99a76e5c2643626c800434f99c48038567ee","affectsGlobalScope":true},{"version":"cce43d02223f8049864f8568bed322c39424013275cd3bcc3f51492d8b546cb3","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"8dff1b4c2df638fcd976cbb0e636f23ab5968e836cd45084cc31d47d1ab19c49","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"8f4c9f651c8294a2eb1cbd12581fe25bfb901ab1d474bb93cd38c7e2f4be7a30","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},"3488caee78be66bee1a74cb1406f0b8371bf0dfc2bd146e6aae9232d9669ba75","0ebe84431b92c2b40372bd0b83d461effd59feb8a70973e13f46754a98843199","3f880625520675cc8daad4ba3d539a1a77d9b8f89fe9bf440e9ebab83788c43e",{"version":"ff9ad3f1527551804ed950a6900a6d5dc54d8ec3565c27086c64cfcf8a804dd7","signature":"524e2b5a7ccf30019badc11c794760649e0f1e12c95b7c5b20fcbdc170f78165"},{"version":"133d7a4f81f4c097e5ab156e8e8cd549a8394ec0bdaca7dc01612e88608a74bb","signature":"3749f25abbeae9ec3b941c3c8410980e463cb6741d128b4c80f95f6c2c6e95ac"},"bbc149a0a418d7a59e9cd4a47e8de5debae5593b7009f1b9819d83809ef9dfe3",{"version":"f82d1c83bcf590847137e48f6144d0b3ef8134f8fce00b4bd15f562076803887","signature":"a1d18f27a7f925a5f6b032e80e65c99d3f2a0bd5b3b0775170bbd25871711520"},{"version":"69e62b148429c169f64ed482d6169b043ee85d9299841a2c5d45058d52f42772","signature":"147046d9b86498fd43c03df6f42afcfbecb3162d68b0fd27c2a925e0d93a651f"},"5e5710e2206d60011b0bb246ecf6ae76c1649928d40c58ba443e679ccd450f13"],"options":{"declaration":true,"esModuleInterop":true,"inlineSourceMap":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./cjs","rootDir":"../src","strict":true,"target":4},"fileIdsList":[[23,24],[23,24,25,26,27,29],[21,22],[23,25,26,27]],"referencedMap":[[25,1],[28,2],[27,1],[23,3]],"exportedModulesMap":[[25,1],[28,4],[27,1],[23,3]],"semanticDiagnosticsPerFile":[5,7,6,2,8,9,10,11,12,13,14,15,3,4,19,16,17,18,20,1,25,26,28,27,29,24,23,22,21]},"version":"4.3.5"}