roboto-js 1.1.6 → 1.1.7

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.
@@ -214,38 +214,72 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
214
214
  return loadCurrentUser;
215
215
  }()
216
216
  }, {
217
- key: "loadUser",
217
+ key: "confirmUserEmail",
218
218
  value: function () {
219
- var _loadUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(userId) {
220
- var params, _response$data2, response, userData, User;
219
+ var _confirmUserEmail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(confirmCode) {
220
+ var params, response;
221
221
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
222
222
  while (1) switch (_context5.prev = _context5.next) {
223
+ case 0:
224
+ debugger;
225
+ params = {
226
+ emailConfirmCode: confirmCode
227
+ };
228
+ _context5.prev = 2;
229
+ _context5.next = 5;
230
+ return this.axios.post('/user_service/confirmUserEmail', [params]);
231
+ case 5:
232
+ response = _context5.sent;
233
+ debugger;
234
+ return _context5.abrupt("return", response);
235
+ case 10:
236
+ _context5.prev = 10;
237
+ _context5.t0 = _context5["catch"](2);
238
+ return _context5.abrupt("return", this._handleError(_context5.t0));
239
+ case 13:
240
+ case "end":
241
+ return _context5.stop();
242
+ }
243
+ }, _callee5, this, [[2, 10]]);
244
+ }));
245
+ function confirmUserEmail(_x2) {
246
+ return _confirmUserEmail.apply(this, arguments);
247
+ }
248
+ return confirmUserEmail;
249
+ }()
250
+ }, {
251
+ key: "loadUser",
252
+ value: function () {
253
+ var _loadUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(userId) {
254
+ var params, _response$data2, response, userData, User;
255
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
256
+ while (1) switch (_context6.prev = _context6.next) {
223
257
  case 0:
224
258
  params = {
225
259
  id: userId
226
260
  };
227
- _context5.prev = 1;
228
- _context5.next = 4;
261
+ _context6.prev = 1;
262
+ _context6.next = 4;
229
263
  return this.axios.post('/user_service/loadUser', [params]);
230
264
  case 4:
231
- response = _context5.sent;
265
+ response = _context6.sent;
232
266
  userData = response === null || response === void 0 || (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.user;
233
267
  User = new _rbt_user["default"]({
234
268
  id: userData.id
235
269
  }, this.axios);
236
270
  User.setData(userData);
237
- return _context5.abrupt("return", User);
271
+ return _context6.abrupt("return", User);
238
272
  case 11:
239
- _context5.prev = 11;
240
- _context5.t0 = _context5["catch"](1);
241
- return _context5.abrupt("return", this._handleError(_context5.t0));
273
+ _context6.prev = 11;
274
+ _context6.t0 = _context6["catch"](1);
275
+ return _context6.abrupt("return", this._handleError(_context6.t0));
242
276
  case 14:
243
277
  case "end":
244
- return _context5.stop();
278
+ return _context6.stop();
245
279
  }
246
- }, _callee5, this, [[1, 11]]);
280
+ }, _callee6, this, [[1, 11]]);
247
281
  }));
248
- function loadUser(_x2) {
282
+ function loadUser(_x3) {
249
283
  return _loadUser.apply(this, arguments);
250
284
  }
251
285
  return loadUser;
@@ -253,28 +287,28 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
253
287
  }, {
254
288
  key: "refreshAuthToken",
255
289
  value: function () {
256
- var _refreshAuthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(authtoken) {
290
+ var _refreshAuthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(authtoken) {
257
291
  var response;
258
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
259
- while (1) switch (_context6.prev = _context6.next) {
292
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
293
+ while (1) switch (_context7.prev = _context7.next) {
260
294
  case 0:
261
- _context6.prev = 0;
262
- _context6.next = 3;
295
+ _context7.prev = 0;
296
+ _context7.next = 3;
263
297
  return this.axios.post('/user_service/refreshAuthToken', [authtoken]);
264
298
  case 3:
265
- response = _context6.sent;
266
- return _context6.abrupt("return", response.data);
299
+ response = _context7.sent;
300
+ return _context7.abrupt("return", response.data);
267
301
  case 7:
268
- _context6.prev = 7;
269
- _context6.t0 = _context6["catch"](0);
270
- this._handleError(_context6.t0);
302
+ _context7.prev = 7;
303
+ _context7.t0 = _context7["catch"](0);
304
+ this._handleError(_context7.t0);
271
305
  case 10:
272
306
  case "end":
273
- return _context6.stop();
307
+ return _context7.stop();
274
308
  }
275
- }, _callee6, this, [[0, 7]]);
309
+ }, _callee7, this, [[0, 7]]);
276
310
  }));
