@okf/ootils 1.43.0 → 1.44.0

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 CHANGED
@@ -9095,6 +9095,26 @@ declare class TenantRegistry {
9095
9095
  static removeTenant(tenantId: any): Promise<boolean>;
9096
9096
  }
9097
9097
 
9098
+ declare const LIVE_COLLAB_DOC_REFRESH_MS: 120000;
9099
+ declare function markLiveCollabDoc({ tenant, contentType, docId, env }: {
9100
+ tenant: any;
9101
+ contentType: any;
9102
+ docId: any;
9103
+ env: any;
9104
+ }): Promise<void>;
9105
+ declare function clearLiveCollabDoc({ tenant, contentType, docId, env }: {
9106
+ tenant: any;
9107
+ contentType: any;
9108
+ docId: any;
9109
+ env: any;
9110
+ }): Promise<void>;
9111
+ declare function isLiveCollabDoc({ tenant, contentType, docId, env }: {
9112
+ tenant: any;
9113
+ contentType: any;
9114
+ docId: any;
9115
+ env: any;
9116
+ }): Promise<boolean>;
9117
+
9098
9118
  declare class WorkerManager {
9099
9119
  constructor(workers?: any[]);
9100
9120
  workers: any[];
@@ -9365,4 +9385,4 @@ declare function GET_GLOBAL_BULLMQ_CONFIG({ env, redisCredentials }: {
9365
9385
  };
9366
9386
  }): Object;
9367
9387
 
