@agenticmail/api 0.5.62 → 0.6.1
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/dist/index.js +34 -0
- package/package.json +6 -3
package/dist/index.js
CHANGED
|
@@ -4511,6 +4511,35 @@ function createStorageRoutes(rawDb, accountManager, config, dialect = "sqlite")
|
|
|
4511
4511
|
}
|
|
4512
4512
|
|
|
4513
4513
|
// src/app.ts
|
|
4514
|
+
var integrationRouteFactoryPromise = (async () => {
|
|
4515
|
+
try {
|
|
4516
|
+
const mod = await import("@agenticmail/claudecode/http-routes");
|
|
4517
|
+
if (typeof mod.createIntegrationRoutes === "function") {
|
|
4518
|
+
return mod.createIntegrationRoutes;
|
|
4519
|
+
}
|
|
4520
|
+
return null;
|
|
4521
|
+
} catch {
|
|
4522
|
+
return null;
|
|
4523
|
+
}
|
|
4524
|
+
})();
|
|
4525
|
+
async function prepareIntegrations() {
|
|
4526
|
+
await integrationRouteFactoryPromise;
|
|
4527
|
+
}
|
|
4528
|
+
var __cachedIntegrationFactory = null;
|
|
4529
|
+
var __integrationFactorySettled = false;
|
|
4530
|
+
integrationRouteFactoryPromise.then(
|
|
4531
|
+
(factory) => {
|
|
4532
|
+
__cachedIntegrationFactory = factory;
|
|
4533
|
+
__integrationFactorySettled = true;
|
|
4534
|
+
},
|
|
4535
|
+
() => {
|
|
4536
|
+
__integrationFactorySettled = true;
|
|
4537
|
+
}
|
|
4538
|
+
);
|
|
4539
|
+
function readResolvedFactory(_p) {
|
|
4540
|
+
if (!__integrationFactorySettled) return null;
|
|
4541
|
+
return __cachedIntegrationFactory;
|
|
4542
|
+
}
|
|
4514
4543
|
function createApp(configOverrides) {
|
|
4515
4544
|
const config = resolveConfig(configOverrides);
|
|
4516
4545
|
const db = getDatabase(config);
|
|
@@ -4552,6 +4581,10 @@ function createApp(configOverrides) {
|
|
|
4552
4581
|
);
|
|
4553
4582
|
app2.use("/api/agenticmail", createHealthRoutes(stalwart));
|
|
4554
4583
|
app2.use("/api/agenticmail", createInboundRoutes(accountManager, config, gatewayManager));
|
|
4584
|
+
const integrationFactory = readResolvedFactory(integrationRouteFactoryPromise);
|
|
4585
|
+
if (integrationFactory) {
|
|
4586
|
+
app2.use("/api/agenticmail", integrationFactory());
|
|
4587
|
+
}
|
|
4555
4588
|
app2.use("/api/agenticmail", createAuthMiddleware(config.masterKey, accountManager, db));
|
|
4556
4589
|
app2.use("/api/agenticmail", createAccountRoutes(accountManager, db, config));
|
|
4557
4590
|
app2.use("/api/agenticmail", createMailRoutes(accountManager, config, db, gatewayManager));
|
|
@@ -4574,6 +4607,7 @@ function createApp(configOverrides) {
|
|
|
4574
4607
|
import { readFileSync as readFileSync2 } from "fs";
|
|
4575
4608
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
4576
4609
|
import { dirname as dirname2, join as join2 } from "path";
|
|
4610
|
+
await prepareIntegrations();
|
|
4577
4611
|
function getLocalIp() {
|
|
4578
4612
|
const nets = networkInterfaces();
|
|
4579
4613
|
for (const iface of Object.values(nets)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticmail/api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
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",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"LICENSE"
|
|
20
20
|
],
|
|
21
21
|
"scripts": {
|
|
22
|
-
"build": "tsup src/index.ts --format esm --dts --clean",
|
|
22
|
+
"build": "tsup src/index.ts --format esm --dts --clean --external @agenticmail/claudecode",
|
|
23
23
|
"dev": "tsx watch src/index.ts",
|
|
24
24
|
"start": "node dist/index.js",
|
|
25
25
|
"test": "vitest run --passWithNoTests",
|
|
@@ -27,13 +27,16 @@
|
|
|
27
27
|
"prepublishOnly": "npm run build"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@agenticmail/core": "^0.
|
|
30
|
+
"@agenticmail/core": "^0.6.0",
|
|
31
31
|
"cors": "^2.8.5",
|
|
32
32
|
"dotenv": "^16.4.7",
|
|
33
33
|
"express": "^4.21.0",
|
|
34
34
|
"express-rate-limit": "^7.5.0",
|
|
35
35
|
"uuid": "^11.1.0"
|
|
36
36
|
},
|
|
37
|
+
"optionalDependencies": {
|
|
38
|
+
"@agenticmail/claudecode": "^0.1.0"
|
|
39
|
+
},
|
|
37
40
|
"devDependencies": {
|
|
38
41
|
"@types/cors": "^2.8.17",
|
|
39
42
|
"@types/express": "^5.0.0",
|