@agenticmail/enterprise 0.5.62 ā 0.5.64
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/chunk-37J6FA4B.js +898 -0
- package/dist/chunk-AE3DOUD4.js +2133 -0
- package/dist/chunk-HTAJQYUO.js +898 -0
- package/dist/chunk-T3XU62HZ.js +2127 -0
- package/dist/chunk-WP76IB36.js +48 -0
- package/dist/cli-recover-C72I57LB.js +97 -0
- package/dist/cli-verify-HKS5O6Q2.js +98 -0
- package/dist/cli.js +3 -3
- package/dist/factory-Q67CKNKV.js +9 -0
- package/dist/index.js +3 -3
- package/dist/postgres-QGWJ3CTZ.js +597 -0
- package/dist/server-HOXRMDFV.js +12 -0
- package/dist/server-M3UEVK4U.js +12 -0
- package/dist/setup-DOGWCA3F.js +20 -0
- package/dist/setup-LNSX2NVU.js +20 -0
- package/package.json +1 -1
- package/src/db/postgres.ts +1 -1
- package/src/server.ts +13 -17
package/src/server.ts
CHANGED
|
@@ -13,6 +13,16 @@ import { serve } from '@hono/node-server';
|
|
|
13
13
|
import { readFileSync, existsSync } from 'fs';
|
|
14
14
|
import { fileURLToPath } from 'url';
|
|
15
15
|
import { dirname, join } from 'path';
|
|
16
|
+
import { createRequire } from 'module';
|
|
17
|
+
|
|
18
|
+
// Resolve version at module load time
|
|
19
|
+
let ENTERPRISE_VERSION = 'unknown';
|
|
20
|
+
try {
|
|
21
|
+
const _require = createRequire(import.meta.url);
|
|
22
|
+
ENTERPRISE_VERSION = _require('../package.json').version;
|
|
23
|
+
} catch {
|
|
24
|
+
try { ENTERPRISE_VERSION = JSON.parse(readFileSync(join(process.cwd(), 'node_modules', '@agenticmail', 'enterprise', 'package.json'), 'utf-8')).version; } catch { /* noop */ }
|
|
25
|
+
}
|
|
16
26
|
import type { DatabaseAdapter } from './db/adapter.js';
|
|
17
27
|
import { createDbProxy, type DbProxy } from './db/proxy.js';
|
|
18
28
|
import { createAdminRoutes } from './admin/routes.js';
|
|
@@ -319,22 +329,8 @@ export function createServer(config: ServerConfig): ServerInstance {
|
|
|
319
329
|
|
|
320
330
|
async function serveDashboard(c: any) {
|
|
321
331
|
let html = getDashboardHtml();
|
|
322
|
-
// Inject version
|
|
323
|
-
|
|
324
|
-
for (const rel of ['../package.json', './package.json', '../../package.json']) {
|
|
325
|
-
if (_version) break;
|
|
326
|
-
try {
|
|
327
|
-
const p = join(dirname(fileURLToPath(import.meta.url)), rel);
|
|
328
|
-
_version = JSON.parse(readFileSync(p, 'utf-8')).version;
|
|
329
|
-
} catch { /* try next */ }
|
|
330
|
-
}
|
|
331
|
-
if (!_version) {
|
|
332
|
-
// Fallback: search from cwd
|
|
333
|
-
try { _version = JSON.parse(readFileSync(join(process.cwd(), 'node_modules', '@agenticmail', 'enterprise', 'package.json'), 'utf-8')).version; } catch { /* noop */ }
|
|
334
|
-
}
|
|
335
|
-
if (_version) {
|
|
336
|
-
html = html.replace('</head>', `<script>window.__ENTERPRISE_VERSION__="${_version}";</script></head>`);
|
|
337
|
-
}
|
|
332
|
+
// Inject version
|
|
333
|
+
html = html.replace('</head>', `<script>window.__ENTERPRISE_VERSION__="${ENTERPRISE_VERSION}";</script></head>`);
|
|
338
334
|
|
|
339
335
|
if (!_setupComplete) {
|
|
340
336
|
const injection = `<script>window.__EM_SETUP_STATE__=${JSON.stringify({ needsBootstrap: true })};</script>`;
|
|
@@ -400,7 +396,7 @@ export function createServer(config: ServerConfig): ServerInstance {
|
|
|
400
396
|
const server = serve(
|
|
401
397
|
{ fetch: app.fetch, port: config.port },
|
|
402
398
|
(info) => {
|
|
403
|
-
console.log(`\nš¢ AgenticMail Enterprise`);
|
|
399
|
+
console.log(`\nš¢ AgenticMail Enterprise v${ENTERPRISE_VERSION}`);
|
|
404
400
|
console.log(` API: http://localhost:${info.port}/api`);
|
|
405
401
|
console.log(` Auth: http://localhost:${info.port}/auth`);
|
|
406
402
|
console.log(` Health: http://localhost:${info.port}/health`);
|