@okf/ootils 1.22.0 → 1.23.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.ts CHANGED
@@ -803,6 +803,348 @@ declare const getRoutePathToModerateContent: ({ contentType, contentId, SELF_MAN
803
803
  };
804
804
  }) => string;
805
805
 
806
+ declare const buildFilterConfigurations: ({ groups, type, selectedTpls, allTpls, isRollup, isAnno }: {
807
+ groups: any[];
808
+ type: string;
809
+ selectedTpls: any[];
810
+ allTpls: any[];
811
+ isRollup?: boolean;
812
+ isAnno?: boolean;
813
+ }) => {
814
+ sectionId: string;
815
+ sectionTitle: string;
816
+ sectionSubtitle: string;
817
+ configs: any;
818
+ }[];
819
+
820
+ declare const compareAndGroupBlocks: (blocksPerTpl: any[]) => any[];
821
+
822
+ declare const extractAndOrganizeBlocks: (selectedTpls: any[], allTpls: any[]) => any;
823
+
824
+ declare const processAuthorAndCommonFilters: (allTpls: any[], filterScopes: string[], annoEnabledBlocks?: any[]) => {
825
+ authorTagConfigs: {
826
+ filterId: string;
827
+ blockId: string;
828
+ display: string;
829
+ value: any;
830
+ filterKey: string | undefined;
831
+ source: {
832
+ filterType: string;
833
+ tagType: any;
834
+ scope: string;
835
+ };
836
+ target: {
837
+ filterType: string;
838
+ tagType: any;
839
+ rollupResourceTypes: any;
840
+ relationshipValuePath: string;
841
+ };
842
+ }[];
843
+ commonAnnotationFilters: {
844
+ sectionId: string;
845
+ sectionTitle: string;
846
+ configs: ({
847
+ filterId: string;
848
+ blockId: string;
849
+ display: string;
850
+ value: string;
851
+ filterKey: string | undefined;
852
+ source: {
853
+ filterType: string;
854
+ profileTypes: any[];
855
+ options?: undefined;
856
+ };
857
+ target: {
858
+ filterType: string;
859
+ valuePath: string;
860
+ };
861
+ } | {
862
+ filterId: string;
863
+ blockId: string;
864
+ display: string;
865
+ value: string;
866
+ filterKey: string | undefined;
867
+ source: {
868
+ filterType: string;
869
+ options: {
870
+ display: any;
871
+ value: any;
872
+ }[];
873
+ profileTypes?: undefined;
874
+ };
875
+ target: {
876
+ filterType: string;
877
+ valuePath: string;
878
+ };
879
+ })[];
880
+ }[];
881
+ commonDocumentFilters: {
882
+ sectionId: string;
883
+ sectionTitle: string;
884
+ configs: ({
885
+ filterId: string;
886
+ blockId: string;
887
+ display: string;
888
+ value: any;
889
+ filterKey: string | undefined;
890
+ source: {
891
+ filterType: string;
892
+ tagType: any;
893
+ scope: string;
894
+ };
895
+ target: {
896
+ filterType: string;
897
+ tagType: any;
898
+ rollupResourceTypes: any;
899
+ relationshipValuePath: string;
900
+ };
901
+ } | {
902
+ filterId: string;
903
+ blockId: string;
904
+ display: string;
905
+ value: string;
906
+ filterKey: string | undefined;
907
+ source: {
908
+ filterType: string;
909
+ profileTypes: any[];
910
+ scope: string;
911
+ };
912
+ target: {
913
+ filterType: string;
914
+ valuePath: string;
915
+ };
916
+ } | {
917
+ filterId: string;
918
+ blockId: string;
919
+ display: string;
920
+ value: string;
921
+ filterKey: string | undefined;
922
+ source: {
923
+ filterType: string;
924
+ profileTypes?: undefined;
925
+ scope?: undefined;
926
+ };
927
+ target: {
928
+ filterType: string;
929
+ valuePath: string;
930
+ };
931
+ })[];
932
+ }[];
933
+ };
934
+
935
+ declare const _self_managed_getFixedAnnoTagBlock: (selectedTpls: any[], annotationTagsCount: any) => any[];
936
+
937
+ declare const _self_managed_getFixedAnnoRollupBlocks: ({ selectedTpls, allTpls, annotationTagsCount }: {
938
+ selectedTpls: any[];
939
+ allTpls: any[];
940
+ annotationTagsCount: any;
941
+ }) => any[];
942
+
943
+ declare const FILTER_IDS: {
944
+ themes: string;
945
+ subThemes: string;
946
+ tags: string;
947
+ };
948
+ /**
949
+ * Builds the single annoHierarchyType config for self-managed tenants.
950
+ * Replaces separate Themes, SubThemes, Tags filters with one consolidated hierarchy UI.
951
+ *
952
+ * Themes -> SubThemes -> Tags
953
+ */
954
+ declare const _self_managed_buildAnnoHierarchyConfig: ({ annotationTagsCount, }: {
955
+ annotationTagsCount: any;
956
+ }) => {
957
+ target: {
958
+ filterType: string;
959
+ };
960
+ filterId: string;
961
+ display: string;
962
+ filterKey: string;
963
+ source: {
964
+ filterType: string;
965
+ annotationTagsCount: {
966
+ themes: boolean;
967
+ subThemes: boolean;
968
+ tags: boolean;
969
+ };
970
+ levelLabels: {
971
+ themes: string;
972
+ subThemes: string;
973
+ tags: string;
974
+ };
975
+ folderSelectionMode: string;
976
+ hierarchyLevels: (false | {
977
+ level: string;
978
+ filterId: string;
979
+ tagType: string;
980
+ })[];
981
+ };
982
+ } | null;
983
+
984
+ /**
985
+ * TEMP_removeDuplicateFilters - Removes duplicate rollup and tag-type filters
986
+ *
987
+ * THIS IS A TEMPORARY SOLUTION TO ADDRESS REPETITIVE FILTERS.
988
+ *
989
+ * KEEPS THE FIRST OCCURRENCE of each filter type and removes subsequent duplicates:
990
+ * - FOR ROLLUPS: Deduplicates based on final target (last element in rollupPath)
991
+ * - FOR TAG TYPES: Deduplicates based on tagType value
992
+ * - FOR OTHER FILTER TYPES: Passes through unchanged (no deduplication)
993
+ */
994
+ declare const TEMP_removeDuplicateFilters: (filterGroups: any[]) => any[];
995
+
996
+ declare const generateFilterKey: ({ filterType, scope, tagType, valuePath, rollupPath, tagTypeCollectionToRollup, valuePathInRolledUpCollection, relationshipValuePath, rollupResourceTypes, }?: {
997
+ filterType: string;
998
+ scope?: string;
999
+ tagType?: string;
1000
+ valuePath?: string;
1001
+ rollupPath?: string[];
1002
+ tagTypeCollectionToRollup?: string;
1003
+ valuePathInRolledUpCollection?: string;
1004
+ relationshipValuePath?: string;
1005
+ rollupResourceTypes?: string[];
1006
+ }) => string | undefined;
1007
+
1008
+ declare const getFilterKeyForBlock: ({ block, scope }?: {
1009
+ block?: any;
1010
+ scope?: string;
1011
+ }) => string | undefined;
1012
+
1013
+ /**
1014
+ * Automatically generates filter configurations from template structures.
1015
+ *
1016
+ * This is a pure function (no UI/React dependencies) that can be used on both
1017
+ * frontend and backend.
1018
+ *
1019
+ * BEHAVIOR:
1020
+ * - DEFAULT TENANTS: Dynamically discovers rollups from template structure
1021
+ * - SELF-MANAGED TENANTS: Uses predefined hierarchy with conditional filters
1022
+ */
1023
+ declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScopes, isSelfManagedTenant, annotationTagsCount, }: {
1024
+ selectedTpls: any[];
1025
+ allTpls: any[];
1026
+ filterScopes: string[];
1027
+ isSelfManagedTenant?: boolean;
1028
+ annotationTagsCount?: any;
1029
+ }) => ({
1030
+ sectionId: string;
1031
+ sectionTitle: string;
1032
+ configs: ({
1033
+ sectionId: string;
1034
+ sectionTitle: string;
1035
+ sectionSubtitle: string;
1036
+ configs: any;
1037
+ } | {
1038
+ sectionId: string;
1039
+ sectionTitle: string;
1040
+ configs: ({
1041
+ filterId: string;
1042
+ blockId: string;
1043
+ display: string;
1044
+ value: string;
1045
+ filterKey: string | undefined;
1046
+ source: {
1047
+ filterType: string;
1048
+ profileTypes: any[];
1049
+ options?: undefined;
1050
+ };
1051
+ target: {
1052
+ filterType: string;
1053
+ valuePath: string;
1054
+ };
1055
+ } | {
1056
+ filterId: string;
1057
+ blockId: string;
1058
+ display: string;
1059
+ value: string;
1060
+ filterKey: string | undefined;
1061
+ source: {
1062
+ filterType: string;
1063
+ options: {
1064
+ display: any;
1065
+ value: any;
1066
+ }[];
1067
+ profileTypes?: undefined;
1068
+ };
1069
+ target: {
1070
+ filterType: string;
1071
+ valuePath: string;
1072
+ };
1073
+ })[];
1074
+ })[] | {
1075
+ sectionId: string;
1076
+ configs: any[];
1077
+ }[];
1078
+ } | {
1079
+ sectionId: string;
1080
+ sectionTitle: string;
1081
+ configs: ({
1082
+ sectionId: string;
1083
+ sectionTitle: string;
1084
+ sectionSubtitle: string;
1085
+ configs: any;
1086
+ } | {
1087
+ sectionId: string;
1088
+ sectionTitle: string;
1089
+ configs: ({
1090
+ filterId: string;
1091
+ blockId: string;
1092
+ display: string;
1093
+ value: any;
1094
+ filterKey: string | undefined;
1095
+ source: {
1096
+ filterType: string;
1097
+ tagType: any;
1098
+ scope: string;
1099
+ };
1100
+ target: {
1101
+ filterType: string;
1102
+ tagType: any;
1103
+ rollupResourceTypes: any;
1104
+ relationshipValuePath: string;
1105
+ };
1106
+ } | {
1107
+ filterId: string;
1108
+ blockId: string;
1109
+ display: string;
1110
+ value: string;
1111
+ filterKey: string | undefined;
1112
+ source: {
1113
+ filterType: string;
1114
+ profileTypes: any[];
1115
+ scope: string;
1116
+ };
1117
+ target: {
1118
+ filterType: string;
1119
+ valuePath: string;
1120
+ };
1121
+ } | {
1122
+ filterId: string;
1123
+ blockId: string;
1124
+ display: string;
1125
+ value: string;
1126
+ filterKey: string | undefined;
1127
+ source: {
1128
+ filterType: string;
1129
+ profileTypes?: undefined;
1130
+ scope?: undefined;
1131
+ };
1132
+ target: {
1133
+ filterType: string;
1134
+ valuePath: string;
1135
+ };
1136
+ })[];
1137
+ })[];
1138
+ } | null)[];
1139
+
1140
+ declare const UI_CONTENT: {
1141
+ autoGenFilterConfigs: {
1142
+ annoTagsTitle: string;
1143
+ tagsTitle: string;
1144
+ tagsFilterTitle: string;
1145
+ };
1146
+ };
1147
+
806
1148
  declare class MongoConnector {
807
1149
  static getInstance(): any;
808
1150
  static getClusterConnections(): any;
@@ -1106,6 +1448,8 @@ interface IAIChat extends Document {
1106
1448
  lastActivity: Date;
1107
1449
  messages: IMessage[];
1108
1450
  ACLScope: "aiChat" | "reports";
1451
+ immutableActiveFilters?: any;
1452
+ immutableContentTypes?: string[];
1109
1453
  }
1110
1454
  declare const AIChatSchema: mongoose__default.Schema<IAIChat, mongoose__default.Model<IAIChat, any, any, any, mongoose__default.Document<unknown, any, IAIChat, any, {}> & IAIChat & Required<{
1111
1455
  _id: mongoose__default.Types.ObjectId;
@@ -1400,4 +1744,4 @@ declare function GET_GLOBAL_BULLMQ_CONFIG({ env, redisCredentials }: {
1400
1744
  };
1401
1745
  }): Object;
1402
1746
 
1403
- 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, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToPublishedContent, getTplModelByTenant, getVal, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
1747
+ export { AIChatSchema, AnnosElasticSyncProducer, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseProducer, BaseWorker, ChunksElasticSyncProducer, ElasticSearchConnector, FILTER_IDS, GET_GLOBAL_BULLMQ_CONFIG, GeneratedTopicsSchema, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, TEMP_removeDuplicateFilters, TplSchema, UI_CONTENT, WorkerManager, _self_managed_buildAnnoHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, buildFilterConfigurations, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genTagId, generateFilterKey, getAIChatModelByTenant, getAnnotationsModelByTenant, getDbByTenant, getFilterKeyForBlock, getGeneratedTopicsModelByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getPlatformContextContent, getRollupPossibilities, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToPublishedContent, getTplModelByTenant, getVal, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };