feat: enable extension from ui (#2117)

This commit is contained in:
Wendy Tang
2025-04-11 13:06:59 -07:00
committed by GitHub
parent 387432ec86
commit b030f845ce
9 changed files with 254 additions and 13 deletions
+26
View File
@@ -0,0 +1,26 @@
import { getApiUrl, getSecretKey } from '../config';
export async function ConfirmExtensionRequest(requestId: string, confirmed: boolean) {
try {
const response = await fetch(getApiUrl('/confirm'), {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Secret-Key': getSecretKey(),
},
body: JSON.stringify({
id: requestId,
confirmed,
principal_type: 'Extension',
}),
});
if (!response.ok) {
const errorText = await response.text();
console.error('Delete response error: ', errorText);
throw new Error('Failed to confirm extension enablement');
}
} catch (error) {
console.error('Error confirming extension enablement: ', error);
}
}
+1
View File
@@ -11,6 +11,7 @@ export async function ConfirmToolRequest(requesyId: string, action: string) {
body: JSON.stringify({
id: requesyId,
action,
principal_type: 'Tool',
}),
});