277
- function refreshAuthToken(_x3) {
311
+ function refreshAuthToken(_x4) {
278
312
  return _refreshAuthToken.apply(this, arguments);
279
313
  }
280
314
  return refreshAuthToken;
@@ -289,35 +323,33 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
289
323
  }, {
290
324
  key: "registerUser",
291
325
  value: function () {
292
- var _registerUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
326
+ var _registerUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
293
327
  var dataHash,
294
328
  response,
295
329
  record,
296
- _args7 = arguments;
297
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
298
- while (1) switch (_context7.prev = _context7.next) {
330
+ _args8 = arguments;
331
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
332
+ while (1) switch (_context8.prev = _context8.next) {
299
333
  case 0:
300
- dataHash = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
301
- _context7.prev = 1;
302
- _context7.next = 4;
334
+ dataHash = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
335
+ _context8.prev = 1;
336
+ _context8.next = 4;
303
337
  return this.axios.post('/user_service/registerUser', [dataHash]);
304
338
  case 4:
305
- response = _context7.sent;
339
+ response = _context8.sent;
340
+ debugger;
306
341
  record = response.data;
307
- if (dataHash) {
308
- record.data = dataHash;
309
- }
310
- return _context7.abrupt("return", new _rbt_user["default"](record, this.axios));
342
+ return _context8.abrupt("return", new _rbt_user["default"](record, this.axios));
311
343
  case 10:
312
- _context7.prev = 10;
313
- _context7.t0 = _context7["catch"](1);
344
+ _context8.prev = 10;
345
+ _context8.t0 = _context8["catch"](1);
314
346
  debugger;
315
- return _context7.abrupt("return", this._handleError(_context7.t0));
347
+ return _context8.abrupt("return", this._handleError(_context8.t0));
316
348
  case 14:
317
349
  case "end":
318
- return _context7.stop();
350
+ return _context8.stop();
319
351
  }
320
- }, _callee7, this, [[1, 10]]);
352
+ }, _callee8, this, [[1, 10]]);
321
353
  }));
322
354
  function registerUser() {
323
355
  return _registerUser.apply(this, arguments);
@@ -334,32 +366,32 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
334
366
  }, {
335
367
  key: "createFile",
336
368
  value: function () {
337
- var _createFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(dataHash) {
369
+ var _createFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(dataHash) {
338
370
  var response, record;
339
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
340
- while (1) switch (_context8.prev = _context8.next) {
371
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
372
+ while (1) switch (_context9.prev = _context9.next) {
341
373
  case 0:
342
- _context8.prev = 0;
343
- _context8.next = 3;
374
+ _context9.prev = 0;
375
+ _context9.next = 3;
344
376
  return this.axios.post('/object_service/createObject', ['<@filekit.file>', dataHash]);
345
377
  case 3:
346
- response = _context8.sent;
378
+ response = _context9.sent;
347
379
  record = response.data;
348
380
  if (dataHash) {
349
381
  record.data = dataHash;
350
382
  }
351
- return _context8.abrupt("return", new _rbt_file["default"](record, this.axios, this.localDb));
383
+ return _context9.abrupt("return", new _rbt_file["default"](record, this.axios, this.localDb));
352
384
  case 9:
353
- _context8.prev = 9;
354
- _context8.t0 = _context8["catch"](0);
355
- return _context8.abrupt("return", this._handleError(_context8.t0));
385
+ _context9.prev = 9;
386
+ _context9.t0 = _context9["catch"](0);
387
+ return _context9.abrupt("return", this._handleError(_context9.t0));
356
388
  case 12:
357
389
  case "end":
358
- return _context8.stop();
390
+ return _context9.stop();
359
391
  }
360
- }, _callee8, this, [[0, 9]]);
392
+ }, _callee9, this, [[0, 9]]);
361
393
  }));
