@wu529778790/open-im 1.11.8-beta.17 → 1.11.8-beta.19
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/config-web.js
CHANGED
|
@@ -375,6 +375,33 @@ export async function startWebConfigServer(options) {
|
|
|
375
375
|
}
|
|
376
376
|
return;
|
|
377
377
|
}
|
|
378
|
+
if (request.method === "POST" && requestUrl.pathname === "/api/workbuddy/qr-login/start") {
|
|
379
|
+
try {
|
|
380
|
+
const { WorkBuddyOAuth } = await import("./workbuddy/oauth.js");
|
|
381
|
+
const QRCode = (await import("qrcode")).default;
|
|
382
|
+
const oauth = new WorkBuddyOAuth();
|
|
383
|
+
const { authUrl, state } = await oauth.fetchAuthState();
|
|
384
|
+
const qrcodeImage = await QRCode.toDataURL(authUrl, { width: 280, margin: 1 });
|
|
385
|
+
json(response, 200, { success: true, qrcodeImage, state, authUrl }, request);
|
|
386
|
+
}
|
|
387
|
+
catch (error) {
|
|
388
|
+
json(response, 500, { success: false, error: toErrorMessage(error) }, request);
|
|
389
|
+
}
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
if (request.method === "POST" && requestUrl.pathname === "/api/workbuddy/qr-login/wait") {
|
|
393
|
+
try {
|
|
394
|
+
const body = await readJson(request);
|
|
395
|
+
const { WorkBuddyOAuth } = await import("./workbuddy/oauth.js");
|
|
396
|
+
const oauth = new WorkBuddyOAuth();
|
|
397
|
+
const result = await oauth.pollToken(body.state);
|
|
398
|
+
json(response, 200, { success: true, accessToken: result.accessToken, refreshToken: result.refreshToken, userId: result.userId }, request);
|
|
399
|
+
}
|
|
400
|
+
catch (error) {
|
|
401
|
+
json(response, 500, { success: false, error: toErrorMessage(error) }, request);
|
|
402
|
+
}
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
378
405
|
if (request.method === "GET" && tryServeDashboardStatic(requestUrl, request, response, mergeCors)) {
|
|
379
406
|
return;
|
|
380
407
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wu529778790/open-im",
|
|
3
|
-
"version": "1.11.8-beta.
|
|
3
|
+
"version": "1.11.8-beta.19",
|
|
4
4
|
"description": "Your AI coding assistant, in every chat app. Multi-platform IM bridge for Claude Code, Codex, and CodeBuddy.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|