open-notepad 1.0.5 → 1.0.6
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/bin/note.js +4 -5
- package/package.json +1 -1
package/bin/note.js
CHANGED
|
@@ -140,13 +140,12 @@ async function apiFetch(config, endpoint, options = {}) {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
// Commands
|
|
143
|
-
async function handleLogin() {
|
|
143
|
+
async function handleLogin(apiUrlArg) {
|
|
144
144
|
clearScreen();
|
|
145
145
|
log(`${colors.bgBlue}${colors.white}${colors.bold} Configure Notepad CLI ${colors.reset}\n`);
|
|
146
146
|
|
|
147
147
|
const current = await loadConfig();
|
|
148
|
-
|
|
149
|
-
const apiUrl = await ask('Enter Server API URL', current.apiUrl);
|
|
148
|
+
const apiUrl = apiUrlArg || current.apiUrl || 'https://notepad.web.id';
|
|
150
149
|
|
|
151
150
|
// Generate a random session code
|
|
152
151
|
const sessionCode = 'cli_' + Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
|
|
@@ -179,7 +178,7 @@ async function handleLogin() {
|
|
|
179
178
|
|
|
180
179
|
// Poll for completion
|
|
181
180
|
info('Waiting for browser authorization...');
|
|
182
|
-
const maxAttempts = 120; // 2 minutes (polling every
|
|
181
|
+
const maxAttempts = 120; // 2 minutes (polling every 1.5s)
|
|
183
182
|
let attempts = 0;
|
|
184
183
|
|
|
185
184
|
while (attempts < maxAttempts) {
|
|
@@ -739,7 +738,7 @@ async function main() {
|
|
|
739
738
|
} else {
|
|
740
739
|
switch (command) {
|
|
741
740
|
case 'login':
|
|
742
|
-
await handleLogin();
|
|
741
|
+
await handleLogin(subArg);
|
|
743
742
|
break;
|
|
744
743
|
case 'list':
|
|
745
744
|
await handleList();
|