@okf/ootils 1.44.0 → 1.44.2

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/universal.js CHANGED
@@ -838,8 +838,8 @@ var BASE_BULLMQ_CONFIG = {
838
838
  },
839
839
  streams: {
840
840
  events: {
841
- maxLen: 10
842
- // Keep very low, cuz we dont really use historical stream events as of now
841
+ maxLen: 1e3
842
+ // 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.
843
843
  }
844
844
  }
845
845
  },
@@ -871,8 +871,8 @@ var BASE_BULLMQ_CONFIG = {
871
871
  },
872
872
  streams: {
873
873
  events: {
874
- maxLen: 10
875
- // Keep very low, cuz we dont really use historical stream events as of now
874
+ maxLen: 1e3
875
+ // 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.
876
876
  }
877
877
  }
878
878
  },
@@ -898,8 +898,8 @@ var BASE_BULLMQ_CONFIG = {
898
898
  },
899
899
  streams: {
900
900
  events: {
901
- maxLen: 10
902
- // Keep very low, cuz we dont really use historical stream events as of now
901
+ maxLen: 1e3
902
+ // 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.
903
903
  }
904
904
  }
905
905
  },
@@ -923,8 +923,8 @@ var BASE_BULLMQ_CONFIG = {
923
923
  },
924
924
  streams: {
925
925
  events: {
926
- maxLen: 10
927
- // Keep very low, cuz we dont really use historical stream events as of now
926
+ maxLen: 1e3
927
+ // 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.
928
928
  }
929
929
  }
930
930
  },
@@ -948,8 +948,8 @@ var BASE_BULLMQ_CONFIG = {
948
948
  },
949
949
  streams: {
950
950
  events: {
951
- maxLen: 10
952
- // Keep very low, cuz we dont really use historical stream events as of now
951
+ maxLen: 1e3
952
+ // 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.
953
953
  }
954
954
  }
955
955
  },
@@ -999,7 +999,8 @@ var BASE_BULLMQ_CONFIG = {
999
999
  },
1000
1000
  streams: {
1001
1001
  events: {
1002
- maxLen: 10
1002
+ maxLen: 1e3
1003
+ // see note on the first maxLen above — 10 dropped tracker events mid-burst
1003
1004
  }
1004
1005
  }
1005
1006
  },
@@ -1041,7 +1042,8 @@ var BASE_BULLMQ_CONFIG = {
1041
1042
  },
1042
1043
  streams: {
1043
1044
  events: {
1044
- maxLen: 10
1045
+ maxLen: 1e3
1046
+ // see note on the first maxLen above — 10 dropped tracker events mid-burst
1045
1047
  }
1046
1048
  }
1047
1049
  },
@@ -1094,7 +1096,8 @@ var BASE_BULLMQ_CONFIG = {
1094
1096
  },
1095
1097
  streams: {
1096
1098
  events: {
1097
- maxLen: 10
1099
+ maxLen: 1e3
1100
+ // see note on the first maxLen above — 10 dropped tracker events mid-burst
1098
1101
  }
1099
1102
  }
1100
1103
  },
@@ -1126,8 +1129,8 @@ var BASE_BULLMQ_CONFIG = {
1126
1129
  },
1127
1130
  streams: {
1128
1131
  events: {
1129
- maxLen: 10
1130
- // Keep very low, cuz we dont really use historical stream events as of now
1132
+ maxLen: 1e3
1133
+ // 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.
1131
1134
  }
1132
1135
  }
1133
1136
  },
@@ -1151,8 +1154,8 @@ var BASE_BULLMQ_CONFIG = {
1151
1154
  },
1152
1155
  streams: {
1153
1156
  events: {
1154
- maxLen: 10
1155
- // Keep very low, cuz we dont really use historical stream events as of now
1157
+ maxLen: 1e3
1158
+ // 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.
1156
1159
  }
1157
1160
  }
1158
1161
  },
@@ -1176,7 +1179,8 @@ var BASE_BULLMQ_CONFIG = {
1176
1179
  },
1177
1180
  streams: {
1178
1181
  events: {
1179
- maxLen: 10
1182
+ maxLen: 1e3
1183
+ // see note on the first maxLen above — 10 dropped tracker events mid-burst
1180
1184
  }
1181
1185
  }
