roboto-js 1.9.5 → 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.
@@ -506,126 +506,203 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
506
506
  }
507
507
  return confirmUserEmail;
508
508
  }() //
509
- // create and upload files
509
+ // Organization management
510
510
  //
511
511
  }, {
512
- key: "createFile",
512
+ key: "loadCurrentOrganization",
513
513
  value: function () {
514
- var _createFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
515
- var data,
514
+ var _loadCurrentOrganization = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
515
+ var forceReload,
516
516
  _args11 = arguments;
517
517
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
518
518
  while (1) switch (_context11.prev = _context11.next) {
519
519
  case 0:
520
- data = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {};
521
- return _context11.abrupt("return", this.api.createFile(data));
520
+ forceReload = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : false;
521
+ return _context11.abrupt("return", this.api.loadCurrentOrganization(forceReload));
522
522
  case 2:
523
523
  case "end":
524
524
  return _context11.stop();
525
525
  }
526
526
  }, _callee11, this);
527
527
  }));
528
- function createFile() {
529
- return _createFile.apply(this, arguments);
528
+ function loadCurrentOrganization() {
529
+ return _loadCurrentOrganization.apply(this, arguments);
530
530
  }
531
- return createFile;
531
+ return loadCurrentOrganization;
532
532
  }()
533
533
  }, {
534
- key: "loadFile",
534
+ key: "switchOrganization",
535
535
  value: function () {
536
- var _loadFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(id) {
536
+ var _switchOrganization = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(orgId) {
537
537
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
538
538
  while (1) switch (_context12.prev = _context12.next) {
539
539
  case 0:
540
- return _context12.abrupt("return", this.api.loadFile(id));
540
+ return _context12.abrupt("return", this.api.switchOrganization(orgId));
541
541
  case 1:
542
542
  case "end":
543
543
  return _context12.stop();
544
544
  }
545
545
  }, _callee12, this);
546
546
  }));
547
- function loadFile(_x6) {
548
- return _loadFile.apply(this, arguments);
547
+ function switchOrganization(_x6) {
548
+ return _switchOrganization.apply(this, arguments);
549
549
  }
550
- return loadFile;
550
+ return switchOrganization;
551
551
  }()
552
552
  }, {
553
- key: "loadFiles",
553
+ key: "selectCurrentOrganization",
554
554
  value: function () {
555
- var _loadFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(ids) {
555
+ var _selectCurrentOrganization = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(orgId) {
556
+ var role,
557
+ _args13 = arguments;
556
558
  return _regeneratorRuntime().wrap(function _callee13$(_context13) {
557
559
  while (1) switch (_context13.prev = _context13.next) {
558
560
  case 0:
559
- return _context13.abrupt("return", this.api.loadFiles(ids));
560
- case 1:
561
+ role = _args13.length > 1 && _args13[1] !== undefined ? _args13[1] : 'owner';
562
+ return _context13.abrupt("return", this.api.selectCurrentOrganization(orgId, role));
563
+ case 2:
561
564
  case "end":
562
565
  return _context13.stop();
563
566
  }
564
567
  }, _callee13, this);
565
568
  }));
566
- function loadFiles(_x7) {
567
- return _loadFiles.apply(this, arguments);
569
+ function selectCurrentOrganization(_x7) {
570
+ return _selectCurrentOrganization.apply(this, arguments);
568
571
  }
569
- return loadFiles;
570
- }() //
572
+ return selectCurrentOrganization;
573
+ }()
574
+ }, {
575
+ key: "getCurrentOrganization",
576
+ value: function getCurrentOrganization() {
577
+ return this.api.getCurrentOrganization();
578
+ }
579
+ }, {
580
+ key: "currentOrganization",
581
+ get: function get() {
582
+ return this.api.currentOrganization;
583
+ }
584
+
571
585
  //
586
+ // create and upload files
572
587
  //
573
588
  }, {
574
- key: "create",
589
+ key: "createFile",
575
590
  value: function () {
576
- var _create = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(params) {
591
+ var _createFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
577
592
  var data,
578
593
  _args14 = arguments;
579
594
  return _regeneratorRuntime().wrap(function _callee14$(_context14) {
580
595
  while (1) switch (_context14.prev = _context14.next) {
581
596
  case 0:
582
- data = _args14.length > 1 && _args14[1] !== undefined ? _args14[1] : {};
583
- return _context14.abrupt("return", this.api.create(params, data));
597
+ data = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
598
+ return _context14.abrupt("return", this.api.createFile(data));
584
599
  case 2:
585
600
  case "end":
586
601
  return _context14.stop();
587
602
  }
588
603
  }, _callee14, this);
589
604
  }));
