@gloablehive/ipad-wechat-plugin 1.0.3 → 1.0.5
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/src/channel.js +16 -5
- package/package.json +1 -1
- package/src/channel.ts +16 -5
package/dist/src/channel.js
CHANGED
|
@@ -78,10 +78,8 @@ export const ipadWeChatPlugin = createChatChannelPlugin({
|
|
|
78
78
|
supportsEditing: false,
|
|
79
79
|
supportsDeleting: false,
|
|
80
80
|
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return resolveAccount(params.cfg, params.accountId)?.accountId || "";
|
|
84
|
-
},
|
|
81
|
+
// Config adapter - for runtime account management
|
|
82
|
+
config: {
|
|
85
83
|
listAccountIds: (cfg) => {
|
|
86
84
|
const section = cfg.channels?.["ipad-wechat"];
|
|
87
85
|
if (section?.wechatAccountId) {
|
|
@@ -89,11 +87,14 @@ export const ipadWeChatPlugin = createChatChannelPlugin({
|
|
|
89
87
|
}
|
|
90
88
|
return ["default"];
|
|
91
89
|
},
|
|
90
|
+
resolveAccount: (cfg, accountId) => {
|
|
91
|
+
return resolveAccount(cfg, accountId);
|
|
92
|
+
},
|
|
92
93
|
defaultAccountId: (cfg) => {
|
|
93
94
|
const section = cfg.channels?.["ipad-wechat"];
|
|
94
95
|
return section?.wechatAccountId || "default";
|
|
95
96
|
},
|
|
96
|
-
inspectAccount(cfg, accountId) {
|
|
97
|
+
inspectAccount: (cfg, accountId) => {
|
|
97
98
|
const section = cfg.channels?.["ipad-wechat"];
|
|
98
99
|
const hasCredentials = Boolean(section?.appKey && section?.appSecret && section?.guid);
|
|
99
100
|
return {
|
|
@@ -103,6 +104,16 @@ export const ipadWeChatPlugin = createChatChannelPlugin({
|
|
|
103
104
|
};
|
|
104
105
|
},
|
|
105
106
|
},
|
|
107
|
+
// Setup adapter - for initial configuration
|
|
108
|
+
setup: {
|
|
109
|
+
resolveAccountId: (params) => {
|
|
110
|
+
return resolveAccount(params.cfg, params.accountId)?.accountId || "";
|
|
111
|
+
},
|
|
112
|
+
applyAccountConfig: (params) => {
|
|
113
|
+
const { cfg, accountId, input } = params;
|
|
114
|
+
return cfg;
|
|
115
|
+
},
|
|
116
|
+
},
|
|
106
117
|
}),
|
|
107
118
|
security: {
|
|
108
119
|
dm: {
|
package/package.json
CHANGED
package/src/channel.ts
CHANGED
|
@@ -114,10 +114,8 @@ export const ipadWeChatPlugin = createChatChannelPlugin<IPadWeChatResolvedAccoun
|
|
|
114
114
|
supportsEditing: false,
|
|
115
115
|
supportsDeleting: false,
|
|
116
116
|
} as any,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return resolveAccount(params.cfg, params.accountId)?.accountId || "";
|
|
120
|
-
},
|
|
117
|
+
// Config adapter - for runtime account management
|
|
118
|
+
config: {
|
|
121
119
|
listAccountIds: (cfg: any) => {
|
|
122
120
|
const section = (cfg.channels as Record<string, any>)?.["ipad-wechat"];
|
|
123
121
|
if (section?.wechatAccountId) {
|
|
@@ -125,11 +123,14 @@ export const ipadWeChatPlugin = createChatChannelPlugin<IPadWeChatResolvedAccoun
|
|
|
125
123
|
}
|
|
126
124
|
return ["default"];
|
|
127
125
|
},
|
|
126
|
+
resolveAccount: (cfg: any, accountId?: string | null) => {
|
|
127
|
+
return resolveAccount(cfg, accountId);
|
|
128
|
+
},
|
|
128
129
|
defaultAccountId: (cfg: any) => {
|
|
129
130
|
const section = (cfg.channels as Record<string, any>)?.["ipad-wechat"];
|
|
130
131
|
return section?.wechatAccountId || "default";
|
|
131
132
|
},
|
|
132
|
-
inspectAccount(cfg: any, accountId
|
|
133
|
+
inspectAccount: (cfg: any, accountId?: string | null) => {
|
|
133
134
|
const section = (cfg.channels as Record<string, any>)?.["ipad-wechat"];
|
|
134
135
|
const hasCredentials = Boolean(section?.appKey && section?.appSecret && section?.guid);
|
|
135
136
|
return {
|
|
@@ -139,6 +140,16 @@ export const ipadWeChatPlugin = createChatChannelPlugin<IPadWeChatResolvedAccoun
|
|
|
139
140
|
};
|
|
140
141
|
},
|
|
141
142
|
} as any,
|
|
143
|
+
// Setup adapter - for initial configuration
|
|
144
|
+
setup: {
|
|
145
|
+
resolveAccountId: (params: any) => {
|
|
146
|
+
return resolveAccount(params.cfg, params.accountId)?.accountId || "";
|
|
147
|
+
},
|
|
148
|
+
applyAccountConfig: (params: any) => {
|
|
149
|
+
const { cfg, accountId, input } = params;
|
|
150
|
+
return cfg;
|
|
151
|
+
},
|
|
152
|
+
},
|
|
142
153
|
}) as any,
|
|
143
154
|
|
|
144
155
|
security: {
|