@ahoo-wang/fetcher-wow 1.5.2 → 1.5.3

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.
@@ -54,14 +54,20 @@ export declare class CommandClient {
54
54
  * @param path - The endpoint path to send the command to
55
55
  * @param commandHttpRequest - The command HTTP request containing headers, method, and body
56
56
  * @param extractor - Function to extract the result from the response, defaults to JSON extractor
57
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
58
+ * throughout the request lifecycle. These attributes allow passing
59
+ * custom data between different interceptors.
57
60
  * @returns A promise that resolves to the extracted result of type R
58
61
  */
59
- protected sendCommand<R>(path: string, commandHttpRequest: CommandRequest, extractor?: ResultExtractor<any>): Promise<R>;
62
+ protected sendCommand<R>(path: string, commandHttpRequest: CommandRequest, extractor?: ResultExtractor<any>, attributes?: Record<string, any>): Promise<R>;
60
63
  /**
61
64
  * Send a command to the server and wait for the result.
62
65
  *
63
66
  * @param path - The endpoint path to send the command to
64
67
  * @param commandHttpRequest - The command request to send
68
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
69
+ * throughout the request lifecycle. These attributes allow passing
70
+ * custom data between different interceptors.
65
71
  * @returns A promise that resolves to the command execution result
66
72
  *
67
73
  * @example
@@ -75,13 +81,16 @@ export declare class CommandClient {
75
81
  * });
76
82
  * ```
77
83
  */
78
- send(path: string, commandHttpRequest: CommandRequest): Promise<CommandResult>;
84
+ send(path: string, commandHttpRequest: CommandRequest, attributes?: Record<string, any>): Promise<CommandResult>;
79
85
  /**
80
86
  * Send a command to the server and wait for the result as a stream.
81
87
  * This is useful for long-running commands that produce multiple events.
82
88
  *
83
89
  * @param path - The endpoint path to send the command to
84
90
  * @param commandHttpRequest - The command request to send
91
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
92
+ * throughout the request lifecycle. These attributes allow passing
93
+ * custom data between different interceptors.
85
94
  * @returns A promise that resolves to a stream of command execution results
86
95
  *
87
96
  * @example
@@ -102,6 +111,6 @@ export declare class CommandClient {
102
111
  * }
103
112
  * ```
104
113
  */
105
- sendAndWaitStream(path: string, commandHttpRequest: CommandRequest): Promise<CommandResultEventStream>;
114
+ sendAndWaitStream(path: string, commandHttpRequest: CommandRequest, attributes?: Record<string, any>): Promise<CommandResultEventStream>;
106
115
  }
107
116
  //# sourceMappingURL=commandClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commandClient.d.ts","sourceRoot":"","sources":["../../src/command/commandClient.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC9B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAGL,eAAe,EAEhB,MAAM,oBAAoB,CAAC;AAG5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,qBAAa,aAAa;IACZ,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,aAAa;gBAAtB,OAAO,EAAE,aAAa;IAGrD;;;;;;;;OAQG;cACa,WAAW,CAAC,CAAC,EAC3B,IAAI,EAAE,MAAM,EACZ,kBAAkB,EAAE,cAAc,EAClC,SAAS,GAAE,eAAe,CAAC,GAAG,CAAyB,GACtD,OAAO,CAAC,CAAC,CAAC;IAUb;;;;;;;;;;;;;;;;;OAiBG;IACH,IAAI,CACF,IAAI,EAAE,MAAM,EACZ,kBAAkB,EAAE,cAAc,GACjC,OAAO,CAAC,aAAa,CAAC;IAIzB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,iBAAiB,CACrB,IAAI,EAAE,MAAM,EACZ,kBAAkB,EAAE,cAAc,GACjC,OAAO,CAAC,wBAAwB,CAAC;CAWrC"}
