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