opencode-feishu 0.4.0 → 0.4.1
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 +19 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -99510,9 +99510,10 @@ var FeishuPlugin = async (ctx) => {
|
|
|
99510
99510
|
throw new Error(`\u98DE\u4E66\u914D\u7F6E\u6587\u4EF6\u683C\u5F0F\u9519\u8BEF\uFF1A${configPath} \u5FC5\u987B\u662F\u5408\u6CD5\u7684 JSON (${parseErr})`);
|
|
99511
99511
|
}
|
|
99512
99512
|
if (feishuRaw.directory !== void 0 && typeof feishuRaw.directory !== "string") {
|
|
99513
|
-
|
|
99514
|
-
|
|
99515
|
-
);
|
|
99513
|
+
log("warn", `\u98DE\u4E66\u914D\u7F6E\u8B66\u544A\uFF1A${configPath} \u4E2D\u7684 'directory' \u5FC5\u987B\u662F\u5B57\u7B26\u4E32\uFF0C\u5DF2\u5FFD\u7565`, {
|
|
99514
|
+
actualType: typeof feishuRaw.directory
|
|
99515
|
+
});
|
|
99516
|
+
feishuRaw.directory = void 0;
|
|
99516
99517
|
}
|
|
99517
99518
|
if (!feishuRaw.appId || !feishuRaw.appSecret) {
|
|
99518
99519
|
throw new Error(
|
|
@@ -99529,7 +99530,7 @@ var FeishuPlugin = async (ctx) => {
|
|
|
99529
99530
|
pollInterval: feishuRaw.pollInterval ?? DEFAULT_CONFIG.pollInterval,
|
|
99530
99531
|
stablePolls: feishuRaw.stablePolls ?? DEFAULT_CONFIG.stablePolls,
|
|
99531
99532
|
dedupTtl: feishuRaw.dedupTtl ?? DEFAULT_CONFIG.dedupTtl,
|
|
99532
|
-
directory: feishuRaw.directory ?? ctx.directory ?? DEFAULT_CONFIG.directory
|
|
99533
|
+
directory: expandDirectoryPath(feishuRaw.directory ?? ctx.directory ?? DEFAULT_CONFIG.directory)
|
|
99533
99534
|
};
|
|
99534
99535
|
initDedup(resolvedConfig.dedupTtl);
|
|
99535
99536
|
const botOpenId = await fetchBotOpenId(resolvedConfig.appId, resolvedConfig.appSecret, log);
|
|
@@ -99573,6 +99574,20 @@ var FeishuPlugin = async (ctx) => {
|
|
|
99573
99574
|
};
|
|
99574
99575
|
return hooks;
|
|
99575
99576
|
};
|
|
99577
|
+
function expandDirectoryPath(dir) {
|
|
99578
|
+
if (!dir) return dir;
|
|
99579
|
+
if (dir.startsWith("~")) {
|
|
99580
|
+
dir = join(homedir(), dir.slice(1));
|
|
99581
|
+
}
|
|
99582
|
+
dir = dir.replace(/\$\{(\w+)\}/g, (_match, name) => {
|
|
99583
|
+
const val = process.env[name];
|
|
99584
|
+
if (val === void 0) {
|
|
99585
|
+
throw new Error(`\u73AF\u5883\u53D8\u91CF ${name} \u672A\u8BBE\u7F6E\uFF08directory \u5F15\u7528\u4E86 \${${name}}\uFF09`);
|
|
99586
|
+
}
|
|
99587
|
+
return val;
|
|
99588
|
+
});
|
|
99589
|
+
return dir;
|
|
99590
|
+
}
|
|
99576
99591
|
function resolveEnvPlaceholders(obj) {
|
|
99577
99592
|
if (typeof obj === "string") {
|
|
99578
99593
|
if (!obj.includes("${")) return obj;
|