1
+ {"version":3,"file":"commandClient.d.ts","sourceRoot":"","sources":["../../src/command/commandClient.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC9B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAGL,eAAe,EAEhB,MAAM,oBAAoB,CAAC;AAG5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,qBAAa,aAAa;IACZ,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,aAAa;gBAAtB,OAAO,EAAE,aAAa;IAGrD;;;;;;;;;;;OAWG;cACa,WAAW,CAAC,CAAC,EAC3B,IAAI,EAAE,MAAM,EACZ,kBAAkB,EAAE,cAAc,EAClC,SAAS,GAAE,eAAe,CAAC,GAAG,CAAyB,EACvD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC/B,OAAO,CAAC,CAAC,CAAC;IASb;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,IAAI,CACF,IAAI,EAAE,MAAM,EACZ,kBAAkB,EAAE,cAAc,EAClC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC/B,OAAO,CAAC,aAAa,CAAC;IAIzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACG,iBAAiB,CACrB,IAAI,EAAE,MAAM,EACZ,kBAAkB,EAAE,cAAc,EAClC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC/B,OAAO,CAAC,wBAAwB,CAAC;CAYrC"}
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ResultExtractors as U, combineURLs as V, ContentTypeValues as L, HttpMethod as Y } from "@ahoo-wang/fetcher";
1
+ import { ResultExtractors as f, combineURLs as V, ContentTypeValues as L, HttpMethod as Y } from "@ahoo-wang/fetcher";
2
2
  import { JsonEventStreamResultExtractor as _ } from "@ahoo-wang/fetcher-eventstream";
