roboto-js 1.9.7 → 1.9.9

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.
@@ -1033,14 +1033,129 @@ var RbtApi = /*#__PURE__*/function () {
1033
1033
  value: function getCurrentOrganization() {
1034
1034
  return this.currentOrganization;
1035
1035
  }
1036
+
1037
+ /**
1038
+ * Select and link an organization to the current user
1039
+ * This adds the organization to the user's organizations array (if not already there)
1040
+ * and sets it as the current organization preference
1041
+ *
1042
+ * @param {string} orgId - Organization ID to select
1043
+ * @param {string} role - Role for the user in this organization (default: 'owner')
1044
+ * @returns {Promise<RbtObject>} The selected organization
1045
+ */
1046
+ }, {
1047
+ key: "selectCurrentOrganization",
1048
+ value: (function () {
1049
+ var _selectCurrentOrganization = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(orgId) {
1050
+ var role,
1051
+ org,
1052
+ user,
1053
+ userOrgs,
1054
+ orgExists,
1055
+ modData,
1056
+ _args17 = arguments;
1057
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1058
+ while (1) switch (_context17.prev = _context17.next) {
1059
+ case 0:
1060
+ role = _args17.length > 1 && _args17[1] !== undefined ? _args17[1] : 'owner';
1061
+ _context17.prev = 1;
1062
+ if (this.currentUser) {
1063
+ _context17.next = 7;
1064
+ break;
1065
+ }
1066
+ _context17.next = 5;
1067
+ return this.loadCurrentUser();
1068
+ case 5:
1069
+ if (this.currentUser) {
1070
+ _context17.next = 7;
1071
+ break;
1072
+ }
1073
+ throw new Error('Must be logged in to select organization');
1074
+ case 7:
1075
+ _context17.next = 9;
1076
+ return this.get('<@iac.organization>', orgId);
1077
+ case 9:
1078
+ org = _context17.sent;
1079
+ if (org) {
1080
+ _context17.next = 12;
1081
+ break;
1082
+ }
1083
+ throw new Error("Organization ".concat(orgId, " not found or not accessible"));
1084
+ case 12:
1085
+ _context17.next = 14;
1086
+ return this.loadUser(this.currentUser.id);
1087
+ case 14:
1088
+ user = _context17.sent;
1089
+ if (user) {
1090
+ _context17.next = 17;
1091
+ break;
1092
+ }
1093
+ throw new Error('Failed to load user object');
1094
+ case 17:
1095
+ // Update user's organizations array
1096
+ userOrgs = user.get('organizations') || [];
1097
+ orgExists = userOrgs.some(function (o) {
1098
+ return (o === null || o === void 0 ? void 0 : o.id) === orgId;
1099
+ });
1100
+ if (!orgExists) {
1101
+ userOrgs.unshift({
1102
+ id: orgId,
1103
+ roles: [role]
1104
+ });
1105
+ user.set('organizations', userOrgs);
1106
+ } else {}
1107
+
1108
+ // Set as current organization preference - handle both nested path formats
1109
+ modData = user.get('mod') || {};
1110
+ modData.currentOrgId = orgId;
1111
+ user.set('mod', modData);
1112
+
1113
+ // Save user record
1114
+ _context17.next = 25;
1115
+ return user.save();
1116
+ case 25:
1117
+ // Clear cached organization to force reload
1118
+ this.currentOrganization = null;
1119
+
1120
+ // Update the current user reference
1121
+ this.currentUser = user;
1122
+
1123
+ // Set the new current organization
1124
+ this.currentOrganization = org;
1125
+
1126
+ // Update cache
1127
+ if (!this.localStorageAdaptor) {
1128
+ _context17.next = 31;
1129
+ break;
1130
+ }
1131
+ _context17.next = 31;
1132
+ return this.localStorageAdaptor.setItem('currentOrgId', orgId);
1133
+ case 31:
1134
+ return _context17.abrupt("return", org);
1135
+ case 34:
1136
+ _context17.prev = 34;
1137
+ _context17.t0 = _context17["catch"](1);
1138
+ console.error('[RbtApi] Error in selectCurrentOrganization:', _context17.t0);
1139
+ return _context17.abrupt("return", this._handleError(_context17.t0));
1140
+ case 38:
1141
+ case "end":
1142
+ return _context17.stop();
1143
+ }
1144
+ }, _callee17, this, [[1, 34]]);
1145
+ }));
1146
+ function selectCurrentOrganization(_x8) {
1147
+ return _selectCurrentOrganization.apply(this, arguments);
1148
+ }
1149
+ return selectCurrentOrganization;
1150
+ }())
1036
1151
  }, {
1037
1152
  key: "loadUser",
1038
1153
  value: function () {
1039
- var _loadUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(userId) {
1154
+ var _loadUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(userId) {
1040
1155
  var _this5 = this;
1041
1156
  var params, cacheKey, now, existing, p;
1042
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1043
- while (1) switch (_context18.prev = _context18.next) {
1157
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1158
+ while (1) switch (_context19.prev = _context19.next) {
1044
1159
  case 0:
1045
1160
  params = {
1046
1161
  id: userId
@@ -1049,53 +1164,53 @@ var RbtApi = /*#__PURE__*/function () {
1049
1164
  now = Date.now();
1050
1165
  existing = this.requestCache[cacheKey];
1051
1166
  if (!(existing && now - existing.time < 10000)) {
1052
- _context18.next = 6;
1167
+ _context19.next = 6;
1053
1168
  break;
1054
1169
  }
1055
- return _context18.abrupt("return", existing.val);
1170
+ return _context19.abrupt("return", existing.val);
1056
1171
  case 6:
1057
- _context18.prev = 6;
1058
- p = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
1172
+ _context19.prev = 6;
1173
+ p = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
1059
1174
  var _response$data;
1060
1175
  var response, userData, User;
1061
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1062
- while (1) switch (_context17.prev = _context17.next) {
1176
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1177
+ while (1) switch (_context18.prev = _context18.next) {
1063
1178
  case 0:
1064
- _context17.next = 2;
1179
+ _context18.next = 2;
1065
1180
  return _this5.axios.post('/user_service/loadUser', [params]);
1066
1181
  case 2:
1067
- response = _context17.sent;
1182
+ response = _context18.sent;
1068
1183
  userData = response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.user;
1069
1184
  User = new RbtUser({
1070
1185
  id: userData.id
1071
1186
  }, _this5.axios);
1072
1187
  User.setData(userData);
1073
- return _context17.abrupt("return", User);
1188
+ return _context18.abrupt("return", User);
1074
1189
  case 7:
1075
1190
  case "end":
1076
- return _context17.stop();
1191
+ return _context18.stop();
1077
1192
  }
1078
- }, _callee17);
1193
+ }, _callee18);
1079
1194
  }))();
1080
1195
  this.requestCache[cacheKey] = {
1081
1196
  val: p,
1082
1197
  time: now
1083
1198
  };
1084
- _context18.next = 11;
1199
+ _context19.next = 11;
1085
1200
  return p;
1086
1201
  case 11:
1087
- return _context18.abrupt("return", _context18.sent);
1202
+ return _context19.abrupt("return", _context19.sent);
1088
1203
  case 14:
1089
- _context18.prev = 14;
1090
- _context18.t0 = _context18["catch"](6);
1091
- return _context18.abrupt("return", this._handleError(_context18.t0));
1204
+ _context19.prev = 14;
1205
+ _context19.t0 = _context19["catch"](6);
1206
+ return _context19.abrupt("return", this._handleError(_context19.t0));
1092
1207
  case 17:
1093
1208
  case "end":
1094
- return _context18.stop();
1209
+ return _context19.stop();
1095
1210
  }
1096
- }, _callee18, this, [[6, 14]]);
1211
+ }, _callee19, this, [[6, 14]]);
1097
1212
  }));
