roboto-js 1.7.1 → 1.7.4

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.
@@ -13,19 +13,19 @@ var _lodash = _interopRequireDefault(require("lodash"));
13
13
  var _idb = require("idb");
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
15
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
16
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
17
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
19
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
16
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
21
17
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
22
18
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
19
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; 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; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; 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); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { 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); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; 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; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
24
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
25
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
20
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
21
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
22
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
23
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
26
24
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
27
25
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
28
26
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
27
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
28
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
29
29
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
30
30
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
31
31
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
@@ -77,28 +77,11 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
77
77
  };
78
78
  }
79
79
 
80
- // Synchronous browser hydration: set auth header and in-memory user immediately
81
- if (typeof localStorage !== 'undefined') {
82
- try {
83
- var token = localStorage.getItem('authtoken');
84
- if (token) {
85
- this.authtoken = token;
86
- this.axios.defaults.headers.common['authtoken'] = token;
87
- }
88
- } catch (_unused) {}
89
- try {
90
- var cachedUser = localStorage.getItem('rbtUser');
91
- if (cachedUser) {
92
- var parsed = JSON.parse(cachedUser);
93
- if (parsed && parsed.id) {
94
- this.currentUser = new _rbt_user["default"]({
95
- id: parsed.id
96
- }, this.axios);
97
- this.currentUser.setData(parsed);
98
- }
99
- }
100
- } catch (_unused2) {}
101
- }
80
+ // Asynchronous browser hydration: set auth header and in-memory user
81
+ // Use storage adaptor if available, otherwise fallback to localStorage
82
+ this._initializeFromStorage()["catch"](function (e) {
83
+ return console.warn('[RbtApi] Storage initialization failed:', e);
84
+ });
102
85
  this.localDb = null;
103
86
  this.iac_session = null;
104
87
  this.appServiceHost = baseUrl;
@@ -110,7 +93,109 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
110
93
  this.initAuthToken(authtoken);
111
94
  this.initApiKey(apikey);
112
95
  }
96
+
97
+ // Initialize authtoken and user from storage (cookies or localStorage)
113
98
  _createClass(RbtApi, [{
99
+ key: "_initializeFromStorage",
100
+ value: function () {
101
+ var _initializeFromStorage2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
102
+ var token, cookies, _iterator, _step, cookie, _cookie$trim$split, _cookie$trim$split2, name, value, cachedUser, parsed;
103
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
104
+ while (1) switch (_context.prev = _context.next) {
105
+ case 0:
106
+ if (this.localStorageAdaptor) {
107
+ _context.next = 2;
108
+ break;
109
+ }
110
+ return _context.abrupt("return");
111
+ case 2:
112
+ _context.prev = 2;
113
+ _context.next = 5;
114
+ return this.localStorageAdaptor.getItem('authtoken');
115
+ case 5:
116
+ token = _context.sent;
117
+ if (!(!token && typeof document !== 'undefined')) {
118
+ _context.next = 27;
119
+ break;
120
+ }
121
+ // Try to get from raw cookie
122
+ cookies = document.cookie.split(';');
123
+ _iterator = _createForOfIteratorHelper(cookies);
124
+ _context.prev = 9;
125
+ _iterator.s();
126
+ case 11:
127
+ if ((_step = _iterator.n()).done) {
128
+ _context.next = 19;
129
+ break;
130
+ }
131
+ cookie = _step.value;
132
+ _cookie$trim$split = cookie.trim().split('='), _cookie$trim$split2 = _slicedToArray(_cookie$trim$split, 2), name = _cookie$trim$split2[0], value = _cookie$trim$split2[1];
133
+ if (!(name === 'authtoken')) {
134
+ _context.next = 17;
135
+ break;
136
+ }
137
+ token = decodeURIComponent(value);
138
+ return _context.abrupt("break", 19);
139
+ case 17:
140
+ _context.next = 11;
141
+ break;
142
+ case 19:
143
+ _context.next = 24;
144
+ break;
145
+ case 21:
146
+ _context.prev = 21;
147
+ _context.t0 = _context["catch"](9);
148
+ _iterator.e(_context.t0);
149
+ case 24:
150
+ _context.prev = 24;
151
+ _iterator.f();
152
+ return _context.finish(24);
153
+ case 27:
154
+ if (token) {
155
+ this.authtoken = token;
156
+ this.axios.defaults.headers.common['authtoken'] = token;
157
+ console.log('[RbtApi] Loaded authtoken from storage adaptor');
158
+ }
159
+ _context.next = 33;
160
+ break;
161
+ case 30:
162
+ _context.prev = 30;
163
+ _context.t1 = _context["catch"](2);
164
+ console.warn('[RbtApi] Failed to load authtoken from storage adaptor:', _context.t1);
165
+ case 33:
166
+ _context.prev = 33;
167
+ _context.next = 36;
168
+ return this.localStorageAdaptor.getItem('rbtUser');
169
+ case 36:
170
+ cachedUser = _context.sent;
171
+ if (cachedUser) {
172
+ parsed = typeof cachedUser === 'string' ? JSON.parse(cachedUser) : cachedUser;
173
+ if (parsed && parsed.id) {
174
+ this.currentUser = new _rbt_user["default"]({
175
+ id: parsed.id
176
+ }, this.axios);
177
+ this.currentUser.setData(parsed);
178
+ console.log('[RbtApi] Loaded user from storage adaptor');
179
+ }
180
+ }
181
+ _context.next = 43;
182
+ break;
183
+ case 40:
184
+ _context.prev = 40;
185
+ _context.t2 = _context["catch"](33);
186
+ console.warn('[RbtApi] Failed to load user from storage adaptor:', _context.t2);
187
+ case 43:
188
+ case "end":
189
+ return _context.stop();
190
+ }
191
+ }, _callee, this, [[2, 30], [9, 21, 24, 27], [33, 40]]);
192
+ }));
193
+ function _initializeFromStorage() {
194
+ return _initializeFromStorage2.apply(this, arguments);
195
+ }
196
+ return _initializeFromStorage;
197
+ }()
198
+ }, {
114
199
  key: "getWebSocketClient",
115
200
  value: function getWebSocketClient() {
116
201
  // Reuse existing WebSocket if it's OPEN or CONNECTING (to prevent race condition)
@@ -136,20 +221,20 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
136
221
 
137
222
  // Re-subscribe to all objects that were previously subscribed
138
223
  if (_this._wsSubscriptions) {
139
- var _iterator = _createForOfIteratorHelper(_this._wsSubscriptions),
140
- _step;
224
+ var _iterator2 = _createForOfIteratorHelper(_this._wsSubscriptions),
225
+ _step2;
141
226
  try {
142
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
143
- var objectId = _step.value;
227
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
228
+ var objectId = _step2.value;
144
229
  ws.send(JSON.stringify({
145
230
  type: 'subscribe',
146
231
  objectId: objectId
147
232
  }));
148
233
  }
149
234
  } catch (err) {
150
- _iterator.e(err);
235
+ _iterator2.e(err);
151
236
  } finally {
152
- _iterator.f();
237
+ _iterator2.f();
153
238
  }
154
239
  }
155
240
  };
@@ -215,18 +300,18 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
215
300
  }, {
216
301
  key: "initAuthToken",
217
302
  value: function () {
218
- var _initAuthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authtoken) {
219
- return _regeneratorRuntime().wrap(function _callee$(_context) {
220
- while (1) switch (_context.prev = _context.next) {
303
+ var _initAuthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(authtoken) {
304
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
305
+ while (1) switch (_context2.prev = _context2.next) {
221
306
  case 0:
222
307
  if (!(!authtoken && this.localStorageAdaptor)) {
223
- _context.next = 4;
308
+ _context2.next = 4;
224
309
  break;
225
310
  }
226
- _context.next = 3;
311
+ _context2.next = 3;
227
312
  return this.localStorageAdaptor.getItem('authtoken');
228
313
  case 3:
229
- authtoken = _context.sent;
314
+ authtoken = _context2.sent;
230
315
  case 4:
231
316
  if (authtoken) {
232
317
  this.authtoken = authtoken;
@@ -234,9 +319,9 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
234
319
  }
235
320
  case 5:
236
321
  case "end":
237
- return _context.stop();
322
+ return _context2.stop();
238
323
  }
239
- }, _callee, this);
324
+ }, _callee2, this);
240
325
  }));
241
326
  function initAuthToken(_x) {
242
327
  return _initAuthToken.apply(this, arguments);
@@ -246,18 +331,18 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
246
331
  }, {
247
332
  key: "initApiKey",
248
333
  value: function () {
249
- var _initApiKey = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(apikey) {
250
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
251
- while (1) switch (_context2.prev = _context2.next) {
334
+ var _initApiKey = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(apikey) {
335
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
336
+ while (1) switch (_context3.prev = _context3.next) {
252
337
  case 0:
253
338
  if (!(!apikey && this.localStorageAdaptor)) {
254
- _context2.next = 4;
339
+ _context3.next = 4;
255
340
  break;
256
341
  }
257
- _context2.next = 3;
342
+ _context3.next = 3;
258
343
  return this.localStorageAdaptor.getItem('apikey');
259
344
  case 3:
260
- apikey = _context2.sent;
345
+ apikey = _context3.sent;
261
346
  case 4:
262
347
  if (apikey) {
263
348
  this.apikey = apikey;
@@ -265,9 +350,9 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
265
350
  }
266
351
  case 5:
267
352
  case "end":
268
- return _context2.stop();
353
+ return _context3.stop();
269
354
  }
270
- }, _callee2, this);
355
+ }, _callee3, this);
271
356
  }));
