@syengup/friday-channel-next 0.0.5 → 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,17 +174,42 @@ if (bindMode === "lan") {
|
|
|
174
174
|
gatewayUrl = `http://127.0.0.1:${gatewayPort}`;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
const BOLD_YELLOW = (s) => `\x1b[1;33m${s}\x1b[0m`;
|
|
178
|
+
|
|
177
179
|
log("--------------------------------------------------");
|
|
178
180
|
log("Installation complete! Friday Next channel is now active.");
|
|
179
|
-
|
|
181
|
+
log("");
|
|
180
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
|
+
}
|
|
181
209
|
log("");
|
|
182
210
|
log("Gateway URL: " + BOLD_YELLOW(gatewayUrl));
|
|
183
211
|
log("Bearer Token: " + BOLD_YELLOW(gatewayToken));
|
|
184
212
|
log("");
|
|
185
|
-
log(BOLD_YELLOW("Input the URL and Token above into your FridayNext app to connect."));
|
|
186
|
-
log(BOLD_YELLOW("请将上方 URL 和 Token 输入至 FridayNext App 完成连接。"));
|
|
187
|
-
log("");
|
|
188
213
|
log("This is a LOCAL network URL (bind=" + bindMode + ").");
|
|
189
214
|
log("If you need a public URL for remote access, configure it");
|
|
190
215
|
log("via HTTPS, Tailscale, or a reverse proxy yourself.");
|
package/install.sh
CHANGED
|
@@ -132,13 +132,30 @@ 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
|
+
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
|
+
}
|
|
135
155
|
console.log("");
|
|
136
156
|
console.log("Gateway URL: " + YB + "http://" + host + ":" + port + N);
|
|
137
157
|
console.log("Bearer Token: " + YB + token + N);
|
|
138
158
|
console.log("");
|
|
139
|
-
console.log(YB + "Input the URL and Token above into your FridayNext app to connect." + N);
|
|
140
|
-
console.log(YB + "请将上方 URL 和 Token 输入至 FridayNext App 完成连接。" + N);
|
|
141
|
-
console.log("");
|
|
142
159
|
console.log("This is a LOCAL network URL (bind=" + bind + ").");
|
|
143
160
|
console.log("If you need a public URL for remote access, configure it");
|
|
144
161
|
console.log("via HTTPS, Tailscale, or a reverse proxy yourself.");
|
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",
|