opencode-studio-server 1.9.4 → 1.9.5
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/index.js +45 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1519,6 +1519,51 @@ app.post('/api/auth/profiles/:provider/:name/activate', (req, res) => {
|
|
|
1519
1519
|
res.json({ success: true });
|
|
1520
1520
|
});
|
|
1521
1521
|
|
|
1522
|
+
// IMPORTANT: This route must be BEFORE /:provider/:name to avoid 'all' being captured as :name
|
|
1523
|
+
app.delete('/api/auth/profiles/:provider/all', (req, res) => {
|
|
1524
|
+
const { provider } = req.params;
|
|
1525
|
+
console.log(`[Auth] Deleting ALL profiles for: ${provider}`);
|
|
1526
|
+
const activePlugin = getActiveGooglePlugin();
|
|
1527
|
+
const namespace = provider === 'google'
|
|
1528
|
+
? (activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini')
|
|
1529
|
+
: provider;
|
|
1530
|
+
|
|
1531
|
+
const dir = getProfileDir(provider, activePlugin);
|
|
1532
|
+
|
|
1533
|
+
if (fs.existsSync(dir)) {
|
|
1534
|
+
const files = fs.readdirSync(dir).filter(f => f.endsWith('.json'));
|
|
1535
|
+
files.forEach(f => fs.unlinkSync(path.join(dir, f)));
|
|
1536
|
+
console.log(`[Auth] Deleted ${files.length} profiles from ${dir}`);
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
const studio = loadStudioConfig();
|
|
1540
|
+
if (studio.activeProfiles && studio.activeProfiles[provider]) {
|
|
1541
|
+
delete studio.activeProfiles[provider];
|
|
1542
|
+
saveStudioConfig(studio);
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
const authCfg = loadAuthConfig() || {};
|
|
1546
|
+
if (authCfg[provider]) {
|
|
1547
|
+
delete authCfg[provider];
|
|
1548
|
+
if (provider === 'google') {
|
|
1549
|
+
const key = activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini';
|
|
1550
|
+
delete authCfg.google;
|
|
1551
|
+
delete authCfg[key];
|
|
1552
|
+
}
|
|
1553
|
+
const cp = getConfigPath();
|
|
1554
|
+
const ap = path.join(path.dirname(cp), 'auth.json');
|
|
1555
|
+
atomicWriteFileSync(ap, JSON.stringify(authCfg, null, 2));
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
const metadata = loadPoolMetadata();
|
|
1559
|
+
if (metadata[namespace]) {
|
|
1560
|
+
delete metadata[namespace];
|
|
1561
|
+
savePoolMetadata(metadata);
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
res.json({ success: true });
|
|
1565
|
+
});
|
|
1566
|
+
|
|
1522
1567
|
app.delete('/api/auth/profiles/:provider/:name', (req, res) => {
|
|
1523
1568
|
const { provider, name } = req.params;
|
|
1524
1569
|
console.log(`[Auth] Deleting profile: ${provider}/${name}`);
|