@one-commerce/sdk-core 1.6.0 → 1.10.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.
- package/lib/bundles/bundle.esm.js +913 -0
- package/lib/bundles/bundle.esm.js.map +1 -0
- package/lib/bundles/bundle.esm.min.js +2 -0
- package/lib/bundles/bundle.esm.min.js.map +1 -0
- package/lib/bundles/bundle.umd.js +924 -0
- package/lib/bundles/bundle.umd.js.map +1 -0
- package/lib/bundles/bundle.umd.min.js +2 -0
- package/lib/bundles/bundle.umd.min.js.map +1 -0
- package/lib/cjs/backofficeServices.js +148 -28
- package/lib/cjs/backofficeServices.js.map +1 -0
- package/lib/cjs/events.js +56 -22
- package/lib/cjs/events.js.map +1 -0
- package/lib/cjs/index.js +288 -106
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/shopServices.js +248 -54
- package/lib/cjs/shopServices.js.map +1 -0
- package/lib/cjs/utils.js +63 -29
- package/lib/cjs/utils.js.map +1 -0
- package/lib/esm/backofficeServices.js +45 -16
- package/lib/esm/backofficeServices.js.map +1 -0
- package/lib/esm/events.js +30 -22
- package/lib/esm/events.js.map +1 -0
- package/lib/esm/index.js +149 -93
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/shopServices.js +125 -67
- package/lib/esm/shopServices.js.map +1 -0
- package/lib/esm/utils.js +34 -26
- package/lib/esm/utils.js.map +1 -0
- package/lib/{cjs → types}/backofficeServices.d.ts +1 -0
- package/lib/types/backofficeServices.d.ts.map +1 -0
- package/lib/{cjs → types}/events.d.ts +1 -0
- package/lib/types/events.d.ts.map +1 -0
- package/lib/types/iframe-channel.d.ts +19 -0
- package/lib/{esm → types}/index.d.ts +14 -2
- package/lib/types/index.d.ts.map +1 -0
- package/lib/{esm → types}/shopServices.d.ts +1 -0
- package/lib/types/shopServices.d.ts.map +1 -0
- package/lib/{esm → types}/utils.d.ts +3 -1
- package/lib/types/utils.d.ts.map +1 -0
- package/package.json +42 -16
- package/lib/cjs/index.d.ts +0 -64
- package/lib/cjs/shopServices.d.ts +0 -98
- package/lib/cjs/utils.d.ts +0 -7
- package/lib/esm/backofficeServices.d.ts +0 -21
- package/lib/esm/events.d.ts +0 -7
- package/lib/tsconfig.module.tsbuildinfo +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Backoffice, Shop } from "@one-commerce/sdk-shared";
|
|
1
|
+
import { Backoffice, Route, Shop } from "@one-commerce/sdk-shared";
|
|
2
2
|
import { BackofficeCatalog, BackofficeLayout, BackofficeOrderpath, BackofficeUser } from "./backofficeServices";
|
|
3
3
|
import Events from "./events";
|
|
4
4
|
import { ShopAccount, ShopCart, ShopCatalog, ShopConfig, ShopUtils } from "./shopServices";
|
|
@@ -25,19 +25,22 @@ 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<
|
|
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
|
+
route: Route;
|
|
35
37
|
orderpath: BackofficeOrderpath;
|
|
36
38
|
catalog: BackofficeCatalog;
|
|
37
39
|
user: BackofficeUser;
|
|
38
40
|
layout: BackofficeLayout;
|
|
39
41
|
}
|
|
40
42
|
export interface ShopInstances extends Shop.Api {
|
|
43
|
+
route: Route;
|
|
41
44
|
cart: ShopCart;
|
|
42
45
|
catalog: ShopCatalog;
|
|
43
46
|
account: ShopAccount;
|
|
@@ -46,6 +49,10 @@ export interface ShopInstances extends Shop.Api {
|
|
|
46
49
|
}
|
|
47
50
|
export declare class BackofficeSdk extends Sdk<BackofficeInstances> {
|
|
48
51
|
instances: {
|
|
52
|
+
route: {
|
|
53
|
+
hash: string;
|
|
54
|
+
query: {};
|
|
55
|
+
};
|
|
49
56
|
orderpath: BackofficeOrderpath;
|
|
50
57
|
catalog: BackofficeCatalog;
|
|
51
58
|
user: BackofficeUser;
|
|
@@ -54,6 +61,10 @@ export declare class BackofficeSdk extends Sdk<BackofficeInstances> {
|
|
|
54
61
|
}
|
|
55
62
|
export declare class ShopSdk extends Sdk<ShopInstances> {
|
|
56
63
|
instances: {
|
|
64
|
+
route: {
|
|
65
|
+
hash: string;
|
|
66
|
+
query: {};
|
|
67
|
+
};
|
|
57
68
|
cart: ShopCart;
|
|
58
69
|
catalog: ShopCatalog;
|
|
59
70
|
account: ShopAccount;
|
|
@@ -62,3 +73,4 @@ export declare class ShopSdk extends Sdk<ShopInstances> {
|
|
|
62
73
|
};
|
|
63
74
|
}
|
|
64
75
|
export {};
|
|
76
|
+
//# 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,EAAE,cAAc,EACpC,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,I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OAAO,CAAC,MAAM,CAAC;IAI/D,aAAa,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAInD,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI5C,MAAM,EAAE;QACN;;WAEG;QACH,eAAe,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC;QACvE;;WAEG;QACH,wBAAwB,CAAC,YAAY,EAAE,MAAM,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC;QAC3E;;WAEG;QACH,aAAa,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC;QACtE;;WAEG;QACH,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAA;KACzD,CAAC;CACH;AAED,qBAAa,UAAW,SAAQ,aAAc,YAAW,IAAI,CAAC,MAAM;IAClE,WAAW,SAAW;IACtB,UAAU,EAAG,MAAM,CAAC;IACpB,wBAAwB,EAAG,OAAO,CAAC;IACnC,eAAe,EAAG,OAAO,CAAC;IAC1B,eAAe,EAAG,OAAO,CAAC;IAC1B,gBAAgB,EAAG,OAAO,CAAC;IAC3B,gBAAgB,EAAG,OAAO,CAAC;IAC3B,iBAAiB,EAAG,OAAO,CAAC;IAC5B,qBAAqB,EAAG,OAAO,CAAC;IAChC,QAAQ,EAAE,GAAG,CAAC;CACf"}
|
|
@@ -3,5 +3,7 @@ export declare class BaseCallClass {
|
|
|
3
3
|
serviceName: string;
|
|
4
4
|
call: (fun: string, ...arg: any[]) => Promise<any>;
|
|
5
5
|
constructor(call: (service: string, fun: string, ...arg: any) => Promise<any>);
|
|
6
|
-
update(payload:
|
|
6
|
+
static update(target: Record<string, any>, payload: Record<string, any>): void;
|
|
7
|
+
update(payload: any): void;
|
|
7
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.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "Core package for One Plugins",
|
|
5
|
+
"module": "lib/esm/index.js",
|
|
5
6
|
"main": "lib/cjs/index.js",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
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
|
-
"
|
|
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.
|
|
58
|
+
"@one-commerce/sdk-shared": "^1.7.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
|
-
"@
|
|
49
|
-
"@
|
|
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.
|
|
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": "
|
|
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": "
|
|
128
|
+
"gitHead": "394cb0fc5155f491d01184e8e23f7919726a9263"
|
|
103
129
|
}
|
package/lib/cjs/index.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { Backoffice, 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
|
-
orderpath: BackofficeOrderpath;
|
|
36
|
-
catalog: BackofficeCatalog;
|
|
37
|
-
user: BackofficeUser;
|
|
38
|
-
layout: BackofficeLayout;
|
|
39
|
-
}
|
|
40
|
-
export interface ShopInstances extends Shop.Api {
|
|
41
|
-
cart: ShopCart;
|
|
42
|
-
catalog: ShopCatalog;
|
|
43
|
-
account: ShopAccount;
|
|
44
|
-
utils: ShopUtils;
|
|
45
|
-
config: ShopConfig;
|
|
46
|
-
}
|
|
47
|
-
export declare class BackofficeSdk extends Sdk<BackofficeInstances> {
|
|
48
|
-
instances: {
|
|
49
|
-
orderpath: BackofficeOrderpath;
|
|
50
|
-
catalog: BackofficeCatalog;
|
|
51
|
-
user: BackofficeUser;
|
|
52
|
-
layout: BackofficeLayout;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
export declare class ShopSdk extends Sdk<ShopInstances> {
|
|
56
|
-
instances: {
|
|
57
|
-
cart: ShopCart;
|
|
58
|
-
catalog: ShopCatalog;
|
|
59
|
-
account: ShopAccount;
|
|
60
|
-
utils: ShopUtils;
|
|
61
|
-
config: ShopConfig;
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
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
|
-
}
|
package/lib/cjs/utils.d.ts
DELETED
|
@@ -1,7 +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
|
-
update(payload: unknown): void;
|
|
7
|
-
}
|
|
@@ -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
|
-
}
|
package/lib/esm/events.d.ts
DELETED
|
@@ -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","b7200f9bb9bcd654a35dba9a523e04c3e5990856b46523cb50e8751aa845388a","3f880625520675cc8daad4ba3d539a1a77d9b8f89fe9bf440e9ebab83788c43e",{"version":"c90a3eba3da8a8ad9482ee7cec435d6bad86a41205ce33c7020d7f884803b8e2","signature":"8d68dd78265c706f6c678b70b66a8eb578fad231dea12c00b154a0dd51e2caa4"},{"version":"133d7a4f81f4c097e5ab156e8e8cd549a8394ec0bdaca7dc01612e88608a74bb","signature":"3749f25abbeae9ec3b941c3c8410980e463cb6741d128b4c80f95f6c2c6e95ac"},"bbc149a0a418d7a59e9cd4a47e8de5debae5593b7009f1b9819d83809ef9dfe3",{"version":"a4529ee572a1f6d166afc754a186c850294e96fee7373a40c871ec495b4d2472","signature":"a1d18f27a7f925a5f6b032e80e65c99d3f2a0bd5b3b0775170bbd25871711520"},{"version":"7c5c9caa9c4b72ca928ea268f02327ea9d728e92829f8100dc43267ec617b6ff","signature":"5a09b9be2304be05420f17e99f2ff5a6628d09af3c7255ee47386e02ecda8b77"},"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"}
|
package/lib/tsconfig.tsbuildinfo
DELETED
|
@@ -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","b7200f9bb9bcd654a35dba9a523e04c3e5990856b46523cb50e8751aa845388a","3f880625520675cc8daad4ba3d539a1a77d9b8f89fe9bf440e9ebab83788c43e",{"version":"c90a3eba3da8a8ad9482ee7cec435d6bad86a41205ce33c7020d7f884803b8e2","signature":"8d68dd78265c706f6c678b70b66a8eb578fad231dea12c00b154a0dd51e2caa4"},{"version":"133d7a4f81f4c097e5ab156e8e8cd549a8394ec0bdaca7dc01612e88608a74bb","signature":"3749f25abbeae9ec3b941c3c8410980e463cb6741d128b4c80f95f6c2c6e95ac"},"bbc149a0a418d7a59e9cd4a47e8de5debae5593b7009f1b9819d83809ef9dfe3",{"version":"a4529ee572a1f6d166afc754a186c850294e96fee7373a40c871ec495b4d2472","signature":"a1d18f27a7f925a5f6b032e80e65c99d3f2a0bd5b3b0775170bbd25871711520"},{"version":"7c5c9caa9c4b72ca928ea268f02327ea9d728e92829f8100dc43267ec617b6ff","signature":"5a09b9be2304be05420f17e99f2ff5a6628d09af3c7255ee47386e02ecda8b77"},"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"}
|