@lyxa.ai/core 1.0.308 → 1.0.309

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.
@@ -14,10 +14,10 @@ async function initGlobalConnection(uri, environment) {
14
14
  console.log(`Initializing global connection for environment: ${environment}`);
15
15
  const connection = (0, mongoose_1.createConnection)(uri, {
16
16
  dbName: `lyxa-${environment}-global`,
17
- maxPoolSize: 10,
18
- minPoolSize: 2,
17
+ maxPoolSize: 20,
18
+ minPoolSize: 4,
19
19
  maxIdleTimeMS: 30000,
20
- waitQueueTimeoutMS: 5000,
20
+ waitQueueTimeoutMS: 10000,
21
21
  retryWrites: true,
22
22
  w: 'majority',
23
23
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/mongo/index.ts"],"names":[],"mappings":";;AAUA,oDAiCC;AAKD,sEAEC;AAKD,kDAKC;AA5DD,uCAAwD;AACxD,qCAAkD;AAGlD,IAAI,gBAAwC,CAAC;AAC7C,IAAI,iBAAiB,GAA+B,IAAI,CAAC;AAKlD,KAAK,UAAU,oBAAoB,CAAC,GAAW,EAAE,WAAmB;IAC1E,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACxB,iBAAiB,GAAG,IAAI,OAAO,CAAa,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;YACrE,IAAI,CAAC;gBACJ,OAAO,CAAC,GAAG,CAAC,mDAAmD,WAAW,EAAE,CAAC,CAAC;gBAC9E,MAAM,UAAU,GAAG,IAAA,2BAAgB,EAAC,GAAG,EAAE;oBACxC,MAAM,EAAE,QAAQ,WAAW,SAAS;oBACpC,WAAW,EAAE,EAAE;oBACf,WAAW,EAAE,CAAC;oBACd,aAAa,EAAE,KAAK;oBACpB,kBAAkB,EAAE,IAAI;oBACxB,WAAW,EAAE,IAAI;oBACjB,CAAC,EAAE,UAAU;iBACb,CAAC,CAAC;gBAEH,MAAM,IAAI,OAAO,CAAO,CAAC,cAAc,EAAE,aAAa,EAAE,EAAE;oBACzD,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE;wBACjC,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;wBAC1D,gBAAgB,GAAG,UAAU,CAAC;wBAC9B,cAAc,EAAE,CAAC;oBAClB,CAAC,CAAC,CAAC;oBACH,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;gBACzC,CAAC,CAAC,CAAC;gBAEH,IAAA,+BAAsB,EAAC,gBAAgB,CAAC,CAAC;gBAEzC,OAAO,CAAC,UAAU,CAAC,CAAC;YACrB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,MAAM,CAAC,KAAK,CAAC,CAAC;YACf,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,iBAAiB,CAAC;AAC1B,CAAC;AAKD,SAAgB,6BAA6B;IAC5C,OAAO,CAAC,CAAC,gBAAgB,CAAC;AAC3B,CAAC;AAKD,SAAgB,mBAAmB;IAClC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,gBAAgB,CAAC;AACzB,CAAC","sourcesContent":["import { Connection, createConnection } from 'mongoose';\nimport { initializeGlobalModels } from './models';\n\n// Track connection status\nlet globalConnection: Connection | undefined;\nlet connectionPromise: Promise<Connection> | null = null;\n\n/**\n * Initialize the global database connection and create all global models\n */\nexport async function initGlobalConnection(uri: string, environment: string): Promise<Connection> {\n\tif (!connectionPromise) {\n\t\tconnectionPromise = new Promise<Connection>(async (resolve, reject) => {\n\t\t\ttry {\n\t\t\t\tconsole.log(`Initializing global connection for environment: ${environment}`);\n\t\t\t\tconst connection = createConnection(uri, {\n\t\t\t\t\tdbName: `lyxa-${environment}-global`,\n\t\t\t\t\tmaxPoolSize: 10,\n\t\t\t\t\tminPoolSize: 2,\n\t\t\t\t\tmaxIdleTimeMS: 30000,\n\t\t\t\t\twaitQueueTimeoutMS: 5000,\n\t\t\t\t\tretryWrites: true,\n\t\t\t\t\tw: 'majority',\n\t\t\t\t});\n\n\t\t\t\tawait new Promise<void>((connectResolve, connectReject) => {\n\t\t\t\t\tconnection.once('connected', () => {\n\t\t\t\t\t\tconsole.log('Global connection successfully established');\n\t\t\t\t\t\tglobalConnection = connection;\n\t\t\t\t\t\tconnectResolve();\n\t\t\t\t\t});\n\t\t\t\t\tconnection.once('error', connectReject);\n\t\t\t\t});\n\n\t\t\t\tinitializeGlobalModels(globalConnection);\n\n\t\t\t\tresolve(connection);\n\t\t\t} catch (error) {\n\t\t\t\treject(error);\n\t\t\t}\n\t\t});\n\t}\n\treturn connectionPromise;\n}\n\n/**\n * Check if the global connection is initialized\n */\nexport function isGlobalConnectionInitialized(): boolean {\n\treturn !!globalConnection;\n}\n\n/**\n * Get the global connection (throws if not initialized)\n */\nexport function getGlobalConnection(): Connection {\n\tif (!globalConnection) {\n\t\tthrow new Error('Global connection not initialized. Call initGlobalConnection() first.');\n\t}\n\treturn globalConnection;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/mongo/index.ts"],"names":[],"mappings":";;AAUA,oDAiCC;AAKD,sEAEC;AAKD,kDAKC;AA5DD,uCAAwD;AACxD,qCAAkD;AAGlD,IAAI,gBAAwC,CAAC;AAC7C,IAAI,iBAAiB,GAA+B,IAAI,CAAC;AAKlD,KAAK,UAAU,oBAAoB,CAAC,GAAW,EAAE,WAAmB;IAC1E,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACxB,iBAAiB,GAAG,IAAI,OAAO,CAAa,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;YACrE,IAAI,CAAC;gBACJ,OAAO,CAAC,GAAG,CAAC,mDAAmD,WAAW,EAAE,CAAC,CAAC;gBAC9E,MAAM,UAAU,GAAG,IAAA,2BAAgB,EAAC,GAAG,EAAE;oBACxC,MAAM,EAAE,QAAQ,WAAW,SAAS;oBACpC,WAAW,EAAE,EAAE;oBACf,WAAW,EAAE,CAAC;oBACd,aAAa,EAAE,KAAK;oBACpB,kBAAkB,EAAE,KAAK;oBACzB,WAAW,EAAE,IAAI;oBACjB,CAAC,EAAE,UAAU;iBACb,CAAC,CAAC;gBAEH,MAAM,IAAI,OAAO,CAAO,CAAC,cAAc,EAAE,aAAa,EAAE,EAAE;oBACzD,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE;wBACjC,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;wBAC1D,gBAAgB,GAAG,UAAU,CAAC;wBAC9B,cAAc,EAAE,CAAC;oBAClB,CAAC,CAAC,CAAC;oBACH,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;gBACzC,CAAC,CAAC,CAAC;gBAEH,IAAA,+BAAsB,EAAC,gBAAgB,CAAC,CAAC;gBAEzC,OAAO,CAAC,UAAU,CAAC,CAAC;YACrB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,MAAM,CAAC,KAAK,CAAC,CAAC;YACf,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,iBAAiB,CAAC;AAC1B,CAAC;AAKD,SAAgB,6BAA6B;IAC5C,OAAO,CAAC,CAAC,gBAAgB,CAAC;AAC3B,CAAC;AAKD,SAAgB,mBAAmB;IAClC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,gBAAgB,CAAC;AACzB,CAAC","sourcesContent":["import { Connection, createConnection } from 'mongoose';\nimport { initializeGlobalModels } from './models';\n\n// Track connection status\nlet globalConnection: Connection | undefined;\nlet connectionPromise: Promise<Connection> | null = null;\n\n/**\n * Initialize the global database connection and create all global models\n */\nexport async function initGlobalConnection(uri: string, environment: string): Promise<Connection> {\n\tif (!connectionPromise) {\n\t\tconnectionPromise = new Promise<Connection>(async (resolve, reject) => {\n\t\t\ttry {\n\t\t\t\tconsole.log(`Initializing global connection for environment: ${environment}`);\n\t\t\t\tconst connection = createConnection(uri, {\n\t\t\t\t\tdbName: `lyxa-${environment}-global`,\n\t\t\t\t\tmaxPoolSize: 20,\n\t\t\t\t\tminPoolSize: 4,\n\t\t\t\t\tmaxIdleTimeMS: 30000,\n\t\t\t\t\twaitQueueTimeoutMS: 10000,\n\t\t\t\t\tretryWrites: true,\n\t\t\t\t\tw: 'majority',\n\t\t\t\t});\n\n\t\t\t\tawait new Promise<void>((connectResolve, connectReject) => {\n\t\t\t\t\tconnection.once('connected', () => {\n\t\t\t\t\t\tconsole.log('Global connection successfully established');\n\t\t\t\t\t\tglobalConnection = connection;\n\t\t\t\t\t\tconnectResolve();\n\t\t\t\t\t});\n\t\t\t\t\tconnection.once('error', connectReject);\n\t\t\t\t});\n\n\t\t\t\tinitializeGlobalModels(globalConnection);\n\n\t\t\t\tresolve(connection);\n\t\t\t} catch (error) {\n\t\t\t\treject(error);\n\t\t\t}\n\t\t});\n\t}\n\treturn connectionPromise;\n}\n\n/**\n * Check if the global connection is initialized\n */\nexport function isGlobalConnectionInitialized(): boolean {\n\treturn !!globalConnection;\n}\n\n/**\n * Get the global connection (throws if not initialized)\n */\nexport function getGlobalConnection(): Connection {\n\tif (!globalConnection) {\n\t\tthrow new Error('Global connection not initialized. Call initGlobalConnection() first.');\n\t}\n\treturn globalConnection;\n}\n"]}
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.0.308
25
+ Version: 1.0.309
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.0.308",
3
+ "version": "1.0.309",
4
4
  "description": "Lyxa type definitions and validation schemas for both frontend and backend",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/core",
3
- "version": "1.0.308",
3
+ "version": "1.0.309",
4
4
  "description": "The Core system of the Lyxa services.",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",