@okf/ootils 1.6.9 → 1.6.11

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.js CHANGED
@@ -35,6 +35,256 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
35
35
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
36
36
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
37
37
 
38
+ // src/bullmq/GLOBAL_BULLMQ_CONFIG.js
39
+ var GLOBAL_BULLMQ_CONFIG_exports = {};
40
+ __export(GLOBAL_BULLMQ_CONFIG_exports, {
41
+ BASE_BULLMQ_CONFIG: () => BASE_BULLMQ_CONFIG
42
+ });
43
+ var BASE_BULLMQ_CONFIG;
44
+ var init_GLOBAL_BULLMQ_CONFIG = __esm({
45
+ "src/bullmq/GLOBAL_BULLMQ_CONFIG.js"() {
46
+ "use strict";
47
+ BASE_BULLMQ_CONFIG = {
48
+ PLUGIN__MAD_USERS_SYNC_QUEUE: {
49
+ id: "plugin--mad-users-sync-queue",
50
+ queueConfig: {
51
+ defaultJobOptions: {
52
+ backoff: {
53
+ type: "exponential",
54
+ delay: 2e3
55
+ },
56
+ attempts: 3,
57
+ removeOnComplete: 30,
58
+ removeOnFail: 100
59
+ },
60
+ streams: {
61
+ events: {
62
+ maxLen: 10
63
+ // Keep very low, cuz we dont really use historical stream events as of now
64
+ }
65
+ }
66
+ },
67
+ workerConfig: {
68
+ concurrency: 1,
69
+ // Process jobs one at a time to avoid race conditions
70
+ limiter: {
71
+ max: 5,
72
+ // Max 10 jobs per...
73
+ duration: 6e4
74
+ // ...60 seconds (rate limiting)
75
+ }
76
+ }
77
+ },
78
+ // Chunk Processing Queue
79
+ CREATE_CHUNKS_QUEUE: {
80
+ id: "create-chunks-queue",
81
+ queueConfig: {
82
+ defaultJobOptions: {
83
+ backoff: {
84
+ type: "exponential",
85
+ delay: 2e3
86
+ },
87
+ attempts: 3,
88
+ removeOnComplete: 30,
89
+ removeOnFail: 100
90
+ },
91
+ streams: {
92
+ events: {
93
+ maxLen: 10
94
+ // Keep very low, cuz we dont really use historical stream events as of now
95
+ }
96
+ }
97
+ },
98
+ workerConfig: {
99
+ concurrency: 10,
100
+ // Process 10 jobs at once for chunk processing
101
+ limiter: {
102
+ max: 100,
103
+ // Max 5 jobs per...
104
+ duration: 6e4
105
+ // ...60 seconds (higher throughput for chunking)
106
+ }
107
+ }
108
+ },
109
+ CREATE_ANNOS_QUEUE: {
110
+ id: "create-annos-queue",
111
+ queueConfig: {
112
+ defaultJobOptions: {
113
+ backoff: {
114
+ type: "exponential",
115
+ delay: 2e3
116
+ },
117
+ attempts: 3,
118
+ removeOnComplete: 30,
119
+ removeOnFail: 100
120
+ },
121
+ streams: {
122
+ events: {
123
+ maxLen: 10
124
+ // Keep very low, cuz we dont really use historical stream events as of now
125
+ }
126
+ }
127
+ },
128
+ workerConfig: {
129
+ concurrency: 10,
130
+ // Process 10 jobs at once for chunk processing
131
+ limiter: {
132
+ max: 100,
133
+ // Max 50 jobs per...
134
+ duration: 6e4
135
+ // ...60 seconds (higher throughput for chunking)
136
+ }
137
+ }
138
+ },
139
+ CONTENT_ENHANCE_AND_EMBED_QUEUE: {
140
+ id: "content-enhance-and-embed-queue",
141
+ queueConfig: {
142
+ defaultJobOptions: {
143
+ backoff: {
144
+ type: "exponential",
145
+ delay: 2e3
146
+ },
147
+ attempts: 3,
148
+ removeOnComplete: 30,
149
+ removeOnFail: 100
150
+ },
151
+ streams: {
152
+ events: {
153
+ maxLen: 10
154
+ // Keep very low, cuz we dont really use historical stream events as of now
155
+ }
156
+ }
157
+ },
158
+ workerConfig: {
159
+ concurrency: 1,
160
+ limiter: {
161
+ max: 100,
162
+ // Max 50 jobs per...
163
+ duration: 6e4
164
+ // ...60 seconds (higher throughput for chunking)
165
+ }
166
+ }
167
+ },
168
+ DIRECT_DATA_IMPORT_QUEUE: {
169
+ id: "direct-data-import-queue",
170
+ queueConfig: {
171
+ defaultJobOptions: {
172
+ backoff: {
173
+ type: "exponential",
174
+ delay: 2e3
175
+ },
176
+ attempts: 3,
177
+ removeOnComplete: 30,
178
+ removeOnFail: 100
179
+ },
180
+ streams: {
181
+ events: {
182
+ maxLen: 10
183
+ // Keep very low, cuz we dont really use historical stream events as of now
184
+ }
185
+ }
186
+ },
187
+ workerConfig: {
188
+ concurrency: 1,
189
+ limiter: {
190
+ max: 5,
191
+ // Max 5 jobs per...
192
+ duration: 6e4
193
+ // ...60 seconds (higher throughput for chunking)
194
+ }
195
+ }
196
+ },
197
+ AI_CATEGORIZE_QUEUE: {
198
+ id: "ai-categorize-queue",
199
+ queueConfig: {
200
+ defaultJobOptions: {
201
+ attempts: 3,
202
+ backoff: {
203
+ type: "exponential",
204
+ delay: 2e3
205
+ },
206
+ removeOnComplete: 30,
207
+ removeOnFail: 100
208
+ },
209
+ streams: {
210
+ events: {
211
+ maxLen: 10
212
+ // Keep very low, cuz we dont really use historical stream events as of now
213
+ }
214
+ }
215
+ },
216
+ workerConfig: {
217
+ concurrency: 1,
218
+ limiter: {
219
+ max: 100,
220
+ // (lets always keep this same as content enhance & embed since it comes immediately after)
221
+ duration: 6e4
222
+ // ...60 seconds (higher throughput for chunking)
223
+ }
224
+ }
225
+ },
226
+ ANNOS_ELASTIC_SYNC_QUEUE: {
227
+ id: "annos-elastic-sync-queue",
228
+ queueConfig: {
229
+ defaultJobOptions: {
230
+ attempts: 3,
231
+ backoff: {
232
+ type: "exponential",
233
+ delay: 2e3
234
+ },
235
+ removeOnComplete: 30,
236
+ removeOnFail: 100
237
+ },
238
+ streams: {
239
+ events: {
240
+ maxLen: 10
241
+ // Keep very low, cuz we dont really use historical stream events as of now
242
+ }
243
+ }
244
+ },
245
+ workerConfig: {
246
+ concurrency: 5,
247
+ limiter: {
248
+ max: 100,
249
+ // (lets always keep this same as content enhance & embed since it comes immediately after)
250
+ duration: 6e4
251
+ // ...60 seconds (higher throughput for chunking)
252
+ }
253
+ }
254
+ },
255
+ CHUNKS_ELASTIC_SYNC_QUEUE: {
256
+ id: "chunks-elastic-sync-queue",
257
+ queueConfig: {
258
+ defaultJobOptions: {
259
+ attempts: 3,
260
+ backoff: {
261
+ type: "exponential",
262
+ delay: 2e3
263
+ },
264
+ removeOnComplete: 30,
265
+ removeOnFail: 100
266
+ },
267
+ streams: {
268
+ events: {
269
+ maxLen: 10
270
+ // Keep very low, cuz we dont really use historical stream events as of now
271
+ }
272
+ }
273
+ },
274
+ workerConfig: {
275
+ concurrency: 5,
276
+ limiter: {
277
+ max: 100,
278
+ // (lets always keep this same as content enhance & embed since it comes immediately after)
279
+ duration: 6e4
280
+ // ...60 seconds (higher throughput for chunking)
281
+ }
282
+ }
283
+ }
284
+ };
285
+ }
286
+ });
287
+
38
288
  // src/models/Annotations.ts
