@ahoo-wang/fetcher-wow 3.18.1 → 4.0.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/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +289 -241
- package/dist/index.es.js.map +1 -1
- package/dist/query/cursorQuery.d.ts +16 -57
- package/dist/query/cursorQuery.d.ts.map +1 -1
- package/dist/query/event/eventStreamQueryApi.d.ts +1 -0
- package/dist/query/event/eventStreamQueryApi.d.ts.map +1 -1
- package/dist/query/event/eventStreamQueryClient.d.ts +3 -0
- package/dist/query/event/eventStreamQueryClient.d.ts.map +1 -1
- package/dist/query/filter.d.ts +5 -1
- package/dist/query/filter.d.ts.map +1 -1
- package/dist/query/queryApi.d.ts +3 -0
- package/dist/query/queryApi.d.ts.map +1 -1
- package/dist/query/snapshot/snapshotQueryApi.d.ts +5 -0
- package/dist/query/snapshot/snapshotQueryApi.d.ts.map +1 -1
- package/dist/query/snapshot/snapshotQueryClient.d.ts +6 -1
- package/dist/query/snapshot/snapshotQueryClient.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.es.js
CHANGED
|
@@ -172,127 +172,127 @@ function v(e, t) {
|
|
|
172
172
|
var y = /* @__PURE__ */ function(e) {
|
|
173
173
|
return e.ACTIVE = "ACTIVE", e.DELETED = "DELETED", e.ALL = "ALL", e;
|
|
174
174
|
}({});
|
|
175
|
-
function
|
|
176
|
-
if (e.length === 0) return
|
|
177
|
-
if (e.length === 1) return g(e[0]) ? e[0] :
|
|
175
|
+
function oe(...e) {
|
|
176
|
+
if (e.length === 0) return x();
|
|
177
|
+
if (e.length === 1) return g(e[0]) ? e[0] : x();
|
|
178
178
|
let t = [];
|
|
179
179
|
return e.forEach((e) => {
|
|
180
180
|
e?.operator === h.ALL || !g(e) || (e.operator === h.AND && e.children ? t.push(...e.children) : t.push(e));
|
|
181
|
-
}), t.length === 0 ?
|
|
181
|
+
}), t.length === 0 ? x() : {
|
|
182
182
|
operator: h.AND,
|
|
183
183
|
children: t
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function se(...e) {
|
|
187
187
|
let t = e?.filter((e) => g(e));
|
|
188
|
-
return t.length === 0 ?
|
|
188
|
+
return t.length === 0 ? x() : {
|
|
189
189
|
operator: h.OR,
|
|
190
190
|
children: t
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
return e.length === 0 ?
|
|
193
|
+
function ce(...e) {
|
|
194
|
+
return e.length === 0 ? x() : {
|
|
195
195
|
operator: h.NOR,
|
|
196
196
|
children: e
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function le(e) {
|
|
200
200
|
return {
|
|
201
201
|
operator: h.ID,
|
|
202
202
|
value: e
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function ue(e) {
|
|
206
206
|
return {
|
|
207
207
|
operator: h.IDS,
|
|
208
208
|
value: e
|
|
209
209
|
};
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function b(e) {
|
|
212
212
|
return {
|
|
213
213
|
operator: h.AGGREGATE_ID,
|
|
214
214
|
value: e
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function de(e) {
|
|
218
218
|
return {
|
|
219
219
|
operator: h.AGGREGATE_IDS,
|
|
220
220
|
value: e
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function fe(e) {
|
|
224
224
|
return {
|
|
225
225
|
operator: h.TENANT_ID,
|
|
226
226
|
value: e
|
|
227
227
|
};
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function pe(e) {
|
|
230
230
|
return {
|
|
231
231
|
operator: h.OWNER_ID,
|
|
232
232
|
value: e
|
|
233
233
|
};
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function me(e) {
|
|
236
236
|
return {
|
|
237
237
|
operator: h.SPACE_ID,
|
|
238
238
|
value: e
|
|
239
239
|
};
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function he(e) {
|
|
242
242
|
return {
|
|
243
243
|
operator: h.DELETED,
|
|
244
244
|
value: e
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
return
|
|
247
|
+
function ge() {
|
|
248
|
+
return he("ACTIVE");
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function x() {
|
|
251
251
|
return { operator: h.ALL };
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function _e(e, t) {
|
|
254
254
|
return {
|
|
255
255
|
field: e,
|
|
256
256
|
operator: h.EQ,
|
|
257
257
|
value: t
|
|
258
258
|
};
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function ve(e, t) {
|
|
261
261
|
return {
|
|
262
262
|
field: e,
|
|
263
263
|
operator: h.NE,
|
|
264
264
|
value: t
|
|
265
265
|
};
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function ye(e, t) {
|
|
268
268
|
return {
|
|
269
269
|
field: e,
|
|
270
270
|
operator: h.GT,
|
|
271
271
|
value: t
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function be(e, t) {
|
|
275
275
|
return {
|
|
276
276
|
field: e,
|
|
277
277
|
operator: h.LT,
|
|
278
278
|
value: t
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function xe(e, t) {
|
|
282
282
|
return {
|
|
283
283
|
field: e,
|
|
284
284
|
operator: h.GTE,
|
|
285
285
|
value: t
|
|
286
286
|
};
|
|
287
287
|
}
|
|
288
|
-
function
|
|
288
|
+
function Se(e, t) {
|
|
289
289
|
return {
|
|
290
290
|
field: e,
|
|
291
291
|
operator: h.LTE,
|
|
292
292
|
value: t
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function Ce(e, t, n) {
|
|
296
296
|
let r = _(n);
|
|
297
297
|
return {
|
|
298
298
|
field: e,
|
|
@@ -301,35 +301,35 @@ function Se(e, t, n) {
|
|
|
301
301
|
options: r
|
|
302
302
|
};
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function we(e, ...t) {
|
|
305
305
|
return {
|
|
306
306
|
field: e,
|
|
307
307
|
operator: h.IN,
|
|
308
308
|
value: t
|
|
309
309
|
};
|
|
310
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function Te(e, ...t) {
|
|
312
312
|
return {
|
|
313
313
|
field: e,
|
|
314
314
|
operator: h.NOT_IN,
|
|
315
315
|
value: t
|
|
316
316
|
};
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function Ee(e, t, n) {
|
|
319
319
|
return {
|
|
320
320
|
field: e,
|
|
321
321
|
operator: h.BETWEEN,
|
|
322
322
|
value: [t, n]
|
|
323
323
|
};
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function De(e, ...t) {
|
|
326
326
|
return {
|
|
327
327
|
field: e,
|
|
328
328
|
operator: h.ALL_IN,
|
|
329
329
|
value: t
|
|
330
330
|
};
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function Oe(e, t, n) {
|
|
333
333
|
let r = _(n);
|
|
334
334
|
return {
|
|
335
335
|
field: e,
|
|
@@ -338,14 +338,14 @@ function De(e, t, n) {
|
|
|
338
338
|
options: r
|
|
339
339
|
};
|
|
340
340
|
}
|
|
341
|
-
function
|
|
341
|
+
function ke(e, t) {
|
|
342
342
|
return {
|
|
343
343
|
field: e,
|
|
344
344
|
operator: h.MATCH,
|
|
345
345
|
value: t
|
|
346
346
|
};
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function Ae(e, t, n) {
|
|
349
349
|
let r = _(n);
|
|
350
350
|
return {
|
|
351
351
|
field: e,
|
|
@@ -354,45 +354,45 @@ function ke(e, t, n) {
|
|
|
354
354
|
options: r
|
|
355
355
|
};
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function je(e, t) {
|
|
358
358
|
return {
|
|
359
359
|
field: e,
|
|
360
360
|
operator: h.ELEM_MATCH,
|
|
361
361
|
children: [t]
|
|
362
362
|
};
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function Me(e) {
|
|
365
365
|
return {
|
|
366
366
|
field: e,
|
|
367
367
|
operator: h.NULL
|
|
368
368
|
};
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function Ne(e) {
|
|
371
371
|
return {
|
|
372
372
|
field: e,
|
|
373
373
|
operator: h.NOT_NULL
|
|
374
374
|
};
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function Pe(e) {
|
|
377
377
|
return {
|
|
378
378
|
field: e,
|
|
379
379
|
operator: h.TRUE
|
|
380
380
|
};
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function Fe(e) {
|
|
383
383
|
return {
|
|
384
384
|
field: e,
|
|
385
385
|
operator: h.FALSE
|
|
386
386
|
};
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function Ie(e, t = !0) {
|
|
389
389
|
return {
|
|
390
390
|
field: e,
|
|
391
391
|
operator: h.EXISTS,
|
|
392
392
|
value: t
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function Le(e, t, n) {
|
|
396
396
|
let r = v(t, n);
|
|
397
397
|
return {
|
|
398
398
|
field: e,
|
|
@@ -400,7 +400,7 @@ function Ie(e, t, n) {
|
|
|
400
400
|
options: r
|
|
401
401
|
};
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function Re(e, t, n, r) {
|
|
404
404
|
let i = v(n, r);
|
|
405
405
|
return {
|
|
406
406
|
field: e,
|
|
@@ -409,7 +409,7 @@ function Le(e, t, n, r) {
|
|
|
409
409
|
options: i
|
|
410
410
|
};
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function ze(e, t, n) {
|
|
413
413
|
let r = v(t, n);
|
|
414
414
|
return {
|
|
415
415
|
field: e,
|
|
@@ -417,7 +417,7 @@ function Re(e, t, n) {
|
|
|
417
417
|
options: r
|
|
418
418
|
};
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function Be(e, t, n) {
|
|
421
421
|
let r = v(t, n);
|
|
422
422
|
return {
|
|
423
423
|
field: e,
|
|
@@ -425,7 +425,7 @@ function ze(e, t, n) {
|
|
|
425
425
|
options: r
|
|
426
426
|
};
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function Ve(e, t, n) {
|
|
429
429
|
let r = v(t, n);
|
|
430
430
|
return {
|
|
431
431
|
field: e,
|
|
@@ -433,7 +433,7 @@ function Be(e, t, n) {
|
|
|
433
433
|
options: r
|
|
434
434
|
};
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function He(e, t, n) {
|
|
437
437
|
let r = v(t, n);
|
|
438
438
|
return {
|
|
439
439
|
field: e,
|
|
@@ -441,7 +441,7 @@ function Ve(e, t, n) {
|
|
|
441
441
|
options: r
|
|
442
442
|
};
|
|
443
443
|
}
|
|
444
|
-
function
|
|
444
|
+
function Ue(e, t, n) {
|
|
445
445
|
let r = v(t, n);
|
|
446
446
|
return {
|
|
447
447
|
field: e,
|
|
@@ -449,7 +449,7 @@ function He(e, t, n) {
|
|
|
449
449
|
options: r
|
|
450
450
|
};
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function We(e, t, n) {
|
|
453
453
|
let r = v(t, n);
|
|
454
454
|
return {
|
|
455
455
|
field: e,
|
|
@@ -457,7 +457,7 @@ function Ue(e, t, n) {
|
|
|
457
457
|
options: r
|
|
458
458
|
};
|
|
459
459
|
}
|
|
460
|
-
function
|
|
460
|
+
function Ge(e, t, n, r) {
|
|
461
461
|
let i = v(n, r);
|
|
462
462
|
return {
|
|
463
463
|
field: e,
|
|
@@ -466,7 +466,7 @@ function We(e, t, n, r) {
|
|
|
466
466
|
options: i
|
|
467
467
|
};
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function Ke(e, t, n, r) {
|
|
470
470
|
let i = v(n, r);
|
|
471
471
|
return {
|
|
472
472
|
field: e,
|
|
@@ -475,7 +475,7 @@ function Ge(e, t, n, r) {
|
|
|
475
475
|
options: i
|
|
476
476
|
};
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function qe(e) {
|
|
479
479
|
return {
|
|
480
480
|
operator: h.RAW,
|
|
481
481
|
value: e
|
|
@@ -483,15 +483,15 @@ function Ke(e) {
|
|
|
483
483
|
}
|
|
484
484
|
//#endregion
|
|
485
485
|
//#region src/query/filter.ts
|
|
486
|
-
var
|
|
487
|
-
return e.MATCH_ALL = "MATCH_ALL", e.MATCH_NONE = "MATCH_NONE", e.ID = "ID", e.IDS = "IDS", e.AGGREGATE_ID = "AGGREGATE_ID", e.AGGREGATE_IDS = "AGGREGATE_IDS", e.TENANT_ID = "TENANT_ID", e.OWNER_ID = "OWNER_ID", e.SPACE_ID = "SPACE_ID", e.AND = "AND", e.OR = "OR", e.NOR = "NOR", e.EQ = "EQ", e.NE = "NE", e.GT = "GT", e.GTE = "GTE", e.LT = "LT", e.LTE = "LTE", e.CONTAINS = "CONTAINS", e.STARTS_WITH = "STARTS_WITH", e.ENDS_WITH = "ENDS_WITH", e.IN = "IN", e.NOT_IN = "NOT_IN", e.BETWEEN = "BETWEEN", e.CONTAINS_ALL = "CONTAINS_ALL", e.IS_EMPTY = "IS_EMPTY", e.IS_NULL = "IS_NULL", e.IS_NOT_NULL = "IS_NOT_NULL", e.EXISTS = "EXISTS", e.NOT_EXISTS = "NOT_EXISTS", e.DELETION = "DELETION", e.ELEMENT_MATCH = "ELEMENT_MATCH", e.SEARCH = "SEARCH", e.TODAY = "TODAY", e.BEFORE_TODAY = "BEFORE_TODAY", e.TOMORROW = "TOMORROW", e.THIS_WEEK = "THIS_WEEK", e.NEXT_WEEK = "NEXT_WEEK", e.LAST_WEEK = "LAST_WEEK", e.THIS_MONTH = "THIS_MONTH", e.LAST_MONTH = "LAST_MONTH", e.YESTERDAY = "YESTERDAY", e.NEXT_MONTH = "NEXT_MONTH", e.LAST_YEAR = "LAST_YEAR", e.THIS_YEAR = "THIS_YEAR", e.NEXT_YEAR = "NEXT_YEAR", e.RECENT_DAYS = "RECENT_DAYS", e.EARLIER_DAYS = "EARLIER_DAYS", e;
|
|
488
|
-
}({}),
|
|
486
|
+
var Je = /* @__PURE__ */ function(e) {
|
|
487
|
+
return e.MATCH_ALL = "MATCH_ALL", e.MATCH_NONE = "MATCH_NONE", e.ID = "ID", e.IDS = "IDS", e.AGGREGATE_ID = "AGGREGATE_ID", e.AGGREGATE_IDS = "AGGREGATE_IDS", e.TENANT_ID = "TENANT_ID", e.OWNER_ID = "OWNER_ID", e.SPACE_ID = "SPACE_ID", e.AND = "AND", e.OR = "OR", e.NOR = "NOR", e.EQ = "EQ", e.NE = "NE", e.GT = "GT", e.GTE = "GTE", e.LT = "LT", e.LTE = "LTE", e.CONTAINS = "CONTAINS", e.STARTS_WITH = "STARTS_WITH", e.ENDS_WITH = "ENDS_WITH", e.IN = "IN", e.NOT_IN = "NOT_IN", e.BETWEEN = "BETWEEN", e.CONTAINS_ALL = "CONTAINS_ALL", e.IS_EMPTY = "IS_EMPTY", e.IS_EMPTY_STRING = "IS_EMPTY_STRING", e.IS_NOT_EMPTY_STRING = "IS_NOT_EMPTY_STRING", e.IS_NULL = "IS_NULL", e.IS_NOT_NULL = "IS_NOT_NULL", e.EXISTS = "EXISTS", e.NOT_EXISTS = "NOT_EXISTS", e.DELETION = "DELETION", e.ELEMENT_MATCH = "ELEMENT_MATCH", e.SEARCH = "SEARCH", e.TODAY = "TODAY", e.BEFORE_TODAY = "BEFORE_TODAY", e.TOMORROW = "TOMORROW", e.THIS_WEEK = "THIS_WEEK", e.NEXT_WEEK = "NEXT_WEEK", e.LAST_WEEK = "LAST_WEEK", e.THIS_MONTH = "THIS_MONTH", e.LAST_MONTH = "LAST_MONTH", e.YESTERDAY = "YESTERDAY", e.NEXT_MONTH = "NEXT_MONTH", e.LAST_YEAR = "LAST_YEAR", e.THIS_YEAR = "THIS_YEAR", e.NEXT_YEAR = "NEXT_YEAR", e.RECENT_DAYS = "RECENT_DAYS", e.EARLIER_DAYS = "EARLIER_DAYS", e;
|
|
488
|
+
}({}), Ye = /* @__PURE__ */ function(e) {
|
|
489
489
|
return e.CASE_SENSITIVE = "CASE_SENSITIVE", e.CASE_INSENSITIVE = "CASE_INSENSITIVE", e;
|
|
490
|
-
}({}),
|
|
490
|
+
}({}), S = /* @__PURE__ */ function(e) {
|
|
491
491
|
return e.TERMS = "TERMS", e.PHRASE = "PHRASE", e;
|
|
492
|
-
}({}),
|
|
492
|
+
}({}), C = /* @__PURE__ */ function(e) {
|
|
493
493
|
return e.NANOSECONDS = "NANOSECONDS", e.MICROSECONDS = "MICROSECONDS", e.MILLISECONDS = "MILLISECONDS", e.SECONDS = "SECONDS", e.MINUTES = "MINUTES", e.HOURS = "HOURS", e.DAYS = "DAYS", e;
|
|
494
|
-
}({}),
|
|
494
|
+
}({}), Xe = /^([01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?$/, Ze = /^@?[A-Za-z_][A-Za-z0-9_-]*(\.(?:@?[A-Za-z_][A-Za-z0-9_-]*|[0-9]+))*$/, Qe = /^(?:UTC|GMT|UT)?[+-](\d{1,2}|\d{4}|\d{6}|\d{2}:\d{2}|\d{2}:\d{2}:\d{2})$/, $e = /^(?:UTC|GMT|UT)?[+-]/, et = {
|
|
495
495
|
G: 5,
|
|
496
496
|
u: 19,
|
|
497
497
|
y: 19,
|
|
@@ -538,30 +538,30 @@ var qe = /* @__PURE__ */ function(e) {
|
|
|
538
538
|
Y: Infinity,
|
|
539
539
|
g: 19
|
|
540
540
|
};
|
|
541
|
-
function
|
|
542
|
-
if (typeof e != "string" || !
|
|
541
|
+
function w(e) {
|
|
542
|
+
if (typeof e != "string" || !Ze.test(e)) throw TypeError(`Logical field is invalid: [${String(e)}].`);
|
|
543
543
|
return e;
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function T(e, t) {
|
|
546
546
|
if (!(e === null ? t : typeof e == "string" || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e))) throw TypeError("Filter value must be a JSON scalar.");
|
|
547
547
|
return e;
|
|
548
548
|
}
|
|
549
|
-
function
|
|
550
|
-
return Array.isArray(e) ? (e.forEach((e) =>
|
|
549
|
+
function E(e) {
|
|
550
|
+
return Array.isArray(e) ? (e.forEach((e) => T(e, !0)), e) : T(e, !0);
|
|
551
551
|
}
|
|
552
|
-
function
|
|
552
|
+
function D(e, t) {
|
|
553
553
|
if (typeof t != "string") throw TypeError(`${e} must be a string.`);
|
|
554
554
|
return t;
|
|
555
555
|
}
|
|
556
|
-
function
|
|
556
|
+
function O(e) {
|
|
557
557
|
if (e !== "CASE_SENSITIVE" && e !== "CASE_INSENSITIVE") throw TypeError(`String comparison is invalid: [${String(e)}].`);
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function k(e, t) {
|
|
560
560
|
if (t.length === 0) throw TypeError(`${e} cannot be empty.`);
|
|
561
561
|
if (t.some((e) => e == null)) throw TypeError(`${e} cannot contain null.`);
|
|
562
562
|
}
|
|
563
|
-
function
|
|
564
|
-
let t =
|
|
563
|
+
function tt(e) {
|
|
564
|
+
let t = Qe.exec(e);
|
|
565
565
|
if (!t) return !1;
|
|
566
566
|
let n = t[1], [r, i = 0, a = 0] = (n.includes(":") ? n.split(":") : n.length <= 2 ? [n] : [
|
|
567
567
|
n.slice(0, 2),
|
|
@@ -570,26 +570,26 @@ function et(e) {
|
|
|
570
570
|
]).map(Number);
|
|
571
571
|
return i <= 59 && a <= 59 && (r < 18 || r === 18 && i === 0 && a === 0);
|
|
572
572
|
}
|
|
573
|
-
function
|
|
573
|
+
function A({ zoneId: e, datePattern: t, timeUnit: n = "MILLISECONDS" }) {
|
|
574
574
|
if (e !== void 0) {
|
|
575
575
|
if (typeof e != "string" || !e.trim()) throw TypeError("zoneId cannot be blank.");
|
|
576
|
-
if (
|
|
576
|
+
if ($e.test(e) && !tt(e)) throw TypeError(`zoneId is invalid: [${e}].`);
|
|
577
577
|
}
|
|
578
|
-
if (t !== void 0 &&
|
|
578
|
+
if (t !== void 0 && rt(t), !Object.values(C).includes(n)) throw TypeError(`timeUnit is invalid: [${String(n)}].`);
|
|
579
579
|
return {
|
|
580
580
|
...e === void 0 ? {} : { zoneId: e },
|
|
581
581
|
...t === void 0 ? {} : { datePattern: t },
|
|
582
582
|
timeUnit: n
|
|
583
583
|
};
|
|
584
584
|
}
|
|
585
|
-
function
|
|
586
|
-
let r =
|
|
585
|
+
function nt(e, t, n) {
|
|
586
|
+
let r = et[t];
|
|
587
587
|
if (!(typeof r == "number" ? n <= r : r?.includes(n) === !0)) throw TypeError(`datePattern is invalid: [${e}].`);
|
|
588
588
|
}
|
|
589
|
-
function
|
|
589
|
+
function j(e, t) {
|
|
590
590
|
return e !== void 0 && ("uyDFdhHkKmsSgAnNWwY".includes(e) || e === "c" && t === 1 || "eMLQq".includes(e) && t <= 2);
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function rt(e) {
|
|
593
593
|
if (typeof e != "string" || !e.trim()) throw TypeError("datePattern cannot be blank.");
|
|
594
594
|
let t = !1, n = 0;
|
|
595
595
|
for (let r = 0; r < e.length; r++) {
|
|
@@ -609,10 +609,10 @@ function nt(e) {
|
|
|
609
609
|
for (; e[n] === t;) n++;
|
|
610
610
|
a = n - r;
|
|
611
611
|
}
|
|
612
|
-
if (
|
|
612
|
+
if (nt(e, t, a), o && j(t, a)) {
|
|
613
613
|
let t = e[n], r = n;
|
|
614
614
|
for (; r < e.length && e[r] === t;) r++;
|
|
615
|
-
if (
|
|
615
|
+
if (j(t, r - n)) throw TypeError(`datePattern is invalid: [${e}].`);
|
|
616
616
|
}
|
|
617
617
|
r = n - 1;
|
|
618
618
|
} else if (i === "[") n++;
|
|
@@ -624,7 +624,7 @@ function nt(e) {
|
|
|
624
624
|
}
|
|
625
625
|
if (t) throw TypeError(`datePattern is invalid: [${e}].`);
|
|
626
626
|
}
|
|
627
|
-
function
|
|
627
|
+
function M(e, t) {
|
|
628
628
|
if (!Number.isInteger(t) || t < 1 || t > 2147483647) throw TypeError(`${e} days must be a positive JVM Int.`);
|
|
629
629
|
}
|
|
630
630
|
function N(e) {
|
|
@@ -641,25 +641,25 @@ function N(e) {
|
|
|
641
641
|
case "AND":
|
|
642
642
|
case "OR":
|
|
643
643
|
case "NOR":
|
|
644
|
-
|
|
644
|
+
k(`${e.op} operands`, e.operands), e.operands.forEach(N);
|
|
645
645
|
break;
|
|
646
646
|
case "ELEMENT_MATCH": N(e.predicate);
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
649
|
function it(e) {
|
|
650
|
-
return
|
|
650
|
+
return k("AND operands", e), {
|
|
651
651
|
op: "AND",
|
|
652
652
|
operands: [...e]
|
|
653
653
|
};
|
|
654
654
|
}
|
|
655
655
|
function at(e) {
|
|
656
|
-
return
|
|
656
|
+
return k("OR operands", e), {
|
|
657
657
|
op: "OR",
|
|
658
658
|
operands: [...e]
|
|
659
659
|
};
|
|
660
660
|
}
|
|
661
661
|
function ot(e) {
|
|
662
|
-
return
|
|
662
|
+
return k("NOR operands", e), {
|
|
663
663
|
op: "NOR",
|
|
664
664
|
operands: [...e]
|
|
665
665
|
};
|
|
@@ -674,11 +674,11 @@ var P = {
|
|
|
674
674
|
id(e) {
|
|
675
675
|
return {
|
|
676
676
|
op: "ID",
|
|
677
|
-
value:
|
|
677
|
+
value: D("ID value", e)
|
|
678
678
|
};
|
|
679
679
|
},
|
|
680
680
|
ids(e) {
|
|
681
|
-
return
|
|
681
|
+
return k("IDS values", e), e.forEach((e) => D("IDS value", e)), {
|
|
682
682
|
op: "IDS",
|
|
683
683
|
values: [...e]
|
|
684
684
|
};
|
|
@@ -686,11 +686,11 @@ var P = {
|
|
|
686
686
|
aggregateId(e) {
|
|
687
687
|
return {
|
|
688
688
|
op: "AGGREGATE_ID",
|
|
689
|
-
value:
|
|
689
|
+
value: D("AGGREGATE_ID value", e)
|
|
690
690
|
};
|
|
691
691
|
},
|
|
692
692
|
aggregateIds(e) {
|
|
693
|
-
return
|
|
693
|
+
return k("AGGREGATE_IDS values", e), e.forEach((e) => D("AGGREGATE_IDS value", e)), {
|
|
694
694
|
op: "AGGREGATE_IDS",
|
|
695
695
|
values: [...e]
|
|
696
696
|
};
|
|
@@ -698,19 +698,19 @@ var P = {
|
|
|
698
698
|
tenantId(e) {
|
|
699
699
|
return {
|
|
700
700
|
op: "TENANT_ID",
|
|
701
|
-
value:
|
|
701
|
+
value: D("TENANT_ID value", e)
|
|
702
702
|
};
|
|
703
703
|
},
|
|
704
704
|
ownerId(e) {
|
|
705
705
|
return {
|
|
706
706
|
op: "OWNER_ID",
|
|
707
|
-
value:
|
|
707
|
+
value: D("OWNER_ID value", e)
|
|
708
708
|
};
|
|
709
709
|
},
|
|
710
710
|
spaceId(e) {
|
|
711
711
|
return {
|
|
712
712
|
op: "SPACE_ID",
|
|
713
|
-
value:
|
|
713
|
+
value: D("SPACE_ID value", e)
|
|
714
714
|
};
|
|
715
715
|
},
|
|
716
716
|
and: it,
|
|
@@ -719,126 +719,138 @@ var P = {
|
|
|
719
719
|
eq(e, t) {
|
|
720
720
|
return {
|
|
721
721
|
op: "EQ",
|
|
722
|
-
field:
|
|
723
|
-
value:
|
|
722
|
+
field: w(e),
|
|
723
|
+
value: E(t)
|
|
724
724
|
};
|
|
725
725
|
},
|
|
726
726
|
ne(e, t) {
|
|
727
727
|
return {
|
|
728
728
|
op: "NE",
|
|
729
|
-
field:
|
|
730
|
-
value:
|
|
729
|
+
field: w(e),
|
|
730
|
+
value: E(t)
|
|
731
731
|
};
|
|
732
732
|
},
|
|
733
733
|
gt(e, t) {
|
|
734
734
|
return {
|
|
735
735
|
op: "GT",
|
|
736
|
-
field:
|
|
737
|
-
value:
|
|
736
|
+
field: w(e),
|
|
737
|
+
value: T(t, !1)
|
|
738
738
|
};
|
|
739
739
|
},
|
|
740
740
|
gte(e, t) {
|
|
741
741
|
return {
|
|
742
742
|
op: "GTE",
|
|
743
|
-
field:
|
|
744
|
-
value:
|
|
743
|
+
field: w(e),
|
|
744
|
+
value: T(t, !1)
|
|
745
745
|
};
|
|
746
746
|
},
|
|
747
747
|
lt(e, t) {
|
|
748
748
|
return {
|
|
749
749
|
op: "LT",
|
|
750
|
-
field:
|
|
751
|
-
value:
|
|
750
|
+
field: w(e),
|
|
751
|
+
value: T(t, !1)
|
|
752
752
|
};
|
|
753
753
|
},
|
|
754
754
|
lte(e, t) {
|
|
755
755
|
return {
|
|
756
756
|
op: "LTE",
|
|
757
|
-
field:
|
|
758
|
-
value:
|
|
757
|
+
field: w(e),
|
|
758
|
+
value: T(t, !1)
|
|
759
759
|
};
|
|
760
760
|
},
|
|
761
761
|
contains(e, t, n = "CASE_SENSITIVE") {
|
|
762
|
-
return
|
|
762
|
+
return O(n), {
|
|
763
763
|
op: "CONTAINS",
|
|
764
|
-
field:
|
|
765
|
-
value:
|
|
764
|
+
field: w(e),
|
|
765
|
+
value: D("CONTAINS value", t),
|
|
766
766
|
stringComparison: n
|
|
767
767
|
};
|
|
768
768
|
},
|
|
769
769
|
startsWith(e, t, n = "CASE_SENSITIVE") {
|
|
770
|
-
return
|
|
770
|
+
return O(n), {
|
|
771
771
|
op: "STARTS_WITH",
|
|
772
|
-
field:
|
|
773
|
-
value:
|
|
772
|
+
field: w(e),
|
|
773
|
+
value: D("STARTS_WITH value", t),
|
|
774
774
|
stringComparison: n
|
|
775
775
|
};
|
|
776
776
|
},
|
|
777
777
|
endsWith(e, t, n = "CASE_SENSITIVE") {
|
|
778
|
-
return
|
|
778
|
+
return O(n), {
|
|
779
779
|
op: "ENDS_WITH",
|
|
780
|
-
field:
|
|
781
|
-
value:
|
|
780
|
+
field: w(e),
|
|
781
|
+
value: D("ENDS_WITH value", t),
|
|
782
782
|
stringComparison: n
|
|
783
783
|
};
|
|
784
784
|
},
|
|
785
785
|
isIn(e, t) {
|
|
786
|
-
return
|
|
786
|
+
return k("IN values", t), t.forEach((e) => T(e, !1)), {
|
|
787
787
|
op: "IN",
|
|
788
|
-
field:
|
|
788
|
+
field: w(e),
|
|
789
789
|
values: [...t]
|
|
790
790
|
};
|
|
791
791
|
},
|
|
792
792
|
notIn(e, t) {
|
|
793
|
-
return
|
|
793
|
+
return k("NOT_IN values", t), t.forEach((e) => T(e, !1)), {
|
|
794
794
|
op: "NOT_IN",
|
|
795
|
-
field:
|
|
795
|
+
field: w(e),
|
|
796
796
|
values: [...t]
|
|
797
797
|
};
|
|
798
798
|
},
|
|
799
799
|
containsAll(e, t) {
|
|
800
|
-
return
|
|
800
|
+
return k("CONTAINS_ALL values", t), t.forEach((e) => T(e, !1)), {
|
|
801
801
|
op: "CONTAINS_ALL",
|
|
802
|
-
field:
|
|
802
|
+
field: w(e),
|
|
803
803
|
values: [...t]
|
|
804
804
|
};
|
|
805
805
|
},
|
|
806
806
|
between(e, t, n) {
|
|
807
807
|
return {
|
|
808
808
|
op: "BETWEEN",
|
|
809
|
-
field:
|
|
810
|
-
lowerBound:
|
|
811
|
-
upperBound:
|
|
809
|
+
field: w(e),
|
|
810
|
+
lowerBound: T(t, !1),
|
|
811
|
+
upperBound: T(n, !1)
|
|
812
812
|
};
|
|
813
813
|
},
|
|
814
814
|
isEmpty(e) {
|
|
815
815
|
return {
|
|
816
816
|
op: "IS_EMPTY",
|
|
817
|
-
field:
|
|
817
|
+
field: w(e)
|
|
818
|
+
};
|
|
819
|
+
},
|
|
820
|
+
isEmptyString(e) {
|
|
821
|
+
return {
|
|
822
|
+
op: "IS_EMPTY_STRING",
|
|
823
|
+
field: w(e)
|
|
824
|
+
};
|
|
825
|
+
},
|
|
826
|
+
isNotEmptyString(e) {
|
|
827
|
+
return {
|
|
828
|
+
op: "IS_NOT_EMPTY_STRING",
|
|
829
|
+
field: w(e)
|
|
818
830
|
};
|
|
819
831
|
},
|
|
820
832
|
isNull(e) {
|
|
821
833
|
return {
|
|
822
834
|
op: "IS_NULL",
|
|
823
|
-
field:
|
|
835
|
+
field: w(e)
|
|
824
836
|
};
|
|
825
837
|
},
|
|
826
838
|
isNotNull(e) {
|
|
827
839
|
return {
|
|
828
840
|
op: "IS_NOT_NULL",
|
|
829
|
-
field:
|
|
841
|
+
field: w(e)
|
|
830
842
|
};
|
|
831
843
|
},
|
|
832
844
|
exists(e) {
|
|
833
845
|
return {
|
|
834
846
|
op: "EXISTS",
|
|
835
|
-
field:
|
|
847
|
+
field: w(e)
|
|
836
848
|
};
|
|
837
849
|
},
|
|
838
850
|
notExists(e) {
|
|
839
851
|
return {
|
|
840
852
|
op: "NOT_EXISTS",
|
|
841
|
-
field:
|
|
853
|
+
field: w(e)
|
|
842
854
|
};
|
|
843
855
|
},
|
|
844
856
|
deletion(e) {
|
|
@@ -851,7 +863,7 @@ var P = {
|
|
|
851
863
|
elementMatch(e, t) {
|
|
852
864
|
return N(t), {
|
|
853
865
|
op: "ELEMENT_MATCH",
|
|
854
|
-
field:
|
|
866
|
+
field: w(e),
|
|
855
867
|
predicate: t
|
|
856
868
|
};
|
|
857
869
|
},
|
|
@@ -859,120 +871,120 @@ var P = {
|
|
|
859
871
|
if (typeof e != "string" || !e.trim()) throw TypeError("SEARCH query cannot be blank.");
|
|
860
872
|
if (t !== void 0 && (typeof t != "object" || !t || Array.isArray(t))) throw TypeError("SEARCH options must be a non-null object.");
|
|
861
873
|
let { fields: n = [], mode: r = "TERMS" } = t ?? {};
|
|
862
|
-
if (!Object.values(
|
|
874
|
+
if (!Object.values(S).includes(r)) throw TypeError(`SEARCH mode is invalid: [${String(r)}].`);
|
|
863
875
|
return {
|
|
864
876
|
op: "SEARCH",
|
|
865
877
|
query: e,
|
|
866
878
|
mode: r,
|
|
867
|
-
fields: n.map(
|
|
879
|
+
fields: n.map(w)
|
|
868
880
|
};
|
|
869
881
|
},
|
|
870
882
|
today(e, t = {}) {
|
|
871
883
|
return {
|
|
872
|
-
...
|
|
884
|
+
...A(t),
|
|
873
885
|
op: "TODAY",
|
|
874
|
-
field:
|
|
886
|
+
field: w(e)
|
|
875
887
|
};
|
|
876
888
|
},
|
|
877
889
|
beforeToday(e, t, n = {}) {
|
|
878
|
-
if (typeof t != "string" || !
|
|
890
|
+
if (typeof t != "string" || !Xe.test(t)) throw TypeError("BEFORE_TODAY time is invalid.");
|
|
879
891
|
return {
|
|
880
|
-
...
|
|
892
|
+
...A(n),
|
|
881
893
|
op: "BEFORE_TODAY",
|
|
882
|
-
field:
|
|
894
|
+
field: w(e),
|
|
883
895
|
time: t
|
|
884
896
|
};
|
|
885
897
|
},
|
|
886
898
|
tomorrow(e, t = {}) {
|
|
887
899
|
return {
|
|
888
|
-
...
|
|
900
|
+
...A(t),
|
|
889
901
|
op: "TOMORROW",
|
|
890
|
-
field:
|
|
902
|
+
field: w(e)
|
|
891
903
|
};
|
|
892
904
|
},
|
|
893
905
|
thisWeek(e, t = {}) {
|
|
894
906
|
return {
|
|
895
|
-
...
|
|
907
|
+
...A(t),
|
|
896
908
|
op: "THIS_WEEK",
|
|
897
|
-
field:
|
|
909
|
+
field: w(e)
|
|
898
910
|
};
|
|
899
911
|
},
|
|
900
912
|
nextWeek(e, t = {}) {
|
|
901
913
|
return {
|
|
902
|
-
...
|
|
914
|
+
...A(t),
|
|
903
915
|
op: "NEXT_WEEK",
|
|
904
|
-
field:
|
|
916
|
+
field: w(e)
|
|
905
917
|
};
|
|
906
918
|
},
|
|
907
919
|
lastWeek(e, t = {}) {
|
|
908
920
|
return {
|
|
909
|
-
...
|
|
921
|
+
...A(t),
|
|
910
922
|
op: "LAST_WEEK",
|
|
911
|
-
field:
|
|
923
|
+
field: w(e)
|
|
912
924
|
};
|
|
913
925
|
},
|
|
914
926
|
thisMonth(e, t = {}) {
|
|
915
927
|
return {
|
|
916
|
-
...
|
|
928
|
+
...A(t),
|
|
917
929
|
op: "THIS_MONTH",
|
|
918
|
-
field:
|
|
930
|
+
field: w(e)
|
|
919
931
|
};
|
|
920
932
|
},
|
|
921
933
|
lastMonth(e, t = {}) {
|
|
922
934
|
return {
|
|
923
|
-
...
|
|
935
|
+
...A(t),
|
|
924
936
|
op: "LAST_MONTH",
|
|
925
|
-
field:
|
|
937
|
+
field: w(e)
|
|
926
938
|
};
|
|
927
939
|
},
|
|
928
940
|
yesterday(e, t = {}) {
|
|
929
941
|
return {
|
|
930
|
-
...
|
|
942
|
+
...A(t),
|
|
931
943
|
op: "YESTERDAY",
|
|
932
|
-
field:
|
|
944
|
+
field: w(e)
|
|
933
945
|
};
|
|
934
946
|
},
|
|
935
947
|
nextMonth(e, t = {}) {
|
|
936
948
|
return {
|
|
937
|
-
...
|
|
949
|
+
...A(t),
|
|
938
950
|
op: "NEXT_MONTH",
|
|
939
|
-
field:
|
|
951
|
+
field: w(e)
|
|
940
952
|
};
|
|
941
953
|
},
|
|
942
954
|
lastYear(e, t = {}) {
|
|
943
955
|
return {
|
|
944
|
-
...
|
|
956
|
+
...A(t),
|
|
945
957
|
op: "LAST_YEAR",
|
|
946
|
-
field:
|
|
958
|
+
field: w(e)
|
|
947
959
|
};
|
|
948
960
|
},
|
|
949
961
|
thisYear(e, t = {}) {
|
|
950
962
|
return {
|
|
951
|
-
...
|
|
963
|
+
...A(t),
|
|
952
964
|
op: "THIS_YEAR",
|
|
953
|
-
field:
|
|
965
|
+
field: w(e)
|
|
954
966
|
};
|
|
955
967
|
},
|
|
956
968
|
nextYear(e, t = {}) {
|
|
957
969
|
return {
|
|
958
|
-
...
|
|
970
|
+
...A(t),
|
|
959
971
|
op: "NEXT_YEAR",
|
|
960
|
-
field:
|
|
972
|
+
field: w(e)
|
|
961
973
|
};
|
|
962
974
|
},
|
|
963
975
|
recentDays(e, t, n = {}) {
|
|
964
|
-
return
|
|
965
|
-
...
|
|
976
|
+
return M("RECENT_DAYS", t), {
|
|
977
|
+
...A(n),
|
|
966
978
|
op: "RECENT_DAYS",
|
|
967
|
-
field:
|
|
979
|
+
field: w(e),
|
|
968
980
|
days: t
|
|
969
981
|
};
|
|
970
982
|
},
|
|
971
983
|
earlierDays(e, t, n = {}) {
|
|
972
|
-
return
|
|
973
|
-
...
|
|
984
|
+
return M("EARLIER_DAYS", t), {
|
|
985
|
+
...A(n),
|
|
974
986
|
op: "EARLIER_DAYS",
|
|
975
|
-
field:
|
|
987
|
+
field: w(e),
|
|
976
988
|
days: t
|
|
977
989
|
};
|
|
978
990
|
}
|
|
@@ -984,20 +996,20 @@ var P = {
|
|
|
984
996
|
return e.FIELD = "FIELD", e.CONSTANT = "CONSTANT", e.BINARY = "BINARY", e;
|
|
985
997
|
}({}), ut = /* @__PURE__ */ function(e) {
|
|
986
998
|
return e.ADD = "ADD", e.SUBTRACT = "SUBTRACT", e.MULTIPLY = "MULTIPLY", e.DIVIDE = "DIVIDE", e;
|
|
987
|
-
}({}),
|
|
999
|
+
}({}), F = /* @__PURE__ */ function(e) {
|
|
988
1000
|
return e.YEAR = "YEAR", e.QUARTER = "QUARTER", e.MONTH = "MONTH", e.WEEK = "WEEK", e.DAY = "DAY", e.HOUR = "HOUR", e.MINUTE = "MINUTE", e.SECOND = "SECOND", e;
|
|
989
|
-
}({}),
|
|
1001
|
+
}({}), dt = /* @__PURE__ */ function(e) {
|
|
990
1002
|
return e.SUM = "SUM", e.AVG = "AVG", e.MIN = "MIN", e.MAX = "MAX", e;
|
|
991
1003
|
}({});
|
|
992
|
-
function
|
|
1004
|
+
function I(e) {
|
|
993
1005
|
return P.exists(e).field;
|
|
994
1006
|
}
|
|
995
|
-
function
|
|
996
|
-
if (
|
|
1007
|
+
function L(e) {
|
|
1008
|
+
if (I(e), e.includes(".")) throw TypeError("aggregation alias must contain one segment.");
|
|
997
1009
|
if (e.startsWith("__wow")) throw TypeError("aggregation alias must not use the reserved __wow prefix.");
|
|
998
1010
|
return e;
|
|
999
1011
|
}
|
|
1000
|
-
function
|
|
1012
|
+
function R(e, t, n) {
|
|
1001
1013
|
return {
|
|
1002
1014
|
type: "BINARY",
|
|
1003
1015
|
operator: e,
|
|
@@ -1005,17 +1017,17 @@ function L(e, t, n) {
|
|
|
1005
1017
|
right: n
|
|
1006
1018
|
};
|
|
1007
1019
|
}
|
|
1008
|
-
function
|
|
1020
|
+
function z(e, t, n) {
|
|
1009
1021
|
return {
|
|
1010
1022
|
type: "NUMERIC",
|
|
1011
1023
|
function: e,
|
|
1012
1024
|
expression: t,
|
|
1013
|
-
alias:
|
|
1025
|
+
alias: L(n)
|
|
1014
1026
|
};
|
|
1015
1027
|
}
|
|
1016
|
-
var
|
|
1028
|
+
var ft = {
|
|
1017
1029
|
element(e, t) {
|
|
1018
|
-
let n =
|
|
1030
|
+
let n = I(e);
|
|
1019
1031
|
return t === void 0 ? { path: n } : (P.elementMatch(e, t), {
|
|
1020
1032
|
path: n,
|
|
1021
1033
|
filter: t
|
|
@@ -1024,7 +1036,7 @@ var pt = {
|
|
|
1024
1036
|
field(e) {
|
|
1025
1037
|
return {
|
|
1026
1038
|
type: "FIELD",
|
|
1027
|
-
field:
|
|
1039
|
+
field: I(e)
|
|
1028
1040
|
};
|
|
1029
1041
|
},
|
|
1030
1042
|
constant(e) {
|
|
@@ -1034,59 +1046,59 @@ var pt = {
|
|
|
1034
1046
|
value: e
|
|
1035
1047
|
};
|
|
1036
1048
|
},
|
|
1037
|
-
add: (e, t) =>
|
|
1038
|
-
subtract: (e, t) =>
|
|
1039
|
-
multiply: (e, t) =>
|
|
1040
|
-
divide: (e, t) =>
|
|
1049
|
+
add: (e, t) => R("ADD", e, t),
|
|
1050
|
+
subtract: (e, t) => R("SUBTRACT", e, t),
|
|
1051
|
+
multiply: (e, t) => R("MULTIPLY", e, t),
|
|
1052
|
+
divide: (e, t) => R("DIVIDE", e, t),
|
|
1041
1053
|
terms(e, t) {
|
|
1042
1054
|
return {
|
|
1043
1055
|
type: "TERMS",
|
|
1044
|
-
field:
|
|
1045
|
-
alias:
|
|
1056
|
+
field: I(e),
|
|
1057
|
+
alias: L(t)
|
|
1046
1058
|
};
|
|
1047
1059
|
},
|
|
1048
1060
|
histogram(e, { interval: t, alias: n }) {
|
|
1049
1061
|
if (!Number.isFinite(t) || t <= 0) throw TypeError("histogram interval must be finite and greater than 0.");
|
|
1050
1062
|
return {
|
|
1051
1063
|
type: "HISTOGRAM",
|
|
1052
|
-
field:
|
|
1064
|
+
field: I(e),
|
|
1053
1065
|
interval: t,
|
|
1054
|
-
alias:
|
|
1066
|
+
alias: L(n)
|
|
1055
1067
|
};
|
|
1056
1068
|
},
|
|
1057
1069
|
dateHistogram(e, { unit: t, alias: n, timeZone: r = "UTC" }) {
|
|
1058
|
-
if (!Object.values(
|
|
1070
|
+
if (!Object.values(F).includes(t)) throw TypeError("date histogram unit is invalid.");
|
|
1059
1071
|
if (typeof r != "string" || !r.trim()) throw TypeError("date histogram timeZone cannot be blank.");
|
|
1060
1072
|
return {
|
|
1061
1073
|
type: "DATE_HISTOGRAM",
|
|
1062
|
-
field:
|
|
1074
|
+
field: I(e),
|
|
1063
1075
|
unit: t,
|
|
1064
|
-
alias:
|
|
1076
|
+
alias: L(n),
|
|
1065
1077
|
timeZone: r
|
|
1066
1078
|
};
|
|
1067
1079
|
},
|
|
1068
1080
|
any(e, t) {
|
|
1069
1081
|
return {
|
|
1070
1082
|
type: "ANY",
|
|
1071
|
-
field:
|
|
1072
|
-
alias:
|
|
1083
|
+
field: I(e),
|
|
1084
|
+
alias: L(t)
|
|
1073
1085
|
};
|
|
1074
1086
|
},
|
|
1075
1087
|
count(e) {
|
|
1076
1088
|
return {
|
|
1077
1089
|
type: "COUNT",
|
|
1078
|
-
alias:
|
|
1090
|
+
alias: L(e)
|
|
1079
1091
|
};
|
|
1080
1092
|
},
|
|
1081
|
-
sum: (e, t) =>
|
|
1082
|
-
avg: (e, t) =>
|
|
1083
|
-
min: (e, t) =>
|
|
1084
|
-
max: (e, t) =>
|
|
1085
|
-
},
|
|
1093
|
+
sum: (e, t) => z("SUM", e, t),
|
|
1094
|
+
avg: (e, t) => z("AVG", e, t),
|
|
1095
|
+
min: (e, t) => z("MIN", e, t),
|
|
1096
|
+
max: (e, t) => z("MAX", e, t)
|
|
1097
|
+
}, B = {
|
|
1086
1098
|
index: 1,
|
|
1087
1099
|
size: 10
|
|
1088
1100
|
};
|
|
1089
|
-
function
|
|
1101
|
+
function pt({ index: e = B.index, size: t = B.size } = B) {
|
|
1090
1102
|
return {
|
|
1091
1103
|
index: e,
|
|
1092
1104
|
size: t
|
|
@@ -1094,11 +1106,11 @@ function mt({ index: e = z.index, size: t = z.size } = z) {
|
|
|
1094
1106
|
}
|
|
1095
1107
|
//#endregion
|
|
1096
1108
|
//#region src/query/projection.ts
|
|
1097
|
-
var
|
|
1098
|
-
function
|
|
1099
|
-
return
|
|
1109
|
+
var mt = {};
|
|
1110
|
+
function ht() {
|
|
1111
|
+
return mt;
|
|
1100
1112
|
}
|
|
1101
|
-
function
|
|
1113
|
+
function gt({ include: e, exclude: t } = ht()) {
|
|
1102
1114
|
return {
|
|
1103
1115
|
include: e,
|
|
1104
1116
|
exclude: t
|
|
@@ -1106,15 +1118,15 @@ function _t({ include: e, exclude: t } = gt()) {
|
|
|
1106
1118
|
}
|
|
1107
1119
|
//#endregion
|
|
1108
1120
|
//#region src/query/queryable.ts
|
|
1109
|
-
function
|
|
1121
|
+
function V({ condition: e, filter: t }) {
|
|
1110
1122
|
if (t === null) throw TypeError("filter cannot be null.");
|
|
1111
1123
|
if (t !== void 0) return { filter: t };
|
|
1112
1124
|
if (e === null) throw TypeError("condition cannot be null.");
|
|
1113
|
-
return { condition: e === void 0 ?
|
|
1125
|
+
return { condition: e === void 0 ? x() : e };
|
|
1114
1126
|
}
|
|
1115
|
-
function
|
|
1127
|
+
function H({ condition: e, filter: t, projection: n, sort: r } = {}) {
|
|
1116
1128
|
return {
|
|
1117
|
-
...
|
|
1129
|
+
...V({
|
|
1118
1130
|
condition: e,
|
|
1119
1131
|
filter: t
|
|
1120
1132
|
}),
|
|
@@ -1122,20 +1134,20 @@ function V({ condition: e, filter: t, projection: n, sort: r } = {}) {
|
|
|
1122
1134
|
sort: r
|
|
1123
1135
|
};
|
|
1124
1136
|
}
|
|
1125
|
-
function
|
|
1137
|
+
function U({ condition: e, filter: t, projection: n, sort: r, limit: i } = {}) {
|
|
1126
1138
|
return {
|
|
1127
|
-
...
|
|
1139
|
+
...V({
|
|
1128
1140
|
condition: e,
|
|
1129
1141
|
filter: t
|
|
1130
1142
|
}),
|
|
1131
1143
|
projection: n,
|
|
1132
1144
|
sort: r,
|
|
1133
|
-
limit: i ?? (t === void 0 ?
|
|
1145
|
+
limit: i ?? (t === void 0 ? B.size : 0)
|
|
1134
1146
|
};
|
|
1135
1147
|
}
|
|
1136
|
-
function
|
|
1148
|
+
function _t({ condition: e, filter: t, projection: n, sort: r, pagination: i = B } = {}) {
|
|
1137
1149
|
return {
|
|
1138
|
-
...
|
|
1150
|
+
...V({
|
|
1139
1151
|
condition: e,
|
|
1140
1152
|
filter: t
|
|
1141
1153
|
}),
|
|
@@ -1144,11 +1156,11 @@ function vt({ condition: e, filter: t, projection: n, sort: r, pagination: i = z
|
|
|
1144
1156
|
pagination: i
|
|
1145
1157
|
};
|
|
1146
1158
|
}
|
|
1147
|
-
var
|
|
1159
|
+
var vt = {
|
|
1148
1160
|
total: 0,
|
|
1149
1161
|
list: []
|
|
1150
1162
|
};
|
|
1151
|
-
function
|
|
1163
|
+
function yt({ total: e, list: t = [] } = vt) {
|
|
1152
1164
|
return e === void 0 && (e = t.length), {
|
|
1153
1165
|
total: e,
|
|
1154
1166
|
list: t
|
|
@@ -1156,7 +1168,7 @@ function bt({ total: e, list: t = [] } = yt) {
|
|
|
1156
1168
|
}
|
|
1157
1169
|
//#endregion
|
|
1158
1170
|
//#region src/query/sort.ts
|
|
1159
|
-
var
|
|
1171
|
+
var bt = /* @__PURE__ */ function(e) {
|
|
1160
1172
|
return e.ASC = "ASC", e.DESC = "DESC", e;
|
|
1161
1173
|
}({});
|
|
1162
1174
|
function xt(e) {
|
|
@@ -1238,6 +1250,9 @@ var Ct = class e {
|
|
|
1238
1250
|
static {
|
|
1239
1251
|
this.PAGED = `${e.EVENT_STREAM_RESOURCE_NAME}/paged`;
|
|
1240
1252
|
}
|
|
1253
|
+
static {
|
|
1254
|
+
this.CURSOR = `${e.EVENT_STREAM_RESOURCE_NAME}/cursor`;
|
|
1255
|
+
}
|
|
1241
1256
|
}, G = class {
|
|
1242
1257
|
constructor(e) {
|
|
1243
1258
|
this.apiMetadata = e;
|
|
@@ -1248,6 +1263,9 @@ var Ct = class e {
|
|
|
1248
1263
|
aggregateStream(e, t, n) {
|
|
1249
1264
|
throw a(e, t, n);
|
|
1250
1265
|
}
|
|
1266
|
+
cursor(e, t, n) {
|
|
1267
|
+
throw a(e, t, n);
|
|
1268
|
+
}
|
|
1251
1269
|
count(e, t, n) {
|
|
1252
1270
|
throw a(e, t, n);
|
|
1253
1271
|
}
|
|
@@ -1287,6 +1305,17 @@ p([
|
|
|
1287
1305
|
]),
|
|
1288
1306
|
d("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
1289
1307
|
], G.prototype, "aggregateStream", null), p([
|
|
1308
|
+
u(W.CURSOR),
|
|
1309
|
+
f(0, o()),
|
|
1310
|
+
f(1, i()),
|
|
1311
|
+
d("design:type", Function),
|
|
1312
|
+
d("design:paramtypes", [
|
|
1313
|
+
Object,
|
|
1314
|
+
typeof Record > "u" ? Object : Record,
|
|
1315
|
+
typeof AbortController > "u" ? Object : AbortController
|
|
1316
|
+
]),
|
|
1317
|
+
d("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
1318
|
+
], G.prototype, "cursor", null), p([
|
|
1290
1319
|
u(W.COUNT),
|
|
1291
1320
|
f(0, o()),
|
|
1292
1321
|
f(1, i()),
|
|
@@ -1398,6 +1427,12 @@ var wt = class {
|
|
|
1398
1427
|
static {
|
|
1399
1428
|
this.PAGED_STATE = `${e.PAGED}/state`;
|
|
1400
1429
|
}
|
|
1430
|
+
static {
|
|
1431
|
+
this.CURSOR = `${e.SNAPSHOT_RESOURCE_NAME}/cursor`;
|
|
1432
|
+
}
|
|
1433
|
+
static {
|
|
1434
|
+
this.CURSOR_STATE = `${e.CURSOR}/state`;
|
|
1435
|
+
}
|
|
1401
1436
|
static {
|
|
1402
1437
|
this.SINGLE = `${e.SNAPSHOT_RESOURCE_NAME}/single`;
|
|
1403
1438
|
}
|
|
@@ -1414,6 +1449,12 @@ var wt = class {
|
|
|
1414
1449
|
aggregateStream(e, t, n) {
|
|
1415
1450
|
throw a(e, t, n);
|
|
1416
1451
|
}
|
|
1452
|
+
cursor(e, t, n) {
|
|
1453
|
+
throw a(e, t, n);
|
|
1454
|
+
}
|
|
1455
|
+
cursorState(e, t, n) {
|
|
1456
|
+
throw a(e, t, n);
|
|
1457
|
+
}
|
|
1417
1458
|
count(e, t, n) {
|
|
1418
1459
|
throw a(e, t, n);
|
|
1419
1460
|
}
|
|
@@ -1442,16 +1483,16 @@ var wt = class {
|
|
|
1442
1483
|
throw a(e, t, n);
|
|
1443
1484
|
}
|
|
1444
1485
|
getById(e, t, n) {
|
|
1445
|
-
let r =
|
|
1486
|
+
let r = H({ condition: b(e) });
|
|
1446
1487
|
return this.single(r, t, n);
|
|
1447
1488
|
}
|
|
1448
1489
|
getStateById(e, t, n) {
|
|
1449
|
-
let r =
|
|
1490
|
+
let r = H({ condition: b(e) });
|
|
1450
1491
|
return this.singleState(r, t, n);
|
|
1451
1492
|
}
|
|
1452
1493
|
getByIds(e, t, n) {
|
|
1453
1494
|
if (e.length === 0) return Promise.resolve([]);
|
|
1454
|
-
let r =
|
|
1495
|
+
let r = U({
|
|
1455
1496
|
filter: P.aggregateIds(e),
|
|
1456
1497
|
limit: e.length
|
|
1457
1498
|
});
|
|
@@ -1459,7 +1500,7 @@ var wt = class {
|
|
|
1459
1500
|
}
|
|
1460
1501
|
getStateByIds(e, t, n) {
|
|
1461
1502
|
if (e.length === 0) return Promise.resolve([]);
|
|
1462
|
-
let r =
|
|
1503
|
+
let r = U({
|
|
1463
1504
|
filter: P.aggregateIds(e),
|
|
1464
1505
|
limit: e.length
|
|
1465
1506
|
});
|
|
@@ -1492,6 +1533,28 @@ p([
|
|
|
1492
1533
|
]),
|
|
1493
1534
|
d("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
1494
1535
|
], q.prototype, "aggregateStream", null), p([
|
|
1536
|
+
u(K.CURSOR),
|
|
1537
|
+
f(0, o()),
|
|
1538
|
+
f(1, i()),
|
|
1539
|
+
d("design:type", Function),
|
|
1540
|
+
d("design:paramtypes", [
|
|
1541
|
+
Object,
|
|
1542
|
+
typeof Record > "u" ? Object : Record,
|
|
1543
|
+
typeof AbortController > "u" ? Object : AbortController
|
|
1544
|
+
]),
|
|
1545
|
+
d("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
1546
|
+
], q.prototype, "cursor", null), p([
|
|
1547
|
+
u(K.CURSOR_STATE),
|
|
1548
|
+
f(0, o()),
|
|
1549
|
+
f(1, i()),
|
|
1550
|
+
d("design:type", Function),
|
|
1551
|
+
d("design:paramtypes", [
|
|
1552
|
+
Object,
|
|
1553
|
+
typeof Record > "u" ? Object : Record,
|
|
1554
|
+
typeof AbortController > "u" ? Object : AbortController
|
|
1555
|
+
]),
|
|
1556
|
+
d("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
1557
|
+
], q.prototype, "cursorState", null), p([
|
|
1495
1558
|
u(K.COUNT),
|
|
1496
1559
|
f(0, o()),
|
|
1497
1560
|
f(1, i()),
|
|
@@ -1754,31 +1817,16 @@ p([
|
|
|
1754
1817
|
], Z.prototype, "loadTimeBased", null), Z = p([r(), d("design:paramtypes", [Object])], Z);
|
|
1755
1818
|
//#endregion
|
|
1756
1819
|
//#region src/query/cursorQuery.ts
|
|
1757
|
-
var Tt =
|
|
1758
|
-
function
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
function Dt({ field: e, cursorId: t = "~", direction: n = U.DESC }) {
|
|
1762
|
-
return n === U.ASC ? P.gt(e, t) : P.lt(e, t);
|
|
1763
|
-
}
|
|
1764
|
-
function Q({ field: e, direction: t = U.DESC }) {
|
|
1765
|
-
return {
|
|
1766
|
-
field: e,
|
|
1767
|
-
direction: t
|
|
1768
|
-
};
|
|
1769
|
-
}
|
|
1770
|
-
function Ot(e) {
|
|
1771
|
-
let t = e.query, n = Q(e), r = "filter" in t ? t.filter : void 0;
|
|
1772
|
-
if (r !== void 0) return {
|
|
1773
|
-
...t,
|
|
1774
|
-
filter: P.and([Dt(e), r]),
|
|
1775
|
-
sort: [n]
|
|
1776
|
-
};
|
|
1777
|
-
let i = t;
|
|
1820
|
+
var Tt = 10, Q = 2147483646, Et = 32;
|
|
1821
|
+
function Dt({ filter: e, projection: t = {}, sort: n = [], size: r = 10, cursor: i = null }) {
|
|
1822
|
+
if (!Number.isInteger(r) || r < 1 || r > 2147483646) throw TypeError(`size must be between 1 and ${Q}.`);
|
|
1823
|
+
if (n.length > 32) throw TypeError("sort must contain at most 32 fields.");
|
|
1778
1824
|
return {
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
sort:
|
|
1825
|
+
filter: e,
|
|
1826
|
+
projection: t,
|
|
1827
|
+
sort: n,
|
|
1828
|
+
size: r,
|
|
1829
|
+
cursor: i
|
|
1782
1830
|
};
|
|
1783
1831
|
}
|
|
1784
1832
|
//#endregion
|
|
@@ -1790,7 +1838,7 @@ function $(e) {
|
|
|
1790
1838
|
basePath: n
|
|
1791
1839
|
};
|
|
1792
1840
|
}
|
|
1793
|
-
var
|
|
1841
|
+
var Ot = class {
|
|
1794
1842
|
constructor(e) {
|
|
1795
1843
|
this.defaultOptions = e;
|
|
1796
1844
|
}
|
|
@@ -1822,11 +1870,11 @@ var kt = class {
|
|
|
1822
1870
|
});
|
|
1823
1871
|
return new G(t);
|
|
1824
1872
|
}
|
|
1825
|
-
},
|
|
1873
|
+
}, kt = {}, At = ["*"], jt = /* @__PURE__ */ function(e) {
|
|
1826
1874
|
return e.NONE = "", e.TENANT = "/tenant/{tenantId}", e.OWNER = "/owner/{ownerId}", e.TENANT_OWNER = "/tenant/{tenantId}/owner/{ownerId}", e;
|
|
1827
|
-
}({}),
|
|
1875
|
+
}({}), Mt = /* @__PURE__ */ function(e) {
|
|
1828
1876
|
return e.RECOVERABLE = "RECOVERABLE", e.UNKNOWN = "UNKNOWN", e.UNRECOVERABLE = "UNRECOVERABLE", e;
|
|
1829
|
-
}({}),
|
|
1877
|
+
}({}), Nt = class e {
|
|
1830
1878
|
static {
|
|
1831
1879
|
this.SUCCEEDED = "Ok";
|
|
1832
1880
|
}
|
|
@@ -1893,14 +1941,14 @@ var kt = class {
|
|
|
1893
1941
|
static isError(t) {
|
|
1894
1942
|
return !e.isSucceeded(t);
|
|
1895
1943
|
}
|
|
1896
|
-
},
|
|
1944
|
+
}, Pt = /* @__PURE__ */ function(e) {
|
|
1897
1945
|
return e.COMMAND = "COMMAND", e.ERROR = "ERROR", e.EVENT = "EVENT", e.SOURCING = "SOURCING", e.STATE_EVENT = "STATE_EVENT", e;
|
|
1898
|
-
}({}),
|
|
1946
|
+
}({}), Ft = "", It = /* @__PURE__ */ function(e) {
|
|
1899
1947
|
return e.MAP = "MAP", e.STRING = "STRING", e;
|
|
1900
1948
|
}({});
|
|
1901
1949
|
//#endregion
|
|
1902
1950
|
//#region src/getPropertyValue.ts
|
|
1903
|
-
function
|
|
1951
|
+
function Lt(e, t, n) {
|
|
1904
1952
|
if (e == null) return n;
|
|
1905
1953
|
let r = Array.isArray(t) ? t : t.split(".").filter(Boolean);
|
|
1906
1954
|
if (r.length === 0) return e;
|
|
@@ -1917,6 +1965,6 @@ function Rt(e, t, n) {
|
|
|
1917
1965
|
return i;
|
|
1918
1966
|
}
|
|
1919
1967
|
//#endregion
|
|
1920
|
-
export {
|
|
1968
|
+
export { F as AggregationDateUnit, ut as AggregationExpressionOperator, lt as AggregationExpressionType, dt as AggregationFunction, st as AggregationGroupType, ct as AggregationMetricType, m as CommandClient, te as CommandHeaders, ne as CommandStage, ae as ConditionOptionKey, Tt as DEFAULT_CURSOR_SIZE, Ft as DEFAULT_OWNER_ID, B as DEFAULT_PAGINATION, mt as DEFAULT_PROJECTION, y as DeletionState, Ct as DomainEventStreamMetadataFields, kt as EMPTY_ABAC_TAGS, vt as EMPTY_PAGED_LIST, ie as EMPTY_VALUE_OPERATORS, Nt as ErrorCodes, G as EventStreamQueryClient, W as EventStreamQueryEndpointPaths, Je as FilterOperator, Pt as FunctionKind, re as LOGICAL_OPERATORS, Z as LoadOwnerStateAggregateClient, X as LoadOwnerStateAggregateEndpointPaths, Y as LoadStateAggregateClient, J as LoadStateAggregateEndpointPaths, Q as MAX_CURSOR_SIZE, Et as MAX_CURSOR_SORT_FIELDS, It as MessageHeaderSqlType, h as Operator, Ot as QueryClientFactory, Mt as RecoverableType, jt as ResourceAttributionPathSpec, S as SearchMode, wt as SnapshotMetadataFields, q as SnapshotQueryClient, K as SnapshotQueryEndpointPaths, bt as SortDirection, Ye as StringComparison, C as TimeUnit, At as WILDCARD_ABAC_TAG_VALUES, ge as active, b as aggregateId, de as aggregateIds, ft as aggregation, x as all, De as allIn, oe as and, xt as asc, Re as beforeToday, Ee as between, Ce as contains, $ as createQueryApiMetadata, Dt as cursorQuery, v as dateOptions, ht as defaultProjection, he as deleted, St as desc, Ke as earlierDays, je as elemMatch, Ae as endsWith, _e as eq, Ie as exists, P as filter, Lt as getPropertyValue, ye as gt, xe as gte, le as id, ue as ids, _ as ignoreCaseOptions, Fe as isFalse, we as isIn, Me as isNull, Pe as isTrue, g as isValidateCondition, We as lastMonth, He as lastWeek, U as listQuery, be as lt, Se as lte, ke as match, ve as ne, Ve as nextWeek, ce as nor, Te as notIn, Ne as notNull, se as or, pe as ownerId, yt as pagedList, _t as pagedQuery, pt as pagination, gt as projection, qe as raw, Ge as recentDays, H as singleQuery, me as spaceId, Oe as startsWith, fe as tenantId, Ue as thisMonth, Be as thisWeek, Le as today, ze as tomorrow };
|
|
1921
1969
|
|
|
1922
1970
|
//# sourceMappingURL=index.es.js.map
|