1098
- function loadUser(_x8) {
1213
+ function loadUser(_x9) {
1099
1214
  return _loadUser.apply(this, arguments);
1100
1215
  }
1101
1216
  return loadUser;
@@ -1103,53 +1218,53 @@ var RbtApi = /*#__PURE__*/function () {
1103
1218
  }, {
1104
1219
  key: "refreshAuthToken",
1105
1220
  value: function () {
1106
- var _refreshAuthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(authtoken) {
1221
+ var _refreshAuthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(authtoken) {
1107
1222
  var promise, response;
1108
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1109
- while (1) switch (_context19.prev = _context19.next) {
1223
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
1224
+ while (1) switch (_context20.prev = _context20.next) {
1110
1225
  case 0:
1111
1226
  if (this.appServiceHost) {
1112
- _context19.next = 2;
1227
+ _context20.next = 2;
1113
1228
  break;
1114
1229
  }
1115
- return _context19.abrupt("return", false);
1230
+ return _context20.abrupt("return", false);
1116
1231
  case 2:
1117
1232
  if (!this.requestCache[authtoken]) {
1118
- _context19.next = 4;
1233
+ _context20.next = 4;
1119
1234
  break;
1120
1235
  }
1121
- return _context19.abrupt("return", this.requestCache[authtoken]);
1236
+ return _context20.abrupt("return", this.requestCache[authtoken]);
1122
1237
  case 4:
1123
- _context19.prev = 4;
1238
+ _context20.prev = 4;
1124
1239
  //console.log('RBTTOK Req', authtoken);
1125
1240
  // Create a new promise for the token refresh and store it in the cache
1126
1241
  promise = this.axios.post('/user_service/refreshAuthToken', [authtoken]);
1127
1242
  this.requestCache[authtoken] = promise;
1128
1243
 
1129
1244
  // Await the promise to get the response
1130
- _context19.next = 9;
1245
+ _context20.next = 9;
1131
1246
  return promise;
1132
1247
  case 9:
1133
- response = _context19.sent;
1248
+ response = _context20.sent;
1134
1249
  //console.log('RBTTOK Response ',response);
1135
1250
  // Once the promise resolves, delete it from the cache to allow future refreshes
1136
1251
  delete this.requestCache[authtoken];
1137
1252
 
1138
1253
  // Return the response data
1139
- return _context19.abrupt("return", response.data);
1254
+ return _context20.abrupt("return", response.data);
1140
1255
  case 14:
1141
- _context19.prev = 14;
1142
- _context19.t0 = _context19["catch"](4);
1256
+ _context20.prev = 14;
1257
+ _context20.t0 = _context20["catch"](4);
1143
1258
  // On error, remove the cached promise to allow retries
1144
1259
  delete this.requestCache[authtoken];
1145
- this._handleError(_context19.t0);
1260
+ this._handleError(_context20.t0);
1146
1261
  case 18:
1147
1262
  case "end":
1148
- return _context19.stop();
1263
+ return _context20.stop();
1149
1264
  }
1150
- }, _callee19, this, [[4, 14]]);
1265
+ }, _callee20, this, [[4, 14]]);
1151
1266
  }));
1152
- function refreshAuthToken(_x9) {
1267
+ function refreshAuthToken(_x10) {
1153
1268
  return _refreshAuthToken.apply(this, arguments);
1154
1269
  }
1155
1270
  return refreshAuthToken;
@@ -1180,31 +1295,31 @@ var RbtApi = /*#__PURE__*/function () {
1180
1295
  }, {
1181
1296
  key: "registerUser",
1182
1297
  value: function () {
1183
- var _registerUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
1298
+ var _registerUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
1184
1299
  var dataHash,
1185
1300
  response,
1186
1301
  record,
1187
- _args20 = arguments;
1188
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
1189
- while (1) switch (_context20.prev = _context20.next) {
1302
+ _args21 = arguments;
1303
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
1304
+ while (1) switch (_context21.prev = _context21.next) {
1190
1305
  case 0:
1191
- dataHash = _args20.length > 0 && _args20[0] !== undefined ? _args20[0] : {};
1192
- _context20.prev = 1;
1193
- _context20.next = 4;
1306
+ dataHash = _args21.length > 0 && _args21[0] !== undefined ? _args21[0] : {};
1307
+ _context21.prev = 1;
1308
+ _context21.next = 4;
1194
1309
  return this.axios.post('/user_service/registerUser', [dataHash]);
1195
1310
  case 4:
1196
- response = _context20.sent;
1311
+ response = _context21.sent;
1197
1312
  record = response.data;
1198
- return _context20.abrupt("return", new RbtUser(record, this.axios));
1313
+ return _context21.abrupt("return", new RbtUser(record, this.axios));
1199
1314
  case 9:
1200
- _context20.prev = 9;
1201
- _context20.t0 = _context20["catch"](1);
1202
- return _context20.abrupt("return", this._handleError(_context20.t0));
1315
+ _context21.prev = 9;
1316
+ _context21.t0 = _context21["catch"](1);
1317
+ return _context21.abrupt("return", this._handleError(_context21.t0));
1203
1318
  case 12:
1204
1319
  case "end":
1205
- return _context20.stop();
1320
+ return _context21.stop();
1206
1321
  }
1207
- }, _callee20, this, [[1, 9]]);
1322
+ }, _callee21, this, [[1, 9]]);
1208
1323
  }));
