@gloablehive/ipad-wechat-plugin 1.0.2 → 1.0.3
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 +11 -0
- package/package.json +1 -1
- package/src/channel.ts +11 -0
package/dist/src/channel.js
CHANGED
|
@@ -82,6 +82,17 @@ export const ipadWeChatPlugin = createChatChannelPlugin({
|
|
|
82
82
|
resolveAccountId: (params) => {
|
|
83
83
|
return resolveAccount(params.cfg, params.accountId)?.accountId || "";
|
|
84
84
|
},
|
|
85
|
+
listAccountIds: (cfg) => {
|
|
86
|
+
const section = cfg.channels?.["ipad-wechat"];
|
|
87
|
+
if (section?.wechatAccountId) {
|
|
88
|
+
return [section.wechatAccountId];
|
|
89
|
+
}
|
|
90
|
+
return ["default"];
|
|
91
|
+
},
|
|
92
|
+
defaultAccountId: (cfg) => {
|
|
93
|
+
const section = cfg.channels?.["ipad-wechat"];
|
|
94
|
+
return section?.wechatAccountId || "default";
|
|
95
|
+
},
|
|
85
96
|
inspectAccount(cfg, accountId) {
|
|
86
97
|
const section = cfg.channels?.["ipad-wechat"];
|
|
87
98
|
const hasCredentials = Boolean(section?.appKey && section?.appSecret && section?.guid);
|
package/package.json
CHANGED
package/src/channel.ts
CHANGED
|
@@ -118,6 +118,17 @@ export const ipadWeChatPlugin = createChatChannelPlugin<IPadWeChatResolvedAccoun
|
|
|
118
118
|
resolveAccountId: (params: any) => {
|
|
119
119
|
return resolveAccount(params.cfg, params.accountId)?.accountId || "";
|
|
120
120
|
},
|
|
121
|
+
listAccountIds: (cfg: any) => {
|
|
122
|
+
const section = (cfg.channels as Record<string, any>)?.["ipad-wechat"];
|
|
123
|
+
if (section?.wechatAccountId) {
|
|
124
|
+
return [section.wechatAccountId];
|
|
125
|
+
}
|
|
126
|
+
return ["default"];
|
|
127
|
+
},
|
|
128
|
+
defaultAccountId: (cfg: any) => {
|
|
129
|
+
const section = (cfg.channels as Record<string, any>)?.["ipad-wechat"];
|
|
130
|
+
return section?.wechatAccountId || "default";
|
|
131
|
+
},
|
|
121
132
|
inspectAccount(cfg: any, accountId: any) {
|
|
122
133
|
const section = (cfg.channels as Record<string, any>)?.["ipad-wechat"];
|
|
123
134
|
const hasCredentials = Boolean(section?.appKey && section?.appSecret && section?.guid);
|