summaryrefslogtreecommitdiffhomepage
path: root/packages/function/src
diff options
context:
space:
mode:
authorShoubhit Dash <[email protected]>2026-04-16 17:30:14 +0530
committerShoubhit Dash <[email protected]>2026-04-16 17:30:14 +0530
commit2e18a603f0ea24154908e748493fd4bfaa74fc00 (patch)
treeb723e00af2821b213573b16fa199b64babd5f1f5 /packages/function/src
parent9819eb04614fd607cacb07d754052f1531a82331 (diff)
parent7341718f9234b0cf3a8758c87e91d2006b71bff6 (diff)
downloadopencode-2e18a603f0ea24154908e748493fd4bfaa74fc00.tar.gz
opencode-2e18a603f0ea24154908e748493fd4bfaa74fc00.zip
merge dev
Diffstat (limited to 'packages/function/src')
-rw-r--r--packages/function/src/api.ts21
1 files changed, 4 insertions, 17 deletions
diff --git a/packages/function/src/api.ts b/packages/function/src/api.ts
index 54b93ad71..58c74fe32 100644
--- a/packages/function/src/api.ts
+++ b/packages/function/src/api.ts
@@ -12,21 +12,8 @@ type Env = {
WEB_DOMAIN: string
}
-async function getFeishuTenantToken(): Promise<string> {
- const response = await fetch("https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal", {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({
- app_id: Resource.FEISHU_APP_ID.value,
- app_secret: Resource.FEISHU_APP_SECRET.value,
- }),
- })
- const data = (await response.json()) as { tenant_access_token?: string }
- if (!data.tenant_access_token) throw new Error("Failed to get Feishu tenant token")
- return data.tenant_access_token
-}
-
export class SyncServer extends DurableObject<Env> {
+ // oxlint-disable-next-line no-useless-constructor
constructor(ctx: DurableObjectState, env: Env) {
super(ctx, env)
}
@@ -49,9 +36,9 @@ export class SyncServer extends DurableObject<Env> {
})
}
- async webSocketMessage(ws, message) {}
+ async webSocketMessage(_ws, _message) {}
- async webSocketClose(ws, code, reason, wasClean) {
+ async webSocketClose(ws, code, _reason, _wasClean) {
ws.close(code, "Durable Object is closing WebSocket")
}
@@ -195,7 +182,7 @@ export default new Hono<{ Bindings: Env }>()
let info
const messages: Record<string, any> = {}
data.forEach((d) => {
- const [root, type, ...splits] = d.key.split("/")
+ const [root, type] = d.key.split("/")
if (root !== "session") return
if (type === "info") {
info = d.content