@ahoo-wang/fetcher-wow 3.17.0 → 3.18.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.
Files changed (39) hide show
  1. package/README.md +150 -62
  2. package/README.zh-CN.md +133 -51
  3. package/dist/index.cjs.js +1 -1
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.es.js +1014 -355
  6. package/dist/index.es.js.map +1 -1
  7. package/dist/query/aggregation.d.ts +131 -0
  8. package/dist/query/aggregation.d.ts.map +1 -0
  9. package/dist/query/condition.d.ts +52 -0
  10. package/dist/query/condition.d.ts.map +1 -1
  11. package/dist/query/cursorQuery.d.ts +10 -1
  12. package/dist/query/cursorQuery.d.ts.map +1 -1
  13. package/dist/query/event/eventStreamQueryClient.d.ts +21 -21
  14. package/dist/query/event/eventStreamQueryClient.d.ts.map +1 -1
  15. package/dist/query/filter.d.ts +224 -0
  16. package/dist/query/filter.d.ts.map +1 -0
  17. package/dist/query/index.d.ts +2 -0
  18. package/dist/query/index.d.ts.map +1 -1
  19. package/dist/query/locale/en_US.cjs.js.map +1 -1
  20. package/dist/query/locale/en_US.d.ts +1 -0
  21. package/dist/query/locale/en_US.d.ts.map +1 -1
  22. package/dist/query/locale/en_US.es.js.map +1 -1
  23. package/dist/query/locale/operatorLocale.d.ts +1 -0
  24. package/dist/query/locale/operatorLocale.d.ts.map +1 -1
  25. package/dist/query/locale/zh_CN.cjs.js.map +1 -1
  26. package/dist/query/locale/zh_CN.d.ts +1 -0
  27. package/dist/query/locale/zh_CN.d.ts.map +1 -1
  28. package/dist/query/locale/zh_CN.es.js.map +1 -1
  29. package/dist/query/operator.d.ts +3 -0
  30. package/dist/query/operator.d.ts.map +1 -1
  31. package/dist/query/queryApi.d.ts +9 -8
  32. package/dist/query/queryApi.d.ts.map +1 -1
  33. package/dist/query/queryable.d.ts +34 -4
  34. package/dist/query/queryable.d.ts.map +1 -1
  35. package/dist/query/snapshot/snapshotQueryApi.d.ts +12 -5
  36. package/dist/query/snapshot/snapshotQueryApi.d.ts.map +1 -1
  37. package/dist/query/snapshot/snapshotQueryClient.d.ts +46 -42
  38. package/dist/query/snapshot/snapshotQueryClient.d.ts.map +1 -1
  39. package/package.json +9 -8
package/dist/index.es.js CHANGED
@@ -1,20 +1,20 @@
1
1
  import { ContentTypeValues as e, combineURLs as t } from "@ahoo-wang/fetcher";
2
2
  import { JsonEventStreamResultExtractor as n } from "@ahoo-wang/fetcher-eventstream";
3
- import { api as r, attribute as i, autoGeneratedError as a, body as o, endpoint as s, get as c, path as l, post as u, request as d } from "@ahoo-wang/fetcher-decorator";
3
+ import { api as r, attribute as i, autoGeneratedError as a, body as o, endpoint as s, get as c, path as l, post as u, request as ee } from "@ahoo-wang/fetcher-decorator";
4
4
  //#region \0@oxc-project+runtime@0.144.0/helpers/esm/decorateMetadata.js