272
357
  function initApiKey(_x2) {
273
358
  return _initApiKey.apply(this, arguments);
@@ -277,11 +362,11 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
277
362
  }, {
278
363
  key: "initLocalDb",
279
364
  value: function () {
280
- var _initLocalDb = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
281
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
282
- while (1) switch (_context3.prev = _context3.next) {
365
+ var _initLocalDb = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
366
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
367
+ while (1) switch (_context4.prev = _context4.next) {
283
368
  case 0:
284
- _context3.next = 2;
369
+ _context4.next = 2;
285
370
  return (0, _idb.openDB)('RBTFileDatabase', 1, {
286
371
  upgrade: function upgrade(db) {
287
372
  if (!db.objectStoreNames.contains('files')) {
@@ -292,12 +377,12 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
292
377
  }
293
378
  });
294
379
  case 2:
295
- this.localDb = _context3.sent;
380
+ this.localDb = _context4.sent;
296
381
  case 3:
297
382
  case "end":
298
- return _context3.stop();
383
+ return _context4.stop();
299
384
  }
300
- }, _callee3, this);
385
+ }, _callee4, this);
301
386
  }));
302
387
  function initLocalDb() {
303
388
  return _initLocalDb.apply(this, arguments);
@@ -327,28 +412,28 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
327
412
  }, {
328
413
  key: "registerTypedefs",
329
414
  value: function () {
330
- var _registerTypedefs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(typedefs) {
415
+ var _registerTypedefs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(typedefs) {
331
416
  var response;
332
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
333
- while (1) switch (_context4.prev = _context4.next) {
417
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
418
+ while (1) switch (_context5.prev = _context5.next) {
334
419
  case 0:
335
- _context4.prev = 0;
336
- _context4.next = 3;
420
+ _context5.prev = 0;
421
+ _context5.next = 3;
337
422
  return this.axios.post('/api/doctree/registerTypedefs', [{
338
423
  typedefs: typedefs
339
424
  }]);
340
425
  case 3:
341
- response = _context4.sent;
342
- return _context4.abrupt("return", response.data);
426
+ response = _context5.sent;
427
+ return _context5.abrupt("return", response.data);
343
428
  case 7:
344
- _context4.prev = 7;
345
- _context4.t0 = _context4["catch"](0);
346
- this._handleError(_context4.t0);
429
+ _context5.prev = 7;
430
+ _context5.t0 = _context5["catch"](0);
431
+ this._handleError(_context5.t0);
347
432
  case 10:
348
433
  case "end":
349
- return _context4.stop();
434
+ return _context5.stop();
350
435
  }
351
- }, _callee4, this, [[0, 7]]);
436
+ }, _callee5, this, [[0, 7]]);
352
437
  }));
353
438
  function registerTypedefs(_x3) {
354
439
  return _registerTypedefs.apply(this, arguments);
@@ -367,13 +452,13 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
367
452
  }, {
368
453
  key: "login",
369
454
  value: (function () {
370
- var _login = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
455
+ var _login = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
371
456
  var response, _this$iac_session;
372
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
373
- while (1) switch (_context5.prev = _context5.next) {
457
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
458
+ while (1) switch (_context6.prev = _context6.next) {
374
459
  case 0:
375
- _context5.prev = 0;
376
- _context5.next = 3;
460
+ _context6.prev = 0;
461
+ _context6.next = 3;
377
462
  return this.axios.post('/user_service/loginUser', [{
378
463
  email: params.email,
379
464
  password: params.password ? _cryptoJs["default"].MD5(params.password).toString(_cryptoJs["default"].enc.Hex) : null,
@@ -383,12 +468,12 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
383
468
  code: params.code || null // single-use signon code (password resets)
384
469
  }]);
385
470
  case 3:
386
- response = _context5.sent;
471
+ response = _context6.sent;
387
472
  if (!(response.data.ok === false)) {
388
- _context5.next = 6;
473
+ _context6.next = 6;
389
474
  break;
390
475
  }
391
- return _context5.abrupt("return", this._handleError(response));
476
+ return _context6.abrupt("return", this._handleError(response));
392
477
  case 6:
393
478
  this.iac_session = response.data;
394
479
  this.currentUser = this.iac_session ? new _rbt_user["default"](this.iac_session.user, this.axios) : null;
@@ -396,29 +481,29 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
396
481
  this.axios.defaults.headers.common['authtoken'] = response.data.authToken;
397
482
  this.authtoken = response.data.authToken;
398
483
  if (!this.localStorageAdaptor) {
399
- _context5.next = 16;
484
+ _context6.next = 16;
400
485
  break;
401
486
  }
402
- _context5.next = 13;
487
+ _context6.next = 13;
403
488
  return this.localStorageAdaptor.setItem('authtoken', response.data.authToken);
404
489
  case 13:
405
490
  if (!((_this$iac_session = this.iac_session) !== null && _this$iac_session !== void 0 && _this$iac_session.user)) {
406
- _context5.next = 16;
491
+ _context6.next = 16;
407
492
  break;
408
493
  }
409
- _context5.next = 16;
494
+ _context6.next = 16;
410
495
  return this.localStorageAdaptor.setItem('rbtUser', JSON.stringify(this.iac_session.user));
411
496
  case 16:
412
- return _context5.abrupt("return", response.data);
497
+ return _context6.abrupt("return", response.data);
413
498
  case 19:
414
- _context5.prev = 19;
415
- _context5.t0 = _context5["catch"](0);
416
- this._handleError(_context5.t0);
499
+ _context6.prev = 19;
500
+ _context6.t0 = _context6["catch"](0);
501
+ this._handleError(_context6.t0);
417
502
  case 22:
418
503
  case "end":
419
- return _context5.stop();
504
+ return _context6.stop();
420
505
  }
421
- }, _callee5, this, [[0, 19]]);
506
+ }, _callee6, this, [[0, 19]]);
422
507
  }));
423
508
  function login(_x4) {
424
509
  return _login.apply(this, arguments);
@@ -428,21 +513,21 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
428
513
  }, {
429
514
  key: "loginWithOauth",
430
515
  value: function () {
431
- var _loginWithOauth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(userData) {
516
+ var _loginWithOauth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(userData) {
432
517
  var response;
433
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
434
- while (1) switch (_context6.prev = _context6.next) {
518
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
519
+ while (1) switch (_context7.prev = _context7.next) {
435
520
  case 0:
436
- _context6.prev = 0;
437
- _context6.next = 3;
521
+ _context7.prev = 0;
522
+ _context7.next = 3;
438
523
  return this.post('/api/account/registerOrSigninOauth', userData);
439
524
  case 3:
440
- response = _context6.sent;
525
+ response = _context7.sent;
441
526
  if (!(response.ok === false)) {
442
- _context6.next = 6;
527
+ _context7.next = 6;
443
528
  break;
444
529
  }
445
- return _context6.abrupt("return", this._handleError(response));
530
+ return _context7.abrupt("return", this._handleError(response));
446
531
  case 6:
447
532
  this.iac_session = response;
448
533
  this.currentUser = this.iac_session ? new _rbt_user["default"](this.iac_session.user, this.axios) : null;
@@ -450,22 +535,22 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
450
535
  this.axios.defaults.headers.common['authtoken'] = response.authToken;
451
536
  this.authtoken = response.authToken;
452
537
  if (!this.localStorageAdaptor) {
453
- _context6.next = 13;
538
+ _context7.next = 13;
454
539
  break;
455
540
  }
456
- _context6.next = 13;
541
+ _context7.next = 13;
457
542
  return this.localStorageAdaptor.setItem('authtoken', response.authToken);
458
543
  case 13:
459
- return _context6.abrupt("return", response);
544
+ return _context7.abrupt("return", response);
460
545
  case 16:
461
- _context6.prev = 16;
462
- _context6.t0 = _context6["catch"](0);
463
- this._handleError(_context6.t0);
546
+ _context7.prev = 16;
547
+ _context7.t0 = _context7["catch"](0);
548
+ this._handleError(_context7.t0);
464
549
  case 19:
465
550
  case "end":
466
- return _context6.stop();
551
+ return _context7.stop();
467
552
  }
468
- }, _callee6, this, [[0, 16]]);
553
+ }, _callee7, this, [[0, 16]]);
469
554
  }));
470
555
  function loginWithOauth(_x5) {
471
556
  return _loginWithOauth.apply(this, arguments);
@@ -475,21 +560,21 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
475
560
  }, {
476
561
  key: "logout",
477
562
  value: function () {
478
- var _logout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
563
+ var _logout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
479
564
  var response;
480
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
481
- while (1) switch (_context7.prev = _context7.next) {
565
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
566
+ while (1) switch (_context8.prev = _context8.next) {
482
567
  case 0:
483
- _context7.prev = 0;
484
- _context7.next = 3;
568
+ _context8.prev = 0;
569
+ _context8.next = 3;
485
570
  return this.axios.post('/user_service/logoutUser');
486
571
  case 3:
487
- response = _context7.sent;
572
+ response = _context8.sent;
488
573
  if (!(response.data.ok === false)) {
489
- _context7.next = 6;
574
+ _context8.next = 6;
490
575
  break;
491
576
  }
492
- return _context7.abrupt("return", this._handleError(response));
577
+ return _context8.abrupt("return", this._handleError(response));
493
578
  case 6:
494
579
  // Clear the iac_session and remove the auth token from axios headers
495
580
  this.iac_session = null;
@@ -501,22 +586,22 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
501
586
 
502
587
  // Clear localStorage if it's being used
503
588
  if (!this.localStorageAdaptor) {
504
- _context7.next = 13;
589
+ _context8.next = 13;
505
590
  break;
506
591
  }
507
- _context7.next = 13;
592
+ _context8.next = 13;
508
593
  return this.localStorageAdaptor.removeItem('authtoken');
509
594
  case 13:
510
- return _context7.abrupt("return", response.data);
595
+ return _context8.abrupt("return", response.data);
511
596
  case 16:
512
- _context7.prev = 16;
513
- _context7.t0 = _context7["catch"](0);
514
- this._handleError(_context7.t0);
597
+ _context8.prev = 16;
598
+ _context8.t0 = _context8["catch"](0);
599
+ this._handleError(_context8.t0);
515
600
  case 19:
516
601
  case "end":
517
- return _context7.stop();
602
+ return _context8.stop();
518
603
  }
519
- }, _callee7, this, [[0, 16]]);
604
+ }, _callee8, this, [[0, 16]]);
520
605
  }));
