@agenticmail/enterprise 0.5.44 → 0.5.46

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/cli.js CHANGED
@@ -48,7 +48,7 @@ Skill Development:
48
48
  break;
49
49
  case "setup":
50
50
  default:
51
- import("./setup-JEL5PU2J.js").then((m) => m.runSetupWizard()).catch(fatal);
51
+ import("./setup-N3RQCS32.js").then((m) => m.runSetupWizard()).catch(fatal);
52
52
  break;
53
53
  }
54
54
  function fatal(err) {
@@ -0,0 +1,7 @@
1
+ import {
2
+ EngineDatabase
3
+ } from "./chunk-5DDNXWPN.js";
4
+ import "./chunk-KFQGP6VL.js";
5
+ export {
6
+ EngineDatabase
7
+ };
@@ -0,0 +1,7 @@
1
+ import {
2
+ EngineDatabase
3
+ } from "./chunk-XTGZRTVI.js";
4
+ import "./chunk-KFQGP6VL.js";
5
+ export {
6
+ EngineDatabase
7
+ };
package/dist/index.js CHANGED
@@ -50,11 +50,11 @@ import {
50
50
  requireRole,
51
51
  securityHeaders,
52
52
  validate
53
- } from "./chunk-C4ARCNXV.js";
53
+ } from "./chunk-VOMXULTW.js";
54
54
  import {
55
55
  provision,
56
56
  runSetupWizard
57
- } from "./chunk-CXJEZOXV.js";
57
+ } from "./chunk-HKBAC2CE.js";
58
58
  import {
59
59
  ENGINE_TABLES,
60
60
  ENGINE_TABLES_POSTGRES,
@@ -64,7 +64,7 @@ import {
64
64
  MIGRATIONS_TABLE_POSTGRES,
65
65
  sqliteToMySQL,
66
66
  sqliteToPostgres
67
- } from "./chunk-C7BLCH6R.js";
67
+ } from "./chunk-5DDNXWPN.js";
68
68
  import {
69
69
  deployToCloud,
70
70
  generateDockerCompose,
@@ -0,0 +1,12 @@
1
+ import {
2
+ createServer
3
+ } from "./chunk-AOASAMLE.js";
4
+ import "./chunk-3SMTCIR4.js";
5
+ import "./chunk-JLSQOQ5L.js";
6
+ import "./chunk-RO537U6H.js";
7
+ import "./chunk-DRXMYYKN.js";
8
+ import "./chunk-67KZYSLU.js";
9
+ import "./chunk-KFQGP6VL.js";
10
+ export {
11
+ createServer
12
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ createServer
3
+ } from "./chunk-VOMXULTW.js";
4
+ import "./chunk-3SMTCIR4.js";
5
+ import "./chunk-JLSQOQ5L.js";
6
+ import "./chunk-RO537U6H.js";
7
+ import "./chunk-DRXMYYKN.js";
8
+ import "./chunk-67KZYSLU.js";
9
+ import "./chunk-KFQGP6VL.js";
10
+ export {
11
+ createServer
12
+ };
@@ -0,0 +1,20 @@
1
+ import {
2
+ promptCompanyInfo,
3
+ promptDatabase,
4
+ promptDeployment,
5
+ promptDomain,
6
+ promptRegistration,
7
+ provision,
8
+ runSetupWizard
9
+ } from "./chunk-HKBAC2CE.js";
10
+ import "./chunk-M4PRT53C.js";
11
+ import "./chunk-KFQGP6VL.js";
12
+ export {
13
+ promptCompanyInfo,
14
+ promptDatabase,
15
+ promptDeployment,
16
+ promptDomain,
17
+ promptRegistration,
18
+ provision,
19
+ runSetupWizard
20
+ };
@@ -0,0 +1,20 @@
1
+ import {
2
+ promptCompanyInfo,
3
+ promptDatabase,
4
+ promptDeployment,
5
+ promptDomain,
6
+ promptRegistration,
7
+ provision,
8
+ runSetupWizard
9
+ } from "./chunk-M3WTJ5YO.js";
10
+ import "./chunk-M4PRT53C.js";
11
+ import "./chunk-KFQGP6VL.js";
12
+ export {
13
+ promptCompanyInfo,
14
+ promptDatabase,
15
+ promptDeployment,
16
+ promptDomain,
17
+ promptRegistration,
18
+ provision,
19
+ runSetupWizard
20
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/enterprise",
3
- "version": "0.5.44",
3
+ "version": "0.5.46",
4
4
  "description": "AgenticMail Enterprise — cloud-hosted AI agent identity, email, auth & compliance for organizations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -104,6 +104,25 @@ export class EngineDatabase {
104
104
  count++;
105
105
  }
106
106
 
107
+ // Post-migration: fix version columns that were incorrectly created as BOOLEAN on Postgres
108
+ if (this.dialect === 'postgres') {
109
+ try {
110
+ const boolVersionCols = await this.db.all<any>(
111
+ `SELECT table_name FROM information_schema.columns WHERE column_name = 'version' AND data_type = 'boolean' AND table_schema = 'public'`
112
+ );
113
+ for (const row of boolVersionCols) {
114
+ try {
115
+ await this.db.run(`ALTER TABLE ${row.table_name} ALTER COLUMN version DROP DEFAULT`);
116
+ await this.db.run(`ALTER TABLE ${row.table_name} ALTER COLUMN version TYPE INTEGER USING CASE WHEN version THEN 1 ELSE 0 END`);
117
+ await this.db.run(`ALTER TABLE ${row.table_name} ALTER COLUMN version SET DEFAULT 1`);
118
+ console.log(`[engine] Fixed version column type on ${row.table_name}: BOOLEAN → INTEGER`);
119
+ } catch (e: any) {
120
+ console.error(`[engine] Failed to fix version column on ${row.table_name}:`, e.message);
121
+ }
122
+ }
123
+ } catch { /* ignore */ }
124
+ }
125
+
107
126
  return { applied: count, total: MIGRATIONS.length };
108
127
  }
