@thescaffold/jsx-polylog 0.2.21 → 0.2.31
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/common/init/config.d.ts +1 -0
- package/index.d.ts +3 -3
- package/jsx-polylog.cjs.development.js +172 -370
- package/jsx-polylog.cjs.development.js.map +1 -1
- package/jsx-polylog.cjs.production.min.js +1 -1
- package/jsx-polylog.cjs.production.min.js.map +1 -1
- package/jsx-polylog.esm.js +172 -370
- package/jsx-polylog.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -37,306 +37,113 @@ function _extends() {
|
|
|
37
37
|
function _inheritsLoose(t, o) {
|
|
38
38
|
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return o(a, "_invoke", {
|
|
75
|
-
value: makeInvokeMethod(t, r, c)
|
|
76
|
-
}), a;
|
|
77
|
-
}
|
|
78
|
-
function tryCatch(t, e, r) {
|
|
79
|
-
try {
|
|
80
|
-
return {
|
|
81
|
-
type: "normal",
|
|
82
|
-
arg: t.call(e, r)
|
|
83
|
-
};
|
|
84
|
-
} catch (t) {
|
|
85
|
-
return {
|
|
86
|
-
type: "throw",
|
|
87
|
-
arg: t
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
e.wrap = wrap;
|
|
92
|
-
var h = "suspendedStart",
|
|
93
|
-
l = "suspendedYield",
|
|
94
|
-
f = "executing",
|
|
95
|
-
s = "completed",
|
|
96
|
-
y = {};
|
|
97
|
-
function Generator() {}
|
|
98
|
-
function GeneratorFunction() {}
|
|
99
|
-
function GeneratorFunctionPrototype() {}
|
|
100
|
-
var p = {};
|
|
101
|
-
define(p, a, function () {
|
|
102
|
-
return this;
|
|
103
|
-
});
|
|
104
|
-
var d = Object.getPrototypeOf,
|
|
105
|
-
v = d && d(d(values([])));
|
|
106
|
-
v && v !== r && n.call(v, a) && (p = v);
|
|
107
|
-
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
108
|
-
function defineIteratorMethods(t) {
|
|
109
|
-
["next", "throw", "return"].forEach(function (e) {
|
|
110
|
-
define(t, e, function (t) {
|
|
111
|
-
return this._invoke(e, t);
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
function AsyncIterator(t, e) {
|
|
116
|
-
function invoke(r, o, i, a) {
|
|
117
|
-
var c = tryCatch(t[r], t, o);
|
|
118
|
-
if ("throw" !== c.type) {
|
|
119
|
-
var u = c.arg,
|
|
120
|
-
h = u.value;
|
|
121
|
-
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
122
|
-
invoke("next", t, i, a);
|
|
123
|
-
}, function (t) {
|
|
124
|
-
invoke("throw", t, i, a);
|
|
125
|
-
}) : e.resolve(h).then(function (t) {
|
|
126
|
-
u.value = t, i(u);
|
|
127
|
-
}, function (t) {
|
|
128
|
-
return invoke("throw", t, i, a);
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
a(c.arg);
|
|
132
|
-
}
|
|
133
|
-
var r;
|
|
134
|
-
o(this, "_invoke", {
|
|
135
|
-
value: function (t, n) {
|
|
136
|
-
function callInvokeWithMethodAndArg() {
|
|
137
|
-
return new e(function (e, r) {
|
|
138
|
-
invoke(t, n, e, r);
|
|
139
|
-
});
|
|
40
|
+
function _regenerator() {
|
|
41
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
42
|
+
var e,
|
|
43
|
+
t,
|
|
44
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
45
|
+
n = r.iterator || "@@iterator",
|
|
46
|
+
o = r.toStringTag || "@@toStringTag";
|
|
47
|
+
function i(r, n, o, i) {
|
|
48
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
49
|
+
u = Object.create(c.prototype);
|
|
50
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
51
|
+
var i,
|
|
52
|
+
c,
|
|
53
|
+
u,
|
|
54
|
+
f = 0,
|
|
55
|
+
p = o || [],
|
|
56
|
+
y = !1,
|
|
57
|
+
G = {
|
|
58
|
+
p: 0,
|
|
59
|
+
n: 0,
|
|
60
|
+
v: e,
|
|
61
|
+
a: d,
|
|
62
|
+
f: d.bind(e, 4),
|
|
63
|
+
d: function (t, r) {
|
|
64
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
function d(r, n) {
|
|
68
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
69
|
+
var o,
|
|
70
|
+
i = p[t],
|
|
71
|
+
d = G.p,
|
|
72
|
+
l = i[2];
|
|
73
|
+
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
140
74
|
}
|
|
141
|
-
|
|
75
|
+
if (o || r > 1) return a;
|
|
76
|
+
throw y = !0, n;
|
|
142
77
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
78
|
+
return function (o, p, l) {
|
|
79
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
80
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
81
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
82
|
+
try {
|
|
83
|
+
if (f = 2, i) {
|
|
84
|
+
if (c || (o = "next"), t = i[o]) {
|
|
85
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
86
|
+
if (!t.done) return t;
|
|
87
|
+
u = t.value, c < 2 && (c = 0);
|
|
88
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
89
|
+
i = e;
|
|
90
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
91
|
+
} catch (t) {
|
|
92
|
+
i = e, c = 1, u = t;
|
|
93
|
+
} finally {
|
|
94
|
+
f = 1;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
151
97
|
return {
|
|
152
98
|
value: t,
|
|
153
|
-
done:
|
|
99
|
+
done: y
|
|
154
100
|
};
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
var c = n.delegate;
|
|
158
|
-
if (c) {
|
|
159
|
-
var u = maybeInvokeDelegate(c, n);
|
|
160
|
-
if (u) {
|
|
161
|
-
if (u === y) continue;
|
|
162
|
-
return u;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
166
|
-
if (o === h) throw o = s, n.arg;
|
|
167
|
-
n.dispatchException(n.arg);
|
|
168
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
169
|
-
o = f;
|
|
170
|
-
var p = tryCatch(e, r, n);
|
|
171
|
-
if ("normal" === p.type) {
|
|
172
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
173
|
-
return {
|
|
174
|
-
value: p.arg,
|
|
175
|
-
done: n.done
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
function maybeInvokeDelegate(e, r) {
|
|
183
|
-
var n = r.method,
|
|
184
|
-
o = e.iterator[n];
|
|
185
|
-
if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
186
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
187
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
188
|
-
var a = i.arg;
|
|
189
|
-
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
190
|
-
}
|
|
191
|
-
function pushTryEntry(t) {
|
|
192
|
-
var e = {
|
|
193
|
-
tryLoc: t[0]
|
|
194
|
-
};
|
|
195
|
-
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
196
|
-
}
|
|
197
|
-
function resetTryEntry(t) {
|
|
198
|
-
var e = t.completion || {};
|
|
199
|
-
e.type = "normal", delete e.arg, t.completion = e;
|
|
200
|
-
}
|
|
201
|
-
function Context(t) {
|
|
202
|
-
this.tryEntries = [{
|
|
203
|
-
tryLoc: "root"
|
|
204
|
-
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
101
|
+
};
|
|
102
|
+
}(r, o, i), !0), u;
|
|
205
103
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
return i.next = i;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
throw new TypeError(typeof e + " is not iterable");
|
|
104
|
+
var a = {};
|
|
105
|
+
function Generator() {}
|
|
106
|
+
function GeneratorFunction() {}
|
|
107
|
+
function GeneratorFunctionPrototype() {}
|
|
108
|
+
t = Object.getPrototypeOf;
|
|
109
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
110
|
+
return this;
|
|
111
|
+
}), t),
|
|
112
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
113
|
+
function f(e) {
|
|
114
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
221
115
|
}
|
|
222
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype,
|
|
223
|
-
value: GeneratorFunctionPrototype,
|
|
224
|
-
configurable: !0
|
|
225
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
226
|
-
value: GeneratorFunction,
|
|
227
|
-
configurable: !0
|
|
228
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
229
|
-
var e = "function" == typeof t && t.constructor;
|
|
230
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
231
|
-
}, e.mark = function (t) {
|
|
232
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
233
|
-
}, e.awrap = function (t) {
|
|
234
|
-
return {
|
|
235
|
-
__await: t
|
|
236
|
-
};
|
|
237
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
116
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
238
117
|
return this;
|
|
239
|
-
}),
|
|
240
|
-
void 0 === i && (i = Promise);
|
|
241
|
-
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
242
|
-
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
243
|
-
return t.done ? t.value : a.next();
|
|
244
|
-
});
|
|
245
|
-
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
246
|
-
return this;
|
|
247
|
-
}), define(g, "toString", function () {
|
|
118
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
248
119
|
return "[object Generator]";
|
|
249
|
-
}),
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
return r.reverse(), function next() {
|
|
254
|
-
for (; r.length;) {
|
|
255
|
-
var t = r.pop();
|
|
256
|
-
if (t in e) return next.value = t, next.done = !1, next;
|
|
257
|
-
}
|
|
258
|
-
return next.done = !0, next;
|
|
120
|
+
}), (_regenerator = function () {
|
|
121
|
+
return {
|
|
122
|
+
w: i,
|
|
123
|
+
m: f
|
|
259
124
|
};
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
function handle(n, o) {
|
|
275
|
-
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
276
|
-
}
|
|
277
|
-
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
278
|
-
var i = this.tryEntries[o],
|
|
279
|
-
a = i.completion;
|
|
280
|
-
if ("root" === i.tryLoc) return handle("end");
|
|
281
|
-
if (i.tryLoc <= this.prev) {
|
|
282
|
-
var c = n.call(i, "catchLoc"),
|
|
283
|
-
u = n.call(i, "finallyLoc");
|
|
284
|
-
if (c && u) {
|
|
285
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
286
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
287
|
-
} else if (c) {
|
|
288
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
289
|
-
} else {
|
|
290
|
-
if (!u) throw Error("try statement without catch or finally");
|
|
291
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
},
|
|
296
|
-
abrupt: function (t, e) {
|
|
297
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
298
|
-
var o = this.tryEntries[r];
|
|
299
|
-
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
300
|
-
var i = o;
|
|
301
|
-
break;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
305
|
-
var a = i ? i.completion : {};
|
|
306
|
-
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
307
|
-
},
|
|
308
|
-
complete: function (t, e) {
|
|
309
|
-
if ("throw" === t.type) throw t.arg;
|
|
310
|
-
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
311
|
-
},
|
|
312
|
-
finish: function (t) {
|
|
313
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
314
|
-
var r = this.tryEntries[e];
|
|
315
|
-
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
catch: function (t) {
|
|
319
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
320
|
-
var r = this.tryEntries[e];
|
|
321
|
-
if (r.tryLoc === t) {
|
|
322
|
-
var n = r.completion;
|
|
323
|
-
if ("throw" === n.type) {
|
|
324
|
-
var o = n.arg;
|
|
325
|
-
resetTryEntry(r);
|
|
326
|
-
}
|
|
327
|
-
return o;
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
throw Error("illegal catch attempt");
|
|
331
|
-
},
|
|
332
|
-
delegateYield: function (e, r, n) {
|
|
333
|
-
return this.delegate = {
|
|
334
|
-
iterator: values(e),
|
|
335
|
-
resultName: r,
|
|
336
|
-
nextLoc: n
|
|
337
|
-
}, "next" === this.method && (this.arg = t), y;
|
|
125
|
+
})();
|
|
126
|
+
}
|
|
127
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
128
|
+
var i = Object.defineProperty;
|
|
129
|
+
try {
|
|
130
|
+
i({}, "", {});
|
|
131
|
+
} catch (e) {
|
|
132
|
+
i = 0;
|
|
133
|
+
}
|
|
134
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
135
|
+
function o(r, n) {
|
|
136
|
+
_regeneratorDefine(e, r, function (e) {
|
|
137
|
+
return this._invoke(r, n, e);
|
|
138
|
+
});
|
|
338
139
|
}
|
|
339
|
-
|
|
140
|
+
r ? i ? i(e, r, {
|
|
141
|
+
value: n,
|
|
142
|
+
enumerable: !t,
|
|
143
|
+
configurable: !t,
|
|
144
|
+
writable: !t
|
|
145
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
146
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
340
147
|
}
|
|
341
148
|
function _setPrototypeOf(t, e) {
|
|
342
149
|
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
@@ -390,6 +197,9 @@ var config = {
|
|
|
390
197
|
var getConfig = function getConfig() {
|
|
391
198
|
return config;
|
|
392
199
|
};
|
|
200
|
+
var setConfig = function setConfig(newConfig) {
|
|
201
|
+
config = newConfig;
|
|
202
|
+
};
|
|
393
203
|
|
|
394
204
|
var isObject = function isObject(x) {
|
|
395
205
|
return typeof x === 'object' && !Array.isArray(x) && x !== null;
|
|
@@ -503,13 +313,13 @@ var message = function message(type, attributes, options) {
|
|
|
503
313
|
var axios = /*#__PURE__*/require('axios');
|
|
504
314
|
var raw = axios;
|
|
505
315
|
var request = /*#__PURE__*/function () {
|
|
506
|
-
var _ref = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
507
|
-
var config, _request, response, _response;
|
|
508
|
-
return
|
|
509
|
-
while (1) switch (_context.
|
|
316
|
+
var _ref = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(method, url, body, queries, headers) {
|
|
317
|
+
var config, _request, response, _response, _t;
|
|
318
|
+
return _regenerator().w(function (_context) {
|
|
319
|
+
while (1) switch (_context.p = _context.n) {
|
|
510
320
|
case 0:
|
|
511
321
|
config = getConfig();
|
|
512
|
-
_context.
|
|
322
|
+
_context.p = 1;
|
|
513
323
|
_request = {
|
|
514
324
|
method: method,
|
|
515
325
|
url: url,
|
|
@@ -521,75 +331,71 @@ var request = /*#__PURE__*/function () {
|
|
|
521
331
|
params: queries
|
|
522
332
|
};
|
|
523
333
|
managedLog('BATCH REQUEST', _request, config, exports.LogType.INFO);
|
|
524
|
-
_context.
|
|
334
|
+
_context.n = 2;
|
|
525
335
|
return raw.request(_request, {
|
|
526
336
|
validateStatus: function validateStatus(status) {
|
|
527
337
|
return status < 500;
|
|
528
338
|
}
|
|
529
339
|
});
|
|
530
|
-
case
|
|
531
|
-
response = _context.
|
|
340
|
+
case 2:
|
|
341
|
+
response = _context.v;
|
|
532
342
|
managedLog('BATCH RESPONSE', response.data, config, exports.LogType.INFO);
|
|
533
|
-
return _context.
|
|
534
|
-
case
|
|
535
|
-
_context.
|
|
536
|
-
|
|
537
|
-
managedLog('BATCH ERROR',
|
|
538
|
-
if (!
|
|
539
|
-
_context.
|
|
343
|
+
return _context.a(2, [true, response.status, response.statusText, null, response.data]);
|
|
344
|
+
case 3:
|
|
345
|
+
_context.p = 3;
|
|
346
|
+
_t = _context.v;
|
|
347
|
+
managedLog('BATCH ERROR', _t, config, exports.LogType.ERROR);
|
|
348
|
+
if (!_t.response) {
|
|
349
|
+
_context.n = 4;
|
|
540
350
|
break;
|
|
541
351
|
}
|
|
542
352
|
// The request was made and the server responded with a status code
|
|
543
353
|
// that falls out of the range of 2xx
|
|
544
|
-
_response =
|
|
545
|
-
return _context.
|
|
546
|
-
case
|
|
547
|
-
if (!
|
|
548
|
-
_context.
|
|
354
|
+
_response = _t.response;
|
|
355
|
+
return _context.a(2, [false, _response.status, _response.statusText, null, _response.data]);
|
|
356
|
+
case 4:
|
|
357
|
+
if (!_t.request) {
|
|
358
|
+
_context.n = 5;
|
|
549
359
|
break;
|
|
550
360
|
}
|
|
551
|
-
return _context.
|
|
552
|
-
case
|
|
553
|
-
return _context.
|
|
554
|
-
case
|
|
555
|
-
|
|
556
|
-
return _context.stop();
|
|
361
|
+
return _context.a(2, [false, 503, 'Service is Down', 'Unable to get any response from the ', _t]);
|
|
362
|
+
case 5:
|
|
363
|
+
return _context.a(2, [false, 403, 'Service is Down', 'Could not make the request, check and try again.', _t]);
|
|
364
|
+
case 6:
|
|
365
|
+
return _context.a(2);
|
|
557
366
|
}
|
|
558
|
-
}, _callee, null, [[1,
|
|
367
|
+
}, _callee, null, [[1, 3]]);
|
|
559
368
|
}));
|
|
560
369
|
return function request(_x, _x2, _x3, _x4, _x5) {
|
|
561
370
|
return _ref.apply(this, arguments);
|
|
562
371
|
};
|
|
563
372
|
}();
|
|
564
373
|
var requestWithError = /*#__PURE__*/function () {
|
|
565
|
-
var _ref2 = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
374
|
+
var _ref2 = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(method, url, body, queries, headers) {
|
|
566
375
|
var _yield$request, status, httpStatus, title, message, response, _response$message;
|
|
567
|
-
return
|
|
568
|
-
while (1) switch (_context2.
|
|
376
|
+
return _regenerator().w(function (_context2) {
|
|
377
|
+
while (1) switch (_context2.n) {
|
|
569
378
|
case 0:
|
|
570
|
-
_context2.
|
|
379
|
+
_context2.n = 1;
|
|
571
380
|
return request(method, url, body, queries, headers);
|
|
572
|
-
case
|
|
573
|
-
_yield$request = _context2.
|
|
381
|
+
case 1:
|
|
382
|
+
_yield$request = _context2.v;
|
|
574
383
|
status = _yield$request[0];
|
|
575
384
|
httpStatus = _yield$request[1];
|
|
576
385
|
title = _yield$request[2];
|
|
577
386
|
message = _yield$request[3];
|
|
578
387
|
response = _yield$request[4];
|
|
579
388
|
if (!(status !== true)) {
|
|
580
|
-
_context2.
|
|
389
|
+
_context2.n = 2;
|
|
581
390
|
break;
|
|
582
391
|
}
|
|
583
392
|
throw new Error(httpStatus + ": " + title + " " + ((_response$message = response == null ? void 0 : response.message) != null ? _response$message : message));
|
|
584
|
-
case
|
|
585
|
-
return _context2.
|
|
586
|
-
case 11:
|
|
587
|
-
case "end":
|
|
588
|
-
return _context2.stop();
|
|
393
|
+
case 2:
|
|
394
|
+
return _context2.a(2, response);
|
|
589
395
|
}
|
|
590
396
|
}, _callee2);
|
|
591
397
|
}));
|
|
592
|
-
return function requestWithError(_x6, _x7, _x8, _x9,
|
|
398
|
+
return function requestWithError(_x6, _x7, _x8, _x9, _x0) {
|
|
593
399
|
return _ref2.apply(this, arguments);
|
|
594
400
|
};
|
|
595
401
|
}();
|
|
@@ -612,42 +418,42 @@ var remove = function remove(url, body, queries, headers) {
|
|
|
612
418
|
var limit = 25;
|
|
613
419
|
var retryTracker = 0;
|
|
614
420
|
var run = /*#__PURE__*/function () {
|
|
615
|
-
var _ref = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
421
|
+
var _ref = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
616
422
|
var config, handler;
|
|
617
|
-
return
|
|
618
|
-
while (1) switch (_context2.
|
|
423
|
+
return _regenerator().w(function (_context2) {
|
|
424
|
+
while (1) switch (_context2.n) {
|
|
619
425
|
case 0:
|
|
620
426
|
config = getConfig();
|
|
621
|
-
handler = setInterval(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
622
|
-
var items, _yield$post, status, _config$batch, _config$batch3, _config$batch4, _config$batch2;
|
|
623
|
-
return
|
|
624
|
-
while (1) switch (_context.
|
|
427
|
+
handler = setInterval(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
428
|
+
var items, _yield$post, status, _config$batch, _config$batch3, _config$batch4, _config$batch2, _t;
|
|
429
|
+
return _regenerator().w(function (_context) {
|
|
430
|
+
while (1) switch (_context.p = _context.n) {
|
|
625
431
|
case 0:
|
|
626
432
|
if (!(length() < 1)) {
|
|
627
|
-
_context.
|
|
433
|
+
_context.n = 1;
|
|
628
434
|
break;
|
|
629
435
|
}
|
|
630
436
|
managedLog('BATCH RUN', 'Nothing to process', getConfig(), exports.LogType.INFO);
|
|
631
|
-
return _context.
|
|
632
|
-
case
|
|
437
|
+
return _context.a(2);
|
|
438
|
+
case 1:
|
|
633
439
|
items = pop(limit);
|
|
634
|
-
_context.
|
|
635
|
-
_context.
|
|
440
|
+
_context.p = 2;
|
|
441
|
+
_context.n = 3;
|
|
636
442
|
return post(config.server + "/apps/polylog/ingest/batch", {
|
|
637
443
|
items: items
|
|
638
444
|
});
|
|
639
|
-
case
|
|
640
|
-
_yield$post = _context.
|
|
445
|
+
case 3:
|
|
446
|
+
_yield$post = _context.v;
|
|
641
447
|
status = _yield$post[0];
|
|
642
448
|
if (status) {
|
|
643
|
-
_context.
|
|
449
|
+
_context.n = 6;
|
|
644
450
|
break;
|
|
645
451
|
}
|
|
646
452
|
push.apply(void 0, items);
|
|
647
453
|
managedLog('BATCH RUN', items.length + " sent back to queue", getConfig(), exports.LogType.INFO, exports.LogType.ERROR);
|
|
648
454
|
++retryTracker;
|
|
649
455
|
if (!(retryTracker > ((_config$batch = config.batch) == null ? void 0 : _config$batch.limit))) {
|
|
650
|
-
_context.
|
|
456
|
+
_context.n = 4;
|
|
651
457
|
break;
|
|
652
458
|
}
|
|
653
459
|
clearInterval(handler);
|
|
@@ -656,31 +462,29 @@ var run = /*#__PURE__*/function () {
|
|
|
656
462
|
giveUpAfter: (_config$batch2 = config.batch) == null ? void 0 : _config$batch2.limit
|
|
657
463
|
}, config, exports.LogType.INFO, exports.LogType.ERROR);
|
|
658
464
|
managedLog('BATCH RUN', "Processed stopped due to retry limit exhausted", getConfig(), exports.LogType.INFO, exports.LogType.ERROR);
|
|
659
|
-
return _context.
|
|
660
|
-
case
|
|
465
|
+
return _context.a(2);
|
|
466
|
+
case 4:
|
|
661
467
|
managedLog('BATCH RUN', "Sleeping for " + ((_config$batch3 = config.batch) == null ? void 0 : _config$batch3.backoff) + "ms", getConfig(), exports.LogType.INFO, exports.LogType.ERROR);
|
|
662
|
-
_context.
|
|
468
|
+
_context.n = 5;
|
|
663
469
|
return sleep((_config$batch4 = config.batch) == null ? void 0 : _config$batch4.backoff);
|
|
664
|
-
case
|
|
665
|
-
return _context.
|
|
666
|
-
case
|
|
470
|
+
case 5:
|
|
471
|
+
return _context.a(2);
|
|
472
|
+
case 6:
|
|
667
473
|
retryTracker = 0;
|
|
668
474
|
managedLog('BATCH RUN', items.length + " sent to server", getConfig(), exports.LogType.INFO);
|
|
669
|
-
_context.
|
|
475
|
+
_context.n = 8;
|
|
670
476
|
break;
|
|
671
|
-
case
|
|
672
|
-
_context.
|
|
673
|
-
|
|
674
|
-
console.error(
|
|
675
|
-
case
|
|
676
|
-
|
|
677
|
-
return _context.stop();
|
|
477
|
+
case 7:
|
|
478
|
+
_context.p = 7;
|
|
479
|
+
_t = _context.v;
|
|
480
|
+
console.error(_t);
|
|
481
|
+
case 8:
|
|
482
|
+
return _context.a(2);
|
|
678
483
|
}
|
|
679
|
-
}, _callee, null, [[
|
|
484
|
+
}, _callee, null, [[2, 7]]);
|
|
680
485
|
})), config.batch.interval);
|
|
681
|
-
case
|
|
682
|
-
|
|
683
|
-
return _context2.stop();
|
|
486
|
+
case 1:
|
|
487
|
+
return _context2.a(2);
|
|
684
488
|
}
|
|
685
489
|
}, _callee2);
|
|
686
490
|
}));
|
|
@@ -702,6 +506,7 @@ var init = function init(c) {
|
|
|
702
506
|
throw new Error('Invalid configuration - sourceId not defined');
|
|
703
507
|
}
|
|
704
508
|
managedLog('INIT ACTIVE CONFIG', config, config, exports.LogType.INFO);
|
|
509
|
+
setConfig(config);
|
|
705
510
|
run();
|
|
706
511
|
managedLog('INIT', 'Batch processing started', config, exports.LogType.INFO);
|
|
707
512
|
// register SDK as source
|
|
@@ -725,14 +530,11 @@ var BaseServiceService = /*#__PURE__*/function () {
|
|
|
725
530
|
}
|
|
726
531
|
var _proto = BaseServiceService.prototype;
|
|
727
532
|
_proto.request = /*#__PURE__*/function () {
|
|
728
|
-
var _request = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
729
|
-
return
|
|
730
|
-
while (1) switch (_context.
|
|
533
|
+
var _request = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(method, url, body, queries, headers) {
|
|
534
|
+
return _regenerator().w(function (_context) {
|
|
535
|
+
while (1) switch (_context.n) {
|
|
731
536
|
case 0:
|
|
732
|
-
return _context.
|
|
733
|
-
case 1:
|
|
734
|
-
case "end":
|
|
735
|
-
return _context.stop();
|
|
537
|
+
return _context.a(2, requestWithError(method, url, body, queries, headers));
|
|
736
538
|
}
|
|
737
539
|
}, _callee);
|
|
738
540
|
}));
|