521
606
  function logout() {
522
607
  return _logout.apply(this, arguments);
@@ -533,52 +618,52 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
533
618
  }, {
534
619
  key: "loadCurrentUser",
535
620
  value: function () {
536
- var _loadCurrentUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
621
+ var _loadCurrentUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
537
622
  var _this2 = this;
538
623
  var result;
539
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
540
- while (1) switch (_context9.prev = _context9.next) {
624
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
625
+ while (1) switch (_context10.prev = _context10.next) {
541
626
  case 0:
542
- _context9.prev = 0;
627
+ _context10.prev = 0;
543
628
  if (!this._loadCurrentUserPromise) {
544
- _context9.next = 3;
629
+ _context10.next = 3;
545
630
  break;
546
631
  }
547
- return _context9.abrupt("return", this._loadCurrentUserPromise);
632
+ return _context10.abrupt("return", this._loadCurrentUserPromise);
548
633
  case 3:
549
634
  if (!this.currentUser) {
550
- _context9.next = 5;
635
+ _context10.next = 5;
551
636
  break;
552
637
  }
553
- return _context9.abrupt("return", this.currentUser);
638
+ return _context10.abrupt("return", this.currentUser);
554
639
  case 5:
555
640
  if (!this.apikey) {
556
- _context9.next = 9;
641
+ _context10.next = 9;
557
642
  break;
558
643
  }
559
- return _context9.abrupt("return", null);
644
+ return _context10.abrupt("return", null);
560
645
  case 9:
561
646
  if (!this.authtoken) {
562
- _context9.next = 18;
647
+ _context10.next = 18;
563
648
  break;
564
649
  }
565
- this._loadCurrentUserPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
650
+ this._loadCurrentUserPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
566
651
  var response, _response$user;
567
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
568
- while (1) switch (_context8.prev = _context8.next) {
652
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
653
+ while (1) switch (_context9.prev = _context9.next) {
569
654
  case 0:
570
- _context8.next = 2;
655
+ _context9.next = 2;
571
656
  return _this2.refreshAuthToken(_this2.authtoken);
572
657
  case 2:
573
- response = _context8.sent;
658
+ response = _context9.sent;
574
659
  if (response) {
575
- _context8.next = 5;
660
+ _context9.next = 5;
576
661
  break;
577
662
  }
578
- return _context8.abrupt("return", null);
663
+ return _context9.abrupt("return", null);
579
664
  case 5:
580
665
  if (!(response !== null && response !== void 0 && response.user)) {
581
- _context8.next = 11;
666
+ _context9.next = 11;
582
667
  break;
583
668
  }
584
669
  _this2.currentUser = new _rbt_user["default"]({
@@ -586,38 +671,38 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
586
671
  }, _this2.axios);
587
672
  _this2.currentUser.setData(response.user);
588
673
  if (!_this2.localStorageAdaptor) {
589
- _context8.next = 11;
674
+ _context9.next = 11;
590
675
  break;
591
676
  }
592
- _context8.next = 11;
677
+ _context9.next = 11;
593
678
  return _this2.localStorageAdaptor.setItem('rbtUser', JSON.stringify(response.user));
594
679
  case 11:
595
- return _context8.abrupt("return", _this2.currentUser);
680
+ return _context9.abrupt("return", _this2.currentUser);
596
681
  case 12:
597
682
  case "end":
598
- return _context8.stop();
683
+ return _context9.stop();
599
684
  }
600
- }, _callee8);
685
+ }, _callee9);
601
686
  }))();
602
- _context9.next = 13;
687
+ _context10.next = 13;
603
688
  return this._loadCurrentUserPromise;
604
689
  case 13:
605
- result = _context9.sent;
690
+ result = _context10.sent;
606
691
  this._loadCurrentUserPromise = null;
607
- return _context9.abrupt("return", result);
692
+ return _context10.abrupt("return", result);
608
693
  case 18:
609
694
  this.currentUser = null;
610
695
  case 19:
611
- return _context9.abrupt("return", null);
696
+ return _context10.abrupt("return", null);
612
697
  case 22:
613
- _context9.prev = 22;
614
- _context9.t0 = _context9["catch"](0);
615
- return _context9.abrupt("return", this._handleError(_context9.t0));
698
+ _context10.prev = 22;
699
+ _context10.t0 = _context10["catch"](0);
700
+ return _context10.abrupt("return", this._handleError(_context10.t0));
616
701
  case 25:
617
702
  case "end":
618
- return _context9.stop();
703
+ return _context10.stop();
619
704
  }
620
- }, _callee9, this, [[0, 22]]);
705
+ }, _callee10, this, [[0, 22]]);
621
706
  }));
622
707
  function loadCurrentUser() {
623
708
  return _loadCurrentUser.apply(this, arguments);
@@ -627,35 +712,35 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
627
712
  }, {
628
713
  key: "confirmUserEmail",
629
714
  value: function () {
630
- var _confirmUserEmail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(confirmCode) {
715
+ var _confirmUserEmail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(confirmCode) {
631
716
  var params, response;
632
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
633
- while (1) switch (_context10.prev = _context10.next) {
717
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
718
+ while (1) switch (_context11.prev = _context11.next) {
634
719
  case 0:
635
720
  params = {
636
721
  emailConfirmCode: confirmCode
637
722
  };
638
- _context10.prev = 1;
639
- _context10.next = 4;
723
+ _context11.prev = 1;
724
+ _context11.next = 4;
640
725
  return this.axios.post('/user_service/confirmUserEmail', [params]);
641
726
  case 4:
642
- response = _context10.sent;
727
+ response = _context11.sent;
643
728
  if (!(response.data.ok === false)) {
644
- _context10.next = 7;
729
+ _context11.next = 7;
645
730
  break;
646
731
  }
647
- return _context10.abrupt("return", this._handleError(response));
732
+ return _context11.abrupt("return", this._handleError(response));
648
733
  case 7:
649
- return _context10.abrupt("return", response.data);
734
+ return _context11.abrupt("return", response.data);
650
735
  case 10:
651
- _context10.prev = 10;
652
- _context10.t0 = _context10["catch"](1);
653
- return _context10.abrupt("return", this._handleError(_context10.t0));
736
+ _context11.prev = 10;
737
+ _context11.t0 = _context11["catch"](1);
738
+ return _context11.abrupt("return", this._handleError(_context11.t0));
654
739
  case 13:
655
740
  case "end":
656
- return _context10.stop();
741
+ return _context11.stop();
657
742
  }
658
- }, _callee10, this, [[1, 10]]);
743
+ }, _callee11, this, [[1, 10]]);
659
744
  }));
660
745
  function confirmUserEmail(_x6) {
661
746
  return _confirmUserEmail.apply(this, arguments);
@@ -665,53 +750,53 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
665
750
  }, {
666
751
  key: "loadCurrentUserExtended",
667
752
  value: function () {
668
- var _loadCurrentUserExtended = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
753
+ var _loadCurrentUserExtended = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
669
754
  var _this3 = this;
670
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
671
- while (1) switch (_context12.prev = _context12.next) {
755
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
756
+ while (1) switch (_context13.prev = _context13.next) {
672
757
  case 0:
673
758
  if (!this._loadCurrentUserExtendedPromise) {
674
- _context12.next = 2;
759
+ _context13.next = 2;
675
760
  break;
676
761
  }
677
- return _context12.abrupt("return", this._loadCurrentUserExtendedPromise);
762
+ return _context13.abrupt("return", this._loadCurrentUserExtendedPromise);
678
763
  case 2:
679
- this._loadCurrentUserExtendedPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
764
+ this._loadCurrentUserExtendedPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
680
765
  var currentUser;
681
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
682
- while (1) switch (_context11.prev = _context11.next) {
766
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
767
+ while (1) switch (_context12.prev = _context12.next) {
683
768
  case 0:
684
- _context11.next = 2;
769
+ _context12.next = 2;
685
770
  return _this3.loadCurrentUser();
686
771
  case 2:
687
- currentUser = _context11.sent;
772
+ currentUser = _context12.sent;
688
773
  if (!currentUser) {
689
- _context11.next = 7;
774
+ _context12.next = 7;
690
775
  break;
691
776
  }
692
- return _context11.abrupt("return", _this3.loadUser(currentUser.id));
777
+ return _context12.abrupt("return", _this3.loadUser(currentUser.id));
693
778
  case 7:
694
- return _context11.abrupt("return", null);
779
+ return _context12.abrupt("return", null);
695
780
  case 8:
696
781
  case "end":
697
- return _context11.stop();
782
+ return _context12.stop();
698
783
  }
699
- }, _callee11);
784
+ }, _callee12);
700
785
  }))();
