@okf/ootils 1.41.1 → 1.42.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
@@ -495,7 +495,7 @@ declare namespace BASE_BULLMQ_CONFIG {
495
495
  }
496
496
  export { workerConfig_4 as workerConfig };
497
497
  }
498
- namespace AI_AUTO_ANNOTATE_QUEUE {
498
+ namespace AI_AUTO_ANNOTATE_PREP_QUEUE {
499
499
  let id_5: string;
500
500
  export { id_5 as id };
501
501
  export namespace queueConfig_5 {
@@ -535,7 +535,7 @@ declare namespace BASE_BULLMQ_CONFIG {
535
535
  }
536
536
  export { workerConfig_5 as workerConfig };
537
537
  }
538
- namespace AI_AUTO_ANNOTATE_CHUNK_QUEUE {
538
+ namespace AI_AUTO_ANNOTATE_QUEUE {
539
539
  let id_6: string;
540
540
  export { id_6 as id };
541
541
  export namespace queueConfig_6 {
@@ -575,7 +575,7 @@ declare namespace BASE_BULLMQ_CONFIG {
575
575
  }
576
576
  export { workerConfig_6 as workerConfig };
577
577
  }
578
- namespace ANNOS_ELASTIC_SYNC_QUEUE {
578
+ namespace AI_AUTO_ANNOTATE_CHUNK_QUEUE {
579
579
  let id_7: string;
580
580
  export { id_7 as id };
581
581
  export namespace queueConfig_7 {
@@ -615,7 +615,7 @@ declare namespace BASE_BULLMQ_CONFIG {
615
615
  }
616
616
  export { workerConfig_7 as workerConfig };
617
617
  }
618
- namespace CHUNKS_ELASTIC_SYNC_QUEUE {
618
+ namespace ANNOS_ELASTIC_SYNC_QUEUE {
619
619
  let id_8: string;
620
620
  export { id_8 as id };
621
621
  export namespace queueConfig_8 {
@@ -655,7 +655,7 @@ declare namespace BASE_BULLMQ_CONFIG {
655
655
  }
656
656
  export { workerConfig_8 as workerConfig };
657
657
  }
658
- namespace USERS_ELASTIC_SYNC_QUEUE {
658
+ namespace CHUNKS_ELASTIC_SYNC_QUEUE {
659
659
  let id_9: string;
660
660
  export { id_9 as id };
661
661
  export namespace queueConfig_9 {
@@ -695,7 +695,7 @@ declare namespace BASE_BULLMQ_CONFIG {
695
695
  }
696
696
  export { workerConfig_9 as workerConfig };
697
697
  }
698
- namespace CONTENT_ELASTIC_SYNC_QUEUE {
698
+ namespace USERS_ELASTIC_SYNC_QUEUE {
699
699
  let id_10: string;
700
700
  export { id_10 as id };
701
701
  export namespace queueConfig_10 {
@@ -735,7 +735,7 @@ declare namespace BASE_BULLMQ_CONFIG {
735
735
  }
736
736
  export { workerConfig_10 as workerConfig };
737
737
  }
738
- namespace SARVAM_TRANSCRIPTION_QUEUE {
738
+ namespace CONTENT_ELASTIC_SYNC_QUEUE {
739
739
  let id_11: string;
740
740
  export { id_11 as id };
741
741
  export namespace queueConfig_11 {
@@ -775,7 +775,7 @@ declare namespace BASE_BULLMQ_CONFIG {
775
775
  }
776
776
  export { workerConfig_11 as workerConfig };
777
777
  }
778
- namespace INTERCOM_CONVERSATIONS_QUEUE {
778
+ namespace SARVAM_TRANSCRIPTION_QUEUE {
779
779
  let id_12: string;
780
780
  export { id_12 as id };
781
781
  export namespace queueConfig_12 {
@@ -815,7 +815,7 @@ declare namespace BASE_BULLMQ_CONFIG {
815
815
  }
816
816
  export { workerConfig_12 as workerConfig };
817
817
  }
818
- namespace TAG_SYNC_PLAN_QUEUE {
818
+ namespace INTERCOM_CONVERSATIONS_QUEUE {
819
819
  let id_13: string;
820
820
  export { id_13 as id };
821
821
  export namespace queueConfig_13 {
@@ -855,7 +855,7 @@ declare namespace BASE_BULLMQ_CONFIG {
855
855
  }
856
856
  export { workerConfig_13 as workerConfig };
857
857
  }
858
- namespace TAG_SYNC_BATCH_QUEUE {
858
+ namespace TAG_SYNC_PLAN_QUEUE {
859
859
  let id_14: string;
860
860
  export { id_14 as id };
861
861
  export namespace queueConfig_14 {
@@ -895,11 +895,13 @@ declare namespace BASE_BULLMQ_CONFIG {
895
895
  }
896
896
  export { workerConfig_14 as workerConfig };
897
897
  }
898
- namespace SCHEDULED_EXTERNAL_SYNC_QUEUE {
898
+ namespace TAG_SYNC_BATCH_QUEUE {
899
899
  let id_15: string;
900
900
  export { id_15 as id };
901
901
  export namespace queueConfig_15 {
902
902
  export namespace defaultJobOptions_15 {
903
+ let attempts_15: number;
904
+ export { attempts_15 as attempts };
903
905
  export namespace backoff_15 {
904
906
  let type_15: string;
905
907
  export { type_15 as type };
@@ -907,8 +909,6 @@ declare namespace BASE_BULLMQ_CONFIG {
907
909
  export { delay_15 as delay };
908
910
  }
909
911
  export { backoff_15 as backoff };
910
- let attempts_15: number;
911
- export { attempts_15 as attempts };
912
912
  let removeOnComplete_15: number;
913
913
  export { removeOnComplete_15 as removeOnComplete };
914
914
  let removeOnFail_15: number;
@@ -935,13 +935,11 @@ declare namespace BASE_BULLMQ_CONFIG {
935
935
  }
936
936
  export { workerConfig_15 as workerConfig };
937
937
  }
938
- namespace REINDEX_QUEUE {
938
+ namespace SCHEDULED_EXTERNAL_SYNC_QUEUE {
939
939
  let id_16: string;
940
940
  export { id_16 as id };
941
941
  export namespace queueConfig_16 {
942
942
  export namespace defaultJobOptions_16 {
943
- let attempts_16: number;
944
- export { attempts_16 as attempts };
945
943
  export namespace backoff_16 {
946
944
  let type_16: string;
947
945
  export { type_16 as type };
@@ -949,8 +947,8 @@ declare namespace BASE_BULLMQ_CONFIG {
949
947
  export { delay_16 as delay };
950
948
  }
951
949
  export { backoff_16 as backoff };
952
- let delay_17: number;
953
- export { delay_17 as delay };
950
+ let attempts_16: number;
951
+ export { attempts_16 as attempts };
954
952
  let removeOnComplete_16: number;
955
953
  export { removeOnComplete_16 as removeOnComplete };
956
954
  let removeOnFail_16: number;
@@ -977,6 +975,48 @@ declare namespace BASE_BULLMQ_CONFIG {
977
975
  }
978
976
  export { workerConfig_16 as workerConfig };
979
977
  }
978
+ namespace REINDEX_QUEUE {
979
+ let id_17: string;
980
+ export { id_17 as id };
981
+ export namespace queueConfig_17 {
982
+ export namespace defaultJobOptions_17 {
983
+ let attempts_17: number;
984
+ export { attempts_17 as attempts };
985
+ export namespace backoff_17 {
986
+ let type_17: string;
987
+ export { type_17 as type };
988
+ let delay_17: number;
989
+ export { delay_17 as delay };
990
+ }
991
+ export { backoff_17 as backoff };
992
+ let delay_18: number;
993
+ export { delay_18 as delay };
994
+ let removeOnComplete_17: number;
995
+ export { removeOnComplete_17 as removeOnComplete };
996
+ let removeOnFail_17: number;
997
+ export { removeOnFail_17 as removeOnFail };
998
+ }
999
+ export { defaultJobOptions_17 as defaultJobOptions };
1000
+ export namespace streams_17 {
1001
+ export namespace events_17 {
1002
+ let maxLen_17: number;
1003
+ export { maxLen_17 as maxLen };
1004
+ }
1005
+ export { events_17 as events };
1006
+ }
1007
+ export { streams_17 as streams };
1008
+ }
1009
+ export { queueConfig_17 as queueConfig };
1010
+ export namespace workerConfig_17 {
1011
+ let concurrency_17: number;
1012
+ export { concurrency_17 as concurrency };
1013
+ let lockDuration_17: number;
1014
+ export { lockDuration_17 as lockDuration };
1015
+ let maxStalledCount_17: number;
1016
+ export { maxStalledCount_17 as maxStalledCount };
1017
+ }
1018
+ export { workerConfig_17 as workerConfig };
1019
+ }
980
1020
  }
981
1021
 
982
1022
  interface PlatformContextContentItem {
@@ -2748,6 +2788,29 @@ declare class AnnosElasticSyncProducer extends BaseProducer {
2748
2788
  addJobWithName(jobData: Object): Promise<Object>;
2749
2789
  }
2750
2790
 
2791
+ declare class ContentElasticSyncProducer extends BaseProducer {
2792
+ static addJobsAndClose(params: any): Promise<{
2793
+ jobCount: number;
2794
+ jobIds: (string | undefined)[];
2795
+ }>;
2796
+ static removeJobsAndClose(jobIds: any, env: any): Promise<{
2797
+ removed: number;
2798
+ results: any[];
2799
+ }>;
2800
+ constructor(options?: {});
2801
+ env: any;
2802
+ addJobs({ documents, tenant, contentType, operationType, sourceMetadata }: {
2803
+ documents: any;
2804
+ tenant: any;
2805
+ contentType: any;
2806
+ operationType: any;
2807
+ sourceMetadata: any;
2808
+ }): Promise<{
2809
+ jobCount: number;
2810
+ jobIds: (string | undefined)[];
2811
+ }>;
2812
+ }
2813
+
2751
2814
  /**
2752
2815
  * Creates BullMQ configuration with explicit dependencies
2753
2816
  * @param {Object} params Configuration parameters
@@ -2767,4 +2830,4 @@ declare function GET_GLOBAL_BULLMQ_CONFIG({ env, redisCredentials }: {
2767
2830
  };
2768
2831
  }): Object;
2769
2832
 
2770
- export { AIChatSchema, AnnosElasticSyncProducer, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseFlowProducer, BaseProducer, BaseWorker, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ChunksElasticSyncProducer, ELASTIC_MAPPING_PRESETS, ElasticSearchConnector, FILTER_IDS, GET_GLOBAL_BULLMQ_CONFIG, GeneratedEntitiesSchema, GeneratedTopicsSchema, MONGO_SCHEMA_PRESETS, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, SecretManagerConnector, TEMP_removeDuplicateFilters, TplSchema, UI_CONTENT, WorkerManager, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, collectMarkIdsInOrder, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getAIChatModelByTenant, getAnnoFilterBucketKey, getAnnotationsModelByTenant, getDbByTenant, getFilterKeyForBlock, getGeneratedEntitiesModelByTenant, getGeneratedTopicsModelByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getTplModelByTenant, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
2833
+ 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, TplSchema, UI_CONTENT, WorkerManager, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, collectMarkIdsInOrder, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getAIChatModelByTenant, getAnnoFilterBucketKey, getAnnotationsModelByTenant, getDbByTenant, getFilterKeyForBlock, getGeneratedEntitiesModelByTenant, getGeneratedTopicsModelByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getTplModelByTenant, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
package/dist/node.d.ts CHANGED
@@ -495,7 +495,7 @@ declare namespace BASE_BULLMQ_CONFIG {
495
495
  }
496
496
  export { workerConfig_4 as workerConfig };
497
497
  }
498
- namespace AI_AUTO_ANNOTATE_QUEUE {
498
+ namespace AI_AUTO_ANNOTATE_PREP_QUEUE {
499
499
  let id_5: string;
500
500
  export { id_5 as id };
501
501
  export namespace queueConfig_5 {
@@ -535,7 +535,7 @@ declare namespace BASE_BULLMQ_CONFIG {
535
535
  }
536
536
  export { workerConfig_5 as workerConfig };
537
537
  }
538
- namespace AI_AUTO_ANNOTATE_CHUNK_QUEUE {
538
+ namespace AI_AUTO_ANNOTATE_QUEUE {
539
539
  let id_6: string;
540
540
  export { id_6 as id };
541
541
  export namespace queueConfig_6 {
@@ -575,7 +575,7 @@ declare namespace BASE_BULLMQ_CONFIG {
575
575
  }
576
576
  export { workerConfig_6 as workerConfig };
577
577
  }
578
- namespace ANNOS_ELASTIC_SYNC_QUEUE {
578
+ namespace AI_AUTO_ANNOTATE_CHUNK_QUEUE {
579
579
  let id_7: string;
580
580
  export { id_7 as id };
581
581
  export namespace queueConfig_7 {
@@ -615,7 +615,7 @@ declare namespace BASE_BULLMQ_CONFIG {
615
615
  }
616
616
  export { workerConfig_7 as workerConfig };
617
617
  }
618
- namespace CHUNKS_ELASTIC_SYNC_QUEUE {
618
+ namespace ANNOS_ELASTIC_SYNC_QUEUE {
619
619
  let id_8: string;
620
620
  export { id_8 as id };
621
621
  export namespace queueConfig_8 {
@@ -655,7 +655,7 @@ declare namespace BASE_BULLMQ_CONFIG {
655
655
  }
656
656
  export { workerConfig_8 as workerConfig };
657
657
  }
658
- namespace USERS_ELASTIC_SYNC_QUEUE {
658
+ namespace CHUNKS_ELASTIC_SYNC_QUEUE {
659
659
  let id_9: string;
660
660
  export { id_9 as id };
661
661
  export namespace queueConfig_9 {
@@ -695,7 +695,7 @@ declare namespace BASE_BULLMQ_CONFIG {
695
695
  }
696
696
  export { workerConfig_9 as workerConfig };
697
697
  }
698
- namespace CONTENT_ELASTIC_SYNC_QUEUE {
698
+ namespace USERS_ELASTIC_SYNC_QUEUE {
699
699
  let id_10: string;
700
700
  export { id_10 as id };
701
701
  export namespace queueConfig_10 {
@@ -735,7 +735,7 @@ declare namespace BASE_BULLMQ_CONFIG {
735
735
  }
736
736
  export { workerConfig_10 as workerConfig };
737
737
  }
738
- namespace SARVAM_TRANSCRIPTION_QUEUE {
738
+ namespace CONTENT_ELASTIC_SYNC_QUEUE {
739
739
  let id_11: string;
740
740
  export { id_11 as id };
741
741
  export namespace queueConfig_11 {
@@ -775,7 +775,7 @@ declare namespace BASE_BULLMQ_CONFIG {
775
775
  }
776
776
  export { workerConfig_11 as workerConfig };
777
777
  }
778
- namespace INTERCOM_CONVERSATIONS_QUEUE {
778
+ namespace SARVAM_TRANSCRIPTION_QUEUE {
779
779
  let id_12: string;
780
780
  export { id_12 as id };
781
781
  export namespace queueConfig_12 {
@@ -815,7 +815,7 @@ declare namespace BASE_BULLMQ_CONFIG {
815
815
  }
816
816
  export { workerConfig_12 as workerConfig };
817
817
  }
818
- namespace TAG_SYNC_PLAN_QUEUE {
818
+ namespace INTERCOM_CONVERSATIONS_QUEUE {
819
819
  let id_13: string;
820
820
  export { id_13 as id };
821
821
  export namespace queueConfig_13 {
@@ -855,7 +855,7 @@ declare namespace BASE_BULLMQ_CONFIG {
855
855
  }
856
856
  export { workerConfig_13 as workerConfig };
857
857
  }
858
- namespace TAG_SYNC_BATCH_QUEUE {
858
+ namespace TAG_SYNC_PLAN_QUEUE {
859
859
  let id_14: string;
860
860
  export { id_14 as id };
861
861
  export namespace queueConfig_14 {
@@ -895,11 +895,13 @@ declare namespace BASE_BULLMQ_CONFIG {
895
895
  }
896
896
  export { workerConfig_14 as workerConfig };
897
897
  }
898
- namespace SCHEDULED_EXTERNAL_SYNC_QUEUE {
898
+ namespace TAG_SYNC_BATCH_QUEUE {
899
899
  let id_15: string;
900
900
  export { id_15 as id };
901
901
  export namespace queueConfig_15 {
902
902
  export namespace defaultJobOptions_15 {
903
+ let attempts_15: number;
904
+ export { attempts_15 as attempts };
903
905
  export namespace backoff_15 {
904
906
  let type_15: string;
905
907
  export { type_15 as type };
@@ -907,8 +909,6 @@ declare namespace BASE_BULLMQ_CONFIG {
907
909
  export { delay_15 as delay };
908
910
  }
909
911
  export { backoff_15 as backoff };
910
- let attempts_15: number;
911
- export { attempts_15 as attempts };
912
912
  let removeOnComplete_15: number;
913
913
  export { removeOnComplete_15 as removeOnComplete };
914
914
  let removeOnFail_15: number;
@@ -935,13 +935,11 @@ declare namespace BASE_BULLMQ_CONFIG {
935
935
  }
936
936
  export { workerConfig_15 as workerConfig };
937
937
  }
938
- namespace REINDEX_QUEUE {
938
+ namespace SCHEDULED_EXTERNAL_SYNC_QUEUE {
939
939
  let id_16: string;
940
940
  export { id_16 as id };
941
941
  export namespace queueConfig_16 {
942
942
  export namespace defaultJobOptions_16 {
943
- let attempts_16: number;
944
- export { attempts_16 as attempts };
945
943
  export namespace backoff_16 {
946
944
  let type_16: string;
947
945
  export { type_16 as type };
@@ -949,8 +947,8 @@ declare namespace BASE_BULLMQ_CONFIG {
949
947
  export { delay_16 as delay };
950
948
  }
951
949
  export { backoff_16 as backoff };
952
- let delay_17: number;
953
- export { delay_17 as delay };
950
+ let attempts_16: number;
951
+ export { attempts_16 as attempts };
954
952
  let removeOnComplete_16: number;
955
953
  export { removeOnComplete_16 as removeOnComplete };
956
954
  let removeOnFail_16: number;
@@ -977,6 +975,48 @@ declare namespace BASE_BULLMQ_CONFIG {
977
975
  }
978
976
  export { workerConfig_16 as workerConfig };
979
977
  }
978
+ namespace REINDEX_QUEUE {
979
+ let id_17: string;
980
+ export { id_17 as id };
981
+ export namespace queueConfig_17 {
982
+ export namespace defaultJobOptions_17 {
983
+ let attempts_17: number;
984
+ export { attempts_17 as attempts };
985
+ export namespace backoff_17 {
986
+ let type_17: string;
987
+ export { type_17 as type };
988
+ let delay_17: number;
989
+ export { delay_17 as delay };
990
+ }
991
+ export { backoff_17 as backoff };
992
+ let delay_18: number;
993
+ export { delay_18 as delay };
994
+ let removeOnComplete_17: number;
995
+ export { removeOnComplete_17 as removeOnComplete };
996
+ let removeOnFail_17: number;
997
+ export { removeOnFail_17 as removeOnFail };
998
+ }
999
+ export { defaultJobOptions_17 as defaultJobOptions };
1000
+ export namespace streams_17 {
1001
+ export namespace events_17 {
1002
+ let maxLen_17: number;
1003
+ export { maxLen_17 as maxLen };
1004
+ }
1005
+ export { events_17 as events };
1006
+ }
1007
+ export { streams_17 as streams };
1008
+ }
1009
+ export { queueConfig_17 as queueConfig };
1010
+ export namespace workerConfig_17 {
1011
+ let concurrency_17: number;
1012
+ export { concurrency_17 as concurrency };
1013
+ let lockDuration_17: number;
1014
+ export { lockDuration_17 as lockDuration };
1015
+ let maxStalledCount_17: number;
1016
+ export { maxStalledCount_17 as maxStalledCount };
1017
+ }
1018
+ export { workerConfig_17 as workerConfig };
1019
+ }
980
1020
  }
981
1021
 
982
1022
  interface PlatformContextContentItem {
@@ -2748,6 +2788,29 @@ declare class AnnosElasticSyncProducer extends BaseProducer {
2748
2788
  addJobWithName(jobData: Object): Promise<Object>;
2749
2789
  }
2750
2790
 
2791
+ declare class ContentElasticSyncProducer extends BaseProducer {
2792
+ static addJobsAndClose(params: any): Promise<{
2793
+ jobCount: number;
2794
+ jobIds: (string | undefined)[];
2795
+ }>;
2796
+ static removeJobsAndClose(jobIds: any, env: any): Promise<{
2797
+ removed: number;
2798
+ results: any[];
2799
+ }>;
2800
+ constructor(options?: {});
2801
+ env: any;
2802
+ addJobs({ documents, tenant, contentType, operationType, sourceMetadata }: {
2803
+ documents: any;
2804
+ tenant: any;
2805
+ contentType: any;
2806
+ operationType: any;
2807
+ sourceMetadata: any;
2808
+ }): Promise<{
2809
+ jobCount: number;
2810
+ jobIds: (string | undefined)[];
2811
+ }>;
2812
+ }
2813
+
2751
2814
  /**
2752
2815
  * Creates BullMQ configuration with explicit dependencies
2753
2816
  * @param {Object} params Configuration parameters
@@ -2767,4 +2830,4 @@ declare function GET_GLOBAL_BULLMQ_CONFIG({ env, redisCredentials }: {
2767
2830
  };
2768
2831
  }): Object;
2769
2832
 
2770
- export { AIChatSchema, AnnosElasticSyncProducer, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseFlowProducer, BaseProducer, BaseWorker, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ChunksElasticSyncProducer, ELASTIC_MAPPING_PRESETS, ElasticSearchConnector, FILTER_IDS, GET_GLOBAL_BULLMQ_CONFIG, GeneratedEntitiesSchema, GeneratedTopicsSchema, MONGO_SCHEMA_PRESETS, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, SecretManagerConnector, TEMP_removeDuplicateFilters, TplSchema, UI_CONTENT, WorkerManager, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, collectMarkIdsInOrder, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getAIChatModelByTenant, getAnnoFilterBucketKey, getAnnotationsModelByTenant, getDbByTenant, getFilterKeyForBlock, getGeneratedEntitiesModelByTenant, getGeneratedTopicsModelByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getTplModelByTenant, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
2833
+ 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, TplSchema, UI_CONTENT, WorkerManager, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, collectMarkIdsInOrder, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getAIChatModelByTenant, getAnnoFilterBucketKey, getAnnotationsModelByTenant, getDbByTenant, getFilterKeyForBlock, getGeneratedEntitiesModelByTenant, getGeneratedTopicsModelByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getTplModelByTenant, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
package/dist/node.js CHANGED
@@ -193,6 +193,58 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
193
193
  }
194
194
  }
195
195
  },
196
+ AI_AUTO_ANNOTATE_PREP_QUEUE: {
197
+ // PREP queue — the front of the per-doc Flow pipeline. The FE-facing
198
+ // /AIAutoAnnotate handler no longer fetches + summarizes + chunks +
199
+ // enqueues each doc inline (that serial, LLM-heavy loop blocked the HTTP
200
+ // request and risked App Engine clipping large batches mid-loop, silently
201
+ // dropping every doc past the cutoff). Instead the handler computes the
202
+ // batch-level prereqs ONCE (7th criterion + platform-derived categories)
203
+ // and enqueues one PREP job per doc here, then returns fast.
204
+ //
205
+ // Each prep job's worker (okf-sub) calls okf-be /internal/prepDoc, which
206
+ // does the per-doc work: fetch → summarizeDocument (warms the doc-level
207
+ // summary cache) → chunk fields → enqueue that doc's Flow (parent on
208
+ // AI_AUTO_ANNOTATE_QUEUE + one child per chunk on the CHUNK queue). So the
209
+ // Flow parents now get created rolling, as each prep job completes, rather
210
+ // than all up-front in the request. A prep failure isolates to its one doc
211
+ // (that doc is skipped); sibling prep jobs keep going.
212
+ id: "ai-auto-annotate-prep-queue",
213
+ queueConfig: {
214
+ defaultJobOptions: {
215
+ // attempts:1 — a retry would re-summarize (cache-HIT, cheap) but then
216
+ // re-enqueue the doc's Flow, double-annotating the doc. The rest of
217
+ // the per-doc Flow pipeline is attempts:1 for the same fail-loud
218
+ // reason (a retry just re-fires expensive LLM work).
219
+ attempts: 1,
220
+ backoff: {
221
+ type: "exponential",
222
+ delay: 5e3
223
+ },
224
+ removeOnComplete: 30,
225
+ removeOnFail: 100
226
+ },
227
+ streams: {
228
+ events: {
229
+ maxLen: 10
230
+ }
231
+ }
232
+ },
233
+ workerConfig: {
234
+ // Each prep job = one Mongo doc fetch + ONE summarize LLM call + a
235
+ // deterministic chunk + a Flow enqueue. It's lighter than a chunk job
236
+ // (which does ~4 LLM calls), so we can run more in parallel — 10 keeps
237
+ // prep comfortably AHEAD of the downstream chunk queue (concurrency 5),
238
+ // which is the real throughput cap. Going much higher than that buys
239
+ // little: prep would just drain faster into a chunk queue that still
240
+ // processes 5 at a time, while adding concurrent okf-be /internal/prepDoc
241
+ // load + concurrent summarize calls against the shared OpenAI TPM budget.
242
+ concurrency: 10,
243
+ lockDuration: 3e5,
244
+ // 5 min — generous ceiling over the 180s summarizer timeout
245
+ maxStalledCount: 1
246
+ }
247
+ },
196
248
  AI_AUTO_ANNOTATE_QUEUE: {
197
249
  // PARENT queue in the per-doc Flow. One job per doc; child jobs (one
198
250
  // per chunk) live on AI_AUTO_ANNOTATE_CHUNK_QUEUE. BullMQ Flow fires
@@ -2228,6 +2280,91 @@ var require_AnnosElasticSyncProducer = __commonJS({
2228
2280
  }
2229
2281
  });
2230
2282
 
2283
+ // src/bullmq/ContentElasticSyncProducer.js
2284
+ var require_ContentElasticSyncProducer = __commonJS({
2285
+ "src/bullmq/ContentElasticSyncProducer.js"(exports2, module2) {
2286
+ "use strict";
2287
+ var { BaseProducer: BaseProducer2 } = require_BaseProducer();
2288
+ var { GET_GLOBAL_BULLMQ_CONFIG: GET_GLOBAL_BULLMQ_CONFIG2 } = require_GET_GLOBAL_BULLMQ_CONFIG();
2289
+ var { SecretManagerConnector: SecretManagerConnector2 } = (init_SecretManagerConnector(), __toCommonJS(SecretManagerConnector_exports));
2290
+ var ContentElasticSyncProducer2 = class _ContentElasticSyncProducer extends BaseProducer2 {
2291
+ // Preserve class name through minification for ProducerManager lookup
2292
+ static get name() {
2293
+ return "ContentElasticSyncProducer";
2294
+ }
2295
+ // env is OPTIONAL — cross-env routing: jobs land in the target env's Redis
2296
+ // so that env's deployed workers pick them up (see okf-be
2297
+ // CreateChunksProducer for the rationale and the localhost `_local_<user>`
2298
+ // queue-id quirk).
2299
+ constructor(options = {}) {
2300
+ const env = options.env || process.env.ENV;
2301
+ const c = SecretManagerConnector2.getEnvSpecificConfigs(env);
2302
+ const redisCredentials = options.redisCredentials || {
2303
+ REDIS_HOST: c.REDIS_HOST,
2304
+ REDIS_PORT: c.REDIS_PORT,
2305
+ REDIS_PASSWORD: c.REDIS_PASSWORD
2306
+ };
2307
+ const GLOBAL_BULLMQ_CONFIG = GET_GLOBAL_BULLMQ_CONFIG2({
2308
+ env,
2309
+ redisCredentials
2310
+ });
2311
+ super(GLOBAL_BULLMQ_CONFIG.CONTENT_ELASTIC_SYNC_QUEUE);
2312
+ this.env = env;
2313
+ }
2314
+ async addJobs({ documents, tenant, contentType, operationType, sourceMetadata }) {
2315
+ if (!documents || documents.length === 0 || contentType === "staticPages") {
2316
+ return { jobCount: 0, jobIds: [] };
2317
+ }
2318
+ const batchSize = 200;
2319
+ let jobs = [];
2320
+ for (let i = 0; i < documents.length; i += batchSize) {
2321
+ const batch = documents.slice(i, i + batchSize);
2322
+ jobs.push({
2323
+ name: "processContentElasticSync",
2324
+ data: {
2325
+ docIds: batch.map((doc) => doc._id),
2326
+ tenant,
2327
+ env: this.env,
2328
+ contentType,
2329
+ operationType,
2330
+ sourceMetadata: {
2331
+ ...sourceMetadata,
2332
+ contentId: batch.map((d) => d._id)
2333
+ }
2334
+ }
2335
+ });
2336
+ }
2337
+ const addedJobs = await this.addBulkJobs(jobs);
2338
+ const jobIds = addedJobs.map((job) => job.id);
2339
+ console.log(`\u{1F4E6} Added ${addedJobs.length} jobs for ${contentType} contents sync atomically`);
2340
+ return {
2341
+ jobCount: addedJobs.length,
2342
+ jobIds
2343
+ };
2344
+ }
2345
+ static async addJobsAndClose(params) {
2346
+ const producer = new _ContentElasticSyncProducer({ env: params?.env });
2347
+ try {
2348
+ return await producer.addJobs(params);
2349
+ } finally {
2350
+ await producer.stop();
2351
+ }
2352
+ }
2353
+ static async removeJobsAndClose(jobIds, env) {
2354
+ const producer = new _ContentElasticSyncProducer({ env });
2355
+ try {
2356
+ return await producer.removeJobs(jobIds);
2357
+ } finally {
2358
+ await producer.stop();
2359
+ }
2360
+ }
2361
+ };
2362
+ module2.exports = {
2363
+ ContentElasticSyncProducer: ContentElasticSyncProducer2
2364
+ };
2365
+ }
2366
+ });
2367
+
2231
2368
  // src/node.ts
2232
2369
  var node_exports = {};
2233
2370
  __export(node_exports, {
@@ -2241,6 +2378,7 @@ __export(node_exports, {
2241
2378
  BlockRegistry: () => BlockRegistry,
2242
2379
  CHUNKING_PRESETS: () => CHUNKING_PRESETS,
2243
2380
  ChunksElasticSyncProducer: () => import_ChunksElasticSyncProducer.ChunksElasticSyncProducer,
2381
+ ContentElasticSyncProducer: () => import_ContentElasticSyncProducer.ContentElasticSyncProducer,
2244
2382
  ELASTIC_MAPPING_PRESETS: () => ELASTIC_MAPPING_PRESETS,
2245
2383
  ElasticSearchConnector: () => import_ElasticSearchConnector.ElasticSearchConnector,
2246
2384
  FILTER_IDS: () => FILTER_IDS,
@@ -4963,6 +5101,7 @@ var import_BaseFlowProducer = __toESM(require_BaseFlowProducer());
4963
5101
  var import_BaseWorker = __toESM(require_BaseWorker());
4964
5102
  var import_ChunksElasticSyncProducer = __toESM(require_ChunksElasticSyncProducer());
4965
5103
  var import_AnnosElasticSyncProducer = __toESM(require_AnnosElasticSyncProducer());
5104
+ var import_ContentElasticSyncProducer = __toESM(require_ContentElasticSyncProducer());
4966
5105
  var import_GET_GLOBAL_BULLMQ_CONFIG = __toESM(require_GET_GLOBAL_BULLMQ_CONFIG());
4967
5106
  // Annotate the CommonJS export names for ESM import in node:
4968
5107
  0 && (module.exports = {
@@ -4976,6 +5115,7 @@ var import_GET_GLOBAL_BULLMQ_CONFIG = __toESM(require_GET_GLOBAL_BULLMQ_CONFIG()
4976
5115
  BlockRegistry,
4977
5116
  CHUNKING_PRESETS,
4978
5117
  ChunksElasticSyncProducer,
5118
+ ContentElasticSyncProducer,
4979
5119
  ELASTIC_MAPPING_PRESETS,
4980
5120
  ElasticSearchConnector,
4981
5121
  FILTER_IDS,