1182
1186
  },
@@ -1200,8 +1204,8 @@ var BASE_BULLMQ_CONFIG = {
1200
1204
  },
1201
1205
  streams: {
1202
1206
  events: {
1203
- maxLen: 10
1204
- // Keep very low, cuz we dont really use historical stream events as of now
1207
+ maxLen: 1e3
1208
+ // 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.
1205
1209
  }
1206
1210
  }
1207
1211
  },
@@ -1227,7 +1231,8 @@ var BASE_BULLMQ_CONFIG = {
1227
1231
  },
1228
1232
  streams: {
1229
1233
  events: {
1230
- maxLen: 10
1234
+ maxLen: 1e3
1235
+ // see note on the first maxLen above — 10 dropped tracker events mid-burst
1231
1236
  }
1232
1237
  }
1233
1238
  },
@@ -1255,7 +1260,8 @@ var BASE_BULLMQ_CONFIG = {
1255
1260
  },
1256
1261
  streams: {
1257
1262
  events: {
1258
- maxLen: 10
1263
+ maxLen: 1e3
1264
+ // see note on the first maxLen above — 10 dropped tracker events mid-burst
1259
1265
  }
1260
1266
  }
1261
1267
  },
@@ -1280,7 +1286,8 @@ var BASE_BULLMQ_CONFIG = {
1280
1286
  },
1281
1287
  streams: {
1282
1288
  events: {
1283
- maxLen: 10
1289
+ maxLen: 1e3
1290
+ // see note on the first maxLen above — 10 dropped tracker events mid-burst
1284
1291
  }
1285
1292
  }
1286
1293
  },
@@ -1306,7 +1313,8 @@ var BASE_BULLMQ_CONFIG = {
1306
1313
  },
1307
1314
  streams: {
1308
1315
  events: {
1309
- maxLen: 10
1316
+ maxLen: 1e3
1317
+ // see note on the first maxLen above — 10 dropped tracker events mid-burst
1310
1318
  }
1311
1319
  }
1312
1320
  },
@@ -1335,7 +1343,8 @@ var BASE_BULLMQ_CONFIG = {
1335
1343
  },
1336
1344
  streams: {
1337
1345
  events: {
1338
- maxLen: 10
1346
+ maxLen: 1e3
1347
+ // see note on the first maxLen above — 10 dropped tracker events mid-burst
1339
1348
  }
1340
1349
  }
1341
1350
  },
@@ -1361,8 +1370,8 @@ var BASE_BULLMQ_CONFIG = {
1361
1370
  },
1362
1371
  streams: {
1363
1372
  events: {
1364
- maxLen: 10
1365
- // Keep very low, cuz we dont really use historical stream events as of now
1373
+ maxLen: 1e3
1374
+ // 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.
1366
1375
  }
1367
1376
  }
1368
1377
  },