701
- _context12.prev = 3;
702
- _context12.next = 6;
786
+ _context13.prev = 3;
787
+ _context13.next = 6;
703
788
  return this._loadCurrentUserExtendedPromise;
704
789
  case 6:
705
- return _context12.abrupt("return", _context12.sent);
790
+ return _context13.abrupt("return", _context13.sent);
706
791
  case 7:
707
- _context12.prev = 7;
792
+ _context13.prev = 7;
708
793
  this._loadCurrentUserExtendedPromise = null;
709
- return _context12.finish(7);
794
+ return _context13.finish(7);
710
795
  case 10:
711
796
  case "end":
712
- return _context12.stop();
797
+ return _context13.stop();
713
798
  }
714
- }, _callee12, this, [[3,, 7, 10]]);
799
+ }, _callee13, this, [[3,, 7, 10]]);
715
800
  }));
716
801
  function loadCurrentUserExtended() {
717
802
  return _loadCurrentUserExtended.apply(this, arguments);
@@ -721,11 +806,11 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
721
806
  }, {
722
807
  key: "loadUser",
723
808
  value: function () {
724
- var _loadUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(userId) {
809
+ var _loadUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(userId) {
725
810
  var _this4 = this;
726
811
  var params, cacheKey, now, existing, p;
727
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
728
- while (1) switch (_context14.prev = _context14.next) {
812
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
813
+ while (1) switch (_context15.prev = _context15.next) {
729
814
  case 0:
730
815
  params = {
731
816
  id: userId
@@ -734,51 +819,51 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
734
819
  now = Date.now();
735
820
  existing = this.requestCache[cacheKey];
736
821
  if (!(existing && now - existing.time < 10000)) {
737
- _context14.next = 6;
822
+ _context15.next = 6;
738
823
  break;
739
824
  }
740
- return _context14.abrupt("return", existing.val);
825
+ return _context15.abrupt("return", existing.val);
741
826
  case 6:
742
- _context14.prev = 6;
743
- p = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
827
+ _context15.prev = 6;
828
+ p = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
744
829
  var _response$data;
745
830
  var response, userData, User;
746
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
747
- while (1) switch (_context13.prev = _context13.next) {
831
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
832
+ while (1) switch (_context14.prev = _context14.next) {
748
833
  case 0:
749
- _context13.next = 2;
834
+ _context14.next = 2;
750
835
  return _this4.axios.post('/user_service/loadUser', [params]);
751
836
  case 2:
752
- response = _context13.sent;
837
+ response = _context14.sent;
753
838
  userData = response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.user;
754
839
  User = new _rbt_user["default"]({
755
840
  id: userData.id
756
841
  }, _this4.axios);
757
842
  User.setData(userData);
758
- return _context13.abrupt("return", User);
843
+ return _context14.abrupt("return", User);
759
844
  case 7:
760
845
  case "end":
761
- return _context13.stop();
846
+ return _context14.stop();
762
847
  }
763
- }, _callee13);
848
+ }, _callee14);
764
849
  }))();
765
850
  this.requestCache[cacheKey] = {
766
851
  val: p,
767
852
  time: now
768
853
  };
769
- _context14.next = 11;
854
+ _context15.next = 11;
770
855
  return p;
771
856
  case 11:
772
- return _context14.abrupt("return", _context14.sent);
857
+ return _context15.abrupt("return", _context15.sent);
773
858
  case 14:
774
- _context14.prev = 14;
775
- _context14.t0 = _context14["catch"](6);
776
- return _context14.abrupt("return", this._handleError(_context14.t0));
859
+ _context15.prev = 14;
860
+ _context15.t0 = _context15["catch"](6);
861
+ return _context15.abrupt("return", this._handleError(_context15.t0));
777
862
  case 17:
778
863
  case "end":
779
- return _context14.stop();
864
+ return _context15.stop();
780
865
  }
781
- }, _callee14, this, [[6, 14]]);
866
+ }, _callee15, this, [[6, 14]]);
782
867
  }));
783
868
  function loadUser(_x7) {
784
869
  return _loadUser.apply(this, arguments);
@@ -788,52 +873,52 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
788
873
  }, {
789
874
  key: "refreshAuthToken",
790
875
  value: function () {
791
- var _refreshAuthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(authtoken) {
876
+ var _refreshAuthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(authtoken) {
792
877
  var promise, response;
793
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
794
- while (1) switch (_context15.prev = _context15.next) {
878
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
879
+ while (1) switch (_context16.prev = _context16.next) {
795
880
  case 0:
796
881
  if (this.appServiceHost) {
797
- _context15.next = 3;
882
+ _context16.next = 3;
798
883
  break;
799
884
  }
800
885
  console.warn('RBTTOK not initialized');
801
- return _context15.abrupt("return", false);
886
+ return _context16.abrupt("return", false);
802
887
  case 3:
803
888
  if (!this.requestCache[authtoken]) {
804
- _context15.next = 5;
889
+ _context16.next = 5;
805
890
  break;
806
891
  }
807
- return _context15.abrupt("return", this.requestCache[authtoken]);
892
+ return _context16.abrupt("return", this.requestCache[authtoken]);
808
893
  case 5:
809
- _context15.prev = 5;
894
+ _context16.prev = 5;
810
895
  //console.log('RBTTOK Req', authtoken);
811
896
  // Create a new promise for the token refresh and store it in the cache
812
897
  promise = this.axios.post('/user_service/refreshAuthToken', [authtoken]);
813
898
  this.requestCache[authtoken] = promise;
814
899
 
815
900
  // Await the promise to get the response
816
- _context15.next = 10;
901
+ _context16.next = 10;
817
902
  return promise;
818
903
  case 10:
819
- response = _context15.sent;
904
+ response = _context16.sent;
820
905
  //console.log('RBTTOK Response ',response);
821
906
  // Once the promise resolves, delete it from the cache to allow future refreshes
822
907
  delete this.requestCache[authtoken];
823
908
 
824
909
  // Return the response data
825
- return _context15.abrupt("return", response.data);
910
+ return _context16.abrupt("return", response.data);
826
911
  case 15:
827
- _context15.prev = 15;
828
- _context15.t0 = _context15["catch"](5);
912
+ _context16.prev = 15;
913
+ _context16.t0 = _context16["catch"](5);
829
914
  // On error, remove the cached promise to allow retries
830
915
  delete this.requestCache[authtoken];
831
- this._handleError(_context15.t0);
916
+ this._handleError(_context16.t0);
832
917
  case 19:
833
918
  case "end":
834
- return _context15.stop();
919
+ return _context16.stop();
835
920
  }
836
- }, _callee15, this, [[5, 15]]);
921
+ }, _callee16, this, [[5, 15]]);
837
922
  }));
838
923
  function refreshAuthToken(_x8) {
839
924
  return _refreshAuthToken.apply(this, arguments);
@@ -866,31 +951,31 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
866
951
  }, {
867
952
  key: "registerUser",
868
953
  value: function () {
869
- var _registerUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
954
+ var _registerUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
870
955
  var dataHash,
871
956
  response,
872
957
  record,
873
- _args16 = arguments;
874
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
875
- while (1) switch (_context16.prev = _context16.next) {
958
+ _args17 = arguments;
959
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
960
+ while (1) switch (_context17.prev = _context17.next) {
876
961
  case 0:
877
- dataHash = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : {};
878
- _context16.prev = 1;
879
- _context16.next = 4;
962
+ dataHash = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
963
+ _context17.prev = 1;
964
+ _context17.next = 4;
880
965
  return this.axios.post('/user_service/registerUser', [dataHash]);
881
966
  case 4:
882
- response = _context16.sent;
967
+ response = _context17.sent;
883
968
  record = response.data;
884
- return _context16.abrupt("return", new _rbt_user["default"](record, this.axios));
969
+ return _context17.abrupt("return", new _rbt_user["default"](record, this.axios));
885
970
  case 9:
886
- _context16.prev = 9;
887
- _context16.t0 = _context16["catch"](1);
888
- return _context16.abrupt("return", this._handleError(_context16.t0));
971
+ _context17.prev = 9;
972
+ _context17.t0 = _context17["catch"](1);
973
+ return _context17.abrupt("return", this._handleError(_context17.t0));
889
974
  case 12:
890
975
  case "end":
891
- return _context16.stop();
976
+ return _context17.stop();
892
977
  }
893
- }, _callee16, this, [[1, 9]]);
978
+ }, _callee17, this, [[1, 9]]);
894
979
  }));