590
- function create(_x8) {
591
- return _create.apply(this, arguments);
605
+ function createFile() {
606
+ return _createFile.apply(this, arguments);
592
607
  }
593
- return create;
608
+ return createFile;
594
609
  }()
595
610
  }, {
596
- key: "load",
611
+ key: "loadFile",
597
612
  value: function () {
598
- var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(type, ids, options) {
613
+ var _loadFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(id) {
599
614
  return _regeneratorRuntime().wrap(function _callee15$(_context15) {
600
615
  while (1) switch (_context15.prev = _context15.next) {
601
616
  case 0:
602
- return _context15.abrupt("return", this.api.load(type, ids, options));
617
+ return _context15.abrupt("return", this.api.loadFile(id));
603
618
  case 1:
604
619
  case "end":
605
620
  return _context15.stop();
606
621
  }
607
622
  }, _callee15, this);
608
623
  }));
609
- function load(_x9, _x10, _x11) {
610
- return _load.apply(this, arguments);
624
+ function loadFile(_x8) {
625
+ return _loadFile.apply(this, arguments);
611
626
  }
612
- return load;
627
+ return loadFile;
613
628
  }()
614
629
  }, {
615
- key: "query",
630
+ key: "loadFiles",
616
631
  value: function () {
617
- var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(type, params) {
632
+ var _loadFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(ids) {
618
633
  return _regeneratorRuntime().wrap(function _callee16$(_context16) {
619
634
  while (1) switch (_context16.prev = _context16.next) {
620
635
  case 0:
621
- return _context16.abrupt("return", this.api.query(type, params));
636
+ return _context16.abrupt("return", this.api.loadFiles(ids));
622
637
  case 1:
623
638
  case "end":
624
639
  return _context16.stop();
625
640
  }
626
641
  }, _callee16, this);
627
642
  }));
628
- function query(_x12, _x13) {
643
+ function loadFiles(_x9) {
644
+ return _loadFiles.apply(this, arguments);
645
+ }
646
+ return loadFiles;
647
+ }() //
648
+ //
649
+ //
650
+ }, {
651
+ key: "create",
652
+ value: function () {
653
+ var _create = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(params) {
654
+ var data,
655
+ _args17 = arguments;
656
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
657
+ while (1) switch (_context17.prev = _context17.next) {
658
+ case 0:
659
+ data = _args17.length > 1 && _args17[1] !== undefined ? _args17[1] : {};
660
+ return _context17.abrupt("return", this.api.create(params, data));
661
+ case 2:
662
+ case "end":
663
+ return _context17.stop();
664
+ }
665
+ }, _callee17, this);
666
+ }));
667
+ function create(_x10) {
668
+ return _create.apply(this, arguments);
669
+ }
670
+ return create;
671
+ }()
672
+ }, {
673
+ key: "load",
674
+ value: function () {
675
+ var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(type, ids, options) {
676
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
677
+ while (1) switch (_context18.prev = _context18.next) {
678
+ case 0:
679
+ return _context18.abrupt("return", this.api.load(type, ids, options));
680
+ case 1:
681
+ case "end":
682
+ return _context18.stop();
683
+ }
684
+ }, _callee18, this);
685
+ }));
686
+ function load(_x11, _x12, _x13) {
687
+ return _load.apply(this, arguments);
688
+ }
689
+ return load;
690
+ }()
691
+ }, {
692
+ key: "query",
693
+ value: function () {
694
+ var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(type, params) {
695
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
696
+ while (1) switch (_context19.prev = _context19.next) {
697
+ case 0:
698
+ return _context19.abrupt("return", this.api.query(type, params));
699
+ case 1:
700
+ case "end":
701
+ return _context19.stop();
702
+ }
703
+ }, _callee19, this);
704
+ }));
705
+ function query(_x14, _x15) {
629
706
  return _query.apply(this, arguments);
630
707
  }
631
708
  return query;
@@ -647,18 +724,18 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
647
724
  }, {
648
725
  key: "runTask",
649
726
  value: function () {
650
- var _runTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(params, callbacks) {
651
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
652
- while (1) switch (_context17.prev = _context17.next) {
727
+ var _runTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(params, callbacks) {
728
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
729
+ while (1) switch (_context20.prev = _context20.next) {
653
730
  case 0:
654
- return _context17.abrupt("return", this.api.runTask(params, callbacks));
731
+ return _context20.abrupt("return", this.api.runTask(params, callbacks));
655
732
  case 1:
656
733
  case "end":
657
- return _context17.stop();
734
+ return _context20.stop();
658
735
  }
659
- }, _callee17, this);
736
+ }, _callee20, this);
660
737
  }));
