@okf/ootils 1.20.0 → 1.21.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/browser.js CHANGED
@@ -773,7 +773,7 @@ var mergeAnnoDataIntoAnnotationsTags = ({
773
773
  prevObj,
774
774
  newLexValue,
775
775
  thisBlockValuePath,
776
- author = { id: null, name: "AI" }
776
+ author
777
777
  }) => {
778
778
  let newConsolidated = (0, import_lodash.cloneDeep)(prevObj) || {};
779
779
  const { annoData = {} } = newLexValue || {};
package/dist/browser.mjs CHANGED
@@ -736,7 +736,7 @@ var mergeAnnoDataIntoAnnotationsTags = ({
736
736
  prevObj,
737
737
  newLexValue,
738
738
  thisBlockValuePath,
739
- author = { id: null, name: "AI" }
739
+ author
740
740
  }) => {
741
741
  let newConsolidated = cloneDeep(prevObj) || {};
742
742
  const { annoData = {} } = newLexValue || {};
package/dist/node.d.mts CHANGED
@@ -1316,6 +1316,16 @@ declare class ChunksElasticSyncProducer extends BaseProducer {
1316
1316
  addJobWithName(jobData: Object): Promise<Object>;
1317
1317
  }
1318
1318
 
1319
+ declare class AnnosElasticSyncProducer extends BaseProducer {
1320
+ constructor(options?: {});
1321
+ /**
1322
+ * Add a single sync job
1323
+ * @param {Object} jobData - Job data containing docIds, tenant, operationType
1324
+ * @returns {Promise<Object>} Job creation result
1325
+ */
1326
+ addJobWithName(jobData: Object): Promise<Object>;
1327
+ }
1328
+
1319
1329
  /**
1320
1330
  * Creates BullMQ configuration with explicit dependencies
1321
1331
  * @param {Object} params Configuration parameters
@@ -1335,4 +1345,4 @@ declare function GET_GLOBAL_BULLMQ_CONFIG({ env, redisCredentials }: {
1335
1345
  };
1336
1346
  }): Object;
1337
1347
 
1338
- export { AIChatSchema, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseProducer, BaseWorker, ChunksElasticSyncProducer, ElasticSearchConnector, GET_GLOBAL_BULLMQ_CONFIG, GeneratedTopicsSchema, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, TplSchema, WorkerManager, deleteVal, extractAllBlocksFromTpl, genTagId, getAIChatModelByTenant, getAnnotationsModelByTenant, getDbByTenant, getGeneratedTopicsModelByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getPlatformContextContent, getRollupPossibilities, getTplModelByTenant, getVal, mergeAnnoDataIntoAnnotationsTags, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
1348
+ export { AIChatSchema, AnnosElasticSyncProducer, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseProducer, BaseWorker, ChunksElasticSyncProducer, ElasticSearchConnector, GET_GLOBAL_BULLMQ_CONFIG, GeneratedTopicsSchema, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, TplSchema, WorkerManager, deleteVal, extractAllBlocksFromTpl, genTagId, getAIChatModelByTenant, getAnnotationsModelByTenant, getDbByTenant, getGeneratedTopicsModelByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getPlatformContextContent, getRollupPossibilities, getTplModelByTenant, getVal, mergeAnnoDataIntoAnnotationsTags, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
package/dist/node.d.ts CHANGED
@@ -1316,6 +1316,16 @@ declare class ChunksElasticSyncProducer extends BaseProducer {
1316
1316
  addJobWithName(jobData: Object): Promise<Object>;
1317
1317
  }
1318
1318
 
1319
+ declare class AnnosElasticSyncProducer extends BaseProducer {
1320
+ constructor(options?: {});
1321
+ /**
1322
+ * Add a single sync job
1323
+ * @param {Object} jobData - Job data containing docIds, tenant, operationType
1324
+ * @returns {Promise<Object>} Job creation result
1325
+ */
1326
+ addJobWithName(jobData: Object): Promise<Object>;
1327
+ }
1328
+
1319
1329
  /**
1320
1330
  * Creates BullMQ configuration with explicit dependencies
1321
1331
  * @param {Object} params Configuration parameters
@@ -1335,4 +1345,4 @@ declare function GET_GLOBAL_BULLMQ_CONFIG({ env, redisCredentials }: {
1335
1345
  };
1336
1346
  }): Object;
1337
1347
 
1338
- export { AIChatSchema, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseProducer, BaseWorker, ChunksElasticSyncProducer, ElasticSearchConnector, GET_GLOBAL_BULLMQ_CONFIG, GeneratedTopicsSchema, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, TplSchema, WorkerManager, deleteVal, extractAllBlocksFromTpl, genTagId, getAIChatModelByTenant, getAnnotationsModelByTenant, getDbByTenant, getGeneratedTopicsModelByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getPlatformContextContent, getRollupPossibilities, getTplModelByTenant, getVal, mergeAnnoDataIntoAnnotationsTags, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
1348
+ export { AIChatSchema, AnnosElasticSyncProducer, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseProducer, BaseWorker, ChunksElasticSyncProducer, ElasticSearchConnector, GET_GLOBAL_BULLMQ_CONFIG, GeneratedTopicsSchema, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, TplSchema, WorkerManager, deleteVal, extractAllBlocksFromTpl, genTagId, getAIChatModelByTenant, getAnnotationsModelByTenant, getDbByTenant, getGeneratedTopicsModelByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getPlatformContextContent, getRollupPossibilities, getTplModelByTenant, getVal, mergeAnnoDataIntoAnnotationsTags, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
package/dist/node.js CHANGED
@@ -1594,10 +1594,53 @@ var require_ChunksElasticSyncProducer = __commonJS({
1594
1594
  }
1595
1595
  });
1596
1596
 
1597
+ // src/bullmq/AnnosElasticSyncProducer.js
1598
+ var require_AnnosElasticSyncProducer = __commonJS({
1599
+ "src/bullmq/AnnosElasticSyncProducer.js"(exports2, module2) {
1600
+ "use strict";
1601
+ var { BaseProducer: BaseProducer2 } = require_BaseProducer();
1602
+ var { GET_GLOBAL_BULLMQ_CONFIG: GET_GLOBAL_BULLMQ_CONFIG2 } = require_GET_GLOBAL_BULLMQ_CONFIG();
1603
+ var AnnosElasticSyncProducer2 = class extends BaseProducer2 {
1604
+ // Preserve class name through minification for ProducerManager lookup
1605
+ static get name() {
1606
+ return "AnnosElasticSyncProducer";
1607
+ }
1608
+ // options - Configuration options (optional, defaults to process.env)
1609
+ constructor(options = {}) {
1610
+ const env = options.env || process.env.ENV;
1611
+ const redisCredentials = options.redisCredentials || {
1612
+ REDIS_HOST: process.env.REDIS_HOST,
1613
+ REDIS_PORT: process.env.REDIS_PORT,
1614
+ REDIS_PASSWORD: process.env.REDIS_PASSWORD
1615
+ };
1616
+ const GLOBAL_BULLMQ_CONFIG = GET_GLOBAL_BULLMQ_CONFIG2({
1617
+ env,
1618
+ redisCredentials
1619
+ });
1620
+ super(GLOBAL_BULLMQ_CONFIG.ANNOS_ELASTIC_SYNC_QUEUE);
1621
+ }
1622
+ /**
1623
+ * Add a single sync job
1624
+ * @param {Object} jobData - Job data containing docIds, tenant, operationType
1625
+ * @returns {Promise<Object>} Job creation result
1626
+ */
1627
+ async addJobWithName(jobData) {
1628
+ const job = await this.addJob("processAnnosElasticSync", jobData);
1629
+ console.log(`\u{1F4C8} Added process annos elastic sync job: ${job.id}`);
1630
+ return { jobId: job.id };
1631
+ }
1632
+ };
1633
+ module2.exports = {
1634
+ AnnosElasticSyncProducer: AnnosElasticSyncProducer2
1635
+ };
1636
+ }
1637
+ });
1638
+
1597
1639
  // src/node.ts