895
980
  function registerUser() {
896
981
  return _registerUser.apply(this, arguments);
@@ -907,30 +992,30 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
907
992
  }, {
908
993
  key: "createFile",
909
994
  value: (function () {
910
- var _createFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(dataHash) {
995
+ var _createFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(dataHash) {
911
996
  var response, record;
912
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
913
- while (1) switch (_context17.prev = _context17.next) {
997
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
998
+ while (1) switch (_context18.prev = _context18.next) {
914
999
  case 0:
915
- _context17.prev = 0;
916
- _context17.next = 3;
1000
+ _context18.prev = 0;
1001
+ _context18.next = 3;
917
1002
  return this.axios.post('/object_service/createObject', ['<@filekit.file>', dataHash]);
918
1003
  case 3:
919
- response = _context17.sent;
1004
+ response = _context18.sent;
920
1005
  record = response.data;
921
1006
  if (dataHash) {
922
1007
  record.data = dataHash;
923
1008
  }
924
- return _context17.abrupt("return", new _rbt_file["default"](record, this.axios, this.localDb));
1009
+ return _context18.abrupt("return", new _rbt_file["default"](record, this.axios, this.localDb));
925
1010
  case 9:
926
- _context17.prev = 9;
927
- _context17.t0 = _context17["catch"](0);
928
- return _context17.abrupt("return", this._handleError(_context17.t0));
1011
+ _context18.prev = 9;
1012
+ _context18.t0 = _context18["catch"](0);
1013
+ return _context18.abrupt("return", this._handleError(_context18.t0));
929
1014
  case 12:
930
1015
  case "end":
931
- return _context17.stop();
1016
+ return _context18.stop();
932
1017
  }
933
- }, _callee17, this, [[0, 9]]);
1018
+ }, _callee18, this, [[0, 9]]);
934
1019
  }));
935
1020
  function createFile(_x9) {
936
1021
  return _createFile.apply(this, arguments);
@@ -940,33 +1025,33 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
940
1025
  }, {
941
1026
  key: "loadFile",
942
1027
  value: function () {
943
- var _loadFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(id) {
1028
+ var _loadFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(id) {
944
1029
  var response, record;
945
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
946
- while (1) switch (_context18.prev = _context18.next) {
1030
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1031
+ while (1) switch (_context19.prev = _context19.next) {
947
1032
  case 0:
948
- _context18.prev = 0;
949
- _context18.next = 3;
1033
+ _context19.prev = 0;
1034
+ _context19.next = 3;
950
1035
  return this.load('<@filekit.file>', id);
951
1036
  case 3:
952
- response = _context18.sent;
1037
+ response = _context19.sent;
953
1038
  if (response) {
954
- _context18.next = 6;
1039
+ _context19.next = 6;
955
1040
  break;
956
1041
  }
957
- return _context18.abrupt("return", null);
1042
+ return _context19.abrupt("return", null);
958
1043
  case 6:
959
1044
  record = response.toRecord();
960
- return _context18.abrupt("return", new _rbt_file["default"](record, this.axios, this.localDb));
1045
+ return _context19.abrupt("return", new _rbt_file["default"](record, this.axios, this.localDb));
961
1046
  case 10:
962
- _context18.prev = 10;
963
- _context18.t0 = _context18["catch"](0);
964
- return _context18.abrupt("return", this._handleError(_context18.t0));
1047
+ _context19.prev = 10;
1048
+ _context19.t0 = _context19["catch"](0);
1049
+ return _context19.abrupt("return", this._handleError(_context19.t0));
965
1050
  case 13:
966
1051
  case "end":
967
- return _context18.stop();
1052
+ return _context19.stop();
968
1053
  }
969
- }, _callee18, this, [[0, 10]]);
1054
+ }, _callee19, this, [[0, 10]]);
970
1055
  }));
