@openclaw-china/dingtalk 2026.3.8-3 → 2026.3.9
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/index.js +23 -17
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -6564,15 +6564,21 @@ function getPreferredAccountConfig(channelCfg) {
|
|
|
6564
6564
|
}
|
|
6565
6565
|
return void 0;
|
|
6566
6566
|
}
|
|
6567
|
-
function
|
|
6568
|
-
if (hasNonEmptyString(channelCfg
|
|
6567
|
+
function hasCredentialPair(channelCfg, firstKey, secondKey) {
|
|
6568
|
+
if (hasNonEmptyString(channelCfg[firstKey]) && hasNonEmptyString(channelCfg[secondKey])) {
|
|
6569
6569
|
return true;
|
|
6570
6570
|
}
|
|
6571
6571
|
const accountCfg = getPreferredAccountConfig(channelCfg);
|
|
6572
6572
|
return Boolean(
|
|
6573
|
-
accountCfg && hasNonEmptyString(accountCfg
|
|
6573
|
+
accountCfg && hasNonEmptyString(accountCfg[firstKey]) && hasNonEmptyString(accountCfg[secondKey])
|
|
6574
6574
|
);
|
|
6575
6575
|
}
|
|
6576
|
+
function hasTokenPair(channelCfg) {
|
|
6577
|
+
return hasCredentialPair(channelCfg, "token", "encodingAESKey");
|
|
6578
|
+
}
|
|
6579
|
+
function hasWecomWsCredentialPair(channelCfg) {
|
|
6580
|
+
return hasCredentialPair(channelCfg, "botId", "secret");
|
|
6581
|
+
}
|
|
6576
6582
|
function isChannelConfigured(cfg, channelId) {
|
|
6577
6583
|
const channelCfg = getChannelConfig(cfg, channelId);
|
|
6578
6584
|
switch (channelId) {
|
|
@@ -6583,6 +6589,7 @@ function isChannelConfigured(cfg, channelId) {
|
|
|
6583
6589
|
case "qqbot":
|
|
6584
6590
|
return hasNonEmptyString(channelCfg.appId) && hasNonEmptyString(channelCfg.clientSecret);
|
|
6585
6591
|
case "wecom":
|
|
6592
|
+
return hasWecomWsCredentialPair(channelCfg);
|
|
6586
6593
|
case "wecom-app":
|
|
6587
6594
|
return hasTokenPair(channelCfg);
|
|
6588
6595
|
default:
|
|
@@ -6733,25 +6740,24 @@ async function configureWecom(prompter, cfg) {
|
|
|
6733
6740
|
section("\u914D\u7F6E WeCom\uFF08\u4F01\u4E1A\u5FAE\u4FE1-\u667A\u80FD\u673A\u5668\u4EBA\uFF09");
|
|
6734
6741
|
showGuideLink("wecom");
|
|
6735
6742
|
const existing = getChannelConfig(cfg, "wecom");
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
});
|
|
6741
|
-
const token = await prompter.askSecret({
|
|
6742
|
-
label: "WeCom token",
|
|
6743
|
-
existingValue: toTrimmedString2(existing.token),
|
|
6743
|
+
Ve("\u5F53\u524D\u5411\u5BFC\u4EC5\u63D0\u4F9B WeCom ws \u957F\u8FDE\u63A5\u914D\u7F6E\u3002", "\u63D0\u793A");
|
|
6744
|
+
const botId = await prompter.askText({
|
|
6745
|
+
label: "WeCom botId\uFF08ws \u957F\u8FDE\u63A5\uFF09",
|
|
6746
|
+
defaultValue: toTrimmedString2(existing.botId),
|
|
6744
6747
|
required: true
|
|
6745
6748
|
});
|
|
6746
|
-
const
|
|
6747
|
-
label: "WeCom
|
|
6748
|
-
existingValue: toTrimmedString2(existing.
|
|
6749
|
+
const secret = await prompter.askSecret({
|
|
6750
|
+
label: "WeCom secret\uFF08ws \u957F\u8FDE\u63A5\uFF09",
|
|
6751
|
+
existingValue: toTrimmedString2(existing.secret),
|
|
6749
6752
|
required: true
|
|
6750
6753
|
});
|
|
6751
6754
|
return mergeChannelConfig(cfg, "wecom", {
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
+
mode: "ws",
|
|
6756
|
+
botId,
|
|
6757
|
+
secret,
|
|
6758
|
+
webhookPath: void 0,
|
|
6759
|
+
token: void 0,
|
|
6760
|
+
encodingAESKey: void 0
|
|
6755
6761
|
});
|
|
6756
6762
|
}
|
|
6757
6763
|
async function configureWecomApp(prompter, cfg) {
|