@@ -2497,6 +2506,13 @@ var deduplicateRollupTagFilters = (rollups) => {
2497
2506
  var injectFilterOptionsBy = (filters) => filters.map(
2498
2507
  (f) => f.parentFilterId ? { ...f, source: { ...f.source, filterOptionsBy: { filterId: f.parentFilterId } } } : f
2499
2508
  );
2509
+ var isRollupConfig = (f) => !!f.target?.rollupPath || f.target?.filterType === "rollupValuePathType";
2510
+ var dedupeSharedGroupConfigs = (configs) => {
2511
+ const rollups = configs.filter(isRollupConfig);
2512
+ const rollupSourceKeys = new Set(rollups.map((r) => JSON.stringify(r.source)));
2513
+ const directFilters = configs.filter((f) => !isRollupConfig(f)).filter((f) => !rollupSourceKeys.has(JSON.stringify(f.source)));
2514
+ return [...directFilters, ...deduplicateRollupTagFilters(rollups)];
2515
+ };
2500
2516
  var _self_managed_buildDocHierarchyConfig = ({
2501
2517
  combinedDocumentBlocks,
2502
2518
  docRollupBlocks,
@@ -2509,17 +2525,19 @@ var _self_managed_buildDocHierarchyConfig = ({
2509
2525
  const commonGroup = allGroups.find(
2510
2526
  (g) => g.contentTypes.length === selectedTpls.length
2511
2527
  );
2512
- const commonFilterConfigs = commonGroup ? injectFilterOptionsBy(
2528
+ const commonFilterConfigs = commonGroup && selectedTpls.length >= 2 ? injectFilterOptionsBy(
2513
2529
  sortFiltersHierarchically(
2514
2530
  attachParentFields(
2515
- buildFilterConfigurations({
2516
- groups: [commonGroup],
2517
- type: "tags",
2518
- selectedTpls,
2519
- allTpls,
2520
- isRollup: false,
2521
- isAnno: false
2522
- }).flatMap((s) => s.configs),
2531
+ dedupeSharedGroupConfigs(
2532
+ buildFilterConfigurations({
2533
+ groups: [commonGroup],
2534
+ type: "tags",
2535
+ selectedTpls,
2536
+ allTpls,
2537
+ isRollup: false,
2538
+ isAnno: false
2539
+ }).flatMap((s) => s.configs)
2540
+ ),
2523
2541
  allTpls
2524
2542
  )
2525
2543
  )
@@ -2531,14 +2549,16 @@ var _self_managed_buildDocHierarchyConfig = ({
2531
2549
  const groupFilterConfigs = injectFilterOptionsBy(
2532
2550
  sortFiltersHierarchically(
2533
2551
  attachParentFields(
2534
- buildFilterConfigurations({
2535
- groups: [group],
2536
- type: "tags",
2537
- selectedTpls,
2538
- allTpls,
2539
- isRollup: false,
2540
- isAnno: false
2541
- }).flatMap((s) => s.configs),
2552
+ dedupeSharedGroupConfigs(
2553
+ buildFilterConfigurations({
2554
+ groups: [group],
2555
+ type: "tags",
2556
+ selectedTpls,
2557
+ allTpls,
2558
+ isRollup: false,
2559
+ isAnno: false
2560
+ }).flatMap((s) => s.configs)
2561
+ ),
2542
2562
  allTpls
2543
2563
  )
2544
2564
  )
@@ -768,8 +768,8 @@ var BASE_BULLMQ_CONFIG = {
768
768
  },
769
769
  streams: {
770
770
  events: {
771
- maxLen: 10
772
- // Keep very low, cuz we dont really use historical stream events as of now
771
+ maxLen: 1e3
772
+ // 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.
773
773
  }
774
774
  }
775
775
  },
@@ -801,8 +801,8 @@ var BASE_BULLMQ_CONFIG = {
801
801
  },
802
802
  streams: {
803
803
  events: {
804
- maxLen: 10
805
- // Keep very low, cuz we dont really use historical stream events as of now
804
+ maxLen: 1e3
805
+ // 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.
806
806
  }
807
807
  }
808
808
  },
@@ -828,8 +828,8 @@ var BASE_BULLMQ_CONFIG = {
828
828
  },
829
829
  streams: {
830
830
  events: {
831
- maxLen: 10
832
- // Keep very low, cuz we dont really use historical stream events as of now
831
+ maxLen: 1e3
832
+ // 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.
833
833
  }
834
834
  }
835
835
  },
@@ -853,8 +853,8 @@ var BASE_BULLMQ_CONFIG = {
853
853
  },
854
854
  streams: {
855
855
  events: {
856
- maxLen: 10
857
- // Keep very low, cuz we dont really use historical stream events as of now
856
+ maxLen: 1e3
857
+ // 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.
858
858
  }
859
859
  }
860
860
  },
@@ -878,8 +878,8 @@ var BASE_BULLMQ_CONFIG = {
878
878
  },
879
879
  streams: {
880
880
  events: {
881
- maxLen: 10
882
- // Keep very low, cuz we dont really use historical stream events as of now
881
+ maxLen: 1e3
882
+ // 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.
883
883
  }
884
884
  }
885
885
  },
@@ -929,7 +929,8 @@ var BASE_BULLMQ_CONFIG = {
929
929
  },
930
930
  streams: {
931
931
  events: {
932
- maxLen: 10
932
+ maxLen: 1e3
933
+ // see note on the first maxLen above — 10 dropped tracker events mid-burst
933
934
  }
934
935
  }
935
936
  },
@@ -971,7 +972,8 @@ var BASE_BULLMQ_CONFIG = {
971
972
  },
972
973
  streams: {
973
974
  events: {
974
- maxLen: 10
975
+ maxLen: 1e3
976
+ // see note on the first maxLen above — 10 dropped tracker events mid-burst
975
977
  }
976
978
  }
977
979
  },
@@ -1024,7 +1026,8 @@ var BASE_BULLMQ_CONFIG = {
1024
1026
  },
1025
1027
  streams: {
1026
1028
  events: {
1027
- maxLen: 10
1029
+ maxLen: 1e3
1030
+ // see note on the first maxLen above — 10 dropped tracker events mid-burst
1028
1031
  }
1029
1032
  }
1030
1033
  },
@@ -1056,8 +1059,8 @@ var BASE_BULLMQ_CONFIG = {
1056
1059
  },
1057
1060
  streams: {
1058
1061
  events: {
1059
- maxLen: 10
1060
- // Keep very low, cuz we dont really use historical stream events as of now
1062
+ maxLen: 1e3
1063
+ // 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.
1061
1064
  }
1062
1065
  }
1063
1066
  },
@@ -1081,8 +1084,8 @@ var BASE_BULLMQ_CONFIG = {
1081
1084
  },
1082
1085
  streams: {
1083
1086
  events: {
1084
- maxLen: 10
1085
- // Keep very low, cuz we dont really use historical stream events as of now
1087
+ maxLen: 1e3
1088
+ // 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.
1086
1089
  }
1087
1090
  }
1088
1091
  },
