@okf/ootils 1.44.2 → 1.46.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/browser.mjs CHANGED
@@ -1145,6 +1145,43 @@ var BASE_BULLMQ_CONFIG = {
1145
1145
  maxStalledCount: 3
1146
1146
  }
1147
1147
  },
1148
+ /**
1149
+ * Collab-editing session-boundary side effects for CONTENT docs.
1150
+ * Enqueued by okf-sub's collab service when a field lock releases / the
1151
+ * last editor leaves a live doc; the worker calls okf-be's internal
1152
+ * contentDocCollabSessionSideEffects endpoint (tag-rename sync, chunks/annos
1153
+ * producers, Elastic sync, cache invalidations, analytics).
1154
+ * Queued (rather than fire-and-forget HTTP from the boundary) for retry
1155
+ * ability + Bullboard trackability — a failed boundary would otherwise be
1156
+ * silently lost when the doc unloads. Steps are idempotent except
1157
+ * analytics, which runs LAST so retries only duplicate it on a
1158
+ * lost-response network edge.
1159
+ */
1160
+ CONTENT_DOC_COLAB_SESH_SIDE_EFFECTS_QUEUE: {
1161
+ id: "content-doc-colab-sesh-side-effects-queue",
1162
+ queueConfig: {
1163
+ defaultJobOptions: {
1164
+ attempts: 3,
1165
+ backoff: {
1166
+ type: "exponential",
1167
+ delay: 5e3
1168
+ },
1169
+ removeOnComplete: 50,
1170
+ removeOnFail: 200
1171
+ },
1172
+ streams: {
1173
+ events: {
1174
+ maxLen: 1e3
1175
+ // SockerIOService QueueEvents tails this stream for progress tracking; trimming at 10 dropped completion events mid-burst (stuck FE tracker). Entries are small now that job returnvalues are trimmed, so 1000 is cheap.
1176
+ }
1177
+ }
1178
+ },
1179
+ workerConfig: {
1180
+ concurrency: 10,
1181
+ lockDuration: 9e4,
1182
+ maxStalledCount: 3
1183
+ }
1184
+ },
1148
1185
  SARVAM_TRANSCRIPTION_QUEUE: {
1149
1186
  id: "sarvam-transcription-queue",
1150
1187
  queueConfig: {
@@ -1421,6 +1458,10 @@ var mergeAnnoDataIntoAnnotationsTags = ({
1421
1458
  return newConsolidated;
1422
1459
  };
1423
1460
 
1461
+ // src/collab/isCollabEditableBlock.js
1462
+ var COLLAB_SYSTEM_PATH_REGEX = /(^|\.)kp_/;
1463
+ var isCollabEditableBlock = (block) => !!block?.valuePath && block.valuePath !== "." && !COLLAB_SYSTEM_PATH_REGEX.test(block.valuePath);
1464
+
1424
1465
  // src/utils/parseSpecialConfigSyntax.ts
1425
1466
  var parseSpecialConfigSyntax = ({
1426
1467
  config,
@@ -2211,6 +2252,24 @@ var processAuthorAndCommonFilters = (allTpls, filterScopes, annoEnabledBlocks =
2211
2252
  filterType: "dateRangeType",
2212
2253
  valuePath: "kp_date_published"
2213
2254
  }
2255
+ },
2256
+ // "Documents" filter — narrows results to specific chosen documents of the
2257
+ // datasets in view, matched on their own _id. Options list those datasets'
2258
+ // documents by title (documentsType fetch, which uses the ambient contentTypes);
2259
+ // the backend matches { _id: { $in: [ids] } } via target valuePath "_id"
2260
+ // (getValuePathQuery ObjectId-casts any `_id`-ending path).
2261
+ {
2262
+ filterId: "documentsFilter",
2263
+ blockId: "documentsFilter",
2264
+ display: "Documents",
2265
+ value: "documents",
2266
+ filterKey: generateFilterKey({
2267
+ filterType: "valuePathType",
2268
+ valuePath: "_id",
2269
+ scope: "doc"
2270
+ }),
2271
+ source: { filterType: "documentsType", scope: "tags" },
2272
+ target: { filterType: "valuePathType", valuePath: "_id" }
2214
2273
  }
2215
2274
  ]
2216
2275
  }] : [];
@@ -2571,12 +2630,19 @@ var _self_managed_buildDocHierarchyConfig = ({
2571
2630
  const t = allTpls.find((tp) => tp.kp_content_type === ct);
2572
2631
  if (t?.general?.content?.title) rollupDisplayMap[ct] = t.general.content.title;
2573
2632
  }
2633
+ const childByParentId = {};
2634
+ for (const r of rollupsWithParents) {
2635
+ if (r.parentFilterId && r.isTagRollup && r.source?.filterType === "tagType") {
2636
+ childByParentId[r.parentFilterId] = r;
2637
+ }
2638
+ }
2574
2639
  return {
2575
2640
  contentType: tpl.kp_content_type,
2576
2641
  display: tplData?.general?.content?.title || tpl.kp_content_type,
2577
2642
  filters: filtersWithParents,
2578
2643
  rollups: rollupsWithParents,
2579
- rollupDisplayMap
2644
+ rollupDisplayMap,
2645
+ childByParentId
2580
2646
  };
2581
2647
  });