5
- function f(e, t) {
5
+ function d(e, t) {
6
6
  if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
7
7
  }
8
8
  //#endregion
9
9
  //#region \0@oxc-project+runtime@0.144.0/helpers/esm/decorateParam.js
10
- function p(e, t) {
10
+ function f(e, t) {
11
11
  return function(n, r) {
12
12
  t(n, r, e);
13
13
  };
14
14
  }
15
15
  //#endregion
16
16
  //#region \0@oxc-project+runtime@0.144.0/helpers/esm/decorate.js
17
- function m(e, t, n, r) {
17
+ function p(e, t, n, r) {
18
18
  var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
19
19
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
20
20
  else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
@@ -22,7 +22,7 @@ function m(e, t, n, r) {
22
22
  }
23
23
  //#endregion
24
24
  //#region src/command/commandClient.ts
25
- var h = class {
25
+ var m = class {
26
26
  constructor(e) {
27
27
  this.apiMetadata = e;
28
28
  }
@@ -33,27 +33,27 @@ var h = class {
33
33
  throw a(e, t);
34
34
  }
35
35
  };
36
- m([
36
+ p([
37
37
  s(),
38
- p(0, d()),
39
- p(1, i()),
40
- f("design:type", Function),
41
- f("design:paramtypes", [Object, typeof Record > "u" ? Object : Record]),
42
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
43
- ], h.prototype, "send", null), m([
38
+ f(0, ee()),
39
+ f(1, i()),
40
+ d("design:type", Function),
41
+ d("design:paramtypes", [Object, typeof Record > "u" ? Object : Record]),
42
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
43
+ ], m.prototype, "send", null), p([
44
44
  s(void 0, void 0, {
45
45
  headers: { Accept: e.TEXT_EVENT_STREAM },
46
46
  resultExtractor: n
47
47
  }),
48
- p(0, d()),
49
- p(1, i()),
50
- f("design:type", Function),
51
- f("design:paramtypes", [Object, typeof Record > "u" ? Object : Record]),
52
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
53
- ], h.prototype, "sendAndWaitStream", null), h = m([r(), f("design:paramtypes", [Object])], h);
48
+ f(0, ee()),
49
+ f(1, i()),
50
+ d("design:type", Function),
51
+ d("design:paramtypes", [Object, typeof Record > "u" ? Object : Record]),
52
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
53
+ ], m.prototype, "sendAndWaitStream", null), m = p([r(), d("design:paramtypes", [Object])], m);
54
54
  //#endregion
55
55
  //#region src/command/commandHeaders.ts
56
- var ee = class e {
56
+ var te = class e {
57
57
  static {
58
58
  this.COMMAND_HEADERS_PREFIX = "Command-";
59
59
  }
@@ -123,15 +123,15 @@ var ee = class e {
123
123
  static {
124
124
  this.COMMAND_HEADER_X_PREFIX = `${e.COMMAND_HEADERS_PREFIX}Header-`;
125
125
  }
126
- }, te = /* @__PURE__ */ function(e) {
126
+ }, ne = /* @__PURE__ */ function(e) {
127
127
  return e.SENT = "SENT", e.PROCESSED = "PROCESSED", e.SNAPSHOT = "SNAPSHOT", e.PROJECTED = "PROJECTED", e.EVENT_HANDLED = "EVENT_HANDLED", e.SAGA_HANDLED = "SAGA_HANDLED", e;
128
- }({}), g = /* @__PURE__ */ function(e) {
128
+ }({}), h = /* @__PURE__ */ function(e) {
129
129
  return e.AND = "AND", e.OR = "OR", e.NOR = "NOR", 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.DELETED = "DELETED", e.ALL = "ALL", e.EQ = "EQ", e.NE = "NE", e.GT = "GT", e.LT = "LT", e.GTE = "GTE", e.LTE = "LTE", e.CONTAINS = "CONTAINS", e.IN = "IN", e.NOT_IN = "NOT_IN", e.BETWEEN = "BETWEEN", e.ALL_IN = "ALL_IN", e.STARTS_WITH = "STARTS_WITH", e.ENDS_WITH = "ENDS_WITH", e.ELEM_MATCH = "ELEM_MATCH", e.NULL = "NULL", e.NOT_NULL = "NOT_NULL", e.TRUE = "TRUE", e.FALSE = "FALSE", e.EXISTS = "EXISTS", 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.RECENT_DAYS = "RECENT_DAYS", e.EARLIER_DAYS = "EARLIER_DAYS", e.MATCH = "MATCH", e.RAW = "RAW", e;
130
- }({}), ne = /* @__PURE__ */ new Set([
130
+ }({}), re = /* @__PURE__ */ new Set([
131
131
  "AND",
132
132
  "OR",
133
133
  "NOR"
134
- ]), re = /* @__PURE__ */ new Set([
134
+ ]), ie = /* @__PURE__ */ new Set([
135
135
  "NULL",
136
136
  "NOT_NULL",
137
137
  "TRUE",
@@ -147,10 +147,10 @@ var ee = class e {
147
147
  ]);
148
148
  //#endregion
149
149
  //#region src/query/condition.ts
150
- function _(e) {
150
+ function g(e) {
151
151
  return !!e;
152
152
  }
153
- var ie = class {
153
+ var ae = class {
154
154
  static {
155
155
  this.IGNORE_CASE_OPTION_KEY = "ignoreCase";
156
156
  }
@@ -161,333 +161,932 @@ var ie = class {
161
161
  this.DATE_PATTERN_OPTION_KEY = "datePattern";
162
162
  }
163
163
  };
164
- function v(e) {
164
+ function _(e) {
165
165
  if (e !== void 0) return { ignoreCase: e };
166
166
  }
167
- function y(e, t) {
167
+ function v(e, t) {
168
168
  if (e === void 0 && t === void 0) return;
169
169
  let n = {};
170
170
  return e !== void 0 && (n.datePattern = e), t !== void 0 && (n.zoneId = t), n;
171
171
  }
172
- var ae = /* @__PURE__ */ function(e) {
172
+ var y = /* @__PURE__ */ function(e) {
173
173
  return e.ACTIVE = "ACTIVE", e.DELETED = "DELETED", e.ALL = "ALL", e;
174
174
  }({});
175
175
  function b(...e) {
176
- if (e.length === 0) return w();
177
- if (e.length === 1) return _(e[0]) ? e[0] : w();
176
+ if (e.length === 0) return S();
177
+ if (e.length === 1) return g(e[0]) ? e[0] : S();
178
178
  let t = [];
179
179
  return e.forEach((e) => {
180
- e?.operator === g.ALL || !_(e) || (e.operator === g.AND && e.children ? t.push(...e.children) : t.push(e));
181
- }), t.length === 0 ? w() : {
182
- operator: g.AND,
180
+ e?.operator === h.ALL || !g(e) || (e.operator === h.AND && e.children ? t.push(...e.children) : t.push(e));
181
+ }), t.length === 0 ? S() : {
182
+ operator: h.AND,
183
183
  children: t
184
184
  };
185
185
  }
186
186
  function oe(...e) {
187
- let t = e?.filter((e) => _(e));
188
- return t.length === 0 ? w() : {
189
- operator: g.OR,
187
+ let t = e?.filter((e) => g(e));
188
+ return t.length === 0 ? S() : {
189
+ operator: h.OR,
190
190
  children: t
191
191
  };
192
192
  }
193
193
  function se(...e) {
194
- return e.length === 0 ? w() : {
195
- operator: g.NOR,
194
+ return e.length === 0 ? S() : {
195
+ operator: h.NOR,
196
196
  children: e
197
197
  };
198
198
  }
199
199
  function ce(e) {
200
200
  return {
201
- operator: g.ID,
201
+ operator: h.ID,
202
202
  value: e
203
203
  };
204
204
  }
205
205
  function le(e) {
206
206
  return {
207
- operator: g.IDS,
207
+ operator: h.IDS,
208
208
  value: e
209
209
  };
210
210
  }
211
211
  function x(e) {
212
212
  return {
213
- operator: g.AGGREGATE_ID,
213
+ operator: h.AGGREGATE_ID,
214
214
  value: e
215
215
  };
216
216
  }
217
- function S(e) {
217
+ function ue(e) {
218
218
  return {
219
- operator: g.AGGREGATE_IDS,
219
+ operator: h.AGGREGATE_IDS,
220
220
  value: e
221
221
  };
222
222
  }
223
- function ue(e) {
223
+ function de(e) {
224
224
  return {
225
- operator: g.TENANT_ID,
225
+ operator: h.TENANT_ID,
226
226
  value: e
227
227
  };
228
228
  }
229
- function de(e) {
229
+ function fe(e) {
230
230
  return {
231
- operator: g.OWNER_ID,
231
+ operator: h.OWNER_ID,
232
232
  value: e
233
233
  };
234
234
  }
235
- function fe(e) {
235
+ function pe(e) {
236
236
  return {
237
- operator: g.SPACE_ID,
237
+ operator: h.SPACE_ID,
238
238
  value: e
239
239
  };
240
240
  }
241
- function C(e) {
241
+ function me(e) {
242
242
  return {
243
- operator: g.DELETED,
243
+ operator: h.DELETED,
244
244
  value: e
245
245
  };
246
246
  }
247
- function pe() {
248
- return C("ACTIVE");
247
+ function he() {
248
+ return me("ACTIVE");
249
249
  }
250
- function w() {
251
- return { operator: g.ALL };
250
+ function S() {
251
+ return { operator: h.ALL };
252
252
  }
253
- function me(e, t) {
253
+ function ge(e, t) {
254
254
  return {
255
255
  field: e,
256
- operator: g.EQ,
256
+ operator: h.EQ,
257
257
  value: t
258
258
  };
259
259
  }
260
- function he(e, t) {
260
+ function _e(e, t) {
261
261
  return {
262
262
  field: e,
263
- operator: g.NE,
263
+ operator: h.NE,
264
264
  value: t
265
265
  };
266
266
  }
267
- function T(e, t) {
267
+ function ve(e, t) {
268
268
  return {
269
269
  field: e,
270
- operator: g.GT,
270
+ operator: h.GT,
271
271
  value: t
272
272
  };
273
273
  }
274
- function E(e, t) {
274
+ function ye(e, t) {
275
275
  return {
276
276
  field: e,
277
- operator: g.LT,
277
+ operator: h.LT,
278
278
  value: t
279
279
  };
280
280
  }
281
- function ge(e, t) {
281
+ function be(e, t) {
282
282
  return {
283
283
  field: e,
284
- operator: g.GTE,
284
+ operator: h.GTE,
285
285
  value: t
286
286
  };
287
287
  }
288
- function _e(e, t) {
288
+ function xe(e, t) {
289
289
  return {
290
290
  field: e,
291
- operator: g.LTE,
291
+ operator: h.LTE,
292
292
  value: t
293
293
  };
294
294
  }
295
- function ve(e, t, n) {
296
- let r = v(n);
295
+ function Se(e, t, n) {
296
+ let r = _(n);
297
297
  return {
298
298
  field: e,
299
- operator: g.CONTAINS,
299
+ operator: h.CONTAINS,
300
300
  value: t,
301
301
  options: r
302
302
  };
303
303
  }
304
- function ye(e, ...t) {
304
+ function Ce(e, ...t) {
305
305
  return {
306
306
  field: e,
307
- operator: g.IN,
307
+ operator: h.IN,
308
308
  value: t
309
309
  };
310
310
  }
311
- function D(e, ...t) {
311
+ function we(e, ...t) {
312
312
  return {
313
313
  field: e,
314
- operator: g.NOT_IN,
314
+ operator: h.NOT_IN,
315
315
  value: t
316
316
  };
317
317
  }
318
- function O(e, t, n) {
318
+ function Te(e, t, n) {
319
319
  return {
320
320
  field: e,
321
- operator: g.BETWEEN,
321
+ operator: h.BETWEEN,
322
322
  value: [t, n]
323
323
  };
324
324
  }
325
- function k(e, ...t) {
325
+ function Ee(e, ...t) {
326
326
  return {
327
327
  field: e,
328
- operator: g.ALL_IN,
328
+ operator: h.ALL_IN,
329
329
  value: t
330
330
  };
331
331
  }
332
- function A(e, t, n) {
333
- let r = v(n);
332
+ function De(e, t, n) {
333
+ let r = _(n);
334
334
  return {
335
335
  field: e,
336
- operator: g.STARTS_WITH,
336
+ operator: h.STARTS_WITH,
337
337
  value: t,
338
338
  options: r
339
339
  };
340
340
  }
341
- function j(e, t) {
341
+ function Oe(e, t) {
342
342
  return {
343
343
  field: e,
344
- operator: g.MATCH,
344
+ operator: h.MATCH,
345
345
  value: t
346
346
  };
347
347
  }
348
- function M(e, t, n) {
349
- let r = v(n);
348
+ function ke(e, t, n) {
349
+ let r = _(n);
350
350
  return {
351
351
  field: e,
352
- operator: g.ENDS_WITH,
352
+ operator: h.ENDS_WITH,
353
353
  value: t,
354
354
  options: r
355
355
  };
356
356
  }
357
- function N(e, t) {
357
+ function Ae(e, t) {
358
358
  return {
359
359
  field: e,
360
- operator: g.ELEM_MATCH,
360
+ operator: h.ELEM_MATCH,
361
361
  children: [t]
362
362
  };
363
363
  }
364
- function P(e) {
364
+ function je(e) {
365
365
  return {
366
366
  field: e,
367
- operator: g.NULL
367
+ operator: h.NULL
368
368
  };
369
369
  }
370
- function be(e) {
370
+ function Me(e) {
371
371
  return {
372
372
  field: e,
373
- operator: g.NOT_NULL
373
+ operator: h.NOT_NULL
374
374
  };
375
375
  }
376
- function xe(e) {
376
+ function Ne(e) {
377
377
  return {
378
378
  field: e,
379
- operator: g.TRUE
379
+ operator: h.TRUE
380
380
  };
381
381
  }
382
- function Se(e) {
382
+ function Pe(e) {
383
383
  return {
384
384
  field: e,
385
- operator: g.FALSE
385
+ operator: h.FALSE
386
386
  };
387
387
  }
388
- function Ce(e, t = !0) {
388
+ function Fe(e, t = !0) {
389
389
  return {
390
390
  field: e,
391
- operator: g.EXISTS,
391
+ operator: h.EXISTS,
392
392
  value: t
393
393
  };
394
394
  }
395
- function we(e, t, n) {
396
- let r = y(t, n);
395
+ function Ie(e, t, n) {
396
+ let r = v(t, n);
397
397
  return {
398
398
  field: e,
399
- operator: g.TODAY,
399
+ operator: h.TODAY,
400
400
  options: r
401
401
  };
402
402
  }
403
- function Te(e, t, n, r) {
404
- let i = y(n, r);
403
+ function Le(e, t, n, r) {
404
+ let i = v(n, r);
405
405
  return {
406
406
  field: e,
407
- operator: g.BEFORE_TODAY,
407
+ operator: h.BEFORE_TODAY,
408
408
  value: t,
409
409
  options: i
410
410
  };
411
411
  }
412
- function Ee(e, t, n) {
413
- let r = y(t, n);
412
+ function Re(e, t, n) {
413
+ let r = v(t, n);
414
414
  return {
415
415
  field: e,
416
- operator: g.TOMORROW,
416
+ operator: h.TOMORROW,
417
417
  options: r
418
418
  };
419
419
  }
420
- function De(e, t, n) {
421
- let r = y(t, n);
420
+ function ze(e, t, n) {
421
+ let r = v(t, n);
422
422
  return {
423
423
  field: e,
424
- operator: g.THIS_WEEK,
424
+ operator: h.THIS_WEEK,
425
425
  options: r
426
426
  };
427
427
  }
428
- function Oe(e, t, n) {
429
- let r = y(t, n);
428
+ function Be(e, t, n) {
429
+ let r = v(t, n);
430
430
  return {
431
431
  field: e,
432
- operator: g.NEXT_WEEK,
432
+ operator: h.NEXT_WEEK,
433
433
  options: r
434
434
  };
435
435
  }
436
- function ke(e, t, n) {
437
- let r = y(t, n);
436
+ function Ve(e, t, n) {
437
+ let r = v(t, n);
438
438
  return {
439
439
  field: e,
440
- operator: g.LAST_WEEK,
440
+ operator: h.LAST_WEEK,
441
441
  options: r
442
442
  };
443
443
  }
444
- function Ae(e, t, n) {
445
- let r = y(t, n);
444
+ function He(e, t, n) {
445
+ let r = v(t, n);
446
446
  return {
447
447
  field: e,
448
- operator: g.THIS_MONTH,
448
+ operator: h.THIS_MONTH,
449
449
  options: r
450
450
  };
451
451
  }
452
- function je(e, t, n) {
453
- let r = y(t, n);
452
+ function Ue(e, t, n) {
453
+ let r = v(t, n);
454
454
  return {
455
455
  field: e,
456
- operator: g.LAST_MONTH,
456
+ operator: h.LAST_MONTH,
457
457
  options: r
458
458
  };
459
459
  }
460
- function Me(e, t, n, r) {
461
- let i = y(n, r);
460
+ function We(e, t, n, r) {
461
+ let i = v(n, r);
462
462
  return {
463
463
  field: e,
464
- operator: g.RECENT_DAYS,
464
+ operator: h.RECENT_DAYS,
465
465
  value: t,
466
466
  options: i
467
467
  };
468
468
  }
469
- function Ne(e, t, n, r) {
470
- let i = y(n, r);
469
+ function Ge(e, t, n, r) {
470
+ let i = v(n, r);
471
471
  return {
472
472
  field: e,
473
- operator: g.EARLIER_DAYS,
473
+ operator: h.EARLIER_DAYS,
474
474
  value: t,
475
475
  options: i
476
476
  };
477
477
  }
478
- function Pe(e) {
478
+ function Ke(e) {
479
479
  return {
480
- operator: g.RAW,
480
+ operator: h.RAW,
481
481
  value: e
482
482
  };
483
483
  }
484
484
  //#endregion
485
- //#region src/query/pagination.ts
486
- var F = {
485
+ //#region src/query/filter.ts
486
+ var qe = /* @__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_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
+ }({}), Je = /* @__PURE__ */ function(e) {
489
+ return e.CASE_SENSITIVE = "CASE_SENSITIVE", e.CASE_INSENSITIVE = "CASE_INSENSITIVE", e;
490
+ }({}), C = /* @__PURE__ */ function(e) {
491
+ return e.TERMS = "TERMS", e.PHRASE = "PHRASE", e;
492
+ }({}), w = /* @__PURE__ */ function(e) {
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
+ }({}), Ye = /^([01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:\.[0-9]{1,9})?)?$/, Xe = /^@?[A-Za-z_][A-Za-z0-9_-]*(\.(?:@?[A-Za-z_][A-Za-z0-9_-]*|[0-9]+))*$/, Ze = /^(?:UTC|GMT|UT)?[+-](\d{1,2}|\d{4}|\d{6}|\d{2}:\d{2}|\d{2}:\d{2}:\d{2})$/, Qe = /^(?:UTC|GMT|UT)?[+-]/, $e = {
495
+ G: 5,
496
+ u: 19,
497
+ y: 19,
498
+ Q: 5,
499
+ q: 5,
500
+ M: 5,
501
+ L: 5,
502
+ D: 3,
503
+ d: 2,
504
+ F: 1,
505
+ E: 5,
506
+ e: 5,
507
+ c: [
508
+ 1,
509
+ 3,
510
+ 4,
511
+ 5
512
+ ],
513
+ a: 1,
514
+ B: [
515
+ 1,
516
+ 4,
517
+ 5
518
+ ],
519
+ h: 2,
520
+ H: 2,
521
+ k: 2,
522
+ K: 2,
523
+ m: 2,
524
+ s: 2,
525
+ S: 9,
526
+ A: 19,
527
+ n: 19,
528
+ N: 19,
529
+ V: [2],
530
+ v: [1, 4],
531
+ z: 4,
532
+ O: [1, 4],
533
+ X: 5,
534
+ x: 5,
535
+ Z: 5,
536
+ W: 1,
537
+ w: 2,
538
+ Y: Infinity,
539
+ g: 19
540
+ };
541
+ function T(e) {
542
+ if (typeof e != "string" || !Xe.test(e)) throw TypeError(`Logical field is invalid: [${String(e)}].`);
543
+ return e;
544
+ }
545
+ function E(e, t) {
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
+ return e;
548
+ }
549
+ function D(e) {
550
+ return Array.isArray(e) ? (e.forEach((e) => E(e, !0)), e) : E(e, !0);
551
+ }
552
+ function O(e, t) {
553
+ if (typeof t != "string") throw TypeError(`${e} must be a string.`);
554
+ return t;
555
+ }
556
+ function k(e) {
557
+ if (e !== "CASE_SENSITIVE" && e !== "CASE_INSENSITIVE") throw TypeError(`String comparison is invalid: [${String(e)}].`);
558
+ }
559
+ function A(e, t) {
560
+ if (t.length === 0) throw TypeError(`${e} cannot be empty.`);
561
+ if (t.some((e) => e == null)) throw TypeError(`${e} cannot contain null.`);
562
+ }
563
+ function et(e) {
564
+ let t = Ze.exec(e);
565
+ if (!t) return !1;
566
+ let n = t[1], [r, i = 0, a = 0] = (n.includes(":") ? n.split(":") : n.length <= 2 ? [n] : [
567
+ n.slice(0, 2),
568
+ n.slice(2, 4),
569
+ n.slice(4, 6)
570
+ ]).map(Number);
571
+ return i <= 59 && a <= 59 && (r < 18 || r === 18 && i === 0 && a === 0);
572
+ }
573
+ function j({ zoneId: e, datePattern: t, timeUnit: n = "MILLISECONDS" }) {
574
+ if (e !== void 0) {
575
+ if (typeof e != "string" || !e.trim()) throw TypeError("zoneId cannot be blank.");
576
+ if (Qe.test(e) && !et(e)) throw TypeError(`zoneId is invalid: [${e}].`);
577
+ }
578
+ if (t !== void 0 && nt(t), !Object.values(w).includes(n)) throw TypeError(`timeUnit is invalid: [${String(n)}].`);
579
+ return {
580
+ ...e === void 0 ? {} : { zoneId: e },
581
+ ...t === void 0 ? {} : { datePattern: t },
582
+ timeUnit: n
583
+ };
584
+ }
585
+ function tt(e, t, n) {
586
+ let r = $e[t];
587
+ if (!(typeof r == "number" ? n <= r : r?.includes(n) === !0)) throw TypeError(`datePattern is invalid: [${e}].`);
588
+ }
589
+ function M(e, t) {
590
+ return e !== void 0 && ("uyDFdhHkKmsSgAnNWwY".includes(e) || e === "c" && t === 1 || "eMLQq".includes(e) && t <= 2);
591
+ }
592
+ function nt(e) {
593
+ if (typeof e != "string" || !e.trim()) throw TypeError("datePattern cannot be blank.");
594
+ let t = !1, n = 0;
595
+ for (let r = 0; r < e.length; r++) {
596
+ let i = e[r];
597
+ if (i === "'") {
598
+ e[r + 1] === "'" ? r++ : t = !t;
599
+ continue;
600
+ }
601
+ if (!t) {
602
+ if (/[A-Za-z]/.test(i)) {
603
+ let t = i, n = r + 1;
604
+ for (; e[n] === t;) n++;
605
+ let a = n - r, o = !1;
606
+ if (t === "p") {
607
+ if (o = !0, t = e[n], !t || !/[A-Za-z]/.test(t) || t === "p") throw TypeError(`datePattern is invalid: [${e}].`);
608
+ let r = n++;
609
+ for (; e[n] === t;) n++;
610
+ a = n - r;
611
+ }
612
+ if (tt(e, t, a), o && M(t, a)) {
613
+ let t = e[n], r = n;
614
+ for (; r < e.length && e[r] === t;) r++;
615
+ if (M(t, r - n)) throw TypeError(`datePattern is invalid: [${e}].`);
616
+ }
617
+ r = n - 1;
618
+ } else if (i === "[") n++;
619
+ else if (i === "]") {
620
+ if (n === 0) throw TypeError(`datePattern is invalid: [${e}].`);
621
+ n--;
622
+ } else if ("{}#".includes(i)) throw TypeError(`datePattern is invalid: [${e}].`);
623
+ }
624
+ }
625
+ if (t) throw TypeError(`datePattern is invalid: [${e}].`);
626
+ }
627
+ function rt(e, t) {
628
+ if (!Number.isInteger(t) || t < 1 || t > 2147483647) throw TypeError(`${e} days must be a positive JVM Int.`);
629
+ }
630
+ function N(e) {
631
+ switch (e.op) {
632
+ case "ID":
633
+ case "IDS":
634
+ case "AGGREGATE_ID":
635
+ case "AGGREGATE_IDS":
636
+ case "TENANT_ID":
637
+ case "OWNER_ID":
638
+ case "SPACE_ID":
639
+ case "DELETION":
640
+ case "SEARCH": throw TypeError("ELEMENT_MATCH predicate cannot contain root filters.");
641
+ case "AND":
642
+ case "OR":
643
+ case "NOR":
644
+ A(`${e.op} operands`, e.operands), e.operands.forEach(N);
645
+ break;
646
+ case "ELEMENT_MATCH": N(e.predicate);
647
+ }
648
+ }
649
+ function it(e) {
650
+ return A("AND operands", e), {
651
+ op: "AND",
652
+ operands: [...e]
653
+ };
654
+ }
655
+ function at(e) {
656
+ return A("OR operands", e), {
657
+ op: "OR",
658
+ operands: [...e]
659
+ };
660
+ }
661
+ function ot(e) {
662
+ return A("NOR operands", e), {
663
+ op: "NOR",
664
+ operands: [...e]
665
+ };
666
+ }
667
+ var P = {
668
+ matchAll() {
669
+ return { op: "MATCH_ALL" };
670
+ },
671
+ matchNone() {
672
+ return { op: "MATCH_NONE" };
673
+ },
674
+ id(e) {
675
+ return {
676
+ op: "ID",
677
+ value: O("ID value", e)
678
+ };
679
+ },
680
+ ids(e) {
681
+ return A("IDS values", e), e.forEach((e) => O("IDS value", e)), {
682
+ op: "IDS",
683
+ values: [...e]
684
+ };
685
+ },
686
+ aggregateId(e) {
687
+ return {
688
+ op: "AGGREGATE_ID",
689
+ value: O("AGGREGATE_ID value", e)
690
+ };
691
+ },
692
+ aggregateIds(e) {
693
+ return A("AGGREGATE_IDS values", e), e.forEach((e) => O("AGGREGATE_IDS value", e)), {
694
+ op: "AGGREGATE_IDS",
695
+ values: [...e]
696
+ };
697
+ },
698
+ tenantId(e) {
699
+ return {
700
+ op: "TENANT_ID",
701
+ value: O("TENANT_ID value", e)
702
+ };
703
+ },
704
+ ownerId(e) {
705
+ return {
706
+ op: "OWNER_ID",
707
+ value: O("OWNER_ID value", e)
708
+ };
709
+ },
710
+ spaceId(e) {
711
+ return {
712
+ op: "SPACE_ID",
713
+ value: O("SPACE_ID value", e)
714
+ };
715
+ },
716
+ and: it,
717
+ or: at,
718
+ nor: ot,
719
+ eq(e, t) {
720
+ return {
721
+ op: "EQ",
722
+ field: T(e),
723
+ value: D(t)
724
+ };
725
+ },
726
+ ne(e, t) {
727
+ return {
728
+ op: "NE",
729
+ field: T(e),
730
+ value: D(t)
731
+ };
732
+ },
733
+ gt(e, t) {
734
+ return {
735
+ op: "GT",
736
+ field: T(e),
737
+ value: E(t, !1)
738
+ };
739
+ },
740
+ gte(e, t) {
741
+ return {
742
+ op: "GTE",
743
+ field: T(e),
744
+ value: E(t, !1)
745
+ };
746
+ },
747
+ lt(e, t) {
748
+ return {
749
+ op: "LT",
750
+ field: T(e),
751
+ value: E(t, !1)
752
+ };
753
+ },
754
+ lte(e, t) {
755
+ return {
756
+ op: "LTE",
757
+ field: T(e),
758
+ value: E(t, !1)
759
+ };
760
+ },
761
+ contains(e, t, n = "CASE_SENSITIVE") {
762
+ return k(n), {
763
+ op: "CONTAINS",
764
+ field: T(e),
765
+ value: O("CONTAINS value", t),
766
+ stringComparison: n
767
+ };
768
+ },
769
+ startsWith(e, t, n = "CASE_SENSITIVE") {
770
+ return k(n), {
771
+ op: "STARTS_WITH",
772
+ field: T(e),
773
+ value: O("STARTS_WITH value", t),
774
+ stringComparison: n
775
+ };
776
+ },
777
+ endsWith(e, t, n = "CASE_SENSITIVE") {
778
+ return k(n), {
779
+ op: "ENDS_WITH",
780
+ field: T(e),
781
+ value: O("ENDS_WITH value", t),
782
+ stringComparison: n
783
+ };
784
+ },
785
+ isIn(e, t) {
786
+ return A("IN values", t), t.forEach((e) => E(e, !1)), {
787
+ op: "IN",
788
+ field: T(e),
789
+ values: [...t]
790
+ };
791
+ },
792
+ notIn(e, t) {
793
+ return A("NOT_IN values", t), t.forEach((e) => E(e, !1)), {
794
+ op: "NOT_IN",
795
+ field: T(e),
796
+ values: [...t]
797
+ };
798
+ },
799
+ containsAll(e, t) {
800
+ return A("CONTAINS_ALL values", t), t.forEach((e) => E(e, !1)), {
801
+ op: "CONTAINS_ALL",
802
+ field: T(e),
803
+ values: [...t]
804
+ };
805
+ },
806
+ between(e, t, n) {
807
+ return {
808
+ op: "BETWEEN",
809
+ field: T(e),
810
+ lowerBound: E(t, !1),
811
+ upperBound: E(n, !1)
812
+ };
813
+ },
814
+ isEmpty(e) {
815
+ return {
816
+ op: "IS_EMPTY",
817
+ field: T(e)
818
+ };
819
+ },
820
+ isNull(e) {
821
+ return {
822
+ op: "IS_NULL",
823
+ field: T(e)
824
+ };
825
+ },
826
+ isNotNull(e) {
827
+ return {
828
+ op: "IS_NOT_NULL",
829
+ field: T(e)
830
+ };
831
+ },
832
+ exists(e) {
833
+ return {
834
+ op: "EXISTS",
835
+ field: T(e)
836
+ };
837
+ },
838
+ notExists(e) {
839
+ return {
840
+ op: "NOT_EXISTS",
841
+ field: T(e)
842
+ };
843
+ },
844
+ deletion(e) {
845
+ if (e !== y.ACTIVE && e !== y.DELETED && e !== y.ALL) throw TypeError(`Deletion state is invalid: [${String(e)}].`);
846
+ return {
847
+ op: "DELETION",
848
+ state: e
849
+ };
850
+ },
851
+ elementMatch(e, t) {
852
+ return N(t), {
853
+ op: "ELEMENT_MATCH",
854
+ field: T(e),
855
+ predicate: t
856
+ };
857
+ },
858
+ search(e, t) {
859
+ if (typeof e != "string" || !e.trim()) throw TypeError("SEARCH query cannot be blank.");
860
+ if (t !== void 0 && (typeof t != "object" || !t || Array.isArray(t))) throw TypeError("SEARCH options must be a non-null object.");
861
+ let { fields: n = [], mode: r = "TERMS" } = t ?? {};
862
+ if (!Object.values(C).includes(r)) throw TypeError(`SEARCH mode is invalid: [${String(r)}].`);
863
+ return {
864
+ op: "SEARCH",
865
+ query: e,
866
+ mode: r,
867
+ fields: n.map(T)
868
+ };
869
+ },
870
+ today(e, t = {}) {
871
+ return {
872
+ ...j(t),
873
+ op: "TODAY",
874
+ field: T(e)
875
+ };
876
+ },
877
+ beforeToday(e, t, n = {}) {
878
+ if (typeof t != "string" || !Ye.test(t)) throw TypeError("BEFORE_TODAY time is invalid.");
879
+ return {
880
+ ...j(n),
881
+ op: "BEFORE_TODAY",
882
+ field: T(e),
883
+ time: t
884
+ };
885
+ },
886
+ tomorrow(e, t = {}) {
887
+ return {
888
+ ...j(t),
889
+ op: "TOMORROW",
890
+ field: T(e)
891
+ };
892
+ },
893
+ thisWeek(e, t = {}) {
894
+ return {
895
+ ...j(t),
896
+ op: "THIS_WEEK",
897
+ field: T(e)
898
+ };
899
+ },
900
+ nextWeek(e, t = {}) {
901
+ return {
902
+ ...j(t),
903
+ op: "NEXT_WEEK",
904
+ field: T(e)
905
+ };
906
+ },
907
+ lastWeek(e, t = {}) {
908
+ return {
909
+ ...j(t),
910
+ op: "LAST_WEEK",
911
+ field: T(e)
912
+ };
913
+ },
914
+ thisMonth(e, t = {}) {
915
+ return {
916
+ ...j(t),
917
+ op: "THIS_MONTH",
918
+ field: T(e)
919
+ };
920
+ },
921
+ lastMonth(e, t = {}) {
922
+ return {
923
+ ...j(t),
924
+ op: "LAST_MONTH",
925
+ field: T(e)
926
+ };
927
+ },
928
+ yesterday(e, t = {}) {
929
+ return {
930
+ ...j(t),
931
+ op: "YESTERDAY",
932
+ field: T(e)
933
+ };
934
+ },
935
+ nextMonth(e, t = {}) {
936
+ return {
937
+ ...j(t),
938
+ op: "NEXT_MONTH",
939
+ field: T(e)
940
+ };
941
+ },
942
+ lastYear(e, t = {}) {
943
+ return {
944
+ ...j(t),
945
+ op: "LAST_YEAR",
946
+ field: T(e)
947
+ };
948
+ },
949
+ thisYear(e, t = {}) {
950
+ return {
951
+ ...j(t),
952
+ op: "THIS_YEAR",
953
+ field: T(e)
954
+ };
955
+ },
956
+ nextYear(e, t = {}) {
957
+ return {
958
+ ...j(t),
959
+ op: "NEXT_YEAR",
960
+ field: T(e)
961
+ };
962
+ },
963
+ recentDays(e, t, n = {}) {
964
+ return rt("RECENT_DAYS", t), {
965
+ ...j(n),
966
+ op: "RECENT_DAYS",
967
+ field: T(e),
968
+ days: t
969
+ };
970
+ },
971
+ earlierDays(e, t, n = {}) {
972
+ return rt("EARLIER_DAYS", t), {
973
+ ...j(n),
974
+ op: "EARLIER_DAYS",
975
+ field: T(e),
976
+ days: t
977
+ };
978
+ }
979
+ }, st = /* @__PURE__ */ function(e) {
980
+ return e.TERMS = "TERMS", e.HISTOGRAM = "HISTOGRAM", e.DATE_HISTOGRAM = "DATE_HISTOGRAM", e;
981
+ }({}), ct = /* @__PURE__ */ function(e) {
982
+ return e.COUNT = "COUNT", e.NUMERIC = "NUMERIC", e.ANY = "ANY", e;
983
+ }({}), lt = /* @__PURE__ */ function(e) {
984
+ return e.FIELD = "FIELD", e.CONSTANT = "CONSTANT", e.BINARY = "BINARY", e;
985
+ }({}), ut = /* @__PURE__ */ function(e) {
986
+ return e.ADD = "ADD", e.SUBTRACT = "SUBTRACT", e.MULTIPLY = "MULTIPLY", e.DIVIDE = "DIVIDE", e;
987
+ }({}), dt = /* @__PURE__ */ function(e) {
988
+ 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
+ }({}), ft = /* @__PURE__ */ function(e) {
990
+ return e.SUM = "SUM", e.AVG = "AVG", e.MIN = "MIN", e.MAX = "MAX", e;
991
+ }({});
992
+ function F(e) {
993
+ return P.exists(e).field;
994
+ }
995
+ function I(e) {
996
+ if (F(e), e.includes(".")) throw TypeError("aggregation alias must contain one segment.");
997
+ if (e.startsWith("__wow")) throw TypeError("aggregation alias must not use the reserved __wow prefix.");
998
+ return e;
999
+ }
1000
+ function L(e, t, n) {
1001
+ return {
1002
+ type: "BINARY",
1003
+ operator: e,
1004
+ left: t,
1005
+ right: n
1006
+ };
1007
+ }
1008
+ function R(e, t, n) {
1009
+ return {
1010
+ type: "NUMERIC",
1011
+ function: e,
1012
+ expression: t,
1013
+ alias: I(n)
1014
+ };
1015
+ }
1016
+ var pt = {
1017
+ element(e, t) {
1018
+ let n = F(e);
1019
+ return t === void 0 ? { path: n } : (P.elementMatch(e, t), {
1020
+ path: n,
1021
+ filter: t
1022
+ });
1023
+ },
1024
+ field(e) {
1025
+ return {
1026
+ type: "FIELD",
1027
+ field: F(e)
1028
+ };
1029
+ },
1030
+ constant(e) {
1031
+ if (!Number.isFinite(e)) throw TypeError("aggregation constant must be finite.");
1032
+ return {
1033
+ type: "CONSTANT",
1034
+ value: e
1035
+ };
1036
+ },
1037
+ add: (e, t) => L("ADD", e, t),
1038
+ subtract: (e, t) => L("SUBTRACT", e, t),
1039
+ multiply: (e, t) => L("MULTIPLY", e, t),
1040
+ divide: (e, t) => L("DIVIDE", e, t),
1041
+ terms(e, t) {
1042
+ return {
1043
+ type: "TERMS",
1044
+ field: F(e),
1045
+ alias: I(t)
1046
+ };
1047
+ },
1048
+ histogram(e, { interval: t, alias: n }) {
1049
+ if (!Number.isFinite(t) || t <= 0) throw TypeError("histogram interval must be finite and greater than 0.");
1050
+ return {
1051
+ type: "HISTOGRAM",
1052
+ field: F(e),
1053
+ interval: t,
1054
+ alias: I(n)
1055
+ };
1056
+ },
1057
+ dateHistogram(e, { unit: t, alias: n, timeZone: r = "UTC" }) {
1058
+ if (!Object.values(dt).includes(t)) throw TypeError("date histogram unit is invalid.");
1059
+ if (typeof r != "string" || !r.trim()) throw TypeError("date histogram timeZone cannot be blank.");
1060
+ return {
1061
+ type: "DATE_HISTOGRAM",
1062
+ field: F(e),
1063
+ unit: t,
1064
+ alias: I(n),
1065
+ timeZone: r
1066
+ };
1067
+ },
1068
+ any(e, t) {
1069
+ return {
1070
+ type: "ANY",
1071
+ field: F(e),
1072
+ alias: I(t)
1073
+ };
1074
+ },
1075
+ count(e) {
1076
+ return {
1077
+ type: "COUNT",
1078
+ alias: I(e)
1079
+ };
1080
+ },
1081
+ sum: (e, t) => R("SUM", e, t),
1082
+ avg: (e, t) => R("AVG", e, t),
1083
+ min: (e, t) => R("MIN", e, t),
1084
+ max: (e, t) => R("MAX", e, t)
1085
+ }, z = {
487
1086
  index: 1,
488
1087
  size: 10
489
1088
  };
490
- function Fe({ index: e = F.index, size: t = F.size } = F) {
1089
+ function mt({ index: e = z.index, size: t = z.size } = z) {
491
1090
  return {
492
1091
  index: e,
493
1092
  size: t
@@ -495,11 +1094,11 @@ function Fe({ index: e = F.index, size: t = F.size } = F) {
495
1094
  }
496
1095
  //#endregion
497
1096
  //#region src/query/projection.ts
498
- var I = {};
499
- function L() {
500
- return I;
1097
+ var ht = {};
1098
+ function gt() {
1099
+ return ht;
501
1100
  }
502
- function Ie({ include: e, exclude: t } = L()) {
1101
+ function _t({ include: e, exclude: t } = gt()) {
503
1102
  return {
504
1103
  include: e,
505
1104
  exclude: t
@@ -507,34 +1106,49 @@ function Ie({ include: e, exclude: t } = L()) {
507
1106
  }
508
1107
  //#endregion
509
1108
  //#region src/query/queryable.ts
510
- function R({ condition: e = w(), projection: t, sort: n } = {}) {
1109
+ function B({ condition: e, filter: t }) {
1110
+ if (t === null) throw TypeError("filter cannot be null.");
1111
+ if (t !== void 0) return { filter: t };
1112
+ if (e === null) throw TypeError("condition cannot be null.");
1113
+ return { condition: e === void 0 ? S() : e };
1114
+ }
1115
+ function V({ condition: e, filter: t, projection: n, sort: r } = {}) {
511
1116
  return {
512
- condition: e,
513
- projection: t,
514
- sort: n
1117
+ ...B({
1118
+ condition: e,
1119
+ filter: t
1120
+ }),
1121
+ projection: n,
1122
+ sort: r
515
1123
  };
516
1124
  }
517
- function z({ condition: e = w(), projection: t, sort: n, limit: r = F.size } = {}) {
1125
+ function H({ condition: e, filter: t, projection: n, sort: r, limit: i } = {}) {
518
1126
  return {
519
- condition: e,
520
- projection: t,
521
- sort: n,
522
- limit: r
1127
+ ...B({
1128
+ condition: e,
1129
+ filter: t
1130
+ }),
1131
+ projection: n,
1132
+ sort: r,
1133
+ limit: i ?? (t === void 0 ? z.size : 0)
523
1134
  };
524
1135
  }
525
- function Le({ condition: e = w(), projection: t, sort: n, pagination: r = F } = {}) {
1136
+ function vt({ condition: e, filter: t, projection: n, sort: r, pagination: i = z } = {}) {
526
1137
  return {
527
- condition: e,
528
- projection: t,
529
- sort: n,
530
- pagination: r
1138
+ ...B({
1139
+ condition: e,
1140
+ filter: t
1141
+ }),
1142
+ projection: n,
1143
+ sort: r,
1144
+ pagination: i
531
1145
  };
532
1146
  }
533
- var B = {
1147
+ var yt = {
534
1148
  total: 0,
535
1149
  list: []
536
1150
  };
537
- function Re({ total: e, list: t = [] } = B) {
1151
+ function bt({ total: e, list: t = [] } = yt) {
538
1152
  return e === void 0 && (e = t.length), {
539
1153
  total: e,
540
1154
  list: t
@@ -542,16 +1156,16 @@ function Re({ total: e, list: t = [] } = B) {
542
1156
  }
543
1157
  //#endregion
544
1158
  //#region src/query/sort.ts
545
- var V = /* @__PURE__ */ function(e) {
1159
+ var U = /* @__PURE__ */ function(e) {
546
1160
  return e.ASC = "ASC", e.DESC = "DESC", e;
547
1161
  }({});
548
- function ze(e) {
1162
+ function xt(e) {
549
1163
  return {
550
1164
  field: e,
551
1165
  direction: "ASC"
552
1166
  };
553
1167
  }
554
- function Be(e) {
1168
+ function St(e) {
555
1169
  return {
556
1170
  field: e,
557
1171
  direction: "DESC"
@@ -559,7 +1173,7 @@ function Be(e) {
559
1173
  }
560
1174
  //#endregion
561
1175
  //#region src/query/event/domainEventStream.ts
562
- var Ve = class e {
1176
+ var Ct = class e {
563
1177
  static {
564
1178
  this.HEADER = "header";
565
1179
  }
@@ -608,7 +1222,7 @@ var Ve = class e {
608
1222
  static {
609
1223
  this.CREATE_TIME = "createTime";
610
1224
  }
611
- }, H = class e {
1225
+ }, W = class e {
612
1226
  static {
613
1227
  this.EVENT_STREAM_RESOURCE_NAME = "event";
614
1228
  }
@@ -621,7 +1235,7 @@ var Ve = class e {
621
1235
  static {
622
1236
  this.PAGED = `${e.EVENT_STREAM_RESOURCE_NAME}/paged`;
623
1237
  }
624
- }, U = class {
1238
+ }, G = class {
625
1239
  constructor(e) {
626
1240
  this.apiMetadata = e;
627
1241
  }
@@ -638,57 +1252,57 @@ var Ve = class e {
638
1252
  throw a(e, t, n);
639
1253
  }
640
1254
  };
641
- m([
642
- u(H.COUNT),
643
- p(0, o()),
644
- p(1, i()),
645
- f("design:type", Function),
646
- f("design:paramtypes", [
1255
+ p([
1256
+ u(W.COUNT),
1257
+ f(0, o()),
1258
+ f(1, i()),
1259
+ d("design:type", Function),
1260
+ d("design:paramtypes", [
647
1261
  Object,
648
1262
  typeof Record > "u" ? Object : Record,
649
1263
  typeof AbortController > "u" ? Object : AbortController
650
1264
  ]),
651
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
652
- ], U.prototype, "count", null), m([
653
- u(H.LIST),
654
- p(0, o()),
655
- p(1, i()),
656
- f("design:type", Function),
657
- f("design:paramtypes", [
1265
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1266
+ ], G.prototype, "count", null), p([
1267
+ u(W.LIST),
1268
+ f(0, o()),
1269
+ f(1, i()),
1270
+ d("design:type", Function),
1271
+ d("design:paramtypes", [
658
1272
  Object,
659
1273
  typeof Record > "u" ? Object : Record,
660
1274
  typeof AbortController > "u" ? Object : AbortController
661
1275
  ]),
662
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
663
- ], U.prototype, "list", null), m([
664
- u(H.LIST, {
1276
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1277
+ ], G.prototype, "list", null), p([
1278
+ u(W.LIST, {
665
1279
  headers: { Accept: e.TEXT_EVENT_STREAM },
666
1280
  resultExtractor: n
667
1281
  }),
668
- p(0, o()),
669
- p(1, i()),
670
- f("design:type", Function),
671
- f("design:paramtypes", [
1282
+ f(0, o()),
1283
+ f(1, i()),
1284
+ d("design:type", Function),
1285
+ d("design:paramtypes", [
672
1286
  Object,
673
1287
  typeof Record > "u" ? Object : Record,
674
1288
  typeof AbortController > "u" ? Object : AbortController
675
1289
  ]),
676
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
677
- ], U.prototype, "listStream", null), m([
678
- u(H.PAGED),
679
- p(0, o()),
680
- p(1, i()),
681
- f("design:type", Function),
682
- f("design:paramtypes", [
1290
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1291
+ ], G.prototype, "listStream", null), p([
1292
+ u(W.PAGED),
1293
+ f(0, o()),
1294
+ f(1, i()),
1295
+ d("design:type", Function),
1296
+ d("design:paramtypes", [
683
1297
  Object,
684
1298
  typeof Record > "u" ? Object : Record,
685
1299
  typeof AbortController > "u" ? Object : AbortController
686
1300
  ]),
687
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
688
- ], U.prototype, "paged", null), U = m([r(), f("design:paramtypes", [Object])], U);
1301
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1302
+ ], G.prototype, "paged", null), G = p([r(), d("design:paramtypes", [Object])], G);
689
1303
  //#endregion
690
1304
  //#region src/query/snapshot/snapshot.ts
691
- var He = class {
1305
+ var wt = class {
692
1306
  static {
693
1307
  this.VERSION = "version";
694
1308
  }
@@ -728,10 +1342,13 @@ var He = class {
728
1342
  static {
729
1343
  this.STATE = "state";
730
1344
  }
731
- }, W = class e {
1345
+ }, K = class e {
732
1346
  static {
733
1347
  this.SNAPSHOT_RESOURCE_NAME = "snapshot";
734
1348
  }
1349
+ static {
1350
+ this.AGGREGATION = `${e.SNAPSHOT_RESOURCE_NAME}/aggregation`;
1351
+ }
735
1352
  static {
736
1353
  this.COUNT = `${e.SNAPSHOT_RESOURCE_NAME}/count`;
737
1354
  }
@@ -753,10 +1370,16 @@ var He = class {
753
1370
  static {
754
1371
  this.SINGLE_STATE = `${e.SINGLE}/state`;
755
1372
  }
756
- }, G = class {
1373
+ }, q = class {
757
1374
  constructor(e) {
758
1375
  this.apiMetadata = e;
759
1376
  }
1377
+ aggregate(e, t, n) {
1378
+ throw a(e, t, n);
1379
+ }
1380
+ aggregateStream(e, t, n) {
1381
+ throw a(e, t, n);
1382
+ }
760
1383
  count(e, t, n) {
761
1384
  throw a(e, t, n);
762
1385
  }
@@ -785,173 +1408,200 @@ var He = class {
785
1408
  throw a(e, t, n);
786
1409
  }
787
1410
  getById(e, t, n) {
788
- let r = R({ condition: x(e) });
1411
+ let r = V({ condition: x(e) });
789
1412
  return this.single(r, t, n);
790
1413
  }
791
1414
  getStateById(e, t, n) {
792
- let r = R({ condition: x(e) });
1415
+ let r = V({ condition: x(e) });
793
1416
  return this.singleState(r, t, n);
794
1417
  }
795
1418
  getByIds(e, t, n) {
796
- let r = z({
797
- condition: S(e),
1419
+ if (e.length === 0) return Promise.resolve([]);
1420
+ let r = H({
1421
+ filter: P.aggregateIds(e),
798
1422
  limit: e.length
799
1423
  });
800
1424
  return this.list(r, t, n);
801
1425
  }
802
1426
  getStateByIds(e, t, n) {
803
- let r = z({
804
- condition: S(e),
1427
+ if (e.length === 0) return Promise.resolve([]);
1428
+ let r = H({
1429
+ filter: P.aggregateIds(e),
805
1430
  limit: e.length
806
1431
  });
807
1432
  return this.listState(r, t, n);
808
1433
  }
809
1434
  };
810
- m([
811
- u(W.COUNT),
812
- p(0, o()),
813
- p(1, i()),
814
- f("design:type", Function),
815
- f("design:paramtypes", [
1435
+ p([
1436
+ u(K.AGGREGATION),
1437
+ f(0, o()),
1438
+ f(1, i()),
1439
+ d("design:type", Function),
1440
+ d("design:paramtypes", [
816
1441
  Object,
817
1442
  typeof Record > "u" ? Object : Record,
818
1443
  typeof AbortController > "u" ? Object : AbortController
819
1444
  ]),
820
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
821
- ], G.prototype, "count", null), m([
822
- u(W.LIST),
823
- p(0, o()),
824
- p(1, i()),
825
- f("design:type", Function),
826
- f("design:paramtypes", [
1445
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1446
+ ], q.prototype, "aggregate", null), p([
1447
+ u(K.AGGREGATION, {
1448
+ headers: { Accept: e.TEXT_EVENT_STREAM },
1449
+ resultExtractor: n
1450
+ }),
1451
+ f(0, o()),
1452
+ f(1, i()),
1453
+ d("design:type", Function),
1454
+ d("design:paramtypes", [
827
1455
  Object,
828
1456
  typeof Record > "u" ? Object : Record,
829
1457
  typeof AbortController > "u" ? Object : AbortController
830
1458
  ]),
831
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
832
- ], G.prototype, "list", null), m([
833
- u(W.LIST, {
1459
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1460
+ ], q.prototype, "aggregateStream", null), p([
1461
+ u(K.COUNT),
1462
+ f(0, o()),
1463
+ f(1, i()),
1464
+ d("design:type", Function),
1465
+ d("design:paramtypes", [
1466
+ Object,
1467
+ typeof Record > "u" ? Object : Record,
1468
+ typeof AbortController > "u" ? Object : AbortController
1469
+ ]),
1470
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1471
+ ], q.prototype, "count", null), p([
1472
+ u(K.LIST),
1473
+ f(0, o()),
1474
+ f(1, i()),
1475
+ d("design:type", Function),
1476
+ d("design:paramtypes", [
1477
+ Object,
1478
+ typeof Record > "u" ? Object : Record,
1479
+ typeof AbortController > "u" ? Object : AbortController
1480
+ ]),
1481
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1482
+ ], q.prototype, "list", null), p([
1483
+ u(K.LIST, {
834
1484
  headers: { Accept: e.TEXT_EVENT_STREAM },
835
1485
  resultExtractor: n
836
1486
  }),
837
- p(0, o()),
838
- p(1, i()),
839
- f("design:type", Function),
840
- f("design:paramtypes", [
1487
+ f(0, o()),
1488
+ f(1, i()),
1489
+ d("design:type", Function),
1490
+ d("design:paramtypes", [
841
1491
  Object,
842
1492
  typeof Record > "u" ? Object : Record,
843
1493
  typeof AbortController > "u" ? Object : AbortController
844
1494
  ]),
845
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
846
- ], G.prototype, "listStream", null), m([
847
- u(W.LIST_STATE),
848
- p(0, o()),
849
- p(1, i()),
850
- f("design:type", Function),
851
- f("design:paramtypes", [
1495
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1496
+ ], q.prototype, "listStream", null), p([
1497
+ u(K.LIST_STATE),
1498
+ f(0, o()),
1499
+ f(1, i()),
1500
+ d("design:type", Function),
1501
+ d("design:paramtypes", [
852
1502
  Object,
853
1503
  typeof Record > "u" ? Object : Record,
854
1504
  typeof AbortController > "u" ? Object : AbortController
855
1505
  ]),
856
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
857
- ], G.prototype, "listState", null), m([
858
- u(W.LIST_STATE, {
1506
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1507
+ ], q.prototype, "listState", null), p([
1508
+ u(K.LIST_STATE, {
859
1509
  headers: { Accept: e.TEXT_EVENT_STREAM },
860
1510
  resultExtractor: n
861
1511
  }),
862
- p(0, o()),
863
- p(1, i()),
864
- f("design:type", Function),
865
- f("design:paramtypes", [
1512
+ f(0, o()),
1513
+ f(1, i()),
1514
+ d("design:type", Function),
1515
+ d("design:paramtypes", [
866
1516
  Object,
867
1517
  typeof Record > "u" ? Object : Record,
868
1518
  typeof AbortController > "u" ? Object : AbortController
869
1519
  ]),
870
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
871
- ], G.prototype, "listStateStream", null), m([
872
- u(W.PAGED),
873
- p(0, o()),
874
- p(1, i()),
875
- f("design:type", Function),
876
- f("design:paramtypes", [
1520
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1521
+ ], q.prototype, "listStateStream", null), p([
1522
+ u(K.PAGED),
1523
+ f(0, o()),
1524
+ f(1, i()),
1525
+ d("design:type", Function),
1526
+ d("design:paramtypes", [
877
1527
  Object,
878
1528
  typeof Record > "u" ? Object : Record,
879
1529
  typeof AbortController > "u" ? Object : AbortController
880
1530
  ]),
881
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
882
- ], G.prototype, "paged", null), m([
883
- u(W.PAGED_STATE),
884
- p(0, o()),
885
- p(1, i()),
886
- f("design:type", Function),
887
- f("design:paramtypes", [
1531
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1532
+ ], q.prototype, "paged", null), p([
1533
+ u(K.PAGED_STATE),
1534
+ f(0, o()),
1535
+ f(1, i()),
1536
+ d("design:type", Function),
1537
+ d("design:paramtypes", [
888
1538
  Object,
889
1539
  typeof Record > "u" ? Object : Record,
890
1540
  typeof AbortController > "u" ? Object : AbortController
891
1541
  ]),
892
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
893
- ], G.prototype, "pagedState", null), m([
894
- u(W.SINGLE),
895
- p(0, o()),
896
- p(1, i()),
897
- f("design:type", Function),
898
- f("design:paramtypes", [
1542
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1543
+ ], q.prototype, "pagedState", null), p([
1544
+ u(K.SINGLE),
1545
+ f(0, o()),
1546
+ f(1, i()),
1547
+ d("design:type", Function),
1548
+ d("design:paramtypes", [
899
1549
  Object,
900
1550
  typeof Record > "u" ? Object : Record,
901
1551
  typeof AbortController > "u" ? Object : AbortController
902
1552
  ]),
903
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
904
- ], G.prototype, "single", null), m([
905
- u(W.SINGLE_STATE),
906
- p(0, o()),
907
- p(1, i()),
908
- f("design:type", Function),
909
- f("design:paramtypes", [
1553
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1554
+ ], q.prototype, "single", null), p([
1555
+ u(K.SINGLE_STATE),
1556
+ f(0, o()),
1557
+ f(1, i()),
1558
+ d("design:type", Function),
1559
+ d("design:paramtypes", [
910
1560
  Object,
911
1561
  typeof Record > "u" ? Object : Record,
912
1562
  typeof AbortController > "u" ? Object : AbortController
913
1563
  ]),
914
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
915
- ], G.prototype, "singleState", null), m([
916
- p(1, i()),
917
- f("design:type", Function),
918
- f("design:paramtypes", [
1564
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1565
+ ], q.prototype, "singleState", null), p([
1566
+ f(1, i()),
1567
+ d("design:type", Function),
1568
+ d("design:paramtypes", [
919
1569
  String,
920
1570
  typeof Record > "u" ? Object : Record,
921
1571
  typeof AbortController > "u" ? Object : AbortController
922
1572
  ]),
923
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
924
- ], G.prototype, "getById", null), m([
925
- p(1, i()),
926
- f("design:type", Function),
927
- f("design:paramtypes", [
1573
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1574
+ ], q.prototype, "getById", null), p([
1575
+ f(1, i()),
1576
+ d("design:type", Function),
1577
+ d("design:paramtypes", [
928
1578
  String,
929
1579
  typeof Record > "u" ? Object : Record,
930
1580
  typeof AbortController > "u" ? Object : AbortController
931
1581
  ]),
932
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
933
- ], G.prototype, "getStateById", null), m([
934
- p(1, i()),
935
- f("design:type", Function),
936
- f("design:paramtypes", [
1582
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1583
+ ], q.prototype, "getStateById", null), p([
1584
+ f(1, i()),
1585
+ d("design:type", Function),
1586
+ d("design:paramtypes", [
937
1587
  Array,
938
1588
  typeof Record > "u" ? Object : Record,
939
1589
  typeof AbortController > "u" ? Object : AbortController
940
1590
  ]),
941
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
942
- ], G.prototype, "getByIds", null), m([
943
- p(1, i()),
944
- f("design:type", Function),
945
- f("design:paramtypes", [
1591
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1592
+ ], q.prototype, "getByIds", null), p([
1593
+ f(1, i()),
1594
+ d("design:type", Function),
1595
+ d("design:paramtypes", [
946
1596
  Array,
947
1597
  typeof Record > "u" ? Object : Record,
948
1598
  typeof AbortController > "u" ? Object : AbortController
949
1599
  ]),
950
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
951
- ], G.prototype, "getStateByIds", null), G = m([r(), f("design:paramtypes", [Object])], G);
1600
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1601
+ ], q.prototype, "getStateByIds", null), q = p([r(), d("design:paramtypes", [Object])], q);
952
1602
  //#endregion
953
1603
  //#region src/query/state/loadStateAggregateClient.ts
954
- var K = class e {
1604
+ var J = class e {
955
1605
  static {
956
1606
  this.LOAD = "{id}/state";
957
1607
  }
@@ -961,7 +1611,7 @@ var K = class e {
961
1611
  static {
962
1612
  this.LOAD_TIME_BASED = `${e.LOAD}/time/{createTime}`;
963
1613
  }
964
- }, q = class {
1614
+ }, Y = class {
965
1615
  constructor(e) {
966
1616
  this.apiMetadata = e;
967
1617
  }
@@ -975,47 +1625,47 @@ var K = class e {
975
1625
  throw a(e, t, n, r);
976
1626
  }
977
1627
  };
978
- m([
979
- c(K.LOAD),
980
- p(0, l("id")),
981
- p(1, i()),
982
- f("design:type", Function),
983
- f("design:paramtypes", [
1628
+ p([
1629
+ c(J.LOAD),
1630
+ f(0, l("id")),
1631
+ f(1, i()),
1632
+ d("design:type", Function),
1633
+ d("design:paramtypes", [
984
1634
  String,
985
1635
  typeof Record > "u" ? Object : Record,
986
1636
  typeof AbortController > "u" ? Object : AbortController
987
1637
  ]),
988
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
989
- ], q.prototype, "load", null), m([
990
- c(K.LOAD_VERSIONED),
991
- p(0, l("id")),
992
- p(1, l("version")),
993
- p(2, i()),
994
- f("design:type", Function),
995
- f("design:paramtypes", [
1638
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1639
+ ], Y.prototype, "load", null), p([
1640
+ c(J.LOAD_VERSIONED),
1641
+ f(0, l("id")),
1642
+ f(1, l("version")),
1643
+ f(2, i()),
1644
+ d("design:type", Function),
1645
+ d("design:paramtypes", [
996
1646
  String,
997
1647
  Number,
998
1648
  typeof Record > "u" ? Object : Record,
999
1649
  typeof AbortController > "u" ? Object : AbortController
1000
1650
  ]),
1001
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
1002
- ], q.prototype, "loadVersioned", null), m([
1003
- c(K.LOAD_TIME_BASED),
1004
- p(0, l("id")),
1005
- p(1, l("createTime")),
1006
- p(2, i()),
1007
- f("design:type", Function),
1008
- f("design:paramtypes", [
1651
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1652
+ ], Y.prototype, "loadVersioned", null), p([
1653
+ c(J.LOAD_TIME_BASED),
1654
+ f(0, l("id")),
1655
+ f(1, l("createTime")),
1656
+ f(2, i()),
1657
+ d("design:type", Function),
1658
+ d("design:paramtypes", [
1009
1659
  String,
1010
1660
  Number,
1011
1661
  typeof Record > "u" ? Object : Record,
1012
1662
  typeof AbortController > "u" ? Object : AbortController
1013
1663
  ]),
1014
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
1015
- ], q.prototype, "loadTimeBased", null), q = m([r(), f("design:paramtypes", [Object])], q);
1664
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1665
+ ], Y.prototype, "loadTimeBased", null), Y = p([r(), d("design:paramtypes", [Object])], Y);
1016
1666
  //#endregion
1017
1667
  //#region src/query/state/loadOwnerStateAggregateClient.ts
1018
- var J = class e {
1668
+ var X = class e {
1019
1669
  static {
1020
1670
  this.LOAD = "state";
1021
1671
  }
@@ -1025,7 +1675,7 @@ var J = class e {
1025
1675
  static {
1026
1676
  this.LOAD_TIME_BASED = `${e.LOAD}/time/{createTime}`;
1027
1677
  }
1028
- }, Y = class {
1678
+ }, Z = class {
1029
1679
  constructor(e) {
1030
1680
  this.apiMetadata = e;
1031
1681
  }
@@ -1039,101 +1689,110 @@ var J = class e {
1039
1689
  throw a(e, t, n);
1040
1690
  }
1041
1691
  };
1042
- m([
1043
- c(J.LOAD),
1044
- p(0, i()),
1045
- f("design:type", Function),
1046
- f("design:paramtypes", [typeof Record > "u" ? Object : Record, typeof AbortController > "u" ? Object : AbortController]),
1047
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
1048
- ], Y.prototype, "load", null), m([
1049
- c(J.LOAD_VERSIONED),
1050
- p(0, l("version")),
1051
- p(1, i()),
1052
- f("design:type", Function),
1053
- f("design:paramtypes", [
1692
+ p([
1693
+ c(X.LOAD),
1694
+ f(0, i()),
1695
+ d("design:type", Function),
1696
+ d("design:paramtypes", [typeof Record > "u" ? Object : Record, typeof AbortController > "u" ? Object : AbortController]),
1697
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1698
+ ], Z.prototype, "load", null), p([
1699
+ c(X.LOAD_VERSIONED),
1700
+ f(0, l("version")),
1701
+ f(1, i()),
1702
+ d("design:type", Function),
1703
+ d("design:paramtypes", [
1054
1704
  Number,
1055
1705
  typeof Record > "u" ? Object : Record,
1056
1706
  typeof AbortController > "u" ? Object : AbortController
1057
1707
  ]),
1058
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
1059
- ], Y.prototype, "loadVersioned", null), m([
1060
- c(J.LOAD_TIME_BASED),
1061
- p(0, l("createTime")),
1062
- p(1, i()),
1063
- f("design:type", Function),
1064
- f("design:paramtypes", [
1708
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1709
+ ], Z.prototype, "loadVersioned", null), p([
1710
+ c(X.LOAD_TIME_BASED),
1711
+ f(0, l("createTime")),
1712
+ f(1, i()),
1713
+ d("design:type", Function),
1714
+ d("design:paramtypes", [
1065
1715
  Number,
1066
1716
  typeof Record > "u" ? Object : Record,
1067
1717
  typeof AbortController > "u" ? Object : AbortController
1068
1718
  ]),
1069
- f("design:returntype", typeof Promise > "u" ? Object : Promise)
1070
- ], Y.prototype, "loadTimeBased", null), Y = m([r(), f("design:paramtypes", [Object])], Y);
1719
+ d("design:returntype", typeof Promise > "u" ? Object : Promise)
1720
+ ], Z.prototype, "loadTimeBased", null), Z = p([r(), d("design:paramtypes", [Object])], Z);
1071
1721
  //#endregion
1072
1722
  //#region src/query/cursorQuery.ts
1073
- var Ue = "~";
1074
- function X({ field: e, cursorId: t = "~", direction: n = V.DESC }) {
1075
- return n === V.ASC ? T(e, t) : E(e, t);
1723
+ var Tt = "~";
1724
+ function Et({ field: e, cursorId: t = "~", direction: n = U.DESC }) {
1725
+ return n === U.ASC ? ve(e, t) : ye(e, t);
1726
+ }
1727
+ function Dt({ field: e, cursorId: t = "~", direction: n = U.DESC }) {
1728
+ return n === U.ASC ? P.gt(e, t) : P.lt(e, t);
1076
1729
  }
1077
- function Z({ field: e, direction: t = V.DESC }) {
1730
+ function Q({ field: e, direction: t = U.DESC }) {
1078
1731
  return {
1079
1732
  field: e,
1080
1733
  direction: t
1081
1734
  };
1082
1735
  }
1083
- function We(e) {
1084
- let t = e.query, n = b(X(e), t.condition), r = Z(e);
1736
+ function Ot(e) {
1737
+ let t = e.query, n = Q(e), r = "filter" in t ? t.filter : void 0;
1738
+ if (r !== void 0) return {
1739
+ ...t,
1740
+ filter: P.and([Dt(e), r]),
1741
+ sort: [n]
1742
+ };
1743
+ let i = t;
1085
1744
  return {
1086
1745
  ...t,
1087
- condition: n,
1088
- sort: [r]
1746
+ condition: b(Et(e), i.condition),
1747
+ sort: [n]
1089
1748
  };
1090
1749
  }
1091
1750
  //#endregion
1092
1751
  //#region src/query/queryClients.ts
1093
- function Q(e) {
1752
+ function $(e) {
1094
1753
  let n = t(e.resourceAttribution ?? "", e.aggregateName ?? "");
1095
1754
  return e.contextAlias && (n = t(e.contextAlias, n)), {
1096
1755
  ...e,
1097
1756
  basePath: n
1098
1757
  };
1099
1758
  }
1100
- var Ge = class {
1759
+ var kt = class {
1101
1760
  constructor(e) {
1102
1761
  this.defaultOptions = e;
1103
1762
  }
1104
1763
  createSnapshotQueryClient(e) {
1105
- let t = Q({
1764
+ let t = $({
1106
1765
  ...this.defaultOptions,
1107
1766
  ...e
1108
1767
  });
1109
- return new G(t);
1768
+ return new q(t);
1110
1769
  }
1111
1770
  createLoadStateAggregateClient(e) {
1112
- let t = Q({
1771
+ let t = $({
1113
1772
  ...this.defaultOptions,
1114
1773
  ...e
1115
1774
  });
1116
- return new q(t);
1775
+ return new Y(t);
1117
1776
  }
1118
1777
  createOwnerLoadStateAggregateClient(e) {
1119
- let t = Q({
1778
+ let t = $({
1120
1779
  ...this.defaultOptions,
1121
1780
  ...e
1122
1781
  });
1123
- return new Y(t);
1782
+ return new Z(t);
1124
1783
  }
1125
1784
  createEventStreamQueryClient(e) {
1126
- let t = Q({
1785
+ let t = $({
1127
1786
  ...this.defaultOptions,
1128
1787
  ...e
1129
1788
  });
1130
- return new U(t);
1789
+ return new G(t);
1131
1790
  }
1132
- }, Ke = {}, qe = ["*"], Je = /* @__PURE__ */ function(e) {
1791
+ }, At = {}, jt = ["*"], Mt = /* @__PURE__ */ function(e) {
1133
1792
  return e.NONE = "", e.TENANT = "/tenant/{tenantId}", e.OWNER = "/owner/{ownerId}", e.TENANT_OWNER = "/tenant/{tenantId}/owner/{ownerId}", e;
1134
- }({}), Ye = /* @__PURE__ */ function(e) {
1793
+ }({}), Nt = /* @__PURE__ */ function(e) {
1135
1794
  return e.RECOVERABLE = "RECOVERABLE", e.UNKNOWN = "UNKNOWN", e.UNRECOVERABLE = "UNRECOVERABLE", e;
1136
- }({}), $ = class e {
1795
+ }({}), Pt = class e {
1137
1796
  static {
1138
1797
  this.SUCCEEDED = "Ok";
1139
1798
  }
@@ -1200,14 +1859,14 @@ var Ge = class {
1200
1859
  static isError(t) {
1201
1860
  return !e.isSucceeded(t);
1202
1861
  }
1203
- }, Xe = /* @__PURE__ */ function(e) {
1862
+ }, Ft = /* @__PURE__ */ function(e) {
1204
1863
  return e.COMMAND = "COMMAND", e.ERROR = "ERROR", e.EVENT = "EVENT", e.SOURCING = "SOURCING", e.STATE_EVENT = "STATE_EVENT", e;
1205
- }({}), Ze = "", Qe = /* @__PURE__ */ function(e) {
1864
+ }({}), It = "", Lt = /* @__PURE__ */ function(e) {
1206
1865
  return e.MAP = "MAP", e.STRING = "STRING", e;
1207
1866
  }({});
1208
1867
  //#endregion
1209
1868
  //#region src/getPropertyValue.ts
1210
- function $e(e, t, n) {
1869
+ function Rt(e, t, n) {
1211
1870
  if (e == null) return n;
1212
1871
  let r = Array.isArray(t) ? t : t.split(".").filter(Boolean);
1213
1872
  if (r.length === 0) return e;
@@ -1224,6 +1883,6 @@ function $e(e, t, n) {
1224
1883
  return i;
1225
1884
  }
1226
1885
  //#endregion
1227
- export { Ue as CURSOR_ID_START, h as CommandClient, ee as CommandHeaders, te as CommandStage, ie as ConditionOptionKey, Ze as DEFAULT_OWNER_ID, F as DEFAULT_PAGINATION, I as DEFAULT_PROJECTION, ae as DeletionState, Ve as DomainEventStreamMetadataFields, Ke as EMPTY_ABAC_TAGS, B as EMPTY_PAGED_LIST, re as EMPTY_VALUE_OPERATORS, $ as ErrorCodes, U as EventStreamQueryClient, H as EventStreamQueryEndpointPaths, Xe as FunctionKind, ne as LOGICAL_OPERATORS, Y as LoadOwnerStateAggregateClient, J as LoadOwnerStateAggregateEndpointPaths, q as LoadStateAggregateClient, K as LoadStateAggregateEndpointPaths, Qe as MessageHeaderSqlType, g as Operator, Ge as QueryClientFactory, Ye as RecoverableType, Je as ResourceAttributionPathSpec, He as SnapshotMetadataFields, G as SnapshotQueryClient, W as SnapshotQueryEndpointPaths, V as SortDirection, qe as WILDCARD_ABAC_TAG_VALUES, pe as active, x as aggregateId, S as aggregateIds, w as all, k as allIn, b as and, ze as asc, Te as beforeToday, O as between, ve as contains, Q as createQueryApiMetadata, X as cursorCondition, We as cursorQuery, Z as cursorSort, y as dateOptions, L as defaultProjection, C as deleted, Be as desc, Ne as earlierDays, N as elemMatch, M as endsWith, me as eq, Ce as exists, $e as getPropertyValue, T as gt, ge as gte, ce as id, le as ids, v as ignoreCaseOptions, Se as isFalse, ye as isIn, P as isNull, xe as isTrue, _ as isValidateCondition, je as lastMonth, ke as lastWeek, z as listQuery, E as lt, _e as lte, j as match, he as ne, Oe as nextWeek, se as nor, D as notIn, be as notNull, oe as or, de as ownerId, Re as pagedList, Le as pagedQuery, Fe as pagination, Ie as projection, Pe as raw, Me as recentDays, R as singleQuery, fe as spaceId, A as startsWith, ue as tenantId, Ae as thisMonth, De as thisWeek, we as today, Ee as tomorrow };
1886
+ export { dt as AggregationDateUnit, ut as AggregationExpressionOperator, lt as AggregationExpressionType, ft as AggregationFunction, st as AggregationGroupType, ct as AggregationMetricType, Tt as CURSOR_ID_START, m as CommandClient, te as CommandHeaders, ne as CommandStage, ae as ConditionOptionKey, It as DEFAULT_OWNER_ID, z as DEFAULT_PAGINATION, ht as DEFAULT_PROJECTION, y as DeletionState, Ct as DomainEventStreamMetadataFields, At as EMPTY_ABAC_TAGS, yt as EMPTY_PAGED_LIST, ie as EMPTY_VALUE_OPERATORS, Pt as ErrorCodes, G as EventStreamQueryClient, W as EventStreamQueryEndpointPaths, qe as FilterOperator, Ft as FunctionKind, re as LOGICAL_OPERATORS, Z as LoadOwnerStateAggregateClient, X as LoadOwnerStateAggregateEndpointPaths, Y as LoadStateAggregateClient, J as LoadStateAggregateEndpointPaths, Lt as MessageHeaderSqlType, h as Operator, kt as QueryClientFactory, Nt as RecoverableType, Mt as ResourceAttributionPathSpec, C as SearchMode, wt as SnapshotMetadataFields, q as SnapshotQueryClient, K as SnapshotQueryEndpointPaths, U as SortDirection, Je as StringComparison, w as TimeUnit, jt as WILDCARD_ABAC_TAG_VALUES, he as active, x as aggregateId, ue as aggregateIds, pt as aggregation, S as all, Ee as allIn, b as and, xt as asc, Le as beforeToday, Te as between, Se as contains, $ as createQueryApiMetadata, Et as cursorCondition, Dt as cursorFilter, Ot as cursorQuery, Q as cursorSort, v as dateOptions, gt as defaultProjection, me as deleted, St as desc, Ge as earlierDays, Ae as elemMatch, ke as endsWith, ge as eq, Fe as exists, P as filter, Rt as getPropertyValue, ve as gt, be as gte, ce as id, le as ids, _ as ignoreCaseOptions, Pe as isFalse, Ce as isIn, je as isNull, Ne as isTrue, g as isValidateCondition, Ue as lastMonth, Ve as lastWeek, H as listQuery, ye as lt, xe as lte, Oe as match, _e as ne, Be as nextWeek, se as nor, we as notIn, Me as notNull, oe as or, fe as ownerId, bt as pagedList, vt as pagedQuery, mt as pagination, _t as projection, Ke as raw, We as recentDays, V as singleQuery, pe as spaceId, De as startsWith, de as tenantId, He as thisMonth, ze as thisWeek, Ie as today, Re as tomorrow };
1228
1887
 
1229
1888
  //# sourceMappingURL=index.es.js.map