971
1056
  function loadFile(_x10) {
972
1057
  return _loadFile.apply(this, arguments);
@@ -976,37 +1061,37 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
976
1061
  }, {
977
1062
  key: "loadFiles",
978
1063
  value: function () {
979
- var _loadFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(ids) {
1064
+ var _loadFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(ids) {
980
1065
  var _this5 = this;
981
1066
  var responses;
982
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
983
- while (1) switch (_context19.prev = _context19.next) {
1067
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
1068
+ while (1) switch (_context20.prev = _context20.next) {
984
1069
  case 0:
985
- _context19.prev = 0;
986
- _context19.next = 3;
1070
+ _context20.prev = 0;
1071
+ _context20.next = 3;
987
1072
  return this.load('<@filekit.file>', ids);
988
1073
  case 3:
989
- responses = _context19.sent;
1074
+ responses = _context20.sent;
990
1075
  if (!(!responses || !Array.isArray(responses))) {
991
- _context19.next = 6;
1076
+ _context20.next = 6;
992
1077
  break;
993
1078
  }
994
- return _context19.abrupt("return", []);
1079
+ return _context20.abrupt("return", []);
995
1080
  case 6:
996
- return _context19.abrupt("return", responses.map(function (response) {
1081
+ return _context20.abrupt("return", responses.map(function (response) {
997
1082
  var record = response.toRecord();
998
1083
  return new _rbt_file["default"](record, _this5.axios, _this5.localDb);
999
1084
  }));
1000
1085
  case 9:
1001
- _context19.prev = 9;
1002
- _context19.t0 = _context19["catch"](0);
1003
- this._handleError(_context19.t0); // Handle errors (log or process as needed)
1004
- return _context19.abrupt("return", []);
1086
+ _context20.prev = 9;
1087
+ _context20.t0 = _context20["catch"](0);
1088
+ this._handleError(_context20.t0); // Handle errors (log or process as needed)
1089
+ return _context20.abrupt("return", []);
1005
1090
  case 13:
1006
1091
  case "end":
1007
- return _context19.stop();
1092
+ return _context20.stop();
1008
1093
  }
1009
- }, _callee19, this, [[0, 9]]);
1094
+ }, _callee20, this, [[0, 9]]);
1010
1095
  }));
1011
1096
  function loadFiles(_x11) {
1012
1097
  return _loadFiles.apply(this, arguments);
@@ -1024,40 +1109,40 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1024
1109
  }, {
1025
1110
  key: "create",
1026
1111
  value: (function () {
1027
- var _create = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(type) {
1112
+ var _create = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(type) {
1028
1113
  var dataHash,
1029
1114
  options,
1030
1115
  response,
1031
1116
  record,
1032
- _args20 = arguments;
1033
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
1034
- while (1) switch (_context20.prev = _context20.next) {
1117
+ _args21 = arguments;
1118
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
1119
+ while (1) switch (_context21.prev = _context21.next) {
1035
1120
  case 0:
1036
- dataHash = _args20.length > 1 && _args20[1] !== undefined ? _args20[1] : {};
1037
- options = _args20.length > 2 && _args20[2] !== undefined ? _args20[2] : {};
1038
- _context20.prev = 2;
1039
- _context20.next = 5;
1121
+ dataHash = _args21.length > 1 && _args21[1] !== undefined ? _args21[1] : {};
1122
+ options = _args21.length > 2 && _args21[2] !== undefined ? _args21[2] : {};
1123
+ _context21.prev = 2;
1124
+ _context21.next = 5;
1040
1125
  return this.axios.post('/object_service/createObject', [type, dataHash]);
1041
1126
  case 5:
1042
- response = _context20.sent;
1127
+ response = _context21.sent;
1043
1128
  record = response.data;
1044
1129
  if (dataHash) {
1045
1130
  record.data = dataHash;
1046
1131
  }
1047
- return _context20.abrupt("return", new _rbt_object["default"](record, this.axios, {
1132
+ return _context21.abrupt("return", new _rbt_object["default"](record, this.axios, {
1048
1133
  isNew: true,
1049
1134
  websocketClient: this.websocketClient,
1050
1135
  enableRealtime: options.enableRealtime || false
1051
1136
  }));
1052
1137
  case 11:
1053
- _context20.prev = 11;
1054
- _context20.t0 = _context20["catch"](2);
1055
- return _context20.abrupt("return", this._handleError(_context20.t0));
1138
+ _context21.prev = 11;
1139
+ _context21.t0 = _context21["catch"](2);
1140
+ return _context21.abrupt("return", this._handleError(_context21.t0));
1056
1141
  case 14:
1057
1142
  case "end":
1058
- return _context20.stop();
1143
+ return _context21.stop();
1059
1144
  }
1060
- }, _callee20, this, [[2, 11]]);
1145
+ }, _callee21, this, [[2, 11]]);
1061
1146
  }));
1062
1147
  function create(_x12) {
1063
1148
  return _create.apply(this, arguments);
@@ -1096,7 +1181,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1096
1181
  }, {
1097
1182
  key: "query",
1098
1183
  value: (function () {
1099
- var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(type) {
1184
+ var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(type) {
1100
1185
  var _this6 = this;
1101
1186
  var params,
1102
1187
  paramsKey,
@@ -1107,12 +1192,12 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1107
1192
  cacheEntry,
1108
1193
  responsePromise,
1109
1194
  processingPromise,
1110
- _args21 = arguments;
1111
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
1112
- while (1) switch (_context21.prev = _context21.next) {
1195
+ _args22 = arguments;
1196
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1197
+ while (1) switch (_context22.prev = _context22.next) {
1113
1198
  case 0:
1114
- params = _args21.length > 1 && _args21[1] !== undefined ? _args21[1] : {};
1115
- _context21.prev = 1;
1199
+ params = _args22.length > 1 && _args22[1] !== undefined ? _args22[1] : {};
1200
+ _context22.prev = 1;
1116
1201
  //console.log('RBTAPI.query INIT', type, params);
1117
1202
  params.type = type;
1118
1203
 
@@ -1134,10 +1219,10 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1134
1219
  paramsKey = JSON.stringify(mergedParams);
1135
1220
  cacheEntry = this.requestCache[paramsKey];
1136
1221
  if (!(cacheEntry && currentTime - cacheEntry.time < 10000)) {
1137
- _context21.next = 11;
1222
+ _context22.next = 11;
1138
1223
  break;
1139
1224
  }
1140
- return _context21.abrupt("return", cacheEntry.val);
1225
+ return _context22.abrupt("return", cacheEntry.val);
1141
1226
  case 11:
1142
1227
  // Create the response promise
1143
1228
  responsePromise = this.axios.post('/object_service/queryObjects', [mergedParams]); // Cache the promise of processing data, not just the raw response
@@ -1154,21 +1239,21 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1154
1239
  };
1155
1240
 
1156
1241
  // Await the processing promise for this call to get processed data
1157
- _context21.next = 16;
1242
+ _context22.next = 16;
1158
1243
  return processingPromise;
1159
1244
  case 16:
1160
- return _context21.abrupt("return", _context21.sent);
1245
+ return _context22.abrupt("return", _context22.sent);
1161
1246
  case 19:
1162
- _context21.prev = 19;
1163
- _context21.t0 = _context21["catch"](1);
1247
+ _context22.prev = 19;
1248
+ _context22.t0 = _context22["catch"](1);
1164
1249
  delete this.requestCache[paramsKey]; // Ensure cache cleanup on error
1165
1250
  //console.log('RBTAPI.query ERROR', paramsKey, e);
1166
- return _context21.abrupt("return", this._handleError(_context21.t0));
1251
+ return _context22.abrupt("return", this._handleError(_context22.t0));
1167
1252
  case 23:
1168
1253
  case "end":
1169
- return _context21.stop();
1254
+ return _context22.stop();
1170
1255
  }
1171
- }, _callee21, this, [[1, 19]]);
1256
+ }, _callee22, this, [[1, 19]]);
1172
1257
  }));
1173
1258
  function query(_x13) {
1174
1259
  return _query.apply(this, arguments);
@@ -1220,28 +1305,28 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1220
1305
  }, {
1221
1306
  key: "load",
1222
1307
  value: (function () {
1223
- var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(type, ids) {
1308
+ var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(type, ids) {
1224
1309
  var _this8 = this;
1225
1310
  var params,
1226
1311
  mergedParams,
1227
1312
  cachedObjects,
1228
1313
  missingIds,
1229
- _iterator2,
1230
- _step2,
1314
+ _iterator3,
1315
+ _step3,
1231
1316
  id,
1232
1317
  _cacheKey,
1233
1318
  cached,
1234
1319
  hitLogKey,
1235
1320
  loadedObjects,
1236
1321
  bulkMissLogKey,
1237
- _iterator3,
1238
- _step3,
1322
+ _iterator4,
1323
+ _step4,
1239
1324
  obj,
1240
1325
  cacheKey,
1241
1326
  setLogKey,
1242
1327
  result,
1243
- _iterator4,
1244
- _step4,
1328
+ _iterator5,
1329
+ _step5,
1245
1330
  _id,
1246
1331
  _cacheKey2,
1247
1332
  _obj,
@@ -1251,26 +1336,26 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1251
1336
  pendingKey,
1252
1337
  missLogKey,
1253
1338
  loadPromise,
1254
- _args23 = arguments;
1255
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1256
- while (1) switch (_context23.prev = _context23.next) {
1339
+ _args24 = arguments;
1340
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1341
+ while (1) switch (_context24.prev = _context24.next) {
1257
1342
  case 0:
1258
- params = _args23.length > 2 && _args23[2] !== undefined ? _args23[2] : {};
1343
+ params = _args24.length > 2 && _args24[2] !== undefined ? _args24[2] : {};
1259
1344
  if (type == '<@iac.user>') {
1260
1345
  debugger;
1261
1346
  }
1262
- _context23.prev = 2;
1347
+ _context24.prev = 2;
1263
1348
  if (!Array.isArray(ids)) {
1264
- _context23.next = 24;
1349
+ _context24.next = 24;
1265
1350
  break;
1266
1351
  }
1267
1352
  // For array requests, check cache for each ID and only load missing ones
1268
1353
  cachedObjects = [];
1269
1354
  missingIds = [];
1270
- _iterator2 = _createForOfIteratorHelper(ids);
1355
+ _iterator3 = _createForOfIteratorHelper(ids);
1271
1356
  try {
1272
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
1273
- id = _step2.value;
1357
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
1358
+ id = _step3.value;
1274
1359
  _cacheKey = "".concat(type, ":").concat(id);
1275
1360
  cached = this._objectCache.get(_cacheKey);
1276
1361
  if (cached) {
@@ -1302,13 +1387,13 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1302
1387
 
1303
1388
  // Load missing objects
1304
1389
  } catch (err) {
1305
- _iterator2.e(err);
1390
+ _iterator3.e(err);
1306
1391
  } finally {
1307
- _iterator2.f();
1392
+ _iterator3.f();
1308
1393
  }
1309
1394
  loadedObjects = [];
1310
1395
  if (!(missingIds.length > 0)) {
1311
- _context23.next = 18;
1396
+ _context24.next = 18;
1312
1397
  break;
1313
1398
  }
1314
1399
  // Only log bulk cache miss once
@@ -1323,15 +1408,15 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1323
1408
  mergedParams = _objectSpread(_objectSpread({}, params), {}, {
1324
1409
  where: "id IN (\"".concat(missingIds.join("\",\""), "\")")
1325
1410
  });
1326
- _context23.next = 15;
1411
+ _context24.next = 15;
1327
1412
  return this.query(type, mergedParams);
1328
1413
  case 15:
1329
- loadedObjects = _context23.sent;
1414
+ loadedObjects = _context24.sent;
1330
1415
  // Cache the newly loaded objects
1331
- _iterator3 = _createForOfIteratorHelper(loadedObjects);
1416
+ _iterator4 = _createForOfIteratorHelper(loadedObjects);
1332
1417
  try {
1333
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
1334
- obj = _step3.value;
1418
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
1419
+ obj = _step4.value;
1335
1420
  cacheKey = "".concat(type, ":").concat(obj.id);
1336
1421
  this._objectCache.set(cacheKey, obj);
1337
1422
 
@@ -1346,17 +1431,17 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1346
1431
  }
1347
1432
  }
1348
1433
  } catch (err) {
1349
- _iterator3.e(err);
1434
+ _iterator4.e(err);
1350
1435
  } finally {
1351
- _iterator3.f();
1436
+ _iterator4.f();
1352
1437
  }
1353
1438
  case 18:
1354
1439
  // Return combined results in original order
1355
1440
  result = [];
1356
- _iterator4 = _createForOfIteratorHelper(ids);
1441
+ _iterator5 = _createForOfIteratorHelper(ids);
1357
1442
  try {
1358
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
1359
- _id = _step4.value;
1443
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
1444
+ _id = _step5.value;
1360
1445
  _cacheKey2 = "".concat(type, ":").concat(_id);
1361
1446
  _obj = this._objectCache.get(_cacheKey2);
1362
1447
  if (_obj) {
@@ -1368,17 +1453,17 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1368
1453
  }
1369
1454
  }
1370
1455
  } catch (err) {
1371
- _iterator4.e(err);
1456
+ _iterator5.e(err);
1372
1457
  } finally {
1373
- _iterator4.f();
1458
+ _iterator5.f();
1374
1459
  }
1375
- return _context23.abrupt("return", result);
1460
+ return _context24.abrupt("return", result);
1376
1461
  case 24:
1377
1462
  // For single object requests, check cache first
1378
1463
  _cacheKey3 = "".concat(type, ":").concat(ids);
1379
1464
  _cached = this._objectCache.get(_cacheKey3);
1380
1465
  if (!_cached) {
1381
- _context23.next = 31;
1466
+ _context24.next = 31;
1382
1467
  break;
1383
1468
  }
1384
1469
  // Only log cache hits once per object to reduce spam
@@ -1400,18 +1485,18 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1400
1485
  });
1401
1486
  _cached._initRealtime();
1402
1487
  }
1403
- return _context23.abrupt("return", _cached);
1488
+ return _context24.abrupt("return", _cached);
1404
1489
  case 31:
1405
1490
  // Check if we're already loading this object
1406
1491
  pendingKey = "".concat(type, ":").concat(ids);
1407
1492
  if (!this._pendingLoads.has(pendingKey)) {
1408
- _context23.next = 36;
1493
+ _context24.next = 36;
1409
1494
  break;
1410
1495
  }
1411
- _context23.next = 35;
1496
+ _context24.next = 35;
1412
1497
  return this._pendingLoads.get(pendingKey);
1413
1498
  case 35:
1414
- return _context23.abrupt("return", _context23.sent);
1499
+ return _context24.abrupt("return", _context24.sent);
1415
1500
  case 36:
1416
1501
  // Only log cache miss once per object to reduce spam
1417
1502
  missLogKey = "miss:".concat(_cacheKey3);
@@ -1424,19 +1509,19 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1424
1509
  }
1425
1510
 
1426
1511
  // Create the loading promise and store it to prevent duplicate requests
1427
- loadPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
1512
+ loadPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
1428
1513
  var res, _obj2, _setLogKey;
1429
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1430
- while (1) switch (_context22.prev = _context22.next) {
1514
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1515
+ while (1) switch (_context23.prev = _context23.next) {
1431
1516
  case 0:
1432
- _context22.prev = 0;
1517
+ _context23.prev = 0;
1433
1518
  mergedParams = _objectSpread(_objectSpread({}, params), {}, {
1434
1519
  where: "id=\"".concat(ids, "\"")
1435
1520
  });
1436
- _context22.next = 4;
1521
+ _context23.next = 4;
1437
1522
  return _this8.query(type, mergedParams);
1438
1523
  case 4:
1439
- res = _context22.sent;
1524
+ res = _context23.sent;
1440
1525
  _obj2 = res[0];
1441
1526
  if (_obj2) {
1442
1527
  // Cache the loaded object
@@ -1452,35 +1537,35 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1452
1537
  _this8._loggedCacheEvents.add(_setLogKey);
1453
1538
  }
1454
1539
  }
1455
- return _context22.abrupt("return", _obj2);
1540
+ return _context23.abrupt("return", _obj2);
1456
1541
  case 8:
1457
- _context22.prev = 8;
1542
+ _context23.prev = 8;
1458
1543
  // Remove from pending loads
1459
1544
  _this8._pendingLoads["delete"](pendingKey);
1460
- return _context22.finish(8);
1545
+ return _context23.finish(8);
1461
1546
  case 11:
1462
1547
  case "end":
1463
- return _context22.stop();
1548
+ return _context23.stop();
1464
1549
  }
1465
- }, _callee22, null, [[0,, 8, 11]]);
1550
+ }, _callee23, null, [[0,, 8, 11]]);
1466
1551
  }))(); // Store the promise so other concurrent requests can await it
