sheetlink 0.1.11 → 0.1.13
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/package.json +1 -1
- package/src/commands/auth.js +2 -1
- package/src/commands/sync.js +10 -3
package/package.json
CHANGED
package/src/commands/auth.js
CHANGED
|
@@ -120,7 +120,8 @@ async function googleOAuthFlow() {
|
|
|
120
120
|
});
|
|
121
121
|
|
|
122
122
|
server.on('error', reject);
|
|
123
|
-
setTimeout(() => { server.closeAllConnections?.(); server.close(); reject(new Error('OAuth timeout (2 minutes)')); }, 120_000);
|
|
123
|
+
const timeout = setTimeout(() => { server.closeAllConnections?.(); server.close(); reject(new Error('OAuth timeout (2 minutes)')); }, 120_000);
|
|
124
|
+
server.on('close', () => clearTimeout(timeout));
|
|
124
125
|
});
|
|
125
126
|
}
|
|
126
127
|
|
package/src/commands/sync.js
CHANGED
|
@@ -39,16 +39,23 @@ export async function cmdSync(options) {
|
|
|
39
39
|
const allAccounts = [];
|
|
40
40
|
const results = [];
|
|
41
41
|
|
|
42
|
+
const spinnerFrames = ['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'];
|
|
43
|
+
|
|
42
44
|
for (const id of itemIds) {
|
|
43
|
-
|
|
45
|
+
let i = 0;
|
|
46
|
+
const spinner = setInterval(() => {
|
|
47
|
+
process.stderr.write(`\r${spinnerFrames[i++ % spinnerFrames.length]} Syncing ${id}...`);
|
|
48
|
+
}, 80);
|
|
44
49
|
try {
|
|
45
50
|
const result = await syncItem(id);
|
|
46
51
|
allTransactions.push(...(result.transactions || []));
|
|
47
52
|
allAccounts.push(...(result.accounts || []));
|
|
48
53
|
results.push({ item_id: id, ...result });
|
|
49
|
-
|
|
54
|
+
clearInterval(spinner);
|
|
55
|
+
process.stderr.write(`\r✓ Synced ${id} — ${result.transactions?.length ?? 0} transactions\n`);
|
|
50
56
|
} catch (e) {
|
|
51
|
-
|
|
57
|
+
clearInterval(spinner);
|
|
58
|
+
process.stderr.write(`\r✗ ${id} — ${e.message}\n`);
|
|
52
59
|
}
|
|
53
60
|
}
|
|
54
61
|
|