@channel.io/app-sdk-core 0.4.2 → 0.6.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/dist/extensions/command.d.ts +642 -0
- package/dist/extensions/command.d.ts.map +1 -1
- package/dist/extensions/command.js +77 -0
- package/dist/extensions/command.js.map +1 -1
- package/dist/extensions/customtab.d.ts +84 -22
- package/dist/extensions/customtab.d.ts.map +1 -1
- package/dist/extensions/customtab.js +26 -16
- package/dist/extensions/customtab.js.map +1 -1
- package/dist/extensions/index.d.ts +4 -3
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +5 -3
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/interfaces/command.d.ts +108 -59
- package/dist/extensions/interfaces/command.d.ts.map +1 -1
- package/dist/extensions/interfaces/command.js +1 -0
- package/dist/extensions/interfaces/command.js.map +1 -1
- package/dist/extensions/interfaces/customtab.d.ts +67 -45
- package/dist/extensions/interfaces/customtab.d.ts.map +1 -1
- package/dist/extensions/interfaces/customtab.js +2 -2
- package/dist/extensions/interfaces/customtab.js.map +1 -1
- package/dist/extensions/interfaces/index.d.ts +1 -0
- package/dist/extensions/interfaces/index.d.ts.map +1 -1
- package/dist/extensions/interfaces/index.js +1 -0
- package/dist/extensions/interfaces/index.js.map +1 -1
- package/dist/extensions/interfaces/widget.d.ts +68 -50
- package/dist/extensions/interfaces/widget.d.ts.map +1 -1
- package/dist/extensions/interfaces/widget.js +1 -1
- package/dist/extensions/interfaces/widget.js.map +1 -1
- package/dist/extensions/interfaces/wms.d.ts +98 -0
- package/dist/extensions/interfaces/wms.d.ts.map +1 -0
- package/dist/extensions/interfaces/wms.js +14 -0
- package/dist/extensions/interfaces/wms.js.map +1 -0
- package/dist/extensions/widget.d.ts +281 -31
- package/dist/extensions/widget.d.ts.map +1 -1
- package/dist/extensions/widget.js +53 -19
- package/dist/extensions/widget.js.map +1 -1
- package/dist/extensions/wms.d.ts +318 -0
- package/dist/extensions/wms.d.ts.map +1 -0
- package/dist/extensions/wms.js +51 -0
- package/dist/extensions/wms.js.map +1 -0
- package/dist/types/extension.d.ts +1 -1
- package/dist/types/extension.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,82 +1,104 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CustomTabActionResult, GetCustomTabsOutput } from "../customtab.js";
|
|
2
2
|
import type { Context } from "../../types/context.js";
|
|
3
3
|
/**
|
|
4
|
-
* Custom
|
|
4
|
+
* Custom tab metadata input/output types
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export type GetCustomTabsInput = Record<string, never>;
|
|
7
|
+
export interface CustomTabActionInput {
|
|
8
|
+
/** Active language */
|
|
9
|
+
language: string;
|
|
10
|
+
/** Optional WAM args forwarded by AppStore */
|
|
11
|
+
wamArgs?: unknown;
|
|
9
12
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Custom tab metadata extension interface
|
|
15
|
+
*
|
|
16
|
+
* Implement this interface to expose custom tab definitions for AppStore registration.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* @Extension({ name: "customtab", systemVersion: "v1" })
|
|
21
|
+
* export class MyCustomTabExtension implements CustomTabMetadataExtensionInterface {
|
|
22
|
+
* @Func("metadata.getCustomTabs")
|
|
23
|
+
* async getCustomTabs(ctx, params): Promise<GetCustomTabsOutput> {
|
|
24
|
+
* return {
|
|
25
|
+
* customTabs: [
|
|
26
|
+
* {
|
|
27
|
+
* name: "analytics",
|
|
28
|
+
* actionFunctionName: "customtabs.analytics.action",
|
|
29
|
+
* nameI18nMap: {
|
|
30
|
+
* ko: { name: "분석" },
|
|
31
|
+
* ja: { name: "分析" },
|
|
32
|
+
* },
|
|
33
|
+
* },
|
|
34
|
+
* ],
|
|
35
|
+
* };
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export interface CustomTabMetadataExtensionInterface {
|
|
41
|
+
/**
|
|
42
|
+
* Get custom tab definitions for AppStore registration
|
|
43
|
+
*
|
|
44
|
+
* Function name: "metadata.getCustomTabs"
|
|
45
|
+
*/
|
|
46
|
+
getCustomTabs(ctx: Context, params: GetCustomTabsInput): Promise<GetCustomTabsOutput>;
|
|
21
47
|
}
|
|
22
48
|
/**
|
|
23
|
-
* Custom
|
|
49
|
+
* Custom tab extension interface
|
|
24
50
|
*
|
|
25
|
-
*
|
|
51
|
+
* Custom tab registration is driven by `metadata.getCustomTabs`. The runtime
|
|
52
|
+
* action function is a plain app function referenced by each tab's
|
|
53
|
+
* `actionFunctionName`, so it may live inside or outside the extension class.
|
|
26
54
|
*
|
|
27
55
|
* @example
|
|
28
56
|
* ```typescript
|
|
29
57
|
* @Extension({ name: "customtab", systemVersion: "v1" })
|
|
30
58
|
* export class MyCustomTabExtension implements CustomTabExtensionInterface {
|
|
31
|
-
* @Func("
|
|
32
|
-
* async
|
|
59
|
+
* @Func("metadata.getCustomTabs")
|
|
60
|
+
* async getCustomTabs(ctx, params): Promise<GetCustomTabsOutput> {
|
|
33
61
|
* return {
|
|
34
|
-
*
|
|
62
|
+
* customTabs: [
|
|
35
63
|
* {
|
|
36
|
-
* name: "
|
|
64
|
+
* name: "analytics",
|
|
65
|
+
* actionFunctionName: "customtabs.analytics.action",
|
|
37
66
|
* nameI18nMap: {
|
|
38
67
|
* ko: { name: "분석" },
|
|
39
|
-
* ja: { name: "分析" },
|
|
40
68
|
* },
|
|
41
|
-
* icon: "chart",
|
|
42
69
|
* },
|
|
43
70
|
* ],
|
|
44
71
|
* };
|
|
45
72
|
* }
|
|
73
|
+
* }
|
|
46
74
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
75
|
+
* export class CustomTabFunctions {
|
|
76
|
+
* @Func("customtabs.analytics.action")
|
|
77
|
+
* async action(ctx, params): Promise<CustomTabActionResult> {
|
|
49
78
|
* return {
|
|
50
|
-
*
|
|
51
|
-
*
|
|
79
|
+
* type: "wam",
|
|
80
|
+
* attributes: {
|
|
81
|
+
* appId: process.env.APP_ID,
|
|
82
|
+
* name: "analytics-dashboard",
|
|
83
|
+
* wamArgs: params.wamArgs ?? {},
|
|
84
|
+
* },
|
|
52
85
|
* };
|
|
53
86
|
* }
|
|
54
87
|
* }
|
|
55
88
|
* ```
|
|
56
89
|
*/
|
|
57
|
-
export interface CustomTabExtensionInterface {
|
|
90
|
+
export interface CustomTabExtensionInterface extends CustomTabMetadataExtensionInterface {
|
|
58
91
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* Function name: "customtab.getConfig"
|
|
62
|
-
*
|
|
63
|
-
* @returns List of tab configurations
|
|
64
|
-
*/
|
|
65
|
-
getConfig(ctx: Context, params: GetTabConfigInput): Promise<GetTabConfigOutput>;
|
|
66
|
-
/**
|
|
67
|
-
* Get content for a specific tab
|
|
68
|
-
*
|
|
69
|
-
* Function name: "customtab.getContent"
|
|
70
|
-
*
|
|
71
|
-
* @returns WAM name and params to render in the tab
|
|
92
|
+
* Optional action function.
|
|
93
|
+
* This is a plain app function referenced by `actionFunctionName`.
|
|
72
94
|
*/
|
|
73
|
-
|
|
95
|
+
action?(ctx: Context, params: CustomTabActionInput): Promise<CustomTabActionResult>;
|
|
74
96
|
}
|
|
75
97
|
/**
|
|
76
98
|
* Custom Tab Extension Function Names
|
|
77
99
|
*/
|
|
78
100
|
export declare const CustomTabFunctionNames: {
|
|
79
|
-
readonly
|
|
80
|
-
readonly
|
|
101
|
+
readonly getCustomTabs: "metadata.getCustomTabs";
|
|
102
|
+
readonly action: "customtab.action";
|
|
81
103
|
};
|
|
82
104
|
//# sourceMappingURL=customtab.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customtab.d.ts","sourceRoot":"","sources":["../../../src/extensions/interfaces/customtab.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"customtab.d.ts","sourceRoot":"","sources":["../../../src/extensions/interfaces/customtab.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEvD,MAAM,WAAW,oBAAoB;IACnC,sBAAsB;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,mCAAmC;IAClD;;;;OAIG;IACH,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACvF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,WAAW,2BAA4B,SAAQ,mCAAmC;IACtF;;;OAGG;IACH,MAAM,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACrF;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;CAGzB,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Custom Tab Extension Function Names
|
|
3
3
|
*/
|
|
4
4
|
export const CustomTabFunctionNames = {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
getCustomTabs: "metadata.getCustomTabs",
|
|
6
|
+
action: "customtab.action",
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=customtab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customtab.js","sourceRoot":"","sources":["../../../src/extensions/interfaces/customtab.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"customtab.js","sourceRoot":"","sources":["../../../src/extensions/interfaces/customtab.ts"],"names":[],"mappings":"AAqGA;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,aAAa,EAAE,wBAAwB;IACvC,MAAM,EAAE,kBAAkB;CAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/interfaces/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/interfaces/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/extensions/interfaces/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/extensions/interfaces/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
|
@@ -1,87 +1,105 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GetWidgetsOutput, WidgetActionResult } from "../widget.js";
|
|
2
2
|
import type { Context } from "../../types/context.js";
|
|
3
3
|
/**
|
|
4
|
-
* Widget
|
|
4
|
+
* Widget metadata input/output types
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
7
|
-
/** Widget ID */
|
|
8
|
-
widgetId?: string;
|
|
9
|
-
/** Scope where widget is displayed ("front" or "desk") */
|
|
10
|
-
scope?: "front" | "desk";
|
|
11
|
-
}
|
|
12
|
-
export interface GetWidgetConfigOutput {
|
|
13
|
-
/** Widget configurations */
|
|
14
|
-
widgets: WidgetConfig[];
|
|
15
|
-
}
|
|
6
|
+
export type GetWidgetsInput = Record<string, never>;
|
|
16
7
|
export interface WidgetActionInput {
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
userId?: string;
|
|
25
|
-
/** Chat ID where the action was triggered (if applicable) */
|
|
26
|
-
chatId?: string;
|
|
8
|
+
/** Chat where the widget was opened */
|
|
9
|
+
chat: {
|
|
10
|
+
type: string;
|
|
11
|
+
id: string;
|
|
12
|
+
};
|
|
13
|
+
/** Active language */
|
|
14
|
+
language: string;
|
|
27
15
|
}
|
|
28
16
|
/**
|
|
29
|
-
* Widget
|
|
17
|
+
* Widget metadata extension interface
|
|
30
18
|
*
|
|
31
|
-
* Implement this interface to
|
|
19
|
+
* Implement this interface to expose widget definitions for AppStore registration.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* @Extension({ name: "widget", systemVersion: "v1" })
|
|
24
|
+
* export class MyWidgetExtension implements WidgetMetadataExtensionInterface {
|
|
25
|
+
* @Func("metadata.getWidgets")
|
|
26
|
+
* async getWidgets(ctx, params): Promise<GetWidgetsOutput> {
|
|
27
|
+
* return {
|
|
28
|
+
* widgets: [
|
|
29
|
+
* {
|
|
30
|
+
* name: "quick_actions",
|
|
31
|
+
* scope: "desk",
|
|
32
|
+
* widgetType: "wam",
|
|
33
|
+
* actionFunctionName: "widgets.quickActions.action",
|
|
34
|
+
* defaultName: "Quick Actions",
|
|
35
|
+
* },
|
|
36
|
+
* ],
|
|
37
|
+
* };
|
|
38
|
+
* }
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export interface WidgetMetadataExtensionInterface {
|
|
43
|
+
/**
|
|
44
|
+
* Get widget definitions for AppStore registration
|
|
45
|
+
*
|
|
46
|
+
* Function name: "metadata.getWidgets"
|
|
47
|
+
*/
|
|
48
|
+
getWidgets(ctx: Context, params: GetWidgetsInput): Promise<GetWidgetsOutput>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Widget extension interface
|
|
52
|
+
*
|
|
53
|
+
* Widget registration is driven by `metadata.getWidgets`. The runtime action
|
|
54
|
+
* function is a plain app function referenced by each widget's
|
|
55
|
+
* `actionFunctionName`, so it may live inside or outside the extension class.
|
|
32
56
|
*
|
|
33
57
|
* @example
|
|
34
58
|
* ```typescript
|
|
35
59
|
* @Extension({ name: "widget", systemVersion: "v1" })
|
|
36
60
|
* export class MyWidgetExtension implements WidgetExtensionInterface {
|
|
37
|
-
* @Func("
|
|
38
|
-
* async
|
|
61
|
+
* @Func("metadata.getWidgets")
|
|
62
|
+
* async getWidgets(ctx, params): Promise<GetWidgetsOutput> {
|
|
39
63
|
* return {
|
|
40
64
|
* widgets: [
|
|
41
65
|
* {
|
|
42
|
-
* name: "
|
|
43
|
-
* description: "Frequently used actions",
|
|
66
|
+
* name: "quick_actions",
|
|
44
67
|
* scope: "desk",
|
|
45
68
|
* widgetType: "wam",
|
|
69
|
+
* actionFunctionName: "widgets.quickActions.action",
|
|
70
|
+
* defaultName: "Quick Actions",
|
|
46
71
|
* },
|
|
47
72
|
* ],
|
|
48
73
|
* };
|
|
49
74
|
* }
|
|
75
|
+
* }
|
|
50
76
|
*
|
|
51
|
-
*
|
|
77
|
+
* export class WidgetFunctions {
|
|
78
|
+
* @Func("widgets.quickActions.action")
|
|
52
79
|
* async action(ctx, params): Promise<WidgetActionResult> {
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
80
|
+
* return {
|
|
81
|
+
* type: "wam",
|
|
82
|
+
* attributes: {
|
|
83
|
+
* appId: process.env.APP_ID,
|
|
84
|
+
* name: "quick-actions",
|
|
85
|
+
* },
|
|
86
|
+
* };
|
|
58
87
|
* }
|
|
59
88
|
* }
|
|
60
89
|
* ```
|
|
61
90
|
*/
|
|
62
|
-
export interface WidgetExtensionInterface {
|
|
63
|
-
/**
|
|
64
|
-
* Get widget configuration
|
|
65
|
-
*
|
|
66
|
-
* Function name: "widget.getConfig"
|
|
67
|
-
*
|
|
68
|
-
* @returns List of widget configurations
|
|
69
|
-
*/
|
|
70
|
-
getConfig(ctx: Context, params: GetWidgetConfigInput): Promise<GetWidgetConfigOutput>;
|
|
91
|
+
export interface WidgetExtensionInterface extends WidgetMetadataExtensionInterface {
|
|
71
92
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* Function name: "widget.action"
|
|
75
|
-
*
|
|
76
|
-
* @returns Action result with success status
|
|
93
|
+
* Optional action function.
|
|
94
|
+
* This is a plain app function referenced by `actionFunctionName`.
|
|
77
95
|
*/
|
|
78
|
-
action(ctx: Context, params: WidgetActionInput): Promise<WidgetActionResult>;
|
|
96
|
+
action?(ctx: Context, params: WidgetActionInput): Promise<WidgetActionResult>;
|
|
79
97
|
}
|
|
80
98
|
/**
|
|
81
99
|
* Widget Extension Function Names
|
|
82
100
|
*/
|
|
83
101
|
export declare const WidgetFunctionNames: {
|
|
84
|
-
readonly
|
|
102
|
+
readonly getWidgets: "metadata.getWidgets";
|
|
85
103
|
readonly action: "widget.action";
|
|
86
104
|
};
|
|
87
105
|
//# sourceMappingURL=widget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../../src/extensions/interfaces/widget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../../src/extensions/interfaces/widget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEpD,MAAM,WAAW,iBAAiB;IAChC,uCAAuC;IACvC,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;IACF,sBAAsB;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,gCAAgC;IAC/C;;;;OAIG;IACH,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC9E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,WAAW,wBAAyB,SAAQ,gCAAgC;IAChF;;;OAGG;IACH,MAAM,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC/E;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.js","sourceRoot":"","sources":["../../../src/extensions/interfaces/widget.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"widget.js","sourceRoot":"","sources":["../../../src/extensions/interfaces/widget.ts"],"names":[],"mappings":"AAsGA;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,UAAU,EAAE,qBAAqB;IACjC,MAAM,EAAE,eAAe;CACf,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { Context } from "../../types/context.js";
|
|
2
|
+
import type { CommerceIdentifiers, WmsOrder } from "../wms.js";
|
|
3
|
+
export interface GetWmsOrdersInput {
|
|
4
|
+
commerceOrderIds?: string;
|
|
5
|
+
orderIds?: string;
|
|
6
|
+
packageIds?: string;
|
|
7
|
+
shopId?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface GetWmsOrdersOutput {
|
|
10
|
+
orders: WmsOrder[];
|
|
11
|
+
}
|
|
12
|
+
export interface GetWmsOrderInput {
|
|
13
|
+
commerceOrderId?: string;
|
|
14
|
+
orderId?: string;
|
|
15
|
+
packageId?: string;
|
|
16
|
+
shopId?: string;
|
|
17
|
+
}
|
|
18
|
+
export type GetWmsOrderOutput = WmsOrder;
|
|
19
|
+
export interface GetWmsShopIdInput {
|
|
20
|
+
commerceIdentifiers?: CommerceIdentifiers;
|
|
21
|
+
}
|
|
22
|
+
export interface GetWmsShopIdOutput {
|
|
23
|
+
shopId: string;
|
|
24
|
+
}
|
|
25
|
+
export interface CancelWmsOrderInput {
|
|
26
|
+
orderIds: string;
|
|
27
|
+
reason?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface ReturnWmsOrderInput {
|
|
30
|
+
orderIds: string;
|
|
31
|
+
reason?: string;
|
|
32
|
+
memo?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ExchangeWmsOrderInput {
|
|
35
|
+
orderIds: string;
|
|
36
|
+
reason?: string;
|
|
37
|
+
memo?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface ChangeWmsShippingAddressInput {
|
|
40
|
+
orderId: string;
|
|
41
|
+
recipient: string;
|
|
42
|
+
phone: string;
|
|
43
|
+
address1: string;
|
|
44
|
+
postalCode: string;
|
|
45
|
+
address2?: string;
|
|
46
|
+
message?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface RestoreWmsOrderInput {
|
|
49
|
+
orderId: string;
|
|
50
|
+
memo?: string;
|
|
51
|
+
prdSeq?: string;
|
|
52
|
+
restorePack?: boolean;
|
|
53
|
+
restockNormal?: boolean;
|
|
54
|
+
restockBad?: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface WmsSuccessOutput {
|
|
57
|
+
success: boolean;
|
|
58
|
+
message?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* WMS Extension Interface
|
|
62
|
+
*
|
|
63
|
+
* Implement this interface to create a warehouse/order management extension
|
|
64
|
+
* for providers such as EzAdmin and similar WMS systems.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* @Extension({ name: "wms", systemVersion: "v1" })
|
|
69
|
+
* export class MyWmsExtension implements WmsExtensionInterface {
|
|
70
|
+
* @Func("extension.wms.core.getOrders")
|
|
71
|
+
* async getOrders(ctx, params) { ... }
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export interface WmsExtensionInterface {
|
|
76
|
+
getOrders(ctx: Context, params: GetWmsOrdersInput): Promise<GetWmsOrdersOutput>;
|
|
77
|
+
getOrder?(ctx: Context, params: GetWmsOrderInput): Promise<GetWmsOrderOutput>;
|
|
78
|
+
getShopId?(ctx: Context, params: GetWmsShopIdInput): Promise<GetWmsShopIdOutput>;
|
|
79
|
+
cancelOrder?(ctx: Context, params: CancelWmsOrderInput): Promise<WmsSuccessOutput>;
|
|
80
|
+
returnOrder?(ctx: Context, params: ReturnWmsOrderInput): Promise<WmsSuccessOutput>;
|
|
81
|
+
exchangeOrder?(ctx: Context, params: ExchangeWmsOrderInput): Promise<WmsSuccessOutput>;
|
|
82
|
+
changeShippingAddress?(ctx: Context, params: ChangeWmsShippingAddressInput): Promise<WmsSuccessOutput>;
|
|
83
|
+
restoreOrder?(ctx: Context, params: RestoreWmsOrderInput): Promise<WmsSuccessOutput>;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* WMS Extension Function Names
|
|
87
|
+
*/
|
|
88
|
+
export declare const WmsFunctionNames: {
|
|
89
|
+
readonly getOrders: "extension.wms.core.getOrders";
|
|
90
|
+
readonly getOrder: "extension.wms.core.getOrder";
|
|
91
|
+
readonly getShopId: "extension.wms.core.getShopId";
|
|
92
|
+
readonly cancelOrder: "extension.wms.cancel.cancelOrder";
|
|
93
|
+
readonly returnOrder: "extension.wms.return.returnOrder";
|
|
94
|
+
readonly exchangeOrder: "extension.wms.exchange.exchangeOrder";
|
|
95
|
+
readonly changeShippingAddress: "extension.wms.edit.changeShippingAddress";
|
|
96
|
+
readonly restoreOrder: "extension.wms.restore.restoreOrder";
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=wms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wms.d.ts","sourceRoot":"","sources":["../../../src/extensions/interfaces/wms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EA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C,CAAC;IAI7B,YAAY,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACtF;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;CASnB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WMS Extension Function Names
|
|
3
|
+
*/
|
|
4
|
+
export const WmsFunctionNames = {
|
|
5
|
+
getOrders: "extension.wms.core.getOrders",
|
|
6
|
+
getOrder: "extension.wms.core.getOrder",
|
|
7
|
+
getShopId: "extension.wms.core.getShopId",
|
|
8
|
+
cancelOrder: "extension.wms.cancel.cancelOrder",
|
|
9
|
+
returnOrder: "extension.wms.return.returnOrder",
|
|
10
|
+
exchangeOrder: "extension.wms.exchange.exchangeOrder",
|
|
11
|
+
changeShippingAddress: "extension.wms.edit.changeShippingAddress",
|
|
12
|
+
restoreOrder: "extension.wms.restore.restoreOrder",
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=wms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wms.js","sourceRoot":"","sources":["../../../src/extensions/interfaces/wms.ts"],"names":[],"mappings":"AA4IA;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,SAAS,EAAE,8BAA8B;IACzC,QAAQ,EAAE,6BAA6B;IACvC,SAAS,EAAE,8BAA8B;IACzC,WAAW,EAAE,kCAAkC;IAC/C,WAAW,EAAE,kCAAkC;IAC/C,aAAa,EAAE,sCAAsC;IACrD,qBAAqB,EAAE,0CAA0C;IACjE,YAAY,EAAE,oCAAoC;CAC1C,CAAC"}
|