@@ -1106,7 +1109,8 @@ var BASE_BULLMQ_CONFIG = {
1106
1109
  },
1107
1110
  streams: {
1108
1111
  events: {
1109
- maxLen: 10
1112
+ maxLen: 1e3
1113
+ // see note on the first maxLen above — 10 dropped tracker events mid-burst
1110
1114
  }
1111
1115
  }
1112
1116
  },
@@ -1130,8 +1134,8 @@ var BASE_BULLMQ_CONFIG = {
1130
1134
  },
1131
1135
  streams: {
1132
1136
  events: {
1133
- maxLen: 10
1134
- // Keep very low, cuz we dont really use historical stream events as of now
1137
+ maxLen: 1e3
1138
+ // 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.
1135
1139
  }
1136
1140
  }
1137
1141
  },
@@ -1157,7 +1161,8 @@ var BASE_BULLMQ_CONFIG = {
1157
1161
  },
1158
1162
  streams: {
1159
1163
  events: {
1160
- maxLen: 10
1164
+ maxLen: 1e3
1165
+ // see note on the first maxLen above — 10 dropped tracker events mid-burst
1161
1166
  }
1162
1167
  }
1163
1168
  },
@@ -1185,7 +1190,8 @@ var BASE_BULLMQ_CONFIG = {
1185
1190
  },
1186
1191
  streams: {
1187
1192
  events: {
1188
- maxLen: 10
1193
+ maxLen: 1e3
1194
+ // see note on the first maxLen above — 10 dropped tracker events mid-burst
1189
1195
  }
1190
1196
  }
1191
1197
  },
@@ -1210,7 +1216,8 @@ var BASE_BULLMQ_CONFIG = {
1210
1216
  },
1211
1217
  streams: {
1212
1218
  events: {
1213
- maxLen: 10
1219
+ maxLen: 1e3
1220
+ // see note on the first maxLen above — 10 dropped tracker events mid-burst
1214
1221
  }
1215
1222
  }
1216
1223
  },
@@ -1236,7 +1243,8 @@ var BASE_BULLMQ_CONFIG = {
1236
1243
  },
1237
1244
  streams: {
1238
1245
  events: {
1239
- maxLen: 10
1246
+ maxLen: 1e3
1247
+ // see note on the first maxLen above — 10 dropped tracker events mid-burst
1240
1248
  }
1241
1249
  }
1242
1250
  },
@@ -1265,7 +1273,8 @@ var BASE_BULLMQ_CONFIG = {
1265
1273
  },