109
128
 
@@ -1233,6 +1233,14 @@ CREATE INDEX idx_agent_followups_agent ON agent_followups(agent_id);
1233
1233
  mysql: `ALTER TABLE company_settings ADD COLUMN model_pricing_config TEXT DEFAULT '{}';`,
1234
1234
  nosql: async () => {},
1235
1235
  },
1236
+ {
1237
+ version: 17,
1238
+ name: 'fix_version_column_type',
1239
+ sql: `SELECT 1;`, // SQLite already uses INTEGER, no fix needed
1240
+ postgres: `SELECT 1`,
1241
+ mysql: `SELECT 1;`,
1242
+ nosql: async () => {},
1243
+ },
1236
1244
  ];
1237
1245
 
1238
1246
  // ─── Dynamic Table Definitions ─────────────────────────
@@ -1266,8 +1274,10 @@ export function sqliteToPostgres(sql: string): string {
1266
1274
  .replace(/\bBLOB\b/g, 'BYTEA')
1267
1275
  .replace(/JSON/g, 'JSONB')
1268
1276
  .replace(/datetime\('now'\)/g, "NOW()")
1269
- .replace(/INTEGER NOT NULL DEFAULT 1(?!\d)/g, 'BOOLEAN NOT NULL DEFAULT TRUE')
1270
- .replace(/INTEGER NOT NULL DEFAULT 0(?!\d)/g, 'INTEGER NOT NULL DEFAULT 0');
1277
+ // Only convert INTEGER→BOOLEAN for known boolean column names (enabled, revoked, enforce_*, auto_*, is_*, active)
1278
+ // NOT for version, count, or other numeric columns that happen to default to 1
1279
+ .replace(/((?:enabled|revoked|enforce_\w+|auto_\w+|is_\w+|active)\s+)INTEGER NOT NULL DEFAULT 1(?!\d)/g, '$1BOOLEAN NOT NULL DEFAULT TRUE')
1280
+ .replace(/((?:enabled|revoked|enforce_\w+|auto_\w+|is_\w+|active)\s+)INTEGER NOT NULL DEFAULT 0(?!\d)/g, '$1BOOLEAN NOT NULL DEFAULT FALSE');
1271
1281
  }
1272
1282
 
1273
1283
  /**