sheetlink 0.1.1 → 0.1.3
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 +4 -8
- package/src/commands/sync.js +2 -2
package/package.json
CHANGED
package/src/commands/auth.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import http from 'http';
|
|
17
17
|
import { randomBytes } from 'crypto';
|
|
18
18
|
import { writeConfig, getApiUrl } from '../config.js';
|
|
19
|
-
import { getTierStatus } from '../api.js';
|
|
19
|
+
import { getTierStatus, listItems } from '../api.js';
|
|
20
20
|
|
|
21
21
|
const GOOGLE_CLIENT_ID = '967710910027-qq2tuel7vsi2i06h4h096hbvok8kfmhk.apps.googleusercontent.com';
|
|
22
22
|
const REDIRECT_PORT = 9876;
|
|
@@ -41,14 +41,10 @@ export async function cmdAuth(options) {
|
|
|
41
41
|
console.log('API key saved to ~/.sheetlink/config.json');
|
|
42
42
|
console.log('');
|
|
43
43
|
|
|
44
|
-
// Verify it works
|
|
44
|
+
// Verify it works by hitting an API-key-aware endpoint
|
|
45
45
|
try {
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
console.error(`Warning: This key belongs to a ${status.subscription_tier} account. MAX tier is required for API key auth.`);
|
|
49
|
-
process.exit(1);
|
|
50
|
-
}
|
|
51
|
-
console.log(`Authenticated as ${status.email} (${status.subscription_tier} tier)`);
|
|
46
|
+
const { items } = await listItems();
|
|
47
|
+
console.log(`Authenticated. ${items.length} bank${items.length !== 1 ? 's' : ''} connected.`);
|
|
52
48
|
} catch (e) {
|
|
53
49
|
console.error(`Could not verify key: ${e.message}`);
|
|
54
50
|
process.exit(1);
|
package/src/commands/sync.js
CHANGED
|
@@ -76,8 +76,8 @@ export async function cmdSync(options) {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
if (output.startsWith('sqlite://')) {
|
|
79
|
-
// sqlite:///absolute/path
|
|
80
|
-
const dbPath = output.replace(/^sqlite
|
|
79
|
+
// sqlite:///absolute/path → /absolute/path, sqlite://relative/path → relative/path
|
|
80
|
+
const dbPath = output.replace(/^sqlite:\/\//, '') || './sheetlink.db';
|
|
81
81
|
writeSQLite(allTransactions, allAccounts, dbPath);
|
|
82
82
|
return;
|
|
83
83
|
}
|