@okf/ootils 1.6.7 → 1.6.9
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/node.d.mts +2 -24
- package/dist/node.d.ts +2 -24
- package/dist/node.js +5 -32
- package/dist/node.mjs +4 -29
- package/package.json +1 -1
package/dist/node.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Client } from '@elastic/elasticsearch';
|
|
2
2
|
import Redis from 'ioredis';
|
|
3
|
-
import mongoose, {
|
|
3
|
+
import mongoose, { Document, Types } from 'mongoose';
|
|
4
4
|
import * as bullmq from 'bullmq';
|
|
5
5
|
import { Queue } from 'bullmq/dist/esm/classes/queue';
|
|
6
6
|
import { Worker } from 'bullmq/dist/esm/classes/worker';
|
|
@@ -329,28 +329,6 @@ declare function getDbByTenant({ tenant, env: _env }: {
|
|
|
329
329
|
env: any;
|
|
330
330
|
}): any;
|
|
331
331
|
|
|
332
|
-
interface GlobalConfigType {
|
|
333
|
-
env?: string;
|
|
334
|
-
dbConfigs?: {
|
|
335
|
-
[env: string]: {
|
|
336
|
-
CLUSTER_NAME: string;
|
|
337
|
-
DB_URI: string;
|
|
338
|
-
connectTo?: string[];
|
|
339
|
-
};
|
|
340
|
-
};
|
|
341
|
-
mongodb?: {
|
|
342
|
-
[clusterName: string]: Connection;
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* Initialize the global configuration (replaces entire config)
|
|
347
|
-
*/
|
|
348
|
-
declare const initializeGlobalConfig: (config: GlobalConfigType) => void;
|
|
349
|
-
/**
|
|
350
|
-
* Update specific parts of the global configuration (merges with existing)
|
|
351
|
-
*/
|
|
352
|
-
declare const updateGlobalConfig: (updates: Partial<GlobalConfigType>) => void;
|
|
353
|
-
|
|
354
332
|
declare function getModelByTenant({ tenant, modelName, schema, env }: {
|
|
355
333
|
tenant: any;
|
|
356
334
|
modelName: any;
|
|
@@ -705,4 +683,4 @@ declare function GET_GLOBAL_BULLMQ_CONFIG({ env, redisCredentials }: {
|
|
|
705
683
|
};
|
|
706
684
|
}): Object;
|
|
707
685
|
|
|
708
|
-
export { AIChatSchema, AnnotationSchema, BaseProducer, BaseWorker, ElasticSearchConnector, GET_GLOBAL_BULLMQ_CONFIG, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, TplSchema, WorkerManager, deleteVal, extractAllBlocksFromTpl, genTagId, getAIChatModelByTenant, getAnnotationsModelByTenant, getDbByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getTplModelByTenant, getVal,
|
|
686
|
+
export { AIChatSchema, AnnotationSchema, BaseProducer, BaseWorker, ElasticSearchConnector, GET_GLOBAL_BULLMQ_CONFIG, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, TplSchema, WorkerManager, deleteVal, extractAllBlocksFromTpl, genTagId, getAIChatModelByTenant, getAnnotationsModelByTenant, getDbByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getTplModelByTenant, getVal, _recursExtractBlocks as recursivelyExtractBlocks, setVal, toArray };
|
package/dist/node.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Client } from '@elastic/elasticsearch';
|
|
2
2
|
import Redis from 'ioredis';
|
|
3
|
-
import mongoose, {
|
|
3
|
+
import mongoose, { Document, Types } from 'mongoose';
|
|
4
4
|
import * as bullmq from 'bullmq';
|
|
5
5
|
import { Queue } from 'bullmq/dist/esm/classes/queue';
|
|
6
6
|
import { Worker } from 'bullmq/dist/esm/classes/worker';
|
|
@@ -329,28 +329,6 @@ declare function getDbByTenant({ tenant, env: _env }: {
|
|
|
329
329
|
env: any;
|
|
330
330
|
}): any;
|
|
331
331
|
|
|
332
|
-
interface GlobalConfigType {
|
|
333
|
-
env?: string;
|
|
334
|
-
dbConfigs?: {
|
|
335
|
-
[env: string]: {
|
|
336
|
-
CLUSTER_NAME: string;
|
|
337
|
-
DB_URI: string;
|
|
338
|
-
connectTo?: string[];
|
|
339
|
-
};
|
|
340
|
-
};
|
|
341
|
-
mongodb?: {
|
|
342
|
-
[clusterName: string]: Connection;
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* Initialize the global configuration (replaces entire config)
|
|
347
|
-
*/
|
|
348
|
-
declare const initializeGlobalConfig: (config: GlobalConfigType) => void;
|
|
349
|
-
/**
|
|
350
|
-
* Update specific parts of the global configuration (merges with existing)
|
|
351
|
-
*/
|
|
352
|
-
declare const updateGlobalConfig: (updates: Partial<GlobalConfigType>) => void;
|
|
353
|
-
|
|
354
332
|
declare function getModelByTenant({ tenant, modelName, schema, env }: {
|
|
355
333
|
tenant: any;
|
|
356
334
|
modelName: any;
|
|
@@ -705,4 +683,4 @@ declare function GET_GLOBAL_BULLMQ_CONFIG({ env, redisCredentials }: {
|
|
|
705
683
|
};
|
|
706
684
|
}): Object;
|
|
707
685
|
|
|
708
|
-
export { AIChatSchema, AnnotationSchema, BaseProducer, BaseWorker, ElasticSearchConnector, GET_GLOBAL_BULLMQ_CONFIG, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, TplSchema, WorkerManager, deleteVal, extractAllBlocksFromTpl, genTagId, getAIChatModelByTenant, getAnnotationsModelByTenant, getDbByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getTplModelByTenant, getVal,
|
|
686
|
+
export { AIChatSchema, AnnotationSchema, BaseProducer, BaseWorker, ElasticSearchConnector, GET_GLOBAL_BULLMQ_CONFIG, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, TplSchema, WorkerManager, deleteVal, extractAllBlocksFromTpl, genTagId, getAIChatModelByTenant, getAnnotationsModelByTenant, getDbByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getTplModelByTenant, getVal, _recursExtractBlocks as recursivelyExtractBlocks, setVal, toArray };
|
package/dist/node.js
CHANGED
|
@@ -1175,7 +1175,7 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
|
|
|
1175
1175
|
concurrency: 10,
|
|
1176
1176
|
// Process 10 jobs at once for chunk processing
|
|
1177
1177
|
limiter: {
|
|
1178
|
-
max:
|
|
1178
|
+
max: 100,
|
|
1179
1179
|
// Max 50 jobs per...
|
|
1180
1180
|
duration: 6e4
|
|
1181
1181
|
// ...60 seconds (higher throughput for chunking)
|
|
@@ -1291,7 +1291,7 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
|
|
|
1291
1291
|
workerConfig: {
|
|
1292
1292
|
concurrency: 5,
|
|
1293
1293
|
limiter: {
|
|
1294
|
-
max:
|
|
1294
|
+
max: 50,
|
|
1295
1295
|
// (lets always keep this same as content enhance & embed since it comes immediately after)
|
|
1296
1296
|
duration: 6e4
|
|
1297
1297
|
// ...60 seconds (higher throughput for chunking)
|
|
@@ -1320,7 +1320,7 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
|
|
|
1320
1320
|
workerConfig: {
|
|
1321
1321
|
concurrency: 5,
|
|
1322
1322
|
limiter: {
|
|
1323
|
-
max:
|
|
1323
|
+
max: 50,
|
|
1324
1324
|
// (lets always keep this same as content enhance & embed since it comes immediately after)
|
|
1325
1325
|
duration: 6e4
|
|
1326
1326
|
// ...60 seconds (higher throughput for chunking)
|
|
@@ -1390,11 +1390,9 @@ __export(node_exports, {
|
|
|
1390
1390
|
getPlatformConfigsModelByTenant: () => import_getModelByTenant2.getPlatformConfigsModelByTenant,
|
|
1391
1391
|
getTplModelByTenant: () => import_getModelByTenant2.getTplModelByTenant,
|
|
1392
1392
|
getVal: () => getVal,
|
|
1393
|
-
initializeGlobalConfig: () => initializeGlobalConfig,
|
|
1394
1393
|
recursivelyExtractBlocks: () => _recursExtractBlocks,
|
|
1395
1394
|
setVal: () => setVal,
|
|
1396
|
-
toArray: () => toArray
|
|
1397
|
-
updateGlobalConfig: () => updateGlobalConfig
|
|
1395
|
+
toArray: () => toArray
|
|
1398
1396
|
});
|
|
1399
1397
|
module.exports = __toCommonJS(node_exports);
|
|
1400
1398
|
|
|
@@ -1990,29 +1988,6 @@ RedisCacheConnector.instance = null;
|
|
|
1990
1988
|
|
|
1991
1989
|
// src/node.ts
|
|
1992
1990
|
init_getDbByTenant();
|
|
1993
|
-
|
|
1994
|
-
// src/db/getGlobalConfig.ts
|
|
1995
|
-
var globalConfig = {};
|
|
1996
|
-
var initializeGlobalConfig = (config) => {
|
|
1997
|
-
globalConfig = {
|
|
1998
|
-
env: config.env,
|
|
1999
|
-
dbConfigs: config.dbConfigs ? { ...config.dbConfigs } : void 0,
|
|
2000
|
-
mongodb: config.mongodb ? { ...config.mongodb } : void 0
|
|
2001
|
-
};
|
|
2002
|
-
console.log(`Global config initialized for environment: ${config.env}`);
|
|
2003
|
-
};
|
|
2004
|
-
var updateGlobalConfig = (updates) => {
|
|
2005
|
-
globalConfig = {
|
|
2006
|
-
...globalConfig,
|
|
2007
|
-
...updates,
|
|
2008
|
-
// Handle nested objects properly
|
|
2009
|
-
dbConfigs: updates.dbConfigs ? { ...globalConfig.dbConfigs, ...updates.dbConfigs } : globalConfig.dbConfigs,
|
|
2010
|
-
mongodb: updates.mongodb ? { ...globalConfig.mongodb, ...updates.mongodb } : globalConfig.mongodb
|
|
2011
|
-
};
|
|
2012
|
-
console.log("Global config updated:", Object.keys(updates));
|
|
2013
|
-
};
|
|
2014
|
-
|
|
2015
|
-
// src/node.ts
|
|
2016
1991
|
var import_getModelByTenant2 = __toESM(require_getModelByTenant());
|
|
2017
1992
|
init_models();
|
|
2018
1993
|
var import_WorkerManager = __toESM(require_WorkerManager());
|
|
@@ -2044,9 +2019,7 @@ var import_GET_GLOBAL_BULLMQ_CONFIG = __toESM(require_GET_GLOBAL_BULLMQ_CONFIG()
|
|
|
2044
2019
|
getPlatformConfigsModelByTenant,
|
|
2045
2020
|
getTplModelByTenant,
|
|
2046
2021
|
getVal,
|
|
2047
|
-
initializeGlobalConfig,
|
|
2048
2022
|
recursivelyExtractBlocks,
|
|
2049
2023
|
setVal,
|
|
2050
|
-
toArray
|
|
2051
|
-
updateGlobalConfig
|
|
2024
|
+
toArray
|
|
2052
2025
|
});
|
package/dist/node.mjs
CHANGED
|
@@ -1180,7 +1180,7 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
|
|
|
1180
1180
|
concurrency: 10,
|
|
1181
1181
|
// Process 10 jobs at once for chunk processing
|
|
1182
1182
|
limiter: {
|
|
1183
|
-
max:
|
|
1183
|
+
max: 100,
|
|
1184
1184
|
// Max 50 jobs per...
|
|
1185
1185
|
duration: 6e4
|
|
1186
1186
|
// ...60 seconds (higher throughput for chunking)
|
|
@@ -1296,7 +1296,7 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
|
|
|
1296
1296
|
workerConfig: {
|
|
1297
1297
|
concurrency: 5,
|
|
1298
1298
|
limiter: {
|
|
1299
|
-
max:
|
|
1299
|
+
max: 50,
|
|
1300
1300
|
// (lets always keep this same as content enhance & embed since it comes immediately after)
|
|
1301
1301
|
duration: 6e4
|
|
1302
1302
|
// ...60 seconds (higher throughput for chunking)
|
|
@@ -1325,7 +1325,7 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
|
|
|
1325
1325
|
workerConfig: {
|
|
1326
1326
|
concurrency: 5,
|
|
1327
1327
|
limiter: {
|
|
1328
|
-
max:
|
|
1328
|
+
max: 50,
|
|
1329
1329
|
// (lets always keep this same as content enhance & embed since it comes immediately after)
|
|
1330
1330
|
duration: 6e4
|
|
1331
1331
|
// ...60 seconds (higher throughput for chunking)
|
|
@@ -1962,29 +1962,6 @@ RedisCacheConnector.instance = null;
|
|
|
1962
1962
|
|
|
1963
1963
|
// src/node.ts
|
|
1964
1964
|
init_getDbByTenant();
|
|
1965
|
-
|
|
1966
|
-
// src/db/getGlobalConfig.ts
|
|
1967
|
-
var globalConfig = {};
|
|
1968
|
-
var initializeGlobalConfig = (config) => {
|
|
1969
|
-
globalConfig = {
|
|
1970
|
-
env: config.env,
|
|
1971
|
-
dbConfigs: config.dbConfigs ? { ...config.dbConfigs } : void 0,
|
|
1972
|
-
mongodb: config.mongodb ? { ...config.mongodb } : void 0
|
|
1973
|
-
};
|
|
1974
|
-
console.log(`Global config initialized for environment: ${config.env}`);
|
|
1975
|
-
};
|
|
1976
|
-
var updateGlobalConfig = (updates) => {
|
|
1977
|
-
globalConfig = {
|
|
1978
|
-
...globalConfig,
|
|
1979
|
-
...updates,
|
|
1980
|
-
// Handle nested objects properly
|
|
1981
|
-
dbConfigs: updates.dbConfigs ? { ...globalConfig.dbConfigs, ...updates.dbConfigs } : globalConfig.dbConfigs,
|
|
1982
|
-
mongodb: updates.mongodb ? { ...globalConfig.mongodb, ...updates.mongodb } : globalConfig.mongodb
|
|
1983
|
-
};
|
|
1984
|
-
console.log("Global config updated:", Object.keys(updates));
|
|
1985
|
-
};
|
|
1986
|
-
|
|
1987
|
-
// src/node.ts
|
|
1988
1965
|
var import_getModelByTenant2 = __toESM(require_getModelByTenant());
|
|
1989
1966
|
init_models();
|
|
1990
1967
|
var import_WorkerManager = __toESM(require_WorkerManager());
|
|
@@ -2027,9 +2004,7 @@ export {
|
|
|
2027
2004
|
export_getPlatformConfigsModelByTenant as getPlatformConfigsModelByTenant,
|
|
2028
2005
|
export_getTplModelByTenant as getTplModelByTenant,
|
|
2029
2006
|
getVal,
|
|
2030
|
-
initializeGlobalConfig,
|
|
2031
2007
|
_recursExtractBlocks as recursivelyExtractBlocks,
|
|
2032
2008
|
setVal,
|
|
2033
|
-
toArray
|
|
2034
|
-
updateGlobalConfig
|
|
2009
|
+
toArray
|
|
2035
2010
|
};
|