@ahoo-wang/fetcher-wow 1.9.8 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,206 +1,243 @@
1
- import { ResultExtractors as B, ContentTypeValues as L, combineURLs as V, HttpMethod as q, mergeRequestOptions as o } from "@ahoo-wang/fetcher";
2
- import { JsonEventStreamResultExtractor as h } from "@ahoo-wang/fetcher-eventstream";
3
- var s = /* @__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))(s || {});
4
- function C(t) {
1
+ import { ContentTypeValues as V } from "@ahoo-wang/fetcher";
2
+ import { JsonEventStreamResultExtractor as X } from "@ahoo-wang/fetcher-eventstream";
3
+ import { endpoint as q, request as j, attribute as R, api as w, autoGeneratedError as e, post as o, body as S } from "@ahoo-wang/fetcher-decorator";
4
+ var K = Object.defineProperty, J = Object.getOwnPropertyDescriptor, v = (t, E, T, i) => {
5
+ for (var s = i > 1 ? void 0 : i ? J(E, T) : E, D = t.length - 1, O; D >= 0; D--)
6
+ (O = t[D]) && (s = (i ? O(E, T, s) : O(s)) || s);
7
+ return i && s && K(E, T, s), s;
8
+ }, U = (t, E) => (T, i) => E(T, i, t);
9
+ let a = class {
10
+ constructor(t) {
11
+ this.apiMetadata = t;
12
+ }
13
+ send(t, E) {
14
+ throw e(t, E);
15
+ }
16
+ sendAndWaitStream(t, E) {
17
+ throw e(t, E);
18
+ }
19
+ };
20
+ v([
21
+ q(),
22
+ U(0, j()),
23
+ U(1, R())
24
+ ], a.prototype, "send", 1);
25
+ v([
26
+ q(void 0, void 0, {
27
+ headers: { Accept: V.TEXT_EVENT_STREAM },
28
+ resultExtractor: X
29
+ }),
30
+ U(0, j()),
31
+ U(1, R())
32
+ ], a.prototype, "sendAndWaitStream", 1);
33
+ a = v([
34
+ w()
35
+ ], a);
36
+ const A = class A {
37
+ };
38
+ A.COMMAND_HEADERS_PREFIX = "Command-", A.TENANT_ID = `${A.COMMAND_HEADERS_PREFIX}Tenant-Id`, A.OWNER_ID = `${A.COMMAND_HEADERS_PREFIX}Owner-Id`, A.AGGREGATE_ID = `${A.COMMAND_HEADERS_PREFIX}Aggregate-Id`, A.AGGREGATE_VERSION = `${A.COMMAND_HEADERS_PREFIX}Aggregate-Version`, A.WAIT_PREFIX = `${A.COMMAND_HEADERS_PREFIX}Wait-`, A.WAIT_TIME_OUT = `${A.WAIT_PREFIX}Timeout`, A.WAIT_STAGE = `${A.WAIT_PREFIX}Stage`, A.WAIT_CONTEXT = `${A.WAIT_PREFIX}Context`, A.WAIT_PROCESSOR = `${A.WAIT_PREFIX}Processor`, A.WAIT_FUNCTION = `${A.WAIT_PREFIX}Function`, A.WAIT_TAIL_PREFIX = `${A.WAIT_PREFIX}Tail-`, A.WAIT_TAIL_STAGE = `${A.WAIT_TAIL_PREFIX}Stage`, A.WAIT_TAIL_CONTEXT = `${A.WAIT_TAIL_PREFIX}Context`, A.WAIT_TAIL_PROCESSOR = `${A.WAIT_TAIL_PREFIX}Processor`, A.WAIT_TAIL_FUNCTION = `${A.WAIT_TAIL_PREFIX}Function`, A.REQUEST_ID = `${A.COMMAND_HEADERS_PREFIX}Request-Id`, A.LOCAL_FIRST = `${A.COMMAND_HEADERS_PREFIX}Local-First`, A.COMMAND_AGGREGATE_CONTEXT = `${A.COMMAND_HEADERS_PREFIX}Aggregate-Context`, A.COMMAND_AGGREGATE_NAME = `${A.COMMAND_HEADERS_PREFIX}Aggregate-Name`, A.COMMAND_TYPE = `${A.COMMAND_HEADERS_PREFIX}Type`, A.COMMAND_HEADER_X_PREFIX = `${A.COMMAND_HEADERS_PREFIX}Header-`;
39
+ let B = A;
40
+ var z = /* @__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))(z || {}), r = /* @__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))(r || {});
41
+ function Y(t) {
5
42
  return !!t;
6
43
  }
7
- const _ = class _ {
44
+ const W = class W {
8
45
  };
9
- _.IGNORE_CASE_OPTION_KEY = "ignoreCase", _.ZONE_ID_OPTION_KEY = "zoneId", _.DATE_PATTERN_OPTION_KEY = "datePattern";
10
- let l = _;
11
- function M(t) {
46
+ W.IGNORE_CASE_OPTION_KEY = "ignoreCase", W.ZONE_ID_OPTION_KEY = "zoneId", W.DATE_PATTERN_OPTION_KEY = "datePattern";
47
+ let y = W;
48
+ function H(t) {
12
49
  if (!(typeof t > "u"))
13
50
  return { ignoreCase: t };
14
51
  }
15
- function N(t, E) {
52
+ function f(t, E) {
16
53
  if (typeof t > "u" && typeof E > "u")
17
54
  return;
18
55
  const T = {};
19
56
  return typeof t < "u" && (T.datePattern = t), typeof E < "u" && (T.zoneId = E), T;
20
57
  }
21
- var y = /* @__PURE__ */ ((t) => (t.ACTIVE = "ACTIVE", t.DELETED = "DELETED", t.ALL = "ALL", t))(y || {});
22
- function a(...t) {
58
+ var Q = /* @__PURE__ */ ((t) => (t.ACTIVE = "ACTIVE", t.DELETED = "DELETED", t.ALL = "ALL", t))(Q || {});
59
+ function Z(...t) {
23
60
  if (t.length === 0)
24
- return S();
61
+ return C();
25
62
  if (t.length === 1)
26
- return C(t[0]) ? t[0] : S();
63
+ return Y(t[0]) ? t[0] : C();
27
64
  const E = [];
28
65
  return t.forEach((T) => {
29
- T?.operator === s.ALL || !C(T) || (T.operator === s.AND && T.children ? E.push(...T.children) : E.push(T));
30
- }), { operator: s.AND, children: E };
66
+ T?.operator === r.ALL || !Y(T) || (T.operator === r.AND && T.children ? E.push(...T.children) : E.push(T));
67
+ }), { operator: r.AND, children: E };
31
68
  }