661
- function runTask(_x14, _x15) {
738
+ function runTask(_x16, _x17) {
662
739
  return _runTask.apply(this, arguments);
663
740
  }
664
741
  return runTask;
@@ -666,18 +743,18 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
666
743
  }, {
667
744
  key: "stopJob",
668
745
  value: function () {
669
- var _stopJob = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(params, callbacks) {
670
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
671
- while (1) switch (_context18.prev = _context18.next) {
746
+ var _stopJob = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(params, callbacks) {
747
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
748
+ while (1) switch (_context21.prev = _context21.next) {
672
749
  case 0:
673
- return _context18.abrupt("return", this.api.stopJob(params, callbacks));
750
+ return _context21.abrupt("return", this.api.stopJob(params, callbacks));
674
751
  case 1:
675
752
  case "end":
676
- return _context18.stop();
753
+ return _context21.stop();
677
754
  }
678
- }, _callee18, this);
755
+ }, _callee21, this);
679
756
  }));
680
- function stopJob(_x16, _x17) {
757
+ function stopJob(_x18, _x19) {
681
758
  return _stopJob.apply(this, arguments);
682
759
  }
683
760
  return stopJob;
@@ -685,18 +762,18 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
685
762
  }, {
686
763
  key: "pollTaskProgress",
687
764
  value: function () {
688
- var _pollTaskProgress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(params) {
689
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
690
- while (1) switch (_context19.prev = _context19.next) {
765
+ var _pollTaskProgress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(params) {
766
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
767
+ while (1) switch (_context22.prev = _context22.next) {
691
768
  case 0:
692
- return _context19.abrupt("return", this.api.pollTaskProgress(params));
769
+ return _context22.abrupt("return", this.api.pollTaskProgress(params));
693
770
  case 1:
694
771
  case "end":
695
- return _context19.stop();
772
+ return _context22.stop();
696
773
  }
697
- }, _callee19, this);
774
+ }, _callee22, this);
698
775
  }));
699
- function pollTaskProgress(_x18) {
776
+ function pollTaskProgress(_x20) {
700
777
  return _pollTaskProgress.apply(this, arguments);
701
778
  }
702
779
  return pollTaskProgress;
@@ -761,23 +838,23 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
761
838
  }, {
762
839
  key: "get",
763
840
  value: function () {
764
- var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(endpoint, params) {
841
+ var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(endpoint, params) {
765
842
  var result;
766
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
767
- while (1) switch (_context20.prev = _context20.next) {
843
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
844
+ while (1) switch (_context23.prev = _context23.next) {
768
845
  case 0:
769
- _context20.next = 2;
846
+ _context23.next = 2;
770
847
  return this.api.get(endpoint, params);
771
848
  case 2:
772
- result = _context20.sent;
773
- return _context20.abrupt("return", this._autoWrapResponse(result));
849
+ result = _context23.sent;
850
+ return _context23.abrupt("return", this._autoWrapResponse(result));
774
851
  case 4:
775
852
  case "end":
776
- return _context20.stop();
853
+ return _context23.stop();
777
854
  }
778
- }, _callee20, this);
855
+ }, _callee23, this);
779
856
  }));
780
- function get(_x19, _x20) {
857
+ function get(_x21, _x22) {
781
858
  return _get.apply(this, arguments);
782
859
  }
783
860
  return get;
@@ -785,23 +862,23 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
785
862
  }, {
786
863
  key: "post",
787
864
  value: function () {
788
- var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(endpoint, data) {
865
+ var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(endpoint, data) {
789
866
  var result;
790
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
791
- while (1) switch (_context21.prev = _context21.next) {
867
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
868
+ while (1) switch (_context24.prev = _context24.next) {
792
869
  case 0:
793
- _context21.next = 2;
870
+ _context24.next = 2;
794
871
  return this.api.post(endpoint, data);
795
872
  case 2:
796
- result = _context21.sent;
797
- return _context21.abrupt("return", this._autoWrapResponse(result));
873
+ result = _context24.sent;
874
+ return _context24.abrupt("return", this._autoWrapResponse(result));
798
875
  case 4:
799
876
  case "end":
800
- return _context21.stop();
877
+ return _context24.stop();
801
878
  }
802
- }, _callee21, this);
879
+ }, _callee24, this);
803
880
  }));
804
- function post(_x21, _x22) {
881
+ function post(_x23, _x24) {
805
882
  return _post.apply(this, arguments);
806
883
  }
807
884
  return post;