@agenticmail/enterprise 0.5.273 → 0.5.275
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, useState, useEffect, useCallback, Fragment, useApp, engineCall, getOrgId } from '../components/utils.js';
|
|
2
|
-
import { I } from '../components/icons.js';
|
|
2
|
+
import { I } from '../components/icons.js?v=2';
|
|
3
3
|
import { Modal } from '../components/modal.js';
|
|
4
4
|
import { HelpButton } from '../components/help-button.js';
|
|
5
5
|
|
|
@@ -105,8 +105,8 @@ export function DatabaseAccessPage() {
|
|
|
105
105
|
engineCall('/database/connections'),
|
|
106
106
|
engineCall('/agents').catch(function() { return []; }),
|
|
107
107
|
]);
|
|
108
|
-
setConnections(conns
|
|
109
|
-
setAgents(agts
|
|
108
|
+
setConnections(Array.isArray(conns) ? conns : []);
|
|
109
|
+
setAgents(Array.isArray(agts) ? agts : []);
|
|
110
110
|
} catch (e) { console.error('Load failed:', e); }
|
|
111
111
|
setLoading(false);
|
|
112
112
|
}, []);
|
|
@@ -123,13 +123,13 @@ export function DatabaseAccessPage() {
|
|
|
123
123
|
|
|
124
124
|
var deleteConn = useCallback(async function(id) {
|
|
125
125
|
if (!confirm('Delete this database connection? All agent access grants will be removed.')) return;
|
|
126
|
-
await engineCall('/database/connections/' + id, 'DELETE');
|
|
126
|
+
await engineCall('/database/connections/' + id, { method: 'DELETE' });
|
|
127
127
|
loadData();
|
|
128
128
|
}, []);
|
|
129
129
|
|
|
130
130
|
var testConn = useCallback(async function(id) {
|
|
131
131
|
try {
|
|
132
|
-
var result = await engineCall('/database/connections/' + id + '/test', 'POST');
|
|
132
|
+
var result = await engineCall('/database/connections/' + id + '/test', { method: 'POST' });
|
|
133
133
|
alert(result.success ? 'Connection successful! (' + result.latencyMs + 'ms)' : 'Connection failed: ' + (result.error || 'Unknown error'));
|
|
134
134
|
loadData();
|
|
135
135
|
} catch (e) { alert('Test failed: ' + e.message); }
|
|
@@ -140,13 +140,10 @@ export function DatabaseAccessPage() {
|
|
|
140
140
|
h('div', { style: s.title },
|
|
141
141
|
I.database(),
|
|
142
142
|
'Database Access',
|
|
143
|
-
HelpButton
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
h('p', null, 'Credentials are encrypted in the vault. All queries are sanitized, rate-limited, and logged for audit.'),
|
|
148
|
-
),
|
|
149
|
-
}),
|
|
143
|
+
h(HelpButton, { title: 'Database Access' },
|
|
144
|
+
h('p', null, 'Connect your agents to external databases. Each agent can be granted granular permissions (read, write, delete) on specific database connections.'),
|
|
145
|
+
h('p', null, 'Credentials are encrypted in the vault. All queries are sanitized, rate-limited, and logged for audit.'),
|
|
146
|
+
),
|
|
150
147
|
),
|
|
151
148
|
h('button', { style: s.btnPrimary, onClick: function() { setShowAdd(true); } }, '+ Add Connection'),
|
|
152
149
|
),
|
|
@@ -271,7 +268,7 @@ function AgentAccessTab(props) {
|
|
|
271
268
|
),
|
|
272
269
|
h('button', { style: s.btnDanger + '; padding: 3px 8px; font-size: 11px;', onClick: async function() {
|
|
273
270
|
if (!confirm('Revoke ' + (agent.displayName || agent.name) + ' access to ' + (conn.name || 'this database') + '?')) return;
|
|
274
|
-
await engineCall('/database/connections/' + grant.connectionId + '/agents/' + agent.id, 'DELETE');
|
|
271
|
+
await engineCall('/database/connections/' + grant.connectionId + '/agents/' + agent.id, { method: 'DELETE' });
|
|
275
272
|
props.onRefresh();
|
|
276
273
|
}}, 'Revoke'),
|
|
277
274
|
);
|
|
@@ -352,7 +349,7 @@ function AddConnectionModal(props) {
|
|
|
352
349
|
body.password = form.password;
|
|
353
350
|
body.ssl = form.ssl;
|
|
354
351
|
}
|
|
355
|
-
await engineCall('/database/connections', 'POST', body);
|
|
352
|
+
await engineCall('/database/connections', { method: 'POST', body: JSON.stringify(body) });
|
|
356
353
|
props.onSave();
|
|
357
354
|
props.onClose();
|
|
358
355
|
} catch (e) { alert('Failed: ' + e.message); }
|
|
@@ -480,7 +477,7 @@ function GrantAccessModal(props) {
|
|
|
480
477
|
if (blockedTables.trim()) {
|
|
481
478
|
body.schemaAccess = { blockedTables: blockedTables.split(',').map(function(t) { return t.trim(); }).filter(Boolean) };
|
|
482
479
|
}
|
|
483
|
-
await engineCall('/database/connections/' + props.connectionId + '/agents', 'POST', body);
|
|
480
|
+
await engineCall('/database/connections/' + props.connectionId + '/agents', { method: 'POST', body: JSON.stringify(body) });
|
|
484
481
|
props.onSave();
|
|
485
482
|
props.onClose();
|
|
486
483
|
} catch (e) { alert('Failed: ' + e.message); }
|
|
@@ -560,14 +557,14 @@ function EditConnectionModal(props) {
|
|
|
560
557
|
var save = async function() {
|
|
561
558
|
setSaving(true);
|
|
562
559
|
try {
|
|
563
|
-
await engineCall('/database/connections/' + conn.id, 'PUT', {
|
|
560
|
+
await engineCall('/database/connections/' + conn.id, { method: 'PUT', body: JSON.stringify({
|
|
564
561
|
name: form.name,
|
|
565
562
|
host: form.host,
|
|
566
563
|
port: form.port ? parseInt(form.port) : undefined,
|
|
567
564
|
database: form.database,
|
|
568
565
|
description: form.description,
|
|
569
566
|
ssl: form.ssl,
|
|
570
|
-
});
|
|
567
|
+
}) });
|
|
571
568
|
props.onSave();
|
|
572
569
|
props.onClose();
|
|
573
570
|
} catch (e) { alert('Failed: ' + e.message); }
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, useState, useEffect, useCallback, Fragment, useApp, engineCall, getOrgId } from '../components/utils.js';
|
|
2
|
-
import { I } from '../components/icons.js';
|
|
2
|
+
import { I } from '../components/icons.js?v=2';
|
|
3
3
|
import { Modal } from '../components/modal.js';
|
|
4
4
|
import { HelpButton } from '../components/help-button.js';
|
|
5
5
|
|
|
@@ -105,8 +105,8 @@ export function DatabaseAccessPage() {
|
|
|
105
105
|
engineCall('/database/connections'),
|
|
106
106
|
engineCall('/agents').catch(function() { return []; }),
|
|
107
107
|
]);
|
|
108
|
-
setConnections(conns
|
|
109
|
-
setAgents(agts
|
|
108
|
+
setConnections(Array.isArray(conns) ? conns : []);
|
|
109
|
+
setAgents(Array.isArray(agts) ? agts : []);
|
|
110
110
|
} catch (e) { console.error('Load failed:', e); }
|
|
111
111
|
setLoading(false);
|
|
112
112
|
}, []);
|
|
@@ -123,13 +123,13 @@ export function DatabaseAccessPage() {
|
|
|
123
123
|
|
|
124
124
|
var deleteConn = useCallback(async function(id) {
|
|
125
125
|
if (!confirm('Delete this database connection? All agent access grants will be removed.')) return;
|
|
126
|
-
await engineCall('/database/connections/' + id, 'DELETE');
|
|
126
|
+
await engineCall('/database/connections/' + id, { method: 'DELETE' });
|
|
127
127
|
loadData();
|
|
128
128
|
}, []);
|
|
129
129
|
|
|
130
130
|
var testConn = useCallback(async function(id) {
|
|
131
131
|
try {
|
|
132
|
-
var result = await engineCall('/database/connections/' + id + '/test', 'POST');
|
|
132
|
+
var result = await engineCall('/database/connections/' + id + '/test', { method: 'POST' });
|
|
133
133
|
alert(result.success ? 'Connection successful! (' + result.latencyMs + 'ms)' : 'Connection failed: ' + (result.error || 'Unknown error'));
|
|
134
134
|
loadData();
|
|
135
135
|
} catch (e) { alert('Test failed: ' + e.message); }
|
|
@@ -140,13 +140,10 @@ export function DatabaseAccessPage() {
|
|
|
140
140
|
h('div', { style: s.title },
|
|
141
141
|
I.database(),
|
|
142
142
|
'Database Access',
|
|
143
|
-
HelpButton
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
h('p', null, 'Credentials are encrypted in the vault. All queries are sanitized, rate-limited, and logged for audit.'),
|
|
148
|
-
),
|
|
149
|
-
}),
|
|
143
|
+
h(HelpButton, { title: 'Database Access' },
|
|
144
|
+
h('p', null, 'Connect your agents to external databases. Each agent can be granted granular permissions (read, write, delete) on specific database connections.'),
|
|
145
|
+
h('p', null, 'Credentials are encrypted in the vault. All queries are sanitized, rate-limited, and logged for audit.'),
|
|
146
|
+
),
|
|
150
147
|
),
|
|
151
148
|
h('button', { style: s.btnPrimary, onClick: function() { setShowAdd(true); } }, '+ Add Connection'),
|
|
152
149
|
),
|
|
@@ -271,7 +268,7 @@ function AgentAccessTab(props) {
|
|
|
271
268
|
),
|
|
272
269
|
h('button', { style: s.btnDanger + '; padding: 3px 8px; font-size: 11px;', onClick: async function() {
|
|
273
270
|
if (!confirm('Revoke ' + (agent.displayName || agent.name) + ' access to ' + (conn.name || 'this database') + '?')) return;
|
|
274
|
-
await engineCall('/database/connections/' + grant.connectionId + '/agents/' + agent.id, 'DELETE');
|
|
271
|
+
await engineCall('/database/connections/' + grant.connectionId + '/agents/' + agent.id, { method: 'DELETE' });
|
|
275
272
|
props.onRefresh();
|
|
276
273
|
}}, 'Revoke'),
|
|
277
274
|
);
|
|
@@ -352,7 +349,7 @@ function AddConnectionModal(props) {
|
|
|
352
349
|
body.password = form.password;
|
|
353
350
|
body.ssl = form.ssl;
|
|
354
351
|
}
|
|
355
|
-
await engineCall('/database/connections', 'POST', body);
|
|
352
|
+
await engineCall('/database/connections', { method: 'POST', body: JSON.stringify(body) });
|
|
356
353
|
props.onSave();
|
|
357
354
|
props.onClose();
|
|
358
355
|
} catch (e) { alert('Failed: ' + e.message); }
|
|
@@ -480,7 +477,7 @@ function GrantAccessModal(props) {
|
|
|
480
477
|
if (blockedTables.trim()) {
|
|
481
478
|
body.schemaAccess = { blockedTables: blockedTables.split(',').map(function(t) { return t.trim(); }).filter(Boolean) };
|
|
482
479
|
}
|
|
483
|
-
await engineCall('/database/connections/' + props.connectionId + '/agents', 'POST', body);
|
|
480
|
+
await engineCall('/database/connections/' + props.connectionId + '/agents', { method: 'POST', body: JSON.stringify(body) });
|
|
484
481
|
props.onSave();
|
|
485
482
|
props.onClose();
|
|
486
483
|
} catch (e) { alert('Failed: ' + e.message); }
|
|
@@ -560,14 +557,14 @@ function EditConnectionModal(props) {
|
|
|
560
557
|
var save = async function() {
|
|
561
558
|
setSaving(true);
|
|
562
559
|
try {
|
|
563
|
-
await engineCall('/database/connections/' + conn.id, 'PUT', {
|
|
560
|
+
await engineCall('/database/connections/' + conn.id, { method: 'PUT', body: JSON.stringify({
|
|
564
561
|
name: form.name,
|
|
565
562
|
host: form.host,
|
|
566
563
|
port: form.port ? parseInt(form.port) : undefined,
|
|
567
564
|
database: form.database,
|
|
568
565
|
description: form.description,
|
|
569
566
|
ssl: form.ssl,
|
|
570
|
-
});
|
|
567
|
+
}) });
|
|
571
568
|
props.onSave();
|
|
572
569
|
props.onClose();
|
|
573
570
|
} catch (e) { alert('Failed: ' + e.message); }
|