32
- function tt(...t) {
69
+ function Dt(...t) {
33
70
  const E = t?.filter(
34
- (T) => C(T)
71
+ (T) => Y(T)
35
72
  );
36
- return E.length === 0 ? S() : { operator: s.OR, children: E };
73
+ return E.length === 0 ? C() : { operator: r.OR, children: E };
37
74
  }
38
- function Et(...t) {
39
- return t.length === 0 ? S() : { operator: s.NOR, children: t };
75
+ function Ot(...t) {
76
+ return t.length === 0 ? C() : { operator: r.NOR, children: t };
40
77
  }
41
- function Tt(t) {
42
- return { operator: s.ID, value: t };
78
+ function _t(t) {
79
+ return { operator: r.ID, value: t };
43
80
  }
44
- function it(t) {
45
- return { operator: s.IDS, value: t };
81
+ function Lt(t) {
82
+ return { operator: r.IDS, value: t };
46
83
  }
47
- function st(t) {
48
- return { operator: s.AGGREGATE_ID, value: t };
84
+ function ft(t) {
85
+ return { operator: r.AGGREGATE_ID, value: t };
49
86
  }
50
- function At(...t) {
51
- return { operator: s.AGGREGATE_IDS, value: t };
87
+ function ht(...t) {
88
+ return { operator: r.AGGREGATE_IDS, value: t };
52
89
  }
53
- function nt(t) {
54
- return { operator: s.TENANT_ID, value: t };
90
+ function lt(t) {
91
+ return { operator: r.TENANT_ID, value: t };
55
92
  }
56
- function ct(t) {
57
- return { operator: s.OWNER_ID, value: t };
93
+ function Gt(t) {
94
+ return { operator: r.OWNER_ID, value: t };
58
95
  }
59
- function x(t) {
60
- return { operator: s.DELETED, value: t };
96
+ function k(t) {
97
+ return { operator: r.DELETED, value: t };
61
98
  }
62
- function rt() {
63
- return x(
99
+ function Ct() {
100
+ return k(
64
101
  "ACTIVE"
65
102
  /* ACTIVE */
66
103
  );
67
104
  }
68
- function S() {
105
+ function C() {
69
106
  return {
70
- operator: s.ALL
107
+ operator: r.ALL
71
108
  };
72
109
  }
73
- function ut(t, E) {
74
- return { field: t, operator: s.EQ, value: E };
110
+ function Mt(t, E) {
111
+ return { field: t, operator: r.EQ, value: E };
75
112
  }
76
- function It(t, E) {
77
- return { field: t, operator: s.NE, value: E };
113
+ function Pt(t, E) {
114
+ return { field: t, operator: r.NE, value: E };
78
115
  }
79
- function F(t, E) {
80
- return { field: t, operator: s.GT, value: E };
116
+ function m(t, E) {
117
+ return { field: t, operator: r.GT, value: E };
81
118
  }
82
- function w(t, E) {
83
- return { field: t, operator: s.LT, value: E };
119
+ function d(t, E) {
120
+ return { field: t, operator: r.LT, value: E };
84
121
  }
85
- function Nt(t, E) {
86
- return { field: t, operator: s.GTE, value: E };
122
+ function pt(t, E) {
123
+ return { field: t, operator: r.GTE, value: E };
87
124
  }
88
- function Rt(t, E) {
89
- return { field: t, operator: s.LTE, value: E };
125
+ function Wt(t, E) {
126
+ return { field: t, operator: r.LTE, value: E };
90
127
  }
91
- function et(t, E, T) {
92
- const A = M(T);
93
- return { field: t, operator: s.CONTAINS, value: E, options: A };
128
+ function gt(t, E, T) {
129
+ const i = H(T);
130
+ return { field: t, operator: r.CONTAINS, value: E, options: i };
94
131
  }
95
- function St(t, ...E) {
96
- return { field: t, operator: s.IN, value: E };
132
+ function Ut(t, ...E) {
133
+ return { field: t, operator: r.IN, value: E };
97
134
  }
98
- function Dt(t, ...E) {
99
- return { field: t, operator: s.NOT_IN, value: E };
135
+ function at(t, ...E) {
136
+ return { field: t, operator: r.NOT_IN, value: E };
100
137
  }
101
- function ot(t, E, T) {
102
- return { field: t, operator: s.BETWEEN, value: [E, T] };
138
+ function $t(t, E, T) {
139
+ return { field: t, operator: r.BETWEEN, value: [E, T] };
103
140
  }
104
- function Ot(t, ...E) {
105
- return { field: t, operator: s.ALL_IN, value: E };
141
+ function Vt(t, ...E) {
142
+ return { field: t, operator: r.ALL_IN, value: E };
106
143
  }
107
- function _t(t, E, T) {
108
- const A = M(T);
109
- return { field: t, operator: s.STARTS_WITH, value: E, options: A };
144
+ function Xt(t, E, T) {
145
+ const i = H(T);
146
+ return { field: t, operator: r.STARTS_WITH, value: E, options: i };
110
147
  }
111
- function Lt(t, E, T) {
112
- const A = M(T);
113
- return { field: t, operator: s.ENDS_WITH, value: E, options: A };
148
+ function Yt(t, E, T) {
149
+ const i = H(T);
150
+ return { field: t, operator: r.ENDS_WITH, value: E, options: i };
114
151
  }
115
- function ht(t, E) {
116
- return { field: t, operator: s.ELEM_MATCH, children: [E] };
152
+ function wt(t, E) {
153
+ return { field: t, operator: r.ELEM_MATCH, children: [E] };
117
154
  }
118
- function ft(t) {
119
- return { field: t, operator: s.NULL };
155
+ function vt(t) {
156
+ return { field: t, operator: r.NULL };
120
157
  }
121
- function Gt(t) {
122
- return { field: t, operator: s.NOT_NULL };
158
+ function Ht(t) {
159
+ return { field: t, operator: r.NOT_NULL };
123
160
  }
124
- function Ct(t) {
125
- return { field: t, operator: s.TRUE };
161
+ function Bt(t) {
162
+ return { field: t, operator: r.TRUE };
126
163
  }
127
- function Mt(t) {
128
- return { field: t, operator: s.FALSE };
164
+ function yt(t) {
165
+ return { field: t, operator: r.FALSE };
129
166
  }
130
- function lt(t, E = !0) {
131
- return { field: t, operator: s.EXISTS, value: E };
167
+ function Ft(t, E = !0) {
168
+ return { field: t, operator: r.EXISTS, value: E };
132
169
  }
133
- function Wt(t, E, T) {
134
- const A = N(E, T);
135
- return { field: t, operator: s.TODAY, options: A };
170
+ function xt(t, E, T) {
171
+ const i = f(E, T);
172
+ return { field: t, operator: r.TODAY, options: i };
136
173
  }
137
- function Pt(t, E, T, A) {
138
- const R = N(T, A);
139
- return { field: t, operator: s.BEFORE_TODAY, value: E, options: R };
174
+ function bt(t, E, T, i) {
175
+ const s = f(T, i);
176
+ return { field: t, operator: r.BEFORE_TODAY, value: E, options: s };
140
177
  }
141
- function Ut(t, E, T) {
142
- const A = N(E, T);
143
- return { field: t, operator: s.TOMORROW, options: A };
178
+ function qt(t, E, T) {
179
+ const i = f(E, T);
180
+ return { field: t, operator: r.TOMORROW, options: i };
144
181
  }
145
- function gt(t, E, T) {
146
- const A = N(E, T);
147
- return { field: t, operator: s.THIS_WEEK, options: A };
182
+ function jt(t, E, T) {
183
+ const i = f(E, T);
184
+ return { field: t, operator: r.THIS_WEEK, options: i };
148
185
  }
149
- function Vt(t, E, T) {
150
- const A = N(E, T);
151
- return { field: t, operator: s.NEXT_WEEK, options: A };
186
+ function Kt(t, E, T) {
187
+ const i = f(E, T);
188
+ return { field: t, operator: r.NEXT_WEEK, options: i };
152
189
  }
153
- function Xt(t, E, T) {
154
- const A = N(E, T);
155
- return { field: t, operator: s.LAST_WEEK, options: A };
190
+ function Jt(t, E, T) {
191
+ const i = f(E, T);
192
+ return { field: t, operator: r.LAST_WEEK, options: i };
156
193
  }
157
- function $t(t, E, T) {
158
- const A = N(E, T);
159
- return { field: t, operator: s.THIS_MONTH, options: A };
194
+ function zt(t, E, T) {
195
+ const i = f(E, T);
196
+ return { field: t, operator: r.THIS_MONTH, options: i };
160
197
  }
161
- function Yt(t, E, T) {
162
- const A = N(E, T);
163
- return { field: t, operator: s.LAST_MONTH, options: A };
198
+ function Qt(t, E, T) {
199
+ const i = f(E, T);
200
+ return { field: t, operator: r.LAST_MONTH, options: i };
164
201
  }
165
- function Bt(t, E, T, A) {
166
- const R = N(T, A);
167
- return { field: t, operator: s.RECENT_DAYS, value: E, options: R };
202
+ function Zt(t, E, T, i) {
203
+ const s = f(T, i);
204
+ return { field: t, operator: r.RECENT_DAYS, value: E, options: s };
168
205
  }
169
- function qt(t, E, T, A) {
170
- const R = N(T, A);
171
- return { field: t, operator: s.EARLIER_DAYS, value: E, options: R };
206
+ function kt(t, E, T, i) {
207
+ const s = f(T, i);
208
+ return { field: t, operator: r.EARLIER_DAYS, value: E, options: s };
172
209
  }
173
- function yt(t) {
174
- return { operator: s.RAW, value: t };
210
+ function mt(t) {
211
+ return { operator: r.RAW, value: t };
175
212
  }
176
- const O = {
213
+ const p = {
177
214
  index: 1,
178
215
  size: 10
179
216
  };
180
- function at({
181
- index: t = O.index,
182
- size: E = O.size
183
- } = O) {
217
+ function dt({
218
+ index: t = p.index,
219
+ size: E = p.size
220
+ } = p) {
184
221
  return {
185
222
  index: t,
186
223
  size: E
187
224
  };
188
225
  }
189
- const J = {};
190
- function b() {
191
- return J;
226
+ const tt = {};
227
+ function Et() {
228
+ return tt;
192
229
  }
193
- function xt({
230
+ function tE({
194
231
  include: t,
195
232
  exclude: E
196
- } = b()) {
233
+ } = Et()) {
197
234
  return {
198
235
  include: t,
199
236
  exclude: E
200
237
  };
201
238
  }
202
- function Ft({
203
- condition: t = S(),
239
+ function EE({
240
+ condition: t = C(),
204
241
  projection: E,
205
242
  sort: T
206
243
  } = {}) {
@@ -210,598 +247,245 @@ function Ft({
210
247
  sort: T
211
248
  };
212
249
  }
213
- function wt({
214
- condition: t = S(),
250
+ function TE({
251
+ condition: t = C(),
215
252
  projection: E,
216
253
  sort: T,
217
- limit: A = O.size
254
+ limit: i = p.size
218
255
  } = {}) {
219
256
  return {
220
257
  condition: t,
221
258
  projection: E,
222
259
  sort: T,
223
- limit: A
260
+ limit: i
224
261
  };
225
262
  }
226
- function Jt({
227
- condition: t = S(),
263
+ function iE({
264
+ condition: t = C(),
228
265
  projection: E,
229
266
  sort: T,
230
- pagination: A = O
267
+ pagination: i = p
231
268
  } = {}) {
232
269
  return {
233
270
  condition: t,
234
271
  projection: E,
235
272
  sort: T,
236
- pagination: A
273
+ pagination: i
237
274
  };
238
275
  }
239
- const v = {
276
+ const Tt = {
240
277
  total: 0,
241
278
  list: []
242
279
  };
243
- function bt({
280
+ function AE({
244
281
  total: t,
245
282
  list: E = []
246
- } = v) {
283
+ } = Tt) {
247
284
  return t === void 0 && (t = E.length), {
248
285
  total: t,
249
286
  list: E
250
287
  };
251
288
  }
252
- const X = {
253
- resultExtractor: B.Json
254
- }, f = {
255
- resultExtractor: h
256
- };
257
- class $ {
258
- /**
259
- * Creates a new QueryClient instance.
260
- * @param options - The client configuration options including fetcher and base path
261
- */
262
- constructor(E) {
263
- this.options = E;
264
- }
265
- /**
266
- * Performs a generic query operation by sending a request to the specified path.
267
- * @template R The return type of the query
268
- * @param path - The endpoint path to query
269
- * @param query - The query parameters to send
270
- * @param accept - The content type to accept from the server, defaults to application/json
271
- * @param options - Request options including result extractor and attributes
272
- * @param options.resultExtractor - Function to extract the desired result from the exchange.
273
- * Defaults to JsonResultExtractor which returns the entire exchange object.
274
- * @param options.attributes - Optional shared attributes that can be accessed by interceptors
275
- * throughout the request lifecycle. These attributes allow passing
276
- * custom data between different interceptors.
277
- * @returns A promise that resolves to the query result
278
- */
279
- async query(E, T, A, R = L.APPLICATION_JSON) {
280
- const Y = {
281
- url: V(this.options.basePath, E),
282
- method: q.POST,
283
- headers: {
284
- Accept: R
285
- },
286
- body: T
287
- };
288
- return await this.options.fetcher.request(
289
- Y,
290
- o(X, A)
291
- );
292
- }
293
- }
294
- var G = /* @__PURE__ */ ((t) => (t.ASC = "ASC", t.DESC = "DESC", t))(G || {});
295
- function vt(t) {
289
+ var $ = /* @__PURE__ */ ((t) => (t.ASC = "ASC", t.DESC = "DESC", t))($ || {});
290
+ function rE(t) {
296
291
  return {
297
292
  field: t,
298
293
  direction: "ASC"
299
294
  /* ASC */
300
295
  };
301
296
  }
302
- function Kt(t) {
297
+ function sE(t) {
303
298
  return {
304
299
  field: t,
305
300
  direction: "DESC"
306
301
  /* DESC */
307
302
  };
308
303
  }
309
- const n = class n {
304
+ const c = class c {
310
305
  };
311
- 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";
312
- let W = n;
313
- const e = class e {
306
+ 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";
307
+ let F = c;
308
+ const l = class l {
314
309
  };
315
- 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`;
316
- let D = e;
317
- class Qt extends $ {
310
+ l.EVENT_STREAM_RESOURCE_NAME = "event", l.COUNT = `${l.EVENT_STREAM_RESOURCE_NAME}/count`, l.LIST = `${l.EVENT_STREAM_RESOURCE_NAME}/list`, l.PAGED = `${l.EVENT_STREAM_RESOURCE_NAME}/paged`;
311
+ let M = l;
312
+ var it = Object.defineProperty, At = Object.getOwnPropertyDescriptor, g = (t, E, T, i) => {
313
+ for (var s = i > 1 ? void 0 : i ? At(E, T) : E, D = t.length - 1, O; D >= 0; D--)
314
+ (O = t[D]) && (s = (i ? O(E, T, s) : O(s)) || s);
315
+ return i && s && it(E, T, s), s;
316
+ }, G = (t, E) => (T, i) => E(T, i, t);
317
+ let P = class {
318
318
  /**
319
319
  * Creates a new EventStreamQueryClient instance.
320
- * @param options - The client configuration options including fetcher and base path
321
320
  */
322
- constructor(E) {
323
- super(E);
321
+ constructor(t) {
322
+ this.apiMetadata = t;
324
323
  }
325
- /**
326
- * Counts the number of domain event streams that match the given condition.
327
- *
328
- * @param condition - The condition to filter event streams
329
- * @param attributes - Optional shared attributes that can be accessed by interceptors
330
- * throughout the request lifecycle. These attributes allow passing
331
- * custom data between different interceptors.
332
- * @returns A promise that resolves to the count of matching event streams
333
- *
334
- * @example
335
- * ```typescript
336
- * const count = await eventStreamQueryClient.count(all());
337
- * console.log('Total event streams:', count);
338
- * ```
339
- */
340
- count(E, T) {
341
- return this.query(D.COUNT, E, {
342
- attributes: T
343
- });
324
+ count(t, E) {
325
+ throw e(t, E);
344
326
  }
345
- /**
346
- * Retrieves a list of domain event streams based on the provided query parameters.
347
- *
348
- * @param listQuery - The query parameters for listing event streams
349
- * @param attributes - Optional shared attributes that can be accessed by interceptors
350
- * throughout the request lifecycle. These attributes allow passing
351
- * custom data between different interceptors.
352
- * @returns A promise that resolves to an array of partial domain event streams
353
- *
354
- * @example
355
- * ```typescript
356
- * const listQuery: ListQuery = {
357
- * condition: all()
358
- * };
359
- * const list = await eventStreamQueryClient.list(listQuery);
360
- * for (const domainEventStream of list) {
361
- * console.log('Event stream:', domainEventStream);
362
- * }
363
- * ```
364
- */
365
- list(E, T) {
366
- return this.query(D.LIST, E, {
367
- attributes: T
368
- });
327
+ list(t, E) {
328
+ throw e(t, E);
369
329
  }
370
- /**
371
- * Retrieves a stream of domain event streams based on the provided query parameters.
372
- * Sets the Accept header to text/event-stream to indicate that the response should be streamed.
373
- *
374
- * @param listQuery - The query parameters for listing event streams
375
- * @param attributes - Optional shared attributes that can be accessed by interceptors
376
- * throughout the request lifecycle. These attributes allow passing
377
- * custom data between different interceptors.
378
- * @returns A promise that resolves to a readable stream of JSON server-sent events containing partial domain event streams
379
- *
380
- * @example
381
- * ```typescript
382
- * const listQuery: ListQuery = {
383
- * condition: all()
384
- * };
385
- * const listStream = await eventStreamQueryClient.listStream(listQuery);
386
- * for await (const event of listStream) {
387
- * const domainEventStream = event.data;
388
- * console.log('Received event stream:', domainEventStream);
389
- * }
390
- * ```
391
- */
392
- listStream(E, T) {
393
- return this.query(
394
- D.LIST,
395
- E,
396
- o(f, {
397
- resultExtractor: h,
398
- attributes: T
399
- }),
400
- L.TEXT_EVENT_STREAM
401
- );
330
+ listStream(t, E) {
331
+ throw e(t, E);
402
332
  }
403
- /**
404
- * Retrieves a paged list of domain event streams based on the provided query parameters.
405
- *
406
- * @param pagedQuery - The query parameters for paging event streams
407
- * @param attributes - Optional shared attributes that can be accessed by interceptors
408
- * throughout the request lifecycle. These attributes allow passing
409
- * custom data between different interceptors.
410
- * @returns A promise that resolves to a paged list of partial domain event streams
411
- *
412
- * @example
413
- * ```typescript
414
- * const pagedQuery: PagedQuery = {
415
- * condition: all(),
416
- * limit: 10,
417
- * offset: 0
418
- * };
419
- * const paged = await eventStreamQueryClient.paged(pagedQuery);
420
- * console.log('Total:', paged.total);
421
- * for (const domainEventStream of paged.list) {
422
- * console.log('Event stream:', domainEventStream);
423
- * }
424
- * ```
425
- */
426
- paged(E, T) {
427
- return this.query(D.PAGED, E, {
428
- attributes: T
429
- });
333
+ paged(t, E) {
334
+ throw e(t, E);
430
335
  }
431
- }
336
+ };
337
+ g([
338
+ o(M.COUNT),
339
+ G(0, S()),
340
+ G(1, R())
341
+ ], P.prototype, "count", 1);
342
+ g([
343
+ o(M.LIST),
344
+ G(0, S()),
345
+ G(1, R())
346
+ ], P.prototype, "list", 1);
347
+ g([
348
+ o(M.LIST, {
349
+ headers: { Accept: V.TEXT_EVENT_STREAM },
350
+ resultExtractor: X
351
+ }),
352
+ G(0, S()),
353
+ G(1, R())
354
+ ], P.prototype, "listStream", 1);
355
+ g([
356
+ o(M.PAGED),
357
+ G(0, S()),
358
+ G(1, R())
359
+ ], P.prototype, "paged", 1);
360
+ P = g([
361
+ w()
362
+ ], P);
432
363
  const u = class u {
433
364
  };
434
365
  u.VERSION = "version", u.TENANT_ID = "tenantId", u.OWNER_ID = "ownerId", u.EVENT_ID = "eventId", u.FIRST_EVENT_TIME = "firstEventTime", u.EVENT_TIME = "eventTime", u.FIRST_OPERATOR = "firstOperator", u.OPERATOR = "operator", u.SNAPSHOT_TIME = "snapshotTime", u.DELETED = "deleted", u.STATE = "state";
435
- let P = u;
436
- const r = class r {
366
+ let x = u;
367
+ const N = class N {
437
368
  };
438
- r.SNAPSHOT_RESOURCE_NAME = "snapshot", r.COUNT = `${r.SNAPSHOT_RESOURCE_NAME}/count`, r.LIST = `${r.SNAPSHOT_RESOURCE_NAME}/list`, r.LIST_STATE = `${r.LIST}/state`, r.PAGED = `${r.SNAPSHOT_RESOURCE_NAME}/paged`, r.PAGED_STATE = `${r.PAGED}/state`, r.SINGLE = `${r.SNAPSHOT_RESOURCE_NAME}/single`, r.SINGLE_STATE = `${r.SINGLE}/state`;
439
- let I = r;
440
- class kt extends $ {
369
+ N.SNAPSHOT_RESOURCE_NAME = "snapshot", N.COUNT = `${N.SNAPSHOT_RESOURCE_NAME}/count`, N.LIST = `${N.SNAPSHOT_RESOURCE_NAME}/list`, N.LIST_STATE = `${N.LIST}/state`, N.PAGED = `${N.SNAPSHOT_RESOURCE_NAME}/paged`, N.PAGED_STATE = `${N.PAGED}/state`, N.SINGLE = `${N.SNAPSHOT_RESOURCE_NAME}/single`, N.SINGLE_STATE = `${N.SINGLE}/state`;
370
+ let _ = N;
371
+ var rt = Object.defineProperty, st = Object.getOwnPropertyDescriptor, h = (t, E, T, i) => {
372
+ for (var s = i > 1 ? void 0 : i ? st(E, T) : E, D = t.length - 1, O; D >= 0; D--)
373
+ (O = t[D]) && (s = (i ? O(E, T, s) : O(s)) || s);
374
+ return i && s && rt(E, T, s), s;
375
+ }, I = (t, E) => (T, i) => E(T, i, t);
376
+ let L = class {
441
377
  /**
442
378
  * Creates a new SnapshotQueryClient instance.
443
- * @param options - The configuration options for the client
444
379
  */
445
- constructor(E) {
446
- super(E);
380
+ constructor(t) {
381
+ this.apiMetadata = t;
447
382
  }
448
- /**
449
- * Counts the number of snapshots that match the given condition.
450
- *
451
- * @param condition - The condition to match snapshots against
452
- * @param attributes - Optional shared attributes that can be accessed by interceptors
453
- * throughout the request lifecycle. These attributes allow passing
454
- * custom data between different interceptors.
455
- * @returns A promise that resolves to the count of matching snapshots
456
- *
457
- * @example
458
- * ```typescript
459
- * const count = await snapshotQueryClient.count(all());
460
- * console.log('Total snapshots:', count);
461
- * ```
462
- */
463
- async count(E, T) {
464
- return this.query(I.COUNT, E, {
465
- attributes: T
466
- });
383
+ count(t, E) {
384
+ throw e(t, E);
467
385
  }
468
- /**
469
- * Retrieves a list of materialized snapshots based on the provided query parameters.
470
- *
471
- * @param listQuery - The query parameters for listing snapshots
472
- * @param attributes - Optional shared attributes that can be accessed by interceptors
473
- * throughout the request lifecycle. These attributes allow passing
474
- * custom data between different interceptors.
475
- * @returns A promise that resolves to an array of partial materialized snapshots
476
- *
477
- * @example
478
- * ```typescript
479
- * const listQuery: ListQuery = {
480
- * condition: all()
481
- * };
482
- * const list = await snapshotQueryClient.list(listQuery);
483
- * for (const snapshot of list) {
484
- * console.log('Snapshot:', snapshot);
485
- * }
486
- * ```
487
- */
488
- list(E, T) {
489
- return this.query(I.LIST, E, {
490
- attributes: T
491
- });
386
+ list(t, E) {
387
+ throw e(t, E);
492
388
  }
493
- /**
494
- * Retrieves a stream of materialized snapshots based on the provided query parameters.
495
- *
496
- * @param listQuery - The query parameters for listing snapshots
497
- * @param attributes - Optional shared attributes that can be accessed by interceptors
498
- * throughout the request lifecycle. These attributes allow passing
499
- * custom data between different interceptors.
500
- * @returns A promise that resolves to a readable stream of JSON server-sent events containing partial materialized snapshots
501
- *
502
- * @example
503
- * ```typescript
504
- * const listQuery: ListQuery = {
505
- * condition: all()
506
- * };
507
- * const listStream = await snapshotQueryClient.listStream(listQuery);
508
- * for await (const event of listStream) {
509
- * const snapshot = event.data;
510
- * console.log('Received snapshot:', snapshot);
511
- * }
512
- * ```
513
- */
514
- listStream(E, T) {
515
- return this.query(
516
- I.LIST,
517
- E,
518
- o(f, {
519
- resultExtractor: h,
520
- attributes: T
521
- }),
522
- L.TEXT_EVENT_STREAM
523
- );
389
+ listStream(t, E) {
390
+ throw e(t, E);
524
391
  }
525
- /**
526
- * Retrieves a list of snapshot states based on the provided query parameters.
527
- *
528
- * @param listQuery - The query parameters for listing snapshot states
529
- * @param attributes - Optional shared attributes that can be accessed by interceptors
530
- * throughout the request lifecycle. These attributes allow passing
531
- * custom data between different interceptors.
532
- * @returns A promise that resolves to an array of partial snapshot states
533
- *
534
- * @example
535
- * ```typescript
536
- * const listQuery: ListQuery = {
537
- * condition: all()
538
- * };
539
- * const list = await snapshotQueryClient.listState(listQuery);
540
- * for (const state of list) {
541
- * console.log('State:', state);
542
- * }
543
- * ```
544
- */
545
- listState(E, T) {
546
- return this.query(I.LIST_STATE, E, {
547
- attributes: T
548
- });
392
+ listState(t, E) {
393
+ throw e(t, E);
549
394
  }
550
- /**
551
- * Retrieves a stream of snapshot states based on the provided query parameters.
552
- *
553
- * @param listQuery - The query parameters for listing snapshot states
554
- * @param attributes - Optional shared attributes that can be accessed by interceptors
555
- * throughout the request lifecycle. These attributes allow passing
556
- * custom data between different interceptors.
557
- * @returns A promise that resolves to a readable stream of JSON server-sent events containing partial snapshot states
558
- *
559
- * @example
560
- * ```typescript
561
- * const listQuery: ListQuery = {
562
- * condition: all()
563
- * };
564
- * const listStream = await snapshotQueryClient.listStateStream(listQuery);
565
- * for await (const event of listStream) {
566
- * const state = event.data;
567
- * console.log('Received state:', state);
568
- * }
569
- * ```
570
- */
571
- listStateStream(E, T) {
572
- return this.query(
573
- I.LIST_STATE,
574
- E,
575
- o(f, {
576
- resultExtractor: h,
577
- attributes: T
578
- }),
579
- L.TEXT_EVENT_STREAM
580
- );
395
+ listStateStream(t, E) {
396
+ throw e(t, E);
581
397
  }
582
- /**
583
- * Retrieves a paged list of materialized snapshots based on the provided query parameters.
584
- *
585
- * @param pagedQuery - The query parameters for paging snapshots
586
- * @param attributes - Optional shared attributes that can be accessed by interceptors
587
- * throughout the request lifecycle. These attributes allow passing
588
- * custom data between different interceptors.
589
- * @returns A promise that resolves to a paged list of partial materialized snapshots
590
- *
591
- * @example
592
- * ```typescript
593
- * const pagedQuery: PagedQuery = {
594
- * condition: all(),
595
- * limit: 10,
596
- * offset: 0
597
- * };
598
- * const paged = await snapshotQueryClient.paged(pagedQuery);
599
- * console.log('Total:', paged.total);
600
- * for (const snapshot of paged.list) {
601
- * console.log('Snapshot:', snapshot);
602
- * }
603
- * ```
604
- */
605
- paged(E, T) {
606
- return this.query(I.PAGED, E, {
607
- attributes: T
608
- });
398
+ paged(t, E) {
399
+ throw e(t, E);
609
400
  }
610
- /**
611
- * Retrieves a paged list of snapshot states based on the provided query parameters.
612
- *
613
- * @param pagedQuery - The query parameters for paging snapshot states
614
- * @param attributes - Optional shared attributes that can be accessed by interceptors
615
- * throughout the request lifecycle. These attributes allow passing
616
- * custom data between different interceptors.
617
- * @returns A promise that resolves to a paged list of partial snapshot states
618
- *
619
- * @example
620
- * ```typescript
621
- * const pagedQuery: PagedQuery = {
622
- * condition: all(),
623
- * limit: 10,
624
- * offset: 0
625
- * };
626
- * const pagedState = await snapshotQueryClient.pagedState(pagedQuery);
627
- * for (const state of pagedState.list) {
628
- * console.log('State:', state);
629
- * }
630
- * ```
631
- */
632
- pagedState(E, T) {
633
- return this.query(I.PAGED_STATE, E, {
634
- attributes: T
635
- });
401
+ pagedState(t, E) {
402
+ throw e(t, E);
636
403
  }
637
- /**
638
- * Retrieves a single materialized snapshot based on the provided query parameters.
639
- *
640
- * @param singleQuery - The query parameters for retrieving a single snapshot
641
- * @param attributes - Optional shared attributes that can be accessed by interceptors
642
- * throughout the request lifecycle. These attributes allow passing
643
- * custom data between different interceptors.
644
- * @returns A promise that resolves to a partial materialized snapshot
645
- *
646
- * @example
647
- * ```typescript
648
- * const singleQuery: SingleQuery = {
649
- * condition: all()
650
- * };
651
- * const single = await snapshotQueryClient.single(singleQuery);
652
- * console.log('Snapshot:', single);
653
- * ```
654
- */
655
- single(E, T) {
656
- return this.query(I.SINGLE, E, {
657
- attributes: T
658
- });
404
+ single(t, E) {
405
+ throw e(t, E);
659
406
  }
660
- /**
661
- * Retrieves a single snapshot state based on the provided query parameters.
662
- *
663
- * @param singleQuery - The query parameters for retrieving a single snapshot state
664
- * @param attributes - Optional shared attributes that can be accessed by interceptors
665
- * throughout the request lifecycle. These attributes allow passing
666
- * custom data between different interceptors.
667
- * @returns A promise that resolves to a partial snapshot state
668
- *
669
- * @example
670
- * ```typescript
671
- * const singleQuery: SingleQuery = {
672
- * condition: all()
673
- * };
674
- * const singleState = await snapshotQueryClient.singleState(singleQuery);
675
- * console.log('State:', singleState);
676
- * ```
677
- */
678
- singleState(E, T) {
679
- return this.query(I.SINGLE_STATE, E, {
680
- attributes: T
681
- });
407
+ singleState(t, E) {
408
+ throw e(t, E);
682
409
  }
683
- }
684
- const K = "~";
685
- function Q({
410
+ };
411
+ h([
412
+ o(_.COUNT),
413
+ I(0, S()),
414
+ I(1, R())
415
+ ], L.prototype, "count", 1);
416
+ h([
417
+ o(_.LIST),
418
+ I(0, S()),
419
+ I(1, R())
420
+ ], L.prototype, "list", 1);
421
+ h([
422
+ o(_.LIST, {
423
+ headers: { Accept: V.TEXT_EVENT_STREAM },
424
+ resultExtractor: X
425
+ }),
426
+ I(0, S()),
427
+ I(1, R())
428
+ ], L.prototype, "listStream", 1);
429
+ h([
430
+ o(_.LIST_STATE),
431
+ I(0, S()),
432
+ I(1, R())
433
+ ], L.prototype, "listState", 1);
434
+ h([
435
+ o(_.LIST_STATE, {
436
+ headers: { Accept: V.TEXT_EVENT_STREAM },
437
+ resultExtractor: X
438
+ }),
439
+ I(0, S()),
440
+ I(1, R())
441
+ ], L.prototype, "listStateStream", 1);
442
+ h([
443
+ o(_.PAGED),
444
+ I(0, S()),
445
+ I(1, R())
446
+ ], L.prototype, "paged", 1);
447
+ h([
448
+ o(_.PAGED_STATE),
449
+ I(0, S()),
450
+ I(1, R())
451
+ ], L.prototype, "pagedState", 1);
452
+ h([
453
+ o(_.SINGLE),
454
+ I(0, S()),
455
+ I(1, R())
456
+ ], L.prototype, "single", 1);
457
+ h([
458
+ o(_.SINGLE_STATE),
459
+ I(0, S()),
460
+ I(1, R())
461
+ ], L.prototype, "singleState", 1);
462
+ L = h([
463
+ w()
464
+ ], L);
465
+ const ct = "~";
466
+ function nt({
686
467
  field: t,
687
- cursorId: E = K,
688
- direction: T = G.DESC
468
+ cursorId: E = ct,
469
+ direction: T = $.DESC
689
470
  }) {
690
- return T === G.ASC ? F(t, E) : w(t, E);
471
+ return T === $.ASC ? m(t, E) : d(t, E);
691
472
  }
692
- function k({
473
+ function It({
693
474
  field: t,
694
- direction: E = G.DESC
475
+ direction: E = $.DESC
695
476
  }) {
696
477
  return { field: t, direction: E };
697
478
  }
698
- function zt(t) {
699
- const E = t.query, T = a(Q(t), E.condition), A = k(t);
479
+ function cE(t) {
480
+ const E = t.query, T = Z(nt(t), E.condition), i = It(t);
700
481
  return {
701
482
  ...E,
702
483
  condition: T,
703
- sort: [A]
484
+ sort: [i]
704
485
  };
705
486
  }
706
- class jt {
707
- constructor(E) {
708
- this.options = E;
709
- }
710
- /**
711
- * Sends a command to the specified path and returns the result.
712
- * This is a protected generic method that handles the common logic for sending commands.
713
- * @template R The type of the result to be returned
714
- * @param path - The endpoint path to send the command to
715
- * @param commandHttpRequest - The command HTTP request containing headers, method, and body
716
- * @param options - Request options including result extractor and attributes
717
- * @param options.resultExtractor - Function to extract the desired result from the exchange.
718
- * Defaults to ExchangeResultExtractor which returns the entire exchange object.
719
- * @param options.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.
722
- * @returns A promise that resolves to the extracted result of type R
723
- */
724
- async sendCommand(E, T, A) {
725
- const R = V(this.options.basePath, E);
726
- return await this.options.fetcher.fetch(
727
- R,
728
- T,
729
- o(X, A)
730
- );
731
- }
732
- /**
733
- * Send a command to the server and wait for the result.
734
- *
735
- * @param path - The endpoint path to send the command to
736
- * @param commandHttpRequest - The command request to send
737
- * @param attributes - Optional shared attributes that can be accessed by interceptors
738
- * throughout the request lifecycle. These attributes allow passing
739
- * custom data between different interceptors.
740
- * @returns A promise that resolves to the command execution result
741
- *
742
- * @example
743
- * ```typescript
744
- * const commandResult = await commandClient.send('add_cart_item', {
745
- * method: HttpMethod.POST,
746
- * body: {
747
- * productId: 'product-1',
748
- * quantity: 2
749
- * }
750
- * });
751
- * ```
752
- */
753
- send(E, T, A) {
754
- return this.sendCommand(E, T, { attributes: A });
755
- }
756
- /**
757
- * Send a command to the server and wait for the result as a stream.
758
- * This is useful for long-running commands that produce multiple events.
759
- *
760
- * @param path - The endpoint path to send the command to
761
- * @param commandHttpRequest - The command request to send
762
- * @param attributes - Optional shared attributes that can be accessed by interceptors
763
- * throughout the request lifecycle. These attributes allow passing
764
- * custom data between different interceptors.
765
- * @returns A promise that resolves to a stream of command execution results
766
- *
767
- * @example
768
- * ```typescript
769
- * const commandResultStream = await commandClient.sendAndWaitStream('add_cart_item', {
770
- * method: HttpMethod.POST,
771
- * headers: {
772
- * Accept: ContentTypeValues.TEXT_EVENT_STREAM
773
- * },
774
- * body: {
775
- * productId: 'product-1',
776
- * quantity: 2
777
- * }
778
- * });
779
- *
780
- * for await (const commandResultEvent of commandResultStream) {
781
- * console.log('Received event:', commandResultEvent.data);
782
- * }
783
- * ```
784
- */
785
- async sendAndWaitStream(E, T, A) {
786
- return T.headers = {
787
- ...T.headers,
788
- Accept: L.TEXT_EVENT_STREAM
789
- }, this.sendCommand(
790
- E,
791
- T,
792
- o(f, {
793
- resultExtractor: h,
794
- attributes: A
795
- })
796
- );
797
- }
798
- }
799
- const i = class i {
800
- };
801
- 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-`;
802
- let U = i;
803
- var z = /* @__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))(z || {}), j = /* @__PURE__ */ ((t) => (t.RECOVERABLE = "RECOVERABLE", t.UNKNOWN = "UNKNOWN", t.UNRECOVERABLE = "UNRECOVERABLE", t))(j || {});
804
- const c = class c {
487
+ var Nt = /* @__PURE__ */ ((t) => (t.RECOVERABLE = "RECOVERABLE", t.UNKNOWN = "UNKNOWN", t.UNRECOVERABLE = "UNRECOVERABLE", t))(Nt || {});
488
+ const n = class n {
805
489
  /**
806
490
  * Checks if the provided error code represents a successful operation.
807
491
  *
@@ -809,7 +493,7 @@ const c = class c {
809
493
  * @returns true if the error code is 'Ok', false otherwise
810
494
  */
811
495
  static isSucceeded(E) {
812
- return E === c.SUCCEEDED;
496
+ return E === n.SUCCEEDED;
813
497
  }
814
498
  /**
815
499
  * Checks if the provided error code represents an error condition.
@@ -818,96 +502,93 @@ const c = class c {
818
502
  * @returns true if the error code is not 'Ok', false otherwise
819
503
  */
820
504
  static isError(E) {
821
- return !c.isSucceeded(E);
505
+ return !n.isSucceeded(E);
822
506
  }
823
507
  };
824
- 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";
825
- let g = c;
826
- var H = /* @__PURE__ */ ((t) => (t.COMMAND = "COMMAND", t.ERROR = "ERROR", t.EVENT = "EVENT", t.SOURCING = "SOURCING", t.STATE_EVENT = "STATE_EVENT", t))(H || {});
827
- const Ht = "";
828
- var Z = /* @__PURE__ */ ((t) => (t.MAP = "MAP", t.STRING = "STRING", t))(Z || {});
508
+ 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";
509
+ let b = n;
510
+ var et = /* @__PURE__ */ ((t) => (t.COMMAND = "COMMAND", t.ERROR = "ERROR", t.EVENT = "EVENT", t.SOURCING = "SOURCING", t.STATE_EVENT = "STATE_EVENT", t))(et || {});
511
+ const nE = "";
512
+ var Rt = /* @__PURE__ */ ((t) => (t.MAP = "MAP", t.STRING = "STRING", t))(Rt || {});
829
513
  export {
830
- K as CURSOR_ID_START,
831
- jt as CommandClient,
832
- U as CommandHttpHeaders,
514
+ ct as CURSOR_ID_START,
515
+ a as CommandClient,
516
+ B as CommandHeaders,
833
517
  z as CommandStage,
834
- l as ConditionOptionKey,
835
- Ht as DEFAULT_OWNER_ID,
836
- O as DEFAULT_PAGINATION,
837
- J as DEFAULT_PROJECTION,
838
- y as DeletionState,
839
- W as DomainEventStreamMetadataFields,
840
- v as EMPTY_PAGED_LIST,
841
- g as ErrorCodes,
842
- Qt as EventStreamQueryClient,
843
- D as EventStreamQueryEndpointPaths,
844
- H as FunctionKind,
845
- f as JSON_EVENT_STREAM_QUERY_REQUEST_OPTIONS,
846
- X as JSON_QUERY_REQUEST_OPTIONS,
847
- Z as MessageHeaderSqlType,
848
- s as Operator,
849
- $ as QueryClient,
850
- j as RecoverableType,
851
- P as SnapshotMetadataFields,
852
- kt as SnapshotQueryClient,
853
- I as SnapshotQueryEndpointPaths,
854
- G as SortDirection,
855
- rt as active,
856
- st as aggregateId,
857
- At as aggregateIds,
858
- S as all,
859
- Ot as allIn,
860
- a as and,
861
- vt as asc,
862
- Pt as beforeToday,
863
- ot as between,
864
- et as contains,
865
- Q as cursorCondition,
866
- zt as cursorQuery,
867
- k as cursorSort,
868
- N as dateOptions,
869
- b as defaultProjection,
870
- x as deleted,
871
- Kt as desc,
872
- qt as earlierDays,
873
- ht as elemMatch,
874
- Lt as endsWith,
875
- ut as eq,
876
- lt as exists,
877
- F as gt,
878
- Nt as gte,
879
- Tt as id,
880
- it as ids,
881
- M as ignoreCaseOptions,
882
- Mt as isFalse,
883
- St as isIn,
884
- ft as isNull,
885
- Ct as isTrue,
886
- C as isValidateCondition,
887
- Yt as lastMonth,
888
- Xt as lastWeek,
889
- wt as listQuery,
890
- w as lt,
891
- Rt as lte,
892
- It as ne,
893
- Vt as nextWeek,
894
- Et as nor,
895
- Dt as notIn,
896
- Gt as notNull,
897
- tt as or,
898
- ct as ownerId,
899
- bt as pagedList,
900
- Jt as pagedQuery,
901
- at as pagination,
902
- xt as projection,
903
- yt as raw,
904
- Bt as recentDays,
905
- Ft as singleQuery,
906
- _t as startsWith,
907
- nt as tenantId,
908
- $t as thisMonth,
909
- gt as thisWeek,
910
- Wt as today,
911
- Ut as tomorrow
518
+ y as ConditionOptionKey,
519
+ nE as DEFAULT_OWNER_ID,
520
+ p as DEFAULT_PAGINATION,
521
+ tt as DEFAULT_PROJECTION,
522
+ Q as DeletionState,
523
+ F as DomainEventStreamMetadataFields,
524
+ Tt as EMPTY_PAGED_LIST,
525
+ b as ErrorCodes,
526
+ P as EventStreamQueryClient,
527
+ M as EventStreamQueryEndpointPaths,
528
+ et as FunctionKind,
529
+ Rt as MessageHeaderSqlType,
530
+ r as Operator,
531
+ Nt as RecoverableType,
532
+ x as SnapshotMetadataFields,
533
+ L as SnapshotQueryClient,
534
+ _ as SnapshotQueryEndpointPaths,
535
+ $ as SortDirection,
536
+ Ct as active,
537
+ ft as aggregateId,
538
+ ht as aggregateIds,
539
+ C as all,
540
+ Vt as allIn,
541
+ Z as and,
542
+ rE as asc,
543
+ bt as beforeToday,
544
+ $t as between,
545
+ gt as contains,
546
+ nt as cursorCondition,
547
+ cE as cursorQuery,
548
+ It as cursorSort,
549
+ f as dateOptions,
550
+ Et as defaultProjection,
551
+ k as deleted,
552
+ sE as desc,
553
+ kt as earlierDays,
554
+ wt as elemMatch,
555
+ Yt as endsWith,
556
+ Mt as eq,
557
+ Ft as exists,
558
+ m as gt,
559
+ pt as gte,
560
+ _t as id,
561
+ Lt as ids,
562
+ H as ignoreCaseOptions,
563
+ yt as isFalse,
564
+ Ut as isIn,
565
+ vt as isNull,
566
+ Bt as isTrue,
567
+ Y as isValidateCondition,
568
+ Qt as lastMonth,
569
+ Jt as lastWeek,
570
+ TE as listQuery,
571
+ d as lt,
572
+ Wt as lte,
573
+ Pt as ne,
574
+ Kt as nextWeek,
575
+ Ot as nor,
576
+ at as notIn,
577
+ Ht as notNull,
578
+ Dt as or,
579
+ Gt as ownerId,
580
+ AE as pagedList,
581
+ iE as pagedQuery,
582
+ dt as pagination,
583
+ tE as projection,
584
+ mt as raw,
585
+ Zt as recentDays,
586
+ EE as singleQuery,
587
+ Xt as startsWith,
588
+ lt as tenantId,
589
+ zt as thisMonth,
590
+ jt as thisWeek,
591
+ xt as today,
592
+ qt as tomorrow
912
593
  };
913
594
  //# sourceMappingURL=index.es.js.map