1209
1324
  function registerUser() {
1210
1325
  return _registerUser.apply(this, arguments);
@@ -1221,32 +1336,32 @@ var RbtApi = /*#__PURE__*/function () {
1221
1336
  }, {
1222
1337
  key: "createFile",
1223
1338
  value: (function () {
1224
- var _createFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(dataHash) {
1339
+ var _createFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(dataHash) {
1225
1340
  var response, record;
1226
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
1227
- while (1) switch (_context21.prev = _context21.next) {
1341
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1342
+ while (1) switch (_context22.prev = _context22.next) {
1228
1343
  case 0:
1229
- _context21.prev = 0;
1230
- _context21.next = 3;
1344
+ _context22.prev = 0;
1345
+ _context22.next = 3;
1231
1346
  return this.axios.post('/object_service/createObject', ['<@filekit.file>', dataHash]);
1232
1347
  case 3:
1233
- response = _context21.sent;
1348
+ response = _context22.sent;
1234
1349
  record = response.data;
1235
1350
  if (dataHash) {
1236
1351
  record.data = dataHash;
1237
1352
  }
1238
- return _context21.abrupt("return", new RbtFile(record, this.axios, this.localDb));
1353
+ return _context22.abrupt("return", new RbtFile(record, this.axios, this.localDb));
1239
1354
  case 9:
1240
- _context21.prev = 9;
1241
- _context21.t0 = _context21["catch"](0);
1242
- return _context21.abrupt("return", this._handleError(_context21.t0));
1355
+ _context22.prev = 9;
1356
+ _context22.t0 = _context22["catch"](0);
1357
+ return _context22.abrupt("return", this._handleError(_context22.t0));
1243
1358
  case 12:
1244
1359
  case "end":
1245
- return _context21.stop();
1360
+ return _context22.stop();
1246
1361
  }
1247
- }, _callee21, this, [[0, 9]]);
1362
+ }, _callee22, this, [[0, 9]]);
1248
1363
  }));
1249
- function createFile(_x10) {
1364
+ function createFile(_x11) {
1250
1365
  return _createFile.apply(this, arguments);
1251
1366
  }
1252
1367
  return createFile;
@@ -1254,35 +1369,35 @@ var RbtApi = /*#__PURE__*/function () {
1254
1369
  }, {
1255
1370
  key: "loadFile",
1256
1371
  value: function () {
1257
- var _loadFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(id) {
1372
+ var _loadFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(id) {
1258
1373
  var response, record;
1259
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1260
- while (1) switch (_context22.prev = _context22.next) {
1374
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1375
+ while (1) switch (_context23.prev = _context23.next) {
1261
1376
  case 0:
1262
- _context22.prev = 0;
1263
- _context22.next = 3;
1377
+ _context23.prev = 0;
1378
+ _context23.next = 3;
1264
1379
  return this.load('<@filekit.file>', id);
1265
1380
  case 3:
1266
- response = _context22.sent;
1381
+ response = _context23.sent;
1267
1382
  if (response) {
1268
- _context22.next = 6;
1383
+ _context23.next = 6;
1269
1384
  break;
1270
1385
  }
1271
- return _context22.abrupt("return", null);
1386
+ return _context23.abrupt("return", null);
1272
1387
  case 6:
1273
1388
  record = response.toRecord();
1274
- return _context22.abrupt("return", new RbtFile(record, this.axios, this.localDb));
1389
+ return _context23.abrupt("return", new RbtFile(record, this.axios, this.localDb));
1275
1390
  case 10:
1276
- _context22.prev = 10;
1277
- _context22.t0 = _context22["catch"](0);
1278
- return _context22.abrupt("return", this._handleError(_context22.t0));
1391
+ _context23.prev = 10;
1392
+ _context23.t0 = _context23["catch"](0);
1393
+ return _context23.abrupt("return", this._handleError(_context23.t0));
1279
1394
  case 13:
1280
1395
  case "end":
1281
- return _context22.stop();
1396
+ return _context23.stop();
1282
1397
  }
1283
- }, _callee22, this, [[0, 10]]);
1398
+ }, _callee23, this, [[0, 10]]);
1284
1399
  }));