362
- function createFile(_x4) {
394
+ function createFile(_x5) {
363
395
  return _createFile.apply(this, arguments);
364
396
  }
365
397
  return createFile;
@@ -374,38 +406,38 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
374
406
  }, {
375
407
  key: "create",
376
408
  value: function () {
377
- var _create = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(type) {
409
+ var _create = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(type) {
378
410
  var dataHash,
379
411
  response,
380
412
  record,
381
- _args9 = arguments;
382
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
383
- while (1) switch (_context9.prev = _context9.next) {
413
+ _args10 = arguments;
414
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
415
+ while (1) switch (_context10.prev = _context10.next) {
384
416
  case 0:
385
- dataHash = _args9.length > 1 && _args9[1] !== undefined ? _args9[1] : {};
386
- _context9.prev = 1;
387
- _context9.next = 4;
417
+ dataHash = _args10.length > 1 && _args10[1] !== undefined ? _args10[1] : {};
418
+ _context10.prev = 1;
419
+ _context10.next = 4;
388
420
  return this.axios.post('/object_service/createObject', [type, dataHash]);
389
421
  case 4:
390
- response = _context9.sent;
422
+ response = _context10.sent;
391
423
  record = response.data;
392
424
  if (dataHash) {
393
425
  record.data = dataHash;
394
426
  }
395
- return _context9.abrupt("return", new _rbt_object["default"](record, this.axios, {
427
+ return _context10.abrupt("return", new _rbt_object["default"](record, this.axios, {
396
428
  isNew: true
397
429
  }));
398
430
  case 10:
399
- _context9.prev = 10;
400
- _context9.t0 = _context9["catch"](1);
401
- return _context9.abrupt("return", this._handleError(_context9.t0));
431
+ _context10.prev = 10;
432
+ _context10.t0 = _context10["catch"](1);
433
+ return _context10.abrupt("return", this._handleError(_context10.t0));
402
434
  case 13:
403
435
  case "end":
404
- return _context9.stop();
436
+ return _context10.stop();
405
437
  }
406
- }, _callee9, this, [[1, 10]]);
438
+ }, _callee10, this, [[1, 10]]);
407
439
  }));
408
- function create(_x5) {
440
+ function create(_x6) {
409
441
  return _create.apply(this, arguments);
410
442
  }
411
443
  return create;
@@ -441,19 +473,19 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
441
473
  }, {
442
474
  key: "query",
443
475
  value: function () {
444
- var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(type) {
476
+ var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(type) {
445
477
  var _this = this;
446
478
  var params,
447
479
  defaultOrderBy,
448
480
  defaultLimit,
449
481
  mergedParams,
450
482
  response,
451
- _args10 = arguments;
452
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
453
- while (1) switch (_context10.prev = _context10.next) {
483
+ _args11 = arguments;
484
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
485
+ while (1) switch (_context11.prev = _context11.next) {
454
486
  case 0:
455
- params = _args10.length > 1 && _args10[1] !== undefined ? _args10[1] : {};
456
- _context10.prev = 1;
487
+ params = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {};
488
+ _context11.prev = 1;
457
489
  params.type = type;
458
490
 
459
491
  // Default ordering and pagination
@@ -470,15 +502,15 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
470
502
  }
471
503
  }; // Merge defaults with provided params
472
504
  mergedParams = _objectSpread(_objectSpread(_objectSpread({}, defaultOrderBy), defaultLimit), params);
473
- _context10.next = 8;
505
+ _context11.next = 8;
474
506
  return this.axios.post('/object_service/queryObjects', [mergedParams]);
475
507
  case 8:
476
- response = _context10.sent;
508
+ response = _context11.sent;
477
509
  if (!(response.data.ok === false)) {
478
- _context10.next = 11;
510
+ _context11.next = 11;
479
511
  break;
480
512
  }
481
- return _context10.abrupt("return", this._handleError(response));
513
+ return _context11.abrupt("return", this._handleError(response));
482
514
  case 11:
483
515
  // Process items into RbtObject instances
484
516
  if (Array.isArray(response.data.items)) {
@@ -488,18 +520,18 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
488
520
  });
489
521
  });
490
522
  }
491
- return _context10.abrupt("return", response.data.items);
523
+ return _context11.abrupt("return", response.data.items);
492
524
  case 15:
493
- _context10.prev = 15;
494
- _context10.t0 = _context10["catch"](1);
495
- return _context10.abrupt("return", this._handleError(_context10.t0));
525
+ _context11.prev = 15;
526
+ _context11.t0 = _context11["catch"](1);
527
+ return _context11.abrupt("return", this._handleError(_context11.t0));
496
528
  case 18:
497
529
  case "end":
498
- return _context10.stop();
530
+ return _context11.stop();
499
531
  }
500
- }, _callee10, this, [[1, 15]]);
532
+ }, _callee11, this, [[1, 15]]);
501
533
  }));
502
- function query(_x6) {
534
+ function query(_x7) {
503
535
  return _query.apply(this, arguments);
504
536
  }
505
537
  return query;
@@ -515,47 +547,47 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
515
547
  }, {
516
548
  key: "load",
517
549
  value: function () {
518
- var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(type, ids) {
550
+ var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(type, ids) {
519
551
  var params,
520
552
  mergedParams,
521
553
  res,
522
- _args11 = arguments;
523
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
524
- while (1) switch (_context11.prev = _context11.next) {
554
+ _args12 = arguments;
555
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
556
+ while (1) switch (_context12.prev = _context12.next) {
525
557
  case 0:
526
- params = _args11.length > 2 && _args11[2] !== undefined ? _args11[2] : {};
527
- _context11.prev = 1;
558
+ params = _args12.length > 2 && _args12[2] !== undefined ? _args12[2] : {};
559
+ _context12.prev = 1;
528
560
  if (!Array.isArray(ids)) {
529
- _context11.next = 7;
561
+ _context12.next = 7;
530
562
  break;
531
563
  }
532
564
  mergedParams = _objectSpread(_objectSpread({}, params), {}, {
533
565
  where: "id IN (" + ids.join(',') + ")"
534
566
  });
535
- return _context11.abrupt("return", this.query(type, mergedParams));
567
+ return _context12.abrupt("return", this.query(type, mergedParams));
536
568
  case 7:
537
569
  mergedParams = _objectSpread(_objectSpread({}, params), {}, {
538
570
  where: "id=" + ids
539
571
  });
540
- _context11.next = 10;
572
+ _context12.next = 10;
541
573
  return this.query(type, mergedParams);
542
574
  case 10:
543
- res = _context11.sent;
544
- return _context11.abrupt("return", res[0]);
575
+ res = _context12.sent;
576
+ return _context12.abrupt("return", res[0]);
545
577
  case 12:
546
- _context11.next = 17;
578
+ _context12.next = 17;
547
579
  break;
548
580
  case 14:
549
- _context11.prev = 14;
550
- _context11.t0 = _context11["catch"](1);
551
- return _context11.abrupt("return", this._handleError(_context11.t0));
581
+ _context12.prev = 14;
582
+ _context12.t0 = _context12["catch"](1);
583
+ return _context12.abrupt("return", this._handleError(_context12.t0));
552
584
  case 17:
553
585
  case "end":
554
- return _context11.stop();
586
+ return _context12.stop();
555
587
  }
556
- }, _callee11, this, [[1, 14]]);
588
+ }, _callee12, this, [[1, 14]]);
557
589
  }));
558
- function load(_x7, _x8) {
590
+ function load(_x8, _x9) {
559
591
  return _load.apply(this, arguments);
560
592
  }
561
593
  return load;
@@ -576,7 +608,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
576
608
  }, {
577
609
  key: "runTask",
578
610
  value: function () {
579
- var _runTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
611
+ var _runTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
580
612
  var params,
581
613
  callbacks,
582
614
  onProgress,
@@ -588,20 +620,20 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
588
620
  status,
589
621
  message,
590
622
  output,
591
- _args12 = arguments;
592
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
593
- while (1) switch (_context12.prev = _context12.next) {
623
+ _args13 = arguments;
624
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
625
+ while (1) switch (_context13.prev = _context13.next) {
594
626
  case 0:
595
- params = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
596
- callbacks = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : {};
627
+ params = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
628
+ callbacks = _args13.length > 1 && _args13[1] !== undefined ? _args13[1] : {};
597
629
  onProgress = callbacks.onProgress, onError = callbacks.onError, onFinish = callbacks.onFinish;
598
- _context12.prev = 3;
599
- _context12.next = 6;
630
+ _context13.prev = 3;
631
+ _context13.next = 6;
600
632
  return this.post('http://localhost:3004/runChain', params);
601
633
  case 6:
602
- response = _context12.sent;
634
+ response = _context13.sent;
603
635
  if (response) {
604
- _context12.next = 9;
636
+ _context13.next = 9;
605
637
  break;
606
638
  }
607
639
  throw new Error('Invalid server response');
@@ -609,7 +641,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
609
641
  // Validate response structure
610
642
  ok = response.ok, jobId = response.jobId, status = response.status, message = response.message, output = response.output;
611
643
  if (!(!ok || typeof jobId !== 'string' || typeof status !== 'string')) {
612
- _context12.next = 12;
644
+ _context13.next = 12;
613
645
  break;
614
646
  }
615
647
  throw new Error('Invalid response structure');
@@ -627,7 +659,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
627
659
  console.log('Finish (request) ', response);
628
660
  onFinish(response);
629
661
  }
630
- return _context12.abrupt("return", {
662
+ return _context13.abrupt("return", {
631
663
  ok: ok,
632
664
  jobId: jobId,
633
665
  status: status,
@@ -635,24 +667,24 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
635
667
  output: output
636
668
  });
637
669
  case 18:
638
- _context12.prev = 18;
639
- _context12.t0 = _context12["catch"](3);
670
+ _context13.prev = 18;
671
+ _context13.t0 = _context13["catch"](3);
640
672
  if (typeof onError === 'function') {
641
- onError(_context12.t0);
673
+ onError(_context13.t0);
642
674
  } else {
643
- console.error('Error in runTask:', _context12.t0);
675
+ console.error('Error in runTask:', _context13.t0);
644
676
  }
645
- return _context12.abrupt("return", {
677
+ return _context13.abrupt("return", {
646
678
  ok: false,
647
679
  jobId: null,
648
680
  status: 'ERROR',
649
- error: _context12.t0.message
681
+ error: _context13.t0.message
650
682
  });
651
683
  case 22:
652
684
  case "end":
653
- return _context12.stop();
685
+ return _context13.stop();
654
686
  }
655
- }, _callee12, this, [[3, 18]]);
687
+ }, _callee13, this, [[3, 18]]);
656
688
  }));