9368
- export { AIChatSchema, AnnosElasticSyncProducer, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseFlowProducer, BaseProducer, BaseWorker, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ChunksElasticSyncProducer, ContentElasticSyncProducer, ELASTIC_MAPPING_PRESETS, ElasticSearchConnector, FILTER_IDS, GET_GLOBAL_BULLMQ_CONFIG, GeneratedEntitiesSchema, GeneratedTopicsSchema, MONGO_SCHEMA_PRESETS, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, SecretManagerConnector, TEMP_removeDuplicateFilters, TenantRegistry, TplSchema, UI_CONTENT, WorkerManager, _backOfficeFields__contr, _constantMeta__contr, _fixedMainFields__contr, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, collectMarkIdsInOrder, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAllUniqueAnnoTagTypesFromTpl, extractAndOrganizeBlocks, extractNumberFromValue, genCleanCamelCaseId, genContentTypeSchema, genTagId, generateFilterKey, getAIChatModelByTenant, getAnnoFilterBucketKey, getAnnotationsModelByTenant, getContrModelByTenant, getDbByTenant, getFilterKeyForBlock, getGeneratedEntitiesModelByTenant, getGeneratedTopicsModelByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getTpl, getTplModelByTenant, getTypesForSchemaFromTpl, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
9388
+ export { AIChatSchema, AnnosElasticSyncProducer, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseFlowProducer, BaseProducer, BaseWorker, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ChunksElasticSyncProducer, ContentElasticSyncProducer, ELASTIC_MAPPING_PRESETS, ElasticSearchConnector, FILTER_IDS, GET_GLOBAL_BULLMQ_CONFIG, GeneratedEntitiesSchema, GeneratedTopicsSchema, LIVE_COLLAB_DOC_REFRESH_MS, MONGO_SCHEMA_PRESETS, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, SecretManagerConnector, TEMP_removeDuplicateFilters, TenantRegistry, TplSchema, UI_CONTENT, WorkerManager, _backOfficeFields__contr, _constantMeta__contr, _fixedMainFields__contr, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, clearLiveCollabDoc, collectMarkIdsInOrder, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAllUniqueAnnoTagTypesFromTpl, extractAndOrganizeBlocks, extractNumberFromValue, genCleanCamelCaseId, genContentTypeSchema, genTagId, generateFilterKey, getAIChatModelByTenant, getAnnoFilterBucketKey, getAnnotationsModelByTenant, getContrModelByTenant, getDbByTenant, getFilterKeyForBlock, getGeneratedEntitiesModelByTenant, getGeneratedTopicsModelByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getTpl, getTplModelByTenant, getTypesForSchemaFromTpl, getVal, isLiveCollabDoc, isTplAnnotationEnabled, markLiveCollabDoc, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
package/dist/node.d.ts CHANGED
@@ -9095,6 +9095,26 @@ declare class TenantRegistry {
9095
9095
  static removeTenant(tenantId: any): Promise<boolean>;
9096
9096
  }
9097
9097
 
9098
+ declare const LIVE_COLLAB_DOC_REFRESH_MS: 120000;
9099
+ declare function markLiveCollabDoc({ tenant, contentType, docId, env }: {
9100
+ tenant: any;
9101
+ contentType: any;
9102
+ docId: any;
9103
+ env: any;
9104
+ }): Promise<void>;
9105
+ declare function clearLiveCollabDoc({ tenant, contentType, docId, env }: {
9106
+ tenant: any;
9107
+ contentType: any;
9108
+ docId: any;
9109
+ env: any;
9110
+ }): Promise<void>;
9111
+ declare function isLiveCollabDoc({ tenant, contentType, docId, env }: {
9112
+ tenant: any;
9113
+ contentType: any;
9114
+ docId: any;
9115
+ env: any;
9116
+ }): Promise<boolean>;
9117
+
9098
9118
  declare class WorkerManager {
9099
9119
  constructor(workers?: any[]);
9100
9120
  workers: any[];
@@ -9365,4 +9385,4 @@ declare function GET_GLOBAL_BULLMQ_CONFIG({ env, redisCredentials }: {
9365
9385
  };
9366
9386
  }): Object;
9367
9387
 
9368
- export { AIChatSchema, AnnosElasticSyncProducer, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseFlowProducer, BaseProducer, BaseWorker, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ChunksElasticSyncProducer, ContentElasticSyncProducer, ELASTIC_MAPPING_PRESETS, ElasticSearchConnector, FILTER_IDS, GET_GLOBAL_BULLMQ_CONFIG, GeneratedEntitiesSchema, GeneratedTopicsSchema, MONGO_SCHEMA_PRESETS, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, SecretManagerConnector, TEMP_removeDuplicateFilters, TenantRegistry, TplSchema, UI_CONTENT, WorkerManager, _backOfficeFields__contr, _constantMeta__contr, _fixedMainFields__contr, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, collectMarkIdsInOrder, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAllUniqueAnnoTagTypesFromTpl, extractAndOrganizeBlocks, extractNumberFromValue, genCleanCamelCaseId, genContentTypeSchema, genTagId, generateFilterKey, getAIChatModelByTenant, getAnnoFilterBucketKey, getAnnotationsModelByTenant, getContrModelByTenant, getDbByTenant, getFilterKeyForBlock, getGeneratedEntitiesModelByTenant, getGeneratedTopicsModelByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getTpl, getTplModelByTenant, getTypesForSchemaFromTpl, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
9388
+ export { AIChatSchema, AnnosElasticSyncProducer, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseFlowProducer, BaseProducer, BaseWorker, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ChunksElasticSyncProducer, ContentElasticSyncProducer, ELASTIC_MAPPING_PRESETS, ElasticSearchConnector, FILTER_IDS, GET_GLOBAL_BULLMQ_CONFIG, GeneratedEntitiesSchema, GeneratedTopicsSchema, LIVE_COLLAB_DOC_REFRESH_MS, MONGO_SCHEMA_PRESETS, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, SecretManagerConnector, TEMP_removeDuplicateFilters, TenantRegistry, TplSchema, UI_CONTENT, WorkerManager, _backOfficeFields__contr, _constantMeta__contr, _fixedMainFields__contr, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, clearLiveCollabDoc, collectMarkIdsInOrder, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAllUniqueAnnoTagTypesFromTpl, extractAndOrganizeBlocks, extractNumberFromValue, genCleanCamelCaseId, genContentTypeSchema, genTagId, generateFilterKey, getAIChatModelByTenant, getAnnoFilterBucketKey, getAnnotationsModelByTenant, getContrModelByTenant, getDbByTenant, getFilterKeyForBlock, getGeneratedEntitiesModelByTenant, getGeneratedTopicsModelByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getTpl, getTplModelByTenant, getTypesForSchemaFromTpl, getVal, isLiveCollabDoc, isTplAnnotationEnabled, markLiveCollabDoc, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
package/dist/node.js CHANGED
@@ -2385,6 +2385,7 @@ __export(node_exports, {
2385
2385
  GET_GLOBAL_BULLMQ_CONFIG: () => import_GET_GLOBAL_BULLMQ_CONFIG.GET_GLOBAL_BULLMQ_CONFIG,
2386
2386
  GeneratedEntitiesSchema: () => GeneratedEntities_default,
2387
2387
  GeneratedTopicsSchema: () => GeneratedTopics_default,
2388
+ LIVE_COLLAB_DOC_REFRESH_MS: () => LIVE_COLLAB_DOC_REFRESH_MS,
2388
2389
  MONGO_SCHEMA_PRESETS: () => MONGO_SCHEMA_PRESETS,
2389
2390
  MongoConnector: () => import_MongoConnector3.MongoConnector,
2390
2391
  PlatformConfigsSchema: () => PlatformConfigs_default,
@@ -2406,6 +2407,7 @@ __export(node_exports, {
2406
2407
  autoGenFilterConfigsFromTpl: () => autoGenFilterConfigsFromTpl,
2407
2408
  blockRegistry: () => blockRegistry,
2408
2409
  buildFilterConfigurations: () => buildFilterConfigurations,
2410
+ clearLiveCollabDoc: () => clearLiveCollabDoc,
2409
2411
  collectMarkIdsInOrder: () => collectMarkIdsInOrder,
2410
2412
  compareAndGroupBlocks: () => compareAndGroupBlocks,
2411
2413
  deleteVal: () => deleteVal,
@@ -2441,7 +2443,9 @@ __export(node_exports, {
2441
2443
  getTplModelByTenant: () => import_getModelByTenant4.getTplModelByTenant,
2442
2444
  getTypesForSchemaFromTpl: () => getTypesForSchemaFromTpl,
2443
2445
  getVal: () => getVal,
2446
+ isLiveCollabDoc: () => isLiveCollabDoc,
2444
2447
  isTplAnnotationEnabled: () => isTplAnnotationEnabled,
2448
+ markLiveCollabDoc: () => markLiveCollabDoc,
2445
2449
  mergeAnnoDataIntoAnnotationsTags: () => mergeAnnoDataIntoAnnotationsTags,
2446
2450
  parseSpecialConfigSyntax: () => parseSpecialConfigSyntax,
2447
2451
  plainTextToLexical: () => plainTextToLexical,
@@ -5848,6 +5852,25 @@ var getContrModelByTenant = async ({
5848
5852
 
5849
5853
  // src/node.ts
5850
5854
  init_models();
5855
+
5856
+ // src/collab/liveCollabDocMarker.js
5857
+ var TTL_SECONDS = 300;
5858
+ var LIVE_COLLAB_DOC_REFRESH_MS = 12e4;
5859
+ var buildKey = ({ env, tenant, contentType, docId }) => `${env || RedisCacheConnector.getEnv()}:liveCollabDoc:${tenant}:${contentType}:${docId}`;
5860
+ var markLiveCollabDoc = async ({ tenant, contentType, docId, env }) => {
5861
+ const client = RedisCacheConnector.getClient(env || RedisCacheConnector.getEnv());
5862
+ await client.set(buildKey({ env, tenant, contentType, docId }), Date.now(), "EX", TTL_SECONDS);
5863
+ };
5864
+ var clearLiveCollabDoc = async ({ tenant, contentType, docId, env }) => {
5865
+ const client = RedisCacheConnector.getClient(env || RedisCacheConnector.getEnv());
5866
+ await client.del(buildKey({ env, tenant, contentType, docId }));
5867
+ };
5868
+ var isLiveCollabDoc = async ({ tenant, contentType, docId, env }) => {
5869
+ const client = RedisCacheConnector.getClient(env || RedisCacheConnector.getEnv());
5870
+ return await client.exists(buildKey({ env, tenant, contentType, docId })) === 1;
5871
+ };
5872
+
5873
+ // src/node.ts
5851
5874
  var import_WorkerManager = __toESM(require_WorkerManager());
5852
5875
  var import_ProducerManager = __toESM(require_ProducerManager());
5853
5876
  var import_BaseProducer = __toESM(require_BaseProducer());
@@ -5876,6 +5899,7 @@ var import_GET_GLOBAL_BULLMQ_CONFIG = __toESM(require_GET_GLOBAL_BULLMQ_CONFIG()
5876
5899
  GET_GLOBAL_BULLMQ_CONFIG,
5877
5900
  GeneratedEntitiesSchema,
5878
5901
  GeneratedTopicsSchema,
5902
+ LIVE_COLLAB_DOC_REFRESH_MS,
5879
5903
  MONGO_SCHEMA_PRESETS,
5880
5904
  MongoConnector,
5881
5905
  PlatformConfigsSchema,
@@ -5897,6 +5921,7 @@ var import_GET_GLOBAL_BULLMQ_CONFIG = __toESM(require_GET_GLOBAL_BULLMQ_CONFIG()
5897
5921
  autoGenFilterConfigsFromTpl,
5898
5922
  blockRegistry,
5899
5923
  buildFilterConfigurations,
5924
+ clearLiveCollabDoc,
5900
5925
  collectMarkIdsInOrder,
5901
5926
  compareAndGroupBlocks,
5902
5927
  deleteVal,
@@ -5932,7 +5957,9 @@ var import_GET_GLOBAL_BULLMQ_CONFIG = __toESM(require_GET_GLOBAL_BULLMQ_CONFIG()
5932
5957
  getTplModelByTenant,
5933
5958
  getTypesForSchemaFromTpl,
5934
5959
  getVal,
5960
+ isLiveCollabDoc,
5935
5961
  isTplAnnotationEnabled,
5962
+ markLiveCollabDoc,
5936
5963
  mergeAnnoDataIntoAnnotationsTags,
5937
5964
  parseSpecialConfigSyntax,
5938
5965
  plainTextToLexical,
package/dist/node.mjs CHANGED
@@ -5765,6 +5765,25 @@ var getContrModelByTenant = async ({
5765
5765
 
5766
5766
  // src/node.ts
5767
5767
  init_models();
5768
+
5769
+ // src/collab/liveCollabDocMarker.js
5770
+ var TTL_SECONDS = 300;
5771
+ var LIVE_COLLAB_DOC_REFRESH_MS = 12e4;
5772
+ var buildKey = ({ env, tenant, contentType, docId }) => `${env || RedisCacheConnector.getEnv()}:liveCollabDoc:${tenant}:${contentType}:${docId}`;
5773
+ var markLiveCollabDoc = async ({ tenant, contentType, docId, env }) => {
5774
+ const client = RedisCacheConnector.getClient(env || RedisCacheConnector.getEnv());
5775
+ await client.set(buildKey({ env, tenant, contentType, docId }), Date.now(), "EX", TTL_SECONDS);
5776
+ };
5777
+ var clearLiveCollabDoc = async ({ tenant, contentType, docId, env }) => {
5778
+ const client = RedisCacheConnector.getClient(env || RedisCacheConnector.getEnv());
5779
+ await client.del(buildKey({ env, tenant, contentType, docId }));
5780
+ };
5781
+ var isLiveCollabDoc = async ({ tenant, contentType, docId, env }) => {
5782
+ const client = RedisCacheConnector.getClient(env || RedisCacheConnector.getEnv());
5783
+ return await client.exists(buildKey({ env, tenant, contentType, docId })) === 1;
5784
+ };
5785
+
5786
+ // src/node.ts
5768
5787
  var import_WorkerManager = __toESM(require_WorkerManager());
5769
5788
  var import_ProducerManager = __toESM(require_ProducerManager());
5770
5789
  var import_BaseProducer = __toESM(require_BaseProducer());
@@ -5810,6 +5829,7 @@ export {
5810
5829
  export_GET_GLOBAL_BULLMQ_CONFIG as GET_GLOBAL_BULLMQ_CONFIG,
5811
5830
  GeneratedEntities_default as GeneratedEntitiesSchema,
5812
5831
  GeneratedTopics_default as GeneratedTopicsSchema,
5832
+ LIVE_COLLAB_DOC_REFRESH_MS,
5813
5833
  MONGO_SCHEMA_PRESETS,
5814
5834
  export_MongoConnector as MongoConnector,
5815
5835
  PlatformConfigs_default as PlatformConfigsSchema,
@@ -5831,6 +5851,7 @@ export {
5831
5851
  autoGenFilterConfigsFromTpl,
5832
5852
  blockRegistry,
5833
5853
  buildFilterConfigurations,
5854
+ clearLiveCollabDoc,
5834
5855
  collectMarkIdsInOrder,
5835
5856
  compareAndGroupBlocks,
5836
5857
  deleteVal,
@@ -5866,7 +5887,9 @@ export {
5866
5887
  export_getTplModelByTenant as getTplModelByTenant,
5867
5888
  getTypesForSchemaFromTpl,
5868
5889
  getVal,
5890
+ isLiveCollabDoc,
5869
5891
  isTplAnnotationEnabled,
5892
+ markLiveCollabDoc,
5870
5893
  mergeAnnoDataIntoAnnotationsTags,
5871
5894
  parseSpecialConfigSyntax,
5872
5895
  plainTextToLexical,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.43.0",
6
+ "version": "1.44.0",
7
7
  "description": "Utility functions for both browser and Node.js",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.mjs",