1285
- function loadFile(_x11) {
1400
+ function loadFile(_x12) {
1286
1401
  return _loadFile.apply(this, arguments);
1287
1402
  }
1288
1403
  return loadFile;
@@ -1290,39 +1405,39 @@ var RbtApi = /*#__PURE__*/function () {
1290
1405
  }, {
1291
1406
  key: "loadFiles",
1292
1407
  value: function () {
1293
- var _loadFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(ids) {
1408
+ var _loadFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(ids) {
1294
1409
  var _this6 = this;
1295
1410
  var responses;
1296
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1297
- while (1) switch (_context23.prev = _context23.next) {
1411
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1412
+ while (1) switch (_context24.prev = _context24.next) {
1298
1413
  case 0:
1299
- _context23.prev = 0;
1300
- _context23.next = 3;
1414
+ _context24.prev = 0;
1415
+ _context24.next = 3;
1301
1416
  return this.load('<@filekit.file>', ids);
1302
1417
  case 3:
1303
- responses = _context23.sent;
1418
+ responses = _context24.sent;
1304
1419
  if (!(!responses || !Array.isArray(responses))) {
1305
- _context23.next = 6;
1420
+ _context24.next = 6;
1306
1421
  break;
1307
1422
  }
1308
- return _context23.abrupt("return", []);
1423
+ return _context24.abrupt("return", []);
1309
1424
  case 6:
1310
- return _context23.abrupt("return", responses.map(function (response) {
1425
+ return _context24.abrupt("return", responses.map(function (response) {
1311
1426
  var record = response.toRecord();
1312
1427
  return new RbtFile(record, _this6.axios, _this6.localDb);
1313
1428
  }));
1314
1429
  case 9:
1315
- _context23.prev = 9;
1316
- _context23.t0 = _context23["catch"](0);
1317
- this._handleError(_context23.t0); // Handle errors (log or process as needed)
1318
- return _context23.abrupt("return", []);
1430
+ _context24.prev = 9;
1431
+ _context24.t0 = _context24["catch"](0);
1432
+ this._handleError(_context24.t0); // Handle errors (log or process as needed)
1433
+ return _context24.abrupt("return", []);
1319
1434
  case 13:
1320
1435
  case "end":
1321
- return _context23.stop();
1436
+ return _context24.stop();
1322
1437
  }
1323
- }, _callee23, this, [[0, 9]]);
1438
+ }, _callee24, this, [[0, 9]]);
1324
1439
  }));
1325
- function loadFiles(_x12) {
1440
+ function loadFiles(_x13) {
1326
1441
  return _loadFiles.apply(this, arguments);
1327
1442
  }
1328
1443
  return loadFiles;
@@ -1338,42 +1453,42 @@ var RbtApi = /*#__PURE__*/function () {
1338
1453
  }, {
1339
1454
  key: "create",
1340
1455
  value: (function () {
1341
- var _create = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(type) {
1456
+ var _create = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(type) {
1342
1457
  var dataHash,
1343
1458
  options,
1344
1459
  response,
1345
1460
  record,
1346
- _args24 = arguments;
1347
- return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1348
- while (1) switch (_context24.prev = _context24.next) {
1461
+ _args25 = arguments;
1462
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
1463
+ while (1) switch (_context25.prev = _context25.next) {
1349
1464
  case 0:
1350
- dataHash = _args24.length > 1 && _args24[1] !== undefined ? _args24[1] : {};
1351
- options = _args24.length > 2 && _args24[2] !== undefined ? _args24[2] : {};
1352
- _context24.prev = 2;
1353
- _context24.next = 5;
1465
+ dataHash = _args25.length > 1 && _args25[1] !== undefined ? _args25[1] : {};
1466
+ options = _args25.length > 2 && _args25[2] !== undefined ? _args25[2] : {};
1467
+ _context25.prev = 2;
1468
+ _context25.next = 5;
1354
1469
  return this.axios.post('/object_service/createObject', [type, dataHash]);
1355
1470
  case 5:
1356
- response = _context24.sent;
1471
+ response = _context25.sent;
1357
1472
  record = response.data;
1358
1473
  if (dataHash) {
1359
1474
  record.data = dataHash;
1360
1475
  }
1361
- return _context24.abrupt("return", new RbtObject(record, this.axios, {
1476
+ return _context25.abrupt("return", new RbtObject(record, this.axios, {
1362
1477
  isNew: true,
1363
1478
  websocketClient: this.websocketClient,
1364
1479
  enableRealtime: options.enableRealtime || false
1365
1480
  }));
1366
1481
  case 11:
1367
- _context24.prev = 11;
1368
- _context24.t0 = _context24["catch"](2);
1369
- return _context24.abrupt("return", this._handleError(_context24.t0));
1482
+ _context25.prev = 11;
1483
+ _context25.t0 = _context25["catch"](2);
1484
+ return _context25.abrupt("return", this._handleError(_context25.t0));
1370
1485
  case 14:
1371
1486
  case "end":
1372
- return _context24.stop();
1487
+ return _context25.stop();
1373
1488
  }
1374
- }, _callee24, this, [[2, 11]]);
1489
+ }, _callee25, this, [[2, 11]]);
1375
1490
  }));
1376
- function create(_x13) {
1491
+ function create(_x14) {
1377
1492
  return _create.apply(this, arguments);
1378
1493
  }
1379
1494
  return create;
@@ -1416,7 +1531,7 @@ var RbtApi = /*#__PURE__*/function () {
1416
1531
  }, {
1417
1532
  key: "query",
1418
1533
  value: (function () {
1419
- var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(type) {
1534
+ var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(type) {
1420
1535
  var _this7 = this;
1421
1536
  var params,
1422
1537
  paramsKey,
@@ -1429,12 +1544,12 @@ var RbtApi = /*#__PURE__*/function () {
1429
1544
  cacheEntry,
1430
1545
  responsePromise,
1431
1546
  processingPromise,
1432
- _args25 = arguments;
1433
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
1434
- while (1) switch (_context25.prev = _context25.next) {
1547
+ _args26 = arguments;
1548
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
1549
+ while (1) switch (_context26.prev = _context26.next) {
1435
1550
  case 0:
1436
- params = _args25.length > 1 && _args25[1] !== undefined ? _args25[1] : {};
1437
- _context25.prev = 1;
1551
+ params = _args26.length > 1 && _args26[1] !== undefined ? _args26[1] : {};
1552
+ _context26.prev = 1;
1438
1553
  //console.log('RBTAPI.query INIT', type, params);
1439
1554
  // Validate parameters - reject invalid parameter names
1440
1555
  validParams = ['type', 'where', 'orderBy', 'limit', 'resolveReferences', 'requestAttrs', 'excludeAttrs', 'timeout', 'enableRealtime'];
@@ -1442,7 +1557,7 @@ var RbtApi = /*#__PURE__*/function () {
1442
1557
  return !validParams.includes(key);
1443
1558
  });
1444
1559
  if (!(invalidParams.length > 0)) {
1445
- _context25.next = 6;
1560
+ _context26.next = 6;
1446
1561
  break;
1447
1562
  }
1448
1563
  throw new Error("Invalid query parameter(s): ".concat(invalidParams.join(', '), ". Valid parameters are: ").concat(validParams.join(', ')));
@@ -1469,10 +1584,10 @@ var RbtApi = /*#__PURE__*/function () {
1469
1584
  paramsKey = JSON.stringify(mergedParams);
1470
1585
  cacheEntry = this.requestCache[paramsKey];
1471
1586
  if (!(cacheEntry && currentTime - cacheEntry.time < 10000)) {
1472
- _context25.next = 16;
1587
+ _context26.next = 16;
1473
1588
  break;
1474
1589
  }
1475
- return _context25.abrupt("return", cacheEntry.val);
1590
+ return _context26.abrupt("return", cacheEntry.val);
1476
1591
  case 16:
1477
1592
  // Create the response promise
1478
1593
  responsePromise = this.axios.post('/object_service/queryObjects', [mergedParams]); // Cache the promise of processing data, not just the raw response
@@ -1489,23 +1604,23 @@ var RbtApi = /*#__PURE__*/function () {
1489
1604
  };
1490
1605
 
1491
1606
  // Await the processing promise for this call to get processed data
1492
- _context25.next = 21;
1607
+ _context26.next = 21;
1493
1608
  return processingPromise;
1494
1609
  case 21:
1495
- return _context25.abrupt("return", _context25.sent);
1610
+ return _context26.abrupt("return", _context26.sent);
1496
1611
  case 24:
1497
- _context25.prev = 24;
1498
- _context25.t0 = _context25["catch"](1);
1612
+ _context26.prev = 24;
1613
+ _context26.t0 = _context26["catch"](1);
1499
1614
  delete this.requestCache[paramsKey]; // Ensure cache cleanup on error
1500
1615
  //console.log('RBTAPI.query ERROR', paramsKey, e);
1501
- return _context25.abrupt("return", this._handleError(_context25.t0));
1616
+ return _context26.abrupt("return", this._handleError(_context26.t0));
1502
1617
  case 28:
1503
1618
  case "end":
1504
- return _context25.stop();
1619
+ return _context26.stop();
1505
1620
  }
1506
- }, _callee25, this, [[1, 24]]);
1621
+ }, _callee26, this, [[1, 24]]);
1507
1622
  }));
1508
- function query(_x14) {
1623
+ function query(_x15) {
1509
1624
  return _query.apply(this, arguments);
1510
1625
  }
1511
1626
  return query;
@@ -1549,7 +1664,7 @@ var RbtApi = /*#__PURE__*/function () {
1549
1664
  }, {
1550
1665
  key: "load",
1551
1666
  value: (function () {
1552
- var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(type, ids) {
1667
+ var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(type, ids) {
1553
1668
  var _this9 = this;
1554
1669
  var params,
1555
1670
  mergedParams,
@@ -1582,17 +1697,17 @@ var RbtApi = /*#__PURE__*/function () {
1582
1697
  pendingKey,
1583
1698
  missLogKey,
1584
1699
  loadPromise,
1585
- _args27 = arguments;
1586
- return _regeneratorRuntime().wrap(function _callee27$(_context27) {
1587
- while (1) switch (_context27.prev = _context27.next) {
1700
+ _args28 = arguments;
1701
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
1702
+ while (1) switch (_context28.prev = _context28.next) {
1588
1703
  case 0:
1589
- params = _args27.length > 2 && _args27[2] !== undefined ? _args27[2] : {};
1704
+ params = _args28.length > 2 && _args28[2] !== undefined ? _args28[2] : {};
1590
1705
  if (type == '<@iac.user>') {
1591
1706
  debugger;
1592
1707
  }
1593
- _context27.prev = 2;
1708
+ _context28.prev = 2;
1594
1709
  if (!Array.isArray(ids)) {
1595
- _context27.next = 25;
1710
+ _context28.next = 25;
1596
1711
  break;
1597
1712
  }
1598
1713
  // For array requests, check cache for each ID and only load missing ones
@@ -1629,7 +1744,7 @@ var RbtApi = /*#__PURE__*/function () {
1629
1744
  }
1630
1745
  loadedObjects = [];
1631
1746
  if (!(missingIds.length > 0)) {
1632
- _context27.next = 19;
1747
+ _context28.next = 19;
1633
1748
  break;
1634
1749
  }
1635
1750
  // Only log bulk cache miss once
@@ -1643,10 +1758,10 @@ var RbtApi = /*#__PURE__*/function () {
1643
1758
  mergedParams = _objectSpread(_objectSpread({}, queryParams), {}, {
1644
1759
  where: "id IN (\"".concat(missingIds.join("\",\""), "\")")
1645
1760
  });
1646
- _context27.next = 16;
1761
+ _context28.next = 16;
1647
1762
  return this.query(type, mergedParams);
1648
1763
  case 16:
1649
- loadedObjects = _context27.sent;
1764
+ loadedObjects = _context28.sent;
1650
1765
  // Cache the newly loaded objects
1651
1766
  _iterator4 = _createForOfIteratorHelper(loadedObjects);
1652
1767
  try {
@@ -1688,13 +1803,13 @@ var RbtApi = /*#__PURE__*/function () {
1688
1803
  } finally {
1689
1804
  _iterator5.f();
1690
1805
  }
1691
- return _context27.abrupt("return", result);
1806
+ return _context28.abrupt("return", result);
1692
1807
  case 25:
1693
1808
  // For single object requests, check cache first
1694
1809
  _cacheKey3 = "".concat(type, ":").concat(ids);
1695
1810
  _cached = this._objectCache.get(_cacheKey3);
1696
1811
  if (!_cached) {
1697
- _context27.next = 32;
1812
+ _context28.next = 32;
1698
1813
  break;
1699
1814
  }
1700
1815
  // Only log cache hits once per object to reduce spam
@@ -1707,18 +1822,18 @@ var RbtApi = /*#__PURE__*/function () {
1707
1822
  if (params.enableRealtime && !_cached._realtime) {
1708
1823
  _cached._initRealtime();
1709
1824
  }
1710
- return _context27.abrupt("return", _cached);
1825
+ return _context28.abrupt("return", _cached);
1711
1826
  case 32:
1712
1827
  // Check if we're already loading this object
1713
1828
  pendingKey = "".concat(type, ":").concat(ids);
1714
1829
  if (!this._pendingLoads.has(pendingKey)) {
1715
- _context27.next = 37;
1830
+ _context28.next = 37;
1716
1831
  break;
1717
1832
  }
1718
- _context27.next = 36;
1833
+ _context28.next = 36;
1719
1834
  return this._pendingLoads.get(pendingKey);
1720
1835
  case 36:
1721
- return _context27.abrupt("return", _context27.sent);
1836
+ return _context28.abrupt("return", _context28.sent);
1722
1837
  case 37:
1723
1838
  // Only log cache miss once per object to reduce spam
1724
1839
  missLogKey = "miss:".concat(_cacheKey3);
@@ -1727,21 +1842,21 @@ var RbtApi = /*#__PURE__*/function () {
1727
1842
  }
1728
1843
 
1729
1844
  // Create the loading promise and store it to prevent duplicate requests
1730
- loadPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
1845
+ loadPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
1731
1846
  var _enableRealtime, _queryParams, res, _obj2, _setLogKey;
1732
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
1733
- while (1) switch (_context26.prev = _context26.next) {
1847
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
1848
+ while (1) switch (_context27.prev = _context27.next) {
1734
1849
  case 0:
1735
- _context26.prev = 0;
1850
+ _context27.prev = 0;
1736
1851
  // Remove load-specific params that shouldn't be passed to query
1737
1852
  _enableRealtime = params.enableRealtime, _queryParams = _objectWithoutProperties(params, _excluded2);
1738
1853
  mergedParams = _objectSpread(_objectSpread({}, _queryParams), {}, {
1739
1854
  where: "id=\"".concat(ids, "\"")
1740
1855
  });
1741
- _context26.next = 5;
1856
+ _context27.next = 5;
1742
1857
  return _this9.query(type, mergedParams);
1743
1858
  case 5:
1744
- res = _context26.sent;
1859
+ res = _context27.sent;
1745
1860
  _obj2 = res[0];
1746
1861
  if (_obj2) {
1747
1862
  // Cache the loaded object
@@ -1753,37 +1868,37 @@ var RbtApi = /*#__PURE__*/function () {
1753
1868
  _this9._loggedCacheEvents.add(_setLogKey);
1754
1869
  }
1755
1870
  }
1756
- return _context26.abrupt("return", _obj2);
1871
+ return _context27.abrupt("return", _obj2);
1757
1872
  case 9:
1758
- _context26.prev = 9;
1873
+ _context27.prev = 9;
1759
1874
  // Remove from pending loads
1760
1875
  _this9._pendingLoads["delete"](pendingKey);
1761
- return _context26.finish(9);
1876
+ return _context27.finish(9);
1762
1877
  case 12:
1763
1878
  case "end":
1764
- return _context26.stop();
1879
+ return _context27.stop();
1765
1880
  }
1766
- }, _callee26, null, [[0,, 9, 12]]);
1881
+ }, _callee27, null, [[0,, 9, 12]]);
1767
1882
  }))(); // Store the promise so other concurrent requests can await it
1768
1883
  this._pendingLoads.set(pendingKey, loadPromise);
1769
- _context27.next = 43;
1884
+ _context28.next = 43;
1770
1885
  return loadPromise;
1771
1886
  case 43:
1772
- return _context27.abrupt("return", _context27.sent);
1887
+ return _context28.abrupt("return", _context28.sent);
1773
1888
  case 44:
1774
- _context27.next = 49;
1889
+ _context28.next = 49;
1775
1890
  break;
1776
1891
  case 46:
1777
- _context27.prev = 46;
1778
- _context27.t0 = _context27["catch"](2);
1779
- return _context27.abrupt("return", this._handleError(_context27.t0));
1892
+ _context28.prev = 46;
1893
+ _context28.t0 = _context28["catch"](2);
1894
+ return _context28.abrupt("return", this._handleError(_context28.t0));
1780
1895
  case 49:
1781
1896
  case "end":
1782
- return _context27.stop();
1897
+ return _context28.stop();
1783
1898
  }
1784
- }, _callee27, this, [[2, 46]]);
1899
+ }, _callee28, this, [[2, 46]]);
1785
1900
  }));
1786
- function load(_x15, _x16) {
1901
+ function load(_x16, _x17) {
1787
1902
  return _load.apply(this, arguments);
1788
1903
  }
1789
1904
  return load;
@@ -1901,7 +2016,7 @@ var RbtApi = /*#__PURE__*/function () {
1901
2016
  }, {
1902
2017
  key: "runTask",
1903
2018
  value: (function () {
1904
- var _runTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
2019
+ var _runTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
1905
2020
  var params,
1906
2021
  callbacks,
1907
2022
  onProgress,
@@ -1916,20 +2031,20 @@ var RbtApi = /*#__PURE__*/function () {
1916
2031
  message,
1917
2032
  output,
1918
2033
  errorResponse,
1919
- _args28 = arguments;
1920
- return _regeneratorRuntime().wrap(function _callee28$(_context28) {
1921
- while (1) switch (_context28.prev = _context28.next) {
2034
+ _args29 = arguments;
2035
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
2036
+ while (1) switch (_context29.prev = _context29.next) {
1922
2037
  case 0:
1923
- params = _args28.length > 0 && _args28[0] !== undefined ? _args28[0] : {};
1924
- callbacks = _args28.length > 1 && _args28[1] !== undefined ? _args28[1] : {};
2038
+ params = _args29.length > 0 && _args29[0] !== undefined ? _args29[0] : {};
2039
+ callbacks = _args29.length > 1 && _args29[1] !== undefined ? _args29[1] : {};
1925
2040
  onProgress = callbacks.onProgress, onError = callbacks.onError, onStopped = callbacks.onStopped, onWaiting = callbacks.onWaiting, onDone = callbacks.onDone;
1926
- _context28.prev = 3;
1927
- _context28.next = 6;
2041
+ _context29.prev = 3;
2042
+ _context29.next = 6;
1928
2043
  return this.post('/task_service/runChain', params);
1929
2044
  case 6:
1930
- response = _context28.sent;
2045
+ response = _context29.sent;
1931
2046
  if (response) {
1932
- _context28.next = 9;
2047
+ _context29.next = 9;
1933
2048
  break;
1934
2049
  }
1935
2050
  throw new Error('Invalid server response');
@@ -1937,7 +2052,7 @@ var RbtApi = /*#__PURE__*/function () {
1937
2052
  // Validate response structure
1938
2053
  ok = response.ok, jobId = response.jobId, status = response.status, message = response.message, output = response.output;
1939
2054
  if (!(!ok || typeof jobId !== 'string' || typeof status !== 'string')) {
1940
- _context28.next = 12;
2055
+ _context29.next = 12;
1941
2056
  break;
1942
2057
  }
1943
2058
  throw new Error('Invalid response structure');
@@ -1963,7 +2078,7 @@ var RbtApi = /*#__PURE__*/function () {
1963
2078
  //console.log('Finish (request) ',response); s
1964
2079
  onDone(response);
1965
2080
  }
1966
- return _context28.abrupt("return", {
2081
+ return _context29.abrupt("return", {
1967
2082
  ok: ok,
1968
2083
  jobId: jobId,
1969
2084
  status: status,
@@ -1971,21 +2086,21 @@ var RbtApi = /*#__PURE__*/function () {
1971
2086
  output: output
1972
2087
  });
1973
2088
  case 20:
1974
- _context28.prev = 20;
1975
- _context28.t0 = _context28["catch"](3);
2089
+ _context29.prev = 20;
2090
+ _context29.t0 = _context29["catch"](3);
1976
2091
  // Standardize error format to match task response object
1977
2092
  // Support RbtError format with label and message
1978
2093
  errorResponse = {
1979
2094
  ok: false,
1980
2095
  jobId: null,
1981
2096
  status: 'ERROR',
1982
- message: _context28.t0.message || _context28.t0.toString() || 'Unknown error',
1983
- label: _context28.t0.label || _context28.t0.name || 'Error',
2097
+ message: _context29.t0.message || _context29.t0.toString() || 'Unknown error',
2098
+ label: _context29.t0.label || _context29.t0.name || 'Error',
1984
2099
  output: {
1985
- error: _context28.t0.message,
1986
- label: _context28.t0.label,
1987
- stack: _context28.t0.stack,
1988
- originalError: _context28.t0
2100
+ error: _context29.t0.message,
2101
+ label: _context29.t0.label,
2102
+ stack: _context29.t0.stack,
2103
+ originalError: _context29.t0
1989
2104
  }
1990
2105
  };
1991
2106
  if (typeof onError === 'function') {
@@ -1993,12 +2108,12 @@ var RbtApi = /*#__PURE__*/function () {
1993
2108
  } else {
1994
2109
  console.error('Error in runTask:', errorResponse.message);
1995
2110
  }
1996
- return _context28.abrupt("return", errorResponse);
2111
+ return _context29.abrupt("return", errorResponse);
1997
2112
  case 25:
1998
2113
  case "end":
1999
- return _context28.stop();
2114
+ return _context29.stop();
2000
2115
  }
2001
- }, _callee28, this, [[3, 20]]);
2116
+ }, _callee29, this, [[3, 20]]);
2002
2117
  }));
2003
2118
  function runTask() {
2004
2119
  return _runTask.apply(this, arguments);
@@ -2008,37 +2123,37 @@ var RbtApi = /*#__PURE__*/function () {
2008
2123
  }, {
2009
2124
  key: "stopJob",
2010
2125
  value: function () {
2011
- var _stopJob = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
2126
+ var _stopJob = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
2012
2127
  var params,
2013
2128
  callbacks,
2014
2129
  response,
2015
- _args29 = arguments;
2016
- return _regeneratorRuntime().wrap(function _callee29$(_context29) {
2017
- while (1) switch (_context29.prev = _context29.next) {
2130
+ _args30 = arguments;
2131
+ return _regeneratorRuntime().wrap(function _callee30$(_context30) {
2132
+ while (1) switch (_context30.prev = _context30.next) {
2018
2133
  case 0:
2019
- params = _args29.length > 0 && _args29[0] !== undefined ? _args29[0] : {};
2020
- callbacks = _args29.length > 1 && _args29[1] !== undefined ? _args29[1] : {};
2021
- _context29.prev = 2;
2022
- _context29.next = 5;
2134
+ params = _args30.length > 0 && _args30[0] !== undefined ? _args30[0] : {};
2135
+ callbacks = _args30.length > 1 && _args30[1] !== undefined ? _args30[1] : {};
2136
+ _context30.prev = 2;
2137
+ _context30.next = 5;
2023
2138
  return this.post('/task_service/stopJob', params);
2024
2139
  case 5:
2025
- response = _context29.sent;
2140
+ response = _context30.sent;
2026
2141
  if (response) {
2027
- _context29.next = 8;
2142
+ _context30.next = 8;
2028
2143
  break;
2029
2144
  }
2030
2145
  throw new Error('Invalid server response');
2031
2146
  case 8:
2032
- return _context29.abrupt("return", true);
2147
+ return _context30.abrupt("return", true);
2033
2148
  case 11:
2034
- _context29.prev = 11;
2035
- _context29.t0 = _context29["catch"](2);
2149
+ _context30.prev = 11;
2150
+ _context30.t0 = _context30["catch"](2);
2036
2151
  throw 'Error in stopJob';
2037
2152
  case 14:
2038
2153
  case "end":
2039
- return _context29.stop();
2154
+ return _context30.stop();
2040
2155
  }
2041
- }, _callee29, this, [[2, 11]]);
2156
+ }, _callee30, this, [[2, 11]]);
2042
2157
  }));
2043
2158
  function stopJob() {
2044
2159
  return _stopJob.apply(this, arguments);
@@ -2086,26 +2201,26 @@ var RbtApi = /*#__PURE__*/function () {
2086
2201
  }, {
2087
2202
  key: "pollTaskProgress",
2088
2203
  value: (function () {
2089
- var _pollTaskProgress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(jobId, callbacks) {
2204
+ var _pollTaskProgress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(jobId, callbacks) {
2090
2205
  var _this10 = this;
2091
2206
  var onProgress, onError, onStopped, onWaiting, onDone, _callbacks$pollingInt, pollingInterval, checkProgress;
2092
- return _regeneratorRuntime().wrap(function _callee31$(_context31) {
2093
- while (1) switch (_context31.prev = _context31.next) {
2207
+ return _regeneratorRuntime().wrap(function _callee32$(_context32) {
2208
+ while (1) switch (_context32.prev = _context32.next) {
2094
2209
  case 0:
2095
2210
  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;
2096
- _context31.prev = 1;
2211
+ _context32.prev = 1;
2097
2212
  checkProgress = /*#__PURE__*/function () {
2098
- var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
2213
+ var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
2099
2214
  var response;
2100
- return _regeneratorRuntime().wrap(function _callee30$(_context30) {
2101
- while (1) switch (_context30.prev = _context30.next) {
2215
+ return _regeneratorRuntime().wrap(function _callee31$(_context31) {
2216
+ while (1) switch (_context31.prev = _context31.next) {
2102
2217
  case 0:
2103
- _context30.next = 2;
2218
+ _context31.next = 2;
2104
2219
  return _this10.get("/task_service/pollChainProgress", {
2105
2220
  jobId: jobId
2106
2221
  });
2107
2222
  case 2:
2108
- response = _context30.sent;
2223
+ response = _context31.sent;
2109
2224
  // If the task is still in progress, start polling for updates
2110
2225
  if (response.status === 'DONE' && onDone) {
2111
2226
  // Provide the current progress to the callback function
@@ -2136,28 +2251,28 @@ var RbtApi = /*#__PURE__*/function () {
2136
2251
  }
2137
2252
  case 9:
2138
2253
  case "end":
2139
- return _context30.stop();
2254
+ return _context31.stop();
2140
2255
  }
2141
- }, _callee30);
2256
+ }, _callee31);
2142
2257
  }));
2143
2258
  return function checkProgress() {
2144
2259
  return _ref9.apply(this, arguments);
2145
2260
  };
2146
2261
  }();
2147
2262
  checkProgress();
2148
- _context31.next = 9;
2263
+ _context32.next = 9;
2149
2264
  break;
2150
2265
  case 6:
2151
- _context31.prev = 6;
2152
- _context31.t0 = _context31["catch"](1);
2153
- return _context31.abrupt("return", this._handleError(_context31.t0));
2266
+ _context32.prev = 6;
2267
+ _context32.t0 = _context32["catch"](1);
2268
+ return _context32.abrupt("return", this._handleError(_context32.t0));
2154
2269
  case 9:
2155
2270
  case "end":
2156
- return _context31.stop();
2271
+ return _context32.stop();
2157
2272
  }
2158
- }, _callee31, this, [[1, 6]]);
2273
+ }, _callee32, this, [[1, 6]]);
2159
2274
  }));
2160
- function pollTaskProgress(_x17, _x18) {
2275
+ function pollTaskProgress(_x18, _x19) {
2161
2276
  return _pollTaskProgress.apply(this, arguments);
2162
2277
  }
2163
2278
  return pollTaskProgress;
@@ -2178,18 +2293,18 @@ var RbtApi = /*#__PURE__*/function () {
2178
2293
  }, {
2179
2294
  key: "get",
2180
2295
  value: (function () {
2181
- var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(endpoint) {
2296
+ var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(endpoint) {
2182
2297
  var params,
2183
2298
  customHeaders,
2184
2299
  config,
2185
2300
  response,
2186
- _args32 = arguments;
2187
- return _regeneratorRuntime().wrap(function _callee32$(_context32) {
2188
- while (1) switch (_context32.prev = _context32.next) {
2301
+ _args33 = arguments;
2302
+ return _regeneratorRuntime().wrap(function _callee33$(_context33) {
2303
+ while (1) switch (_context33.prev = _context33.next) {
2189
2304
  case 0:
2190
- params = _args32.length > 1 && _args32[1] !== undefined ? _args32[1] : {};
2191
- customHeaders = _args32.length > 2 && _args32[2] !== undefined ? _args32[2] : null;
2192
- _context32.prev = 2;
2305
+ params = _args33.length > 1 && _args33[1] !== undefined ? _args33[1] : {};
2306
+ customHeaders = _args33.length > 2 && _args33[2] !== undefined ? _args33[2] : null;
2307
+ _context33.prev = 2;
2193
2308
  // Build request config
2194
2309
  config = {
2195
2310
  params: params
@@ -2204,28 +2319,28 @@ var RbtApi = /*#__PURE__*/function () {
2204
2319
  // Otherwise, don't set config.headers at all - let axios use its defaults
2205
2320
 
2206
2321
  // Make the GET request using Axios
2207
- _context32.next = 7;
2322
+ _context33.next = 7;
2208
2323
  return this.axios.get(endpoint, config);
2209
2324
  case 7:
2210
- response = _context32.sent;
2325
+ response = _context33.sent;
2211
2326
  if (!(response.data.ok === false)) {
2212
- _context32.next = 10;
2327
+ _context33.next = 10;
2213
2328
  break;
2214
2329
  }
2215
- return _context32.abrupt("return", this._handleError(response));
2330
+ return _context33.abrupt("return", this._handleError(response));
2216
2331
  case 10:
2217
- return _context32.abrupt("return", response.data);
2332
+ return _context33.abrupt("return", response.data);
2218
2333
  case 13:
2219
- _context32.prev = 13;
2220
- _context32.t0 = _context32["catch"](2);
2221
- return _context32.abrupt("return", this._handleError(_context32.t0));
2334
+ _context33.prev = 13;
2335
+ _context33.t0 = _context33["catch"](2);
2336
+ return _context33.abrupt("return", this._handleError(_context33.t0));
2222
2337
  case 16:
2223
2338
  case "end":
2224
- return _context32.stop();
2339
+ return _context33.stop();
2225
2340
  }
2226
- }, _callee32, this, [[2, 13]]);
2341
+ }, _callee33, this, [[2, 13]]);
2227
2342
  }));
2228
- function get(_x19) {
2343
+ function get(_x20) {
2229
2344
  return _get.apply(this, arguments);
2230
2345
  }
2231
2346
  return get;
@@ -2246,44 +2361,44 @@ var RbtApi = /*#__PURE__*/function () {
2246
2361
  }, {
2247
2362
  key: "post",
2248
2363
  value: (function () {
2249
- var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(endpoint) {
2364
+ var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(endpoint) {
2250
2365
  var data,
2251
2366
  headers,
2252
2367
  response,
2253
- _args33 = arguments;
2254
- return _regeneratorRuntime().wrap(function _callee33$(_context33) {
2255
- while (1) switch (_context33.prev = _context33.next) {
2368
+ _args34 = arguments;
2369
+ return _regeneratorRuntime().wrap(function _callee34$(_context34) {
2370
+ while (1) switch (_context34.prev = _context34.next) {
2256
2371
  case 0:
2257
- data = _args33.length > 1 && _args33[1] !== undefined ? _args33[1] : {};
2258
- _context33.prev = 1;
2372
+ data = _args34.length > 1 && _args34[1] !== undefined ? _args34[1] : {};
2373
+ _context34.prev = 1;
2259
2374
  // Add the authToken to the headers
2260
2375
  headers = {
2261
2376
  authtoken: this.authtoken
2262
2377
  }; // Make the POST request using Axios
2263
- _context33.next = 5;
2378
+ _context34.next = 5;
2264
2379
  return this.axios.post(endpoint, data, {
2265
2380
  headers: headers
2266
2381
  });
2267
2382
  case 5:
2268
- response = _context33.sent;
2383
+ response = _context34.sent;
2269
2384
  if (!(response.data.ok === false)) {
2270
- _context33.next = 8;
2385
+ _context34.next = 8;
2271
2386
  break;
2272
2387
  }
2273
- return _context33.abrupt("return", this._handleError(response));
2388
+ return _context34.abrupt("return", this._handleError(response));
2274
2389
  case 8:
2275
- return _context33.abrupt("return", response.data);
2390
+ return _context34.abrupt("return", response.data);
2276
2391
  case 11:
2277
- _context33.prev = 11;
2278
- _context33.t0 = _context33["catch"](1);
2279
- return _context33.abrupt("return", this._handleError(_context33.t0));
2392
+ _context34.prev = 11;
2393
+ _context34.t0 = _context34["catch"](1);
2394
+ return _context34.abrupt("return", this._handleError(_context34.t0));
2280
2395
  case 14:
2281
2396
  case "end":
2282
- return _context33.stop();
2397
+ return _context34.stop();
2283
2398
  }
2284
- }, _callee33, this, [[1, 11]]);
2399
+ }, _callee34, this, [[1, 11]]);
2285
2400
  }));
2286
- function post(_x20) {
2401
+ function post(_x21) {
2287
2402
  return _post.apply(this, arguments);
2288
2403
  }
2289
2404
  return post;