2582
2648
  const filteredPerDataset = perDataset.filter(
@@ -2844,6 +2910,7 @@ export {
2844
2910
  BASE_BULLMQ_CONFIG,
2845
2911
  BlockRegistry,
2846
2912
  CHUNKING_PRESETS,
2913
+ COLLAB_SYSTEM_PATH_REGEX,
2847
2914
  ELASTIC_MAPPING_PRESETS,
2848
2915
  FILTER_IDS,
2849
2916
  MONGO_SCHEMA_PRESETS,
@@ -2877,6 +2944,7 @@ export {
2877
2944
  getRoutePathToTCI,
2878
2945
  getRoutePathToTagCategoryLanding,
2879
2946
  getVal,
2947
+ isCollabEditableBlock,
2880
2948
  isTplAnnotationEnabled,
2881
2949
  mergeAnnoDataIntoAnnotationsTags,
2882
2950
  parseSpecialConfigSyntax,
package/dist/node.d.mts CHANGED
@@ -775,7 +775,7 @@ declare namespace BASE_BULLMQ_CONFIG {
775
775
  }
776
776
  export { workerConfig_11 as workerConfig };
777
777
  }
778
- namespace SARVAM_TRANSCRIPTION_QUEUE {
778
+ namespace CONTENT_DOC_COLAB_SESH_SIDE_EFFECTS_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 INTERCOM_CONVERSATIONS_QUEUE {
818
+ namespace SARVAM_TRANSCRIPTION_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_PLAN_QUEUE {
858
+ namespace INTERCOM_CONVERSATIONS_QUEUE {
859
859
  let id_14: string;
860
860
  export { id_14 as id };
861
861
  export namespace queueConfig_14 {
@@ -895,7 +895,7 @@ declare namespace BASE_BULLMQ_CONFIG {
895
895
  }
896
896
  export { workerConfig_14 as workerConfig };
897
897
  }
898
- namespace TAG_SYNC_BATCH_QUEUE {
898
+ namespace TAG_SYNC_PLAN_QUEUE {
899
899
  let id_15: string;
900
900
  export { id_15 as id };
901
901
  export namespace queueConfig_15 {
@@ -935,11 +935,13 @@ declare namespace BASE_BULLMQ_CONFIG {
935
935
  }
936
936
  export { workerConfig_15 as workerConfig };
937
937
  }
938
- namespace SCHEDULED_EXTERNAL_SYNC_QUEUE {
938
+ namespace TAG_SYNC_BATCH_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 };
943
945
  export namespace backoff_16 {
944
946
  let type_16: string;
945
947
  export { type_16 as type };
@@ -947,8 +949,6 @@ declare namespace BASE_BULLMQ_CONFIG {
947
949
  export { delay_16 as delay };
948
950
  }
949
951
  export { backoff_16 as backoff };
950
- let attempts_16: number;
951
- export { attempts_16 as attempts };
952
952
  let removeOnComplete_16: number;
953
953
  export { removeOnComplete_16 as removeOnComplete };
954
954
  let removeOnFail_16: number;
@@ -975,13 +975,11 @@ declare namespace BASE_BULLMQ_CONFIG {
975
975
  }
976
976
  export { workerConfig_16 as workerConfig };
977
977
  }
978
- namespace REINDEX_QUEUE {
978
+ namespace SCHEDULED_EXTERNAL_SYNC_QUEUE {
979
979
  let id_17: string;
980
980
  export { id_17 as id };
981
981
  export namespace queueConfig_17 {
982
982
  export namespace defaultJobOptions_17 {
983
- let attempts_17: number;
984
- export { attempts_17 as attempts };
985
983
  export namespace backoff_17 {
986
984
  let type_17: string;
987
985
  export { type_17 as type };
@@ -989,8 +987,8 @@ declare namespace BASE_BULLMQ_CONFIG {
989
987
  export { delay_17 as delay };
990
988
  }
991
989
  export { backoff_17 as backoff };
992
- let delay_18: number;
993
- export { delay_18 as delay };
990
+ let attempts_17: number;
991
+ export { attempts_17 as attempts };
994
992
  let removeOnComplete_17: number;
995
993
  export { removeOnComplete_17 as removeOnComplete };
996
994
  let removeOnFail_17: number;
@@ -1017,6 +1015,48 @@ declare namespace BASE_BULLMQ_CONFIG {
1017
1015
  }
1018
1016
  export { workerConfig_17 as workerConfig };
1019
1017
  }
1018
+ namespace REINDEX_QUEUE {
1019
+ let id_18: string;
1020
+ export { id_18 as id };
1021
+ export namespace queueConfig_18 {
1022
+ export namespace defaultJobOptions_18 {
1023
+ let attempts_18: number;
1024
+ export { attempts_18 as attempts };
1025
+ export namespace backoff_18 {
1026
+ let type_18: string;
1027
+ export { type_18 as type };
1028
+ let delay_18: number;
1029
+ export { delay_18 as delay };
1030
+ }
1031
+ export { backoff_18 as backoff };
1032
+ let delay_19: number;
1033
+ export { delay_19 as delay };
1034
+ let removeOnComplete_18: number;
1035
+ export { removeOnComplete_18 as removeOnComplete };
1036
+ let removeOnFail_18: number;
1037
+ export { removeOnFail_18 as removeOnFail };
1038
+ }
1039
+ export { defaultJobOptions_18 as defaultJobOptions };
1040
+ export namespace streams_18 {
1041
+ export namespace events_18 {
1042
+ let maxLen_18: number;
1043
+ export { maxLen_18 as maxLen };
1044
+ }
1045
+ export { events_18 as events };
1046
+ }
1047
+ export { streams_18 as streams };
1048
+ }
1049
+ export { queueConfig_18 as queueConfig };
1050
+ export namespace workerConfig_18 {
1051
+ let concurrency_18: number;
1052
+ export { concurrency_18 as concurrency };
1053
+ let lockDuration_18: number;
1054
+ export { lockDuration_18 as lockDuration };
1055
+ let maxStalledCount_18: number;
1056
+ export { maxStalledCount_18 as maxStalledCount };
1057
+ }
1058
+ export { workerConfig_18 as workerConfig };
1059
+ }
1020
1060
  }
1021
1061
 
1022
1062
  interface PlatformContextContentItem {
@@ -1062,6 +1102,24 @@ interface MergeParams {
1062
1102
  */
1063
1103
  declare const mergeAnnoDataIntoAnnotationsTags: ({ prevObj, newLexValue, thisBlockValuePath, author, }: MergeParams) => any;
1064
1104
 
1105
+ /**
1106
+ * Is this tpl block a collab-editable field? ONE definition, used by BOTH
1107
+ * sides so they can never disagree:
1108
+ * - okf-sub loadContentDocument builds the server-side editable allowlist
1109
+ * from it (the flush drops writes outside that list)
1110
+ * - okf-fe ViewBlockGenerator derives per-block editability from it
1111
+ *
1112
+ * Editable = binds to a real content path. Exclusions:
1113
+ * - no valuePath (display-only blocks) / the odd "." valuePath some legacy
1114
+ * tpls carry (see getTypesForSchemaFromTpl, which skips it too)
1115
+ * - kp_-prefixed segments (publish status, lifecycle dates, author refs —
1116
+ * machinery, not content). NOTE: non-block system fields (lastActivity,
1117
+ * tagId...) are excluded by construction anyway — they're never tpl
1118
+ * blocks; this regex only guards block-defined kp_ paths.
1119
+ */
1120
+ declare const COLLAB_SYSTEM_PATH_REGEX: RegExp;
1121
+ declare function isCollabEditableBlock(block: any): boolean;
1122
+
1065
1123
  declare const parseSpecialConfigSyntax: ({ config, content, returnUndefinedIfReplacementWordNotFound }: {
1066
1124
  config: string | object;
1067
1125
  content: Record<string, any>;
@@ -1284,6 +1342,21 @@ declare const processAuthorAndCommonFilters: (allTpls: any[], filterScopes: stri
1284
1342
  filterType: string;
1285
1343
  valuePath: string;
1286
1344
  };
1345
+ } | {
1346
+ filterId: string;
1347
+ blockId: string;
1348
+ display: string;
1349
+ value: string;
1350
+ filterKey: string | undefined;
1351
+ source: {
1352
+ filterType: string;
1353
+ scope: string;
1354
+ profileTypes?: undefined;
1355
+ };
1356
+ target: {
1357
+ filterType: string;
1358
+ valuePath: string;
1359
+ };
1287
1360
  })[];
1288
1361
  }[];
1289
1362
  };
@@ -1413,6 +1486,7 @@ declare const _self_managed_buildDocHierarchyConfig: ({ combinedDocumentBlocks,
1413
1486
  filters: any[];
1414
1487
  rollups: any[];
1415
1488
  rollupDisplayMap: Record<string, string>;
1489
+ childByParentId: Record<string, any>;
1416
1490
  }[];
1417
1491
  };
1418
1492
  target: {
@@ -1573,6 +1647,7 @@ declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScope
1573
1647
  filters: any[];
1574
1648
  rollups: any[];
1575
1649
  rollupDisplayMap: Record<string, string>;
1650
+ childByParentId: Record<string, any>;
1576
1651
  }[];
1577
1652
  };
1578
1653
  target: {
@@ -1639,6 +1714,21 @@ declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScope
1639
1714
  filterType: string;
1640
1715
  valuePath: string;
1641
1716
  };
1717
+ } | {
1718
+ filterId: string;
1719
+ blockId: string;
1720
+ display: string;
1721
+ value: string;
1722
+ filterKey: string | undefined;
1723
+ source: {
1724
+ filterType: string;
1725
+ scope: string;
1726
+ profileTypes?: undefined;
1727
+ };
1728
+ target: {
1729
+ filterType: string;
1730
+ valuePath: string;
1731
+ };
1642
1732
  })[];
1643
1733
  })[];
1644
1734
  } | null)[];
@@ -9096,6 +9186,9 @@ declare class TenantRegistry {
9096
9186
  }
9097
9187
 
9098
9188
  declare const LIVE_COLLAB_DOC_REFRESH_MS: 120000;
9189
+ declare const LIVE_COLLAB_DEFER_MS: 120000;
9190
+ declare const LIVE_COLLAB_MAX_DEFERRALS: 30;
9191
+ declare const DOC_IN_LIVE_COLLAB_SESSION_ERROR: "aiApply_docInLiveCollabSession";
9099
9192
  declare function markLiveCollabDoc({ tenant, contentType, docId, env }: {
9100
9193
  tenant: any;
9101
9194
  contentType: any;
@@ -9385,4 +9478,4 @@ declare function GET_GLOBAL_BULLMQ_CONFIG({ env, redisCredentials }: {
9385
9478
  };
9386
9479
  }): Object;
9387
9480
 
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 };
9481
+ export { AIChatSchema, AnnosElasticSyncProducer, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseFlowProducer, BaseProducer, BaseWorker, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, COLLAB_SYSTEM_PATH_REGEX, ChunksElasticSyncProducer, ContentElasticSyncProducer, DOC_IN_LIVE_COLLAB_SESSION_ERROR, ELASTIC_MAPPING_PRESETS, ElasticSearchConnector, FILTER_IDS, GET_GLOBAL_BULLMQ_CONFIG, GeneratedEntitiesSchema, GeneratedTopicsSchema, LIVE_COLLAB_DEFER_MS, LIVE_COLLAB_DOC_REFRESH_MS, LIVE_COLLAB_MAX_DEFERRALS, 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, isCollabEditableBlock, isLiveCollabDoc, isTplAnnotationEnabled, markLiveCollabDoc, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
package/dist/node.d.ts CHANGED
@@ -775,7 +775,7 @@ declare namespace BASE_BULLMQ_CONFIG {
775
775
  }
776
776
  export { workerConfig_11 as workerConfig };
777
777
  }
778
- namespace SARVAM_TRANSCRIPTION_QUEUE {
778
+ namespace CONTENT_DOC_COLAB_SESH_SIDE_EFFECTS_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 INTERCOM_CONVERSATIONS_QUEUE {
818
+ namespace SARVAM_TRANSCRIPTION_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_PLAN_QUEUE {
858
+ namespace INTERCOM_CONVERSATIONS_QUEUE {
859
859
  let id_14: string;
860
860
  export { id_14 as id };
861
861
  export namespace queueConfig_14 {
@@ -895,7 +895,7 @@ declare namespace BASE_BULLMQ_CONFIG {
895
895
  }
896
896
  export { workerConfig_14 as workerConfig };
897
897
  }
898
- namespace TAG_SYNC_BATCH_QUEUE {
898
+ namespace TAG_SYNC_PLAN_QUEUE {
899
899
  let id_15: string;
900
900
  export { id_15 as id };
901
901
  export namespace queueConfig_15 {
@@ -935,11 +935,13 @@ declare namespace BASE_BULLMQ_CONFIG {
935
935
  }
936
936
  export { workerConfig_15 as workerConfig };
937
937
  }
938
- namespace SCHEDULED_EXTERNAL_SYNC_QUEUE {
938
+ namespace TAG_SYNC_BATCH_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 };
943
945
  export namespace backoff_16 {
944
946
  let type_16: string;
945
947
  export { type_16 as type };
@@ -947,8 +949,6 @@ declare namespace BASE_BULLMQ_CONFIG {
947
949
  export { delay_16 as delay };
948
950
  }
949
951
  export { backoff_16 as backoff };
950
- let attempts_16: number;
951
- export { attempts_16 as attempts };
952
952
  let removeOnComplete_16: number;
953
953
  export { removeOnComplete_16 as removeOnComplete };
954
954
  let removeOnFail_16: number;
@@ -975,13 +975,11 @@ declare namespace BASE_BULLMQ_CONFIG {
975
975
  }
976
976
  export { workerConfig_16 as workerConfig };
977
977
  }
978
- namespace REINDEX_QUEUE {
978
+ namespace SCHEDULED_EXTERNAL_SYNC_QUEUE {
979
979
  let id_17: string;
980
980
  export { id_17 as id };
981
981
  export namespace queueConfig_17 {
982
982
  export namespace defaultJobOptions_17 {
983
- let attempts_17: number;
984
- export { attempts_17 as attempts };
985
983
  export namespace backoff_17 {
986
984
  let type_17: string;
987
985
  export { type_17 as type };
@@ -989,8 +987,8 @@ declare namespace BASE_BULLMQ_CONFIG {
989
987
  export { delay_17 as delay };
990
988
  }
991
989
  export { backoff_17 as backoff };
992
- let delay_18: number;
993
- export { delay_18 as delay };
990
+ let attempts_17: number;
991
+ export { attempts_17 as attempts };
994
992
  let removeOnComplete_17: number;
995
993
  export { removeOnComplete_17 as removeOnComplete };
996
994
  let removeOnFail_17: number;
@@ -1017,6 +1015,48 @@ declare namespace BASE_BULLMQ_CONFIG {
1017
1015
  }
1018
1016
  export { workerConfig_17 as workerConfig };
1019
1017
  }
1018
+ namespace REINDEX_QUEUE {
1019
+ let id_18: string;
1020
+ export { id_18 as id };
1021
+ export namespace queueConfig_18 {
1022
+ export namespace defaultJobOptions_18 {
1023
+ let attempts_18: number;
1024
+ export { attempts_18 as attempts };
1025
+ export namespace backoff_18 {
1026
+ let type_18: string;
1027
+ export { type_18 as type };
1028
+ let delay_18: number;
1029
+ export { delay_18 as delay };
1030
+ }
1031
+ export { backoff_18 as backoff };
1032
+ let delay_19: number;
1033
+ export { delay_19 as delay };
1034
+ let removeOnComplete_18: number;
1035
+ export { removeOnComplete_18 as removeOnComplete };
1036
+ let removeOnFail_18: number;
1037
+ export { removeOnFail_18 as removeOnFail };
1038
+ }
1039
+ export { defaultJobOptions_18 as defaultJobOptions };
1040
+ export namespace streams_18 {
1041
+ export namespace events_18 {
1042
+ let maxLen_18: number;
1043
+ export { maxLen_18 as maxLen };
1044
+ }
1045
+ export { events_18 as events };
1046
+ }
1047
+ export { streams_18 as streams };
1048
+ }
1049
+ export { queueConfig_18 as queueConfig };
1050
+ export namespace workerConfig_18 {
1051
+ let concurrency_18: number;
1052
+ export { concurrency_18 as concurrency };
1053
+ let lockDuration_18: number;
1054
+ export { lockDuration_18 as lockDuration };
1055
+ let maxStalledCount_18: number;
1056
+ export { maxStalledCount_18 as maxStalledCount };
1057
+ }
1058
+ export { workerConfig_18 as workerConfig };
1059
+ }
1020
1060
  }
1021
1061
 
1022
1062
  interface PlatformContextContentItem {
@@ -1062,6 +1102,24 @@ interface MergeParams {
1062
1102
  */
1063
1103
  declare const mergeAnnoDataIntoAnnotationsTags: ({ prevObj, newLexValue, thisBlockValuePath, author, }: MergeParams) => any;
1064
1104
 
1105
+ /**
1106
+ * Is this tpl block a collab-editable field? ONE definition, used by BOTH
1107
+ * sides so they can never disagree:
1108
+ * - okf-sub loadContentDocument builds the server-side editable allowlist
1109
+ * from it (the flush drops writes outside that list)
1110
+ * - okf-fe ViewBlockGenerator derives per-block editability from it
1111
+ *
1112
+ * Editable = binds to a real content path. Exclusions:
1113
+ * - no valuePath (display-only blocks) / the odd "." valuePath some legacy
1114
+ * tpls carry (see getTypesForSchemaFromTpl, which skips it too)
1115
+ * - kp_-prefixed segments (publish status, lifecycle dates, author refs —
1116
+ * machinery, not content). NOTE: non-block system fields (lastActivity,
1117
+ * tagId...) are excluded by construction anyway — they're never tpl
1118
+ * blocks; this regex only guards block-defined kp_ paths.
1119
+ */
1120
+ declare const COLLAB_SYSTEM_PATH_REGEX: RegExp;
1121
+ declare function isCollabEditableBlock(block: any): boolean;
1122
+
1065
1123
  declare const parseSpecialConfigSyntax: ({ config, content, returnUndefinedIfReplacementWordNotFound }: {
1066
1124
  config: string | object;
1067
1125
  content: Record<string, any>;
@@ -1284,6 +1342,21 @@ declare const processAuthorAndCommonFilters: (allTpls: any[], filterScopes: stri
1284
1342
  filterType: string;
1285
1343
  valuePath: string;
1286
1344
  };
1345
+ } | {
1346
+ filterId: string;
1347
+ blockId: string;
1348
+ display: string;
1349
+ value: string;
1350
+ filterKey: string | undefined;
1351
+ source: {
1352
+ filterType: string;
1353
+ scope: string;
1354
+ profileTypes?: undefined;
1355
+ };
1356
+ target: {
1357
+ filterType: string;
1358
+ valuePath: string;
1359
+ };
1287
1360
  })[];
1288
1361
  }[];
1289
1362
  };
@@ -1413,6 +1486,7 @@ declare const _self_managed_buildDocHierarchyConfig: ({ combinedDocumentBlocks,
1413
1486
  filters: any[];
1414
1487
  rollups: any[];
1415
1488
  rollupDisplayMap: Record<string, string>;
1489
+ childByParentId: Record<string, any>;
1416
1490
  }[];
1417
1491
  };
1418
1492
  target: {
@@ -1573,6 +1647,7 @@ declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScope
1573
1647
  filters: any[];
1574
1648
  rollups: any[];
1575
1649
  rollupDisplayMap: Record<string, string>;
1650
+ childByParentId: Record<string, any>;
1576
1651
  }[];
1577
1652
  };
1578
1653
  target: {
@@ -1639,6 +1714,21 @@ declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScope
1639
1714
  filterType: string;
1640
1715
  valuePath: string;
1641
1716
  };
1717
+ } | {
1718
+ filterId: string;
1719
+ blockId: string;
1720
+ display: string;
1721
+ value: string;
1722
+ filterKey: string | undefined;
1723
+ source: {
1724
+ filterType: string;
1725
+ scope: string;
1726
+ profileTypes?: undefined;
1727
+ };
1728
+ target: {
1729
+ filterType: string;
1730
+ valuePath: string;
1731
+ };
1642
1732
  })[];
1643
1733
  })[];
1644
1734
  } | null)[];
@@ -9096,6 +9186,9 @@ declare class TenantRegistry {
9096
9186
  }
9097
9187
 
9098
9188
  declare const LIVE_COLLAB_DOC_REFRESH_MS: 120000;
9189
+ declare const LIVE_COLLAB_DEFER_MS: 120000;
9190
+ declare const LIVE_COLLAB_MAX_DEFERRALS: 30;
9191
+ declare const DOC_IN_LIVE_COLLAB_SESSION_ERROR: "aiApply_docInLiveCollabSession";
9099
9192
  declare function markLiveCollabDoc({ tenant, contentType, docId, env }: {
9100
9193
  tenant: any;
9101
9194
  contentType: any;
@@ -9385,4 +9478,4 @@ declare function GET_GLOBAL_BULLMQ_CONFIG({ env, redisCredentials }: {
9385
9478
  };
9386
9479
  }): Object;
9387
9480
 
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 };
9481
+ export { AIChatSchema, AnnosElasticSyncProducer, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseFlowProducer, BaseProducer, BaseWorker, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, COLLAB_SYSTEM_PATH_REGEX, ChunksElasticSyncProducer, ContentElasticSyncProducer, DOC_IN_LIVE_COLLAB_SESSION_ERROR, ELASTIC_MAPPING_PRESETS, ElasticSearchConnector, FILTER_IDS, GET_GLOBAL_BULLMQ_CONFIG, GeneratedEntitiesSchema, GeneratedTopicsSchema, LIVE_COLLAB_DEFER_MS, LIVE_COLLAB_DOC_REFRESH_MS, LIVE_COLLAB_MAX_DEFERRALS, 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, isCollabEditableBlock, isLiveCollabDoc, isTplAnnotationEnabled, markLiveCollabDoc, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };