@agenticmail/api 0.9.13 → 0.9.14

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.
Files changed (2) hide show
  1. package/dist/index.js +17 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -540,6 +540,23 @@ function createAccountRoutes(accountManager, db, config) {
540
540
  next(err);
541
541
  }
542
542
  });
543
+ router.patch("/accounts/:id/role", requireMaster, async (req, res, next) => {
544
+ try {
545
+ const role = req.body?.role;
546
+ if (typeof role !== "string" || !AGENT_ROLES.includes(role)) {
547
+ res.status(400).json({ error: `Invalid role. Must be one of: ${AGENT_ROLES.join(", ")}` });
548
+ return;
549
+ }
550
+ const updated = await accountManager.updateRole(req.params.id, role);
551
+ if (!updated) {
552
+ res.status(404).json({ error: "Agent not found" });
553
+ return;
554
+ }
555
+ res.json(sanitizeAgent(updated));
556
+ } catch (err) {
557
+ next(err);
558
+ }
559
+ });
543
560
  router.delete("/accounts/:id", requireMaster, async (req, res, next) => {
544
561
  try {
545
562
  const allAgents = await accountManager.list();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/api",
3
- "version": "0.9.13",
3
+ "version": "0.9.14",
4
4
  "description": "REST API server for AgenticMail — email and SMS endpoints for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "prepublishOnly": "npm run build"
29
29
  },
30
30
  "dependencies": {
31
- "@agenticmail/core": "^0.9.2",
31
+ "@agenticmail/core": "^0.9.3",
32
32
  "cors": "^2.8.5",
33
33
  "dotenv": "^16.4.7",
34
34
  "express": "^4.21.0",