657
689
  function runTask() {
658
690
  return _runTask.apply(this, arguments);
@@ -672,26 +704,26 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
672
704
  }, {
673
705
  key: "pollTaskProgress",
674
706
  value: function () {
675
- var _pollTaskProgress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(jobId, callbacks) {
707
+ var _pollTaskProgress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(jobId, callbacks) {
676
708
  var _this2 = this;
677
709
  var onProgress, onError, onFinish, checkProgress;
678
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
679
- while (1) switch (_context14.prev = _context14.next) {
710
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
711
+ while (1) switch (_context15.prev = _context15.next) {
680
712
  case 0:
681
713
  onProgress = callbacks.onProgress, onError = callbacks.onError, onFinish = callbacks.onFinish;
682
- _context14.prev = 1;
714
+ _context15.prev = 1;
683
715
  checkProgress = /*#__PURE__*/function () {
684
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
716
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
685
717
  var response;
686
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
687
- while (1) switch (_context13.prev = _context13.next) {
718
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
719
+ while (1) switch (_context14.prev = _context14.next) {
688
720
  case 0:
689
- _context13.next = 2;
721
+ _context14.next = 2;
690
722
  return _this2.get("http://localhost:3004/pollChainProgress", {
691
723
  jobId: jobId
692
724
  });
693
725
  case 2:
694
- response = _context13.sent;
726
+ response = _context14.sent;
695
727
  // If the task is still in progress, start polling for updates
696
728
  if (response.status === 'DONE' && onFinish) {
697
729
  // Provide the current progress to the callback function
@@ -714,28 +746,28 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
714
746
  }
715
747
  case 7:
716
748
  case "end":
717
- return _context13.stop();
749
+ return _context14.stop();
718
750
  }
719
- }, _callee13);
751
+ }, _callee14);
720
752
  }));
721
753
  return function checkProgress() {
722
754
  return _ref2.apply(this, arguments);
723
755
  };
724
756
  }();
725
757
  checkProgress();
726
- _context14.next = 9;
758
+ _context15.next = 9;
727
759
  break;
728
760
  case 6:
729
- _context14.prev = 6;
730
- _context14.t0 = _context14["catch"](1);
731
- return _context14.abrupt("return", this._handleError(_context14.t0));
761
+ _context15.prev = 6;
762
+ _context15.t0 = _context15["catch"](1);
763
+ return _context15.abrupt("return", this._handleError(_context15.t0));
732
764
  case 9:
733
765
  case "end":
734
- return _context14.stop();
766
+ return _context15.stop();
735
767
  }
736
- }, _callee14, this, [[1, 6]]);
768
+ }, _callee15, this, [[1, 6]]);
737
769
  }));
