@yourrentals/cloudevent-receiver-hapi 0.1.4
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/index.d.ts +3 -0
- package/index.js +16 -0
- package/index.mjs +2908 -0
- package/lib/cloud-event-receiver-plugin.d.ts +10 -0
- package/package.json +8 -0
package/index.mjs
ADDED
|
@@ -0,0 +1,2908 @@
|
|
|
1
|
+
class ue extends Error {
|
|
2
|
+
constructor(t, r, a) {
|
|
3
|
+
super(), this.statusCode = t, this.isRetryable = r, this.isReceiverError = !0, this.message = a, this.name = "HTTPError";
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
class Mr extends ue {
|
|
7
|
+
constructor(t = "InvalidSignatureError") {
|
|
8
|
+
super(401, !1, t), this.name = "InvalidSignatureError";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
class $r extends ue {
|
|
12
|
+
constructor(t = "UnparseableMessageError") {
|
|
13
|
+
super(400, !1, t), this.name = "UnparseableMessageError";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
class Fr extends ue {
|
|
17
|
+
constructor(t = "NotFoundError") {
|
|
18
|
+
super(404, !0, t), this.name = "NotFoundError";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
class xa extends ue {
|
|
22
|
+
constructor(t = "ConflictError") {
|
|
23
|
+
super(409, !0, t), this.name = "ConflictError";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
class ei extends ue {
|
|
27
|
+
constructor(t = "TooManyRequestsError") {
|
|
28
|
+
super(429, !0, t), this.name = "TooManyRequestsError";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
class ti extends ue {
|
|
32
|
+
constructor(t = "ClientError") {
|
|
33
|
+
super(400, !1, t), this.name = "ClientError";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
class Hr extends ue {
|
|
37
|
+
constructor(t = "ServerError") {
|
|
38
|
+
super(500, !1, t), this.name = "ServerError";
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function Zt(e) {
|
|
42
|
+
return e.isReceiverError;
|
|
43
|
+
}
|
|
44
|
+
const ri = (e) => ({
|
|
45
|
+
name: "cloud-event-receiver-plugin",
|
|
46
|
+
register: async function(t, r) {
|
|
47
|
+
const a = e.pathPrefix.startsWith("/") ? e.pathPrefix : "/" + e.pathPrefix;
|
|
48
|
+
t.route({
|
|
49
|
+
method: "POST",
|
|
50
|
+
path: `${a}/{queueName}`,
|
|
51
|
+
handler: async (n, i) => {
|
|
52
|
+
try {
|
|
53
|
+
const o = n.params.queueName;
|
|
54
|
+
return await e.receiver.handle(
|
|
55
|
+
o,
|
|
56
|
+
n.headers,
|
|
57
|
+
n.payload
|
|
58
|
+
), i.response().code(200);
|
|
59
|
+
} catch (o) {
|
|
60
|
+
return Zt(o) ? i.response().code(o.statusCode).message(o.message) : i.response().code(500).message("Internal Server Error");
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
var L = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
67
|
+
function xt(e) {
|
|
68
|
+
if (e.__esModule)
|
|
69
|
+
return e;
|
|
70
|
+
var t = e.default;
|
|
71
|
+
if (typeof t == "function") {
|
|
72
|
+
var r = function a() {
|
|
73
|
+
if (this instanceof a) {
|
|
74
|
+
var n = [null];
|
|
75
|
+
n.push.apply(n, arguments);
|
|
76
|
+
var i = Function.bind.apply(t, n);
|
|
77
|
+
return new i();
|
|
78
|
+
}
|
|
79
|
+
return t.apply(this, arguments);
|
|
80
|
+
};
|
|
81
|
+
r.prototype = t.prototype;
|
|
82
|
+
} else
|
|
83
|
+
r = {};
|
|
84
|
+
return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(e).forEach(function(a) {
|
|
85
|
+
var n = Object.getOwnPropertyDescriptor(e, a);
|
|
86
|
+
Object.defineProperty(r, a, n.get ? n : {
|
|
87
|
+
enumerable: !0,
|
|
88
|
+
get: function() {
|
|
89
|
+
return e[a];
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}), r;
|
|
93
|
+
}
|
|
94
|
+
var Ke = {}, Qe = {}, Ie, zr = new Uint8Array(16);
|
|
95
|
+
function er() {
|
|
96
|
+
if (!Ie && (Ie = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto < "u" && typeof msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto), !Ie))
|
|
97
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
98
|
+
return Ie(zr);
|
|
99
|
+
}
|
|
100
|
+
const Lr = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
101
|
+
function ke(e) {
|
|
102
|
+
return typeof e == "string" && Lr.test(e);
|
|
103
|
+
}
|
|
104
|
+
var Y = [];
|
|
105
|
+
for (var Xe = 0; Xe < 256; ++Xe)
|
|
106
|
+
Y.push((Xe + 256).toString(16).substr(1));
|
|
107
|
+
function Ve(e) {
|
|
108
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, r = (Y[e[t + 0]] + Y[e[t + 1]] + Y[e[t + 2]] + Y[e[t + 3]] + "-" + Y[e[t + 4]] + Y[e[t + 5]] + "-" + Y[e[t + 6]] + Y[e[t + 7]] + "-" + Y[e[t + 8]] + Y[e[t + 9]] + "-" + Y[e[t + 10]] + Y[e[t + 11]] + Y[e[t + 12]] + Y[e[t + 13]] + Y[e[t + 14]] + Y[e[t + 15]]).toLowerCase();
|
|
109
|
+
if (!ke(r))
|
|
110
|
+
throw TypeError("Stringified UUID is invalid");
|
|
111
|
+
return r;
|
|
112
|
+
}
|
|
113
|
+
var jt, Ze, xe = 0, et = 0;
|
|
114
|
+
function kr(e, t, r) {
|
|
115
|
+
var a = t && r || 0, n = t || new Array(16);
|
|
116
|
+
e = e || {};
|
|
117
|
+
var i = e.node || jt, o = e.clockseq !== void 0 ? e.clockseq : Ze;
|
|
118
|
+
if (i == null || o == null) {
|
|
119
|
+
var s = e.random || (e.rng || er)();
|
|
120
|
+
i == null && (i = jt = [s[0] | 1, s[1], s[2], s[3], s[4], s[5]]), o == null && (o = Ze = (s[6] << 8 | s[7]) & 16383);
|
|
121
|
+
}
|
|
122
|
+
var d = e.msecs !== void 0 ? e.msecs : Date.now(), u = e.nsecs !== void 0 ? e.nsecs : et + 1, c = d - xe + (u - et) / 1e4;
|
|
123
|
+
if (c < 0 && e.clockseq === void 0 && (o = o + 1 & 16383), (c < 0 || d > xe) && e.nsecs === void 0 && (u = 0), u >= 1e4)
|
|
124
|
+
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
|
|
125
|
+
xe = d, et = u, Ze = o, d += 122192928e5;
|
|
126
|
+
var E = ((d & 268435455) * 1e4 + u) % 4294967296;
|
|
127
|
+
n[a++] = E >>> 24 & 255, n[a++] = E >>> 16 & 255, n[a++] = E >>> 8 & 255, n[a++] = E & 255;
|
|
128
|
+
var S = d / 4294967296 * 1e4 & 268435455;
|
|
129
|
+
n[a++] = S >>> 8 & 255, n[a++] = S & 255, n[a++] = S >>> 24 & 15 | 16, n[a++] = S >>> 16 & 255, n[a++] = o >>> 8 | 128, n[a++] = o & 255;
|
|
130
|
+
for (var g = 0; g < 6; ++g)
|
|
131
|
+
n[a + g] = i[g];
|
|
132
|
+
return t || Ve(n);
|
|
133
|
+
}
|
|
134
|
+
function tr(e) {
|
|
135
|
+
if (!ke(e))
|
|
136
|
+
throw TypeError("Invalid UUID");
|
|
137
|
+
var t, r = new Uint8Array(16);
|
|
138
|
+
return r[0] = (t = parseInt(e.slice(0, 8), 16)) >>> 24, r[1] = t >>> 16 & 255, r[2] = t >>> 8 & 255, r[3] = t & 255, r[4] = (t = parseInt(e.slice(9, 13), 16)) >>> 8, r[5] = t & 255, r[6] = (t = parseInt(e.slice(14, 18), 16)) >>> 8, r[7] = t & 255, r[8] = (t = parseInt(e.slice(19, 23), 16)) >>> 8, r[9] = t & 255, r[10] = (t = parseInt(e.slice(24, 36), 16)) / 1099511627776 & 255, r[11] = t / 4294967296 & 255, r[12] = t >>> 24 & 255, r[13] = t >>> 16 & 255, r[14] = t >>> 8 & 255, r[15] = t & 255, r;
|
|
139
|
+
}
|
|
140
|
+
function Vr(e) {
|
|
141
|
+
e = unescape(encodeURIComponent(e));
|
|
142
|
+
for (var t = [], r = 0; r < e.length; ++r)
|
|
143
|
+
t.push(e.charCodeAt(r));
|
|
144
|
+
return t;
|
|
145
|
+
}
|
|
146
|
+
var Yr = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", Jr = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
|
|
147
|
+
function rr(e, t, r) {
|
|
148
|
+
function a(n, i, o, s) {
|
|
149
|
+
if (typeof n == "string" && (n = Vr(n)), typeof i == "string" && (i = tr(i)), i.length !== 16)
|
|
150
|
+
throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
|
|
151
|
+
var d = new Uint8Array(16 + n.length);
|
|
152
|
+
if (d.set(i), d.set(n, i.length), d = r(d), d[6] = d[6] & 15 | t, d[8] = d[8] & 63 | 128, o) {
|
|
153
|
+
s = s || 0;
|
|
154
|
+
for (var u = 0; u < 16; ++u)
|
|
155
|
+
o[s + u] = d[u];
|
|
156
|
+
return o;
|
|
157
|
+
}
|
|
158
|
+
return Ve(d);
|
|
159
|
+
}
|
|
160
|
+
try {
|
|
161
|
+
a.name = e;
|
|
162
|
+
} catch {
|
|
163
|
+
}
|
|
164
|
+
return a.DNS = Yr, a.URL = Jr, a;
|
|
165
|
+
}
|
|
166
|
+
function qr(e) {
|
|
167
|
+
if (typeof e == "string") {
|
|
168
|
+
var t = unescape(encodeURIComponent(e));
|
|
169
|
+
e = new Uint8Array(t.length);
|
|
170
|
+
for (var r = 0; r < t.length; ++r)
|
|
171
|
+
e[r] = t.charCodeAt(r);
|
|
172
|
+
}
|
|
173
|
+
return Gr(Wr(Kr(e), e.length * 8));
|
|
174
|
+
}
|
|
175
|
+
function Gr(e) {
|
|
176
|
+
for (var t = [], r = e.length * 32, a = "0123456789abcdef", n = 0; n < r; n += 8) {
|
|
177
|
+
var i = e[n >> 5] >>> n % 32 & 255, o = parseInt(a.charAt(i >>> 4 & 15) + a.charAt(i & 15), 16);
|
|
178
|
+
t.push(o);
|
|
179
|
+
}
|
|
180
|
+
return t;
|
|
181
|
+
}
|
|
182
|
+
function nr(e) {
|
|
183
|
+
return (e + 64 >>> 9 << 4) + 14 + 1;
|
|
184
|
+
}
|
|
185
|
+
function Wr(e, t) {
|
|
186
|
+
e[t >> 5] |= 128 << t % 32, e[nr(t) - 1] = t;
|
|
187
|
+
for (var r = 1732584193, a = -271733879, n = -1732584194, i = 271733878, o = 0; o < e.length; o += 16) {
|
|
188
|
+
var s = r, d = a, u = n, c = i;
|
|
189
|
+
r = q(r, a, n, i, e[o], 7, -680876936), i = q(i, r, a, n, e[o + 1], 12, -389564586), n = q(n, i, r, a, e[o + 2], 17, 606105819), a = q(a, n, i, r, e[o + 3], 22, -1044525330), r = q(r, a, n, i, e[o + 4], 7, -176418897), i = q(i, r, a, n, e[o + 5], 12, 1200080426), n = q(n, i, r, a, e[o + 6], 17, -1473231341), a = q(a, n, i, r, e[o + 7], 22, -45705983), r = q(r, a, n, i, e[o + 8], 7, 1770035416), i = q(i, r, a, n, e[o + 9], 12, -1958414417), n = q(n, i, r, a, e[o + 10], 17, -42063), a = q(a, n, i, r, e[o + 11], 22, -1990404162), r = q(r, a, n, i, e[o + 12], 7, 1804603682), i = q(i, r, a, n, e[o + 13], 12, -40341101), n = q(n, i, r, a, e[o + 14], 17, -1502002290), a = q(a, n, i, r, e[o + 15], 22, 1236535329), r = G(r, a, n, i, e[o + 1], 5, -165796510), i = G(i, r, a, n, e[o + 6], 9, -1069501632), n = G(n, i, r, a, e[o + 11], 14, 643717713), a = G(a, n, i, r, e[o], 20, -373897302), r = G(r, a, n, i, e[o + 5], 5, -701558691), i = G(i, r, a, n, e[o + 10], 9, 38016083), n = G(n, i, r, a, e[o + 15], 14, -660478335), a = G(a, n, i, r, e[o + 4], 20, -405537848), r = G(r, a, n, i, e[o + 9], 5, 568446438), i = G(i, r, a, n, e[o + 14], 9, -1019803690), n = G(n, i, r, a, e[o + 3], 14, -187363961), a = G(a, n, i, r, e[o + 8], 20, 1163531501), r = G(r, a, n, i, e[o + 13], 5, -1444681467), i = G(i, r, a, n, e[o + 2], 9, -51403784), n = G(n, i, r, a, e[o + 7], 14, 1735328473), a = G(a, n, i, r, e[o + 12], 20, -1926607734), r = W(r, a, n, i, e[o + 5], 4, -378558), i = W(i, r, a, n, e[o + 8], 11, -2022574463), n = W(n, i, r, a, e[o + 11], 16, 1839030562), a = W(a, n, i, r, e[o + 14], 23, -35309556), r = W(r, a, n, i, e[o + 1], 4, -1530992060), i = W(i, r, a, n, e[o + 4], 11, 1272893353), n = W(n, i, r, a, e[o + 7], 16, -155497632), a = W(a, n, i, r, e[o + 10], 23, -1094730640), r = W(r, a, n, i, e[o + 13], 4, 681279174), i = W(i, r, a, n, e[o], 11, -358537222), n = W(n, i, r, a, e[o + 3], 16, -722521979), a = W(a, n, i, r, e[o + 6], 23, 76029189), r = W(r, a, n, i, e[o + 9], 4, -640364487), i = W(i, r, a, n, e[o + 12], 11, -421815835), n = W(n, i, r, a, e[o + 15], 16, 530742520), a = W(a, n, i, r, e[o + 2], 23, -995338651), r = K(r, a, n, i, e[o], 6, -198630844), i = K(i, r, a, n, e[o + 7], 10, 1126891415), n = K(n, i, r, a, e[o + 14], 15, -1416354905), a = K(a, n, i, r, e[o + 5], 21, -57434055), r = K(r, a, n, i, e[o + 12], 6, 1700485571), i = K(i, r, a, n, e[o + 3], 10, -1894986606), n = K(n, i, r, a, e[o + 10], 15, -1051523), a = K(a, n, i, r, e[o + 1], 21, -2054922799), r = K(r, a, n, i, e[o + 8], 6, 1873313359), i = K(i, r, a, n, e[o + 15], 10, -30611744), n = K(n, i, r, a, e[o + 6], 15, -1560198380), a = K(a, n, i, r, e[o + 13], 21, 1309151649), r = K(r, a, n, i, e[o + 4], 6, -145523070), i = K(i, r, a, n, e[o + 11], 10, -1120210379), n = K(n, i, r, a, e[o + 2], 15, 718787259), a = K(a, n, i, r, e[o + 9], 21, -343485551), r = re(r, s), a = re(a, d), n = re(n, u), i = re(i, c);
|
|
190
|
+
}
|
|
191
|
+
return [r, a, n, i];
|
|
192
|
+
}
|
|
193
|
+
function Kr(e) {
|
|
194
|
+
if (e.length === 0)
|
|
195
|
+
return [];
|
|
196
|
+
for (var t = e.length * 8, r = new Uint32Array(nr(t)), a = 0; a < t; a += 8)
|
|
197
|
+
r[a >> 5] |= (e[a / 8] & 255) << a % 32;
|
|
198
|
+
return r;
|
|
199
|
+
}
|
|
200
|
+
function re(e, t) {
|
|
201
|
+
var r = (e & 65535) + (t & 65535), a = (e >> 16) + (t >> 16) + (r >> 16);
|
|
202
|
+
return a << 16 | r & 65535;
|
|
203
|
+
}
|
|
204
|
+
function Qr(e, t) {
|
|
205
|
+
return e << t | e >>> 32 - t;
|
|
206
|
+
}
|
|
207
|
+
function Ye(e, t, r, a, n, i) {
|
|
208
|
+
return re(Qr(re(re(t, e), re(a, i)), n), r);
|
|
209
|
+
}
|
|
210
|
+
function q(e, t, r, a, n, i, o) {
|
|
211
|
+
return Ye(t & r | ~t & a, e, t, n, i, o);
|
|
212
|
+
}
|
|
213
|
+
function G(e, t, r, a, n, i, o) {
|
|
214
|
+
return Ye(t & a | r & ~a, e, t, n, i, o);
|
|
215
|
+
}
|
|
216
|
+
function W(e, t, r, a, n, i, o) {
|
|
217
|
+
return Ye(t ^ r ^ a, e, t, n, i, o);
|
|
218
|
+
}
|
|
219
|
+
function K(e, t, r, a, n, i, o) {
|
|
220
|
+
return Ye(r ^ (t | ~a), e, t, n, i, o);
|
|
221
|
+
}
|
|
222
|
+
var Xr = rr("v3", 48, qr);
|
|
223
|
+
const Zr = Xr;
|
|
224
|
+
function xr(e, t, r) {
|
|
225
|
+
e = e || {};
|
|
226
|
+
var a = e.random || (e.rng || er)();
|
|
227
|
+
if (a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, t) {
|
|
228
|
+
r = r || 0;
|
|
229
|
+
for (var n = 0; n < 16; ++n)
|
|
230
|
+
t[r + n] = a[n];
|
|
231
|
+
return t;
|
|
232
|
+
}
|
|
233
|
+
return Ve(a);
|
|
234
|
+
}
|
|
235
|
+
function en(e, t, r, a) {
|
|
236
|
+
switch (e) {
|
|
237
|
+
case 0:
|
|
238
|
+
return t & r ^ ~t & a;
|
|
239
|
+
case 1:
|
|
240
|
+
return t ^ r ^ a;
|
|
241
|
+
case 2:
|
|
242
|
+
return t & r ^ t & a ^ r & a;
|
|
243
|
+
case 3:
|
|
244
|
+
return t ^ r ^ a;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
function tt(e, t) {
|
|
248
|
+
return e << t | e >>> 32 - t;
|
|
249
|
+
}
|
|
250
|
+
function tn(e) {
|
|
251
|
+
var t = [1518500249, 1859775393, 2400959708, 3395469782], r = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
|
|
252
|
+
if (typeof e == "string") {
|
|
253
|
+
var a = unescape(encodeURIComponent(e));
|
|
254
|
+
e = [];
|
|
255
|
+
for (var n = 0; n < a.length; ++n)
|
|
256
|
+
e.push(a.charCodeAt(n));
|
|
257
|
+
} else
|
|
258
|
+
Array.isArray(e) || (e = Array.prototype.slice.call(e));
|
|
259
|
+
e.push(128);
|
|
260
|
+
for (var i = e.length / 4 + 2, o = Math.ceil(i / 16), s = new Array(o), d = 0; d < o; ++d) {
|
|
261
|
+
for (var u = new Uint32Array(16), c = 0; c < 16; ++c)
|
|
262
|
+
u[c] = e[d * 64 + c * 4] << 24 | e[d * 64 + c * 4 + 1] << 16 | e[d * 64 + c * 4 + 2] << 8 | e[d * 64 + c * 4 + 3];
|
|
263
|
+
s[d] = u;
|
|
264
|
+
}
|
|
265
|
+
s[o - 1][14] = (e.length - 1) * 8 / Math.pow(2, 32), s[o - 1][14] = Math.floor(s[o - 1][14]), s[o - 1][15] = (e.length - 1) * 8 & 4294967295;
|
|
266
|
+
for (var E = 0; E < o; ++E) {
|
|
267
|
+
for (var S = new Uint32Array(80), g = 0; g < 16; ++g)
|
|
268
|
+
S[g] = s[E][g];
|
|
269
|
+
for (var l = 16; l < 80; ++l)
|
|
270
|
+
S[l] = tt(S[l - 3] ^ S[l - 8] ^ S[l - 14] ^ S[l - 16], 1);
|
|
271
|
+
for (var h = r[0], A = r[1], _ = r[2], C = r[3], $ = r[4], k = 0; k < 80; ++k) {
|
|
272
|
+
var z = Math.floor(k / 20), I = tt(h, 5) + en(z, A, _, C) + $ + t[z] + S[k] >>> 0;
|
|
273
|
+
$ = C, C = _, _ = tt(A, 30) >>> 0, A = h, h = I;
|
|
274
|
+
}
|
|
275
|
+
r[0] = r[0] + h >>> 0, r[1] = r[1] + A >>> 0, r[2] = r[2] + _ >>> 0, r[3] = r[3] + C >>> 0, r[4] = r[4] + $ >>> 0;
|
|
276
|
+
}
|
|
277
|
+
return [r[0] >> 24 & 255, r[0] >> 16 & 255, r[0] >> 8 & 255, r[0] & 255, r[1] >> 24 & 255, r[1] >> 16 & 255, r[1] >> 8 & 255, r[1] & 255, r[2] >> 24 & 255, r[2] >> 16 & 255, r[2] >> 8 & 255, r[2] & 255, r[3] >> 24 & 255, r[3] >> 16 & 255, r[3] >> 8 & 255, r[3] & 255, r[4] >> 24 & 255, r[4] >> 16 & 255, r[4] >> 8 & 255, r[4] & 255];
|
|
278
|
+
}
|
|
279
|
+
var rn = rr("v5", 80, tn);
|
|
280
|
+
const nn = rn, an = "00000000-0000-0000-0000-000000000000";
|
|
281
|
+
function on(e) {
|
|
282
|
+
if (!ke(e))
|
|
283
|
+
throw TypeError("Invalid UUID");
|
|
284
|
+
return parseInt(e.substr(14, 1), 16);
|
|
285
|
+
}
|
|
286
|
+
const sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
287
|
+
__proto__: null,
|
|
288
|
+
NIL: an,
|
|
289
|
+
parse: tr,
|
|
290
|
+
stringify: Ve,
|
|
291
|
+
v1: kr,
|
|
292
|
+
v3: Zr,
|
|
293
|
+
v4: xr,
|
|
294
|
+
v5: nn,
|
|
295
|
+
validate: ke,
|
|
296
|
+
version: on
|
|
297
|
+
}, Symbol.toStringTag, { value: "Module" })), fn = /* @__PURE__ */ xt(sn);
|
|
298
|
+
var _e = {}, ce = {};
|
|
299
|
+
(function(e) {
|
|
300
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.isValidType = e.asData = e.isJsonContentType = e.clone = e.asBase64 = e.base64AsBinary = e.asBuffer = e.isBuffer = e.isBase64 = e.equalsOrThrow = e.isStringOrObjectOrThrow = e.isDefinedOrThrow = e.isStringOrThrow = e.isBinary = e.isDate = e.isInteger = e.isBoolean = e.isDefined = e.isObject = e.isString = e.ValidationError = void 0;
|
|
301
|
+
const t = function() {
|
|
302
|
+
try {
|
|
303
|
+
return globalThis;
|
|
304
|
+
} catch {
|
|
305
|
+
try {
|
|
306
|
+
return self;
|
|
307
|
+
} catch {
|
|
308
|
+
return L;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}();
|
|
312
|
+
class r extends TypeError {
|
|
313
|
+
constructor(w, m) {
|
|
314
|
+
const O = m instanceof Array ? (
|
|
315
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
316
|
+
// @ts-ignore
|
|
317
|
+
m == null ? void 0 : m.reduce((H, j) => H.concat(`
|
|
318
|
+
${j instanceof Object ? JSON.stringify(j) : j}`), w)
|
|
319
|
+
) : w;
|
|
320
|
+
super(O), this.errors = m || [];
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
e.ValidationError = r;
|
|
324
|
+
const a = (v) => typeof v == "string";
|
|
325
|
+
e.isString = a;
|
|
326
|
+
const n = (v) => typeof v == "object";
|
|
327
|
+
e.isObject = n;
|
|
328
|
+
const i = (v) => v !== null && typeof v < "u";
|
|
329
|
+
e.isDefined = i;
|
|
330
|
+
const o = (v) => typeof v == "boolean";
|
|
331
|
+
e.isBoolean = o;
|
|
332
|
+
const s = (v) => Number.isInteger(v);
|
|
333
|
+
e.isInteger = s;
|
|
334
|
+
const d = (v) => v instanceof Date;
|
|
335
|
+
e.isDate = d;
|
|
336
|
+
const u = (v) => ArrayBuffer.isView(v);
|
|
337
|
+
e.isBinary = u;
|
|
338
|
+
const c = (v, w) => (0, e.isString)(v) ? !0 : (() => {
|
|
339
|
+
throw w;
|
|
340
|
+
})();
|
|
341
|
+
e.isStringOrThrow = c;
|
|
342
|
+
const E = (v, w) => (0, e.isDefined)(v) ? !0 : (() => {
|
|
343
|
+
throw w;
|
|
344
|
+
})();
|
|
345
|
+
e.isDefinedOrThrow = E;
|
|
346
|
+
const S = (v, w) => (0, e.isString)(v) || (0, e.isObject)(v) ? !0 : (() => {
|
|
347
|
+
throw w;
|
|
348
|
+
})();
|
|
349
|
+
e.isStringOrObjectOrThrow = S;
|
|
350
|
+
const g = (v, w, m) => v === w ? !0 : (() => {
|
|
351
|
+
throw m;
|
|
352
|
+
})();
|
|
353
|
+
e.equalsOrThrow = g;
|
|
354
|
+
const l = (v) => Buffer.from(v, "base64").toString("base64") === v;
|
|
355
|
+
e.isBase64 = l;
|
|
356
|
+
const h = (v) => v instanceof Buffer;
|
|
357
|
+
e.isBuffer = h;
|
|
358
|
+
const A = (v) => (0, e.isBinary)(v) ? Buffer.from(v) : (0, e.isBuffer)(v) ? v : (() => {
|
|
359
|
+
throw new TypeError("is not buffer or a valid binary");
|
|
360
|
+
})();
|
|
361
|
+
e.asBuffer = A;
|
|
362
|
+
const _ = (v) => {
|
|
363
|
+
const w = (m) => t.atob ? t.atob(m) : Buffer.from(m, "base64").toString("binary");
|
|
364
|
+
return Uint8Array.from(w(v), (m) => m.charCodeAt(0));
|
|
365
|
+
};
|
|
366
|
+
e.base64AsBinary = _;
|
|
367
|
+
const C = (v) => (0, e.asBuffer)(v).toString("base64");
|
|
368
|
+
e.asBase64 = C;
|
|
369
|
+
const $ = (v) => JSON.parse(JSON.stringify(v));
|
|
370
|
+
e.clone = $;
|
|
371
|
+
const k = (v) => v && v.match(/(json)/i);
|
|
372
|
+
e.isJsonContentType = k;
|
|
373
|
+
const z = (v, w) => {
|
|
374
|
+
const m = (0, e.isString)(v) && !(0, e.isBase64)(v) && (0, e.isJsonContentType)(w) ? JSON.parse(v) : v;
|
|
375
|
+
return (0, e.isBinary)(m) ? (0, e.asBase64)(m) : m;
|
|
376
|
+
};
|
|
377
|
+
e.asData = z;
|
|
378
|
+
const I = (v) => (0, e.isBoolean)(v) || (0, e.isInteger)(v) || (0, e.isString)(v) || (0, e.isDate)(v) || (0, e.isBinary)(v) || (0, e.isObject)(v);
|
|
379
|
+
e.isValidType = I;
|
|
380
|
+
})(ce);
|
|
381
|
+
var St = { exports: {} }, mt = {};
|
|
382
|
+
Object.defineProperty(mt, "__esModule", { value: !0 });
|
|
383
|
+
function ar(e) {
|
|
384
|
+
const t = e.length;
|
|
385
|
+
let r = 0, a = 0, n;
|
|
386
|
+
for (; a < t; )
|
|
387
|
+
r++, n = e.charCodeAt(a++), n >= 55296 && n <= 56319 && a < t && (n = e.charCodeAt(a), (n & 64512) === 56320 && a++);
|
|
388
|
+
return r;
|
|
389
|
+
}
|
|
390
|
+
mt.default = ar;
|
|
391
|
+
ar.code = 'require("ajv/dist/runtime/ucs2length").default';
|
|
392
|
+
var At = {};
|
|
393
|
+
(function(e) {
|
|
394
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.formatNames = e.fastFormats = e.fullFormats = void 0;
|
|
395
|
+
function t(m, O) {
|
|
396
|
+
return { validate: m, compare: O };
|
|
397
|
+
}
|
|
398
|
+
e.fullFormats = {
|
|
399
|
+
// date: http://tools.ietf.org/html/rfc3339#section-5.6
|
|
400
|
+
date: t(i, o),
|
|
401
|
+
// date-time: http://tools.ietf.org/html/rfc3339#section-5.6
|
|
402
|
+
time: t(d, u),
|
|
403
|
+
"date-time": t(E, S),
|
|
404
|
+
// duration: https://tools.ietf.org/html/rfc3339#appendix-A
|
|
405
|
+
duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,
|
|
406
|
+
uri: h,
|
|
407
|
+
"uri-reference": /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,
|
|
408
|
+
// uri-template: https://tools.ietf.org/html/rfc6570
|
|
409
|
+
"uri-template": /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,
|
|
410
|
+
// For the source: https://gist.github.com/dperini/729294
|
|
411
|
+
// For test cases: https://mathiasbynens.be/demo/url-regex
|
|
412
|
+
url: /^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,
|
|
413
|
+
email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
|
|
414
|
+
hostname: /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,
|
|
415
|
+
// optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
|
|
416
|
+
ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
|
|
417
|
+
ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,
|
|
418
|
+
regex: w,
|
|
419
|
+
// uuid: http://tools.ietf.org/html/rfc4122
|
|
420
|
+
uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,
|
|
421
|
+
// JSON-pointer: https://tools.ietf.org/html/rfc6901
|
|
422
|
+
// uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
|
|
423
|
+
"json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/,
|
|
424
|
+
"json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,
|
|
425
|
+
// relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
|
|
426
|
+
"relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,
|
|
427
|
+
// the following formats are used by the openapi specification: https://spec.openapis.org/oas/v3.0.0#data-types
|
|
428
|
+
// byte: https://github.com/miguelmota/is-base64
|
|
429
|
+
byte: _,
|
|
430
|
+
// signed 32 bit integer
|
|
431
|
+
int32: { type: "number", validate: k },
|
|
432
|
+
// signed 64 bit integer
|
|
433
|
+
int64: { type: "number", validate: z },
|
|
434
|
+
// C-type float
|
|
435
|
+
float: { type: "number", validate: I },
|
|
436
|
+
// C-type double
|
|
437
|
+
double: { type: "number", validate: I },
|
|
438
|
+
// hint to the UI to hide input strings
|
|
439
|
+
password: !0,
|
|
440
|
+
// unchecked string payload
|
|
441
|
+
binary: !0
|
|
442
|
+
}, e.fastFormats = {
|
|
443
|
+
...e.fullFormats,
|
|
444
|
+
date: t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, o),
|
|
445
|
+
time: t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, u),
|
|
446
|
+
"date-time": t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, S),
|
|
447
|
+
// uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
|
|
448
|
+
uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
|
|
449
|
+
"uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
|
|
450
|
+
// email (sources from jsen validator):
|
|
451
|
+
// http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
|
|
452
|
+
// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation')
|
|
453
|
+
email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i
|
|
454
|
+
}, e.formatNames = Object.keys(e.fullFormats);
|
|
455
|
+
function r(m) {
|
|
456
|
+
return m % 4 === 0 && (m % 100 !== 0 || m % 400 === 0);
|
|
457
|
+
}
|
|
458
|
+
const a = /^(\d\d\d\d)-(\d\d)-(\d\d)$/, n = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
459
|
+
function i(m) {
|
|
460
|
+
const O = a.exec(m);
|
|
461
|
+
if (!O)
|
|
462
|
+
return !1;
|
|
463
|
+
const H = +O[1], j = +O[2], Z = +O[3];
|
|
464
|
+
return j >= 1 && j <= 12 && Z >= 1 && Z <= (j === 2 && r(H) ? 29 : n[j]);
|
|
465
|
+
}
|
|
466
|
+
function o(m, O) {
|
|
467
|
+
if (m && O)
|
|
468
|
+
return m > O ? 1 : m < O ? -1 : 0;
|
|
469
|
+
}
|
|
470
|
+
const s = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;
|
|
471
|
+
function d(m, O) {
|
|
472
|
+
const H = s.exec(m);
|
|
473
|
+
if (!H)
|
|
474
|
+
return !1;
|
|
475
|
+
const j = +H[1], Z = +H[2], X = +H[3], x = H[5];
|
|
476
|
+
return (j <= 23 && Z <= 59 && X <= 59 || j === 23 && Z === 59 && X === 60) && (!O || x !== "");
|
|
477
|
+
}
|
|
478
|
+
function u(m, O) {
|
|
479
|
+
if (!(m && O))
|
|
480
|
+
return;
|
|
481
|
+
const H = s.exec(m), j = s.exec(O);
|
|
482
|
+
if (H && j)
|
|
483
|
+
return m = H[1] + H[2] + H[3] + (H[4] || ""), O = j[1] + j[2] + j[3] + (j[4] || ""), m > O ? 1 : m < O ? -1 : 0;
|
|
484
|
+
}
|
|
485
|
+
const c = /t|\s/i;
|
|
486
|
+
function E(m) {
|
|
487
|
+
const O = m.split(c);
|
|
488
|
+
return O.length === 2 && i(O[0]) && d(O[1], !0);
|
|
489
|
+
}
|
|
490
|
+
function S(m, O) {
|
|
491
|
+
if (!(m && O))
|
|
492
|
+
return;
|
|
493
|
+
const [H, j] = m.split(c), [Z, X] = O.split(c), x = o(H, Z);
|
|
494
|
+
if (x !== void 0)
|
|
495
|
+
return x || u(j, X);
|
|
496
|
+
}
|
|
497
|
+
const g = /\/|:/, l = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
498
|
+
function h(m) {
|
|
499
|
+
return g.test(m) && l.test(m);
|
|
500
|
+
}
|
|
501
|
+
const A = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
|
|
502
|
+
function _(m) {
|
|
503
|
+
return A.lastIndex = 0, A.test(m);
|
|
504
|
+
}
|
|
505
|
+
const C = -(2 ** 31), $ = 2 ** 31 - 1;
|
|
506
|
+
function k(m) {
|
|
507
|
+
return Number.isInteger(m) && m <= $ && m >= C;
|
|
508
|
+
}
|
|
509
|
+
function z(m) {
|
|
510
|
+
return Number.isInteger(m);
|
|
511
|
+
}
|
|
512
|
+
function I() {
|
|
513
|
+
return !0;
|
|
514
|
+
}
|
|
515
|
+
const v = /[^\\]\\Z/;
|
|
516
|
+
function w(m) {
|
|
517
|
+
if (v.test(m))
|
|
518
|
+
return !1;
|
|
519
|
+
try {
|
|
520
|
+
return new RegExp(m), !0;
|
|
521
|
+
} catch {
|
|
522
|
+
return !1;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
})(At);
|
|
526
|
+
St.exports = F;
|
|
527
|
+
St.exports.default = F;
|
|
528
|
+
const un = { type: ["string", "null"], minLength: 1 }, cn = { type: ["string", "null"], format: "uri", minLength: 1 }, dn = { type: ["string", "null"], minLength: 1 }, ln = { type: ["string", "null"], format: "date-time", minLength: 1 }, yn = { type: ["object", "string", "number", "array", "boolean", "null"] }, pn = { type: ["string", "null"], contentEncoding: "base64" }, te = mt.default, En = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i, Tn = At.fullFormats.uri, hn = At.fullFormats["date-time"];
|
|
529
|
+
function F(e, { instancePath: t = "", parentData: r, parentDataProperty: a, rootData: n = e } = {}) {
|
|
530
|
+
let i = null, o = 0;
|
|
531
|
+
if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
532
|
+
let d;
|
|
533
|
+
if (e.id === void 0 && (d = "id") || e.source === void 0 && (d = "source") || e.specversion === void 0 && (d = "specversion") || e.type === void 0 && (d = "type"))
|
|
534
|
+
return F.errors = [{ instancePath: t, schemaPath: "#/required", keyword: "required", params: { missingProperty: d }, message: "must have required property '" + d + "'" }], !1;
|
|
535
|
+
if (e.id !== void 0) {
|
|
536
|
+
let u = e.id;
|
|
537
|
+
const c = o;
|
|
538
|
+
if (typeof u == "string") {
|
|
539
|
+
if (te(u) < 1)
|
|
540
|
+
return F.errors = [{ instancePath: t + "/id", schemaPath: "#/definitions/iddef/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], !1;
|
|
541
|
+
} else
|
|
542
|
+
return F.errors = [{ instancePath: t + "/id", schemaPath: "#/definitions/iddef/type", keyword: "type", params: { type: "string" }, message: "must be string" }], !1;
|
|
543
|
+
var s = c === o;
|
|
544
|
+
} else
|
|
545
|
+
var s = !0;
|
|
546
|
+
if (s) {
|
|
547
|
+
if (e.source !== void 0) {
|
|
548
|
+
let u = e.source;
|
|
549
|
+
const c = o;
|
|
550
|
+
if (typeof u == "string") {
|
|
551
|
+
if (te(u) < 1)
|
|
552
|
+
return F.errors = [{ instancePath: t + "/source", schemaPath: "#/definitions/sourcedef/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], !1;
|
|
553
|
+
if (!En.test(u))
|
|
554
|
+
return F.errors = [{ instancePath: t + "/source", schemaPath: "#/definitions/sourcedef/format", keyword: "format", params: { format: "uri-reference" }, message: 'must match format "uri-reference"' }], !1;
|
|
555
|
+
} else
|
|
556
|
+
return F.errors = [{ instancePath: t + "/source", schemaPath: "#/definitions/sourcedef/type", keyword: "type", params: { type: "string" }, message: "must be string" }], !1;
|
|
557
|
+
var s = c === o;
|
|
558
|
+
} else
|
|
559
|
+
var s = !0;
|
|
560
|
+
if (s) {
|
|
561
|
+
if (e.specversion !== void 0) {
|
|
562
|
+
let u = e.specversion;
|
|
563
|
+
const c = o;
|
|
564
|
+
if (typeof u == "string") {
|
|
565
|
+
if (te(u) < 1)
|
|
566
|
+
return F.errors = [{ instancePath: t + "/specversion", schemaPath: "#/definitions/specversiondef/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], !1;
|
|
567
|
+
} else
|
|
568
|
+
return F.errors = [{ instancePath: t + "/specversion", schemaPath: "#/definitions/specversiondef/type", keyword: "type", params: { type: "string" }, message: "must be string" }], !1;
|
|
569
|
+
var s = c === o;
|
|
570
|
+
} else
|
|
571
|
+
var s = !0;
|
|
572
|
+
if (s) {
|
|
573
|
+
if (e.type !== void 0) {
|
|
574
|
+
let u = e.type;
|
|
575
|
+
const c = o;
|
|
576
|
+
if (typeof u == "string") {
|
|
577
|
+
if (te(u) < 1)
|
|
578
|
+
return F.errors = [{ instancePath: t + "/type", schemaPath: "#/definitions/typedef/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], !1;
|
|
579
|
+
} else
|
|
580
|
+
return F.errors = [{ instancePath: t + "/type", schemaPath: "#/definitions/typedef/type", keyword: "type", params: { type: "string" }, message: "must be string" }], !1;
|
|
581
|
+
var s = c === o;
|
|
582
|
+
} else
|
|
583
|
+
var s = !0;
|
|
584
|
+
if (s) {
|
|
585
|
+
if (e.datacontenttype !== void 0) {
|
|
586
|
+
let u = e.datacontenttype;
|
|
587
|
+
const c = o;
|
|
588
|
+
if (typeof u != "string" && u !== null)
|
|
589
|
+
return F.errors = [{ instancePath: t + "/datacontenttype", schemaPath: "#/definitions/datacontenttypedef/type", keyword: "type", params: { type: un.type }, message: "must be string,null" }], !1;
|
|
590
|
+
if (typeof u == "string" && te(u) < 1)
|
|
591
|
+
return F.errors = [{ instancePath: t + "/datacontenttype", schemaPath: "#/definitions/datacontenttypedef/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], !1;
|
|
592
|
+
var s = c === o;
|
|
593
|
+
} else
|
|
594
|
+
var s = !0;
|
|
595
|
+
if (s) {
|
|
596
|
+
if (e.dataschema !== void 0) {
|
|
597
|
+
let u = e.dataschema;
|
|
598
|
+
const c = o;
|
|
599
|
+
if (typeof u != "string" && u !== null)
|
|
600
|
+
return F.errors = [{ instancePath: t + "/dataschema", schemaPath: "#/definitions/dataschemadef/type", keyword: "type", params: { type: cn.type }, message: "must be string,null" }], !1;
|
|
601
|
+
if (typeof u == "string") {
|
|
602
|
+
if (te(u) < 1)
|
|
603
|
+
return F.errors = [{ instancePath: t + "/dataschema", schemaPath: "#/definitions/dataschemadef/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], !1;
|
|
604
|
+
if (!Tn(u))
|
|
605
|
+
return F.errors = [{ instancePath: t + "/dataschema", schemaPath: "#/definitions/dataschemadef/format", keyword: "format", params: { format: "uri" }, message: 'must match format "uri"' }], !1;
|
|
606
|
+
}
|
|
607
|
+
var s = c === o;
|
|
608
|
+
} else
|
|
609
|
+
var s = !0;
|
|
610
|
+
if (s) {
|
|
611
|
+
if (e.subject !== void 0) {
|
|
612
|
+
let u = e.subject;
|
|
613
|
+
const c = o;
|
|
614
|
+
if (typeof u != "string" && u !== null)
|
|
615
|
+
return F.errors = [{ instancePath: t + "/subject", schemaPath: "#/definitions/subjectdef/type", keyword: "type", params: { type: dn.type }, message: "must be string,null" }], !1;
|
|
616
|
+
if (typeof u == "string" && te(u) < 1)
|
|
617
|
+
return F.errors = [{ instancePath: t + "/subject", schemaPath: "#/definitions/subjectdef/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], !1;
|
|
618
|
+
var s = c === o;
|
|
619
|
+
} else
|
|
620
|
+
var s = !0;
|
|
621
|
+
if (s) {
|
|
622
|
+
if (e.time !== void 0) {
|
|
623
|
+
let u = e.time;
|
|
624
|
+
const c = o;
|
|
625
|
+
if (typeof u != "string" && u !== null)
|
|
626
|
+
return F.errors = [{ instancePath: t + "/time", schemaPath: "#/definitions/timedef/type", keyword: "type", params: { type: ln.type }, message: "must be string,null" }], !1;
|
|
627
|
+
if (typeof u == "string") {
|
|
628
|
+
if (te(u) < 1)
|
|
629
|
+
return F.errors = [{ instancePath: t + "/time", schemaPath: "#/definitions/timedef/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], !1;
|
|
630
|
+
if (!hn.validate(u))
|
|
631
|
+
return F.errors = [{ instancePath: t + "/time", schemaPath: "#/definitions/timedef/format", keyword: "format", params: { format: "date-time" }, message: 'must match format "date-time"' }], !1;
|
|
632
|
+
}
|
|
633
|
+
var s = c === o;
|
|
634
|
+
} else
|
|
635
|
+
var s = !0;
|
|
636
|
+
if (s) {
|
|
637
|
+
if (e.data !== void 0) {
|
|
638
|
+
let u = e.data;
|
|
639
|
+
const c = o;
|
|
640
|
+
if (typeof u != "object" && typeof u != "string" && !(typeof u == "number" && isFinite(u)) && typeof u != "boolean")
|
|
641
|
+
return F.errors = [{ instancePath: t + "/data", schemaPath: "#/definitions/datadef/type", keyword: "type", params: { type: yn.type }, message: "must be object,string,number,array,boolean,null" }], !1;
|
|
642
|
+
var s = c === o;
|
|
643
|
+
} else
|
|
644
|
+
var s = !0;
|
|
645
|
+
if (s)
|
|
646
|
+
if (e.data_base64 !== void 0) {
|
|
647
|
+
let u = e.data_base64;
|
|
648
|
+
const c = o;
|
|
649
|
+
if (typeof u != "string" && u !== null)
|
|
650
|
+
return F.errors = [{ instancePath: t + "/data_base64", schemaPath: "#/definitions/data_base64def/type", keyword: "type", params: { type: pn.type }, message: "must be string,null" }], !1;
|
|
651
|
+
var s = c === o;
|
|
652
|
+
} else
|
|
653
|
+
var s = !0;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
} else
|
|
663
|
+
return F.errors = [{ instancePath: t, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], !1;
|
|
664
|
+
return F.errors = i, o === 0;
|
|
665
|
+
}
|
|
666
|
+
var vn = St.exports, Ut;
|
|
667
|
+
function Sn() {
|
|
668
|
+
if (Ut)
|
|
669
|
+
return _e;
|
|
670
|
+
Ut = 1;
|
|
671
|
+
var e = L && L.__importDefault || function(i) {
|
|
672
|
+
return i && i.__esModule ? i : { default: i };
|
|
673
|
+
};
|
|
674
|
+
Object.defineProperty(_e, "__esModule", { value: !0 }), _e.validateCloudEvent = void 0;
|
|
675
|
+
const t = ce, r = _t(), a = e(vn);
|
|
676
|
+
function n(i) {
|
|
677
|
+
if (i.specversion === r.Version.V1) {
|
|
678
|
+
if (!(0, a.default)(i))
|
|
679
|
+
throw new t.ValidationError("invalid payload", a.default.errors);
|
|
680
|
+
} else
|
|
681
|
+
return !1;
|
|
682
|
+
const o = /^[a-z0-9]+$/;
|
|
683
|
+
for (const s in i)
|
|
684
|
+
if (o.test(s) === !1 && s !== "data_base64")
|
|
685
|
+
throw new t.ValidationError(`invalid attribute name: "${s}"`);
|
|
686
|
+
return !0;
|
|
687
|
+
}
|
|
688
|
+
return _e.validateCloudEvent = n, _e;
|
|
689
|
+
}
|
|
690
|
+
var Bt;
|
|
691
|
+
function _t() {
|
|
692
|
+
return Bt || (Bt = 1, function(e) {
|
|
693
|
+
var t = L && L.__awaiter || function(d, u, c, E) {
|
|
694
|
+
function S(g) {
|
|
695
|
+
return g instanceof c ? g : new c(function(l) {
|
|
696
|
+
l(g);
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
return new (c || (c = Promise))(function(g, l) {
|
|
700
|
+
function h(C) {
|
|
701
|
+
try {
|
|
702
|
+
_(E.next(C));
|
|
703
|
+
} catch ($) {
|
|
704
|
+
l($);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
function A(C) {
|
|
708
|
+
try {
|
|
709
|
+
_(E.throw(C));
|
|
710
|
+
} catch ($) {
|
|
711
|
+
l($);
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
function _(C) {
|
|
715
|
+
C.done ? g(C.value) : S(C.value).then(h, A);
|
|
716
|
+
}
|
|
717
|
+
_((E = E.apply(d, u || [])).next());
|
|
718
|
+
});
|
|
719
|
+
};
|
|
720
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.CloudEvent = e.Version = void 0;
|
|
721
|
+
const r = fn, a = Ae(), n = Sn(), i = ce;
|
|
722
|
+
var o;
|
|
723
|
+
(function(d) {
|
|
724
|
+
d.V1 = "1.0", d.V03 = "0.3";
|
|
725
|
+
})(o = e.Version || (e.Version = {}));
|
|
726
|
+
class s {
|
|
727
|
+
/**
|
|
728
|
+
* Creates a new CloudEvent object with the provided properties. If there is a chance that the event
|
|
729
|
+
* properties will not conform to the CloudEvent specification, you may pass a boolean `false` as a
|
|
730
|
+
* second parameter to bypass event validation.
|
|
731
|
+
*
|
|
732
|
+
* @param {object} event the event properties
|
|
733
|
+
* @param {boolean?} strict whether to perform event validation when creating the object - default: true
|
|
734
|
+
*/
|
|
735
|
+
constructor(u, c = !0) {
|
|
736
|
+
const E = Object.assign({}, u);
|
|
737
|
+
if (this.id = E.id || (0, r.v4)(), delete E.id, this.time = E.time || (/* @__PURE__ */ new Date()).toISOString(), delete E.time, this.type = E.type, delete E.type, this.source = E.source, delete E.source, this.specversion = E.specversion || o.V1, delete E.specversion, this.datacontenttype = E.datacontenttype, delete E.datacontenttype, this.subject = E.subject, delete E.subject, this.datacontentencoding = E.datacontentencoding, delete E.datacontentencoding, this.dataschema = E.dataschema, delete E.dataschema, this.data_base64 = E.data_base64, this.data_base64 && (this.data = (0, i.base64AsBinary)(this.data_base64)), delete E.data_base64, this.schemaurl = E.schemaurl, delete E.schemaurl, (0, i.isBinary)(E.data) && (this.data_base64 = (0, i.asBase64)(E.data)), this.data = typeof E.data < "u" ? E.data : this.data, delete E.data, this.specversion === o.V1 && this.schemaurl)
|
|
738
|
+
throw new TypeError("cannot set schemaurl on version 1.0 event");
|
|
739
|
+
if (this.specversion === o.V03 && this.dataschema)
|
|
740
|
+
throw new TypeError("cannot set dataschema on version 0.3 event");
|
|
741
|
+
for (const [S, g] of Object.entries(E)) {
|
|
742
|
+
if (!S.match(/^[a-z0-9]{1,20}$/) && c)
|
|
743
|
+
throw new i.ValidationError(`invalid extension name: ${S}
|
|
744
|
+
CloudEvents attribute names MUST consist of lower-case letters ('a' to 'z')
|
|
745
|
+
or digits ('0' to '9') from the ASCII character set. Attribute names SHOULD
|
|
746
|
+
be descriptive and terse and SHOULD NOT exceed 20 characters in length.`);
|
|
747
|
+
if (!(0, i.isValidType)(g) && c)
|
|
748
|
+
throw new i.ValidationError(`invalid extension value: ${g}
|
|
749
|
+
Extension values must conform to the CloudEvent type system.
|
|
750
|
+
See: https://github.com/cloudevents/spec/blob/v1.0/spec.md#type-system`);
|
|
751
|
+
this[S] = g;
|
|
752
|
+
}
|
|
753
|
+
c && this.validate(), Object.freeze(this);
|
|
754
|
+
}
|
|
755
|
+
/**
|
|
756
|
+
* Used by JSON.stringify(). The name is confusing, but this method is called by
|
|
757
|
+
* JSON.stringify() when converting this object to JSON.
|
|
758
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
|
|
759
|
+
* @return {object} this event as a plain object
|
|
760
|
+
*/
|
|
761
|
+
toJSON() {
|
|
762
|
+
const u = Object.assign({}, this);
|
|
763
|
+
return u.time = new Date(this.time).toISOString(), u.data_base64 && u.data && delete u.data, u;
|
|
764
|
+
}
|
|
765
|
+
toString() {
|
|
766
|
+
return JSON.stringify(this);
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* Validates this CloudEvent against the schema
|
|
770
|
+
* @throws if the CloudEvent does not conform to the schema
|
|
771
|
+
* @return {boolean} true if this event is valid
|
|
772
|
+
*/
|
|
773
|
+
validate() {
|
|
774
|
+
try {
|
|
775
|
+
return (0, n.validateCloudEvent)(this);
|
|
776
|
+
} catch (u) {
|
|
777
|
+
throw u instanceof i.ValidationError ? u : new i.ValidationError("invalid payload", [u]);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Emit this CloudEvent through the application
|
|
782
|
+
*
|
|
783
|
+
* @param {boolean} ensureDelivery fail the promise if one listener fail
|
|
784
|
+
* @return {Promise<CloudEvent>} this
|
|
785
|
+
*/
|
|
786
|
+
emit(u = !0) {
|
|
787
|
+
return t(this, void 0, void 0, function* () {
|
|
788
|
+
return yield a.Emitter.emitEvent(this, u), this;
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* Clone a CloudEvent with new/updated attributes and possibly different data types
|
|
793
|
+
* @param {object} options attributes to augment the CloudEvent
|
|
794
|
+
* @param {boolean} strict whether or not to use strict validation when cloning (default: true)
|
|
795
|
+
* @throws if the CloudEvent does not conform to the schema
|
|
796
|
+
* @return {CloudEvent} returns a new CloudEvent
|
|
797
|
+
*/
|
|
798
|
+
cloneWith(u, c = !0) {
|
|
799
|
+
return s.cloneWith(this, u, c);
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* The native `console.log` value of the CloudEvent.
|
|
803
|
+
* @return {string} The string representation of the CloudEvent.
|
|
804
|
+
*/
|
|
805
|
+
[Symbol.for("nodejs.util.inspect.custom")]() {
|
|
806
|
+
return this.toString();
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* Clone a CloudEvent with new or updated attributes.
|
|
810
|
+
* @param {CloudEventV1<any>} event an object that implements the {@linkcode CloudEventV1} interface
|
|
811
|
+
* @param {Partial<CloudEventV1<any>>} options an object with new or updated attributes
|
|
812
|
+
* @param {boolean} strict `true` if the resulting event should be valid per the CloudEvent specification
|
|
813
|
+
* @throws {ValidationError} if `strict` is `true` and the resulting event is invalid
|
|
814
|
+
* @returns {CloudEvent<any>} a CloudEvent cloned from `event` with `options` applied.
|
|
815
|
+
*/
|
|
816
|
+
static cloneWith(u, c, E = !0) {
|
|
817
|
+
return new s(Object.assign({}, u, c), E);
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
e.CloudEvent = s;
|
|
821
|
+
}(Qe)), Qe;
|
|
822
|
+
}
|
|
823
|
+
var ae = {}, rt = {}, ge = {}, ir = {}, or = {}, sr = function() {
|
|
824
|
+
if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
|
|
825
|
+
return !1;
|
|
826
|
+
if (typeof Symbol.iterator == "symbol")
|
|
827
|
+
return !0;
|
|
828
|
+
var t = {}, r = Symbol("test"), a = Object(r);
|
|
829
|
+
if (typeof r == "string" || Object.prototype.toString.call(r) !== "[object Symbol]" || Object.prototype.toString.call(a) !== "[object Symbol]")
|
|
830
|
+
return !1;
|
|
831
|
+
var n = 42;
|
|
832
|
+
t[r] = n;
|
|
833
|
+
for (r in t)
|
|
834
|
+
return !1;
|
|
835
|
+
if (typeof Object.keys == "function" && Object.keys(t).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(t).length !== 0)
|
|
836
|
+
return !1;
|
|
837
|
+
var i = Object.getOwnPropertySymbols(t);
|
|
838
|
+
if (i.length !== 1 || i[0] !== r || !Object.prototype.propertyIsEnumerable.call(t, r))
|
|
839
|
+
return !1;
|
|
840
|
+
if (typeof Object.getOwnPropertyDescriptor == "function") {
|
|
841
|
+
var o = Object.getOwnPropertyDescriptor(t, r);
|
|
842
|
+
if (o.value !== n || o.enumerable !== !0)
|
|
843
|
+
return !1;
|
|
844
|
+
}
|
|
845
|
+
return !0;
|
|
846
|
+
}, mn = sr, gt = function() {
|
|
847
|
+
return mn() && !!Symbol.toStringTag;
|
|
848
|
+
}, Mt = typeof Symbol < "u" && Symbol, An = sr, _n = function() {
|
|
849
|
+
return typeof Mt != "function" || typeof Symbol != "function" || typeof Mt("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : An();
|
|
850
|
+
}, $t = {
|
|
851
|
+
foo: {}
|
|
852
|
+
}, gn = Object, bn = function() {
|
|
853
|
+
return { __proto__: $t }.foo === $t.foo && !({ __proto__: null } instanceof gn);
|
|
854
|
+
}, On = "Function.prototype.bind called on incompatible ", nt = Array.prototype.slice, Cn = Object.prototype.toString, Rn = "[object Function]", Nn = function(t) {
|
|
855
|
+
var r = this;
|
|
856
|
+
if (typeof r != "function" || Cn.call(r) !== Rn)
|
|
857
|
+
throw new TypeError(On + r);
|
|
858
|
+
for (var a = nt.call(arguments, 1), n, i = function() {
|
|
859
|
+
if (this instanceof n) {
|
|
860
|
+
var c = r.apply(
|
|
861
|
+
this,
|
|
862
|
+
a.concat(nt.call(arguments))
|
|
863
|
+
);
|
|
864
|
+
return Object(c) === c ? c : this;
|
|
865
|
+
} else
|
|
866
|
+
return r.apply(
|
|
867
|
+
t,
|
|
868
|
+
a.concat(nt.call(arguments))
|
|
869
|
+
);
|
|
870
|
+
}, o = Math.max(0, r.length - a.length), s = [], d = 0; d < o; d++)
|
|
871
|
+
s.push("$" + d);
|
|
872
|
+
if (n = Function("binder", "return function (" + s.join(",") + "){ return binder.apply(this,arguments); }")(i), r.prototype) {
|
|
873
|
+
var u = function() {
|
|
874
|
+
};
|
|
875
|
+
u.prototype = r.prototype, n.prototype = new u(), u.prototype = null;
|
|
876
|
+
}
|
|
877
|
+
return n;
|
|
878
|
+
}, wn = Nn, bt = Function.prototype.bind || wn, Pn = bt, In = Pn.call(Function.call, Object.prototype.hasOwnProperty), N, me = SyntaxError, fr = Function, ve = TypeError, at = function(e) {
|
|
879
|
+
try {
|
|
880
|
+
return fr('"use strict"; return (' + e + ").constructor;")();
|
|
881
|
+
} catch {
|
|
882
|
+
}
|
|
883
|
+
}, se = Object.getOwnPropertyDescriptor;
|
|
884
|
+
if (se)
|
|
885
|
+
try {
|
|
886
|
+
se({}, "");
|
|
887
|
+
} catch {
|
|
888
|
+
se = null;
|
|
889
|
+
}
|
|
890
|
+
var it = function() {
|
|
891
|
+
throw new ve();
|
|
892
|
+
}, Dn = se ? function() {
|
|
893
|
+
try {
|
|
894
|
+
return arguments.callee, it;
|
|
895
|
+
} catch {
|
|
896
|
+
try {
|
|
897
|
+
return se(arguments, "callee").get;
|
|
898
|
+
} catch {
|
|
899
|
+
return it;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
}() : it, Ee = _n(), jn = bn(), V = Object.getPrototypeOf || (jn ? function(e) {
|
|
903
|
+
return e.__proto__;
|
|
904
|
+
} : null), Te = {}, Un = typeof Uint8Array > "u" || !V ? N : V(Uint8Array), fe = {
|
|
905
|
+
"%AggregateError%": typeof AggregateError > "u" ? N : AggregateError,
|
|
906
|
+
"%Array%": Array,
|
|
907
|
+
"%ArrayBuffer%": typeof ArrayBuffer > "u" ? N : ArrayBuffer,
|
|
908
|
+
"%ArrayIteratorPrototype%": Ee && V ? V([][Symbol.iterator]()) : N,
|
|
909
|
+
"%AsyncFromSyncIteratorPrototype%": N,
|
|
910
|
+
"%AsyncFunction%": Te,
|
|
911
|
+
"%AsyncGenerator%": Te,
|
|
912
|
+
"%AsyncGeneratorFunction%": Te,
|
|
913
|
+
"%AsyncIteratorPrototype%": Te,
|
|
914
|
+
"%Atomics%": typeof Atomics > "u" ? N : Atomics,
|
|
915
|
+
"%BigInt%": typeof BigInt > "u" ? N : BigInt,
|
|
916
|
+
"%BigInt64Array%": typeof BigInt64Array > "u" ? N : BigInt64Array,
|
|
917
|
+
"%BigUint64Array%": typeof BigUint64Array > "u" ? N : BigUint64Array,
|
|
918
|
+
"%Boolean%": Boolean,
|
|
919
|
+
"%DataView%": typeof DataView > "u" ? N : DataView,
|
|
920
|
+
"%Date%": Date,
|
|
921
|
+
"%decodeURI%": decodeURI,
|
|
922
|
+
"%decodeURIComponent%": decodeURIComponent,
|
|
923
|
+
"%encodeURI%": encodeURI,
|
|
924
|
+
"%encodeURIComponent%": encodeURIComponent,
|
|
925
|
+
"%Error%": Error,
|
|
926
|
+
"%eval%": eval,
|
|
927
|
+
// eslint-disable-line no-eval
|
|
928
|
+
"%EvalError%": EvalError,
|
|
929
|
+
"%Float32Array%": typeof Float32Array > "u" ? N : Float32Array,
|
|
930
|
+
"%Float64Array%": typeof Float64Array > "u" ? N : Float64Array,
|
|
931
|
+
"%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? N : FinalizationRegistry,
|
|
932
|
+
"%Function%": fr,
|
|
933
|
+
"%GeneratorFunction%": Te,
|
|
934
|
+
"%Int8Array%": typeof Int8Array > "u" ? N : Int8Array,
|
|
935
|
+
"%Int16Array%": typeof Int16Array > "u" ? N : Int16Array,
|
|
936
|
+
"%Int32Array%": typeof Int32Array > "u" ? N : Int32Array,
|
|
937
|
+
"%isFinite%": isFinite,
|
|
938
|
+
"%isNaN%": isNaN,
|
|
939
|
+
"%IteratorPrototype%": Ee && V ? V(V([][Symbol.iterator]())) : N,
|
|
940
|
+
"%JSON%": typeof JSON == "object" ? JSON : N,
|
|
941
|
+
"%Map%": typeof Map > "u" ? N : Map,
|
|
942
|
+
"%MapIteratorPrototype%": typeof Map > "u" || !Ee || !V ? N : V((/* @__PURE__ */ new Map())[Symbol.iterator]()),
|
|
943
|
+
"%Math%": Math,
|
|
944
|
+
"%Number%": Number,
|
|
945
|
+
"%Object%": Object,
|
|
946
|
+
"%parseFloat%": parseFloat,
|
|
947
|
+
"%parseInt%": parseInt,
|
|
948
|
+
"%Promise%": typeof Promise > "u" ? N : Promise,
|
|
949
|
+
"%Proxy%": typeof Proxy > "u" ? N : Proxy,
|
|
950
|
+
"%RangeError%": RangeError,
|
|
951
|
+
"%ReferenceError%": ReferenceError,
|
|
952
|
+
"%Reflect%": typeof Reflect > "u" ? N : Reflect,
|
|
953
|
+
"%RegExp%": RegExp,
|
|
954
|
+
"%Set%": typeof Set > "u" ? N : Set,
|
|
955
|
+
"%SetIteratorPrototype%": typeof Set > "u" || !Ee || !V ? N : V((/* @__PURE__ */ new Set())[Symbol.iterator]()),
|
|
956
|
+
"%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? N : SharedArrayBuffer,
|
|
957
|
+
"%String%": String,
|
|
958
|
+
"%StringIteratorPrototype%": Ee && V ? V(""[Symbol.iterator]()) : N,
|
|
959
|
+
"%Symbol%": Ee ? Symbol : N,
|
|
960
|
+
"%SyntaxError%": me,
|
|
961
|
+
"%ThrowTypeError%": Dn,
|
|
962
|
+
"%TypedArray%": Un,
|
|
963
|
+
"%TypeError%": ve,
|
|
964
|
+
"%Uint8Array%": typeof Uint8Array > "u" ? N : Uint8Array,
|
|
965
|
+
"%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? N : Uint8ClampedArray,
|
|
966
|
+
"%Uint16Array%": typeof Uint16Array > "u" ? N : Uint16Array,
|
|
967
|
+
"%Uint32Array%": typeof Uint32Array > "u" ? N : Uint32Array,
|
|
968
|
+
"%URIError%": URIError,
|
|
969
|
+
"%WeakMap%": typeof WeakMap > "u" ? N : WeakMap,
|
|
970
|
+
"%WeakRef%": typeof WeakRef > "u" ? N : WeakRef,
|
|
971
|
+
"%WeakSet%": typeof WeakSet > "u" ? N : WeakSet
|
|
972
|
+
};
|
|
973
|
+
if (V)
|
|
974
|
+
try {
|
|
975
|
+
null.error;
|
|
976
|
+
} catch (e) {
|
|
977
|
+
var Bn = V(V(e));
|
|
978
|
+
fe["%Error.prototype%"] = Bn;
|
|
979
|
+
}
|
|
980
|
+
var Mn = function e(t) {
|
|
981
|
+
var r;
|
|
982
|
+
if (t === "%AsyncFunction%")
|
|
983
|
+
r = at("async function () {}");
|
|
984
|
+
else if (t === "%GeneratorFunction%")
|
|
985
|
+
r = at("function* () {}");
|
|
986
|
+
else if (t === "%AsyncGeneratorFunction%")
|
|
987
|
+
r = at("async function* () {}");
|
|
988
|
+
else if (t === "%AsyncGenerator%") {
|
|
989
|
+
var a = e("%AsyncGeneratorFunction%");
|
|
990
|
+
a && (r = a.prototype);
|
|
991
|
+
} else if (t === "%AsyncIteratorPrototype%") {
|
|
992
|
+
var n = e("%AsyncGenerator%");
|
|
993
|
+
n && V && (r = V(n.prototype));
|
|
994
|
+
}
|
|
995
|
+
return fe[t] = r, r;
|
|
996
|
+
}, Ft = {
|
|
997
|
+
"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
|
|
998
|
+
"%ArrayPrototype%": ["Array", "prototype"],
|
|
999
|
+
"%ArrayProto_entries%": ["Array", "prototype", "entries"],
|
|
1000
|
+
"%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
|
|
1001
|
+
"%ArrayProto_keys%": ["Array", "prototype", "keys"],
|
|
1002
|
+
"%ArrayProto_values%": ["Array", "prototype", "values"],
|
|
1003
|
+
"%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
|
|
1004
|
+
"%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
|
|
1005
|
+
"%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
|
|
1006
|
+
"%BooleanPrototype%": ["Boolean", "prototype"],
|
|
1007
|
+
"%DataViewPrototype%": ["DataView", "prototype"],
|
|
1008
|
+
"%DatePrototype%": ["Date", "prototype"],
|
|
1009
|
+
"%ErrorPrototype%": ["Error", "prototype"],
|
|
1010
|
+
"%EvalErrorPrototype%": ["EvalError", "prototype"],
|
|
1011
|
+
"%Float32ArrayPrototype%": ["Float32Array", "prototype"],
|
|
1012
|
+
"%Float64ArrayPrototype%": ["Float64Array", "prototype"],
|
|
1013
|
+
"%FunctionPrototype%": ["Function", "prototype"],
|
|
1014
|
+
"%Generator%": ["GeneratorFunction", "prototype"],
|
|
1015
|
+
"%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
|
|
1016
|
+
"%Int8ArrayPrototype%": ["Int8Array", "prototype"],
|
|
1017
|
+
"%Int16ArrayPrototype%": ["Int16Array", "prototype"],
|
|
1018
|
+
"%Int32ArrayPrototype%": ["Int32Array", "prototype"],
|
|
1019
|
+
"%JSONParse%": ["JSON", "parse"],
|
|
1020
|
+
"%JSONStringify%": ["JSON", "stringify"],
|
|
1021
|
+
"%MapPrototype%": ["Map", "prototype"],
|
|
1022
|
+
"%NumberPrototype%": ["Number", "prototype"],
|
|
1023
|
+
"%ObjectPrototype%": ["Object", "prototype"],
|
|
1024
|
+
"%ObjProto_toString%": ["Object", "prototype", "toString"],
|
|
1025
|
+
"%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
|
|
1026
|
+
"%PromisePrototype%": ["Promise", "prototype"],
|
|
1027
|
+
"%PromiseProto_then%": ["Promise", "prototype", "then"],
|
|
1028
|
+
"%Promise_all%": ["Promise", "all"],
|
|
1029
|
+
"%Promise_reject%": ["Promise", "reject"],
|
|
1030
|
+
"%Promise_resolve%": ["Promise", "resolve"],
|
|
1031
|
+
"%RangeErrorPrototype%": ["RangeError", "prototype"],
|
|
1032
|
+
"%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
|
|
1033
|
+
"%RegExpPrototype%": ["RegExp", "prototype"],
|
|
1034
|
+
"%SetPrototype%": ["Set", "prototype"],
|
|
1035
|
+
"%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
|
|
1036
|
+
"%StringPrototype%": ["String", "prototype"],
|
|
1037
|
+
"%SymbolPrototype%": ["Symbol", "prototype"],
|
|
1038
|
+
"%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
|
|
1039
|
+
"%TypedArrayPrototype%": ["TypedArray", "prototype"],
|
|
1040
|
+
"%TypeErrorPrototype%": ["TypeError", "prototype"],
|
|
1041
|
+
"%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
|
|
1042
|
+
"%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
|
|
1043
|
+
"%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
|
|
1044
|
+
"%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
|
|
1045
|
+
"%URIErrorPrototype%": ["URIError", "prototype"],
|
|
1046
|
+
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
1047
|
+
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
1048
|
+
}, Ce = bt, Fe = In, $n = Ce.call(Function.call, Array.prototype.concat), Fn = Ce.call(Function.apply, Array.prototype.splice), Ht = Ce.call(Function.call, String.prototype.replace), He = Ce.call(Function.call, String.prototype.slice), Hn = Ce.call(Function.call, RegExp.prototype.exec), zn = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, Ln = /\\(\\)?/g, kn = function(t) {
|
|
1049
|
+
var r = He(t, 0, 1), a = He(t, -1);
|
|
1050
|
+
if (r === "%" && a !== "%")
|
|
1051
|
+
throw new me("invalid intrinsic syntax, expected closing `%`");
|
|
1052
|
+
if (a === "%" && r !== "%")
|
|
1053
|
+
throw new me("invalid intrinsic syntax, expected opening `%`");
|
|
1054
|
+
var n = [];
|
|
1055
|
+
return Ht(t, zn, function(i, o, s, d) {
|
|
1056
|
+
n[n.length] = s ? Ht(d, Ln, "$1") : o || i;
|
|
1057
|
+
}), n;
|
|
1058
|
+
}, Vn = function(t, r) {
|
|
1059
|
+
var a = t, n;
|
|
1060
|
+
if (Fe(Ft, a) && (n = Ft[a], a = "%" + n[0] + "%"), Fe(fe, a)) {
|
|
1061
|
+
var i = fe[a];
|
|
1062
|
+
if (i === Te && (i = Mn(a)), typeof i > "u" && !r)
|
|
1063
|
+
throw new ve("intrinsic " + t + " exists, but is not available. Please file an issue!");
|
|
1064
|
+
return {
|
|
1065
|
+
alias: n,
|
|
1066
|
+
name: a,
|
|
1067
|
+
value: i
|
|
1068
|
+
};
|
|
1069
|
+
}
|
|
1070
|
+
throw new me("intrinsic " + t + " does not exist!");
|
|
1071
|
+
}, Ot = function(t, r) {
|
|
1072
|
+
if (typeof t != "string" || t.length === 0)
|
|
1073
|
+
throw new ve("intrinsic name must be a non-empty string");
|
|
1074
|
+
if (arguments.length > 1 && typeof r != "boolean")
|
|
1075
|
+
throw new ve('"allowMissing" argument must be a boolean');
|
|
1076
|
+
if (Hn(/^%?[^%]*%?$/, t) === null)
|
|
1077
|
+
throw new me("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
1078
|
+
var a = kn(t), n = a.length > 0 ? a[0] : "", i = Vn("%" + n + "%", r), o = i.name, s = i.value, d = !1, u = i.alias;
|
|
1079
|
+
u && (n = u[0], Fn(a, $n([0, 1], u)));
|
|
1080
|
+
for (var c = 1, E = !0; c < a.length; c += 1) {
|
|
1081
|
+
var S = a[c], g = He(S, 0, 1), l = He(S, -1);
|
|
1082
|
+
if ((g === '"' || g === "'" || g === "`" || l === '"' || l === "'" || l === "`") && g !== l)
|
|
1083
|
+
throw new me("property names with quotes must have matching quotes");
|
|
1084
|
+
if ((S === "constructor" || !E) && (d = !0), n += "." + S, o = "%" + n + "%", Fe(fe, o))
|
|
1085
|
+
s = fe[o];
|
|
1086
|
+
else if (s != null) {
|
|
1087
|
+
if (!(S in s)) {
|
|
1088
|
+
if (!r)
|
|
1089
|
+
throw new ve("base intrinsic for " + t + " exists, but the property is not available.");
|
|
1090
|
+
return;
|
|
1091
|
+
}
|
|
1092
|
+
if (se && c + 1 >= a.length) {
|
|
1093
|
+
var h = se(s, S);
|
|
1094
|
+
E = !!h, E && "get" in h && !("originalValue" in h.get) ? s = h.get : s = s[S];
|
|
1095
|
+
} else
|
|
1096
|
+
E = Fe(s, S), s = s[S];
|
|
1097
|
+
E && !d && (fe[o] = s);
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
return s;
|
|
1101
|
+
}, ur = { exports: {} };
|
|
1102
|
+
(function(e) {
|
|
1103
|
+
var t = bt, r = Ot, a = r("%Function.prototype.apply%"), n = r("%Function.prototype.call%"), i = r("%Reflect.apply%", !0) || t.call(n, a), o = r("%Object.getOwnPropertyDescriptor%", !0), s = r("%Object.defineProperty%", !0), d = r("%Math.max%");
|
|
1104
|
+
if (s)
|
|
1105
|
+
try {
|
|
1106
|
+
s({}, "a", { value: 1 });
|
|
1107
|
+
} catch {
|
|
1108
|
+
s = null;
|
|
1109
|
+
}
|
|
1110
|
+
e.exports = function(E) {
|
|
1111
|
+
var S = i(t, n, arguments);
|
|
1112
|
+
if (o && s) {
|
|
1113
|
+
var g = o(S, "length");
|
|
1114
|
+
g.configurable && s(
|
|
1115
|
+
S,
|
|
1116
|
+
"length",
|
|
1117
|
+
{ value: 1 + d(0, E.length - (arguments.length - 1)) }
|
|
1118
|
+
);
|
|
1119
|
+
}
|
|
1120
|
+
return S;
|
|
1121
|
+
};
|
|
1122
|
+
var u = function() {
|
|
1123
|
+
return i(t, a, arguments);
|
|
1124
|
+
};
|
|
1125
|
+
s ? s(e.exports, "apply", { value: u }) : e.exports.apply = u;
|
|
1126
|
+
})(ur);
|
|
1127
|
+
var cr = ur.exports, dr = Ot, lr = cr, Yn = lr(dr("String.prototype.indexOf")), yr = function(t, r) {
|
|
1128
|
+
var a = dr(t, !!r);
|
|
1129
|
+
return typeof a == "function" && Yn(t, ".prototype.") > -1 ? lr(a) : a;
|
|
1130
|
+
}, Jn = gt(), qn = yr, yt = qn("Object.prototype.toString"), Je = function(t) {
|
|
1131
|
+
return Jn && t && typeof t == "object" && Symbol.toStringTag in t ? !1 : yt(t) === "[object Arguments]";
|
|
1132
|
+
}, pr = function(t) {
|
|
1133
|
+
return Je(t) ? !0 : t !== null && typeof t == "object" && typeof t.length == "number" && t.length >= 0 && yt(t) !== "[object Array]" && yt(t.callee) === "[object Function]";
|
|
1134
|
+
}, Gn = function() {
|
|
1135
|
+
return Je(arguments);
|
|
1136
|
+
}();
|
|
1137
|
+
Je.isLegacyArguments = pr;
|
|
1138
|
+
var Wn = Gn ? Je : pr, Kn = Object.prototype.toString, Qn = Function.prototype.toString, Xn = /^\s*(?:function)?\*/, Er = gt(), ot = Object.getPrototypeOf, Zn = function() {
|
|
1139
|
+
if (!Er)
|
|
1140
|
+
return !1;
|
|
1141
|
+
try {
|
|
1142
|
+
return Function("return function*() {}")();
|
|
1143
|
+
} catch {
|
|
1144
|
+
}
|
|
1145
|
+
}, st, xn = function(t) {
|
|
1146
|
+
if (typeof t != "function")
|
|
1147
|
+
return !1;
|
|
1148
|
+
if (Xn.test(Qn.call(t)))
|
|
1149
|
+
return !0;
|
|
1150
|
+
if (!Er) {
|
|
1151
|
+
var r = Kn.call(t);
|
|
1152
|
+
return r === "[object GeneratorFunction]";
|
|
1153
|
+
}
|
|
1154
|
+
if (!ot)
|
|
1155
|
+
return !1;
|
|
1156
|
+
if (typeof st > "u") {
|
|
1157
|
+
var a = Zn();
|
|
1158
|
+
st = a ? ot(a) : !1;
|
|
1159
|
+
}
|
|
1160
|
+
return ot(t) === st;
|
|
1161
|
+
}, Tr = Function.prototype.toString, he = typeof Reflect == "object" && Reflect !== null && Reflect.apply, pt, je;
|
|
1162
|
+
if (typeof he == "function" && typeof Object.defineProperty == "function")
|
|
1163
|
+
try {
|
|
1164
|
+
pt = Object.defineProperty({}, "length", {
|
|
1165
|
+
get: function() {
|
|
1166
|
+
throw je;
|
|
1167
|
+
}
|
|
1168
|
+
}), je = {}, he(function() {
|
|
1169
|
+
throw 42;
|
|
1170
|
+
}, null, pt);
|
|
1171
|
+
} catch (e) {
|
|
1172
|
+
e !== je && (he = null);
|
|
1173
|
+
}
|
|
1174
|
+
else
|
|
1175
|
+
he = null;
|
|
1176
|
+
var ea = /^\s*class\b/, Et = function(t) {
|
|
1177
|
+
try {
|
|
1178
|
+
var r = Tr.call(t);
|
|
1179
|
+
return ea.test(r);
|
|
1180
|
+
} catch {
|
|
1181
|
+
return !1;
|
|
1182
|
+
}
|
|
1183
|
+
}, ft = function(t) {
|
|
1184
|
+
try {
|
|
1185
|
+
return Et(t) ? !1 : (Tr.call(t), !0);
|
|
1186
|
+
} catch {
|
|
1187
|
+
return !1;
|
|
1188
|
+
}
|
|
1189
|
+
}, Ue = Object.prototype.toString, ta = "[object Object]", ra = "[object Function]", na = "[object GeneratorFunction]", aa = "[object HTMLAllCollection]", ia = "[object HTML document.all class]", oa = "[object HTMLCollection]", sa = typeof Symbol == "function" && !!Symbol.toStringTag, fa = !(0 in [,]), Tt = function() {
|
|
1190
|
+
return !1;
|
|
1191
|
+
};
|
|
1192
|
+
if (typeof document == "object") {
|
|
1193
|
+
var ua = document.all;
|
|
1194
|
+
Ue.call(ua) === Ue.call(document.all) && (Tt = function(t) {
|
|
1195
|
+
if ((fa || !t) && (typeof t > "u" || typeof t == "object"))
|
|
1196
|
+
try {
|
|
1197
|
+
var r = Ue.call(t);
|
|
1198
|
+
return (r === aa || r === ia || r === oa || r === ta) && t("") == null;
|
|
1199
|
+
} catch {
|
|
1200
|
+
}
|
|
1201
|
+
return !1;
|
|
1202
|
+
});
|
|
1203
|
+
}
|
|
1204
|
+
var ca = he ? function(t) {
|
|
1205
|
+
if (Tt(t))
|
|
1206
|
+
return !0;
|
|
1207
|
+
if (!t || typeof t != "function" && typeof t != "object")
|
|
1208
|
+
return !1;
|
|
1209
|
+
try {
|
|
1210
|
+
he(t, null, pt);
|
|
1211
|
+
} catch (r) {
|
|
1212
|
+
if (r !== je)
|
|
1213
|
+
return !1;
|
|
1214
|
+
}
|
|
1215
|
+
return !Et(t) && ft(t);
|
|
1216
|
+
} : function(t) {
|
|
1217
|
+
if (Tt(t))
|
|
1218
|
+
return !0;
|
|
1219
|
+
if (!t || typeof t != "function" && typeof t != "object")
|
|
1220
|
+
return !1;
|
|
1221
|
+
if (sa)
|
|
1222
|
+
return ft(t);
|
|
1223
|
+
if (Et(t))
|
|
1224
|
+
return !1;
|
|
1225
|
+
var r = Ue.call(t);
|
|
1226
|
+
return r !== ra && r !== na && !/^\[object HTML/.test(r) ? !1 : ft(t);
|
|
1227
|
+
}, da = ca, la = Object.prototype.toString, hr = Object.prototype.hasOwnProperty, ya = function(t, r, a) {
|
|
1228
|
+
for (var n = 0, i = t.length; n < i; n++)
|
|
1229
|
+
hr.call(t, n) && (a == null ? r(t[n], n, t) : r.call(a, t[n], n, t));
|
|
1230
|
+
}, pa = function(t, r, a) {
|
|
1231
|
+
for (var n = 0, i = t.length; n < i; n++)
|
|
1232
|
+
a == null ? r(t.charAt(n), n, t) : r.call(a, t.charAt(n), n, t);
|
|
1233
|
+
}, Ea = function(t, r, a) {
|
|
1234
|
+
for (var n in t)
|
|
1235
|
+
hr.call(t, n) && (a == null ? r(t[n], n, t) : r.call(a, t[n], n, t));
|
|
1236
|
+
}, Ta = function(t, r, a) {
|
|
1237
|
+
if (!da(r))
|
|
1238
|
+
throw new TypeError("iterator must be a function");
|
|
1239
|
+
var n;
|
|
1240
|
+
arguments.length >= 3 && (n = a), la.call(t) === "[object Array]" ? ya(t, r, n) : typeof t == "string" ? pa(t, r, n) : Ea(t, r, n);
|
|
1241
|
+
}, ha = Ta, ut = [
|
|
1242
|
+
"BigInt64Array",
|
|
1243
|
+
"BigUint64Array",
|
|
1244
|
+
"Float32Array",
|
|
1245
|
+
"Float64Array",
|
|
1246
|
+
"Int16Array",
|
|
1247
|
+
"Int32Array",
|
|
1248
|
+
"Int8Array",
|
|
1249
|
+
"Uint16Array",
|
|
1250
|
+
"Uint32Array",
|
|
1251
|
+
"Uint8Array",
|
|
1252
|
+
"Uint8ClampedArray"
|
|
1253
|
+
], va = typeof globalThis > "u" ? L : globalThis, Sa = function() {
|
|
1254
|
+
for (var t = [], r = 0; r < ut.length; r++)
|
|
1255
|
+
typeof va[ut[r]] == "function" && (t[t.length] = ut[r]);
|
|
1256
|
+
return t;
|
|
1257
|
+
}, ma = Ot, Be = ma("%Object.getOwnPropertyDescriptor%", !0);
|
|
1258
|
+
if (Be)
|
|
1259
|
+
try {
|
|
1260
|
+
Be([], "length");
|
|
1261
|
+
} catch {
|
|
1262
|
+
Be = null;
|
|
1263
|
+
}
|
|
1264
|
+
var Aa = Be, ze = ha, _a = Sa, zt = cr, Ct = yr, Me = Aa, ga = Ct("Object.prototype.toString"), vr = gt(), Lt = typeof globalThis > "u" ? L : globalThis, ht = _a(), Rt = Ct("String.prototype.slice"), ct = Object.getPrototypeOf, ba = Ct("Array.prototype.indexOf", !0) || function(t, r) {
|
|
1265
|
+
for (var a = 0; a < t.length; a += 1)
|
|
1266
|
+
if (t[a] === r)
|
|
1267
|
+
return a;
|
|
1268
|
+
return -1;
|
|
1269
|
+
}, Le = { __proto__: null };
|
|
1270
|
+
vr && Me && ct ? ze(ht, function(e) {
|
|
1271
|
+
var t = new Lt[e]();
|
|
1272
|
+
if (Symbol.toStringTag in t) {
|
|
1273
|
+
var r = ct(t), a = Me(r, Symbol.toStringTag);
|
|
1274
|
+
if (!a) {
|
|
1275
|
+
var n = ct(r);
|
|
1276
|
+
a = Me(n, Symbol.toStringTag);
|
|
1277
|
+
}
|
|
1278
|
+
Le["$" + e] = zt(a.get);
|
|
1279
|
+
}
|
|
1280
|
+
}) : ze(ht, function(e) {
|
|
1281
|
+
var t = new Lt[e]();
|
|
1282
|
+
Le["$" + e] = zt(t.slice);
|
|
1283
|
+
});
|
|
1284
|
+
var Oa = function(t) {
|
|
1285
|
+
var r = !1;
|
|
1286
|
+
return ze(Le, function(a, n) {
|
|
1287
|
+
if (!r)
|
|
1288
|
+
try {
|
|
1289
|
+
"$" + a(t) === n && (r = Rt(n, 1));
|
|
1290
|
+
} catch {
|
|
1291
|
+
}
|
|
1292
|
+
}), r;
|
|
1293
|
+
}, Ca = function(t) {
|
|
1294
|
+
var r = !1;
|
|
1295
|
+
return ze(Le, function(a, n) {
|
|
1296
|
+
if (!r)
|
|
1297
|
+
try {
|
|
1298
|
+
a(t), r = Rt(n, 1);
|
|
1299
|
+
} catch {
|
|
1300
|
+
}
|
|
1301
|
+
}), r;
|
|
1302
|
+
}, Sr = function(t) {
|
|
1303
|
+
if (!t || typeof t != "object")
|
|
1304
|
+
return !1;
|
|
1305
|
+
if (!vr) {
|
|
1306
|
+
var r = Rt(ga(t), 8, -1);
|
|
1307
|
+
return ba(ht, r) > -1 ? r : r !== "Object" ? !1 : Ca(t);
|
|
1308
|
+
}
|
|
1309
|
+
return Me ? Oa(t) : null;
|
|
1310
|
+
}, Ra = Sr, Na = function(t) {
|
|
1311
|
+
return !!Ra(t);
|
|
1312
|
+
};
|
|
1313
|
+
(function(e) {
|
|
1314
|
+
var t = Wn, r = xn, a = Sr, n = Na;
|
|
1315
|
+
function i(p) {
|
|
1316
|
+
return p.call.bind(p);
|
|
1317
|
+
}
|
|
1318
|
+
var o = typeof BigInt < "u", s = typeof Symbol < "u", d = i(Object.prototype.toString), u = i(Number.prototype.valueOf), c = i(String.prototype.valueOf), E = i(Boolean.prototype.valueOf);
|
|
1319
|
+
if (o)
|
|
1320
|
+
var S = i(BigInt.prototype.valueOf);
|
|
1321
|
+
if (s)
|
|
1322
|
+
var g = i(Symbol.prototype.valueOf);
|
|
1323
|
+
function l(p, Br) {
|
|
1324
|
+
if (typeof p != "object")
|
|
1325
|
+
return !1;
|
|
1326
|
+
try {
|
|
1327
|
+
return Br(p), !0;
|
|
1328
|
+
} catch {
|
|
1329
|
+
return !1;
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
e.isArgumentsObject = t, e.isGeneratorFunction = r, e.isTypedArray = n;
|
|
1333
|
+
function h(p) {
|
|
1334
|
+
return typeof Promise < "u" && p instanceof Promise || p !== null && typeof p == "object" && typeof p.then == "function" && typeof p.catch == "function";
|
|
1335
|
+
}
|
|
1336
|
+
e.isPromise = h;
|
|
1337
|
+
function A(p) {
|
|
1338
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? ArrayBuffer.isView(p) : n(p) || y(p);
|
|
1339
|
+
}
|
|
1340
|
+
e.isArrayBufferView = A;
|
|
1341
|
+
function _(p) {
|
|
1342
|
+
return a(p) === "Uint8Array";
|
|
1343
|
+
}
|
|
1344
|
+
e.isUint8Array = _;
|
|
1345
|
+
function C(p) {
|
|
1346
|
+
return a(p) === "Uint8ClampedArray";
|
|
1347
|
+
}
|
|
1348
|
+
e.isUint8ClampedArray = C;
|
|
1349
|
+
function $(p) {
|
|
1350
|
+
return a(p) === "Uint16Array";
|
|
1351
|
+
}
|
|
1352
|
+
e.isUint16Array = $;
|
|
1353
|
+
function k(p) {
|
|
1354
|
+
return a(p) === "Uint32Array";
|
|
1355
|
+
}
|
|
1356
|
+
e.isUint32Array = k;
|
|
1357
|
+
function z(p) {
|
|
1358
|
+
return a(p) === "Int8Array";
|
|
1359
|
+
}
|
|
1360
|
+
e.isInt8Array = z;
|
|
1361
|
+
function I(p) {
|
|
1362
|
+
return a(p) === "Int16Array";
|
|
1363
|
+
}
|
|
1364
|
+
e.isInt16Array = I;
|
|
1365
|
+
function v(p) {
|
|
1366
|
+
return a(p) === "Int32Array";
|
|
1367
|
+
}
|
|
1368
|
+
e.isInt32Array = v;
|
|
1369
|
+
function w(p) {
|
|
1370
|
+
return a(p) === "Float32Array";
|
|
1371
|
+
}
|
|
1372
|
+
e.isFloat32Array = w;
|
|
1373
|
+
function m(p) {
|
|
1374
|
+
return a(p) === "Float64Array";
|
|
1375
|
+
}
|
|
1376
|
+
e.isFloat64Array = m;
|
|
1377
|
+
function O(p) {
|
|
1378
|
+
return a(p) === "BigInt64Array";
|
|
1379
|
+
}
|
|
1380
|
+
e.isBigInt64Array = O;
|
|
1381
|
+
function H(p) {
|
|
1382
|
+
return a(p) === "BigUint64Array";
|
|
1383
|
+
}
|
|
1384
|
+
e.isBigUint64Array = H;
|
|
1385
|
+
function j(p) {
|
|
1386
|
+
return d(p) === "[object Map]";
|
|
1387
|
+
}
|
|
1388
|
+
j.working = typeof Map < "u" && j(/* @__PURE__ */ new Map());
|
|
1389
|
+
function Z(p) {
|
|
1390
|
+
return typeof Map > "u" ? !1 : j.working ? j(p) : p instanceof Map;
|
|
1391
|
+
}
|
|
1392
|
+
e.isMap = Z;
|
|
1393
|
+
function X(p) {
|
|
1394
|
+
return d(p) === "[object Set]";
|
|
1395
|
+
}
|
|
1396
|
+
X.working = typeof Set < "u" && X(/* @__PURE__ */ new Set());
|
|
1397
|
+
function x(p) {
|
|
1398
|
+
return typeof Set > "u" ? !1 : X.working ? X(p) : p instanceof Set;
|
|
1399
|
+
}
|
|
1400
|
+
e.isSet = x;
|
|
1401
|
+
function de(p) {
|
|
1402
|
+
return d(p) === "[object WeakMap]";
|
|
1403
|
+
}
|
|
1404
|
+
de.working = typeof WeakMap < "u" && de(/* @__PURE__ */ new WeakMap());
|
|
1405
|
+
function We(p) {
|
|
1406
|
+
return typeof WeakMap > "u" ? !1 : de.working ? de(p) : p instanceof WeakMap;
|
|
1407
|
+
}
|
|
1408
|
+
e.isWeakMap = We;
|
|
1409
|
+
function le(p) {
|
|
1410
|
+
return d(p) === "[object WeakSet]";
|
|
1411
|
+
}
|
|
1412
|
+
le.working = typeof WeakSet < "u" && le(/* @__PURE__ */ new WeakSet());
|
|
1413
|
+
function ee(p) {
|
|
1414
|
+
return le(p);
|
|
1415
|
+
}
|
|
1416
|
+
e.isWeakSet = ee;
|
|
1417
|
+
function ye(p) {
|
|
1418
|
+
return d(p) === "[object ArrayBuffer]";
|
|
1419
|
+
}
|
|
1420
|
+
ye.working = typeof ArrayBuffer < "u" && ye(new ArrayBuffer());
|
|
1421
|
+
function Ne(p) {
|
|
1422
|
+
return typeof ArrayBuffer > "u" ? !1 : ye.working ? ye(p) : p instanceof ArrayBuffer;
|
|
1423
|
+
}
|
|
1424
|
+
e.isArrayBuffer = Ne;
|
|
1425
|
+
function f(p) {
|
|
1426
|
+
return d(p) === "[object DataView]";
|
|
1427
|
+
}
|
|
1428
|
+
f.working = typeof ArrayBuffer < "u" && typeof DataView < "u" && f(new DataView(new ArrayBuffer(1), 0, 1));
|
|
1429
|
+
function y(p) {
|
|
1430
|
+
return typeof DataView > "u" ? !1 : f.working ? f(p) : p instanceof DataView;
|
|
1431
|
+
}
|
|
1432
|
+
e.isDataView = y;
|
|
1433
|
+
var T = typeof SharedArrayBuffer < "u" ? SharedArrayBuffer : void 0;
|
|
1434
|
+
function b(p) {
|
|
1435
|
+
return d(p) === "[object SharedArrayBuffer]";
|
|
1436
|
+
}
|
|
1437
|
+
function D(p) {
|
|
1438
|
+
return typeof T > "u" ? !1 : (typeof b.working > "u" && (b.working = b(new T())), b.working ? b(p) : p instanceof T);
|
|
1439
|
+
}
|
|
1440
|
+
e.isSharedArrayBuffer = D;
|
|
1441
|
+
function U(p) {
|
|
1442
|
+
return d(p) === "[object AsyncFunction]";
|
|
1443
|
+
}
|
|
1444
|
+
e.isAsyncFunction = U;
|
|
1445
|
+
function R(p) {
|
|
1446
|
+
return d(p) === "[object Map Iterator]";
|
|
1447
|
+
}
|
|
1448
|
+
e.isMapIterator = R;
|
|
1449
|
+
function P(p) {
|
|
1450
|
+
return d(p) === "[object Set Iterator]";
|
|
1451
|
+
}
|
|
1452
|
+
e.isSetIterator = P;
|
|
1453
|
+
function M(p) {
|
|
1454
|
+
return d(p) === "[object Generator]";
|
|
1455
|
+
}
|
|
1456
|
+
e.isGeneratorObject = M;
|
|
1457
|
+
function Q(p) {
|
|
1458
|
+
return d(p) === "[object WebAssembly.Module]";
|
|
1459
|
+
}
|
|
1460
|
+
e.isWebAssemblyCompiledModule = Q;
|
|
1461
|
+
function ne(p) {
|
|
1462
|
+
return l(p, u);
|
|
1463
|
+
}
|
|
1464
|
+
e.isNumberObject = ne;
|
|
1465
|
+
function we(p) {
|
|
1466
|
+
return l(p, c);
|
|
1467
|
+
}
|
|
1468
|
+
e.isStringObject = we;
|
|
1469
|
+
function pe(p) {
|
|
1470
|
+
return l(p, E);
|
|
1471
|
+
}
|
|
1472
|
+
e.isBooleanObject = pe;
|
|
1473
|
+
function Pe(p) {
|
|
1474
|
+
return o && l(p, S);
|
|
1475
|
+
}
|
|
1476
|
+
e.isBigIntObject = Pe;
|
|
1477
|
+
function Dt(p) {
|
|
1478
|
+
return s && l(p, g);
|
|
1479
|
+
}
|
|
1480
|
+
e.isSymbolObject = Dt;
|
|
1481
|
+
function jr(p) {
|
|
1482
|
+
return ne(p) || we(p) || pe(p) || Pe(p) || Dt(p);
|
|
1483
|
+
}
|
|
1484
|
+
e.isBoxedPrimitive = jr;
|
|
1485
|
+
function Ur(p) {
|
|
1486
|
+
return typeof Uint8Array < "u" && (Ne(p) || D(p));
|
|
1487
|
+
}
|
|
1488
|
+
e.isAnyArrayBuffer = Ur, ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(p) {
|
|
1489
|
+
Object.defineProperty(e, p, {
|
|
1490
|
+
enumerable: !1,
|
|
1491
|
+
value: function() {
|
|
1492
|
+
throw new Error(p + " is not supported in userland");
|
|
1493
|
+
}
|
|
1494
|
+
});
|
|
1495
|
+
});
|
|
1496
|
+
})(or);
|
|
1497
|
+
var wa = function(t) {
|
|
1498
|
+
return t && typeof t == "object" && typeof t.copy == "function" && typeof t.fill == "function" && typeof t.readUInt8 == "function";
|
|
1499
|
+
}, vt = { exports: {} };
|
|
1500
|
+
typeof Object.create == "function" ? vt.exports = function(t, r) {
|
|
1501
|
+
r && (t.super_ = r, t.prototype = Object.create(r.prototype, {
|
|
1502
|
+
constructor: {
|
|
1503
|
+
value: t,
|
|
1504
|
+
enumerable: !1,
|
|
1505
|
+
writable: !0,
|
|
1506
|
+
configurable: !0
|
|
1507
|
+
}
|
|
1508
|
+
}));
|
|
1509
|
+
} : vt.exports = function(t, r) {
|
|
1510
|
+
if (r) {
|
|
1511
|
+
t.super_ = r;
|
|
1512
|
+
var a = function() {
|
|
1513
|
+
};
|
|
1514
|
+
a.prototype = r.prototype, t.prototype = new a(), t.prototype.constructor = t;
|
|
1515
|
+
}
|
|
1516
|
+
};
|
|
1517
|
+
var Pa = vt.exports;
|
|
1518
|
+
(function(e) {
|
|
1519
|
+
var t = Object.getOwnPropertyDescriptors || function(y) {
|
|
1520
|
+
for (var T = Object.keys(y), b = {}, D = 0; D < T.length; D++)
|
|
1521
|
+
b[T[D]] = Object.getOwnPropertyDescriptor(y, T[D]);
|
|
1522
|
+
return b;
|
|
1523
|
+
}, r = /%[sdj%]/g;
|
|
1524
|
+
e.format = function(f) {
|
|
1525
|
+
if (!z(f)) {
|
|
1526
|
+
for (var y = [], T = 0; T < arguments.length; T++)
|
|
1527
|
+
y.push(o(arguments[T]));
|
|
1528
|
+
return y.join(" ");
|
|
1529
|
+
}
|
|
1530
|
+
for (var T = 1, b = arguments, D = b.length, U = String(f).replace(r, function(P) {
|
|
1531
|
+
if (P === "%%")
|
|
1532
|
+
return "%";
|
|
1533
|
+
if (T >= D)
|
|
1534
|
+
return P;
|
|
1535
|
+
switch (P) {
|
|
1536
|
+
case "%s":
|
|
1537
|
+
return String(b[T++]);
|
|
1538
|
+
case "%d":
|
|
1539
|
+
return Number(b[T++]);
|
|
1540
|
+
case "%j":
|
|
1541
|
+
try {
|
|
1542
|
+
return JSON.stringify(b[T++]);
|
|
1543
|
+
} catch {
|
|
1544
|
+
return "[Circular]";
|
|
1545
|
+
}
|
|
1546
|
+
default:
|
|
1547
|
+
return P;
|
|
1548
|
+
}
|
|
1549
|
+
}), R = b[T]; T < D; R = b[++T])
|
|
1550
|
+
C(R) || !m(R) ? U += " " + R : U += " " + o(R);
|
|
1551
|
+
return U;
|
|
1552
|
+
}, e.deprecate = function(f, y) {
|
|
1553
|
+
if (typeof process < "u" && process.noDeprecation === !0)
|
|
1554
|
+
return f;
|
|
1555
|
+
if (typeof process > "u")
|
|
1556
|
+
return function() {
|
|
1557
|
+
return e.deprecate(f, y).apply(this, arguments);
|
|
1558
|
+
};
|
|
1559
|
+
var T = !1;
|
|
1560
|
+
function b() {
|
|
1561
|
+
if (!T) {
|
|
1562
|
+
if (process.throwDeprecation)
|
|
1563
|
+
throw new Error(y);
|
|
1564
|
+
process.traceDeprecation ? console.trace(y) : console.error(y), T = !0;
|
|
1565
|
+
}
|
|
1566
|
+
return f.apply(this, arguments);
|
|
1567
|
+
}
|
|
1568
|
+
return b;
|
|
1569
|
+
};
|
|
1570
|
+
var a = {}, n = /^$/;
|
|
1571
|
+
if (process.env.NODE_DEBUG) {
|
|
1572
|
+
var i = process.env.NODE_DEBUG;
|
|
1573
|
+
i = i.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase(), n = new RegExp("^" + i + "$", "i");
|
|
1574
|
+
}
|
|
1575
|
+
e.debuglog = function(f) {
|
|
1576
|
+
if (f = f.toUpperCase(), !a[f])
|
|
1577
|
+
if (n.test(f)) {
|
|
1578
|
+
var y = process.pid;
|
|
1579
|
+
a[f] = function() {
|
|
1580
|
+
var T = e.format.apply(e, arguments);
|
|
1581
|
+
console.error("%s %d: %s", f, y, T);
|
|
1582
|
+
};
|
|
1583
|
+
} else
|
|
1584
|
+
a[f] = function() {
|
|
1585
|
+
};
|
|
1586
|
+
return a[f];
|
|
1587
|
+
};
|
|
1588
|
+
function o(f, y) {
|
|
1589
|
+
var T = {
|
|
1590
|
+
seen: [],
|
|
1591
|
+
stylize: d
|
|
1592
|
+
};
|
|
1593
|
+
return arguments.length >= 3 && (T.depth = arguments[2]), arguments.length >= 4 && (T.colors = arguments[3]), _(y) ? T.showHidden = y : y && e._extend(T, y), v(T.showHidden) && (T.showHidden = !1), v(T.depth) && (T.depth = 2), v(T.colors) && (T.colors = !1), v(T.customInspect) && (T.customInspect = !0), T.colors && (T.stylize = s), c(T, f, T.depth);
|
|
1594
|
+
}
|
|
1595
|
+
e.inspect = o, o.colors = {
|
|
1596
|
+
bold: [1, 22],
|
|
1597
|
+
italic: [3, 23],
|
|
1598
|
+
underline: [4, 24],
|
|
1599
|
+
inverse: [7, 27],
|
|
1600
|
+
white: [37, 39],
|
|
1601
|
+
grey: [90, 39],
|
|
1602
|
+
black: [30, 39],
|
|
1603
|
+
blue: [34, 39],
|
|
1604
|
+
cyan: [36, 39],
|
|
1605
|
+
green: [32, 39],
|
|
1606
|
+
magenta: [35, 39],
|
|
1607
|
+
red: [31, 39],
|
|
1608
|
+
yellow: [33, 39]
|
|
1609
|
+
}, o.styles = {
|
|
1610
|
+
special: "cyan",
|
|
1611
|
+
number: "yellow",
|
|
1612
|
+
boolean: "yellow",
|
|
1613
|
+
undefined: "grey",
|
|
1614
|
+
null: "bold",
|
|
1615
|
+
string: "green",
|
|
1616
|
+
date: "magenta",
|
|
1617
|
+
// "name": intentionally not styling
|
|
1618
|
+
regexp: "red"
|
|
1619
|
+
};
|
|
1620
|
+
function s(f, y) {
|
|
1621
|
+
var T = o.styles[y];
|
|
1622
|
+
return T ? "\x1B[" + o.colors[T][0] + "m" + f + "\x1B[" + o.colors[T][1] + "m" : f;
|
|
1623
|
+
}
|
|
1624
|
+
function d(f, y) {
|
|
1625
|
+
return f;
|
|
1626
|
+
}
|
|
1627
|
+
function u(f) {
|
|
1628
|
+
var y = {};
|
|
1629
|
+
return f.forEach(function(T, b) {
|
|
1630
|
+
y[T] = !0;
|
|
1631
|
+
}), y;
|
|
1632
|
+
}
|
|
1633
|
+
function c(f, y, T) {
|
|
1634
|
+
if (f.customInspect && y && j(y.inspect) && // Filter out the util module, it's inspect function is special
|
|
1635
|
+
y.inspect !== e.inspect && // Also filter out any prototype objects using the circular check.
|
|
1636
|
+
!(y.constructor && y.constructor.prototype === y)) {
|
|
1637
|
+
var b = y.inspect(T, f);
|
|
1638
|
+
return z(b) || (b = c(f, b, T)), b;
|
|
1639
|
+
}
|
|
1640
|
+
var D = E(f, y);
|
|
1641
|
+
if (D)
|
|
1642
|
+
return D;
|
|
1643
|
+
var U = Object.keys(y), R = u(U);
|
|
1644
|
+
if (f.showHidden && (U = Object.getOwnPropertyNames(y)), H(y) && (U.indexOf("message") >= 0 || U.indexOf("description") >= 0))
|
|
1645
|
+
return S(y);
|
|
1646
|
+
if (U.length === 0) {
|
|
1647
|
+
if (j(y)) {
|
|
1648
|
+
var P = y.name ? ": " + y.name : "";
|
|
1649
|
+
return f.stylize("[Function" + P + "]", "special");
|
|
1650
|
+
}
|
|
1651
|
+
if (w(y))
|
|
1652
|
+
return f.stylize(RegExp.prototype.toString.call(y), "regexp");
|
|
1653
|
+
if (O(y))
|
|
1654
|
+
return f.stylize(Date.prototype.toString.call(y), "date");
|
|
1655
|
+
if (H(y))
|
|
1656
|
+
return S(y);
|
|
1657
|
+
}
|
|
1658
|
+
var M = "", Q = !1, ne = ["{", "}"];
|
|
1659
|
+
if (A(y) && (Q = !0, ne = ["[", "]"]), j(y)) {
|
|
1660
|
+
var we = y.name ? ": " + y.name : "";
|
|
1661
|
+
M = " [Function" + we + "]";
|
|
1662
|
+
}
|
|
1663
|
+
if (w(y) && (M = " " + RegExp.prototype.toString.call(y)), O(y) && (M = " " + Date.prototype.toUTCString.call(y)), H(y) && (M = " " + S(y)), U.length === 0 && (!Q || y.length == 0))
|
|
1664
|
+
return ne[0] + M + ne[1];
|
|
1665
|
+
if (T < 0)
|
|
1666
|
+
return w(y) ? f.stylize(RegExp.prototype.toString.call(y), "regexp") : f.stylize("[Object]", "special");
|
|
1667
|
+
f.seen.push(y);
|
|
1668
|
+
var pe;
|
|
1669
|
+
return Q ? pe = g(f, y, T, R, U) : pe = U.map(function(Pe) {
|
|
1670
|
+
return l(f, y, T, R, Pe, Q);
|
|
1671
|
+
}), f.seen.pop(), h(pe, M, ne);
|
|
1672
|
+
}
|
|
1673
|
+
function E(f, y) {
|
|
1674
|
+
if (v(y))
|
|
1675
|
+
return f.stylize("undefined", "undefined");
|
|
1676
|
+
if (z(y)) {
|
|
1677
|
+
var T = "'" + JSON.stringify(y).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
|
|
1678
|
+
return f.stylize(T, "string");
|
|
1679
|
+
}
|
|
1680
|
+
if (k(y))
|
|
1681
|
+
return f.stylize("" + y, "number");
|
|
1682
|
+
if (_(y))
|
|
1683
|
+
return f.stylize("" + y, "boolean");
|
|
1684
|
+
if (C(y))
|
|
1685
|
+
return f.stylize("null", "null");
|
|
1686
|
+
}
|
|
1687
|
+
function S(f) {
|
|
1688
|
+
return "[" + Error.prototype.toString.call(f) + "]";
|
|
1689
|
+
}
|
|
1690
|
+
function g(f, y, T, b, D) {
|
|
1691
|
+
for (var U = [], R = 0, P = y.length; R < P; ++R)
|
|
1692
|
+
le(y, String(R)) ? U.push(l(
|
|
1693
|
+
f,
|
|
1694
|
+
y,
|
|
1695
|
+
T,
|
|
1696
|
+
b,
|
|
1697
|
+
String(R),
|
|
1698
|
+
!0
|
|
1699
|
+
)) : U.push("");
|
|
1700
|
+
return D.forEach(function(M) {
|
|
1701
|
+
M.match(/^\d+$/) || U.push(l(
|
|
1702
|
+
f,
|
|
1703
|
+
y,
|
|
1704
|
+
T,
|
|
1705
|
+
b,
|
|
1706
|
+
M,
|
|
1707
|
+
!0
|
|
1708
|
+
));
|
|
1709
|
+
}), U;
|
|
1710
|
+
}
|
|
1711
|
+
function l(f, y, T, b, D, U) {
|
|
1712
|
+
var R, P, M;
|
|
1713
|
+
if (M = Object.getOwnPropertyDescriptor(y, D) || { value: y[D] }, M.get ? M.set ? P = f.stylize("[Getter/Setter]", "special") : P = f.stylize("[Getter]", "special") : M.set && (P = f.stylize("[Setter]", "special")), le(b, D) || (R = "[" + D + "]"), P || (f.seen.indexOf(M.value) < 0 ? (C(T) ? P = c(f, M.value, null) : P = c(f, M.value, T - 1), P.indexOf(`
|
|
1714
|
+
`) > -1 && (U ? P = P.split(`
|
|
1715
|
+
`).map(function(Q) {
|
|
1716
|
+
return " " + Q;
|
|
1717
|
+
}).join(`
|
|
1718
|
+
`).slice(2) : P = `
|
|
1719
|
+
` + P.split(`
|
|
1720
|
+
`).map(function(Q) {
|
|
1721
|
+
return " " + Q;
|
|
1722
|
+
}).join(`
|
|
1723
|
+
`))) : P = f.stylize("[Circular]", "special")), v(R)) {
|
|
1724
|
+
if (U && D.match(/^\d+$/))
|
|
1725
|
+
return P;
|
|
1726
|
+
R = JSON.stringify("" + D), R.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (R = R.slice(1, -1), R = f.stylize(R, "name")) : (R = R.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), R = f.stylize(R, "string"));
|
|
1727
|
+
}
|
|
1728
|
+
return R + ": " + P;
|
|
1729
|
+
}
|
|
1730
|
+
function h(f, y, T) {
|
|
1731
|
+
var b = f.reduce(function(D, U) {
|
|
1732
|
+
return U.indexOf(`
|
|
1733
|
+
`) >= 0, D + U.replace(/\u001b\[\d\d?m/g, "").length + 1;
|
|
1734
|
+
}, 0);
|
|
1735
|
+
return b > 60 ? T[0] + (y === "" ? "" : y + `
|
|
1736
|
+
`) + " " + f.join(`,
|
|
1737
|
+
`) + " " + T[1] : T[0] + y + " " + f.join(", ") + " " + T[1];
|
|
1738
|
+
}
|
|
1739
|
+
e.types = or;
|
|
1740
|
+
function A(f) {
|
|
1741
|
+
return Array.isArray(f);
|
|
1742
|
+
}
|
|
1743
|
+
e.isArray = A;
|
|
1744
|
+
function _(f) {
|
|
1745
|
+
return typeof f == "boolean";
|
|
1746
|
+
}
|
|
1747
|
+
e.isBoolean = _;
|
|
1748
|
+
function C(f) {
|
|
1749
|
+
return f === null;
|
|
1750
|
+
}
|
|
1751
|
+
e.isNull = C;
|
|
1752
|
+
function $(f) {
|
|
1753
|
+
return f == null;
|
|
1754
|
+
}
|
|
1755
|
+
e.isNullOrUndefined = $;
|
|
1756
|
+
function k(f) {
|
|
1757
|
+
return typeof f == "number";
|
|
1758
|
+
}
|
|
1759
|
+
e.isNumber = k;
|
|
1760
|
+
function z(f) {
|
|
1761
|
+
return typeof f == "string";
|
|
1762
|
+
}
|
|
1763
|
+
e.isString = z;
|
|
1764
|
+
function I(f) {
|
|
1765
|
+
return typeof f == "symbol";
|
|
1766
|
+
}
|
|
1767
|
+
e.isSymbol = I;
|
|
1768
|
+
function v(f) {
|
|
1769
|
+
return f === void 0;
|
|
1770
|
+
}
|
|
1771
|
+
e.isUndefined = v;
|
|
1772
|
+
function w(f) {
|
|
1773
|
+
return m(f) && X(f) === "[object RegExp]";
|
|
1774
|
+
}
|
|
1775
|
+
e.isRegExp = w, e.types.isRegExp = w;
|
|
1776
|
+
function m(f) {
|
|
1777
|
+
return typeof f == "object" && f !== null;
|
|
1778
|
+
}
|
|
1779
|
+
e.isObject = m;
|
|
1780
|
+
function O(f) {
|
|
1781
|
+
return m(f) && X(f) === "[object Date]";
|
|
1782
|
+
}
|
|
1783
|
+
e.isDate = O, e.types.isDate = O;
|
|
1784
|
+
function H(f) {
|
|
1785
|
+
return m(f) && (X(f) === "[object Error]" || f instanceof Error);
|
|
1786
|
+
}
|
|
1787
|
+
e.isError = H, e.types.isNativeError = H;
|
|
1788
|
+
function j(f) {
|
|
1789
|
+
return typeof f == "function";
|
|
1790
|
+
}
|
|
1791
|
+
e.isFunction = j;
|
|
1792
|
+
function Z(f) {
|
|
1793
|
+
return f === null || typeof f == "boolean" || typeof f == "number" || typeof f == "string" || typeof f == "symbol" || // ES6 symbol
|
|
1794
|
+
typeof f > "u";
|
|
1795
|
+
}
|
|
1796
|
+
e.isPrimitive = Z, e.isBuffer = wa;
|
|
1797
|
+
function X(f) {
|
|
1798
|
+
return Object.prototype.toString.call(f);
|
|
1799
|
+
}
|
|
1800
|
+
function x(f) {
|
|
1801
|
+
return f < 10 ? "0" + f.toString(10) : f.toString(10);
|
|
1802
|
+
}
|
|
1803
|
+
var de = [
|
|
1804
|
+
"Jan",
|
|
1805
|
+
"Feb",
|
|
1806
|
+
"Mar",
|
|
1807
|
+
"Apr",
|
|
1808
|
+
"May",
|
|
1809
|
+
"Jun",
|
|
1810
|
+
"Jul",
|
|
1811
|
+
"Aug",
|
|
1812
|
+
"Sep",
|
|
1813
|
+
"Oct",
|
|
1814
|
+
"Nov",
|
|
1815
|
+
"Dec"
|
|
1816
|
+
];
|
|
1817
|
+
function We() {
|
|
1818
|
+
var f = /* @__PURE__ */ new Date(), y = [
|
|
1819
|
+
x(f.getHours()),
|
|
1820
|
+
x(f.getMinutes()),
|
|
1821
|
+
x(f.getSeconds())
|
|
1822
|
+
].join(":");
|
|
1823
|
+
return [f.getDate(), de[f.getMonth()], y].join(" ");
|
|
1824
|
+
}
|
|
1825
|
+
e.log = function() {
|
|
1826
|
+
console.log("%s - %s", We(), e.format.apply(e, arguments));
|
|
1827
|
+
}, e.inherits = Pa, e._extend = function(f, y) {
|
|
1828
|
+
if (!y || !m(y))
|
|
1829
|
+
return f;
|
|
1830
|
+
for (var T = Object.keys(y), b = T.length; b--; )
|
|
1831
|
+
f[T[b]] = y[T[b]];
|
|
1832
|
+
return f;
|
|
1833
|
+
};
|
|
1834
|
+
function le(f, y) {
|
|
1835
|
+
return Object.prototype.hasOwnProperty.call(f, y);
|
|
1836
|
+
}
|
|
1837
|
+
var ee = typeof Symbol < "u" ? Symbol("util.promisify.custom") : void 0;
|
|
1838
|
+
e.promisify = function(y) {
|
|
1839
|
+
if (typeof y != "function")
|
|
1840
|
+
throw new TypeError('The "original" argument must be of type Function');
|
|
1841
|
+
if (ee && y[ee]) {
|
|
1842
|
+
var T = y[ee];
|
|
1843
|
+
if (typeof T != "function")
|
|
1844
|
+
throw new TypeError('The "util.promisify.custom" argument must be of type Function');
|
|
1845
|
+
return Object.defineProperty(T, ee, {
|
|
1846
|
+
value: T,
|
|
1847
|
+
enumerable: !1,
|
|
1848
|
+
writable: !1,
|
|
1849
|
+
configurable: !0
|
|
1850
|
+
}), T;
|
|
1851
|
+
}
|
|
1852
|
+
function T() {
|
|
1853
|
+
for (var b, D, U = new Promise(function(M, Q) {
|
|
1854
|
+
b = M, D = Q;
|
|
1855
|
+
}), R = [], P = 0; P < arguments.length; P++)
|
|
1856
|
+
R.push(arguments[P]);
|
|
1857
|
+
R.push(function(M, Q) {
|
|
1858
|
+
M ? D(M) : b(Q);
|
|
1859
|
+
});
|
|
1860
|
+
try {
|
|
1861
|
+
y.apply(this, R);
|
|
1862
|
+
} catch (M) {
|
|
1863
|
+
D(M);
|
|
1864
|
+
}
|
|
1865
|
+
return U;
|
|
1866
|
+
}
|
|
1867
|
+
return Object.setPrototypeOf(T, Object.getPrototypeOf(y)), ee && Object.defineProperty(T, ee, {
|
|
1868
|
+
value: T,
|
|
1869
|
+
enumerable: !1,
|
|
1870
|
+
writable: !1,
|
|
1871
|
+
configurable: !0
|
|
1872
|
+
}), Object.defineProperties(
|
|
1873
|
+
T,
|
|
1874
|
+
t(y)
|
|
1875
|
+
);
|
|
1876
|
+
}, e.promisify.custom = ee;
|
|
1877
|
+
function ye(f, y) {
|
|
1878
|
+
if (!f) {
|
|
1879
|
+
var T = new Error("Promise was rejected with a falsy value");
|
|
1880
|
+
T.reason = f, f = T;
|
|
1881
|
+
}
|
|
1882
|
+
return y(f);
|
|
1883
|
+
}
|
|
1884
|
+
function Ne(f) {
|
|
1885
|
+
if (typeof f != "function")
|
|
1886
|
+
throw new TypeError('The "original" argument must be of type Function');
|
|
1887
|
+
function y() {
|
|
1888
|
+
for (var T = [], b = 0; b < arguments.length; b++)
|
|
1889
|
+
T.push(arguments[b]);
|
|
1890
|
+
var D = T.pop();
|
|
1891
|
+
if (typeof D != "function")
|
|
1892
|
+
throw new TypeError("The last argument must be of type Function");
|
|
1893
|
+
var U = this, R = function() {
|
|
1894
|
+
return D.apply(U, arguments);
|
|
1895
|
+
};
|
|
1896
|
+
f.apply(this, T).then(
|
|
1897
|
+
function(P) {
|
|
1898
|
+
process.nextTick(R.bind(null, null, P));
|
|
1899
|
+
},
|
|
1900
|
+
function(P) {
|
|
1901
|
+
process.nextTick(ye.bind(null, P, R));
|
|
1902
|
+
}
|
|
1903
|
+
);
|
|
1904
|
+
}
|
|
1905
|
+
return Object.setPrototypeOf(y, Object.getPrototypeOf(f)), Object.defineProperties(
|
|
1906
|
+
y,
|
|
1907
|
+
t(f)
|
|
1908
|
+
), y;
|
|
1909
|
+
}
|
|
1910
|
+
e.callbackify = Ne;
|
|
1911
|
+
})(ir);
|
|
1912
|
+
var dt = {}, J = {}, Re = {};
|
|
1913
|
+
Object.defineProperty(Re, "__esModule", { value: !0 });
|
|
1914
|
+
const Ia = Object.freeze({
|
|
1915
|
+
CHARSET_DEFAULT: "utf-8",
|
|
1916
|
+
EXTENSIONS_PREFIX: "ce-",
|
|
1917
|
+
ENCODING_BASE64: "base64",
|
|
1918
|
+
DATA_ATTRIBUTE: "data",
|
|
1919
|
+
MIME_JSON: "application/json",
|
|
1920
|
+
MIME_OCTET_STREAM: "application/octet-stream",
|
|
1921
|
+
MIME_CE: "application/cloudevents",
|
|
1922
|
+
MIME_CE_JSON: "application/cloudevents+json",
|
|
1923
|
+
MIME_CE_BATCH: "application/cloudevents-batch+json",
|
|
1924
|
+
HEADER_CONTENT_TYPE: "content-type",
|
|
1925
|
+
DEFAULT_CONTENT_TYPE: "application/json; charset=utf-8",
|
|
1926
|
+
DEFAULT_CE_CONTENT_TYPE: "application/cloudevents+json; charset=utf-8",
|
|
1927
|
+
CE_HEADERS: {
|
|
1928
|
+
TYPE: "ce-type",
|
|
1929
|
+
SPEC_VERSION: "ce-specversion",
|
|
1930
|
+
SOURCE: "ce-source",
|
|
1931
|
+
ID: "ce-id",
|
|
1932
|
+
TIME: "ce-time",
|
|
1933
|
+
SUBJECT: "ce-subject"
|
|
1934
|
+
},
|
|
1935
|
+
CE_ATTRIBUTES: {
|
|
1936
|
+
ID: "id",
|
|
1937
|
+
TYPE: "type",
|
|
1938
|
+
SOURCE: "source",
|
|
1939
|
+
SPEC_VERSION: "specversion",
|
|
1940
|
+
TIME: "time",
|
|
1941
|
+
CONTENT_TYPE: "datacontenttype",
|
|
1942
|
+
SUBJECT: "subject",
|
|
1943
|
+
DATA: "data"
|
|
1944
|
+
},
|
|
1945
|
+
BINARY_HEADERS_03: {
|
|
1946
|
+
SCHEMA_URL: "ce-schemaurl",
|
|
1947
|
+
CONTENT_ENCODING: "ce-datacontentencoding"
|
|
1948
|
+
},
|
|
1949
|
+
STRUCTURED_ATTRS_03: {
|
|
1950
|
+
SCHEMA_URL: "schemaurl",
|
|
1951
|
+
CONTENT_ENCODING: "datacontentencoding"
|
|
1952
|
+
},
|
|
1953
|
+
BINARY_HEADERS_1: {
|
|
1954
|
+
DATA_SCHEMA: "ce-dataschema"
|
|
1955
|
+
},
|
|
1956
|
+
STRUCTURED_ATTRS_1: {
|
|
1957
|
+
DATA_SCHEMA: "dataschema",
|
|
1958
|
+
DATA_BASE64: "data_base64"
|
|
1959
|
+
}
|
|
1960
|
+
});
|
|
1961
|
+
Re.default = Ia;
|
|
1962
|
+
var Da = L && L.__importDefault || function(e) {
|
|
1963
|
+
return e && e.__esModule ? e : { default: e };
|
|
1964
|
+
};
|
|
1965
|
+
Object.defineProperty(J, "__esModule", { value: !0 });
|
|
1966
|
+
J.parserByEncoding = J.DateParser = J.Base64Parser = J.parserByContentType = J.PassThroughParser = J.JSONParser = J.Parser = void 0;
|
|
1967
|
+
const oe = Da(Re), be = ce;
|
|
1968
|
+
class Nt {
|
|
1969
|
+
}
|
|
1970
|
+
J.Parser = Nt;
|
|
1971
|
+
class wt {
|
|
1972
|
+
constructor(t) {
|
|
1973
|
+
this.decorator = t;
|
|
1974
|
+
}
|
|
1975
|
+
/**
|
|
1976
|
+
* Parses the payload with an optional decorator
|
|
1977
|
+
* @param {object|string} payload the JSON payload
|
|
1978
|
+
* @return {object} the parsed JSON payload.
|
|
1979
|
+
*/
|
|
1980
|
+
parse(t) {
|
|
1981
|
+
return typeof t == "string" && (/^[[|{|"]/.test(t) || (t = `"${t}"`)), this.decorator && (t = this.decorator.parse(t)), (0, be.isDefinedOrThrow)(t, new be.ValidationError("null or undefined payload")), (0, be.isStringOrObjectOrThrow)(t, new be.ValidationError("invalid payload type, allowed are: string or object")), ((a) => (0, be.isString)(a) ? JSON.parse(a) : a)(t);
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
J.JSONParser = wt;
|
|
1985
|
+
class Pt extends Nt {
|
|
1986
|
+
parse(t) {
|
|
1987
|
+
return t;
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
J.PassThroughParser = Pt;
|
|
1991
|
+
const De = new wt();
|
|
1992
|
+
J.parserByContentType = {
|
|
1993
|
+
[oe.default.MIME_JSON]: De,
|
|
1994
|
+
[oe.default.MIME_CE_JSON]: De,
|
|
1995
|
+
[oe.default.DEFAULT_CONTENT_TYPE]: De,
|
|
1996
|
+
[oe.default.DEFAULT_CE_CONTENT_TYPE]: De,
|
|
1997
|
+
[oe.default.MIME_OCTET_STREAM]: new Pt()
|
|
1998
|
+
};
|
|
1999
|
+
class mr {
|
|
2000
|
+
constructor(t) {
|
|
2001
|
+
this.decorator = t;
|
|
2002
|
+
}
|
|
2003
|
+
parse(t) {
|
|
2004
|
+
let r = t;
|
|
2005
|
+
return this.decorator && (r = this.decorator.parse(t)), Buffer.from(r, "base64").toString();
|
|
2006
|
+
}
|
|
2007
|
+
}
|
|
2008
|
+
J.Base64Parser = mr;
|
|
2009
|
+
class ja extends Nt {
|
|
2010
|
+
parse(t) {
|
|
2011
|
+
let r = new Date(Date.parse(t));
|
|
2012
|
+
return r.toString() === "Invalid Date" && (r = /* @__PURE__ */ new Date()), r.toISOString();
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
2015
|
+
J.DateParser = ja;
|
|
2016
|
+
J.parserByEncoding = {
|
|
2017
|
+
base64: {
|
|
2018
|
+
[oe.default.MIME_CE_JSON]: new wt(new mr()),
|
|
2019
|
+
[oe.default.MIME_OCTET_STREAM]: new Pt()
|
|
2020
|
+
}
|
|
2021
|
+
};
|
|
2022
|
+
var kt;
|
|
2023
|
+
function Ar() {
|
|
2024
|
+
return kt || (kt = 1, function(e) {
|
|
2025
|
+
var t = L && L.__importDefault || function(d) {
|
|
2026
|
+
return d && d.__esModule ? d : { default: d };
|
|
2027
|
+
};
|
|
2028
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.v03structuredParsers = e.v03binaryParsers = e.v03headerMap = e.v1structuredParsers = e.v1binaryParsers = e.v1headerMap = e.sanitize = e.headersFor = e.requiredHeaders = e.allowedContentTypes = void 0;
|
|
2029
|
+
const r = J, a = _t(), n = t(Re);
|
|
2030
|
+
e.allowedContentTypes = [n.default.DEFAULT_CONTENT_TYPE, n.default.MIME_JSON, n.default.MIME_OCTET_STREAM], e.requiredHeaders = [
|
|
2031
|
+
n.default.CE_HEADERS.ID,
|
|
2032
|
+
n.default.CE_HEADERS.SOURCE,
|
|
2033
|
+
n.default.CE_HEADERS.TYPE,
|
|
2034
|
+
n.default.CE_HEADERS.SPEC_VERSION
|
|
2035
|
+
];
|
|
2036
|
+
function i(d) {
|
|
2037
|
+
const u = {};
|
|
2038
|
+
let c;
|
|
2039
|
+
return d.specversion === a.Version.V1 ? c = e.v1headerMap : c = e.v03headerMap, Object.getOwnPropertyNames(d).forEach((E) => {
|
|
2040
|
+
const S = d[E];
|
|
2041
|
+
if (S !== void 0) {
|
|
2042
|
+
const g = c[E];
|
|
2043
|
+
g ? u[g.name] = g.parser.parse(S) : E !== n.default.DATA_ATTRIBUTE && E !== `${n.default.DATA_ATTRIBUTE}_base64` && (u[`${n.default.EXTENSIONS_PREFIX}${E}`] = S);
|
|
2044
|
+
}
|
|
2045
|
+
}), d.time && (u[n.default.CE_HEADERS.TIME] = new Date(d.time).toISOString()), u;
|
|
2046
|
+
}
|
|
2047
|
+
e.headersFor = i;
|
|
2048
|
+
function o(d) {
|
|
2049
|
+
const u = {};
|
|
2050
|
+
return Array.from(Object.keys(d)).filter((c) => Object.hasOwnProperty.call(d, c)).forEach((c) => u[c.toLowerCase()] = d[c]), u;
|
|
2051
|
+
}
|
|
2052
|
+
e.sanitize = o;
|
|
2053
|
+
function s(d, u = new r.PassThroughParser()) {
|
|
2054
|
+
return { name: d, parser: u };
|
|
2055
|
+
}
|
|
2056
|
+
e.v1headerMap = Object.freeze({
|
|
2057
|
+
[n.default.CE_ATTRIBUTES.CONTENT_TYPE]: s(n.default.HEADER_CONTENT_TYPE),
|
|
2058
|
+
[n.default.CE_ATTRIBUTES.SUBJECT]: s(n.default.CE_HEADERS.SUBJECT),
|
|
2059
|
+
[n.default.CE_ATTRIBUTES.TYPE]: s(n.default.CE_HEADERS.TYPE),
|
|
2060
|
+
[n.default.CE_ATTRIBUTES.SPEC_VERSION]: s(n.default.CE_HEADERS.SPEC_VERSION),
|
|
2061
|
+
[n.default.CE_ATTRIBUTES.SOURCE]: s(n.default.CE_HEADERS.SOURCE),
|
|
2062
|
+
[n.default.CE_ATTRIBUTES.ID]: s(n.default.CE_HEADERS.ID),
|
|
2063
|
+
[n.default.CE_ATTRIBUTES.TIME]: s(n.default.CE_HEADERS.TIME),
|
|
2064
|
+
[n.default.STRUCTURED_ATTRS_1.DATA_SCHEMA]: s(n.default.BINARY_HEADERS_1.DATA_SCHEMA)
|
|
2065
|
+
}), e.v1binaryParsers = Object.freeze({
|
|
2066
|
+
[n.default.CE_HEADERS.TYPE]: s(n.default.CE_ATTRIBUTES.TYPE),
|
|
2067
|
+
[n.default.CE_HEADERS.SPEC_VERSION]: s(n.default.CE_ATTRIBUTES.SPEC_VERSION),
|
|
2068
|
+
[n.default.CE_HEADERS.SOURCE]: s(n.default.CE_ATTRIBUTES.SOURCE),
|
|
2069
|
+
[n.default.CE_HEADERS.ID]: s(n.default.CE_ATTRIBUTES.ID),
|
|
2070
|
+
[n.default.CE_HEADERS.TIME]: s(n.default.CE_ATTRIBUTES.TIME, new r.DateParser()),
|
|
2071
|
+
[n.default.BINARY_HEADERS_1.DATA_SCHEMA]: s(n.default.STRUCTURED_ATTRS_1.DATA_SCHEMA),
|
|
2072
|
+
[n.default.CE_HEADERS.SUBJECT]: s(n.default.CE_ATTRIBUTES.SUBJECT),
|
|
2073
|
+
[n.default.CE_ATTRIBUTES.CONTENT_TYPE]: s(n.default.CE_ATTRIBUTES.CONTENT_TYPE),
|
|
2074
|
+
[n.default.HEADER_CONTENT_TYPE]: s(n.default.CE_ATTRIBUTES.CONTENT_TYPE)
|
|
2075
|
+
}), e.v1structuredParsers = Object.freeze({
|
|
2076
|
+
[n.default.CE_ATTRIBUTES.TYPE]: s(n.default.CE_ATTRIBUTES.TYPE),
|
|
2077
|
+
[n.default.CE_ATTRIBUTES.SPEC_VERSION]: s(n.default.CE_ATTRIBUTES.SPEC_VERSION),
|
|
2078
|
+
[n.default.CE_ATTRIBUTES.SOURCE]: s(n.default.CE_ATTRIBUTES.SOURCE),
|
|
2079
|
+
[n.default.CE_ATTRIBUTES.ID]: s(n.default.CE_ATTRIBUTES.ID),
|
|
2080
|
+
[n.default.CE_ATTRIBUTES.TIME]: s(n.default.CE_ATTRIBUTES.TIME, new r.DateParser()),
|
|
2081
|
+
[n.default.STRUCTURED_ATTRS_1.DATA_SCHEMA]: s(n.default.STRUCTURED_ATTRS_1.DATA_SCHEMA),
|
|
2082
|
+
[n.default.CE_ATTRIBUTES.CONTENT_TYPE]: s(n.default.CE_ATTRIBUTES.CONTENT_TYPE),
|
|
2083
|
+
[n.default.CE_ATTRIBUTES.SUBJECT]: s(n.default.CE_ATTRIBUTES.SUBJECT),
|
|
2084
|
+
[n.default.CE_ATTRIBUTES.DATA]: s(n.default.CE_ATTRIBUTES.DATA),
|
|
2085
|
+
[n.default.STRUCTURED_ATTRS_1.DATA_BASE64]: s(n.default.STRUCTURED_ATTRS_1.DATA_BASE64)
|
|
2086
|
+
}), e.v03headerMap = Object.freeze({
|
|
2087
|
+
[n.default.CE_ATTRIBUTES.CONTENT_TYPE]: s(n.default.HEADER_CONTENT_TYPE),
|
|
2088
|
+
[n.default.CE_ATTRIBUTES.SUBJECT]: s(n.default.CE_HEADERS.SUBJECT),
|
|
2089
|
+
[n.default.CE_ATTRIBUTES.TYPE]: s(n.default.CE_HEADERS.TYPE),
|
|
2090
|
+
[n.default.CE_ATTRIBUTES.SPEC_VERSION]: s(n.default.CE_HEADERS.SPEC_VERSION),
|
|
2091
|
+
[n.default.CE_ATTRIBUTES.SOURCE]: s(n.default.CE_HEADERS.SOURCE),
|
|
2092
|
+
[n.default.CE_ATTRIBUTES.ID]: s(n.default.CE_HEADERS.ID),
|
|
2093
|
+
[n.default.CE_ATTRIBUTES.TIME]: s(n.default.CE_HEADERS.TIME),
|
|
2094
|
+
[n.default.STRUCTURED_ATTRS_03.CONTENT_ENCODING]: s(n.default.BINARY_HEADERS_03.CONTENT_ENCODING),
|
|
2095
|
+
[n.default.STRUCTURED_ATTRS_03.SCHEMA_URL]: s(n.default.BINARY_HEADERS_03.SCHEMA_URL)
|
|
2096
|
+
}), e.v03binaryParsers = Object.freeze({
|
|
2097
|
+
[n.default.CE_HEADERS.TYPE]: s(n.default.CE_ATTRIBUTES.TYPE),
|
|
2098
|
+
[n.default.CE_HEADERS.SPEC_VERSION]: s(n.default.CE_ATTRIBUTES.SPEC_VERSION),
|
|
2099
|
+
[n.default.CE_HEADERS.SOURCE]: s(n.default.CE_ATTRIBUTES.SOURCE),
|
|
2100
|
+
[n.default.CE_HEADERS.ID]: s(n.default.CE_ATTRIBUTES.ID),
|
|
2101
|
+
[n.default.CE_HEADERS.TIME]: s(n.default.CE_ATTRIBUTES.TIME, new r.DateParser()),
|
|
2102
|
+
[n.default.BINARY_HEADERS_03.SCHEMA_URL]: s(n.default.STRUCTURED_ATTRS_03.SCHEMA_URL),
|
|
2103
|
+
[n.default.CE_HEADERS.SUBJECT]: s(n.default.CE_ATTRIBUTES.SUBJECT),
|
|
2104
|
+
[n.default.BINARY_HEADERS_03.CONTENT_ENCODING]: s(n.default.STRUCTURED_ATTRS_03.CONTENT_ENCODING),
|
|
2105
|
+
[n.default.HEADER_CONTENT_TYPE]: s(n.default.CE_ATTRIBUTES.CONTENT_TYPE)
|
|
2106
|
+
}), e.v03structuredParsers = Object.freeze({
|
|
2107
|
+
[n.default.CE_ATTRIBUTES.TYPE]: s(n.default.CE_ATTRIBUTES.TYPE),
|
|
2108
|
+
[n.default.CE_ATTRIBUTES.SPEC_VERSION]: s(n.default.CE_ATTRIBUTES.SPEC_VERSION),
|
|
2109
|
+
[n.default.CE_ATTRIBUTES.SOURCE]: s(n.default.CE_ATTRIBUTES.SOURCE),
|
|
2110
|
+
[n.default.CE_ATTRIBUTES.ID]: s(n.default.CE_ATTRIBUTES.ID),
|
|
2111
|
+
[n.default.CE_ATTRIBUTES.TIME]: s(n.default.CE_ATTRIBUTES.TIME, new r.DateParser()),
|
|
2112
|
+
[n.default.STRUCTURED_ATTRS_03.SCHEMA_URL]: s(n.default.STRUCTURED_ATTRS_03.SCHEMA_URL),
|
|
2113
|
+
[n.default.STRUCTURED_ATTRS_03.CONTENT_ENCODING]: s(n.default.STRUCTURED_ATTRS_03.CONTENT_ENCODING),
|
|
2114
|
+
[n.default.CE_ATTRIBUTES.CONTENT_TYPE]: s(n.default.CE_ATTRIBUTES.CONTENT_TYPE),
|
|
2115
|
+
[n.default.CE_ATTRIBUTES.SUBJECT]: s(n.default.CE_ATTRIBUTES.SUBJECT),
|
|
2116
|
+
[n.default.CE_ATTRIBUTES.DATA]: s(n.default.CE_ATTRIBUTES.DATA)
|
|
2117
|
+
});
|
|
2118
|
+
}(dt)), dt;
|
|
2119
|
+
}
|
|
2120
|
+
var Vt;
|
|
2121
|
+
function Ua() {
|
|
2122
|
+
if (Vt)
|
|
2123
|
+
return ge;
|
|
2124
|
+
Vt = 1, Object.defineProperty(ge, "__esModule", { value: !0 }), ge.HTTP = void 0;
|
|
2125
|
+
const e = ir, t = Ae(), r = Ar(), a = ce, n = J;
|
|
2126
|
+
function i(l) {
|
|
2127
|
+
const h = { [t.CONSTANTS.HEADER_CONTENT_TYPE]: t.CONSTANTS.DEFAULT_CONTENT_TYPE }, A = Object.assign(Object.assign({}, h), (0, r.headersFor)(l));
|
|
2128
|
+
let _ = l.data;
|
|
2129
|
+
return typeof l.data == "object" && !e.types.isTypedArray(l.data) && (_ = JSON.stringify(l.data)), {
|
|
2130
|
+
headers: A,
|
|
2131
|
+
body: _
|
|
2132
|
+
};
|
|
2133
|
+
}
|
|
2134
|
+
function o(l) {
|
|
2135
|
+
return l.data_base64 && (l = l.cloneWith({ data: void 0 })), {
|
|
2136
|
+
headers: {
|
|
2137
|
+
[t.CONSTANTS.HEADER_CONTENT_TYPE]: t.CONSTANTS.DEFAULT_CE_CONTENT_TYPE
|
|
2138
|
+
},
|
|
2139
|
+
body: l.toString()
|
|
2140
|
+
};
|
|
2141
|
+
}
|
|
2142
|
+
function s(l) {
|
|
2143
|
+
try {
|
|
2144
|
+
return d(l), !0;
|
|
2145
|
+
} catch {
|
|
2146
|
+
return !1;
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
function d(l) {
|
|
2150
|
+
const h = (0, r.sanitize)(l.headers), A = u(h), _ = c(A, h, l.body);
|
|
2151
|
+
switch (A) {
|
|
2152
|
+
case t.Mode.BINARY:
|
|
2153
|
+
return E(l, _);
|
|
2154
|
+
case t.Mode.STRUCTURED:
|
|
2155
|
+
return S(l, _);
|
|
2156
|
+
case t.Mode.BATCH:
|
|
2157
|
+
return g(l);
|
|
2158
|
+
default:
|
|
2159
|
+
throw new a.ValidationError("Unknown Message mode");
|
|
2160
|
+
}
|
|
2161
|
+
}
|
|
2162
|
+
function u(l) {
|
|
2163
|
+
const h = l[t.CONSTANTS.HEADER_CONTENT_TYPE];
|
|
2164
|
+
if (h) {
|
|
2165
|
+
if (h.startsWith(t.CONSTANTS.MIME_CE_BATCH))
|
|
2166
|
+
return t.Mode.BATCH;
|
|
2167
|
+
if (h.startsWith(t.CONSTANTS.MIME_CE))
|
|
2168
|
+
return t.Mode.STRUCTURED;
|
|
2169
|
+
}
|
|
2170
|
+
if (l[t.CONSTANTS.CE_HEADERS.ID])
|
|
2171
|
+
return t.Mode.BINARY;
|
|
2172
|
+
throw new a.ValidationError("no cloud event detected");
|
|
2173
|
+
}
|
|
2174
|
+
function c(l, h, A) {
|
|
2175
|
+
if (l === t.Mode.BINARY) {
|
|
2176
|
+
const _ = h[t.CONSTANTS.CE_HEADERS.SPEC_VERSION];
|
|
2177
|
+
if (_)
|
|
2178
|
+
return _;
|
|
2179
|
+
} else
|
|
2180
|
+
return typeof A == "string" ? JSON.parse(A).specversion : A.specversion;
|
|
2181
|
+
return t.Version.V1;
|
|
2182
|
+
}
|
|
2183
|
+
function E(l, h) {
|
|
2184
|
+
const A = Object.assign({}, l.headers);
|
|
2185
|
+
let _ = l.body;
|
|
2186
|
+
if (!A)
|
|
2187
|
+
throw new a.ValidationError("headers is null or undefined");
|
|
2188
|
+
const C = (0, r.sanitize)(A), $ = {}, k = h === t.Version.V03 ? r.v03binaryParsers : r.v1binaryParsers;
|
|
2189
|
+
for (const I in k)
|
|
2190
|
+
if (C[I]) {
|
|
2191
|
+
const v = k[I];
|
|
2192
|
+
$[v.name] = v.parser.parse(C[I]), delete C[I], delete A[I];
|
|
2193
|
+
}
|
|
2194
|
+
for (const I in A)
|
|
2195
|
+
I.startsWith(t.CONSTANTS.EXTENSIONS_PREFIX) && ($[I.substring(t.CONSTANTS.EXTENSIONS_PREFIX.length)] = A[I]);
|
|
2196
|
+
const z = n.parserByContentType[$.datacontenttype];
|
|
2197
|
+
return z && _ && (_ = z.parse(_)), $.datacontenttype === t.CONSTANTS.MIME_JSON && $.datacontentencoding === t.CONSTANTS.ENCODING_BASE64 && delete $.datacontentencoding, new t.CloudEvent(Object.assign(Object.assign({}, $), { data: _ }), !1);
|
|
2198
|
+
}
|
|
2199
|
+
function S(l, h) {
|
|
2200
|
+
const A = l.body, _ = l.headers;
|
|
2201
|
+
if (!A)
|
|
2202
|
+
throw new a.ValidationError("payload is null or undefined");
|
|
2203
|
+
if (!_)
|
|
2204
|
+
throw new a.ValidationError("headers is null or undefined");
|
|
2205
|
+
(0, a.isStringOrObjectOrThrow)(A, new a.ValidationError("payload must be an object or a string"));
|
|
2206
|
+
const C = (0, r.sanitize)(_), $ = C[t.CONSTANTS.HEADER_CONTENT_TYPE], k = $ ? n.parserByContentType[$] : new n.JSONParser();
|
|
2207
|
+
if (!k)
|
|
2208
|
+
throw new a.ValidationError(`invalid content type ${C[t.CONSTANTS.HEADER_CONTENT_TYPE]}`);
|
|
2209
|
+
const z = Object.assign({}, k.parse(A)), I = {}, v = h === t.Version.V03 ? r.v03structuredParsers : r.v1structuredParsers;
|
|
2210
|
+
for (const w in v) {
|
|
2211
|
+
const m = z[w];
|
|
2212
|
+
if (m) {
|
|
2213
|
+
const O = v[w];
|
|
2214
|
+
I[O.name] = O.parser.parse(m);
|
|
2215
|
+
}
|
|
2216
|
+
delete z[w];
|
|
2217
|
+
}
|
|
2218
|
+
for (const w in z)
|
|
2219
|
+
I[w] = z[w];
|
|
2220
|
+
if (I.data_base64 || I.datacontentencoding === t.CONSTANTS.ENCODING_BASE64) {
|
|
2221
|
+
const w = I.data_base64 || I.data;
|
|
2222
|
+
I.data = new Uint32Array(Buffer.from(w, "base64")), delete I.data_base64, delete I.datacontentencoding;
|
|
2223
|
+
}
|
|
2224
|
+
return new t.CloudEvent(I, !1);
|
|
2225
|
+
}
|
|
2226
|
+
function g(l) {
|
|
2227
|
+
const h = [];
|
|
2228
|
+
return JSON.parse(l.body).forEach((_) => {
|
|
2229
|
+
h.push(new t.CloudEvent(_));
|
|
2230
|
+
}), h;
|
|
2231
|
+
}
|
|
2232
|
+
return ge.HTTP = {
|
|
2233
|
+
binary: i,
|
|
2234
|
+
structured: o,
|
|
2235
|
+
toEvent: d,
|
|
2236
|
+
isEvent: s
|
|
2237
|
+
}, ge;
|
|
2238
|
+
}
|
|
2239
|
+
var Oe = {}, lt = {}, Yt;
|
|
2240
|
+
function Ba() {
|
|
2241
|
+
return Yt || (Yt = 1, function(e) {
|
|
2242
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.headersFor = e.HEADER_MAP = e.KAFKA_CE_HEADERS = void 0;
|
|
2243
|
+
const t = Ae();
|
|
2244
|
+
e.KAFKA_CE_HEADERS = Object.freeze({
|
|
2245
|
+
/** corresponds to the CloudEvent#id */
|
|
2246
|
+
ID: "ce_id",
|
|
2247
|
+
/** corresponds to the CloudEvent#type */
|
|
2248
|
+
TYPE: "ce_type",
|
|
2249
|
+
/** corresponds to the CloudEvent#source */
|
|
2250
|
+
SOURCE: "ce_source",
|
|
2251
|
+
/** corresponds to the CloudEvent#specversion */
|
|
2252
|
+
SPEC_VERSION: "ce_specversion",
|
|
2253
|
+
/** corresponds to the CloudEvent#time */
|
|
2254
|
+
TIME: "ce_time",
|
|
2255
|
+
/** corresponds to the CloudEvent#subject */
|
|
2256
|
+
SUBJECT: "ce_subject",
|
|
2257
|
+
/** corresponds to the CloudEvent#datacontenttype */
|
|
2258
|
+
DATACONTENTTYPE: "ce_datacontenttype",
|
|
2259
|
+
/** corresponds to the CloudEvent#dataschema */
|
|
2260
|
+
DATASCHEMA: "ce_dataschema"
|
|
2261
|
+
}), e.HEADER_MAP = {
|
|
2262
|
+
[e.KAFKA_CE_HEADERS.ID]: "id",
|
|
2263
|
+
[e.KAFKA_CE_HEADERS.TYPE]: "type",
|
|
2264
|
+
[e.KAFKA_CE_HEADERS.SOURCE]: "source",
|
|
2265
|
+
[e.KAFKA_CE_HEADERS.SPEC_VERSION]: "specversion",
|
|
2266
|
+
[e.KAFKA_CE_HEADERS.TIME]: "time",
|
|
2267
|
+
[e.KAFKA_CE_HEADERS.SUBJECT]: "subject",
|
|
2268
|
+
[e.KAFKA_CE_HEADERS.DATACONTENTTYPE]: "datacontenttype",
|
|
2269
|
+
[e.KAFKA_CE_HEADERS.DATASCHEMA]: "dataschema"
|
|
2270
|
+
};
|
|
2271
|
+
function r(a) {
|
|
2272
|
+
const n = {};
|
|
2273
|
+
return Object.getOwnPropertyNames(a).forEach((i) => {
|
|
2274
|
+
i != t.CONSTANTS.CE_ATTRIBUTES.DATA && i != t.CONSTANTS.STRUCTURED_ATTRS_1.DATA_BASE64 && (n[`ce_${i}`] = a[i]);
|
|
2275
|
+
}), n;
|
|
2276
|
+
}
|
|
2277
|
+
e.headersFor = r;
|
|
2278
|
+
}(lt)), lt;
|
|
2279
|
+
}
|
|
2280
|
+
var Jt;
|
|
2281
|
+
function Ma() {
|
|
2282
|
+
if (Jt)
|
|
2283
|
+
return Oe;
|
|
2284
|
+
Jt = 1, Object.defineProperty(Oe, "__esModule", { value: !0 }), Oe.Kafka = void 0;
|
|
2285
|
+
const e = Ae(), t = Ba(), r = Ar(), a = {
|
|
2286
|
+
binary: n,
|
|
2287
|
+
structured: i,
|
|
2288
|
+
toEvent: o,
|
|
2289
|
+
isEvent: s
|
|
2290
|
+
};
|
|
2291
|
+
Oe.Kafka = a;
|
|
2292
|
+
function n(l) {
|
|
2293
|
+
return {
|
|
2294
|
+
headers: Object.assign({ [e.CONSTANTS.HEADER_CONTENT_TYPE]: l.datacontenttype }, (0, t.headersFor)(l)),
|
|
2295
|
+
key: l.partitionkey,
|
|
2296
|
+
value: l.data,
|
|
2297
|
+
body: l.data,
|
|
2298
|
+
timestamp: g(l.time)
|
|
2299
|
+
};
|
|
2300
|
+
}
|
|
2301
|
+
function i(l) {
|
|
2302
|
+
l instanceof e.CloudEvent && l.data_base64 && (l = l.cloneWith({ data: void 0 }));
|
|
2303
|
+
const h = l.toString();
|
|
2304
|
+
return {
|
|
2305
|
+
// All events may not have a partitionkey set, but if they do,
|
|
2306
|
+
// use it for the KafkaMessage#key per
|
|
2307
|
+
// https://github.com/cloudevents/spec/blob/v1.0.1/kafka-protocol-binding.md#31-key-mapping
|
|
2308
|
+
key: l.partitionkey,
|
|
2309
|
+
value: h,
|
|
2310
|
+
headers: {
|
|
2311
|
+
[e.CONSTANTS.HEADER_CONTENT_TYPE]: e.CONSTANTS.DEFAULT_CE_CONTENT_TYPE
|
|
2312
|
+
},
|
|
2313
|
+
body: h,
|
|
2314
|
+
timestamp: g(l.time)
|
|
2315
|
+
};
|
|
2316
|
+
}
|
|
2317
|
+
function o(l) {
|
|
2318
|
+
if (!s(l))
|
|
2319
|
+
throw new e.ValidationError("No CloudEvent detected");
|
|
2320
|
+
const h = l;
|
|
2321
|
+
if (!h.value)
|
|
2322
|
+
throw new e.ValidationError("Value is null or undefined");
|
|
2323
|
+
if (!h.headers)
|
|
2324
|
+
throw new e.ValidationError("Headers are null or undefined");
|
|
2325
|
+
const A = (0, r.sanitize)(h.headers);
|
|
2326
|
+
switch (d(A)) {
|
|
2327
|
+
case e.Mode.BINARY:
|
|
2328
|
+
return u(h);
|
|
2329
|
+
case e.Mode.STRUCTURED:
|
|
2330
|
+
return c(h);
|
|
2331
|
+
case e.Mode.BATCH:
|
|
2332
|
+
return E(h);
|
|
2333
|
+
default:
|
|
2334
|
+
throw new e.ValidationError("Unknown Message mode");
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
function s(l) {
|
|
2338
|
+
var h, A;
|
|
2339
|
+
const _ = (0, r.sanitize)(l.headers);
|
|
2340
|
+
return !!_[t.KAFKA_CE_HEADERS.ID] || // A binary mode event
|
|
2341
|
+
((h = _[e.CONSTANTS.HEADER_CONTENT_TYPE]) === null || h === void 0 ? void 0 : h.startsWith(e.CONSTANTS.MIME_CE)) || // A structured mode event
|
|
2342
|
+
((A = _[e.CONSTANTS.HEADER_CONTENT_TYPE]) === null || A === void 0 ? void 0 : A.startsWith(e.CONSTANTS.MIME_CE_BATCH));
|
|
2343
|
+
}
|
|
2344
|
+
function d(l) {
|
|
2345
|
+
const h = l[e.CONSTANTS.HEADER_CONTENT_TYPE];
|
|
2346
|
+
if (h) {
|
|
2347
|
+
if (h.startsWith(e.CONSTANTS.MIME_CE_BATCH))
|
|
2348
|
+
return e.Mode.BATCH;
|
|
2349
|
+
if (h.startsWith(e.CONSTANTS.MIME_CE))
|
|
2350
|
+
return e.Mode.STRUCTURED;
|
|
2351
|
+
}
|
|
2352
|
+
return e.Mode.BINARY;
|
|
2353
|
+
}
|
|
2354
|
+
function u(l) {
|
|
2355
|
+
const h = {}, A = Object.assign({}, l.headers);
|
|
2356
|
+
h.datacontenttype = A[e.CONSTANTS.HEADER_CONTENT_TYPE];
|
|
2357
|
+
for (const _ in t.KAFKA_CE_HEADERS) {
|
|
2358
|
+
const C = t.KAFKA_CE_HEADERS[_];
|
|
2359
|
+
A[C] && (h[t.HEADER_MAP[C]] = A[C], C === t.KAFKA_CE_HEADERS.TIME && (h.time = new Date(h.time).toISOString()), delete A[C]);
|
|
2360
|
+
}
|
|
2361
|
+
for (const _ in A)
|
|
2362
|
+
_.startsWith("ce_") && (h[_.replace("ce_", "")] = A[_]);
|
|
2363
|
+
return new e.CloudEvent(Object.assign(Object.assign({}, h), { data: S(l), partitionkey: l.key }), !1);
|
|
2364
|
+
}
|
|
2365
|
+
function c(l) {
|
|
2366
|
+
var h;
|
|
2367
|
+
if (!(!((h = l.headers[e.CONSTANTS.HEADER_CONTENT_TYPE]) === null || h === void 0) && h.startsWith(e.CONSTANTS.MIME_CE_JSON)))
|
|
2368
|
+
throw new e.ValidationError(`Unsupported event encoding ${l.headers[e.CONSTANTS.HEADER_CONTENT_TYPE]}`);
|
|
2369
|
+
const A = JSON.parse(l.value);
|
|
2370
|
+
return A.time = new Date(A.time).toISOString(), new e.CloudEvent(Object.assign(Object.assign({}, A), { partitionkey: l.key }), !1);
|
|
2371
|
+
}
|
|
2372
|
+
function E(l) {
|
|
2373
|
+
var h;
|
|
2374
|
+
if (!(!((h = l.headers[e.CONSTANTS.HEADER_CONTENT_TYPE]) === null || h === void 0) && h.startsWith(e.CONSTANTS.MIME_CE_BATCH)))
|
|
2375
|
+
throw new e.ValidationError(`Unsupported event encoding ${l.headers[e.CONSTANTS.HEADER_CONTENT_TYPE]}`);
|
|
2376
|
+
return JSON.parse(l.value).map((_) => new e.CloudEvent(Object.assign(Object.assign({}, _), { partitionkey: l.key }), !1));
|
|
2377
|
+
}
|
|
2378
|
+
function S(l) {
|
|
2379
|
+
let h = l.value;
|
|
2380
|
+
const A = l.headers[e.CONSTANTS.HEADER_CONTENT_TYPE];
|
|
2381
|
+
return A && A.startsWith(e.CONSTANTS.MIME_JSON) && (typeof l.value == "string" ? h = JSON.parse(l.value) : typeof l.value == "object" && Buffer.isBuffer(l.value) && (h = JSON.parse(l.value.toString()))), h;
|
|
2382
|
+
}
|
|
2383
|
+
function g(l) {
|
|
2384
|
+
return l ? `${Date.parse(l)}` : void 0;
|
|
2385
|
+
}
|
|
2386
|
+
return Oe;
|
|
2387
|
+
}
|
|
2388
|
+
var ie = {}, qt;
|
|
2389
|
+
function $a() {
|
|
2390
|
+
if (qt)
|
|
2391
|
+
return ie;
|
|
2392
|
+
qt = 1, Object.defineProperty(ie, "__esModule", { value: !0 }), ie.MQTTMessageFactory = ie.MQTT = void 0;
|
|
2393
|
+
const e = Ae(), t = ce, r = {
|
|
2394
|
+
binary: a,
|
|
2395
|
+
structured: n,
|
|
2396
|
+
toEvent: o,
|
|
2397
|
+
isEvent: s
|
|
2398
|
+
};
|
|
2399
|
+
ie.MQTT = r;
|
|
2400
|
+
function a(c) {
|
|
2401
|
+
const E = Object.assign({}, c);
|
|
2402
|
+
let S = E.data;
|
|
2403
|
+
return !S && E.data_base64 && (S = (0, t.base64AsBinary)(E.data_base64)), delete E.data, delete E.data_base64, i(c.datacontenttype, E, S);
|
|
2404
|
+
}
|
|
2405
|
+
function n(c) {
|
|
2406
|
+
let E;
|
|
2407
|
+
return c instanceof e.CloudEvent ? E = c.toJSON() : E = c, i(e.CONSTANTS.DEFAULT_CE_CONTENT_TYPE, {}, E);
|
|
2408
|
+
}
|
|
2409
|
+
function i(c, E, S) {
|
|
2410
|
+
return {
|
|
2411
|
+
PUBLISH: {
|
|
2412
|
+
"Content Type": c
|
|
2413
|
+
},
|
|
2414
|
+
body: S,
|
|
2415
|
+
get payload() {
|
|
2416
|
+
return this.body;
|
|
2417
|
+
},
|
|
2418
|
+
headers: E,
|
|
2419
|
+
get "User Properties"() {
|
|
2420
|
+
return this.headers;
|
|
2421
|
+
}
|
|
2422
|
+
};
|
|
2423
|
+
}
|
|
2424
|
+
ie.MQTTMessageFactory = i;
|
|
2425
|
+
function o(c, E = !1) {
|
|
2426
|
+
if (E && !s(c))
|
|
2427
|
+
throw new e.ValidationError("No CloudEvent detected");
|
|
2428
|
+
if (u(c)) {
|
|
2429
|
+
const S = typeof c.body == "string" ? JSON.parse(c.body) : c.body;
|
|
2430
|
+
return new e.CloudEvent(Object.assign({}, S), !1);
|
|
2431
|
+
} else
|
|
2432
|
+
return new e.CloudEvent(Object.assign(Object.assign({}, c.headers), { data: c.body }), !1);
|
|
2433
|
+
}
|
|
2434
|
+
function s(c) {
|
|
2435
|
+
return d(c) || u(c);
|
|
2436
|
+
}
|
|
2437
|
+
function d(c) {
|
|
2438
|
+
return !!c.headers.id && !!c.headers.source && !!c.headers.type && !!c.headers.specversion;
|
|
2439
|
+
}
|
|
2440
|
+
function u(c) {
|
|
2441
|
+
var E;
|
|
2442
|
+
return c && c.PUBLISH && ((E = c == null ? void 0 : c.PUBLISH["Content Type"]) === null || E === void 0 ? void 0 : E.startsWith(e.CONSTANTS.MIME_CE_JSON)) || !1;
|
|
2443
|
+
}
|
|
2444
|
+
return ie;
|
|
2445
|
+
}
|
|
2446
|
+
var Gt;
|
|
2447
|
+
function _r() {
|
|
2448
|
+
return Gt || (Gt = 1, function(e) {
|
|
2449
|
+
var t = L && L.__createBinding || (Object.create ? function(a, n, i, o) {
|
|
2450
|
+
o === void 0 && (o = i), Object.defineProperty(a, o, { enumerable: !0, get: function() {
|
|
2451
|
+
return n[i];
|
|
2452
|
+
} });
|
|
2453
|
+
} : function(a, n, i, o) {
|
|
2454
|
+
o === void 0 && (o = i), a[o] = n[i];
|
|
2455
|
+
}), r = L && L.__exportStar || function(a, n) {
|
|
2456
|
+
for (var i in a)
|
|
2457
|
+
i !== "default" && !Object.prototype.hasOwnProperty.call(n, i) && t(n, a, i);
|
|
2458
|
+
};
|
|
2459
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.Mode = void 0, r(Ua(), e), r(Ma(), e), r($a(), e), function(a) {
|
|
2460
|
+
a.BINARY = "binary", a.STRUCTURED = "structured", a.BATCH = "batch";
|
|
2461
|
+
}(e.Mode || (e.Mode = {}));
|
|
2462
|
+
}(rt)), rt;
|
|
2463
|
+
}
|
|
2464
|
+
var It = { exports: {} }, Se = typeof Reflect == "object" ? Reflect : null, Wt = Se && typeof Se.apply == "function" ? Se.apply : function(t, r, a) {
|
|
2465
|
+
return Function.prototype.apply.call(t, r, a);
|
|
2466
|
+
}, $e;
|
|
2467
|
+
Se && typeof Se.ownKeys == "function" ? $e = Se.ownKeys : Object.getOwnPropertySymbols ? $e = function(t) {
|
|
2468
|
+
return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t));
|
|
2469
|
+
} : $e = function(t) {
|
|
2470
|
+
return Object.getOwnPropertyNames(t);
|
|
2471
|
+
};
|
|
2472
|
+
function Fa(e) {
|
|
2473
|
+
console && console.warn && console.warn(e);
|
|
2474
|
+
}
|
|
2475
|
+
var gr = Number.isNaN || function(t) {
|
|
2476
|
+
return t !== t;
|
|
2477
|
+
};
|
|
2478
|
+
function B() {
|
|
2479
|
+
B.init.call(this);
|
|
2480
|
+
}
|
|
2481
|
+
It.exports = B;
|
|
2482
|
+
It.exports.once = ka;
|
|
2483
|
+
B.EventEmitter = B;
|
|
2484
|
+
B.prototype._events = void 0;
|
|
2485
|
+
B.prototype._eventsCount = 0;
|
|
2486
|
+
B.prototype._maxListeners = void 0;
|
|
2487
|
+
var Kt = 10;
|
|
2488
|
+
function qe(e) {
|
|
2489
|
+
if (typeof e != "function")
|
|
2490
|
+
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof e);
|
|
2491
|
+
}
|
|
2492
|
+
Object.defineProperty(B, "defaultMaxListeners", {
|
|
2493
|
+
enumerable: !0,
|
|
2494
|
+
get: function() {
|
|
2495
|
+
return Kt;
|
|
2496
|
+
},
|
|
2497
|
+
set: function(e) {
|
|
2498
|
+
if (typeof e != "number" || e < 0 || gr(e))
|
|
2499
|
+
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + e + ".");
|
|
2500
|
+
Kt = e;
|
|
2501
|
+
}
|
|
2502
|
+
});
|
|
2503
|
+
B.init = function() {
|
|
2504
|
+
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
2505
|
+
};
|
|
2506
|
+
B.prototype.setMaxListeners = function(t) {
|
|
2507
|
+
if (typeof t != "number" || t < 0 || gr(t))
|
|
2508
|
+
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + t + ".");
|
|
2509
|
+
return this._maxListeners = t, this;
|
|
2510
|
+
};
|
|
2511
|
+
function br(e) {
|
|
2512
|
+
return e._maxListeners === void 0 ? B.defaultMaxListeners : e._maxListeners;
|
|
2513
|
+
}
|
|
2514
|
+
B.prototype.getMaxListeners = function() {
|
|
2515
|
+
return br(this);
|
|
2516
|
+
};
|
|
2517
|
+
B.prototype.emit = function(t) {
|
|
2518
|
+
for (var r = [], a = 1; a < arguments.length; a++)
|
|
2519
|
+
r.push(arguments[a]);
|
|
2520
|
+
var n = t === "error", i = this._events;
|
|
2521
|
+
if (i !== void 0)
|
|
2522
|
+
n = n && i.error === void 0;
|
|
2523
|
+
else if (!n)
|
|
2524
|
+
return !1;
|
|
2525
|
+
if (n) {
|
|
2526
|
+
var o;
|
|
2527
|
+
if (r.length > 0 && (o = r[0]), o instanceof Error)
|
|
2528
|
+
throw o;
|
|
2529
|
+
var s = new Error("Unhandled error." + (o ? " (" + o.message + ")" : ""));
|
|
2530
|
+
throw s.context = o, s;
|
|
2531
|
+
}
|
|
2532
|
+
var d = i[t];
|
|
2533
|
+
if (d === void 0)
|
|
2534
|
+
return !1;
|
|
2535
|
+
if (typeof d == "function")
|
|
2536
|
+
Wt(d, this, r);
|
|
2537
|
+
else
|
|
2538
|
+
for (var u = d.length, c = wr(d, u), a = 0; a < u; ++a)
|
|
2539
|
+
Wt(c[a], this, r);
|
|
2540
|
+
return !0;
|
|
2541
|
+
};
|
|
2542
|
+
function Or(e, t, r, a) {
|
|
2543
|
+
var n, i, o;
|
|
2544
|
+
if (qe(r), i = e._events, i === void 0 ? (i = e._events = /* @__PURE__ */ Object.create(null), e._eventsCount = 0) : (i.newListener !== void 0 && (e.emit(
|
|
2545
|
+
"newListener",
|
|
2546
|
+
t,
|
|
2547
|
+
r.listener ? r.listener : r
|
|
2548
|
+
), i = e._events), o = i[t]), o === void 0)
|
|
2549
|
+
o = i[t] = r, ++e._eventsCount;
|
|
2550
|
+
else if (typeof o == "function" ? o = i[t] = a ? [r, o] : [o, r] : a ? o.unshift(r) : o.push(r), n = br(e), n > 0 && o.length > n && !o.warned) {
|
|
2551
|
+
o.warned = !0;
|
|
2552
|
+
var s = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(t) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
2553
|
+
s.name = "MaxListenersExceededWarning", s.emitter = e, s.type = t, s.count = o.length, Fa(s);
|
|
2554
|
+
}
|
|
2555
|
+
return e;
|
|
2556
|
+
}
|
|
2557
|
+
B.prototype.addListener = function(t, r) {
|
|
2558
|
+
return Or(this, t, r, !1);
|
|
2559
|
+
};
|
|
2560
|
+
B.prototype.on = B.prototype.addListener;
|
|
2561
|
+
B.prototype.prependListener = function(t, r) {
|
|
2562
|
+
return Or(this, t, r, !0);
|
|
2563
|
+
};
|
|
2564
|
+
function Ha() {
|
|
2565
|
+
if (!this.fired)
|
|
2566
|
+
return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
|
|
2567
|
+
}
|
|
2568
|
+
function Cr(e, t, r) {
|
|
2569
|
+
var a = { fired: !1, wrapFn: void 0, target: e, type: t, listener: r }, n = Ha.bind(a);
|
|
2570
|
+
return n.listener = r, a.wrapFn = n, n;
|
|
2571
|
+
}
|
|
2572
|
+
B.prototype.once = function(t, r) {
|
|
2573
|
+
return qe(r), this.on(t, Cr(this, t, r)), this;
|
|
2574
|
+
};
|
|
2575
|
+
B.prototype.prependOnceListener = function(t, r) {
|
|
2576
|
+
return qe(r), this.prependListener(t, Cr(this, t, r)), this;
|
|
2577
|
+
};
|
|
2578
|
+
B.prototype.removeListener = function(t, r) {
|
|
2579
|
+
var a, n, i, o, s;
|
|
2580
|
+
if (qe(r), n = this._events, n === void 0)
|
|
2581
|
+
return this;
|
|
2582
|
+
if (a = n[t], a === void 0)
|
|
2583
|
+
return this;
|
|
2584
|
+
if (a === r || a.listener === r)
|
|
2585
|
+
--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete n[t], n.removeListener && this.emit("removeListener", t, a.listener || r));
|
|
2586
|
+
else if (typeof a != "function") {
|
|
2587
|
+
for (i = -1, o = a.length - 1; o >= 0; o--)
|
|
2588
|
+
if (a[o] === r || a[o].listener === r) {
|
|
2589
|
+
s = a[o].listener, i = o;
|
|
2590
|
+
break;
|
|
2591
|
+
}
|
|
2592
|
+
if (i < 0)
|
|
2593
|
+
return this;
|
|
2594
|
+
i === 0 ? a.shift() : za(a, i), a.length === 1 && (n[t] = a[0]), n.removeListener !== void 0 && this.emit("removeListener", t, s || r);
|
|
2595
|
+
}
|
|
2596
|
+
return this;
|
|
2597
|
+
};
|
|
2598
|
+
B.prototype.off = B.prototype.removeListener;
|
|
2599
|
+
B.prototype.removeAllListeners = function(t) {
|
|
2600
|
+
var r, a, n;
|
|
2601
|
+
if (a = this._events, a === void 0)
|
|
2602
|
+
return this;
|
|
2603
|
+
if (a.removeListener === void 0)
|
|
2604
|
+
return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : a[t] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete a[t]), this;
|
|
2605
|
+
if (arguments.length === 0) {
|
|
2606
|
+
var i = Object.keys(a), o;
|
|
2607
|
+
for (n = 0; n < i.length; ++n)
|
|
2608
|
+
o = i[n], o !== "removeListener" && this.removeAllListeners(o);
|
|
2609
|
+
return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
|
|
2610
|
+
}
|
|
2611
|
+
if (r = a[t], typeof r == "function")
|
|
2612
|
+
this.removeListener(t, r);
|
|
2613
|
+
else if (r !== void 0)
|
|
2614
|
+
for (n = r.length - 1; n >= 0; n--)
|
|
2615
|
+
this.removeListener(t, r[n]);
|
|
2616
|
+
return this;
|
|
2617
|
+
};
|
|
2618
|
+
function Rr(e, t, r) {
|
|
2619
|
+
var a = e._events;
|
|
2620
|
+
if (a === void 0)
|
|
2621
|
+
return [];
|
|
2622
|
+
var n = a[t];
|
|
2623
|
+
return n === void 0 ? [] : typeof n == "function" ? r ? [n.listener || n] : [n] : r ? La(n) : wr(n, n.length);
|
|
2624
|
+
}
|
|
2625
|
+
B.prototype.listeners = function(t) {
|
|
2626
|
+
return Rr(this, t, !0);
|
|
2627
|
+
};
|
|
2628
|
+
B.prototype.rawListeners = function(t) {
|
|
2629
|
+
return Rr(this, t, !1);
|
|
2630
|
+
};
|
|
2631
|
+
B.listenerCount = function(e, t) {
|
|
2632
|
+
return typeof e.listenerCount == "function" ? e.listenerCount(t) : Nr.call(e, t);
|
|
2633
|
+
};
|
|
2634
|
+
B.prototype.listenerCount = Nr;
|
|
2635
|
+
function Nr(e) {
|
|
2636
|
+
var t = this._events;
|
|
2637
|
+
if (t !== void 0) {
|
|
2638
|
+
var r = t[e];
|
|
2639
|
+
if (typeof r == "function")
|
|
2640
|
+
return 1;
|
|
2641
|
+
if (r !== void 0)
|
|
2642
|
+
return r.length;
|
|
2643
|
+
}
|
|
2644
|
+
return 0;
|
|
2645
|
+
}
|
|
2646
|
+
B.prototype.eventNames = function() {
|
|
2647
|
+
return this._eventsCount > 0 ? $e(this._events) : [];
|
|
2648
|
+
};
|
|
2649
|
+
function wr(e, t) {
|
|
2650
|
+
for (var r = new Array(t), a = 0; a < t; ++a)
|
|
2651
|
+
r[a] = e[a];
|
|
2652
|
+
return r;
|
|
2653
|
+
}
|
|
2654
|
+
function za(e, t) {
|
|
2655
|
+
for (; t + 1 < e.length; t++)
|
|
2656
|
+
e[t] = e[t + 1];
|
|
2657
|
+
e.pop();
|
|
2658
|
+
}
|
|
2659
|
+
function La(e) {
|
|
2660
|
+
for (var t = new Array(e.length), r = 0; r < t.length; ++r)
|
|
2661
|
+
t[r] = e[r].listener || e[r];
|
|
2662
|
+
return t;
|
|
2663
|
+
}
|
|
2664
|
+
function ka(e, t) {
|
|
2665
|
+
return new Promise(function(r, a) {
|
|
2666
|
+
function n(o) {
|
|
2667
|
+
e.removeListener(t, i), a(o);
|
|
2668
|
+
}
|
|
2669
|
+
function i() {
|
|
2670
|
+
typeof e.removeListener == "function" && e.removeListener("error", n), r([].slice.call(arguments));
|
|
2671
|
+
}
|
|
2672
|
+
Pr(e, t, i, { once: !0 }), t !== "error" && Va(e, n, { once: !0 });
|
|
2673
|
+
});
|
|
2674
|
+
}
|
|
2675
|
+
function Va(e, t, r) {
|
|
2676
|
+
typeof e.on == "function" && Pr(e, "error", t, r);
|
|
2677
|
+
}
|
|
2678
|
+
function Pr(e, t, r, a) {
|
|
2679
|
+
if (typeof e.on == "function")
|
|
2680
|
+
a.once ? e.once(t, r) : e.on(t, r);
|
|
2681
|
+
else if (typeof e.addEventListener == "function")
|
|
2682
|
+
e.addEventListener(t, function n(i) {
|
|
2683
|
+
a.once && e.removeEventListener(t, n), r(i);
|
|
2684
|
+
});
|
|
2685
|
+
else
|
|
2686
|
+
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof e);
|
|
2687
|
+
}
|
|
2688
|
+
var Ya = It.exports, Qt;
|
|
2689
|
+
function Ja() {
|
|
2690
|
+
if (Qt)
|
|
2691
|
+
return ae;
|
|
2692
|
+
Qt = 1;
|
|
2693
|
+
var e = L && L.__awaiter || function(o, s, d, u) {
|
|
2694
|
+
function c(E) {
|
|
2695
|
+
return E instanceof d ? E : new d(function(S) {
|
|
2696
|
+
S(E);
|
|
2697
|
+
});
|
|
2698
|
+
}
|
|
2699
|
+
return new (d || (d = Promise))(function(E, S) {
|
|
2700
|
+
function g(A) {
|
|
2701
|
+
try {
|
|
2702
|
+
h(u.next(A));
|
|
2703
|
+
} catch (_) {
|
|
2704
|
+
S(_);
|
|
2705
|
+
}
|
|
2706
|
+
}
|
|
2707
|
+
function l(A) {
|
|
2708
|
+
try {
|
|
2709
|
+
h(u.throw(A));
|
|
2710
|
+
} catch (_) {
|
|
2711
|
+
S(_);
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
function h(A) {
|
|
2715
|
+
A.done ? E(A.value) : c(A.value).then(g, l);
|
|
2716
|
+
}
|
|
2717
|
+
h((u = u.apply(o, s || [])).next());
|
|
2718
|
+
});
|
|
2719
|
+
};
|
|
2720
|
+
Object.defineProperty(ae, "__esModule", { value: !0 }), ae.Emitter = ae.emitterFor = void 0;
|
|
2721
|
+
const t = _r(), r = Ya, a = { binding: t.HTTP, mode: t.Mode.BINARY };
|
|
2722
|
+
function n(o, s = a) {
|
|
2723
|
+
if (!o)
|
|
2724
|
+
throw new TypeError("A TransportFunction is required");
|
|
2725
|
+
const { binding: d, mode: u } = Object.assign(Object.assign({}, a), s);
|
|
2726
|
+
return function(E, S) {
|
|
2727
|
+
switch (S = S || {}, u) {
|
|
2728
|
+
case t.Mode.BINARY:
|
|
2729
|
+
return o(d.binary(E), S);
|
|
2730
|
+
case t.Mode.STRUCTURED:
|
|
2731
|
+
return o(d.structured(E), S);
|
|
2732
|
+
default:
|
|
2733
|
+
throw new TypeError(`Unexpected transport mode: ${u}`);
|
|
2734
|
+
}
|
|
2735
|
+
};
|
|
2736
|
+
}
|
|
2737
|
+
ae.emitterFor = n;
|
|
2738
|
+
class i {
|
|
2739
|
+
/**
|
|
2740
|
+
* Return or create the Emitter singleton
|
|
2741
|
+
*
|
|
2742
|
+
* @return {Emitter} return Emitter singleton
|
|
2743
|
+
*/
|
|
2744
|
+
static getInstance() {
|
|
2745
|
+
return i.instance || (i.instance = new r.EventEmitter()), i.instance;
|
|
2746
|
+
}
|
|
2747
|
+
/**
|
|
2748
|
+
* Add a listener for eventing
|
|
2749
|
+
*
|
|
2750
|
+
* @param {string} event type to listen to
|
|
2751
|
+
* @param {Function} listener to call on event
|
|
2752
|
+
* @return {void}
|
|
2753
|
+
*/
|
|
2754
|
+
static on(s, d) {
|
|
2755
|
+
i.getInstance().on(s, d);
|
|
2756
|
+
}
|
|
2757
|
+
/**
|
|
2758
|
+
* Emit an event inside this application
|
|
2759
|
+
*
|
|
2760
|
+
* @param {CloudEvent} event to emit
|
|
2761
|
+
* @param {boolean} ensureDelivery fail the promise if one listener fails
|
|
2762
|
+
* @return {void}
|
|
2763
|
+
*/
|
|
2764
|
+
static emitEvent(s, d = !0) {
|
|
2765
|
+
return e(this, void 0, void 0, function* () {
|
|
2766
|
+
d ? yield Promise.all(i.getInstance().listeners("cloudevent").map((u) => e(this, void 0, void 0, function* () {
|
|
2767
|
+
return u(s);
|
|
2768
|
+
}))) : i.getInstance().emit("cloudevent", s);
|
|
2769
|
+
});
|
|
2770
|
+
}
|
|
2771
|
+
}
|
|
2772
|
+
return ae.Emitter = i, i.instance = void 0, ae;
|
|
2773
|
+
}
|
|
2774
|
+
var Ge = {};
|
|
2775
|
+
const qa = {}, Ga = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2776
|
+
__proto__: null,
|
|
2777
|
+
default: qa
|
|
2778
|
+
}, Symbol.toStringTag, { value: "Module" })), Ir = /* @__PURE__ */ xt(Ga);
|
|
2779
|
+
var Dr = L && L.__importDefault || function(e) {
|
|
2780
|
+
return e && e.__esModule ? e : { default: e };
|
|
2781
|
+
};
|
|
2782
|
+
Object.defineProperty(Ge, "__esModule", { value: !0 });
|
|
2783
|
+
Ge.httpTransport = void 0;
|
|
2784
|
+
const Wa = Dr(Ir), Ka = Dr(Ir);
|
|
2785
|
+
function Qa(e) {
|
|
2786
|
+
const t = new URL(e);
|
|
2787
|
+
let r;
|
|
2788
|
+
if (t.protocol === "https:")
|
|
2789
|
+
r = Ka.default;
|
|
2790
|
+
else if (t.protocol === "http:")
|
|
2791
|
+
r = Wa.default;
|
|
2792
|
+
else
|
|
2793
|
+
throw new TypeError(`unsupported protocol ${t.protocol}`);
|
|
2794
|
+
return function(a, n) {
|
|
2795
|
+
return new Promise((i, o) => {
|
|
2796
|
+
n = Object.assign({}, n);
|
|
2797
|
+
const s = {
|
|
2798
|
+
method: "POST",
|
|
2799
|
+
headers: Object.assign(Object.assign({}, a.headers), n.headers)
|
|
2800
|
+
};
|
|
2801
|
+
try {
|
|
2802
|
+
const d = {
|
|
2803
|
+
body: "",
|
|
2804
|
+
headers: {}
|
|
2805
|
+
}, u = r.request(t, s, (c) => {
|
|
2806
|
+
c.setEncoding("utf-8"), d.headers = c.headers, c.on("data", (E) => d.body += E), c.on("end", () => {
|
|
2807
|
+
i(d);
|
|
2808
|
+
});
|
|
2809
|
+
});
|
|
2810
|
+
u.on("error", o), u.write(a.body), u.end();
|
|
2811
|
+
} catch (d) {
|
|
2812
|
+
o(d);
|
|
2813
|
+
}
|
|
2814
|
+
});
|
|
2815
|
+
};
|
|
2816
|
+
}
|
|
2817
|
+
Ge.httpTransport = Qa;
|
|
2818
|
+
var Xt;
|
|
2819
|
+
function Ae() {
|
|
2820
|
+
return Xt || (Xt = 1, function(e) {
|
|
2821
|
+
var t = L && L.__importDefault || function(d) {
|
|
2822
|
+
return d && d.__esModule ? d : { default: d };
|
|
2823
|
+
};
|
|
2824
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.CONSTANTS = e.Emitter = e.httpTransport = e.emitterFor = e.MQTTMessageFactory = e.MQTT = e.Kafka = e.HTTP = e.Mode = e.ValidationError = e.Version = e.CloudEvent = void 0;
|
|
2825
|
+
const r = _t();
|
|
2826
|
+
Object.defineProperty(e, "CloudEvent", { enumerable: !0, get: function() {
|
|
2827
|
+
return r.CloudEvent;
|
|
2828
|
+
} }), Object.defineProperty(e, "Version", { enumerable: !0, get: function() {
|
|
2829
|
+
return r.Version;
|
|
2830
|
+
} });
|
|
2831
|
+
const a = ce;
|
|
2832
|
+
Object.defineProperty(e, "ValidationError", { enumerable: !0, get: function() {
|
|
2833
|
+
return a.ValidationError;
|
|
2834
|
+
} });
|
|
2835
|
+
const n = Ja();
|
|
2836
|
+
Object.defineProperty(e, "emitterFor", { enumerable: !0, get: function() {
|
|
2837
|
+
return n.emitterFor;
|
|
2838
|
+
} }), Object.defineProperty(e, "Emitter", { enumerable: !0, get: function() {
|
|
2839
|
+
return n.Emitter;
|
|
2840
|
+
} });
|
|
2841
|
+
const i = Ge;
|
|
2842
|
+
Object.defineProperty(e, "httpTransport", { enumerable: !0, get: function() {
|
|
2843
|
+
return i.httpTransport;
|
|
2844
|
+
} });
|
|
2845
|
+
const o = _r();
|
|
2846
|
+
Object.defineProperty(e, "Mode", { enumerable: !0, get: function() {
|
|
2847
|
+
return o.Mode;
|
|
2848
|
+
} }), Object.defineProperty(e, "HTTP", { enumerable: !0, get: function() {
|
|
2849
|
+
return o.HTTP;
|
|
2850
|
+
} }), Object.defineProperty(e, "Kafka", { enumerable: !0, get: function() {
|
|
2851
|
+
return o.Kafka;
|
|
2852
|
+
} }), Object.defineProperty(e, "MQTT", { enumerable: !0, get: function() {
|
|
2853
|
+
return o.MQTT;
|
|
2854
|
+
} }), Object.defineProperty(e, "MQTTMessageFactory", { enumerable: !0, get: function() {
|
|
2855
|
+
return o.MQTTMessageFactory;
|
|
2856
|
+
} });
|
|
2857
|
+
const s = t(Re);
|
|
2858
|
+
e.CONSTANTS = s.default;
|
|
2859
|
+
}(Ke)), Ke;
|
|
2860
|
+
}
|
|
2861
|
+
var Xa = Ae();
|
|
2862
|
+
class ni {
|
|
2863
|
+
constructor(t) {
|
|
2864
|
+
this.queueMap = {}, this.verifiers = t.verifiers;
|
|
2865
|
+
for (const r of t.queues) {
|
|
2866
|
+
if (this.queueMap[r.name])
|
|
2867
|
+
throw new Error(
|
|
2868
|
+
"Multiple handlers for the same queue name are not permitted"
|
|
2869
|
+
);
|
|
2870
|
+
this.queueMap[r.name] = r;
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
async handle(t, r, a) {
|
|
2874
|
+
let n;
|
|
2875
|
+
try {
|
|
2876
|
+
n = Xa.HTTP.toEvent({
|
|
2877
|
+
headers: r,
|
|
2878
|
+
body: a
|
|
2879
|
+
});
|
|
2880
|
+
} catch {
|
|
2881
|
+
throw new $r("Provided message is not a CloudEvent");
|
|
2882
|
+
}
|
|
2883
|
+
try {
|
|
2884
|
+
if (!this.queueMap[t])
|
|
2885
|
+
throw new Fr(`No handler exists: ${t}`);
|
|
2886
|
+
if (!(this.verifiers.length === 0 ? !0 : (await Promise.all(
|
|
2887
|
+
this.verifiers.map((o) => o.verify(n))
|
|
2888
|
+
)).some((o) => !!o)))
|
|
2889
|
+
throw new Mr();
|
|
2890
|
+
await this.queueMap[t].handler(n);
|
|
2891
|
+
} catch (i) {
|
|
2892
|
+
throw Zt(i) ? i : new Hr();
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2895
|
+
}
|
|
2896
|
+
export {
|
|
2897
|
+
ti as ClientError,
|
|
2898
|
+
ni as CloudEventReceiver,
|
|
2899
|
+
xa as ConflictError,
|
|
2900
|
+
Mr as InvalidSignatureError,
|
|
2901
|
+
Fr as NotFoundError,
|
|
2902
|
+
ue as ReceiverError,
|
|
2903
|
+
Hr as ServerError,
|
|
2904
|
+
ei as TooManyRequestsError,
|
|
2905
|
+
$r as UnparseableMessageError,
|
|
2906
|
+
ri as cloudEventReceiverPlugin,
|
|
2907
|
+
Zt as isReceiverError
|
|
2908
|
+
};
|