opencode-feishu 1.0.0 → 1.0.2
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 +26 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -112535,15 +112535,35 @@ var CardKitClient = class {
|
|
|
112535
112535
|
* 创建 CardKit 2.0 卡片 → cardId
|
|
112536
112536
|
*/
|
|
112537
112537
|
async createCard(schema) {
|
|
112538
|
-
|
|
112539
|
-
|
|
112540
|
-
|
|
112541
|
-
data:
|
|
112538
|
+
let res;
|
|
112539
|
+
try {
|
|
112540
|
+
res = await this.larkClient.cardkit.v1.card.create({
|
|
112541
|
+
data: {
|
|
112542
|
+
type: "card_json",
|
|
112543
|
+
data: JSON.stringify(schema.data)
|
|
112544
|
+
}
|
|
112545
|
+
});
|
|
112546
|
+
} catch (err) {
|
|
112547
|
+
let detail = "no response body";
|
|
112548
|
+
if (err && typeof err === "object" && "response" in err) {
|
|
112549
|
+
const axiosData = err.response?.data;
|
|
112550
|
+
if (axiosData) {
|
|
112551
|
+
try {
|
|
112552
|
+
detail = JSON.stringify(axiosData);
|
|
112553
|
+
} catch {
|
|
112554
|
+
detail = String(axiosData);
|
|
112555
|
+
}
|
|
112556
|
+
}
|
|
112542
112557
|
}
|
|
112543
|
-
|
|
112558
|
+
throw new Error(
|
|
112559
|
+
`CardKit createCard HTTP \u9519\u8BEF: ${err instanceof Error ? err.message : String(err)} | detail: ${detail}`
|
|
112560
|
+
);
|
|
112561
|
+
}
|
|
112544
112562
|
const cardId = res?.data?.card_id;
|
|
112545
112563
|
if (!cardId) {
|
|
112546
|
-
throw new Error(
|
|
112564
|
+
throw new Error(
|
|
112565
|
+
`CardKit createCard \u5931\u8D25: ${res?.msg ?? "unknown"} (code: ${res?.code})`
|
|
112566
|
+
);
|
|
112547
112567
|
}
|
|
112548
112568
|
return cardId;
|
|
112549
112569
|
}
|
|
@@ -113632,7 +113652,6 @@ var StreamingCard = class {
|
|
|
113632
113652
|
*/
|
|
113633
113653
|
async start() {
|
|
113634
113654
|
const schema = {
|
|
113635
|
-
type: "card_kit",
|
|
113636
113655
|
data: {
|
|
113637
113656
|
schema: "2.0",
|
|
113638
113657
|
config: { streaming_mode: true, summary: { content: "\u6B63\u5728\u601D\u8003..." } },
|