1467
1552
  this._pendingLoads.set(pendingKey, loadPromise);
1468
- _context23.next = 42;
1553
+ _context24.next = 42;
1469
1554
  return loadPromise;
1470
1555
  case 42:
1471
- return _context23.abrupt("return", _context23.sent);
1556
+ return _context24.abrupt("return", _context24.sent);
1472
1557
  case 43:
1473
- _context23.next = 48;
1558
+ _context24.next = 48;
1474
1559
  break;
1475
1560
  case 45:
1476
- _context23.prev = 45;
1477
- _context23.t0 = _context23["catch"](2);
1478
- return _context23.abrupt("return", this._handleError(_context23.t0));
1561
+ _context24.prev = 45;
1562
+ _context24.t0 = _context24["catch"](2);
1563
+ return _context24.abrupt("return", this._handleError(_context24.t0));
1479
1564
  case 48:
1480
1565
  case "end":
1481
- return _context23.stop();
1566
+ return _context24.stop();
1482
1567
  }
1483
- }, _callee23, this, [[2, 45]]);
1568
+ }, _callee24, this, [[2, 45]]);
1484
1569
  }));
1485
1570
  function load(_x14, _x15) {
1486
1571
  return _load.apply(this, arguments);
@@ -1515,12 +1600,12 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1515
1600
  } else if (type) {
1516
1601
  // Clear all objects of a specific type
1517
1602
  var removedCount = 0;
1518
- var _iterator5 = _createForOfIteratorHelper(this._objectCache),
1519
- _step5;
1603
+ var _iterator6 = _createForOfIteratorHelper(this._objectCache),
1604
+ _step6;
1520
1605
  try {
1521
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
1522
- var _step5$value = _slicedToArray(_step5.value, 1),
1523
- key = _step5$value[0];
1606
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
1607
+ var _step6$value = _slicedToArray(_step6.value, 1),
1608
+ key = _step6$value[0];
1524
1609
  if (key.startsWith("".concat(type, ":"))) {
1525
1610
  this._objectCache["delete"](key);
1526
1611
  removedCount++;
@@ -1529,23 +1614,23 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1529
1614
 
1530
1615
  // Clear related log tracking for this type
1531
1616
  } catch (err) {
1532
- _iterator5.e(err);
1617
+ _iterator6.e(err);
1533
1618
  } finally {
1534
- _iterator5.f();
1619
+ _iterator6.f();
1535
1620
  }
1536
- var _iterator6 = _createForOfIteratorHelper(this._loggedCacheEvents),
1537
- _step6;
1621
+ var _iterator7 = _createForOfIteratorHelper(this._loggedCacheEvents),
1622
+ _step7;
1538
1623
  try {
1539
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
1540
- var logKey = _step6.value;
1624
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
1625
+ var logKey = _step7.value;
1541
1626
  if (logKey.includes("".concat(type, ":"))) {
1542
1627
  this._loggedCacheEvents["delete"](logKey);
1543
1628
  }
1544
1629
  }
1545
1630
  } catch (err) {
1546
- _iterator6.e(err);
1631
+ _iterator7.e(err);
1547
1632
  } finally {
1548
- _iterator6.f();
1633
+ _iterator7.f();
1549
1634
  }
1550
1635
  console.log('[AgentProviderSync] 🗑️ roboto.clearCache by type:', {
1551
1636
  type: type,
@@ -1612,7 +1697,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1612
1697
  }, {
1613
1698
  key: "runTask",
1614
1699
  value: (function () {
1615
- var _runTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
1700
+ var _runTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
1616
1701
  var params,
1617
1702
  callbacks,
1618
1703
  onProgress,
@@ -1626,20 +1711,20 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1626
1711
  status,
1627
1712
  message,
1628
1713
  output,
1629
- _args24 = arguments;
1630
- return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1631
- while (1) switch (_context24.prev = _context24.next) {
1714
+ _args25 = arguments;
1715
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
1716
+ while (1) switch (_context25.prev = _context25.next) {
1632
1717
  case 0:
1633
- params = _args24.length > 0 && _args24[0] !== undefined ? _args24[0] : {};
1634
- callbacks = _args24.length > 1 && _args24[1] !== undefined ? _args24[1] : {};
1718
+ params = _args25.length > 0 && _args25[0] !== undefined ? _args25[0] : {};
1719
+ callbacks = _args25.length > 1 && _args25[1] !== undefined ? _args25[1] : {};
1635
1720
  onProgress = callbacks.onProgress, onError = callbacks.onError, onStopped = callbacks.onStopped, onWaiting = callbacks.onWaiting, onDone = callbacks.onDone;
1636
- _context24.prev = 3;
1637
- _context24.next = 6;
1721
+ _context25.prev = 3;
1722
+ _context25.next = 6;
1638
1723
  return this.post('/task_service/runChain', params);
1639
1724
  case 6:
1640
- response = _context24.sent;
1725
+ response = _context25.sent;
1641
1726
  if (response) {
1642
- _context24.next = 9;
1727
+ _context25.next = 9;
1643
1728
  break;
1644
1729
  }
1645
1730
  throw new Error('Invalid server response');
@@ -1647,7 +1732,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1647
1732
  // Validate response structure
1648
1733
  ok = response.ok, jobId = response.jobId, status = response.status, message = response.message, output = response.output;
1649
1734
  if (!(!ok || typeof jobId !== 'string' || typeof status !== 'string')) {
1650
- _context24.next = 12;
1735
+ _context25.next = 12;
1651
1736
  break;
1652
1737
  }
1653
1738
  throw new Error('Invalid response structure');
@@ -1673,7 +1758,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1673
1758
  //console.log('Finish (request) ',response);
1674
1759
  onDone(response);
1675
1760
  }
1676
- return _context24.abrupt("return", {
1761
+ return _context25.abrupt("return", {
1677
1762
  ok: ok,
1678
1763
  jobId: jobId,
1679
1764
  status: status,
@@ -1681,24 +1766,24 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1681
1766
  output: output
1682
1767
  });
1683
1768
  case 20:
1684
- _context24.prev = 20;
1685
- _context24.t0 = _context24["catch"](3);
1769
+ _context25.prev = 20;
1770
+ _context25.t0 = _context25["catch"](3);
1686
1771
  if (typeof onError === 'function') {
1687
- onError(_context24.t0);
1772
+ onError(_context25.t0);
1688
1773
  } else {
1689
- console.error('Error in runTask:', _context24.t0);
1774
+ console.error('Error in runTask:', _context25.t0);
1690
1775
  }
1691
- return _context24.abrupt("return", {
1776
+ return _context25.abrupt("return", {
1692
1777
  ok: false,
1693
1778
  jobId: null,
1694
1779
  status: 'ERROR',
1695
- error: _context24.t0.message
1780
+ error: _context25.t0.message
1696
1781
  });
1697
1782
  case 24:
1698
1783
  case "end":
1699
- return _context24.stop();
1784
+ return _context25.stop();
1700
1785
  }
1701
- }, _callee24, this, [[3, 20]]);
1786
+ }, _callee25, this, [[3, 20]]);
1702
1787
  }));
1703
1788
  function runTask() {
1704
1789
  return _runTask.apply(this, arguments);
@@ -1708,37 +1793,37 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1708
1793
  }, {
1709
1794
  key: "stopJob",
1710
1795
  value: function () {
1711
- var _stopJob = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
1796
+ var _stopJob = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
1712
1797
  var params,
1713
1798
  callbacks,
1714
1799
  response,
1715
- _args25 = arguments;
1716
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
1717
- while (1) switch (_context25.prev = _context25.next) {
1800
+ _args26 = arguments;
1801
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
1802
+ while (1) switch (_context26.prev = _context26.next) {
1718
1803
  case 0:
1719
- params = _args25.length > 0 && _args25[0] !== undefined ? _args25[0] : {};
1720
- callbacks = _args25.length > 1 && _args25[1] !== undefined ? _args25[1] : {};
1721
- _context25.prev = 2;
1722
- _context25.next = 5;
1804
+ params = _args26.length > 0 && _args26[0] !== undefined ? _args26[0] : {};
1805
+ callbacks = _args26.length > 1 && _args26[1] !== undefined ? _args26[1] : {};
1806
+ _context26.prev = 2;
1807
+ _context26.next = 5;
1723
1808
  return this.post('/task_service/stopJob', params);
1724
1809
  case 5:
1725
- response = _context25.sent;
1810
+ response = _context26.sent;
1726
1811
  if (response) {
1727
- _context25.next = 8;
1812
+ _context26.next = 8;
1728
1813
  break;
1729
1814
  }
1730
1815
  throw new Error('Invalid server response');
1731
1816
  case 8:
1732
- return _context25.abrupt("return", true);
1817
+ return _context26.abrupt("return", true);
1733
1818
  case 11:
1734
- _context25.prev = 11;
1735
- _context25.t0 = _context25["catch"](2);
1819
+ _context26.prev = 11;
1820
+ _context26.t0 = _context26["catch"](2);
1736
1821
  throw 'Error in stopJob';
1737
1822
  case 14:
1738
1823
  case "end":
1739
- return _context25.stop();
1824
+ return _context26.stop();
1740
1825
  }
1741
- }, _callee25, this, [[2, 11]]);
1826
+ }, _callee26, this, [[2, 11]]);
1742
1827
  }));
