@nextclaw/channel-plugin-feishu 0.2.16 → 0.2.18
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/index.ts +10 -0
- package/package.json +1 -1
- package/src/app-scope-checker.ts +75 -0
- package/src/auth-errors.ts +90 -0
- package/src/calendar-calendar.ts +72 -0
- package/src/calendar-event-attendee.ts +96 -0
- package/src/calendar-event.ts +236 -0
- package/src/calendar-freebusy.ts +58 -0
- package/src/calendar-shared.ts +33 -0
- package/src/calendar.ts +18 -0
- package/src/card-action.ts +19 -7
- package/src/config-schema.ts +5 -0
- package/src/device-flow.ts +188 -0
- package/src/domains.ts +19 -0
- package/src/feishu-fetch.ts +9 -0
- package/src/identity.ts +160 -0
- package/src/lark-ticket.ts +26 -0
- package/src/monitor.account.ts +48 -20
- package/src/oauth.ts +248 -0
- package/src/raw-request.ts +45 -0
- package/src/sheets.ts +431 -0
- package/src/task-comment.ts +95 -0
- package/src/task-shared.ts +10 -0
- package/src/task-subtask.ts +94 -0
- package/src/task-task.ts +172 -0
- package/src/task-tasklist.ts +174 -0
- package/src/task.ts +18 -0
- package/src/token-store.ts +211 -0
- package/src/tool-account-routing.test.ts +19 -0
- package/src/tool-account.ts +16 -0
- package/src/tool-scopes.ts +102 -0
- package/src/tools-config.test.ts +19 -0
- package/src/tools-config.ts +5 -0
- package/src/types.ts +5 -0
- package/src/uat-client.ts +159 -0
- package/src/user-tool-client.ts +224 -0
- package/src/user-tool-helpers.ts +157 -0
- package/src/user-tool-result.ts +22 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function formatLarkError(error: unknown): string {
|
|
2
|
+
if (!error || typeof error !== "object") {
|
|
3
|
+
return String(error);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const typed = error as {
|
|
7
|
+
code?: number;
|
|
8
|
+
msg?: string;
|
|
9
|
+
message?: string;
|
|
10
|
+
response?: { data?: { code?: number; msg?: string } };
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
if (typeof typed.code === "number" && typed.msg) {
|
|
14
|
+
return typed.msg;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (typed.response?.data?.msg) {
|
|
18
|
+
return typed.response.data.msg;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return typed.message ?? String(error);
|
|
22
|
+
}
|