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