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