738
- function pollTaskProgress(_x9, _x10) {
770
+ function pollTaskProgress(_x10, _x11) {
739
771
  return _pollTaskProgress.apply(this, arguments);
740
772
  }
741
773
  return pollTaskProgress;
@@ -754,45 +786,45 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
754
786
  }, {
755
787
  key: "get",
756
788
  value: function () {
757
- var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(endpoint) {
789
+ var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(endpoint) {
758
790
  var params,
759
791
  headers,
760
792
  response,
761
- _args15 = arguments;
762
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
763
- while (1) switch (_context15.prev = _context15.next) {
793
+ _args16 = arguments;
794
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
795
+ while (1) switch (_context16.prev = _context16.next) {
764
796
  case 0:
765
- params = _args15.length > 1 && _args15[1] !== undefined ? _args15[1] : {};
766
- _context15.prev = 1;
797
+ params = _args16.length > 1 && _args16[1] !== undefined ? _args16[1] : {};
798
+ _context16.prev = 1;
767
799
  // Add the authToken to the headers
768
800
  headers = {
769
801
  authtoken: this.authtoken
770
802
  }; // Make the GET request using Axios
771
- _context15.next = 5;
803
+ _context16.next = 5;
772
804
  return this.axios.get(endpoint, {
773
805
  params: params,
774
806
  headers: headers
775
807
  });
776
808
  case 5:
777
- response = _context15.sent;
809
+ response = _context16.sent;
778
810
  if (!(response.data.ok === false)) {
779
- _context15.next = 8;
811
+ _context16.next = 8;
780
812
  break;
781
813
  }
782
- return _context15.abrupt("return", this._handleError(response));
814
+ return _context16.abrupt("return", this._handleError(response));
783
815
  case 8:
784
- return _context15.abrupt("return", response.data);
816
+ return _context16.abrupt("return", response.data);
785
817
  case 11:
786
- _context15.prev = 11;
787
- _context15.t0 = _context15["catch"](1);
788
- return _context15.abrupt("return", this._handleError(_context15.t0));
818
+ _context16.prev = 11;
819
+ _context16.t0 = _context16["catch"](1);
820
+ return _context16.abrupt("return", this._handleError(_context16.t0));
789
821
  case 14:
790
822
  case "end":
791
- return _context15.stop();
823
+ return _context16.stop();
792
824
  }
793
- }, _callee15, this, [[1, 11]]);
825
+ }, _callee16, this, [[1, 11]]);
794
826
  }));
795
- function get(_x11) {
827
+ function get(_x12) {
796
828
  return _get.apply(this, arguments);
797
829
  }
798
830
  return get;
@@ -812,44 +844,44 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
812
844
  }, {
813
845
  key: "post",
814
846
  value: function () {
815
- var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(endpoint) {
847
+ var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(endpoint) {
816
848
  var data,
817
849
  headers,
818
850
  response,
819
- _args16 = arguments;
820
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
821
- while (1) switch (_context16.prev = _context16.next) {
851
+ _args17 = arguments;
852
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
853
+ while (1) switch (_context17.prev = _context17.next) {
822
854
  case 0:
823
- data = _args16.length > 1 && _args16[1] !== undefined ? _args16[1] : {};
824
- _context16.prev = 1;
855
+ data = _args17.length > 1 && _args17[1] !== undefined ? _args17[1] : {};
856
+ _context17.prev = 1;
825
857
  // Add the authToken to the headers
826
858
  headers = {
827
859
  authtoken: this.authtoken
828
860
  }; // Make the POST request using Axios
829
- _context16.next = 5;
861
+ _context17.next = 5;
830
862
  return this.axios.post(endpoint, data, {
831
863
  headers: headers
832
864
  });
833
865
  case 5:
834
- response = _context16.sent;
866
+ response = _context17.sent;
835
867
  if (!(response.data.ok === false)) {
836
- _context16.next = 8;
868
+ _context17.next = 8;
837
869
  break;
838
870
  }
839
- return _context16.abrupt("return", this._handleError(response));
871
+ return _context17.abrupt("return", this._handleError(response));
840
872
  case 8:
841
- return _context16.abrupt("return", response.data);
873
+ return _context17.abrupt("return", response.data);
842
874
  case 11:
843
- _context16.prev = 11;
844
- _context16.t0 = _context16["catch"](1);
845
- return _context16.abrupt("return", this._handleError(_context16.t0));
875
+ _context17.prev = 11;
876
+ _context17.t0 = _context17["catch"](1);
877
+ return _context17.abrupt("return", this._handleError(_context17.t0));
846
878
  case 14:
847
879
  case "end":
848
- return _context16.stop();
880
+ return _context17.stop();
849
881
  }
850
- }, _callee16, this, [[1, 11]]);
882
+ }, _callee17, this, [[1, 11]]);
851
883
  }));
852
- function post(_x12) {
884
+ function post(_x13) {
853
885
  return _post.apply(this, arguments);
854
886
  }
855
887
  return post;