1598
1640
  var node_exports = {};
1599
1641
  __export(node_exports, {
1600
1642
  AIChatSchema: () => AIChat_default,
1643
+ AnnosElasticSyncProducer: () => import_AnnosElasticSyncProducer.AnnosElasticSyncProducer,
1601
1644
  AnnotationSchema: () => Annotations_default,
1602
1645
  BASE_BULLMQ_CONFIG: () => BASE_BULLMQ_CONFIG,
1603
1646
  BaseProducer: () => import_BaseProducer.BaseProducer,
@@ -2071,7 +2114,7 @@ var mergeAnnoDataIntoAnnotationsTags = ({
2071
2114
  prevObj,
2072
2115
  newLexValue,
2073
2116
  thisBlockValuePath,
2074
- author = { id: null, name: "AI" }
2117
+ author
2075
2118
  }) => {
2076
2119
  let newConsolidated = (0, import_lodash.cloneDeep)(prevObj) || {};
2077
2120
  const { annoData = {} } = newLexValue || {};
@@ -2482,10 +2525,12 @@ var import_ProducerManager = __toESM(require_ProducerManager());
2482
2525
  var import_BaseProducer = __toESM(require_BaseProducer());
2483
2526
  var import_BaseWorker = __toESM(require_BaseWorker());
2484
2527
  var import_ChunksElasticSyncProducer = __toESM(require_ChunksElasticSyncProducer());
2528
+ var import_AnnosElasticSyncProducer = __toESM(require_AnnosElasticSyncProducer());
2485
2529
  var import_GET_GLOBAL_BULLMQ_CONFIG = __toESM(require_GET_GLOBAL_BULLMQ_CONFIG());
2486
2530
  // Annotate the CommonJS export names for ESM import in node:
2487
2531
  0 && (module.exports = {
2488
2532
  AIChatSchema,
2533
+ AnnosElasticSyncProducer,
2489
2534
  AnnotationSchema,
2490
2535
  BASE_BULLMQ_CONFIG,
2491
2536
  BaseProducer,
package/dist/node.mjs CHANGED
@@ -1599,6 +1599,48 @@ var require_ChunksElasticSyncProducer = __commonJS({
1599
1599
  }
1600
1600
  });
1601
1601
 
1602
+ // src/bullmq/AnnosElasticSyncProducer.js
1603
+ var require_AnnosElasticSyncProducer = __commonJS({
1604
+ "src/bullmq/AnnosElasticSyncProducer.js"(exports, module) {
1605
+ "use strict";
1606
+ var { BaseProducer: BaseProducer2 } = require_BaseProducer();
1607
+ var { GET_GLOBAL_BULLMQ_CONFIG: GET_GLOBAL_BULLMQ_CONFIG2 } = require_GET_GLOBAL_BULLMQ_CONFIG();
1608
+ var AnnosElasticSyncProducer2 = class extends BaseProducer2 {
1609
+ // Preserve class name through minification for ProducerManager lookup
1610
+ static get name() {
1611
+ return "AnnosElasticSyncProducer";
1612
+ }
1613
+ // options - Configuration options (optional, defaults to process.env)
1614
+ constructor(options = {}) {
1615
+ const env = options.env || process.env.ENV;
1616
+ const redisCredentials = options.redisCredentials || {
1617
+ REDIS_HOST: process.env.REDIS_HOST,
1618
+ REDIS_PORT: process.env.REDIS_PORT,
1619
+ REDIS_PASSWORD: process.env.REDIS_PASSWORD
1620
+ };
1621
+ const GLOBAL_BULLMQ_CONFIG = GET_GLOBAL_BULLMQ_CONFIG2({
1622
+ env,
1623
+ redisCredentials
1624
+ });
1625
+ super(GLOBAL_BULLMQ_CONFIG.ANNOS_ELASTIC_SYNC_QUEUE);
1626
+ }
1627
+ /**
1628
+ * Add a single sync job
1629
+ * @param {Object} jobData - Job data containing docIds, tenant, operationType
1630
+ * @returns {Promise<Object>} Job creation result
1631
+ */
1632
+ async addJobWithName(jobData) {
1633
+ const job = await this.addJob("processAnnosElasticSync", jobData);
1634
+ console.log(`\u{1F4C8} Added process annos elastic sync job: ${job.id}`);
1635
+ return { jobId: job.id };
1636
+ }
1637
+ };
1638
+ module.exports = {
1639
+ AnnosElasticSyncProducer: AnnosElasticSyncProducer2
1640
+ };
1641
+ }
1642
+ });
1643
+
1602
1644
  // src/utils/getterSetterDeleter/utils/set_deleteVal.ts
1603
1645
  var set_deleteVal = (action, data, valuePath, value) => {
1604
1646
  if (valuePath === void 0) return;
@@ -2037,7 +2079,7 @@ var mergeAnnoDataIntoAnnotationsTags = ({
2037
2079
  prevObj,
2038
2080
  newLexValue,
2039
2081
  thisBlockValuePath,
2040
- author = { id: null, name: "AI" }
2082
+ author
2041
2083
  }) => {
2042
2084
  let newConsolidated = cloneDeep(prevObj) || {};
2043
2085
  const { annoData = {} } = newLexValue || {};
@@ -2448,7 +2490,9 @@ var import_ProducerManager = __toESM(require_ProducerManager());
2448
2490
  var import_BaseProducer = __toESM(require_BaseProducer());
2449
2491
  var import_BaseWorker = __toESM(require_BaseWorker());
2450
2492
  var import_ChunksElasticSyncProducer = __toESM(require_ChunksElasticSyncProducer());
2493
+ var import_AnnosElasticSyncProducer = __toESM(require_AnnosElasticSyncProducer());
2451
2494
  var import_GET_GLOBAL_BULLMQ_CONFIG = __toESM(require_GET_GLOBAL_BULLMQ_CONFIG());
2495
+ var export_AnnosElasticSyncProducer = import_AnnosElasticSyncProducer.AnnosElasticSyncProducer;
2452
2496
  var export_BaseProducer = import_BaseProducer.BaseProducer;
2453
2497
  var export_BaseWorker = import_BaseWorker.BaseWorker;
2454
2498
  var export_ChunksElasticSyncProducer = import_ChunksElasticSyncProducer.ChunksElasticSyncProducer;
@@ -2465,6 +2509,7 @@ var export_getPlatformConfigsModelByTenant = import_getModelByTenant2.getPlatfor
2465
2509
  var export_getTplModelByTenant = import_getModelByTenant2.getTplModelByTenant;
2466
2510
  export {
2467
2511
  AIChat_default as AIChatSchema,
2512
+ export_AnnosElasticSyncProducer as AnnosElasticSyncProducer,
2468
2513
  Annotations_default as AnnotationSchema,
2469
2514
  BASE_BULLMQ_CONFIG,
2470
2515
  export_BaseProducer as BaseProducer,
package/dist/universal.js CHANGED
@@ -773,7 +773,7 @@ var mergeAnnoDataIntoAnnotationsTags = ({
773
773
  prevObj,
774
774
  newLexValue,
775
775
  thisBlockValuePath,
776
- author = { id: null, name: "AI" }
776
+ author
777
777
  }) => {
778
778
  let newConsolidated = (0, import_lodash.cloneDeep)(prevObj) || {};
779
779
  const { annoData = {} } = newLexValue || {};
@@ -736,7 +736,7 @@ var mergeAnnoDataIntoAnnotationsTags = ({
736
736
  prevObj,
737
737
  newLexValue,
738
738
  thisBlockValuePath,
739
- author = { id: null, name: "AI" }
739
+ author
740
740
  }) => {
741
741
  let newConsolidated = cloneDeep(prevObj) || {};
742
742
  const { annoData = {} } = newLexValue || {};
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.20.0",
6
+ "version": "1.21.1",
7
7
  "description": "Utility functions for both browser and Node.js",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.mjs",