@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/command/commandClient.d.ts +8 -26
- package/dist/command/commandClient.d.ts.map +1 -1
- package/dist/command/{commandHttpHeaders.d.ts → commandHeaders.d.ts} +2 -2
- package/dist/command/commandHeaders.d.ts.map +1 -0
- package/dist/command/commandRequest.d.ts +7 -6
- package/dist/command/commandRequest.d.ts.map +1 -1
- package/dist/command/index.d.ts +1 -1
- package/dist/command/index.d.ts.map +1 -1
- package/dist/index.es.js +405 -724
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/query/event/eventStreamQueryApi.d.ts +1 -1
- package/dist/query/event/eventStreamQueryApi.d.ts.map +1 -1
- package/dist/query/event/eventStreamQueryClient.d.ts +7 -8
- package/dist/query/event/eventStreamQueryClient.d.ts.map +1 -1
- package/dist/query/queryApi.d.ts +4 -39
- package/dist/query/queryApi.d.ts.map +1 -1
- package/dist/query/snapshot/snapshotQueryApi.d.ts +4 -4
- package/dist/query/snapshot/snapshotQueryApi.d.ts.map +1 -1
- package/dist/query/snapshot/snapshotQueryClient.d.ts +12 -13
- package/dist/query/snapshot/snapshotQueryClient.d.ts.map +1 -1
- package/dist/types/endpoints.d.ts +1 -1
- package/dist/types/endpoints.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +4 -3
- package/dist/command/commandHttpHeaders.d.ts.map +0 -1
- package/dist/types/client.d.ts +0 -15
- package/dist/types/client.d.ts.map +0 -1
package/dist/index.es.js
CHANGED
|
@@ -1,206 +1,243 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JsonEventStreamResultExtractor as
|
|
3
|
-
|
|
4
|
-
|
|
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
|
|
44
|
+
const W = class W {
|
|
8
45
|
};
|
|
9
|
-
|
|
10
|
-
let
|
|
11
|
-
function
|
|
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
|
|
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
|
|
22
|
-
function
|
|
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
|
|
61
|
+
return C();
|
|
25
62
|
if (t.length === 1)
|
|
26
|
-
return
|
|
63
|
+
return Y(t[0]) ? t[0] : C();
|
|
27
64
|
const E = [];
|
|
28
65
|
return t.forEach((T) => {
|
|
29
|
-
T?.operator ===
|
|
30
|
-
}), { operator:
|
|
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
|
|
69
|
+
function Dt(...t) {
|
|
33
70
|
const E = t?.filter(
|
|
34
|
-
(T) =>
|
|
71
|
+
(T) => Y(T)
|
|
35
72
|
);
|
|
36
|
-
return E.length === 0 ?
|
|
73
|
+
return E.length === 0 ? C() : { operator: r.OR, children: E };
|
|
37
74
|
}
|
|
38
|
-
function
|
|
39
|
-
return t.length === 0 ?
|
|
75
|
+
function Ot(...t) {
|
|
76
|
+
return t.length === 0 ? C() : { operator: r.NOR, children: t };
|
|
40
77
|
}
|
|
41
|
-
function
|
|
42
|
-
return { operator:
|
|
78
|
+
function _t(t) {
|
|
79
|
+
return { operator: r.ID, value: t };
|
|
43
80
|
}
|
|
44
|
-
function
|
|
45
|
-
return { operator:
|
|
81
|
+
function Lt(t) {
|
|
82
|
+
return { operator: r.IDS, value: t };
|
|
46
83
|
}
|
|
47
|
-
function
|
|
48
|
-
return { operator:
|
|
84
|
+
function ft(t) {
|
|
85
|
+
return { operator: r.AGGREGATE_ID, value: t };
|
|
49
86
|
}
|
|
50
|
-
function
|
|
51
|
-
return { operator:
|
|
87
|
+
function ht(...t) {
|
|
88
|
+
return { operator: r.AGGREGATE_IDS, value: t };
|
|
52
89
|
}
|
|
53
|
-
function
|
|
54
|
-
return { operator:
|
|
90
|
+
function lt(t) {
|
|
91
|
+
return { operator: r.TENANT_ID, value: t };
|
|
55
92
|
}
|
|
56
|
-
function
|
|
57
|
-
return { operator:
|
|
93
|
+
function Gt(t) {
|
|
94
|
+
return { operator: r.OWNER_ID, value: t };
|
|
58
95
|
}
|
|
59
|
-
function
|
|
60
|
-
return { operator:
|
|
96
|
+
function k(t) {
|
|
97
|
+
return { operator: r.DELETED, value: t };
|
|
61
98
|
}
|
|
62
|
-
function
|
|
63
|
-
return
|
|
99
|
+
function Ct() {
|
|
100
|
+
return k(
|
|
64
101
|
"ACTIVE"
|
|
65
102
|
/* ACTIVE */
|
|
66
103
|
);
|
|
67
104
|
}
|
|
68
|
-
function
|
|
105
|
+
function C() {
|
|
69
106
|
return {
|
|
70
|
-
operator:
|
|
107
|
+
operator: r.ALL
|
|
71
108
|
};
|
|
72
109
|
}
|
|
73
|
-
function
|
|
74
|
-
return { field: t, operator:
|
|
110
|
+
function Mt(t, E) {
|
|
111
|
+
return { field: t, operator: r.EQ, value: E };
|
|
75
112
|
}
|
|
76
|
-
function
|
|
77
|
-
return { field: t, operator:
|
|
113
|
+
function Pt(t, E) {
|
|
114
|
+
return { field: t, operator: r.NE, value: E };
|
|
78
115
|
}
|
|
79
|
-
function
|
|
80
|
-
return { field: t, operator:
|
|
116
|
+
function m(t, E) {
|
|
117
|
+
return { field: t, operator: r.GT, value: E };
|
|
81
118
|
}
|
|
82
|
-
function
|
|
83
|
-
return { field: t, operator:
|
|
119
|
+
function d(t, E) {
|
|
120
|
+
return { field: t, operator: r.LT, value: E };
|
|
84
121
|
}
|
|
85
|
-
function
|
|
86
|
-
return { field: t, operator:
|
|
122
|
+
function pt(t, E) {
|
|
123
|
+
return { field: t, operator: r.GTE, value: E };
|
|
87
124
|
}
|
|
88
|
-
function
|
|
89
|
-
return { field: t, operator:
|
|
125
|
+
function Wt(t, E) {
|
|
126
|
+
return { field: t, operator: r.LTE, value: E };
|
|
90
127
|
}
|
|
91
|
-
function
|
|
92
|
-
const
|
|
93
|
-
return { field: t, operator:
|
|
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
|
|
96
|
-
return { field: t, operator:
|
|
132
|
+
function Ut(t, ...E) {
|
|
133
|
+
return { field: t, operator: r.IN, value: E };
|
|
97
134
|
}
|
|
98
|
-
function
|
|
99
|
-
return { field: t, operator:
|
|
135
|
+
function at(t, ...E) {
|
|
136
|
+
return { field: t, operator: r.NOT_IN, value: E };
|
|
100
137
|
}
|
|
101
|
-
function
|
|
102
|
-
return { field: t, operator:
|
|
138
|
+
function $t(t, E, T) {
|
|
139
|
+
return { field: t, operator: r.BETWEEN, value: [E, T] };
|
|
103
140
|
}
|
|
104
|
-
function
|
|
105
|
-
return { field: t, operator:
|
|
141
|
+
function Vt(t, ...E) {
|
|
142
|
+
return { field: t, operator: r.ALL_IN, value: E };
|
|
106
143
|
}
|
|
107
|
-
function
|
|
108
|
-
const
|
|
109
|
-
return { field: t, operator:
|
|
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
|
|
112
|
-
const
|
|
113
|
-
return { field: t, operator:
|
|
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
|
|
116
|
-
return { field: t, operator:
|
|
152
|
+
function wt(t, E) {
|
|
153
|
+
return { field: t, operator: r.ELEM_MATCH, children: [E] };
|
|
117
154
|
}
|
|
118
|
-
function
|
|
119
|
-
return { field: t, operator:
|
|
155
|
+
function vt(t) {
|
|
156
|
+
return { field: t, operator: r.NULL };
|
|
120
157
|
}
|
|
121
|
-
function
|
|
122
|
-
return { field: t, operator:
|
|
158
|
+
function Ht(t) {
|
|
159
|
+
return { field: t, operator: r.NOT_NULL };
|
|
123
160
|
}
|
|
124
|
-
function
|
|
125
|
-
return { field: t, operator:
|
|
161
|
+
function Bt(t) {
|
|
162
|
+
return { field: t, operator: r.TRUE };
|
|
126
163
|
}
|
|
127
|
-
function
|
|
128
|
-
return { field: t, operator:
|
|
164
|
+
function yt(t) {
|
|
165
|
+
return { field: t, operator: r.FALSE };
|
|
129
166
|
}
|
|
130
|
-
function
|
|
131
|
-
return { field: t, operator:
|
|
167
|
+
function Ft(t, E = !0) {
|
|
168
|
+
return { field: t, operator: r.EXISTS, value: E };
|
|
132
169
|
}
|
|
133
|
-
function
|
|
134
|
-
const
|
|
135
|
-
return { field: t, operator:
|
|
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
|
|
138
|
-
const
|
|
139
|
-
return { field: t, operator:
|
|
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
|
|
142
|
-
const
|
|
143
|
-
return { field: t, operator:
|
|
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
|
|
146
|
-
const
|
|
147
|
-
return { field: t, operator:
|
|
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
|
|
150
|
-
const
|
|
151
|
-
return { field: t, operator:
|
|
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
|
|
154
|
-
const
|
|
155
|
-
return { field: t, operator:
|
|
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
|
|
158
|
-
const
|
|
159
|
-
return { field: t, operator:
|
|
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
|
|
162
|
-
const
|
|
163
|
-
return { field: t, operator:
|
|
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
|
|
166
|
-
const
|
|
167
|
-
return { field: t, operator:
|
|
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
|
|
170
|
-
const
|
|
171
|
-
return { field: t, operator:
|
|
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
|
|
174
|
-
return { operator:
|
|
210
|
+
function mt(t) {
|
|
211
|
+
return { operator: r.RAW, value: t };
|
|
175
212
|
}
|
|
176
|
-
const
|
|
213
|
+
const p = {
|
|
177
214
|
index: 1,
|
|
178
215
|
size: 10
|
|
179
216
|
};
|
|
180
|
-
function
|
|
181
|
-
index: t =
|
|
182
|
-
size: E =
|
|
183
|
-
} =
|
|
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
|
|
190
|
-
function
|
|
191
|
-
return
|
|
226
|
+
const tt = {};
|
|
227
|
+
function Et() {
|
|
228
|
+
return tt;
|
|
192
229
|
}
|
|
193
|
-
function
|
|
230
|
+
function tE({
|
|
194
231
|
include: t,
|
|
195
232
|
exclude: E
|
|
196
|
-
} =
|
|
233
|
+
} = Et()) {
|
|
197
234
|
return {
|
|
198
235
|
include: t,
|
|
199
236
|
exclude: E
|
|
200
237
|
};
|
|
201
238
|
}
|
|
202
|
-
function
|
|
203
|
-
condition: t =
|
|
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
|
|
214
|
-
condition: t =
|
|
250
|
+
function TE({
|
|
251
|
+
condition: t = C(),
|
|
215
252
|
projection: E,
|
|
216
253
|
sort: T,
|
|
217
|
-
limit:
|
|
254
|
+
limit: i = p.size
|
|
218
255
|
} = {}) {
|
|
219
256
|
return {
|
|
220
257
|
condition: t,
|
|
221
258
|
projection: E,
|
|
222
259
|
sort: T,
|
|
223
|
-
limit:
|
|
260
|
+
limit: i
|
|
224
261
|
};
|
|
225
262
|
}
|
|
226
|
-
function
|
|
227
|
-
condition: t =
|
|
263
|
+
function iE({
|
|
264
|
+
condition: t = C(),
|
|
228
265
|
projection: E,
|
|
229
266
|
sort: T,
|
|
230
|
-
pagination:
|
|
267
|
+
pagination: i = p
|
|
231
268
|
} = {}) {
|
|
232
269
|
return {
|
|
233
270
|
condition: t,
|
|
234
271
|
projection: E,
|
|
235
272
|
sort: T,
|
|
236
|
-
pagination:
|
|
273
|
+
pagination: i
|
|
237
274
|
};
|
|
238
275
|
}
|
|
239
|
-
const
|
|
276
|
+
const Tt = {
|
|
240
277
|
total: 0,
|
|
241
278
|
list: []
|
|
242
279
|
};
|
|
243
|
-
function
|
|
280
|
+
function AE({
|
|
244
281
|
total: t,
|
|
245
282
|
list: E = []
|
|
246
|
-
} =
|
|
283
|
+
} = Tt) {
|
|
247
284
|
return t === void 0 && (t = E.length), {
|
|
248
285
|
total: t,
|
|
249
286
|
list: E
|
|
250
287
|
};
|
|
251
288
|
}
|
|
252
|
-
|
|
253
|
-
|
|
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
|
|
297
|
+
function sE(t) {
|
|
303
298
|
return {
|
|
304
299
|
field: t,
|
|
305
300
|
direction: "DESC"
|
|
306
301
|
/* DESC */
|
|
307
302
|
};
|
|
308
303
|
}
|
|
309
|
-
const
|
|
304
|
+
const c = class c {
|
|
310
305
|
};
|
|
311
|
-
|
|
312
|
-
let
|
|
313
|
-
const
|
|
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
|
-
|
|
316
|
-
let
|
|
317
|
-
|
|
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(
|
|
323
|
-
|
|
321
|
+
constructor(t) {
|
|
322
|
+
this.apiMetadata = t;
|
|
324
323
|
}
|
|
325
|
-
|
|
326
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
436
|
-
const
|
|
366
|
+
let x = u;
|
|
367
|
+
const N = class N {
|
|
437
368
|
};
|
|
438
|
-
|
|
439
|
-
let
|
|
440
|
-
|
|
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(
|
|
446
|
-
|
|
380
|
+
constructor(t) {
|
|
381
|
+
this.apiMetadata = t;
|
|
447
382
|
}
|
|
448
|
-
|
|
449
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
685
|
-
|
|
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 =
|
|
688
|
-
direction: T =
|
|
468
|
+
cursorId: E = ct,
|
|
469
|
+
direction: T = $.DESC
|
|
689
470
|
}) {
|
|
690
|
-
return T ===
|
|
471
|
+
return T === $.ASC ? m(t, E) : d(t, E);
|
|
691
472
|
}
|
|
692
|
-
function
|
|
473
|
+
function It({
|
|
693
474
|
field: t,
|
|
694
|
-
direction: E =
|
|
475
|
+
direction: E = $.DESC
|
|
695
476
|
}) {
|
|
696
477
|
return { field: t, direction: E };
|
|
697
478
|
}
|
|
698
|
-
function
|
|
699
|
-
const E = t.query, 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: [
|
|
484
|
+
sort: [i]
|
|
704
485
|
};
|
|
705
486
|
}
|
|
706
|
-
|
|
707
|
-
|
|
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 ===
|
|
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 !
|
|
505
|
+
return !n.isSucceeded(E);
|
|
822
506
|
}
|
|
823
507
|
};
|
|
824
|
-
|
|
825
|
-
let
|
|
826
|
-
var
|
|
827
|
-
const
|
|
828
|
-
var
|
|
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
|
-
|
|
831
|
-
|
|
832
|
-
|
|
514
|
+
ct as CURSOR_ID_START,
|
|
515
|
+
a as CommandClient,
|
|
516
|
+
B as CommandHeaders,
|
|
833
517
|
z as CommandStage,
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
k as
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
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
|