1266
1274
  streams: {
1267
1275
  events: {
1268
- maxLen: 10
1276
+ maxLen: 1e3
1277
+ // see note on the first maxLen above — 10 dropped tracker events mid-burst
1269
1278
  }
1270
1279
  }
1271
1280
  },
@@ -1291,8 +1300,8 @@ var BASE_BULLMQ_CONFIG = {
1291
1300
  },
1292
1301
  streams: {
1293
1302
  events: {
1294
- maxLen: 10
1295
- // Keep very low, cuz we dont really use historical stream events as of now
1303
+ maxLen: 1e3
1304
+ // 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.
1296
1305
  }
1297
1306
  }
1298
1307
  },
@@ -2427,6 +2436,13 @@ var deduplicateRollupTagFilters = (rollups) => {
2427
2436
  var injectFilterOptionsBy = (filters) => filters.map(
2428
2437
  (f) => f.parentFilterId ? { ...f, source: { ...f.source, filterOptionsBy: { filterId: f.parentFilterId } } } : f
2429
2438
  );
2439
+ var isRollupConfig = (f) => !!f.target?.rollupPath || f.target?.filterType === "rollupValuePathType";
2440
+ var dedupeSharedGroupConfigs = (configs) => {
2441
+ const rollups = configs.filter(isRollupConfig);
2442
+ const rollupSourceKeys = new Set(rollups.map((r) => JSON.stringify(r.source)));
2443
+ const directFilters = configs.filter((f) => !isRollupConfig(f)).filter((f) => !rollupSourceKeys.has(JSON.stringify(f.source)));
2444
+ return [...directFilters, ...deduplicateRollupTagFilters(rollups)];
2445
+ };
2430
2446
  var _self_managed_buildDocHierarchyConfig = ({
2431
2447
  combinedDocumentBlocks,
2432
2448
  docRollupBlocks,
@@ -2439,17 +2455,19 @@ var _self_managed_buildDocHierarchyConfig = ({
2439
2455
  const commonGroup = allGroups.find(
2440
2456
  (g) => g.contentTypes.length === selectedTpls.length
2441
2457
  );
2442
- const commonFilterConfigs = commonGroup ? injectFilterOptionsBy(
2458
+ const commonFilterConfigs = commonGroup && selectedTpls.length >= 2 ? injectFilterOptionsBy(
2443
2459
  sortFiltersHierarchically(
2444
2460
  attachParentFields(
2445
- buildFilterConfigurations({
2446
- groups: [commonGroup],
2447
- type: "tags",
2448
- selectedTpls,
2449
- allTpls,
2450
- isRollup: false,
2451
- isAnno: false
2452
- }).flatMap((s) => s.configs),
2461
+ dedupeSharedGroupConfigs(
2462
+ buildFilterConfigurations({
2463
+ groups: [commonGroup],
2464
+ type: "tags",
2465
+ selectedTpls,
2466
+ allTpls,
2467
+ isRollup: false,
2468
+ isAnno: false
2469
+ }).flatMap((s) => s.configs)
2470
+ ),
2453
2471
  allTpls
2454
2472
  )
2455
2473
  )
@@ -2461,14 +2479,16 @@ var _self_managed_buildDocHierarchyConfig = ({
2461
2479
  const groupFilterConfigs = injectFilterOptionsBy(
2462
2480
  sortFiltersHierarchically(
2463
2481
  attachParentFields(
2464
- buildFilterConfigurations({
2465
- groups: [group],
2466
- type: "tags",
2467
- selectedTpls,
2468
- allTpls,
2469
- isRollup: false,
2470
- isAnno: false
2471
- }).flatMap((s) => s.configs),
2482
+ dedupeSharedGroupConfigs(
2483
+ buildFilterConfigurations({
2484
+ groups: [group],
2485
+ type: "tags",
2486
+ selectedTpls,
2487
+ allTpls,
2488
+ isRollup: false,
2489
+ isAnno: false
2490
+ }).flatMap((s) => s.configs)
2491
+ ),
2472
2492
  allTpls
2473
2493
  )
2474
2494
  )
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.44.0",
6
+ "version": "1.44.2",
7
7
  "description": "Utility functions for both browser and Node.js",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.mjs",