3
3
  class v {
4
4
  constructor(E) {
@@ -11,20 +11,26 @@ class v {
11
11
  * @param path - The endpoint path to send the command to
12
12
  * @param commandHttpRequest - The command HTTP request containing headers, method, and body
13
13
  * @param extractor - Function to extract the result from the response, defaults to JSON extractor
14
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
15
+ * throughout the request lifecycle. These attributes allow passing
16
+ * custom data between different interceptors.
14
17
  * @returns A promise that resolves to the extracted result of type R
15
18
  */
16
- async sendCommand(E, T, s = U.Json) {
17
- const R = V(this.options.basePath, E), M = {
19
+ async sendCommand(E, T, s = f.Json, R) {
20
+ const h = V(this.options.basePath, E), C = {
18
21
  ...T,
19
- url: R
20
- }, h = await this.options.fetcher.request(M);
21
- return s(h);
22
+ url: h
23
+ };
24
+ return await this.options.fetcher.request(C, s, R);
22
25
  }
23
26
  /**
24
27
  * Send a command to the server and wait for the result.
25
28
  *
26
29
  * @param path - The endpoint path to send the command to
27
30
  * @param commandHttpRequest - The command request to send
31
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
32
+ * throughout the request lifecycle. These attributes allow passing
33
+ * custom data between different interceptors.
28
34
  * @returns A promise that resolves to the command execution result
29
35
  *
30
36
  * @example
@@ -38,8 +44,8 @@ class v {
38
44
  * });
39
45
  * ```
40
46
  */
41
- send(E, T) {
42
- return this.sendCommand(E, T);
47
+ send(E, T, s) {
48
+ return this.sendCommand(E, T, f.Json, s);
43
49
  }
44
50
  /**
45
51
  * Send a command to the server and wait for the result as a stream.
@@ -47,6 +53,9 @@ class v {
47
53
  *
48
54
  * @param path - The endpoint path to send the command to
49
55
  * @param commandHttpRequest - The command request to send
56
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
57
+ * throughout the request lifecycle. These attributes allow passing
58
+ * custom data between different interceptors.
50
59
  * @returns A promise that resolves to a stream of command execution results
51
60
  *
52
61
  * @example
@@ -67,30 +76,31 @@ class v {
67
76
  * }
68
77
  * ```
69
78
  */
70
- async sendAndWaitStream(E, T) {
79
+ async sendAndWaitStream(E, T, s) {
71
80
  return T.headers = {
72
81
  ...T.headers,
73
82
  Accept: L.TEXT_EVENT_STREAM
74
83
  }, this.sendCommand(
75
84
  E,
76
85
  T,
77
- _
86
+ _,
87
+ s
78
88
  );
79
89
  }
80
90
  }
81
91
  const i = class i {
82
92
  };
83
93
  i.COMMAND_HEADERS_PREFIX = "Command-", i.TENANT_ID = `${i.COMMAND_HEADERS_PREFIX}Tenant-Id`, i.OWNER_ID = `${i.COMMAND_HEADERS_PREFIX}Owner-Id`, i.AGGREGATE_ID = `${i.COMMAND_HEADERS_PREFIX}Aggregate-Id`, i.AGGREGATE_VERSION = `${i.COMMAND_HEADERS_PREFIX}Aggregate-Version`, i.WAIT_PREFIX = `${i.COMMAND_HEADERS_PREFIX}Wait-`, i.WAIT_TIME_OUT = `${i.WAIT_PREFIX}Timeout`, i.WAIT_STAGE = `${i.WAIT_PREFIX}Stage`, i.WAIT_CONTEXT = `${i.WAIT_PREFIX}Context`, i.WAIT_PROCESSOR = `${i.WAIT_PREFIX}Processor`, i.WAIT_FUNCTION = `${i.WAIT_PREFIX}Function`, i.WAIT_TAIL_PREFIX = `${i.WAIT_PREFIX}Tail-`, i.WAIT_TAIL_STAGE = `${i.WAIT_TAIL_PREFIX}Stage`, i.WAIT_TAIL_CONTEXT = `${i.WAIT_TAIL_PREFIX}Context`, i.WAIT_TAIL_PROCESSOR = `${i.WAIT_TAIL_PREFIX}Processor`, i.WAIT_TAIL_FUNCTION = `${i.WAIT_TAIL_PREFIX}Function`, i.REQUEST_ID = `${i.COMMAND_HEADERS_PREFIX}Request-Id`, i.LOCAL_FIRST = `${i.COMMAND_HEADERS_PREFIX}Local-First`, i.COMMAND_AGGREGATE_CONTEXT = `${i.COMMAND_HEADERS_PREFIX}Aggregate-Context`, i.COMMAND_AGGREGATE_NAME = `${i.COMMAND_HEADERS_PREFIX}Aggregate-Name`, i.COMMAND_TYPE = `${i.COMMAND_HEADERS_PREFIX}Type`, i.COMMAND_HEADER_X_PREFIX = `${i.COMMAND_HEADERS_PREFIX}Header-`;
84
- let C = i;
94
+ let W = i;
85
95
  var B = /* @__PURE__ */ ((t) => (t.SENT = "SENT", t.PROCESSED = "PROCESSED", t.SNAPSHOT = "SNAPSHOT", t.PROJECTED = "PROJECTED", t.EVENT_HANDLED = "EVENT_HANDLED", t.SAGA_HANDLED = "SAGA_HANDLED", t))(B || {}), A = /* @__PURE__ */ ((t) => (t.AND = "AND", t.OR = "OR", t.NOR = "NOR", t.ID = "ID", t.IDS = "IDS", t.AGGREGATE_ID = "AGGREGATE_ID", t.AGGREGATE_IDS = "AGGREGATE_IDS", t.TENANT_ID = "TENANT_ID", t.OWNER_ID = "OWNER_ID", t.DELETED = "DELETED", t.ALL = "ALL", t.EQ = "EQ", t.NE = "NE", t.GT = "GT", t.LT = "LT", t.GTE = "GTE", t.LTE = "LTE", t.CONTAINS = "CONTAINS", t.IN = "IN", t.NOT_IN = "NOT_IN", t.BETWEEN = "BETWEEN", t.ALL_IN = "ALL_IN", t.STARTS_WITH = "STARTS_WITH", t.ENDS_WITH = "ENDS_WITH", t.ELEM_MATCH = "ELEM_MATCH", t.NULL = "NULL", t.NOT_NULL = "NOT_NULL", t.TRUE = "TRUE", t.FALSE = "FALSE", t.EXISTS = "EXISTS", t.TODAY = "TODAY", t.BEFORE_TODAY = "BEFORE_TODAY", t.TOMORROW = "TOMORROW", t.THIS_WEEK = "THIS_WEEK", t.NEXT_WEEK = "NEXT_WEEK", t.LAST_WEEK = "LAST_WEEK", t.THIS_MONTH = "THIS_MONTH", t.LAST_MONTH = "LAST_MONTH", t.RECENT_DAYS = "RECENT_DAYS", t.EARLIER_DAYS = "EARLIER_DAYS", t.RAW = "RAW", t))(A || {});
86
- function f(t) {
96
+ function G(t) {
87
97
  return !!t;
88
98
  }
89
99
  const o = class o {
90
100
  };
91
101
  o.IGNORE_CASE_OPTION_KEY = "ignoreCase", o.ZONE_ID_OPTION_KEY = "zoneId", o.DATE_PATTERN_OPTION_KEY = "datePattern";
92
- let W = o;
93
- function G(t) {
102
+ let l = o;
103
+ function M(t) {
94
104
  if (!(typeof t > "u"))
95
105
  return { ignoreCase: t };
96
106
  }
@@ -105,15 +115,15 @@ function k(...t) {
105
115
  if (t.length === 0)
106
116
  return D();
107
117
  if (t.length === 1)
108
- return f(t[0]) ? t[0] : D();
118
+ return G(t[0]) ? t[0] : D();
109
119
  const E = [];
110
120
  return t.forEach((T) => {
111
- T?.operator === A.ALL || !f(T) || (T.operator === A.AND && T.children ? E.push(...T.children) : E.push(T));
121
+ T?.operator === A.ALL || !G(T) || (T.operator === A.AND && T.children ? E.push(...T.children) : E.push(T));
112
122
  }), { operator: A.AND, children: E };
113
123
  }
114
124
  function z(...t) {
115
125
  const E = t?.filter(
116
- (T) => f(T)
126
+ (T) => G(T)
117
127
  );
118
128
  return E.length === 0 ? D() : { operator: A.OR, children: E };
119
129
  }
@@ -167,11 +177,11 @@ function At(t, E) {
167
177
  function st(t, E) {
168
178
  return { field: t, operator: A.GTE, value: E };
169
179
  }
170
- function ct(t, E) {
180
+ function nt(t, E) {
171
181
  return { field: t, operator: A.LTE, value: E };
172
182
  }
173
- function nt(t, E, T) {
174
- const s = G(T);
183
+ function ct(t, E, T) {
184
+ const s = M(T);
175
185
  return { field: t, operator: A.CONTAINS, value: E, options: s };
176
186
  }
177
187
  function It(t, ...E) {
@@ -187,11 +197,11 @@ function ut(t, ...E) {
187
197
  return { field: t, operator: A.ALL_IN, value: E };
188
198
  }
189
199
  function Rt(t, E, T) {
190
- const s = G(T);
200
+ const s = M(T);
191
201
  return { field: t, operator: A.STARTS_WITH, value: E, options: s };
192
202
  }
193
203
  function et(t, E, T) {
194
- const s = G(T);
204
+ const s = M(T);
195
205
  return { field: t, operator: A.ENDS_WITH, value: E, options: s };
196
206
  }
197
207
  function Dt(t, E) {
@@ -240,11 +250,11 @@ function lt(t, E, T) {
240
250
  const s = u(E, T);
241
251
  return { field: t, operator: A.THIS_MONTH, options: s };
242
252
  }
243
- function gt(t, E, T) {
253
+ function Pt(t, E, T) {
244
254
  const s = u(E, T);
245
255
  return { field: t, operator: A.LAST_MONTH, options: s };
246
256
  }
247
- function Pt(t, E, T, s) {
257
+ function gt(t, E, T, s) {
248
258
  const R = u(T, s);
249
259
  return { field: t, operator: A.RECENT_DAYS, value: E, options: R };
250
260
  }
@@ -343,18 +353,21 @@ class X {
343
353
  * @param query - The query parameters to send
344
354
  * @param accept - The content type to accept from the server, defaults to application/json
345
355
  * @param extractor - Function to extract the result from the response, defaults to JSON extractor
356
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
357
+ * throughout the request lifecycle. These attributes allow passing
358
+ * custom data between different interceptors.
346
359
  * @returns A promise that resolves to the query result
347
360
  */
348
- async query(E, T, s = L.APPLICATION_JSON, R = U.Json) {
349
- const h = {
361
+ async query(E, T, s, R = L.APPLICATION_JSON, h = f.Json) {
362
+ const $ = {
350
363
  url: V(this.options.basePath, E),
351
364
  method: Y.POST,
352
365
  headers: {
353
- Accept: s
366
+ Accept: R
354
367
  },
355
368
  body: T
356
- }, $ = await this.options.fetcher.request(h);
357
- return R($);
369
+ };
370
+ return await this.options.fetcher.request($, h, s);
358
371
  }
359
372
  }
360
373
  var x = /* @__PURE__ */ ((t) => (t.ASC = "ASC", t.DESC = "DESC", t))(x || {});
@@ -372,10 +385,10 @@ function at(t) {
372
385
  /* DESC */
373
386
  };
374
387
  }
375
- const c = class c {
388
+ const n = class n {
376
389
  };
377
- c.HEADER = "header", c.COMMAND_OPERATOR = `${c.HEADER}.command_operator`, c.AGGREGATE_ID = "aggregateId", c.TENANT_ID = "tenantId", c.OWNER_ID = "ownerId", c.COMMAND_ID = "commandId", c.REQUEST_ID = "requestId", c.VERSION = "version", c.BODY = "body", c.BODY_ID = `${c.BODY}.id`, c.BODY_NAME = `${c.BODY}.name`, c.BODY_TYPE = `${c.BODY}.bodyType`, c.BODY_REVISION = `${c.BODY}.revision`, c.BODY_BODY = `${c.BODY}.body`, c.CREATE_TIME = "createTime";
378
- let l = c;
390
+ n.HEADER = "header", n.COMMAND_OPERATOR = `${n.HEADER}.command_operator`, n.AGGREGATE_ID = "aggregateId", n.TENANT_ID = "tenantId", n.OWNER_ID = "ownerId", n.COMMAND_ID = "commandId", n.REQUEST_ID = "requestId", n.VERSION = "version", n.BODY = "body", n.BODY_ID = `${n.BODY}.id`, n.BODY_NAME = `${n.BODY}.name`, n.BODY_TYPE = `${n.BODY}.bodyType`, n.BODY_REVISION = `${n.BODY}.revision`, n.BODY_BODY = `${n.BODY}.body`, n.CREATE_TIME = "createTime";
391
+ let P = n;
379
392
  const e = class e {
380
393
  };
381
394
  e.EVENT_STREAM_RESOURCE_NAME = "event", e.COUNT = `${e.EVENT_STREAM_RESOURCE_NAME}/count`, e.LIST = `${e.EVENT_STREAM_RESOURCE_NAME}/list`, e.PAGED = `${e.EVENT_STREAM_RESOURCE_NAME}/paged`;
@@ -392,6 +405,9 @@ class xt extends X {
392
405
  * Counts the number of domain event streams that match the given condition.
393
406
  *
394
407
  * @param condition - The condition to filter event streams
408
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
409
+ * throughout the request lifecycle. These attributes allow passing
410
+ * custom data between different interceptors.
395
411
  * @returns A promise that resolves to the count of matching event streams
396
412
  *
397
413
  * @example
@@ -400,13 +416,16 @@ class xt extends X {
400
416
  * console.log('Total event streams:', count);
401
417
  * ```
402
418
  */
403
- count(E) {
404
- return this.query(S.COUNT, E);
419
+ count(E, T) {
420
+ return this.query(S.COUNT, E, T);
405
421
  }
406
422
  /**
407
423
  * Retrieves a list of domain event streams based on the provided query parameters.
408
424
  *
409
425
  * @param listQuery - The query parameters for listing event streams
426
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
427
+ * throughout the request lifecycle. These attributes allow passing
428
+ * custom data between different interceptors.
410
429
  * @returns A promise that resolves to an array of partial domain event streams
411
430
  *
412
431
  * @example
@@ -420,14 +439,17 @@ class xt extends X {
420
439
  * }
421
440
  * ```
422
441
  */
423
- list(E) {
424
- return this.query(S.LIST, E);
442
+ list(E, T) {
443
+ return this.query(S.LIST, E, T);
425
444
  }
426
445
  /**
427
446
  * Retrieves a stream of domain event streams based on the provided query parameters.
428
447
  * Sets the Accept header to text/event-stream to indicate that the response should be streamed.
429
448
  *
430
449
  * @param listQuery - The query parameters for listing event streams
450
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
451
+ * throughout the request lifecycle. These attributes allow passing
452
+ * custom data between different interceptors.
431
453
  * @returns A promise that resolves to a readable stream of JSON server-sent events containing partial domain event streams
432
454
  *
433
455
  * @example
@@ -442,10 +464,11 @@ class xt extends X {
442
464
  * }
443
465
  * ```
444
466
  */
445
- listStream(E) {
467
+ listStream(E, T) {
446
468
  return this.query(
447
469
  S.LIST,
448
470
  E,
471
+ T,
449
472
  L.TEXT_EVENT_STREAM,
450
473
  _
451
474
  );
@@ -454,6 +477,9 @@ class xt extends X {
454
477
  * Retrieves a paged list of domain event streams based on the provided query parameters.
455
478
  *
456
479
  * @param pagedQuery - The query parameters for paging event streams
480
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
481
+ * throughout the request lifecycle. These attributes allow passing
482
+ * custom data between different interceptors.
457
483
  * @returns A promise that resolves to a paged list of partial domain event streams
458
484
  *
459
485
  * @example
@@ -470,8 +496,8 @@ class xt extends X {
470
496
  * }
471
497
  * ```
472
498
  */
473
- paged(E) {
474
- return this.query(S.PAGED, E);
499
+ paged(E, T) {
500
+ return this.query(S.PAGED, E, T);
475
501
  }
476
502
  }
477
503
  const N = class N {
@@ -494,6 +520,9 @@ class wt extends X {
494
520
  * Counts the number of snapshots that match the given condition.
495
521
  *
496
522
  * @param condition - The condition to match snapshots against
523
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
524
+ * throughout the request lifecycle. These attributes allow passing
525
+ * custom data between different interceptors.
497
526
  * @returns A promise that resolves to the count of matching snapshots
498
527
  *
499
528
  * @example
@@ -502,13 +531,16 @@ class wt extends X {
502
531
  * console.log('Total snapshots:', count);
503
532
  * ```
504
533
  */
505
- async count(E) {
506
- return this.query(r.COUNT, E);
534
+ async count(E, T) {
535
+ return this.query(r.COUNT, E, T);
507
536
  }
508
537
  /**
509
538
  * Retrieves a list of materialized snapshots based on the provided query parameters.
510
539
  *
511
540
  * @param listQuery - The query parameters for listing snapshots
541
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
542
+ * throughout the request lifecycle. These attributes allow passing
543
+ * custom data between different interceptors.
512
544
  * @returns A promise that resolves to an array of partial materialized snapshots
513
545
  *
514
546
  * @example
@@ -522,13 +554,16 @@ class wt extends X {
522
554
  * }
523
555
  * ```
524
556
  */
525
- list(E) {
526
- return this.query(r.LIST, E);
557
+ list(E, T) {
558
+ return this.query(r.LIST, E, T);
527
559
  }
528
560
  /**
529
561
  * Retrieves a stream of materialized snapshots based on the provided query parameters.
530
562
  *
531
563
  * @param listQuery - The query parameters for listing snapshots
564
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
565
+ * throughout the request lifecycle. These attributes allow passing
566
+ * custom data between different interceptors.
532
567
  * @returns A promise that resolves to a readable stream of JSON server-sent events containing partial materialized snapshots
533
568
  *
534
569
  * @example
@@ -543,10 +578,11 @@ class wt extends X {
543
578
  * }
544
579
  * ```
545
580
  */
546
- listStream(E) {
581
+ listStream(E, T) {
547
582
  return this.query(
548
583
  r.LIST,
549
584
  E,
585
+ T,
550
586
  L.TEXT_EVENT_STREAM,
551
587
  _
552
588
  );
@@ -555,6 +591,9 @@ class wt extends X {
555
591
  * Retrieves a list of snapshot states based on the provided query parameters.
556
592
  *
557
593
  * @param listQuery - The query parameters for listing snapshot states
594
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
595
+ * throughout the request lifecycle. These attributes allow passing
596
+ * custom data between different interceptors.
558
597
  * @returns A promise that resolves to an array of partial snapshot states
559
598
  *
560
599
  * @example
@@ -568,13 +607,16 @@ class wt extends X {
568
607
  * }
569
608
  * ```
570
609
  */
571
- listState(E) {
572
- return this.query(r.LIST_STATE, E);
610
+ listState(E, T) {
611
+ return this.query(r.LIST_STATE, E, T);
573
612
  }
574
613
  /**
575
614
  * Retrieves a stream of snapshot states based on the provided query parameters.
576
615
  *
577
616
  * @param listQuery - The query parameters for listing snapshot states
617
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
618
+ * throughout the request lifecycle. These attributes allow passing
619
+ * custom data between different interceptors.
578
620
  * @returns A promise that resolves to a readable stream of JSON server-sent events containing partial snapshot states
579
621
  *
580
622
  * @example
@@ -589,10 +631,11 @@ class wt extends X {
589
631
  * }
590
632
  * ```
591
633
  */
592
- listStateStream(E) {
634
+ listStateStream(E, T) {
593
635
  return this.query(
594
636
  r.LIST_STATE,
595
637
  E,
638
+ T,
596
639
  L.TEXT_EVENT_STREAM,
597
640
  _
598
641
  );
@@ -601,6 +644,9 @@ class wt extends X {
601
644
  * Retrieves a paged list of materialized snapshots based on the provided query parameters.
602
645
  *
603
646
  * @param pagedQuery - The query parameters for paging snapshots
647
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
648
+ * throughout the request lifecycle. These attributes allow passing
649
+ * custom data between different interceptors.
604
650
  * @returns A promise that resolves to a paged list of partial materialized snapshots
605
651
  *
606
652
  * @example
@@ -617,13 +663,16 @@ class wt extends X {
617
663
  * }
618
664
  * ```
619
665
  */
620
- paged(E) {
621
- return this.query(r.PAGED, E);
666
+ paged(E, T) {
667
+ return this.query(r.PAGED, E, T);
622
668
  }
623
669
  /**
624
670
  * Retrieves a paged list of snapshot states based on the provided query parameters.
625
671
  *
626
672
  * @param pagedQuery - The query parameters for paging snapshot states
673
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
674
+ * throughout the request lifecycle. These attributes allow passing
675
+ * custom data between different interceptors.
627
676
  * @returns A promise that resolves to a paged list of partial snapshot states
628
677
  *
629
678
  * @example
@@ -639,13 +688,16 @@ class wt extends X {
639
688
  * }
640
689
  * ```
641
690
  */
642
- pagedState(E) {
643
- return this.query(r.PAGED_STATE, E);
691
+ pagedState(E, T) {
692
+ return this.query(r.PAGED_STATE, E, T);
644
693
  }
645
694
  /**
646
695
  * Retrieves a single materialized snapshot based on the provided query parameters.
647
696
  *
648
697
  * @param singleQuery - The query parameters for retrieving a single snapshot
698
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
699
+ * throughout the request lifecycle. These attributes allow passing
700
+ * custom data between different interceptors.
649
701
  * @returns A promise that resolves to a partial materialized snapshot
650
702
  *
651
703
  * @example
@@ -657,13 +709,16 @@ class wt extends X {
657
709
  * console.log('Snapshot:', single);
658
710
  * ```
659
711
  */
660
- single(E) {
661
- return this.query(r.SINGLE, E);
712
+ single(E, T) {
713
+ return this.query(r.SINGLE, E, T);
662
714
  }
663
715
  /**
664
716
  * Retrieves a single snapshot state based on the provided query parameters.
665
717
  *
666
718
  * @param singleQuery - The query parameters for retrieving a single snapshot state
719
+ * @param attributes - Optional shared attributes that can be accessed by interceptors
720
+ * throughout the request lifecycle. These attributes allow passing
721
+ * custom data between different interceptors.
667
722
  * @returns A promise that resolves to a partial snapshot state
668
723
  *
669
724
  * @example
@@ -675,12 +730,12 @@ class wt extends X {
675
730
  * console.log('State:', singleState);
676
731
  * ```
677
732
  */
678
- singleState(E) {
679
- return this.query(r.SINGLE_STATE, E);
733
+ singleState(E, T) {
734
+ return this.query(r.SINGLE_STATE, E, T);
680
735
  }
681
736
  }
682
737
  var w = /* @__PURE__ */ ((t) => (t.RECOVERABLE = "RECOVERABLE", t.UNKNOWN = "UNKNOWN", t.UNRECOVERABLE = "UNRECOVERABLE", t))(w || {});
683
- const n = class n {
738
+ const c = class c {
684
739
  /**
685
740
  * Checks if the provided error code represents a successful operation.
686
741
  *
@@ -688,7 +743,7 @@ const n = class n {
688
743
  * @returns true if the error code is 'Ok', false otherwise
689
744
  */
690
745
  static isSucceeded(E) {
691
- return E === n.SUCCEEDED;
746
+ return E === c.SUCCEEDED;
692
747
  }
693
748
  /**
694
749
  * Checks if the provided error code represents an error condition.
@@ -697,28 +752,28 @@ const n = class n {
697
752
  * @returns true if the error code is not 'Ok', false otherwise
698
753
  */
699
754
  static isError(E) {
700
- return !n.isSucceeded(E);
755
+ return !c.isSucceeded(E);
701
756
  }
702
757
  };
703
- n.SUCCEEDED = "Ok", n.SUCCEEDED_MESSAGE = "", n.NOT_FOUND = "NotFound", n.NOT_FOUND_MESSAGE = "Not found resource!", n.BAD_REQUEST = "BadRequest", n.ILLEGAL_ARGUMENT = "IllegalArgument", n.ILLEGAL_STATE = "IllegalState", n.REQUEST_TIMEOUT = "RequestTimeout", n.TOO_MANY_REQUESTS = "TooManyRequests", n.DUPLICATE_REQUEST_ID = "DuplicateRequestId", n.COMMAND_VALIDATION = "CommandValidation", n.REWRITE_NO_COMMAND = "RewriteNoCommand", n.EVENT_VERSION_CONFLICT = "EventVersionConflict", n.DUPLICATE_AGGREGATE_ID = "DuplicateAggregateId", n.COMMAND_EXPECT_VERSION_CONFLICT = "CommandExpectVersionConflict", n.SOURCING_VERSION_CONFLICT = "SourcingVersionConflict", n.ILLEGAL_ACCESS_DELETED_AGGREGATE = "IllegalAccessDeletedAggregate", n.ILLEGAL_ACCESS_OWNER_AGGREGATE = "IllegalAccessOwnerAggregate", n.INTERNAL_SERVER_ERROR = "InternalServerError";
704
- let P = n;
705
- var b = /* @__PURE__ */ ((t) => (t.COMMAND = "COMMAND", t.ERROR = "ERROR", t.EVENT = "EVENT", t.SOURCING = "SOURCING", t.STATE_EVENT = "STATE_EVENT", t))(b || {});
706
- const bt = "";
758
+ c.SUCCEEDED = "Ok", c.SUCCEEDED_MESSAGE = "", c.NOT_FOUND = "NotFound", c.NOT_FOUND_MESSAGE = "Not found resource!", c.BAD_REQUEST = "BadRequest", c.ILLEGAL_ARGUMENT = "IllegalArgument", c.ILLEGAL_STATE = "IllegalState", c.REQUEST_TIMEOUT = "RequestTimeout", c.TOO_MANY_REQUESTS = "TooManyRequests", c.DUPLICATE_REQUEST_ID = "DuplicateRequestId", c.COMMAND_VALIDATION = "CommandValidation", c.REWRITE_NO_COMMAND = "RewriteNoCommand", c.EVENT_VERSION_CONFLICT = "EventVersionConflict", c.DUPLICATE_AGGREGATE_ID = "DuplicateAggregateId", c.COMMAND_EXPECT_VERSION_CONFLICT = "CommandExpectVersionConflict", c.SOURCING_VERSION_CONFLICT = "SourcingVersionConflict", c.ILLEGAL_ACCESS_DELETED_AGGREGATE = "IllegalAccessDeletedAggregate", c.ILLEGAL_ACCESS_OWNER_AGGREGATE = "IllegalAccessOwnerAggregate", c.INTERNAL_SERVER_ERROR = "InternalServerError";
759
+ let U = c;
760
+ var J = /* @__PURE__ */ ((t) => (t.COMMAND = "COMMAND", t.ERROR = "ERROR", t.EVENT = "EVENT", t.SOURCING = "SOURCING", t.STATE_EVENT = "STATE_EVENT", t))(J || {});
761
+ const Jt = "";
707
762
  export {
708
763
  v as CommandClient,
709
- C as CommandHttpHeaders,
764
+ W as CommandHttpHeaders,
710
765
  B as CommandStage,
711
- W as ConditionOptionKey,
712
- bt as DEFAULT_OWNER_ID,
766
+ l as ConditionOptionKey,
767
+ Jt as DEFAULT_OWNER_ID,
713
768
  O as DEFAULT_PAGINATION,
714
769
  F as DEFAULT_PROJECTION,
715
770
  q as DeletionState,
716
- l as DomainEventStreamMetadataFields,
771
+ P as DomainEventStreamMetadataFields,
717
772
  a as EMPTY_PAGED_LIST,
718
- P as ErrorCodes,
773
+ U as ErrorCodes,
719
774
  xt as EventStreamQueryClient,
720
775
  S as EventStreamQueryEndpointPaths,
721
- b as FunctionKind,
776
+ J as FunctionKind,
722
777
  A as Operator,
723
778
  X as QueryClient,
724
779
  w as RecoverableType,
@@ -735,7 +790,7 @@ export {
735
790
  Ft as asc,
736
791
  ft as beforeToday,
737
792
  rt as between,
738
- nt as contains,
793
+ ct as contains,
739
794
  u as dateOptions,
740
795
  y as deleted,
741
796
  at as desc,
@@ -748,17 +803,17 @@ export {
748
803
  st as gte,
749
804
  j as id,
750
805
  Q as ids,
751
- G as ignoreCaseOptions,
806
+ M as ignoreCaseOptions,
752
807
  Lt as isFalse,
753
808
  It as isIn,
754
809
  St as isNull,
755
810
  ot as isTrue,
756
- f as isValidateCondition,
757
- gt as lastMonth,
811
+ G as isValidateCondition,
812
+ Pt as lastMonth,
758
813
  Wt as lastWeek,
759
814
  Bt as listQuery,
760
815
  At as lt,
761
- ct as lte,
816
+ nt as lte,
762
817
  Tt as ne,
763
818
  Ct as nextWeek,
764
819
  H as nor,
@@ -771,7 +826,7 @@ export {
771
826
  Xt as pagination,
772
827
  $t as projection,
773
828
  Vt as raw,
774
- Pt as recentDays,
829
+ gt as recentDays,
775
830
  Yt as singleQuery,
776
831
  Rt as startsWith,
777
832
  m as tenantId,