39
289
  var Annotations_exports = {};
40
290
  __export(Annotations_exports, {
@@ -1081,256 +1331,6 @@ var require_BaseWorker = __commonJS({
1081
1331
  }
1082
1332
  });
1083
1333
 
1084
- // src/bullmq/GLOBAL_BULLMQ_CONFIG.js
1085
- var GLOBAL_BULLMQ_CONFIG_exports = {};
1086
- __export(GLOBAL_BULLMQ_CONFIG_exports, {
1087
- BASE_BULLMQ_CONFIG: () => BASE_BULLMQ_CONFIG
1088
- });
1089
- var BASE_BULLMQ_CONFIG;
1090
- var init_GLOBAL_BULLMQ_CONFIG = __esm({
1091
- "src/bullmq/GLOBAL_BULLMQ_CONFIG.js"() {
1092
- "use strict";
1093
- BASE_BULLMQ_CONFIG = {
1094
- PLUGIN__MAD_USERS_SYNC_QUEUE: {
1095
- id: "plugin--mad-users-sync-queue",
1096
- queueConfig: {
1097
- defaultJobOptions: {
1098
- backoff: {
1099
- type: "exponential",
1100
- delay: 2e3
1101
- },
1102
- attempts: 3,
1103
- removeOnComplete: 30,
1104
- removeOnFail: 100
1105
- },
1106
- streams: {
1107
- events: {
1108
- maxLen: 10
1109
- // Keep very low, cuz we dont really use historical stream events as of now
1110
- }
1111
- }
1112
- },
1113
- workerConfig: {
1114
- concurrency: 1,
1115
- // Process jobs one at a time to avoid race conditions
1116
- limiter: {
1117
- max: 5,
1118
- // Max 10 jobs per...
1119
- duration: 6e4
1120
- // ...60 seconds (rate limiting)
1121
- }
1122
- }
1123
- },
1124
- // Chunk Processing Queue
1125
- CREATE_CHUNKS_QUEUE: {
1126
- id: "create-chunks-queue",
1127
- queueConfig: {
1128
- defaultJobOptions: {
1129
- backoff: {
1130
- type: "exponential",
1131
- delay: 2e3
1132
- },
1133
- attempts: 3,
1134
- removeOnComplete: 30,
1135
- removeOnFail: 100
1136
- },
1137
- streams: {
1138
- events: {
1139
- maxLen: 10
1140
- // Keep very low, cuz we dont really use historical stream events as of now
1141
- }
1142
- }
1143
- },
1144
- workerConfig: {
1145
- concurrency: 10,
1146
- // Process 10 jobs at once for chunk processing
1147
- limiter: {
1148
- max: 100,
1149
- // Max 5 jobs per...
1150
- duration: 6e4
1151
- // ...60 seconds (higher throughput for chunking)
1152
- }
1153
- }
1154
- },
1155
- CREATE_ANNOS_QUEUE: {
1156
- id: "create-annos-queue",
1157
- queueConfig: {
1158
- defaultJobOptions: {
1159
- backoff: {
1160
- type: "exponential",
1161
- delay: 2e3
1162
- },
1163
- attempts: 3,
1164
- removeOnComplete: 30,
1165
- removeOnFail: 100
1166
- },
1167
- streams: {
1168
- events: {
1169
- maxLen: 10
1170
- // Keep very low, cuz we dont really use historical stream events as of now
1171
- }
1172
- }
1173
- },
1174
- workerConfig: {
1175
- concurrency: 10,
1176
- // Process 10 jobs at once for chunk processing
1177
- limiter: {
1178
- max: 100,
1179
- // Max 50 jobs per...
1180
- duration: 6e4
1181
- // ...60 seconds (higher throughput for chunking)
1182
- }
1183
- }
1184
- },
1185
- CONTENT_ENHANCE_AND_EMBED_QUEUE: {
1186
- id: "content-enhance-and-embed-queue",
1187
- queueConfig: {
1188
- defaultJobOptions: {
1189
- backoff: {
1190
- type: "exponential",
1191
- delay: 2e3
1192
- },
1193
- attempts: 3,
1194
- removeOnComplete: 30,
1195
- removeOnFail: 100
1196
- },
1197
- streams: {
1198
- events: {
1199
- maxLen: 10
1200
- // Keep very low, cuz we dont really use historical stream events as of now
1201
- }
1202
- }
1203
- },
1204
- workerConfig: {
1205
- concurrency: 1,
1206
- limiter: {
1207
- max: 100,
1208
- // Max 50 jobs per...
1209
- duration: 6e4
1210
- // ...60 seconds (higher throughput for chunking)
1211
- }
1212
- }
1213
- },
1214
- DIRECT_DATA_IMPORT_QUEUE: {
1215
- id: "direct-data-import-queue",
1216
- queueConfig: {
1217
- defaultJobOptions: {
1218
- backoff: {
1219
- type: "exponential",
1220
- delay: 2e3
1221
- },
1222
- attempts: 3,
1223
- removeOnComplete: 30,
1224
- removeOnFail: 100
1225
- },
1226
- streams: {
1227
- events: {
1228
- maxLen: 10
1229
- // Keep very low, cuz we dont really use historical stream events as of now
1230
- }
1231
- }
1232
- },
1233
- workerConfig: {
1234
- concurrency: 1,
1235
- limiter: {
1236
- max: 5,
1237
- // Max 5 jobs per...
1238
- duration: 6e4
1239
- // ...60 seconds (higher throughput for chunking)
1240
- }
1241
- }
1242
- },
1243
- AI_CATEGORIZE_QUEUE: {
1244
- id: "ai-categorize-queue",
1245
- queueConfig: {
1246
- defaultJobOptions: {
1247
- attempts: 3,
1248
- backoff: {
1249
- type: "exponential",
1250
- delay: 2e3
1251
- },
1252
- removeOnComplete: 30,
1253
- removeOnFail: 100
1254
- },
1255
- streams: {
1256
- events: {
1257
- maxLen: 10
1258
- // Keep very low, cuz we dont really use historical stream events as of now
1259
- }
1260
- }
1261
- },
1262
- workerConfig: {
1263
- concurrency: 1,
1264
- limiter: {
1265
- max: 100,
1266
- // (lets always keep this same as content enhance & embed since it comes immediately after)
1267
- duration: 6e4
1268
- // ...60 seconds (higher throughput for chunking)
1269
- }
1270
- }
1271
- },
1272
- ANNOS_ELASTIC_SYNC_QUEUE: {
1273
- id: "annos-elastic-sync-queue",
1274
- queueConfig: {
1275
- defaultJobOptions: {
1276
- attempts: 3,
1277
- backoff: {
1278
- type: "exponential",
1279
- delay: 2e3
1280
- },
1281
- removeOnComplete: 30,
1282
- removeOnFail: 100
1283
- },
1284
- streams: {
1285
- events: {
1286
- maxLen: 10
1287
- // Keep very low, cuz we dont really use historical stream events as of now
1288
- }
1289
- }
1290
- },
1291
- workerConfig: {
1292
- concurrency: 5,
1293
- limiter: {
1294
- max: 50,
1295
- // (lets always keep this same as content enhance & embed since it comes immediately after)
1296
- duration: 6e4
1297
- // ...60 seconds (higher throughput for chunking)
1298
- }
1299
- }
1300
- },
1301
- CHUNKS_ELASTIC_SYNC_QUEUE: {
1302
- id: "chunks-elastic-sync-queue",
1303
- queueConfig: {
1304
- defaultJobOptions: {
1305
- attempts: 3,
1306
- backoff: {
1307
- type: "exponential",
1308
- delay: 2e3
1309
- },
1310
- removeOnComplete: 30,
1311
- removeOnFail: 100
1312
- },
1313
- streams: {
1314
- events: {
1315
- maxLen: 10
1316
- // Keep very low, cuz we dont really use historical stream events as of now
1317
- }
1318
- }
1319
- },
1320
- workerConfig: {
1321
- concurrency: 5,
1322
- limiter: {
1323
- max: 50,
1324
- // (lets always keep this same as content enhance & embed since it comes immediately after)
1325
- duration: 6e4
1326
- // ...60 seconds (higher throughput for chunking)
1327
- }
1328
- }
1329
- }
1330
- };
1331
- }
1332
- });
1333
-
1334
1334
  // src/bullmq/GET_GLOBAL_BULLMQ_CONFIG.js
1335
1335
  var require_GET_GLOBAL_BULLMQ_CONFIG = __commonJS({
1336
1336
  "src/bullmq/GET_GLOBAL_BULLMQ_CONFIG.js"(exports2, module2) {
@@ -1370,6 +1370,7 @@ var node_exports = {};
1370
1370
  __export(node_exports, {
1371
1371
  AIChatSchema: () => AIChat_default,
1372
1372
  AnnotationSchema: () => Annotations_default,
1373
+ BASE_BULLMQ_CONFIG: () => BASE_BULLMQ_CONFIG,
1373
1374
  BaseProducer: () => import_BaseProducer.BaseProducer,
1374
1375
  BaseWorker: () => import_BaseWorker.BaseWorker,
1375
1376
  ElasticSearchConnector: () => import_ElasticSearchConnector.ElasticSearchConnector,
@@ -1671,6 +1672,9 @@ var _extractBlocksFromSomeBuilders = ({
1671
1672
  }
1672
1673
  };
1673
1674
 
1675
+ // src/universal.ts
1676
+ init_GLOBAL_BULLMQ_CONFIG();
1677
+
1674
1678
  // src/node.ts
1675
1679
  var import_MongoConnector2 = __toESM(require_MongoConnector());
1676
1680
  var import_ElasticSearchConnector = __toESM(require_ElasticSearchConnector());
@@ -1999,6 +2003,7 @@ var import_GET_GLOBAL_BULLMQ_CONFIG = __toESM(require_GET_GLOBAL_BULLMQ_CONFIG()
1999
2003
  0 && (module.exports = {
2000
2004
  AIChatSchema,
2001
2005
  AnnotationSchema,
2006
+ BASE_BULLMQ_CONFIG,
2002
2007
  BaseProducer,
2003
2008
  BaseWorker,
2004
2009
  ElasticSearchConnector,