@ahoo-wang/fetcher-react 2.6.9 → 2.6.12
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/README.md +357 -3
- package/README.zh-CN.md +369 -19
- package/dist/fetcher/useFetcher.d.ts +4 -4
- package/dist/fetcher/useFetcher.d.ts.map +1 -1
- package/dist/index.es.js +457 -441
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/wow/index.d.ts +1 -0
- package/dist/wow/index.d.ts.map +1 -1
- package/dist/wow/types.d.ts +7 -0
- package/dist/wow/types.d.ts.map +1 -0
- package/dist/wow/useCountQuery.d.ts +5 -7
- package/dist/wow/useCountQuery.d.ts.map +1 -1
- package/dist/wow/useListQuery.d.ts +5 -7
- package/dist/wow/useListQuery.d.ts.map +1 -1
- package/dist/wow/useListStreamQuery.d.ts +5 -7
- package/dist/wow/useListStreamQuery.d.ts.map +1 -1
- package/dist/wow/usePagedQuery.d.ts +5 -7
- package/dist/wow/usePagedQuery.d.ts.map +1 -1
- package/dist/wow/useSingleQuery.d.ts +5 -7
- package/dist/wow/useSingleQuery.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import { fetcherRegistrar as
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
5
|
-
return
|
|
1
|
+
import { useRef as pt, useCallback as g, useEffect as z, useState as C, useMemo as F, useSyncExternalStore as Le } from "react";
|
|
2
|
+
import { fetcherRegistrar as xe, getFetcher as zt, CONTENT_TYPE_HEADER as ke, ContentTypeValues as ot, FetcherError as Ce, HttpMethod as De, combineURLs as je, JsonResultExtractor as Ge, mergeRecordToMap as St, mergeRequest as qe } from "@ahoo-wang/fetcher";
|
|
3
|
+
function bt() {
|
|
4
|
+
const t = pt(!1), e = g(() => t.current, []);
|
|
5
|
+
return z(() => (t.current = !0, () => {
|
|
6
6
|
t.current = !1;
|
|
7
7
|
}), []), e;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
const e =
|
|
9
|
+
function Z(t) {
|
|
10
|
+
const e = pt(t);
|
|
11
11
|
return e.current = t, e;
|
|
12
12
|
}
|
|
13
13
|
var He = /* @__PURE__ */ ((t) => (t.IDLE = "idle", t.LOADING = "loading", t.SUCCESS = "success", t.ERROR = "error", t))(He || {});
|
|
@@ -15,47 +15,47 @@ function Zt(t) {
|
|
|
15
15
|
const [e, r] = C(
|
|
16
16
|
t?.initialStatus ?? "idle"
|
|
17
17
|
/* IDLE */
|
|
18
|
-
), [a, s] = C(void 0), [u, f] = C(void 0),
|
|
19
|
-
|
|
18
|
+
), [a, s] = C(void 0), [u, f] = C(void 0), y = bt(), m = Z(t), S = g(() => {
|
|
19
|
+
y() && (r(
|
|
20
20
|
"loading"
|
|
21
21
|
/* LOADING */
|
|
22
22
|
), f(void 0));
|
|
23
|
-
}, [
|
|
24
|
-
async (
|
|
25
|
-
if (
|
|
26
|
-
s(
|
|
23
|
+
}, [y]), M = g(
|
|
24
|
+
async (b) => {
|
|
25
|
+
if (y()) {
|
|
26
|
+
s(b), r(
|
|
27
27
|
"success"
|
|
28
28
|
/* SUCCESS */
|
|
29
29
|
), f(void 0);
|
|
30
30
|
try {
|
|
31
|
-
await m.current?.onSuccess?.(
|
|
32
|
-
} catch (
|
|
33
|
-
console.warn("PromiseState onSuccess callback error:",
|
|
31
|
+
await m.current?.onSuccess?.(b);
|
|
32
|
+
} catch (O) {
|
|
33
|
+
console.warn("PromiseState onSuccess callback error:", O);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
|
-
[
|
|
38
|
-
),
|
|
39
|
-
async (
|
|
40
|
-
if (
|
|
41
|
-
f(
|
|
37
|
+
[y, m]
|
|
38
|
+
), _ = g(
|
|
39
|
+
async (b) => {
|
|
40
|
+
if (y()) {
|
|
41
|
+
f(b), r(
|
|
42
42
|
"error"
|
|
43
43
|
/* ERROR */
|
|
44
44
|
), s(void 0);
|
|
45
45
|
try {
|
|
46
|
-
await m.current?.onError?.(
|
|
47
|
-
} catch (
|
|
48
|
-
console.warn("PromiseState onError callback error:",
|
|
46
|
+
await m.current?.onError?.(b);
|
|
47
|
+
} catch (O) {
|
|
48
|
+
console.warn("PromiseState onError callback error:", O);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
|
-
[
|
|
53
|
-
),
|
|
54
|
-
|
|
52
|
+
[y, m]
|
|
53
|
+
), A = g(() => {
|
|
54
|
+
y() && (r(
|
|
55
55
|
"idle"
|
|
56
56
|
/* IDLE */
|
|
57
57
|
), f(void 0), s(void 0));
|
|
58
|
-
}, [
|
|
58
|
+
}, [y]);
|
|
59
59
|
return F(
|
|
60
60
|
() => ({
|
|
61
61
|
status: e,
|
|
@@ -63,17 +63,17 @@ function Zt(t) {
|
|
|
63
63
|
result: a,
|
|
64
64
|
error: u,
|
|
65
65
|
setLoading: S,
|
|
66
|
-
setSuccess:
|
|
67
|
-
setError:
|
|
68
|
-
setIdle:
|
|
66
|
+
setSuccess: M,
|
|
67
|
+
setError: _,
|
|
68
|
+
setIdle: A
|
|
69
69
|
}),
|
|
70
|
-
[e, a, u, S,
|
|
70
|
+
[e, a, u, S, M, _, A]
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
function Kt() {
|
|
74
|
-
const t =
|
|
74
|
+
const t = pt(0), e = g(() => ++t.current, []), r = g(() => t.current, []), a = g((f) => f === t.current, []), s = g(() => {
|
|
75
75
|
t.current++;
|
|
76
|
-
}, []), u =
|
|
76
|
+
}, []), u = g(() => {
|
|
77
77
|
t.current = 0;
|
|
78
78
|
}, []);
|
|
79
79
|
return F(() => ({
|
|
@@ -84,24 +84,24 @@ function Kt() {
|
|
|
84
84
|
reset: u
|
|
85
85
|
}), [e, r, a, s, u]);
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
const e = Zt(t), r =
|
|
87
|
+
function it(t) {
|
|
88
|
+
const e = Zt(t), r = bt(), a = Kt(), s = g(
|
|
89
89
|
async (f) => {
|
|
90
90
|
if (!r())
|
|
91
91
|
throw new Error("Component is unmounted");
|
|
92
|
-
const
|
|
92
|
+
const y = a.generate();
|
|
93
93
|
e.setLoading();
|
|
94
94
|
try {
|
|
95
95
|
const S = await (typeof f == "function" ? f() : f);
|
|
96
|
-
return r() && a.isLatest(
|
|
96
|
+
return r() && a.isLatest(y) && await e.setSuccess(S), S;
|
|
97
97
|
} catch (m) {
|
|
98
|
-
if (r() && a.isLatest(
|
|
98
|
+
if (r() && a.isLatest(y) && await e.setError(m), t?.propagateError)
|
|
99
99
|
throw m;
|
|
100
100
|
return m;
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
103
|
[e, r, a, t]
|
|
104
|
-
), u =
|
|
104
|
+
), u = g(() => {
|
|
105
105
|
r() && e.setIdle();
|
|
106
106
|
}, [e, r]);
|
|
107
107
|
return F(
|
|
@@ -117,52 +117,52 @@ function ot(t) {
|
|
|
117
117
|
);
|
|
118
118
|
}
|
|
119
119
|
function Mr(t) {
|
|
120
|
-
const e =
|
|
120
|
+
const e = g(
|
|
121
121
|
(u) => t.addListener(u),
|
|
122
122
|
[t]
|
|
123
|
-
), r =
|
|
123
|
+
), r = g(() => t.get(), [t]), a = Le(e, r, r), s = g(
|
|
124
124
|
(u) => t.set(u),
|
|
125
125
|
[t]
|
|
126
126
|
);
|
|
127
127
|
return [a, s];
|
|
128
128
|
}
|
|
129
129
|
function Ar(t) {
|
|
130
|
-
const { fetcher: e =
|
|
130
|
+
const { fetcher: e = xe.default } = t || {}, r = Zt(t), [a, s] = C(
|
|
131
131
|
void 0
|
|
132
|
-
), u =
|
|
133
|
-
async (
|
|
134
|
-
f.current && f.current.abort(), f.current =
|
|
135
|
-
const
|
|
132
|
+
), u = bt(), f = pt(), y = Kt(), m = Z(t), S = zt(e), M = g(
|
|
133
|
+
async (_) => {
|
|
134
|
+
f.current && f.current.abort(), f.current = _.abortController ?? new AbortController(), _.abortController = f.current;
|
|
135
|
+
const A = y.generate();
|
|
136
136
|
r.setLoading();
|
|
137
137
|
try {
|
|
138
|
-
const
|
|
139
|
-
|
|
138
|
+
const b = await S.exchange(
|
|
139
|
+
_,
|
|
140
140
|
m.current
|
|
141
141
|
);
|
|
142
|
-
u() &&
|
|
143
|
-
const
|
|
144
|
-
u() &&
|
|
145
|
-
} catch (
|
|
146
|
-
if (
|
|
142
|
+
u() && y.isLatest(A) && s(b);
|
|
143
|
+
const O = await b.extractResult();
|
|
144
|
+
u() && y.isLatest(A) && await r.setSuccess(O);
|
|
145
|
+
} catch (b) {
|
|
146
|
+
if (b instanceof Error && b.name === "AbortError") {
|
|
147
147
|
u() && r.setIdle();
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
|
-
u() &&
|
|
150
|
+
u() && y.isLatest(A) && await r.setError(b);
|
|
151
151
|
} finally {
|
|
152
|
-
f.current ===
|
|
152
|
+
f.current === _.abortController && (f.current = void 0);
|
|
153
153
|
}
|
|
154
154
|
},
|
|
155
|
-
[S, u, m, r,
|
|
155
|
+
[S, u, m, r, y]
|
|
156
156
|
);
|
|
157
|
-
return
|
|
157
|
+
return z(() => () => {
|
|
158
158
|
f.current?.abort(), f.current = void 0;
|
|
159
159
|
}, []), F(
|
|
160
160
|
() => ({
|
|
161
161
|
...r,
|
|
162
162
|
exchange: a,
|
|
163
|
-
execute:
|
|
163
|
+
execute: M
|
|
164
164
|
}),
|
|
165
|
-
[r, a,
|
|
165
|
+
[r, a, M]
|
|
166
166
|
);
|
|
167
167
|
}
|
|
168
168
|
let Ue = class {
|
|
@@ -205,33 +205,33 @@ class $e extends TransformStream {
|
|
|
205
205
|
super(new Ue());
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
const
|
|
208
|
+
const at = class {
|
|
209
209
|
};
|
|
210
|
-
|
|
211
|
-
let
|
|
210
|
+
at.ID = "id", at.RETRY = "retry", at.EVENT = "event", at.DATA = "data";
|
|
211
|
+
let dt = at;
|
|
212
212
|
function We(t, e, r) {
|
|
213
213
|
switch (t) {
|
|
214
|
-
case
|
|
214
|
+
case dt.EVENT:
|
|
215
215
|
r.event = e;
|
|
216
216
|
break;
|
|
217
|
-
case
|
|
217
|
+
case dt.DATA:
|
|
218
218
|
r.data.push(e);
|
|
219
219
|
break;
|
|
220
|
-
case
|
|
220
|
+
case dt.ID:
|
|
221
221
|
r.id = e;
|
|
222
222
|
break;
|
|
223
|
-
case
|
|
223
|
+
case dt.RETRY: {
|
|
224
224
|
const a = parseInt(e, 10);
|
|
225
225
|
isNaN(a) || (r.retry = a);
|
|
226
226
|
break;
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
|
-
const
|
|
230
|
+
const tt = "message";
|
|
231
231
|
let Fe = class {
|
|
232
232
|
constructor() {
|
|
233
233
|
this.currentEvent = {
|
|
234
|
-
event:
|
|
234
|
+
event: tt,
|
|
235
235
|
id: void 0,
|
|
236
236
|
retry: void 0,
|
|
237
237
|
data: []
|
|
@@ -248,12 +248,12 @@ let Fe = class {
|
|
|
248
248
|
try {
|
|
249
249
|
if (e.trim() === "") {
|
|
250
250
|
a.data.length > 0 && (r.enqueue({
|
|
251
|
-
event: a.event ||
|
|
251
|
+
event: a.event || tt,
|
|
252
252
|
data: a.data.join(`
|
|
253
253
|
`),
|
|
254
254
|
id: a.id || "",
|
|
255
255
|
retry: a.retry
|
|
256
|
-
}), a.event =
|
|
256
|
+
}), a.event = tt, a.data = []);
|
|
257
257
|
return;
|
|
258
258
|
}
|
|
259
259
|
if (e.startsWith(":"))
|
|
@@ -264,7 +264,7 @@ let Fe = class {
|
|
|
264
264
|
} catch (s) {
|
|
265
265
|
r.error(
|
|
266
266
|
s instanceof Error ? s : new Error(String(s))
|
|
267
|
-
), a.event =
|
|
267
|
+
), a.event = tt, a.id = void 0, a.retry = void 0, a.data = [];
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
/**
|
|
@@ -276,7 +276,7 @@ let Fe = class {
|
|
|
276
276
|
const r = this.currentEvent;
|
|
277
277
|
try {
|
|
278
278
|
r.data.length > 0 && e.enqueue({
|
|
279
|
-
event: r.event ||
|
|
279
|
+
event: r.event || tt,
|
|
280
280
|
data: r.data.join(`
|
|
281
281
|
`),
|
|
282
282
|
id: r.id || "",
|
|
@@ -287,7 +287,7 @@ let Fe = class {
|
|
|
287
287
|
a instanceof Error ? a : new Error(String(a))
|
|
288
288
|
);
|
|
289
289
|
} finally {
|
|
290
|
-
r.event =
|
|
290
|
+
r.event = tt, r.id = void 0, r.retry = void 0, r.data = [];
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
};
|
|
@@ -296,7 +296,7 @@ class Qe extends TransformStream {
|
|
|
296
296
|
super(new Fe());
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
class
|
|
299
|
+
class st extends Ce {
|
|
300
300
|
/**
|
|
301
301
|
* Creates a new EventStreamConvertError instance.
|
|
302
302
|
* @param response - The Response object associated with the error
|
|
@@ -304,12 +304,12 @@ class it extends Ce {
|
|
|
304
304
|
* @param cause - Optional underlying error that caused this error
|
|
305
305
|
*/
|
|
306
306
|
constructor(e, r, a) {
|
|
307
|
-
super(r, a), this.response = e, this.name = "EventStreamConvertError", Object.setPrototypeOf(this,
|
|
307
|
+
super(r, a), this.response = e, this.name = "EventStreamConvertError", Object.setPrototypeOf(this, st.prototype);
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
function Ve(t) {
|
|
311
311
|
if (!t.body)
|
|
312
|
-
throw new
|
|
312
|
+
throw new st(t, "Response body is null");
|
|
313
313
|
return t.body.pipeThrough(new TextDecoderStream("utf-8")).pipeThrough(new $e()).pipeThrough(new Qe());
|
|
314
314
|
}
|
|
315
315
|
let Ye = class {
|
|
@@ -332,16 +332,16 @@ function Xe(t) {
|
|
|
332
332
|
new Be()
|
|
333
333
|
);
|
|
334
334
|
}
|
|
335
|
-
const
|
|
335
|
+
const yt = (t) => t.requiredResponse.requiredJsonEventStream();
|
|
336
336
|
Object.defineProperty(Response.prototype, "contentType", {
|
|
337
337
|
get() {
|
|
338
|
-
return this.headers.get(
|
|
338
|
+
return this.headers.get(ke);
|
|
339
339
|
}
|
|
340
340
|
});
|
|
341
341
|
Object.defineProperty(Response.prototype, "isEventStream", {
|
|
342
342
|
get() {
|
|
343
343
|
const t = this.contentType;
|
|
344
|
-
return t ? t.includes(
|
|
344
|
+
return t ? t.includes(ot.TEXT_EVENT_STREAM) : !1;
|
|
345
345
|
}
|
|
346
346
|
});
|
|
347
347
|
Response.prototype.eventStream = function() {
|
|
@@ -350,7 +350,7 @@ Response.prototype.eventStream = function() {
|
|
|
350
350
|
Response.prototype.requiredEventStream = function() {
|
|
351
351
|
const t = this.eventStream();
|
|
352
352
|
if (!t)
|
|
353
|
-
throw new
|
|
353
|
+
throw new st(
|
|
354
354
|
this,
|
|
355
355
|
`Event stream is not available. Response content-type: [${this.contentType}]`
|
|
356
356
|
);
|
|
@@ -363,7 +363,7 @@ Response.prototype.jsonEventStream = function() {
|
|
|
363
363
|
Response.prototype.requiredJsonEventStream = function() {
|
|
364
364
|
const t = this.jsonEventStream();
|
|
365
365
|
if (!t)
|
|
366
|
-
throw new
|
|
366
|
+
throw new st(
|
|
367
367
|
this,
|
|
368
368
|
`Event stream is not available. Response content-type: [${this.contentType}]`
|
|
369
369
|
);
|
|
@@ -448,7 +448,7 @@ const ze = typeof ReadableStream.prototype[Symbol.asyncIterator] == "function";
|
|
|
448
448
|
ze || (ReadableStream.prototype[Symbol.asyncIterator] = function() {
|
|
449
449
|
return new Je(this);
|
|
450
450
|
});
|
|
451
|
-
var
|
|
451
|
+
var Yt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Bt = {};
|
|
452
452
|
/*! *****************************************************************************
|
|
453
453
|
Copyright (C) Microsoft. All rights reserved.
|
|
454
454
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -463,18 +463,18 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
463
463
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
464
464
|
and limitations under the License.
|
|
465
465
|
***************************************************************************** */
|
|
466
|
-
var
|
|
466
|
+
var Xt;
|
|
467
467
|
function Ze() {
|
|
468
|
-
if (
|
|
469
|
-
|
|
468
|
+
if (Xt) return Bt;
|
|
469
|
+
Xt = 1;
|
|
470
470
|
var t;
|
|
471
471
|
return (function(e) {
|
|
472
472
|
(function(r) {
|
|
473
|
-
var a = typeof globalThis == "object" ? globalThis : typeof
|
|
473
|
+
var a = typeof globalThis == "object" ? globalThis : typeof Yt == "object" ? Yt : typeof self == "object" ? self : typeof this == "object" ? this : m(), s = u(e);
|
|
474
474
|
typeof a.Reflect < "u" && (s = u(a.Reflect, s)), r(s, a), typeof a.Reflect > "u" && (a.Reflect = e);
|
|
475
|
-
function u(S,
|
|
476
|
-
return function(
|
|
477
|
-
Object.defineProperty(S,
|
|
475
|
+
function u(S, M) {
|
|
476
|
+
return function(_, A) {
|
|
477
|
+
Object.defineProperty(S, _, { configurable: !0, writable: !0, value: A }), M && M(_, A);
|
|
478
478
|
};
|
|
479
479
|
}
|
|
480
480
|
function f() {
|
|
@@ -483,61 +483,61 @@ function Ze() {
|
|
|
483
483
|
} catch {
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function y() {
|
|
487
487
|
try {
|
|
488
488
|
return (0, eval)("(function() { return this; })()");
|
|
489
489
|
} catch {
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
function m() {
|
|
493
|
-
return f() ||
|
|
493
|
+
return f() || y();
|
|
494
494
|
}
|
|
495
495
|
})(function(r, a) {
|
|
496
|
-
var s = Object.prototype.hasOwnProperty, u = typeof Symbol == "function", f = u && typeof Symbol.toPrimitive < "u" ? Symbol.toPrimitive : "@@toPrimitive",
|
|
496
|
+
var s = Object.prototype.hasOwnProperty, u = typeof Symbol == "function", f = u && typeof Symbol.toPrimitive < "u" ? Symbol.toPrimitive : "@@toPrimitive", y = u && typeof Symbol.iterator < "u" ? Symbol.iterator : "@@iterator", m = typeof Object.create == "function", S = { __proto__: [] } instanceof Array, M = !m && !S, _ = {
|
|
497
497
|
// create an object in dictionary mode (a.k.a. "slow" mode in v8)
|
|
498
498
|
create: m ? function() {
|
|
499
|
-
return
|
|
499
|
+
return mt(/* @__PURE__ */ Object.create(null));
|
|
500
500
|
} : S ? function() {
|
|
501
|
-
return
|
|
501
|
+
return mt({ __proto__: null });
|
|
502
502
|
} : function() {
|
|
503
|
-
return
|
|
503
|
+
return mt({});
|
|
504
504
|
},
|
|
505
|
-
has:
|
|
505
|
+
has: M ? function(n, o) {
|
|
506
506
|
return s.call(n, o);
|
|
507
507
|
} : function(n, o) {
|
|
508
508
|
return o in n;
|
|
509
509
|
},
|
|
510
|
-
get:
|
|
510
|
+
get: M ? function(n, o) {
|
|
511
511
|
return s.call(n, o) ? n[o] : void 0;
|
|
512
512
|
} : function(n, o) {
|
|
513
513
|
return n[o];
|
|
514
514
|
}
|
|
515
|
-
},
|
|
515
|
+
}, A = Object.getPrototypeOf(Function), b = typeof Map == "function" && typeof Map.prototype.entries == "function" ? Map : Me(), O = typeof Set == "function" && typeof Set.prototype.entries == "function" ? Set : Ae(), X = typeof WeakMap == "function" ? WeakMap : Ie(), G = u ? Symbol.for("@reflect-metadata:registry") : void 0, ct = ge(), Pt = Re(ct);
|
|
516
516
|
function ie(n, o, i, c) {
|
|
517
517
|
if (v(i)) {
|
|
518
|
-
if (!
|
|
518
|
+
if (!qt(n))
|
|
519
519
|
throw new TypeError();
|
|
520
|
-
if (!
|
|
520
|
+
if (!Ht(o))
|
|
521
521
|
throw new TypeError();
|
|
522
|
-
return
|
|
522
|
+
return Ee(n, o);
|
|
523
523
|
} else {
|
|
524
|
-
if (!
|
|
524
|
+
if (!qt(n))
|
|
525
525
|
throw new TypeError();
|
|
526
526
|
if (!N(o))
|
|
527
527
|
throw new TypeError();
|
|
528
|
-
if (!N(c) && !v(c) && !
|
|
528
|
+
if (!N(c) && !v(c) && !K(c))
|
|
529
529
|
throw new TypeError();
|
|
530
|
-
return
|
|
530
|
+
return K(c) && (c = void 0), i = W(i), ve(n, o, i, c);
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
533
|
r("decorate", ie);
|
|
534
534
|
function se(n, o) {
|
|
535
|
-
function i(c,
|
|
535
|
+
function i(c, E) {
|
|
536
536
|
if (!N(c))
|
|
537
537
|
throw new TypeError();
|
|
538
|
-
if (!v(
|
|
538
|
+
if (!v(E) && !_e(E))
|
|
539
539
|
throw new TypeError();
|
|
540
|
-
kt(n, o, c,
|
|
540
|
+
kt(n, o, c, E);
|
|
541
541
|
}
|
|
542
542
|
return i;
|
|
543
543
|
}
|
|
@@ -551,7 +551,7 @@ function Ze() {
|
|
|
551
551
|
function ce(n, o, i) {
|
|
552
552
|
if (!N(o))
|
|
553
553
|
throw new TypeError();
|
|
554
|
-
return v(i) || (i = W(i)),
|
|
554
|
+
return v(i) || (i = W(i)), Nt(n, o, i);
|
|
555
555
|
}
|
|
556
556
|
r("hasMetadata", ce);
|
|
557
557
|
function fe(n, o, i) {
|
|
@@ -563,25 +563,25 @@ function Ze() {
|
|
|
563
563
|
function de(n, o, i) {
|
|
564
564
|
if (!N(o))
|
|
565
565
|
throw new TypeError();
|
|
566
|
-
return v(i) || (i = W(i)),
|
|
566
|
+
return v(i) || (i = W(i)), Lt(n, o, i);
|
|
567
567
|
}
|
|
568
568
|
r("getMetadata", de);
|
|
569
569
|
function le(n, o, i) {
|
|
570
570
|
if (!N(o))
|
|
571
571
|
throw new TypeError();
|
|
572
|
-
return v(i) || (i = W(i)),
|
|
572
|
+
return v(i) || (i = W(i)), xt(n, o, i);
|
|
573
573
|
}
|
|
574
574
|
r("getOwnMetadata", le);
|
|
575
575
|
function he(n, o) {
|
|
576
576
|
if (!N(n))
|
|
577
577
|
throw new TypeError();
|
|
578
|
-
return v(o) || (o = W(o)),
|
|
578
|
+
return v(o) || (o = W(o)), Ct(n, o);
|
|
579
579
|
}
|
|
580
580
|
r("getMetadataKeys", he);
|
|
581
581
|
function pe(n, o) {
|
|
582
582
|
if (!N(n))
|
|
583
583
|
throw new TypeError();
|
|
584
|
-
return v(o) || (o = W(o)),
|
|
584
|
+
return v(o) || (o = W(o)), Dt(n, o);
|
|
585
585
|
}
|
|
586
586
|
r("getOwnMetadataKeys", pe);
|
|
587
587
|
function ye(n, o, i) {
|
|
@@ -590,7 +590,7 @@ function Ze() {
|
|
|
590
590
|
if (v(i) || (i = W(i)), !N(o))
|
|
591
591
|
throw new TypeError();
|
|
592
592
|
v(i) || (i = W(i));
|
|
593
|
-
var c =
|
|
593
|
+
var c = rt(
|
|
594
594
|
o,
|
|
595
595
|
i,
|
|
596
596
|
/*Create*/
|
|
@@ -599,21 +599,21 @@ function Ze() {
|
|
|
599
599
|
return v(c) ? !1 : c.OrdinaryDeleteMetadata(n, o, i);
|
|
600
600
|
}
|
|
601
601
|
r("deleteMetadata", ye);
|
|
602
|
-
function
|
|
602
|
+
function Ee(n, o) {
|
|
603
603
|
for (var i = n.length - 1; i >= 0; --i) {
|
|
604
|
-
var c = n[i],
|
|
605
|
-
if (!v(
|
|
606
|
-
if (!
|
|
604
|
+
var c = n[i], E = c(o);
|
|
605
|
+
if (!v(E) && !K(E)) {
|
|
606
|
+
if (!Ht(E))
|
|
607
607
|
throw new TypeError();
|
|
608
|
-
o =
|
|
608
|
+
o = E;
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
611
|
return o;
|
|
612
612
|
}
|
|
613
|
-
function
|
|
614
|
-
for (var
|
|
615
|
-
var
|
|
616
|
-
if (!v(L) && !
|
|
613
|
+
function ve(n, o, i, c) {
|
|
614
|
+
for (var E = n.length - 1; E >= 0; --E) {
|
|
615
|
+
var I = n[E], L = I(o, i, c);
|
|
616
|
+
if (!v(L) && !K(L)) {
|
|
617
617
|
if (!N(L))
|
|
618
618
|
throw new TypeError();
|
|
619
619
|
c = L;
|
|
@@ -621,32 +621,32 @@ function Ze() {
|
|
|
621
621
|
}
|
|
622
622
|
return c;
|
|
623
623
|
}
|
|
624
|
-
function
|
|
624
|
+
function Nt(n, o, i) {
|
|
625
625
|
var c = vt(n, o, i);
|
|
626
626
|
if (c)
|
|
627
627
|
return !0;
|
|
628
|
-
var
|
|
629
|
-
return
|
|
628
|
+
var E = wt(o);
|
|
629
|
+
return K(E) ? !1 : Nt(n, E, i);
|
|
630
630
|
}
|
|
631
631
|
function vt(n, o, i) {
|
|
632
|
-
var c =
|
|
632
|
+
var c = rt(
|
|
633
633
|
o,
|
|
634
634
|
i,
|
|
635
635
|
/*Create*/
|
|
636
636
|
!1
|
|
637
637
|
);
|
|
638
|
-
return v(c) ? !1 :
|
|
638
|
+
return v(c) ? !1 : Gt(c.OrdinaryHasOwnMetadata(n, o, i));
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function Lt(n, o, i) {
|
|
641
641
|
var c = vt(n, o, i);
|
|
642
642
|
if (c)
|
|
643
|
-
return
|
|
644
|
-
var
|
|
645
|
-
if (!
|
|
646
|
-
return
|
|
643
|
+
return xt(n, o, i);
|
|
644
|
+
var E = wt(o);
|
|
645
|
+
if (!K(E))
|
|
646
|
+
return Lt(n, E, i);
|
|
647
647
|
}
|
|
648
|
-
function
|
|
649
|
-
var c =
|
|
648
|
+
function xt(n, o, i) {
|
|
649
|
+
var c = rt(
|
|
650
650
|
o,
|
|
651
651
|
i,
|
|
652
652
|
/*Create*/
|
|
@@ -656,35 +656,35 @@ function Ze() {
|
|
|
656
656
|
return c.OrdinaryGetOwnMetadata(n, o, i);
|
|
657
657
|
}
|
|
658
658
|
function kt(n, o, i, c) {
|
|
659
|
-
var
|
|
659
|
+
var E = rt(
|
|
660
660
|
i,
|
|
661
661
|
c,
|
|
662
662
|
/*Create*/
|
|
663
663
|
!0
|
|
664
664
|
);
|
|
665
|
-
|
|
665
|
+
E.OrdinaryDefineOwnMetadata(n, o, i, c);
|
|
666
666
|
}
|
|
667
|
-
function
|
|
668
|
-
var i =
|
|
667
|
+
function Ct(n, o) {
|
|
668
|
+
var i = Dt(n, o), c = wt(n);
|
|
669
669
|
if (c === null)
|
|
670
670
|
return i;
|
|
671
|
-
var
|
|
672
|
-
if (
|
|
671
|
+
var E = Ct(c, o);
|
|
672
|
+
if (E.length <= 0)
|
|
673
673
|
return i;
|
|
674
674
|
if (i.length <= 0)
|
|
675
|
-
return
|
|
676
|
-
for (var
|
|
677
|
-
var l = d[T], h =
|
|
678
|
-
h || (
|
|
675
|
+
return E;
|
|
676
|
+
for (var I = new O(), L = [], T = 0, d = i; T < d.length; T++) {
|
|
677
|
+
var l = d[T], h = I.has(l);
|
|
678
|
+
h || (I.add(l), L.push(l));
|
|
679
679
|
}
|
|
680
|
-
for (var p = 0, w =
|
|
681
|
-
var l = w[p], h =
|
|
682
|
-
h || (
|
|
680
|
+
for (var p = 0, w = E; p < w.length; p++) {
|
|
681
|
+
var l = w[p], h = I.has(l);
|
|
682
|
+
h || (I.add(l), L.push(l));
|
|
683
683
|
}
|
|
684
684
|
return L;
|
|
685
685
|
}
|
|
686
|
-
function
|
|
687
|
-
var i =
|
|
686
|
+
function Dt(n, o) {
|
|
687
|
+
var i = rt(
|
|
688
688
|
n,
|
|
689
689
|
o,
|
|
690
690
|
/*create*/
|
|
@@ -692,7 +692,7 @@ function Ze() {
|
|
|
692
692
|
);
|
|
693
693
|
return i ? i.OrdinaryOwnMetadataKeys(n, o) : [];
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function jt(n) {
|
|
696
696
|
if (n === null)
|
|
697
697
|
return 1;
|
|
698
698
|
switch (typeof n) {
|
|
@@ -715,7 +715,7 @@ function Ze() {
|
|
|
715
715
|
function v(n) {
|
|
716
716
|
return n === void 0;
|
|
717
717
|
}
|
|
718
|
-
function
|
|
718
|
+
function K(n) {
|
|
719
719
|
return n === null;
|
|
720
720
|
}
|
|
721
721
|
function Te(n) {
|
|
@@ -725,7 +725,7 @@ function Ze() {
|
|
|
725
725
|
return typeof n == "object" ? n !== null : typeof n == "function";
|
|
726
726
|
}
|
|
727
727
|
function we(n, o) {
|
|
728
|
-
switch (
|
|
728
|
+
switch (jt(n)) {
|
|
729
729
|
case 0:
|
|
730
730
|
return n;
|
|
731
731
|
case 1:
|
|
@@ -739,26 +739,26 @@ function Ze() {
|
|
|
739
739
|
case 5:
|
|
740
740
|
return n;
|
|
741
741
|
}
|
|
742
|
-
var i = "string", c =
|
|
742
|
+
var i = "string", c = Ut(n, f);
|
|
743
743
|
if (c !== void 0) {
|
|
744
|
-
var
|
|
745
|
-
if (N(
|
|
744
|
+
var E = c.call(n, i);
|
|
745
|
+
if (N(E))
|
|
746
746
|
throw new TypeError();
|
|
747
|
-
return
|
|
747
|
+
return E;
|
|
748
748
|
}
|
|
749
749
|
return me(n);
|
|
750
750
|
}
|
|
751
751
|
function me(n, o) {
|
|
752
|
-
var i, c,
|
|
752
|
+
var i, c, E;
|
|
753
753
|
{
|
|
754
|
-
var
|
|
755
|
-
if (
|
|
756
|
-
var c =
|
|
754
|
+
var I = n.toString;
|
|
755
|
+
if (ft(I)) {
|
|
756
|
+
var c = I.call(n);
|
|
757
757
|
if (!N(c))
|
|
758
758
|
return c;
|
|
759
759
|
}
|
|
760
760
|
var i = n.valueOf;
|
|
761
|
-
if (
|
|
761
|
+
if (ft(i)) {
|
|
762
762
|
var c = i.call(n);
|
|
763
763
|
if (!N(c))
|
|
764
764
|
return c;
|
|
@@ -766,7 +766,7 @@ function Ze() {
|
|
|
766
766
|
}
|
|
767
767
|
throw new TypeError();
|
|
768
768
|
}
|
|
769
|
-
function
|
|
769
|
+
function Gt(n) {
|
|
770
770
|
return !!n;
|
|
771
771
|
}
|
|
772
772
|
function Se(n) {
|
|
@@ -776,17 +776,17 @@ function Ze() {
|
|
|
776
776
|
var o = we(n);
|
|
777
777
|
return Te(o) ? o : Se(o);
|
|
778
778
|
}
|
|
779
|
-
function
|
|
779
|
+
function qt(n) {
|
|
780
780
|
return Array.isArray ? Array.isArray(n) : n instanceof Object ? n instanceof Array : Object.prototype.toString.call(n) === "[object Array]";
|
|
781
781
|
}
|
|
782
|
-
function
|
|
782
|
+
function ft(n) {
|
|
783
783
|
return typeof n == "function";
|
|
784
784
|
}
|
|
785
|
-
function
|
|
785
|
+
function Ht(n) {
|
|
786
786
|
return typeof n == "function";
|
|
787
787
|
}
|
|
788
788
|
function _e(n) {
|
|
789
|
-
switch (
|
|
789
|
+
switch (jt(n)) {
|
|
790
790
|
case 3:
|
|
791
791
|
return !0;
|
|
792
792
|
case 4:
|
|
@@ -795,58 +795,58 @@ function Ze() {
|
|
|
795
795
|
return !1;
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function Tt(n, o) {
|
|
799
799
|
return n === o || n !== n && o !== o;
|
|
800
800
|
}
|
|
801
|
-
function
|
|
801
|
+
function Ut(n, o) {
|
|
802
802
|
var i = n[o];
|
|
803
803
|
if (i != null) {
|
|
804
|
-
if (!
|
|
804
|
+
if (!ft(i))
|
|
805
805
|
throw new TypeError();
|
|
806
806
|
return i;
|
|
807
807
|
}
|
|
808
808
|
}
|
|
809
|
-
function
|
|
810
|
-
var o =
|
|
811
|
-
if (!
|
|
809
|
+
function $t(n) {
|
|
810
|
+
var o = Ut(n, y);
|
|
811
|
+
if (!ft(o))
|
|
812
812
|
throw new TypeError();
|
|
813
813
|
var i = o.call(n);
|
|
814
814
|
if (!N(i))
|
|
815
815
|
throw new TypeError();
|
|
816
816
|
return i;
|
|
817
817
|
}
|
|
818
|
-
function
|
|
818
|
+
function Wt(n) {
|
|
819
819
|
return n.value;
|
|
820
820
|
}
|
|
821
|
-
function
|
|
821
|
+
function Ft(n) {
|
|
822
822
|
var o = n.next();
|
|
823
823
|
return o.done ? !1 : o;
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function Qt(n) {
|
|
826
826
|
var o = n.return;
|
|
827
827
|
o && o.call(n);
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function wt(n) {
|
|
830
830
|
var o = Object.getPrototypeOf(n);
|
|
831
|
-
if (typeof n != "function" || n ===
|
|
831
|
+
if (typeof n != "function" || n === A || o !== A)
|
|
832
832
|
return o;
|
|
833
833
|
var i = n.prototype, c = i && Object.getPrototypeOf(i);
|
|
834
834
|
if (c == null || c === Object.prototype)
|
|
835
835
|
return o;
|
|
836
|
-
var
|
|
837
|
-
return typeof
|
|
836
|
+
var E = c.constructor;
|
|
837
|
+
return typeof E != "function" || E === n ? o : E;
|
|
838
838
|
}
|
|
839
839
|
function be() {
|
|
840
840
|
var n;
|
|
841
841
|
!v(G) && typeof a.Reflect < "u" && !(G in a.Reflect) && typeof a.Reflect.defineMetadata == "function" && (n = Oe(a.Reflect));
|
|
842
|
-
var o, i, c,
|
|
842
|
+
var o, i, c, E = new X(), I = {
|
|
843
843
|
registerProvider: L,
|
|
844
844
|
getProvider: d,
|
|
845
845
|
setProvider: h
|
|
846
846
|
};
|
|
847
|
-
return
|
|
847
|
+
return I;
|
|
848
848
|
function L(p) {
|
|
849
|
-
if (!Object.isExtensible(
|
|
849
|
+
if (!Object.isExtensible(I))
|
|
850
850
|
throw new Error("Cannot add provider to a frozen registry.");
|
|
851
851
|
switch (!0) {
|
|
852
852
|
case n === p:
|
|
@@ -862,7 +862,7 @@ function Ze() {
|
|
|
862
862
|
case i === p:
|
|
863
863
|
break;
|
|
864
864
|
default:
|
|
865
|
-
c === void 0 && (c = new
|
|
865
|
+
c === void 0 && (c = new O()), c.add(p);
|
|
866
866
|
break;
|
|
867
867
|
}
|
|
868
868
|
}
|
|
@@ -874,13 +874,13 @@ function Ze() {
|
|
|
874
874
|
if (i.isProviderFor(p, w))
|
|
875
875
|
return o;
|
|
876
876
|
if (!v(c))
|
|
877
|
-
for (var
|
|
878
|
-
var
|
|
879
|
-
if (!
|
|
877
|
+
for (var R = $t(c); ; ) {
|
|
878
|
+
var P = Ft(R);
|
|
879
|
+
if (!P)
|
|
880
880
|
return;
|
|
881
|
-
var U =
|
|
881
|
+
var U = Wt(P);
|
|
882
882
|
if (U.isProviderFor(p, w))
|
|
883
|
-
return
|
|
883
|
+
return Qt(R), U;
|
|
884
884
|
}
|
|
885
885
|
}
|
|
886
886
|
}
|
|
@@ -888,23 +888,23 @@ function Ze() {
|
|
|
888
888
|
return n;
|
|
889
889
|
}
|
|
890
890
|
function d(p, w) {
|
|
891
|
-
var
|
|
892
|
-
return v(
|
|
891
|
+
var R = E.get(p), P;
|
|
892
|
+
return v(R) || (P = R.get(w)), v(P) && (P = T(p, w), v(P) || (v(R) && (R = new b(), E.set(p, R)), R.set(w, P))), P;
|
|
893
893
|
}
|
|
894
894
|
function l(p) {
|
|
895
895
|
if (v(p))
|
|
896
896
|
throw new TypeError();
|
|
897
897
|
return o === p || i === p || !v(c) && c.has(p);
|
|
898
898
|
}
|
|
899
|
-
function h(p, w,
|
|
900
|
-
if (!l(
|
|
899
|
+
function h(p, w, R) {
|
|
900
|
+
if (!l(R))
|
|
901
901
|
throw new Error("Metadata provider not registered.");
|
|
902
|
-
var
|
|
903
|
-
if (
|
|
904
|
-
if (!v(
|
|
902
|
+
var P = d(p, w);
|
|
903
|
+
if (P !== R) {
|
|
904
|
+
if (!v(P))
|
|
905
905
|
return !1;
|
|
906
|
-
var U =
|
|
907
|
-
v(U) && (U = new
|
|
906
|
+
var U = E.get(p);
|
|
907
|
+
v(U) && (U = new b(), E.set(p, U)), U.set(w, R);
|
|
908
908
|
}
|
|
909
909
|
return !0;
|
|
910
910
|
}
|
|
@@ -919,44 +919,44 @@ function Ze() {
|
|
|
919
919
|
}), n;
|
|
920
920
|
}
|
|
921
921
|
function Re(n) {
|
|
922
|
-
var o = new
|
|
922
|
+
var o = new X(), i = {
|
|
923
923
|
isProviderFor: function(l, h) {
|
|
924
924
|
var p = o.get(l);
|
|
925
925
|
return v(p) ? !1 : p.has(h);
|
|
926
926
|
},
|
|
927
927
|
OrdinaryDefineOwnMetadata: L,
|
|
928
|
-
OrdinaryHasOwnMetadata:
|
|
929
|
-
OrdinaryGetOwnMetadata:
|
|
928
|
+
OrdinaryHasOwnMetadata: E,
|
|
929
|
+
OrdinaryGetOwnMetadata: I,
|
|
930
930
|
OrdinaryOwnMetadataKeys: T,
|
|
931
931
|
OrdinaryDeleteMetadata: d
|
|
932
932
|
};
|
|
933
|
-
return
|
|
933
|
+
return ct.registerProvider(i), i;
|
|
934
934
|
function c(l, h, p) {
|
|
935
|
-
var w = o.get(l),
|
|
935
|
+
var w = o.get(l), R = !1;
|
|
936
936
|
if (v(w)) {
|
|
937
937
|
if (!p)
|
|
938
938
|
return;
|
|
939
|
-
w = new
|
|
939
|
+
w = new b(), o.set(l, w), R = !0;
|
|
940
940
|
}
|
|
941
|
-
var
|
|
942
|
-
if (v(
|
|
941
|
+
var P = w.get(h);
|
|
942
|
+
if (v(P)) {
|
|
943
943
|
if (!p)
|
|
944
944
|
return;
|
|
945
|
-
if (
|
|
946
|
-
throw w.delete(h),
|
|
945
|
+
if (P = new b(), w.set(h, P), !n.setProvider(l, h, i))
|
|
946
|
+
throw w.delete(h), R && o.delete(l), new Error("Wrong provider for target.");
|
|
947
947
|
}
|
|
948
|
-
return
|
|
948
|
+
return P;
|
|
949
949
|
}
|
|
950
|
-
function
|
|
950
|
+
function E(l, h, p) {
|
|
951
951
|
var w = c(
|
|
952
952
|
h,
|
|
953
953
|
p,
|
|
954
954
|
/*Create*/
|
|
955
955
|
!1
|
|
956
956
|
);
|
|
957
|
-
return v(w) ? !1 :
|
|
957
|
+
return v(w) ? !1 : Gt(w.has(l));
|
|
958
958
|
}
|
|
959
|
-
function
|
|
959
|
+
function I(l, h, p) {
|
|
960
960
|
var w = c(
|
|
961
961
|
h,
|
|
962
962
|
p,
|
|
@@ -967,13 +967,13 @@ function Ze() {
|
|
|
967
967
|
return w.get(l);
|
|
968
968
|
}
|
|
969
969
|
function L(l, h, p, w) {
|
|
970
|
-
var
|
|
970
|
+
var R = c(
|
|
971
971
|
p,
|
|
972
972
|
w,
|
|
973
973
|
/*Create*/
|
|
974
974
|
!0
|
|
975
975
|
);
|
|
976
|
-
|
|
976
|
+
R.set(l, h);
|
|
977
977
|
}
|
|
978
978
|
function T(l, h) {
|
|
979
979
|
var p = [], w = c(
|
|
@@ -984,16 +984,16 @@ function Ze() {
|
|
|
984
984
|
);
|
|
985
985
|
if (v(w))
|
|
986
986
|
return p;
|
|
987
|
-
for (var
|
|
988
|
-
var
|
|
989
|
-
if (!
|
|
987
|
+
for (var R = w.keys(), P = $t(R), U = 0; ; ) {
|
|
988
|
+
var Vt = Ft(P);
|
|
989
|
+
if (!Vt)
|
|
990
990
|
return p.length = U, p;
|
|
991
|
-
var Pe =
|
|
991
|
+
var Pe = Wt(Vt);
|
|
992
992
|
try {
|
|
993
993
|
p[U] = Pe;
|
|
994
994
|
} catch (Ne) {
|
|
995
995
|
try {
|
|
996
|
-
|
|
996
|
+
Qt(P);
|
|
997
997
|
} finally {
|
|
998
998
|
throw Ne;
|
|
999
999
|
}
|
|
@@ -1011,33 +1011,33 @@ function Ze() {
|
|
|
1011
1011
|
if (v(w) || !w.delete(l))
|
|
1012
1012
|
return !1;
|
|
1013
1013
|
if (w.size === 0) {
|
|
1014
|
-
var
|
|
1015
|
-
v(
|
|
1014
|
+
var R = o.get(h);
|
|
1015
|
+
v(R) || (R.delete(p), R.size === 0 && o.delete(R));
|
|
1016
1016
|
}
|
|
1017
1017
|
return !0;
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
1020
|
function Oe(n) {
|
|
1021
|
-
var o = n.defineMetadata, i = n.hasOwnMetadata, c = n.getOwnMetadata,
|
|
1021
|
+
var o = n.defineMetadata, i = n.hasOwnMetadata, c = n.getOwnMetadata, E = n.getOwnMetadataKeys, I = n.deleteMetadata, L = new X(), T = {
|
|
1022
1022
|
isProviderFor: function(d, l) {
|
|
1023
1023
|
var h = L.get(d);
|
|
1024
|
-
return !v(h) && h.has(l) ? !0 :
|
|
1024
|
+
return !v(h) && h.has(l) ? !0 : E(d, l).length ? (v(h) && (h = new O(), L.set(d, h)), h.add(l), !0) : !1;
|
|
1025
1025
|
},
|
|
1026
1026
|
OrdinaryDefineOwnMetadata: o,
|
|
1027
1027
|
OrdinaryHasOwnMetadata: i,
|
|
1028
1028
|
OrdinaryGetOwnMetadata: c,
|
|
1029
|
-
OrdinaryOwnMetadataKeys:
|
|
1030
|
-
OrdinaryDeleteMetadata:
|
|
1029
|
+
OrdinaryOwnMetadataKeys: E,
|
|
1030
|
+
OrdinaryDeleteMetadata: I
|
|
1031
1031
|
};
|
|
1032
1032
|
return T;
|
|
1033
1033
|
}
|
|
1034
|
-
function
|
|
1035
|
-
var c =
|
|
1034
|
+
function rt(n, o, i) {
|
|
1035
|
+
var c = ct.getProvider(n, o);
|
|
1036
1036
|
if (!v(c))
|
|
1037
1037
|
return c;
|
|
1038
1038
|
if (i) {
|
|
1039
|
-
if (
|
|
1040
|
-
return
|
|
1039
|
+
if (ct.setProvider(n, o, Pt))
|
|
1040
|
+
return Pt;
|
|
1041
1041
|
throw new Error("Illegal state.");
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
@@ -1050,7 +1050,7 @@ function Ze() {
|
|
|
1050
1050
|
}
|
|
1051
1051
|
return T.prototype["@@iterator"] = function() {
|
|
1052
1052
|
return this;
|
|
1053
|
-
}, T.prototype[
|
|
1053
|
+
}, T.prototype[y] = function() {
|
|
1054
1054
|
return this;
|
|
1055
1055
|
}, T.prototype.next = function() {
|
|
1056
1056
|
var d = this._index;
|
|
@@ -1106,26 +1106,26 @@ function Ze() {
|
|
|
1106
1106
|
if (l >= 0) {
|
|
1107
1107
|
for (var h = this._keys.length, p = l + 1; p < h; p++)
|
|
1108
1108
|
this._keys[p - 1] = this._keys[p], this._values[p - 1] = this._values[p];
|
|
1109
|
-
return this._keys.length--, this._values.length--,
|
|
1109
|
+
return this._keys.length--, this._values.length--, Tt(d, this._cacheKey) && (this._cacheKey = n, this._cacheIndex = -2), !0;
|
|
1110
1110
|
}
|
|
1111
1111
|
return !1;
|
|
1112
1112
|
}, T.prototype.clear = function() {
|
|
1113
1113
|
this._keys.length = 0, this._values.length = 0, this._cacheKey = n, this._cacheIndex = -2;
|
|
1114
1114
|
}, T.prototype.keys = function() {
|
|
1115
|
-
return new i(this._keys, this._values,
|
|
1115
|
+
return new i(this._keys, this._values, E);
|
|
1116
1116
|
}, T.prototype.values = function() {
|
|
1117
|
-
return new i(this._keys, this._values,
|
|
1117
|
+
return new i(this._keys, this._values, I);
|
|
1118
1118
|
}, T.prototype.entries = function() {
|
|
1119
1119
|
return new i(this._keys, this._values, L);
|
|
1120
1120
|
}, T.prototype["@@iterator"] = function() {
|
|
1121
1121
|
return this.entries();
|
|
1122
|
-
}, T.prototype[
|
|
1122
|
+
}, T.prototype[y] = function() {
|
|
1123
1123
|
return this.entries();
|
|
1124
1124
|
}, T.prototype._find = function(d, l) {
|
|
1125
|
-
if (!
|
|
1125
|
+
if (!Tt(this._cacheKey, d)) {
|
|
1126
1126
|
this._cacheIndex = -1;
|
|
1127
1127
|
for (var h = 0; h < this._keys.length; h++)
|
|
1128
|
-
if (
|
|
1128
|
+
if (Tt(this._keys[h], d)) {
|
|
1129
1129
|
this._cacheIndex = h;
|
|
1130
1130
|
break;
|
|
1131
1131
|
}
|
|
@@ -1135,10 +1135,10 @@ function Ze() {
|
|
|
1135
1135
|
})()
|
|
1136
1136
|
);
|
|
1137
1137
|
return c;
|
|
1138
|
-
function
|
|
1138
|
+
function E(T, d) {
|
|
1139
1139
|
return T;
|
|
1140
1140
|
}
|
|
1141
|
-
function
|
|
1141
|
+
function I(T, d) {
|
|
1142
1142
|
return d;
|
|
1143
1143
|
}
|
|
1144
1144
|
function L(T, d) {
|
|
@@ -1150,7 +1150,7 @@ function Ze() {
|
|
|
1150
1150
|
/** @class */
|
|
1151
1151
|
(function() {
|
|
1152
1152
|
function o() {
|
|
1153
|
-
this._map = new
|
|
1153
|
+
this._map = new b();
|
|
1154
1154
|
}
|
|
1155
1155
|
return Object.defineProperty(o.prototype, "size", {
|
|
1156
1156
|
get: function() {
|
|
@@ -1174,7 +1174,7 @@ function Ze() {
|
|
|
1174
1174
|
return this._map.entries();
|
|
1175
1175
|
}, o.prototype["@@iterator"] = function() {
|
|
1176
1176
|
return this.keys();
|
|
1177
|
-
}, o.prototype[
|
|
1177
|
+
}, o.prototype[y] = function() {
|
|
1178
1178
|
return this.keys();
|
|
1179
1179
|
}, o;
|
|
1180
1180
|
})()
|
|
@@ -1182,7 +1182,7 @@ function Ze() {
|
|
|
1182
1182
|
return n;
|
|
1183
1183
|
}
|
|
1184
1184
|
function Ie() {
|
|
1185
|
-
var n = 16, o =
|
|
1185
|
+
var n = 16, o = _.create(), i = c();
|
|
1186
1186
|
return (
|
|
1187
1187
|
/** @class */
|
|
1188
1188
|
(function() {
|
|
@@ -1190,28 +1190,28 @@ function Ze() {
|
|
|
1190
1190
|
this._key = c();
|
|
1191
1191
|
}
|
|
1192
1192
|
return d.prototype.has = function(l) {
|
|
1193
|
-
var h =
|
|
1193
|
+
var h = E(
|
|
1194
1194
|
l,
|
|
1195
1195
|
/*create*/
|
|
1196
1196
|
!1
|
|
1197
1197
|
);
|
|
1198
|
-
return h !== void 0 ?
|
|
1198
|
+
return h !== void 0 ? _.has(h, this._key) : !1;
|
|
1199
1199
|
}, d.prototype.get = function(l) {
|
|
1200
|
-
var h =
|
|
1200
|
+
var h = E(
|
|
1201
1201
|
l,
|
|
1202
1202
|
/*create*/
|
|
1203
1203
|
!1
|
|
1204
1204
|
);
|
|
1205
|
-
return h !== void 0 ?
|
|
1205
|
+
return h !== void 0 ? _.get(h, this._key) : void 0;
|
|
1206
1206
|
}, d.prototype.set = function(l, h) {
|
|
1207
|
-
var p =
|
|
1207
|
+
var p = E(
|
|
1208
1208
|
l,
|
|
1209
1209
|
/*create*/
|
|
1210
1210
|
!0
|
|
1211
1211
|
);
|
|
1212
1212
|
return p[this._key] = h, this;
|
|
1213
1213
|
}, d.prototype.delete = function(l) {
|
|
1214
|
-
var h =
|
|
1214
|
+
var h = E(
|
|
1215
1215
|
l,
|
|
1216
1216
|
/*create*/
|
|
1217
1217
|
!1
|
|
@@ -1226,18 +1226,18 @@ function Ze() {
|
|
|
1226
1226
|
var d;
|
|
1227
1227
|
do
|
|
1228
1228
|
d = "@@WeakMap@@" + T();
|
|
1229
|
-
while (
|
|
1229
|
+
while (_.has(o, d));
|
|
1230
1230
|
return o[d] = !0, d;
|
|
1231
1231
|
}
|
|
1232
|
-
function
|
|
1232
|
+
function E(d, l) {
|
|
1233
1233
|
if (!s.call(d, i)) {
|
|
1234
1234
|
if (!l)
|
|
1235
1235
|
return;
|
|
1236
|
-
Object.defineProperty(d, i, { value:
|
|
1236
|
+
Object.defineProperty(d, i, { value: _.create() });
|
|
1237
1237
|
}
|
|
1238
1238
|
return d[i];
|
|
1239
1239
|
}
|
|
1240
|
-
function
|
|
1240
|
+
function I(d, l) {
|
|
1241
1241
|
for (var h = 0; h < l; ++h)
|
|
1242
1242
|
d[h] = Math.random() * 255 | 0;
|
|
1243
1243
|
return d;
|
|
@@ -1245,9 +1245,9 @@ function Ze() {
|
|
|
1245
1245
|
function L(d) {
|
|
1246
1246
|
if (typeof Uint8Array == "function") {
|
|
1247
1247
|
var l = new Uint8Array(d);
|
|
1248
|
-
return typeof crypto < "u" ? crypto.getRandomValues(l) : typeof msCrypto < "u" ? msCrypto.getRandomValues(l) :
|
|
1248
|
+
return typeof crypto < "u" ? crypto.getRandomValues(l) : typeof msCrypto < "u" ? msCrypto.getRandomValues(l) : I(l, d), l;
|
|
1249
1249
|
}
|
|
1250
|
-
return
|
|
1250
|
+
return I(new Array(d), d);
|
|
1251
1251
|
}
|
|
1252
1252
|
function T() {
|
|
1253
1253
|
var d = L(n);
|
|
@@ -1259,15 +1259,15 @@ function Ze() {
|
|
|
1259
1259
|
return l;
|
|
1260
1260
|
}
|
|
1261
1261
|
}
|
|
1262
|
-
function
|
|
1262
|
+
function mt(n) {
|
|
1263
1263
|
return n.__ = void 0, delete n.__, n;
|
|
1264
1264
|
}
|
|
1265
1265
|
});
|
|
1266
|
-
})(t || (t = {})),
|
|
1266
|
+
})(t || (t = {})), Bt;
|
|
1267
1267
|
}
|
|
1268
1268
|
Ze();
|
|
1269
1269
|
const te = Symbol("endpoint:metadata");
|
|
1270
|
-
function
|
|
1270
|
+
function gt(t, e, r = {}) {
|
|
1271
1271
|
return function(a, s) {
|
|
1272
1272
|
const u = {
|
|
1273
1273
|
method: t,
|
|
@@ -1283,9 +1283,9 @@ function bt(t, e, r = {}) {
|
|
|
1283
1283
|
};
|
|
1284
1284
|
}
|
|
1285
1285
|
function q(t = "", e = {}) {
|
|
1286
|
-
return
|
|
1286
|
+
return gt(De.POST, t, e);
|
|
1287
1287
|
}
|
|
1288
|
-
var
|
|
1288
|
+
var Rt = /* @__PURE__ */ ((t) => (t.EXCHANGE = "Exchange", t.RESULT = "Result", t))(Rt || {});
|
|
1289
1289
|
const Ke = "__decorator_target__", tr = "__decorator_metadata__";
|
|
1290
1290
|
let er = class {
|
|
1291
1291
|
/**
|
|
@@ -1343,26 +1343,26 @@ let er = class {
|
|
|
1343
1343
|
resultExtractor: s,
|
|
1344
1344
|
attributes: a.attributes
|
|
1345
1345
|
});
|
|
1346
|
-
return u ===
|
|
1346
|
+
return u === Rt.EXCHANGE ? f : await f.extractResult();
|
|
1347
1347
|
}
|
|
1348
1348
|
};
|
|
1349
|
-
const
|
|
1349
|
+
const nt = /* @__PURE__ */ new WeakMap();
|
|
1350
1350
|
function rr(t) {
|
|
1351
1351
|
if (typeof t != "function")
|
|
1352
1352
|
throw new TypeError("Expected a function");
|
|
1353
|
-
if (
|
|
1354
|
-
return
|
|
1353
|
+
if (nt.has(t))
|
|
1354
|
+
return nt.get(t);
|
|
1355
1355
|
try {
|
|
1356
1356
|
const e = t.toString().trim(), r = or(e);
|
|
1357
1357
|
if (!ar(r)) {
|
|
1358
1358
|
const s = [];
|
|
1359
|
-
return
|
|
1359
|
+
return nt.set(t, s), s;
|
|
1360
1360
|
}
|
|
1361
1361
|
const a = ir(r);
|
|
1362
|
-
return
|
|
1362
|
+
return nt.set(t, a), a;
|
|
1363
1363
|
} catch {
|
|
1364
1364
|
const e = [];
|
|
1365
|
-
return
|
|
1365
|
+
return nt.set(t, e), e;
|
|
1366
1366
|
}
|
|
1367
1367
|
}
|
|
1368
1368
|
function nr(t, e, r, a) {
|
|
@@ -1383,15 +1383,15 @@ function ar(t) {
|
|
|
1383
1383
|
}
|
|
1384
1384
|
function or(t) {
|
|
1385
1385
|
if (t.startsWith("(")) {
|
|
1386
|
-
const a =
|
|
1386
|
+
const a = Jt(t, 0);
|
|
1387
1387
|
return a === -1 ? "" : t.substring(1, a);
|
|
1388
1388
|
}
|
|
1389
1389
|
const e = t.indexOf("(");
|
|
1390
1390
|
if (e === -1) return "";
|
|
1391
|
-
const r =
|
|
1391
|
+
const r = Jt(t, e);
|
|
1392
1392
|
return r === -1 ? "" : t.substring(e + 1, r);
|
|
1393
1393
|
}
|
|
1394
|
-
function
|
|
1394
|
+
function Jt(t, e) {
|
|
1395
1395
|
let r = 1;
|
|
1396
1396
|
for (let a = e + 1; a < t.length; a++) {
|
|
1397
1397
|
const s = t[a];
|
|
@@ -1423,22 +1423,22 @@ function dr(t) {
|
|
|
1423
1423
|
const e = t.indexOf(":");
|
|
1424
1424
|
return e !== -1 ? t.substring(0, e) : t;
|
|
1425
1425
|
}
|
|
1426
|
-
var
|
|
1427
|
-
const
|
|
1428
|
-
function
|
|
1426
|
+
var J = /* @__PURE__ */ ((t) => (t.PATH = "path", t.QUERY = "query", t.HEADER = "header", t.BODY = "body", t.REQUEST = "request", t.ATTRIBUTE = "attribute", t))(J || {});
|
|
1427
|
+
const _t = Symbol("parameter:metadata");
|
|
1428
|
+
function Ot(t, e = "") {
|
|
1429
1429
|
return function(r, a, s) {
|
|
1430
1430
|
const u = nr(
|
|
1431
1431
|
r,
|
|
1432
1432
|
a,
|
|
1433
1433
|
s,
|
|
1434
1434
|
e
|
|
1435
|
-
), f = Reflect.getMetadata(
|
|
1435
|
+
), f = Reflect.getMetadata(_t, r, a) || /* @__PURE__ */ new Map(), y = {
|
|
1436
1436
|
type: t,
|
|
1437
1437
|
name: u,
|
|
1438
1438
|
index: s
|
|
1439
1439
|
};
|
|
1440
|
-
f.set(s,
|
|
1441
|
-
|
|
1440
|
+
f.set(s, y), Reflect.defineMetadata(
|
|
1441
|
+
_t,
|
|
1442
1442
|
f,
|
|
1443
1443
|
r,
|
|
1444
1444
|
a
|
|
@@ -1446,19 +1446,19 @@ function Rt(t, e = "") {
|
|
|
1446
1446
|
};
|
|
1447
1447
|
}
|
|
1448
1448
|
function H() {
|
|
1449
|
-
return
|
|
1449
|
+
return Ot(
|
|
1450
1450
|
"body"
|
|
1451
1451
|
/* BODY */
|
|
1452
1452
|
);
|
|
1453
1453
|
}
|
|
1454
1454
|
function ee() {
|
|
1455
|
-
return
|
|
1455
|
+
return Ot(
|
|
1456
1456
|
"request"
|
|
1457
1457
|
/* REQUEST */
|
|
1458
1458
|
);
|
|
1459
1459
|
}
|
|
1460
1460
|
function j(t = "") {
|
|
1461
|
-
return
|
|
1461
|
+
return Ot("attribute", t);
|
|
1462
1462
|
}
|
|
1463
1463
|
let re = class {
|
|
1464
1464
|
/**
|
|
@@ -1508,11 +1508,11 @@ let re = class {
|
|
|
1508
1508
|
return this.endpoint.resultExtractor || this.api.resultExtractor || Ge;
|
|
1509
1509
|
}
|
|
1510
1510
|
resolveAttributes() {
|
|
1511
|
-
const e =
|
|
1512
|
-
return
|
|
1511
|
+
const e = St(this.api.attributes);
|
|
1512
|
+
return St(this.endpoint.attributes, e);
|
|
1513
1513
|
}
|
|
1514
1514
|
resolveEndpointReturnType() {
|
|
1515
|
-
return this.endpoint.returnType || this.api.returnType ||
|
|
1515
|
+
return this.endpoint.returnType || this.api.returnType || Rt.RESULT;
|
|
1516
1516
|
}
|
|
1517
1517
|
/**
|
|
1518
1518
|
* Resolves the request configuration from the method arguments.
|
|
@@ -1565,57 +1565,57 @@ let re = class {
|
|
|
1565
1565
|
...this.api.headers,
|
|
1566
1566
|
...this.endpoint.headers
|
|
1567
1567
|
};
|
|
1568
|
-
let u, f,
|
|
1568
|
+
let u, f, y, m = {};
|
|
1569
1569
|
const S = this.resolveAttributes();
|
|
1570
|
-
e.forEach((
|
|
1571
|
-
if (
|
|
1572
|
-
f =
|
|
1570
|
+
e.forEach((O, X) => {
|
|
1571
|
+
if (O instanceof AbortSignal) {
|
|
1572
|
+
f = O;
|
|
1573
1573
|
return;
|
|
1574
1574
|
}
|
|
1575
|
-
if (
|
|
1576
|
-
|
|
1575
|
+
if (O instanceof AbortController) {
|
|
1576
|
+
y = O;
|
|
1577
1577
|
return;
|
|
1578
1578
|
}
|
|
1579
|
-
const G = this.parameters.get(
|
|
1579
|
+
const G = this.parameters.get(X);
|
|
1580
1580
|
if (G)
|
|
1581
1581
|
switch (G.type) {
|
|
1582
|
-
case
|
|
1583
|
-
this.processPathParam(G,
|
|
1582
|
+
case J.PATH:
|
|
1583
|
+
this.processPathParam(G, O, r);
|
|
1584
1584
|
break;
|
|
1585
|
-
case
|
|
1586
|
-
this.processQueryParam(G,
|
|
1585
|
+
case J.QUERY:
|
|
1586
|
+
this.processQueryParam(G, O, a);
|
|
1587
1587
|
break;
|
|
1588
|
-
case
|
|
1589
|
-
this.processHeaderParam(G,
|
|
1588
|
+
case J.HEADER:
|
|
1589
|
+
this.processHeaderParam(G, O, s);
|
|
1590
1590
|
break;
|
|
1591
|
-
case
|
|
1592
|
-
u =
|
|
1591
|
+
case J.BODY:
|
|
1592
|
+
u = O;
|
|
1593
1593
|
break;
|
|
1594
|
-
case
|
|
1595
|
-
m = this.processRequestParam(
|
|
1594
|
+
case J.REQUEST:
|
|
1595
|
+
m = this.processRequestParam(O);
|
|
1596
1596
|
break;
|
|
1597
|
-
case
|
|
1598
|
-
this.processAttributeParam(G,
|
|
1597
|
+
case J.ATTRIBUTE:
|
|
1598
|
+
this.processAttributeParam(G, O, S);
|
|
1599
1599
|
break;
|
|
1600
1600
|
}
|
|
1601
1601
|
});
|
|
1602
|
-
const
|
|
1602
|
+
const M = {
|
|
1603
1603
|
path: r,
|
|
1604
1604
|
query: a
|
|
1605
|
-
},
|
|
1605
|
+
}, _ = {
|
|
1606
1606
|
method: this.endpoint.method,
|
|
1607
|
-
urlParams:
|
|
1607
|
+
urlParams: M,
|
|
1608
1608
|
headers: s,
|
|
1609
1609
|
body: u,
|
|
1610
1610
|
timeout: this.resolveTimeout(),
|
|
1611
1611
|
signal: f,
|
|
1612
|
-
abortController:
|
|
1613
|
-
},
|
|
1614
|
-
|
|
1612
|
+
abortController: y
|
|
1613
|
+
}, A = qe(
|
|
1614
|
+
_,
|
|
1615
1615
|
m
|
|
1616
|
-
),
|
|
1617
|
-
return
|
|
1618
|
-
request:
|
|
1616
|
+
), b = m.path;
|
|
1617
|
+
return A.url = this.resolvePath(b), {
|
|
1618
|
+
request: A,
|
|
1619
1619
|
attributes: S
|
|
1620
1620
|
};
|
|
1621
1621
|
}
|
|
@@ -1676,7 +1676,7 @@ let re = class {
|
|
|
1676
1676
|
}
|
|
1677
1677
|
processAttributeParam(e, r, a) {
|
|
1678
1678
|
if (typeof r == "object" || r instanceof Map) {
|
|
1679
|
-
|
|
1679
|
+
St(r, a);
|
|
1680
1680
|
return;
|
|
1681
1681
|
}
|
|
1682
1682
|
e.name && r !== void 0 && a.set(e.name, r);
|
|
@@ -1695,7 +1695,7 @@ function hr(t, e, r) {
|
|
|
1695
1695
|
if (!s)
|
|
1696
1696
|
return;
|
|
1697
1697
|
const u = Reflect.getMetadata(
|
|
1698
|
-
|
|
1698
|
+
_t,
|
|
1699
1699
|
t.prototype,
|
|
1700
1700
|
e
|
|
1701
1701
|
) || /* @__PURE__ */ new Map(), f = new re(
|
|
@@ -1704,11 +1704,11 @@ function hr(t, e, r) {
|
|
|
1704
1704
|
s,
|
|
1705
1705
|
u
|
|
1706
1706
|
);
|
|
1707
|
-
t.prototype[e] = async function(...
|
|
1707
|
+
t.prototype[e] = async function(...y) {
|
|
1708
1708
|
return await pr(
|
|
1709
1709
|
this,
|
|
1710
1710
|
f
|
|
1711
|
-
).execute(
|
|
1711
|
+
).execute(y);
|
|
1712
1712
|
};
|
|
1713
1713
|
}
|
|
1714
1714
|
function pr(t, e) {
|
|
@@ -1731,7 +1731,7 @@ function pr(t, e) {
|
|
|
1731
1731
|
)
|
|
1732
1732
|
), r.set(e.name, a), a;
|
|
1733
1733
|
}
|
|
1734
|
-
function
|
|
1734
|
+
function Mt(t = "", e = {}) {
|
|
1735
1735
|
return function(r) {
|
|
1736
1736
|
const a = {
|
|
1737
1737
|
basePath: t,
|
|
@@ -1748,12 +1748,12 @@ let yr = class extends Error {
|
|
|
1748
1748
|
}
|
|
1749
1749
|
};
|
|
1750
1750
|
const D = (...t) => new yr();
|
|
1751
|
-
var
|
|
1752
|
-
for (var s = a > 1 ? void 0 : a ?
|
|
1751
|
+
var Er = Object.defineProperty, vr = Object.getOwnPropertyDescriptor, At = (t, e, r, a) => {
|
|
1752
|
+
for (var s = a > 1 ? void 0 : a ? vr(e, r) : e, u = t.length - 1, f; u >= 0; u--)
|
|
1753
1753
|
(f = t[u]) && (s = (a ? f(e, r, s) : f(s)) || s);
|
|
1754
|
-
return a && s &&
|
|
1755
|
-
},
|
|
1756
|
-
let
|
|
1754
|
+
return a && s && Er(e, r, s), s;
|
|
1755
|
+
}, lt = (t, e) => (r, a) => e(r, a, t);
|
|
1756
|
+
let ht = class {
|
|
1757
1757
|
constructor(t) {
|
|
1758
1758
|
this.apiMetadata = t;
|
|
1759
1759
|
}
|
|
@@ -1764,24 +1764,24 @@ let lt = class {
|
|
|
1764
1764
|
throw D(t, e);
|
|
1765
1765
|
}
|
|
1766
1766
|
};
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
],
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
headers: { Accept:
|
|
1775
|
-
resultExtractor:
|
|
1767
|
+
At([
|
|
1768
|
+
gt(),
|
|
1769
|
+
lt(0, ee()),
|
|
1770
|
+
lt(1, j())
|
|
1771
|
+
], ht.prototype, "send", 1);
|
|
1772
|
+
At([
|
|
1773
|
+
gt(void 0, void 0, {
|
|
1774
|
+
headers: { Accept: ot.TEXT_EVENT_STREAM },
|
|
1775
|
+
resultExtractor: yt
|
|
1776
1776
|
}),
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
],
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
],
|
|
1777
|
+
lt(0, ee()),
|
|
1778
|
+
lt(1, j())
|
|
1779
|
+
], ht.prototype, "sendAndWaitStream", 1);
|
|
1780
|
+
ht = At([
|
|
1781
|
+
Mt()
|
|
1782
|
+
], ht);
|
|
1783
1783
|
var ne = /* @__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))(ne || {});
|
|
1784
|
-
function
|
|
1784
|
+
function It() {
|
|
1785
1785
|
return {
|
|
1786
1786
|
operator: ne.ALL
|
|
1787
1787
|
};
|
|
@@ -1791,7 +1791,7 @@ const ae = {
|
|
|
1791
1791
|
size: 10
|
|
1792
1792
|
};
|
|
1793
1793
|
function Tr({
|
|
1794
|
-
condition: t =
|
|
1794
|
+
condition: t = It(),
|
|
1795
1795
|
projection: e,
|
|
1796
1796
|
sort: r
|
|
1797
1797
|
} = {}) {
|
|
@@ -1802,7 +1802,7 @@ function Tr({
|
|
|
1802
1802
|
};
|
|
1803
1803
|
}
|
|
1804
1804
|
function wr({
|
|
1805
|
-
condition: t =
|
|
1805
|
+
condition: t = It(),
|
|
1806
1806
|
projection: e,
|
|
1807
1807
|
sort: r,
|
|
1808
1808
|
limit: a = ae.size
|
|
@@ -1815,7 +1815,7 @@ function wr({
|
|
|
1815
1815
|
};
|
|
1816
1816
|
}
|
|
1817
1817
|
function mr({
|
|
1818
|
-
condition: t =
|
|
1818
|
+
condition: t = It(),
|
|
1819
1819
|
projection: e,
|
|
1820
1820
|
sort: r,
|
|
1821
1821
|
pagination: a = ae
|
|
@@ -1830,13 +1830,13 @@ function mr({
|
|
|
1830
1830
|
const Y = class {
|
|
1831
1831
|
};
|
|
1832
1832
|
Y.EVENT_STREAM_RESOURCE_NAME = "event", Y.COUNT = `${Y.EVENT_STREAM_RESOURCE_NAME}/count`, Y.LIST = `${Y.EVENT_STREAM_RESOURCE_NAME}/list`, Y.PAGED = `${Y.EVENT_STREAM_RESOURCE_NAME}/paged`;
|
|
1833
|
-
let
|
|
1834
|
-
var Sr = Object.defineProperty, _r = Object.getOwnPropertyDescriptor,
|
|
1833
|
+
let Et = Y;
|
|
1834
|
+
var Sr = Object.defineProperty, _r = Object.getOwnPropertyDescriptor, ut = (t, e, r, a) => {
|
|
1835
1835
|
for (var s = a > 1 ? void 0 : a ? _r(e, r) : e, u = t.length - 1, f; u >= 0; u--)
|
|
1836
1836
|
(f = t[u]) && (s = (a ? f(e, r, s) : f(s)) || s);
|
|
1837
1837
|
return a && s && Sr(e, r, s), s;
|
|
1838
1838
|
}, B = (t, e) => (r, a) => e(r, a, t);
|
|
1839
|
-
let
|
|
1839
|
+
let et = class {
|
|
1840
1840
|
/**
|
|
1841
1841
|
* Creates a new EventStreamQueryClient instance.
|
|
1842
1842
|
*/
|
|
@@ -1856,41 +1856,41 @@ let K = class {
|
|
|
1856
1856
|
throw D(t, e);
|
|
1857
1857
|
}
|
|
1858
1858
|
};
|
|
1859
|
-
|
|
1860
|
-
q(
|
|
1859
|
+
ut([
|
|
1860
|
+
q(Et.COUNT),
|
|
1861
1861
|
B(0, H()),
|
|
1862
1862
|
B(1, j())
|
|
1863
|
-
],
|
|
1864
|
-
|
|
1865
|
-
q(
|
|
1863
|
+
], et.prototype, "count", 1);
|
|
1864
|
+
ut([
|
|
1865
|
+
q(Et.LIST),
|
|
1866
1866
|
B(0, H()),
|
|
1867
1867
|
B(1, j())
|
|
1868
|
-
],
|
|
1869
|
-
|
|
1870
|
-
q(
|
|
1871
|
-
headers: { Accept:
|
|
1872
|
-
resultExtractor:
|
|
1868
|
+
], et.prototype, "list", 1);
|
|
1869
|
+
ut([
|
|
1870
|
+
q(Et.LIST, {
|
|
1871
|
+
headers: { Accept: ot.TEXT_EVENT_STREAM },
|
|
1872
|
+
resultExtractor: yt
|
|
1873
1873
|
}),
|
|
1874
1874
|
B(0, H()),
|
|
1875
1875
|
B(1, j())
|
|
1876
|
-
],
|
|
1877
|
-
|
|
1878
|
-
q(
|
|
1876
|
+
], et.prototype, "listStream", 1);
|
|
1877
|
+
ut([
|
|
1878
|
+
q(Et.PAGED),
|
|
1879
1879
|
B(0, H()),
|
|
1880
1880
|
B(1, j())
|
|
1881
|
-
],
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
],
|
|
1885
|
-
const
|
|
1881
|
+
], et.prototype, "paged", 1);
|
|
1882
|
+
et = ut([
|
|
1883
|
+
Mt()
|
|
1884
|
+
], et);
|
|
1885
|
+
const k = class {
|
|
1886
1886
|
};
|
|
1887
|
-
|
|
1888
|
-
let V =
|
|
1887
|
+
k.SNAPSHOT_RESOURCE_NAME = "snapshot", k.COUNT = `${k.SNAPSHOT_RESOURCE_NAME}/count`, k.LIST = `${k.SNAPSHOT_RESOURCE_NAME}/list`, k.LIST_STATE = `${k.LIST}/state`, k.PAGED = `${k.SNAPSHOT_RESOURCE_NAME}/paged`, k.PAGED_STATE = `${k.PAGED}/state`, k.SINGLE = `${k.SNAPSHOT_RESOURCE_NAME}/single`, k.SINGLE_STATE = `${k.SINGLE}/state`;
|
|
1888
|
+
let V = k;
|
|
1889
1889
|
var br = Object.defineProperty, gr = Object.getOwnPropertyDescriptor, Q = (t, e, r, a) => {
|
|
1890
1890
|
for (var s = a > 1 ? void 0 : a ? gr(e, r) : e, u = t.length - 1, f; u >= 0; u--)
|
|
1891
1891
|
(f = t[u]) && (s = (a ? f(e, r, s) : f(s)) || s);
|
|
1892
1892
|
return a && s && br(e, r, s), s;
|
|
1893
|
-
},
|
|
1893
|
+
}, x = (t, e) => (r, a) => e(r, a, t);
|
|
1894
1894
|
let $ = class {
|
|
1895
1895
|
/**
|
|
1896
1896
|
* Creates a new SnapshotQueryClient instance.
|
|
@@ -1928,123 +1928,135 @@ let $ = class {
|
|
|
1928
1928
|
};
|
|
1929
1929
|
Q([
|
|
1930
1930
|
q(V.COUNT),
|
|
1931
|
-
|
|
1932
|
-
|
|
1931
|
+
x(0, H()),
|
|
1932
|
+
x(1, j())
|
|
1933
1933
|
], $.prototype, "count", 1);
|
|
1934
1934
|
Q([
|
|
1935
1935
|
q(V.LIST),
|
|
1936
|
-
|
|
1937
|
-
|
|
1936
|
+
x(0, H()),
|
|
1937
|
+
x(1, j())
|
|
1938
1938
|
], $.prototype, "list", 1);
|
|
1939
1939
|
Q([
|
|
1940
1940
|
q(V.LIST, {
|
|
1941
|
-
headers: { Accept:
|
|
1942
|
-
resultExtractor:
|
|
1941
|
+
headers: { Accept: ot.TEXT_EVENT_STREAM },
|
|
1942
|
+
resultExtractor: yt
|
|
1943
1943
|
}),
|
|
1944
|
-
|
|
1945
|
-
|
|
1944
|
+
x(0, H()),
|
|
1945
|
+
x(1, j())
|
|
1946
1946
|
], $.prototype, "listStream", 1);
|
|
1947
1947
|
Q([
|
|
1948
1948
|
q(V.LIST_STATE),
|
|
1949
|
-
|
|
1950
|
-
|
|
1949
|
+
x(0, H()),
|
|
1950
|
+
x(1, j())
|
|
1951
1951
|
], $.prototype, "listState", 1);
|
|
1952
1952
|
Q([
|
|
1953
1953
|
q(V.LIST_STATE, {
|
|
1954
|
-
headers: { Accept:
|
|
1955
|
-
resultExtractor:
|
|
1954
|
+
headers: { Accept: ot.TEXT_EVENT_STREAM },
|
|
1955
|
+
resultExtractor: yt
|
|
1956
1956
|
}),
|
|
1957
|
-
|
|
1958
|
-
|
|
1957
|
+
x(0, H()),
|
|
1958
|
+
x(1, j())
|
|
1959
1959
|
], $.prototype, "listStateStream", 1);
|
|
1960
1960
|
Q([
|
|
1961
1961
|
q(V.PAGED),
|
|
1962
|
-
|
|
1963
|
-
|
|
1962
|
+
x(0, H()),
|
|
1963
|
+
x(1, j())
|
|
1964
1964
|
], $.prototype, "paged", 1);
|
|
1965
1965
|
Q([
|
|
1966
1966
|
q(V.PAGED_STATE),
|
|
1967
|
-
|
|
1968
|
-
|
|
1967
|
+
x(0, H()),
|
|
1968
|
+
x(1, j())
|
|
1969
1969
|
], $.prototype, "pagedState", 1);
|
|
1970
1970
|
Q([
|
|
1971
1971
|
q(V.SINGLE),
|
|
1972
|
-
|
|
1973
|
-
|
|
1972
|
+
x(0, H()),
|
|
1973
|
+
x(1, j())
|
|
1974
1974
|
], $.prototype, "single", 1);
|
|
1975
1975
|
Q([
|
|
1976
1976
|
q(V.SINGLE_STATE),
|
|
1977
|
-
|
|
1978
|
-
|
|
1977
|
+
x(0, H()),
|
|
1978
|
+
x(1, j())
|
|
1979
1979
|
], $.prototype, "singleState", 1);
|
|
1980
1980
|
$ = Q([
|
|
1981
|
-
|
|
1981
|
+
Mt()
|
|
1982
1982
|
], $);
|
|
1983
1983
|
function qr(t) {
|
|
1984
|
-
const { initialQuery: e } = t, r =
|
|
1985
|
-
const
|
|
1984
|
+
const { initialQuery: e } = t, r = it(t), [a, s] = C(e.condition), [u, f] = C(e.pagination), [y, m] = C(e.projection), [S, M] = C(e.sort), _ = Z(t), A = g(async () => {
|
|
1985
|
+
const X = mr({
|
|
1986
1986
|
condition: a,
|
|
1987
1987
|
pagination: u,
|
|
1988
|
-
projection:
|
|
1988
|
+
projection: y,
|
|
1989
1989
|
sort: S
|
|
1990
1990
|
});
|
|
1991
|
-
return
|
|
1992
|
-
|
|
1993
|
-
|
|
1991
|
+
return _.current.query(
|
|
1992
|
+
X,
|
|
1993
|
+
_.current.attributes
|
|
1994
1994
|
);
|
|
1995
|
-
}, [a,
|
|
1996
|
-
return
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
1995
|
+
}, [a, y, u, S, _]), b = g(() => r.execute(A), [r, A]), { autoExecute: O } = t;
|
|
1996
|
+
return z(() => {
|
|
1997
|
+
O && b();
|
|
1998
|
+
}, [O, b]), F(
|
|
1999
|
+
() => ({
|
|
2000
|
+
...r,
|
|
2001
|
+
execute: b,
|
|
2002
|
+
setCondition: s,
|
|
2003
|
+
setProjection: m,
|
|
2004
|
+
setPagination: f,
|
|
2005
|
+
setSort: M
|
|
2006
|
+
}),
|
|
2007
|
+
[
|
|
2008
|
+
r,
|
|
2009
|
+
b,
|
|
2010
|
+
s,
|
|
2011
|
+
m,
|
|
2012
|
+
f,
|
|
2013
|
+
M
|
|
2014
|
+
]
|
|
2015
|
+
);
|
|
2011
2016
|
}
|
|
2012
2017
|
function Hr(t) {
|
|
2013
|
-
const { initialQuery: e } = t, r =
|
|
2014
|
-
const
|
|
2018
|
+
const { initialQuery: e } = t, r = it(t), [a, s] = C(e.condition), [u, f] = C(e.projection), [y, m] = C(e.sort), S = Z(t), M = g(async () => {
|
|
2019
|
+
const b = Tr({
|
|
2015
2020
|
condition: a,
|
|
2016
2021
|
projection: u,
|
|
2017
|
-
sort:
|
|
2022
|
+
sort: y
|
|
2018
2023
|
});
|
|
2019
2024
|
return S.current.query(
|
|
2020
|
-
|
|
2025
|
+
b,
|
|
2021
2026
|
S.current.attributes
|
|
2022
2027
|
);
|
|
2023
|
-
}, [a, u,
|
|
2024
|
-
return
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2028
|
+
}, [a, u, y, S]), _ = g(() => r.execute(M), [r, M]), { autoExecute: A } = t;
|
|
2029
|
+
return z(() => {
|
|
2030
|
+
A && _();
|
|
2031
|
+
}, [A, _]), F(
|
|
2032
|
+
() => ({
|
|
2033
|
+
...r,
|
|
2034
|
+
execute: _,
|
|
2035
|
+
setCondition: s,
|
|
2036
|
+
setProjection: f,
|
|
2037
|
+
setSort: m
|
|
2038
|
+
}),
|
|
2039
|
+
[r, _, s, f, m]
|
|
2040
|
+
);
|
|
2031
2041
|
}
|
|
2032
2042
|
function Ur(t) {
|
|
2033
|
-
const { initialCondition: e } = t, r =
|
|
2043
|
+
const { initialCondition: e } = t, r = it(t), [a, s] = C(e), u = Z(t), f = g(async () => u.current.count(
|
|
2034
2044
|
a,
|
|
2035
2045
|
u.current.attributes
|
|
2036
|
-
), [a, u]),
|
|
2037
|
-
return
|
|
2046
|
+
), [a, u]), y = g(() => r.execute(f), [r, f]), { autoExecute: m } = t;
|
|
2047
|
+
return z(() => {
|
|
2048
|
+
m && y();
|
|
2049
|
+
}, [m, y]), F(
|
|
2038
2050
|
() => ({
|
|
2039
2051
|
...r,
|
|
2040
|
-
execute:
|
|
2052
|
+
execute: y,
|
|
2041
2053
|
setCondition: s
|
|
2042
2054
|
}),
|
|
2043
|
-
[r,
|
|
2055
|
+
[r, y, s]
|
|
2044
2056
|
);
|
|
2045
2057
|
}
|
|
2046
2058
|
function oe(t) {
|
|
2047
|
-
const { initialQuery: e } = t, [r, a] = C(e.condition), [s, u] = C(e.projection), [f,
|
|
2059
|
+
const { initialQuery: e } = t, [r, a] = C(e.condition), [s, u] = C(e.projection), [f, y] = C(e.sort), [m, S] = C(e.limit), M = g(() => wr({
|
|
2048
2060
|
condition: r,
|
|
2049
2061
|
projection: s,
|
|
2050
2062
|
sort: f,
|
|
@@ -2058,9 +2070,9 @@ function oe(t) {
|
|
|
2058
2070
|
limit: m,
|
|
2059
2071
|
setCondition: a,
|
|
2060
2072
|
setProjection: u,
|
|
2061
|
-
setSort:
|
|
2073
|
+
setSort: y,
|
|
2062
2074
|
setLimit: S,
|
|
2063
|
-
buildQuery:
|
|
2075
|
+
buildQuery: M
|
|
2064
2076
|
}),
|
|
2065
2077
|
[
|
|
2066
2078
|
r,
|
|
@@ -2069,21 +2081,23 @@ function oe(t) {
|
|
|
2069
2081
|
m,
|
|
2070
2082
|
a,
|
|
2071
2083
|
u,
|
|
2072
|
-
|
|
2084
|
+
y,
|
|
2073
2085
|
S,
|
|
2074
|
-
|
|
2086
|
+
M
|
|
2075
2087
|
]
|
|
2076
2088
|
);
|
|
2077
2089
|
}
|
|
2078
2090
|
function $r(t) {
|
|
2079
|
-
const e =
|
|
2080
|
-
const
|
|
2091
|
+
const e = it(t), r = oe({ initialQuery: t.initialQuery }), a = Z(t), s = g(async () => {
|
|
2092
|
+
const y = r.buildQuery();
|
|
2081
2093
|
return a.current.list(
|
|
2082
|
-
|
|
2094
|
+
y,
|
|
2083
2095
|
a.current.attributes
|
|
2084
2096
|
);
|
|
2085
|
-
}, [r, a]), u =
|
|
2086
|
-
return
|
|
2097
|
+
}, [r, a]), u = g(() => e.execute(s), [e, s]), { autoExecute: f } = t;
|
|
2098
|
+
return z(() => {
|
|
2099
|
+
f && u();
|
|
2100
|
+
}, [f, u]), F(
|
|
2087
2101
|
() => ({
|
|
2088
2102
|
...e,
|
|
2089
2103
|
execute: u,
|
|
@@ -2103,14 +2117,16 @@ function $r(t) {
|
|
|
2103
2117
|
);
|
|
2104
2118
|
}
|
|
2105
2119
|
function Wr(t) {
|
|
2106
|
-
const e =
|
|
2107
|
-
const
|
|
2120
|
+
const e = it(t), r = oe({ initialQuery: t.initialQuery }), a = Z(t), s = g(async () => {
|
|
2121
|
+
const y = r.buildQuery();
|
|
2108
2122
|
return a.current.listStream(
|
|
2109
|
-
|
|
2123
|
+
y,
|
|
2110
2124
|
a.current.attributes
|
|
2111
2125
|
);
|
|
2112
|
-
}, [r, a]), u =
|
|
2113
|
-
return
|
|
2126
|
+
}, [r, a]), u = g(() => e.execute(s), [e, s]), { autoExecute: f } = t;
|
|
2127
|
+
return z(() => {
|
|
2128
|
+
f && u();
|
|
2129
|
+
}, [f, u]), F(
|
|
2114
2130
|
() => ({
|
|
2115
2131
|
...e,
|
|
2116
2132
|
execute: u,
|
|
@@ -2132,13 +2148,13 @@ function Wr(t) {
|
|
|
2132
2148
|
export {
|
|
2133
2149
|
He as PromiseStatus,
|
|
2134
2150
|
Ur as useCountQuery,
|
|
2135
|
-
|
|
2151
|
+
it as useExecutePromise,
|
|
2136
2152
|
Ar as useFetcher,
|
|
2137
2153
|
Mr as useKeyStorage,
|
|
2138
|
-
|
|
2154
|
+
Z as useLatest,
|
|
2139
2155
|
$r as useListQuery,
|
|
2140
2156
|
Wr as useListStreamQuery,
|
|
2141
|
-
|
|
2157
|
+
bt as useMounted,
|
|
2142
2158
|
qr as usePagedQuery,
|
|
2143
2159
|
Zt as usePromiseState,
|
|
2144
2160
|
Kt as useRequestId,
|