@syengup/friday-channel-next 0.0.6 → 0.0.7
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/install.js +29 -4
- package/install.sh +20 -3
- package/package.json +4 -1
package/install.js
CHANGED
|
@@ -174,13 +174,38 @@ if (bindMode === "lan") {
|
|
|
174
174
|
gatewayUrl = `http://127.0.0.1:${gatewayPort}`;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
log("--------------------------------------------------");
|
|
178
|
-
log("Installation complete! Friday Next channel is now active.");
|
|
179
177
|
const BOLD_YELLOW = (s) => `\x1b[1;33m${s}\x1b[0m`;
|
|
180
178
|
|
|
179
|
+
log("--------------------------------------------------");
|
|
180
|
+
log("Installation complete! Friday Next channel is now active.");
|
|
181
181
|
log("");
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
|
|
183
|
+
// --------------- QR code ---------------
|
|
184
|
+
|
|
185
|
+
const qrPayload = JSON.stringify({ url: gatewayUrl, token: gatewayToken });
|
|
186
|
+
let qrShown = false;
|
|
187
|
+
|
|
188
|
+
try {
|
|
189
|
+
const { createRequire } = await import("node:module");
|
|
190
|
+
const qrcode = createRequire(import.meta.url)("qrcode-terminal");
|
|
191
|
+
log(BOLD_YELLOW("Scan below to auto-fill URL & Token in FridayNext app:"));
|
|
192
|
+
log(BOLD_YELLOW("扫描下方二维码自动填入 URL 和 Token:"));
|
|
193
|
+
log("");
|
|
194
|
+
qrcode.generate(qrPayload, { small: true });
|
|
195
|
+
log("");
|
|
196
|
+
log("If QR scan doesn't work, enter manually:");
|
|
197
|
+
log("若二维码无法使用,请手动输入:");
|
|
198
|
+
qrShown = true;
|
|
199
|
+
} catch {
|
|
200
|
+
// qrcode-terminal not available, fall through to manual-only
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// --------------- manual input ---------------
|
|
204
|
+
|
|
205
|
+
if (!qrShown) {
|
|
206
|
+
log(BOLD_YELLOW("Input the URL and Token below into your FridayNext app to connect."));
|
|
207
|
+
log(BOLD_YELLOW("请将下方 URL 和 Token 输入至 FridayNext App 完成连接。"));
|
|
208
|
+
}
|
|
184
209
|
log("");
|
|
185
210
|
log("Gateway URL: " + BOLD_YELLOW(gatewayUrl));
|
|
186
211
|
log("Bearer Token: " + BOLD_YELLOW(gatewayToken));
|
package/install.sh
CHANGED
|
@@ -132,9 +132,26 @@ const bind = config.gateway?.bind || "localhost";
|
|
|
132
132
|
const host = bind === "lan" ? getLanIp() : "127.0.0.1";
|
|
133
133
|
|
|
134
134
|
const YB = '\x1b[1;33m', N = '\x1b[0m';
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
const qrPayload = JSON.stringify({ url: "http://" + host + ":" + port, token: token });
|
|
136
|
+
let qrShown = false;
|
|
137
|
+
try {
|
|
138
|
+
const { createRequire } = await import("node:module");
|
|
139
|
+
const qrcode = createRequire(import.meta.url)("qrcode-terminal");
|
|
140
|
+
console.log("");
|
|
141
|
+
console.log(YB + "Scan below to auto-fill URL & Token in FridayNext app:" + N);
|
|
142
|
+
console.log(YB + "扫描下方二维码自动填入 URL 和 Token:" + N);
|
|
143
|
+
console.log("");
|
|
144
|
+
qrcode.generate(qrPayload, { small: true });
|
|
145
|
+
console.log("");
|
|
146
|
+
console.log("If QR scan doesn't work, enter manually:");
|
|
147
|
+
console.log("若二维码无法使用,请手动输入:");
|
|
148
|
+
qrShown = true;
|
|
149
|
+
} catch {}
|
|
150
|
+
if (!qrShown) {
|
|
151
|
+
console.log("");
|
|
152
|
+
console.log(YB + "Input the URL and Token below into your FridayNext app to connect." + N);
|
|
153
|
+
console.log(YB + "请将下方 URL 和 Token 输入至 FridayNext App 完成连接。" + N);
|
|
154
|
+
}
|
|
138
155
|
console.log("");
|
|
139
156
|
console.log("Gateway URL: " + YB + "http://" + host + ":" + port + N);
|
|
140
157
|
console.log("Bearer Token: " + YB + token + N);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syengup/friday-channel-next",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "OpenClaw Friday Next Apple channel plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -53,6 +53,9 @@
|
|
|
53
53
|
"stageRuntimeDependencies": true
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"qrcode-terminal": "^0.12.0"
|
|
58
|
+
},
|
|
56
59
|
"devDependencies": {
|
|
57
60
|
"@types/node": "^25.6.0",
|
|
58
61
|
"chalk": "^5.6.2",
|