@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.
@@ -34,306 +34,113 @@ function _extends() {
34
34
  return n;
35
35
  }, _extends.apply(null, arguments);
36
36
  }
37
- function _regeneratorRuntime() {
38
- _regeneratorRuntime = function () {
39
- return e;
40
- };
41
- var t,
42
- e = {},
43
- r = Object.prototype,
44
- n = r.hasOwnProperty,
45
- o = Object.defineProperty || function (t, e, r) {
46
- t[e] = r.value;
47
- },
48
- i = "function" == typeof Symbol ? Symbol : {},
49
- a = i.iterator || "@@iterator",
50
- c = i.asyncIterator || "@@asyncIterator",
51
- u = i.toStringTag || "@@toStringTag";
52
- function define(t, e, r) {
53
- return Object.defineProperty(t, e, {
54
- value: r,
55
- enumerable: !0,
56
- configurable: !0,
57
- writable: !0
58
- }), t[e];
59
- }
60
- try {
61
- define({}, "");
62
- } catch (t) {
63
- define = function (t, e, r) {
64
- return t[e] = r;
65
- };
66
- }
67
- function wrap(t, e, r, n) {
68
- var i = e && e.prototype instanceof Generator ? e : Generator,
69
- a = Object.create(i.prototype),
70
- c = new Context(n || []);
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
- return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
72
+ if (o || r > 1) return a;
73
+ throw y = !0, n;
139
74
  }
140
- });
141
- }
142
- function makeInvokeMethod(e, r, n) {
143
- var o = h;
144
- return function (i, a) {
145
- if (o === f) throw Error("Generator is already running");
146
- if (o === s) {
147
- if ("throw" === i) throw a;
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: !0
96
+ done: y
151
97
  };
152
- }
153
- for (n.method = i, n.arg = a;;) {
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
- function values(e) {
204
- if (e || "" === e) {
205
- var r = e[a];
206
- if (r) return r.call(e);
207
- if ("function" == typeof e.next) return e;
208
- if (!isNaN(e.length)) {
209
- var o = -1,
210
- i = function next() {
211
- for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
212
- return next.value = t, next.done = !0, next;
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, o(g, "constructor", {
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
- }), define(g, "toString", function () {
115
+ }), _regeneratorDefine(u, "toString", function () {
245
116
  return "[object Generator]";
246
- }), e.keys = function (t) {
247
- var e = Object(t),
248
- r = [];
249
- for (var n in e) r.push(n);
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
- }, e.values = values, Context.prototype = {
258
- constructor: Context,
259
- reset: function (e) {
260
- if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
261
- },
262
- stop: function () {
263
- this.done = !0;
264
- var t = this.tryEntries[0].completion;
265
- if ("throw" === t.type) throw t.arg;
266
- return this.rval;
267
- },
268
- dispatchException: function (e) {
269
- if (this.done) throw e;
270
- var r = this;
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
- }, e;
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__*/_regeneratorRuntime().mark(function _callee(method, url, body, queries, headers) {
419
- var config, _request, response, _response;
420
- return _regeneratorRuntime().wrap(function _callee$(_context) {
421
- while (1) switch (_context.prev = _context.next) {
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.prev = 1;
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.next = 6;
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 6:
443
- response = _context.sent;
252
+ case 2:
253
+ response = _context.v;
444
254
  managedLog('BATCH RESPONSE', response.data, config, exports.LogType.INFO);
445
- return _context.abrupt("return", [true, response.status, response.statusText, null, response.data]);
446
- case 11:
447
- _context.prev = 11;
448
- _context.t0 = _context["catch"](1);
449
- managedLog('BATCH ERROR', _context.t0, config, exports.LogType.ERROR);
450
- if (!_context.t0.response) {
451
- _context.next = 19;
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 = _context.t0.response;
457
- return _context.abrupt("return", [false, _response.status, _response.statusText, null, _response.data]);
458
- case 19:
459
- if (!_context.t0.request) {
460
- _context.next = 23;
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.abrupt("return", [false, 503, 'Service is Down', 'Unable to get any response from the ', _context.t0]);
464
- case 23:
465
- return _context.abrupt("return", [false, 403, 'Service is Down', 'Could not make the request, check and try again.', _context.t0]);
466
- case 24:
467
- case "end":
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, 11]]);
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__*/_regeneratorRuntime().mark(function _callee2(method, url, body, queries, headers) {
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 _regeneratorRuntime().wrap(function _callee2$(_context2) {
480
- while (1) switch (_context2.prev = _context2.next) {
288
+ return _regenerator().w(function (_context2) {
289
+ while (1) switch (_context2.n) {
481
290
  case 0:
482
- _context2.next = 2;
291
+ _context2.n = 1;
483
292
  return request(method, url, body, queries, headers);
484
- case 2:
485
- _yield$request = _context2.sent;
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.next = 10;
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 10:
497
- return _context2.abrupt("return", response);
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, _x10) {
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__*/_regeneratorRuntime().mark(function _callee(flags, environmentTypeName) {
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 _regeneratorRuntime().wrap(function _callee$(_context) {
528
- while (1) switch (_context.prev = _context.next) {
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.next = 4;
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 4:
545
- _yield$post = _context.sent;
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.next = 13;
358
+ _context.n = 2;
553
359
  break;
554
360
  }
555
361
  console.error('REGISTER ERROR', title, message, httpStatus);
556
- return _context.abrupt("return", null);
557
- case 13:
558
- return _context.abrupt("return", response == null ? void 0 : response.data);
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__*/_regeneratorRuntime().mark(function _callee2(name, limit, level, userId, clientId, workspaceId) {
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 _regeneratorRuntime().wrap(function _callee2$(_context2) {
573
- while (1) switch (_context2.prev = _context2.next) {
375
+ return _regenerator().w(function (_context2) {
376
+ while (1) switch (_context2.n) {
574
377
  case 0:
575
378
  config = getConfig();
576
- _context2.next = 3;
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 3:
589
- _yield$post2 = _context2.sent;
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.next = 12;
399
+ _context2.n = 2;
597
400
  break;
598
401
  }
599
402
  console.error('STATUS ERROR', title, message, httpStatus);
600
- return _context2.abrupt("return", null);
601
- case 12:
602
- return _context2.abrupt("return", response == null ? void 0 : response.data);
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__*/_regeneratorRuntime().mark(function _callee3(names, level, userId, clientId, workspaceId) {
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 _regeneratorRuntime().wrap(function _callee3$(_context3) {
617
- while (1) switch (_context3.prev = _context3.next) {
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.next = 5;
421
+ _context3.n = 1;
622
422
  break;
623
423
  }
624
424
  names = [[names]];
625
- _context3.next = 14;
425
+ _context3.n = 4;
626
426
  break;
627
- case 5:
427
+ case 1:
628
428
  if (!(_arrayDepth(names) === 1)) {
629
- _context3.next = 9;
429
+ _context3.n = 2;
630
430
  break;
631
431
  }
632
432
  names = [names];
633
- _context3.next = 14;
433
+ _context3.n = 4;
634
434
  break;
635
- case 9:
435
+ case 2:
636
436
  if (!(_arrayDepth(names) === 2)) {
637
- _context3.next = 13;
437
+ _context3.n = 3;
638
438
  break;
639
439
  }
640
440
  names = names;
641
- _context3.next = 14;
441
+ _context3.n = 4;
642
442
  break;
643
- case 13:
644
- return _context3.abrupt("return", false);
645
- case 14:
646
- _context3.next = 16;
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 16:
658
- _yield$post3 = _context3.sent;
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.next = 25;
465
+ _context3.n = 6;
666
466
  break;
667
467
  }
668
468
  console.error('STATUS ERROR', title, message, httpStatus);
669
- return _context3.abrupt("return", null);
670
- case 25:
671
- return _context3.abrupt("return", response == null ? void 0 : response.data);
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, _x10, _x11, _x12, _x13) {
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__*/_regeneratorRuntime().mark(function _callee4(name, level, userId, clientId, workspaceId) {
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 _regeneratorRuntime().wrap(function _callee4$(_context4) {
686
- while (1) switch (_context4.prev = _context4.next) {
482
+ return _regenerator().w(function (_context4) {
483
+ while (1) switch (_context4.n) {
687
484
  case 0:
688
485
  config = getConfig();
689
- _context4.next = 3;
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 3:
701
- _yield$post4 = _context4.sent;
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.next = 12;
505
+ _context4.n = 2;
709
506
  break;
710
507
  }
711
508
  console.error('STATUS ERROR', title, message, httpStatus);
712
- return _context4.abrupt("return", null);
713
- case 12:
714
- return _context4.abrupt("return", response == null ? void 0 : response.data);
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(_x14, _x15, _x16, _x17, _x18) {
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,