1743
1828
  function stopJob() {
1744
1829
  return _stopJob.apply(this, arguments);
@@ -1758,26 +1843,26 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1758
1843
  }, {
1759
1844
  key: "pollTaskProgress",
1760
1845
  value: (function () {
1761
- var _pollTaskProgress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(jobId, callbacks) {
1846
+ var _pollTaskProgress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(jobId, callbacks) {
1762
1847
  var _this9 = this;
1763
1848
  var onProgress, onError, onStopped, onWaiting, onDone, _callbacks$pollingInt, pollingInterval, checkProgress;
1764
- return _regeneratorRuntime().wrap(function _callee27$(_context27) {
1765
- while (1) switch (_context27.prev = _context27.next) {
1849
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
1850
+ while (1) switch (_context28.prev = _context28.next) {
1766
1851
  case 0:
1767
1852
  onProgress = callbacks.onProgress, onError = callbacks.onError, onStopped = callbacks.onStopped, onWaiting = callbacks.onWaiting, onDone = callbacks.onDone, _callbacks$pollingInt = callbacks.pollingInterval, pollingInterval = _callbacks$pollingInt === void 0 ? 2000 : _callbacks$pollingInt;
1768
- _context27.prev = 1;
1853
+ _context28.prev = 1;
1769
1854
  checkProgress = /*#__PURE__*/function () {
1770
- var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
1855
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
1771
1856
  var response;
1772
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
1773
- while (1) switch (_context26.prev = _context26.next) {
1857
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
1858
+ while (1) switch (_context27.prev = _context27.next) {
1774
1859
  case 0:
1775
- _context26.next = 2;
1860
+ _context27.next = 2;
1776
1861
  return _this9.get("/task_service/pollChainProgress", {
1777
1862
  jobId: jobId
1778
1863
  });
1779
1864
  case 2:
1780
- response = _context26.sent;
1865
+ response = _context27.sent;
1781
1866
  // If the task is still in progress, start polling for updates
1782
1867
  if (response.status === 'DONE' && onDone) {
1783
1868
  // Provide the current progress to the callback function
@@ -1808,26 +1893,26 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1808
1893
  }
1809
1894
  case 9:
1810
1895
  case "end":
1811
- return _context26.stop();
1896
+ return _context27.stop();
1812
1897
  }
1813
- }, _callee26);
1898
+ }, _callee27);
1814
1899
  }));
1815
1900
  return function checkProgress() {
1816
1901
  return _ref8.apply(this, arguments);
1817
1902
  };
1818
1903
  }();
1819
1904
  checkProgress();
1820
- _context27.next = 9;
1905
+ _context28.next = 9;
1821
1906
  break;
1822
1907
  case 6:
1823
- _context27.prev = 6;
1824
- _context27.t0 = _context27["catch"](1);
1825
- return _context27.abrupt("return", this._handleError(_context27.t0));
1908
+ _context28.prev = 6;
1909
+ _context28.t0 = _context28["catch"](1);
1910
+ return _context28.abrupt("return", this._handleError(_context28.t0));
1826
1911
  case 9:
1827
1912
  case "end":
1828
- return _context27.stop();
1913
+ return _context28.stop();
1829
1914
  }
1830
- }, _callee27, this, [[1, 6]]);
1915
+ }, _callee28, this, [[1, 6]]);
1831
1916
  }));
1832
1917
  function pollTaskProgress(_x16, _x17) {
1833
1918
  return _pollTaskProgress.apply(this, arguments);
@@ -1849,43 +1934,43 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1849
1934
  }, {
1850
1935
  key: "get",
1851
1936
  value: (function () {
1852
- var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(endpoint) {
1937
+ var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(endpoint) {
1853
1938
  var params,
1854
1939
  headers,
1855
1940
  response,
1856
- _args28 = arguments;
1857
- return _regeneratorRuntime().wrap(function _callee28$(_context28) {
1858
- while (1) switch (_context28.prev = _context28.next) {
1941
+ _args29 = arguments;
1942
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
1943
+ while (1) switch (_context29.prev = _context29.next) {
1859
1944
  case 0:
1860
- params = _args28.length > 1 && _args28[1] !== undefined ? _args28[1] : {};
1861
- _context28.prev = 1;
1945
+ params = _args29.length > 1 && _args29[1] !== undefined ? _args29[1] : {};
1946
+ _context29.prev = 1;
1862
1947
  // Add the authToken to the headers
1863
1948
  headers = {
1864
1949
  authtoken: this.authtoken
1865
1950
  }; // Make the GET request using Axios
1866
- _context28.next = 5;
1951
+ _context29.next = 5;
1867
1952
  return this.axios.get(endpoint, {
1868
1953
  params: params,
1869
1954
  headers: headers
1870
1955
  });
1871
1956
  case 5:
1872
- response = _context28.sent;
1957
+ response = _context29.sent;
1873
1958
  if (!(response.data.ok === false)) {
1874
- _context28.next = 8;
1959
+ _context29.next = 8;
1875
1960
  break;
1876
1961
  }
1877
- return _context28.abrupt("return", this._handleError(response));
1962
+ return _context29.abrupt("return", this._handleError(response));
1878
1963
  case 8:
1879
- return _context28.abrupt("return", response.data);
1964
+ return _context29.abrupt("return", response.data);
1880
1965
  case 11:
1881
- _context28.prev = 11;
1882
- _context28.t0 = _context28["catch"](1);
1883
- return _context28.abrupt("return", this._handleError(_context28.t0));
1966
+ _context29.prev = 11;
1967
+ _context29.t0 = _context29["catch"](1);
1968
+ return _context29.abrupt("return", this._handleError(_context29.t0));
1884
1969
  case 14:
1885
1970
  case "end":
1886
- return _context28.stop();
1971
+ return _context29.stop();
1887
1972
  }
1888
- }, _callee28, this, [[1, 11]]);
1973
+ }, _callee29, this, [[1, 11]]);
1889
1974
  }));
1890
1975
  function get(_x18) {
1891
1976
  return _get.apply(this, arguments);
@@ -1908,42 +1993,42 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1908
1993
  }, {
1909
1994
  key: "post",
1910
1995
  value: (function () {
1911
- var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(endpoint) {
1996
+ var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(endpoint) {
1912
1997
  var data,
1913
1998
  headers,
1914
1999
  response,
1915
- _args29 = arguments;
1916
- return _regeneratorRuntime().wrap(function _callee29$(_context29) {
1917
- while (1) switch (_context29.prev = _context29.next) {
2000
+ _args30 = arguments;
2001
+ return _regeneratorRuntime().wrap(function _callee30$(_context30) {
2002
+ while (1) switch (_context30.prev = _context30.next) {
1918
2003
  case 0:
1919
- data = _args29.length > 1 && _args29[1] !== undefined ? _args29[1] : {};
1920
- _context29.prev = 1;
2004
+ data = _args30.length > 1 && _args30[1] !== undefined ? _args30[1] : {};
2005
+ _context30.prev = 1;
1921
2006
  // Add the authToken to the headers
1922
2007
  headers = {
1923
2008
  authtoken: this.authtoken
1924
2009
  }; // Make the POST request using Axios
1925
- _context29.next = 5;
2010
+ _context30.next = 5;
1926
2011
  return this.axios.post(endpoint, data, {
1927
2012
  headers: headers
1928
2013
  });
1929
2014
  case 5:
1930
- response = _context29.sent;
2015
+ response = _context30.sent;
1931
2016
  if (!(response.data.ok === false)) {
1932
- _context29.next = 8;
2017
+ _context30.next = 8;
1933
2018
  break;
1934
2019
  }
1935
- return _context29.abrupt("return", this._handleError(response));
2020
+ return _context30.abrupt("return", this._handleError(response));
1936
2021
  case 8:
1937
- return _context29.abrupt("return", response.data);
2022
+ return _context30.abrupt("return", response.data);
1938
2023
  case 11:
1939
- _context29.prev = 11;
1940
- _context29.t0 = _context29["catch"](1);
1941
- return _context29.abrupt("return", this._handleError(_context29.t0));
2024
+ _context30.prev = 11;
2025
+ _context30.t0 = _context30["catch"](1);
2026
+ return _context30.abrupt("return", this._handleError(_context30.t0));
1942
2027
  case 14:
1943
2028
  case "end":
1944
- return _context29.stop();
2029
+ return _context30.stop();
1945
2030
  }
1946
- }, _callee29, this, [[1, 11]]);
2031
+ }, _callee30, this, [[1, 11]]);
1947
2032
  }));
1948
2033
  function post(_x19) {
1949
2034
  return _post.apply(this, arguments);