parse 3.5.1-beta.1 → 4.0.0-alpha.1

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.
Files changed (50) hide show
  1. package/README.md +17 -4
  2. package/dist/parse.js +421 -347
  3. package/dist/parse.min.js +2 -2
  4. package/dist/parse.weapp.js +421 -347
  5. package/dist/parse.weapp.min.js +2 -2
  6. package/lib/browser/CoreManager.js +1 -1
  7. package/lib/browser/EventuallyQueue.js +31 -27
  8. package/lib/browser/LiveQueryClient.js +6 -2
  9. package/lib/browser/LocalDatastore.js +20 -20
  10. package/lib/browser/LocalDatastoreController.js +16 -14
  11. package/lib/browser/LocalDatastoreController.react-native.js +10 -10
  12. package/lib/browser/ParseCLP.js +32 -32
  13. package/lib/browser/ParseFile.js +26 -15
  14. package/lib/browser/ParseLiveQuery.js +6 -6
  15. package/lib/browser/ParseObject.js +84 -69
  16. package/lib/browser/ParseOp.js +3 -1
  17. package/lib/browser/ParseQuery.js +115 -88
  18. package/lib/browser/ParseUser.js +74 -64
  19. package/lib/browser/RESTController.js +6 -7
  20. package/lib/node/CoreManager.js +1 -1
  21. package/lib/node/ObjectStateMutations.js +14 -43
  22. package/lib/node/ParseCLP.js +12 -41
  23. package/lib/node/ParseFile.js +15 -41
  24. package/lib/node/ParseObject.js +13 -41
  25. package/lib/node/ParseQuery.js +3 -1
  26. package/lib/node/RESTController.js +2 -43
  27. package/lib/react-native/CoreManager.js +1 -1
  28. package/lib/react-native/LiveQueryClient.js +6 -2
  29. package/lib/react-native/LocalDatastore.js +3 -2
  30. package/lib/react-native/ParseCLP.js +32 -32
  31. package/lib/react-native/ParseFile.js +9 -3
  32. package/lib/react-native/ParseObject.js +14 -9
  33. package/lib/react-native/ParseOp.js +3 -1
  34. package/lib/react-native/ParseQuery.js +21 -7
  35. package/lib/react-native/RESTController.js +6 -7
  36. package/lib/weapp/CoreManager.js +1 -1
  37. package/lib/weapp/EventuallyQueue.js +31 -27
  38. package/lib/weapp/LiveQueryClient.js +6 -2
  39. package/lib/weapp/LocalDatastore.js +20 -20
  40. package/lib/weapp/LocalDatastoreController.js +16 -14
  41. package/lib/weapp/LocalDatastoreController.react-native.js +10 -10
  42. package/lib/weapp/ParseCLP.js +32 -32
  43. package/lib/weapp/ParseFile.js +26 -15
  44. package/lib/weapp/ParseLiveQuery.js +6 -6
  45. package/lib/weapp/ParseObject.js +84 -69
  46. package/lib/weapp/ParseOp.js +3 -1
  47. package/lib/weapp/ParseQuery.js +115 -88
  48. package/lib/weapp/ParseUser.js +74 -64
  49. package/lib/weapp/RESTController.js +6 -7
  50. package/package.json +6 -2
@@ -488,7 +488,7 @@ var LocalDatastoreController = {
488
488
  {
489
489
  return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
490
490
  var values, objects;
491
- return _regeneratorRuntime().wrap(function (_context) {
491
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
492
492
  while (1) {
493
493
  switch (_context.prev = _context.next) {
494
494
  case 0:
@@ -517,7 +517,7 @@ var LocalDatastoreController = {
517
517
  }, _callee);
518
518
  }))();
519
519
  },
520
- pinWithName: function (name
520
+ pinWithName: function pinWithName(name
521
521
  /*: string*/
522
522
  , value
523
523
  /*: any*/
@@ -525,17 +525,17 @@ var LocalDatastoreController = {
525
525
  var values = (0, _stringify.default)(value);
526
526
  return _Storage.default.setItemAsync(name, values);
527
527
  },
528
- unPinWithName: function (name
528
+ unPinWithName: function unPinWithName(name
529
529
  /*: string*/
530
530
  ) {
531
531
  return _Storage.default.removeItemAsync(name);
532
532
  },
533
- getAllContents: function ()
533
+ getAllContents: function getAllContents()
534
534
  /*: Object*/
535
535
  {
536
536
  return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
537
537
  var keys;
538
- return _regeneratorRuntime().wrap(function (_context3) {
538
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
539
539
  while (1) {
540
540
  switch (_context3.prev = _context3.next) {
541
541
  case 0:
@@ -547,7 +547,7 @@ var LocalDatastoreController = {
547
547
  return _context3.abrupt("return", (0, _reduce.default)(keys).call(keys, /*#__PURE__*/function () {
548
548
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(previousPromise, key) {
549
549
  var LDS, value;
550
- return _regeneratorRuntime().wrap(function (_context2) {
550
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
551
551
  while (1) {
552
552
  switch (_context2.prev = _context2.next) {
553
553
  case 0:
@@ -585,7 +585,7 @@ var LocalDatastoreController = {
585
585
  }, _callee2);
586
586
  }));
587
587
 
588
- return function () {
588
+ return function (_x, _x2) {
589
589
  return _ref.apply(this, arguments);
590
590
  };
591
591
  }(), _promise.default.resolve({})));
@@ -599,12 +599,12 @@ var LocalDatastoreController = {
599
599
  }))();
600
600
  },
601
601
  // Used for testing
602
- getRawStorage: function ()
602
+ getRawStorage: function getRawStorage()
603
603
  /*: Object*/
604
604
  {
605
605
  return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
606
606
  var keys;
607
- return _regeneratorRuntime().wrap(function (_context5) {
607
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
608
608
  while (1) {
609
609
  switch (_context5.prev = _context5.next) {
610
610
  case 0:
@@ -616,7 +616,7 @@ var LocalDatastoreController = {
616
616
  return _context5.abrupt("return", (0, _reduce.default)(keys).call(keys, /*#__PURE__*/function () {
617
617
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(previousPromise, key) {
618
618
  var LDS, value;
619
- return _regeneratorRuntime().wrap(function (_context4) {
619
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
620
620
  while (1) {
621
621
  switch (_context4.prev = _context4.next) {
622
622
  case 0:
@@ -641,7 +641,7 @@ var LocalDatastoreController = {
641
641
  }, _callee4);
642
642
  }));
643
643
 
644
- return function () {
644
+ return function (_x3, _x4) {
645
645
  return _ref2.apply(this, arguments);
646
646
  };
647
647
  }(), _promise.default.resolve({})));
@@ -654,13 +654,15 @@ var LocalDatastoreController = {
654
654
  }, _callee5);
655
655
  }))();
656
656
  },
657
- clear: function ()
657
+ clear: function clear()
658
658
  /*: Promise*/
659
659
  {
660
+ var _this = this;
661
+
660
662
  return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
661
663
  var keys, toRemove, _iterator, _step, key, promises;
662
664
 
663
- return _regeneratorRuntime().wrap(function (_context6) {
665
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
664
666
  while (1) {
665
667
  switch (_context6.prev = _context6.next) {
666
668
  case 0:
@@ -686,7 +688,7 @@ var LocalDatastoreController = {
686
688
  _iterator.f();
687
689
  }
688
690
 
689
- promises = (0, _map.default)(toRemove).call(toRemove, this.unPinWithName);
691
+ promises = (0, _map.default)(toRemove).call(toRemove, _this.unPinWithName);
690
692
  return _context6.abrupt("return", _promise.default.all(promises));
691
693
 
692
694
  case 8:
@@ -402,7 +402,7 @@ var LocalDatastoreController = {
402
402
  {
403
403
  return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
404
404
  var values, objects;
405
- return _regeneratorRuntime().wrap(function (_context) {
405
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
406
406
  while (1) {
407
407
  switch (_context.prev = _context.next) {
408
408
  case 0:
@@ -431,7 +431,7 @@ var LocalDatastoreController = {
431
431
  }, _callee);
432
432
  }))();
433
433
  },
434
- pinWithName: function (name
434
+ pinWithName: function pinWithName(name
435
435
  /*: string*/
436
436
  , value
437
437
  /*: any*/
@@ -440,7 +440,7 @@ var LocalDatastoreController = {
440
440
  {
441
441
  return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
442
442
  var values;
443
- return _regeneratorRuntime().wrap(function (_context2) {
443
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
444
444
  while (1) {
445
445
  switch (_context2.prev = _context2.next) {
446
446
  case 0:
@@ -467,19 +467,19 @@ var LocalDatastoreController = {
467
467
  }, _callee2, null, [[0, 6]]);
468
468
  }))();
469
469
  },
470
- unPinWithName: function (name
470
+ unPinWithName: function unPinWithName(name
471
471
  /*: string*/
472
472
  )
473
473
  /*: Promise<void>*/
474
474
  {
475
475
  return RNStorage.removeItemAsync(name);
476
476
  },
477
- getAllContents: function ()
477
+ getAllContents: function getAllContents()
478
478
  /*: Promise<Object>*/
479
479
  {
480
480
  return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
481
481
  var keys, batch, i, key, LDS, results;
482
- return _regeneratorRuntime().wrap(function (_context3) {
482
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
483
483
  while (1) {
484
484
  switch (_context3.prev = _context3.next) {
485
485
  case 0:
@@ -538,12 +538,12 @@ var LocalDatastoreController = {
538
538
  }))();
539
539
  },
540
540
  // Used for testing
541
- getRawStorage: function ()
541
+ getRawStorage: function getRawStorage()
542
542
  /*: Promise<Object>*/
543
543
  {
544
544
  return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
545
545
  var keys, storage, results;
546
- return _regeneratorRuntime().wrap(function (_context4) {
546
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
547
547
  while (1) {
548
548
  switch (_context4.prev = _context4.next) {
549
549
  case 0:
@@ -575,12 +575,12 @@ var LocalDatastoreController = {
575
575
  }, _callee4);
576
576
  }))();
577
577
  },
578
- clear: function ()
578
+ clear: function clear()
579
579
  /*: Promise<void>*/
580
580
  {
581
581
  return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
582
582
  var keys, batch, i, key;
583
- return _regeneratorRuntime().wrap(function (_context5) {
583
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
584
584
  while (1) {
585
585
  switch (_context5.prev = _context5.next) {
586
586
  case 0:
@@ -298,7 +298,7 @@ var ParseCLP = /*#__PURE__*/function () {
298
298
  _step;
299
299
 
300
300
  try {
301
- var _loop = function () {
301
+ var _loop = function _loop() {
302
302
  var _step$value = (0, _slicedToArray2.default)(_step.value, 2),
303
303
  operation = _step$value[0],
304
304
  group = _step$value[1];
@@ -429,7 +429,7 @@ var ParseCLP = /*#__PURE__*/function () {
429
429
 
430
430
  (0, _createClass2.default)(ParseCLP, [{
431
431
  key: "toJSON",
432
- value: function ()
432
+ value: function toJSON()
433
433
  /*: PermissionsMap*/
434
434
  {
435
435
  return _objectSpread({}, this.permissionsMap);
@@ -443,7 +443,7 @@ var ParseCLP = /*#__PURE__*/function () {
443
443
 
444
444
  }, {
445
445
  key: "equals",
446
- value: function (other
446
+ value: function equals(other
447
447
  /*: ParseCLP*/
448
448
  )
449
449
  /*: boolean*/
@@ -486,7 +486,7 @@ var ParseCLP = /*#__PURE__*/function () {
486
486
  }
487
487
  }, {
488
488
  key: "_getRoleName",
489
- value: function (role
489
+ value: function _getRoleName(role
490
490
  /*: ParseRole | string*/
491
491
  )
492
492
  /*: string*/
@@ -506,7 +506,7 @@ var ParseCLP = /*#__PURE__*/function () {
506
506
  }
507
507
  }, {
508
508
  key: "_parseEntity",
509
- value: function (entity
509
+ value: function _parseEntity(entity
510
510
  /*: Entity*/
511
511
  ) {
512
512
  var userId = entity;
@@ -529,7 +529,7 @@ var ParseCLP = /*#__PURE__*/function () {
529
529
  }
530
530
  }, {
531
531
  key: "_setAccess",
532
- value: function (permission
532
+ value: function _setAccess(permission
533
533
  /*: string*/
534
534
  , userId
535
535
  /*: Entity*/
@@ -561,7 +561,7 @@ var ParseCLP = /*#__PURE__*/function () {
561
561
  }
562
562
  }, {
563
563
  key: "_getAccess",
564
- value: function (permission
564
+ value: function _getAccess(permission
565
565
  /*: string*/
566
566
  , userId
567
567
  /*: Entity*/
@@ -584,7 +584,7 @@ var ParseCLP = /*#__PURE__*/function () {
584
584
  }
585
585
  }, {
586
586
  key: "_setArrayAccess",
587
- value: function (permission
587
+ value: function _setArrayAccess(permission
588
588
  /*: string*/
589
589
  , userId
590
590
  /*: Entity*/
@@ -610,7 +610,7 @@ var ParseCLP = /*#__PURE__*/function () {
610
610
  }
611
611
  }, {
612
612
  key: "_setGroupPointerPermission",
613
- value: function (operation
613
+ value: function _setGroupPointerPermission(operation
614
614
  /*: string*/
615
615
  , pointerFields
616
616
  /*: string[]*/
@@ -633,7 +633,7 @@ var ParseCLP = /*#__PURE__*/function () {
633
633
  }
634
634
  }, {
635
635
  key: "_getGroupPointerPermissions",
636
- value: function (operation
636
+ value: function _getGroupPointerPermissions(operation
637
637
  /*: string*/
638
638
  )
639
639
  /*: string[]*/
@@ -648,7 +648,7 @@ var ParseCLP = /*#__PURE__*/function () {
648
648
 
649
649
  }, {
650
650
  key: "setReadUserFields",
651
- value: function (pointerFields
651
+ value: function setReadUserFields(pointerFields
652
652
  /*: string[]*/
653
653
  ) {
654
654
  this._setGroupPointerPermission('readUserFields', pointerFields);
@@ -659,7 +659,7 @@ var ParseCLP = /*#__PURE__*/function () {
659
659
 
660
660
  }, {
661
661
  key: "getReadUserFields",
662
- value: function ()
662
+ value: function getReadUserFields()
663
663
  /*: string[]*/
664
664
  {
665
665
  return this._getGroupPointerPermissions('readUserFields');
@@ -672,7 +672,7 @@ var ParseCLP = /*#__PURE__*/function () {
672
672
 
673
673
  }, {
674
674
  key: "setWriteUserFields",
675
- value: function (pointerFields
675
+ value: function setWriteUserFields(pointerFields
676
676
  /*: string[]*/
677
677
  ) {
678
678
  this._setGroupPointerPermission('writeUserFields', pointerFields);
@@ -683,7 +683,7 @@ var ParseCLP = /*#__PURE__*/function () {
683
683
 
684
684
  }, {
685
685
  key: "getWriteUserFields",
686
- value: function ()
686
+ value: function getWriteUserFields()
687
687
  /*: string[]*/
688
688
  {
689
689
  return this._getGroupPointerPermissions('writeUserFields');
@@ -697,7 +697,7 @@ var ParseCLP = /*#__PURE__*/function () {
697
697
 
698
698
  }, {
699
699
  key: "setProtectedFields",
700
- value: function (userId
700
+ value: function setProtectedFields(userId
701
701
  /*: Entity*/
702
702
  , fields
703
703
  /*: string[]*/
@@ -713,7 +713,7 @@ var ParseCLP = /*#__PURE__*/function () {
713
713
 
714
714
  }, {
715
715
  key: "getProtectedFields",
716
- value: function (userId
716
+ value: function getProtectedFields(userId
717
717
  /*: Entity*/
718
718
  )
719
719
  /*: string[]*/
@@ -729,7 +729,7 @@ var ParseCLP = /*#__PURE__*/function () {
729
729
 
730
730
  }, {
731
731
  key: "setReadAccess",
732
- value: function (userId
732
+ value: function setReadAccess(userId
733
733
  /*: Entity*/
734
734
  , allowed
735
735
  /*: boolean*/
@@ -752,7 +752,7 @@ var ParseCLP = /*#__PURE__*/function () {
752
752
 
753
753
  }, {
754
754
  key: "getReadAccess",
755
- value: function (userId
755
+ value: function getReadAccess(userId
756
756
  /*: Entity*/
757
757
  )
758
758
  /*: boolean*/
@@ -768,7 +768,7 @@ var ParseCLP = /*#__PURE__*/function () {
768
768
 
769
769
  }, {
770
770
  key: "setWriteAccess",
771
- value: function (userId
771
+ value: function setWriteAccess(userId
772
772
  /*: Entity*/
773
773
  , allowed
774
774
  /*: boolean*/
@@ -793,7 +793,7 @@ var ParseCLP = /*#__PURE__*/function () {
793
793
 
794
794
  }, {
795
795
  key: "getWriteAccess",
796
- value: function (userId
796
+ value: function getWriteAccess(userId
797
797
  /*: Entity*/
798
798
  )
799
799
  /*: boolean*/
@@ -808,7 +808,7 @@ var ParseCLP = /*#__PURE__*/function () {
808
808
 
809
809
  }, {
810
810
  key: "setPublicReadAccess",
811
- value: function (allowed
811
+ value: function setPublicReadAccess(allowed
812
812
  /*: boolean*/
813
813
  ) {
814
814
  this.setReadAccess(PUBLIC_KEY, allowed);
@@ -821,7 +821,7 @@ var ParseCLP = /*#__PURE__*/function () {
821
821
 
822
822
  }, {
823
823
  key: "getPublicReadAccess",
824
- value: function ()
824
+ value: function getPublicReadAccess()
825
825
  /*: boolean*/
826
826
  {
827
827
  return this.getReadAccess(PUBLIC_KEY);
@@ -834,7 +834,7 @@ var ParseCLP = /*#__PURE__*/function () {
834
834
 
835
835
  }, {
836
836
  key: "setPublicWriteAccess",
837
- value: function (allowed
837
+ value: function setPublicWriteAccess(allowed
838
838
  /*: boolean*/
839
839
  ) {
840
840
  this.setWriteAccess(PUBLIC_KEY, allowed);
@@ -847,7 +847,7 @@ var ParseCLP = /*#__PURE__*/function () {
847
847
 
848
848
  }, {
849
849
  key: "getPublicWriteAccess",
850
- value: function ()
850
+ value: function getPublicWriteAccess()
851
851
  /*: boolean*/
852
852
  {
853
853
  return this.getWriteAccess(PUBLIC_KEY);
@@ -860,7 +860,7 @@ var ParseCLP = /*#__PURE__*/function () {
860
860
 
861
861
  }, {
862
862
  key: "setPublicProtectedFields",
863
- value: function (fields
863
+ value: function setPublicProtectedFields(fields
864
864
  /*: string[]*/
865
865
  ) {
866
866
  this.setProtectedFields(PUBLIC_KEY, fields);
@@ -873,7 +873,7 @@ var ParseCLP = /*#__PURE__*/function () {
873
873
 
874
874
  }, {
875
875
  key: "getPublicProtectedFields",
876
- value: function ()
876
+ value: function getPublicProtectedFields()
877
877
  /*: string[]*/
878
878
  {
879
879
  return this.getProtectedFields(PUBLIC_KEY);
@@ -890,7 +890,7 @@ var ParseCLP = /*#__PURE__*/function () {
890
890
 
891
891
  }, {
892
892
  key: "getRoleReadAccess",
893
- value: function (role
893
+ value: function getRoleReadAccess(role
894
894
  /*: ParseRole | string*/
895
895
  )
896
896
  /*: boolean*/
@@ -909,7 +909,7 @@ var ParseCLP = /*#__PURE__*/function () {
909
909
 
910
910
  }, {
911
911
  key: "getRoleWriteAccess",
912
- value: function (role
912
+ value: function getRoleWriteAccess(role
913
913
  /*: ParseRole | string*/
914
914
  )
915
915
  /*: boolean*/
@@ -927,7 +927,7 @@ var ParseCLP = /*#__PURE__*/function () {
927
927
 
928
928
  }, {
929
929
  key: "setRoleReadAccess",
930
- value: function (role
930
+ value: function setRoleReadAccess(role
931
931
  /*: ParseRole | string*/
932
932
  , allowed
933
933
  /*: boolean*/
@@ -945,7 +945,7 @@ var ParseCLP = /*#__PURE__*/function () {
945
945
 
946
946
  }, {
947
947
  key: "setRoleWriteAccess",
948
- value: function (role
948
+ value: function setRoleWriteAccess(role
949
949
  /*: ParseRole | string*/
950
950
  , allowed
951
951
  /*: boolean*/
@@ -964,7 +964,7 @@ var ParseCLP = /*#__PURE__*/function () {
964
964
 
965
965
  }, {
966
966
  key: "getRoleProtectedFields",
967
- value: function (role
967
+ value: function getRoleProtectedFields(role
968
968
  /*: ParseRole | string*/
969
969
  )
970
970
  /*: string[]*/
@@ -982,7 +982,7 @@ var ParseCLP = /*#__PURE__*/function () {
982
982
 
983
983
  }, {
984
984
  key: "setRoleProtectedFields",
985
- value: function (role
985
+ value: function setRoleProtectedFields(role
986
986
  /*: ParseRole | string*/
987
987
  , fields
988
988
  /*: string[]*/
@@ -625,6 +625,8 @@ var ParseFile = /*#__PURE__*/function () {
625
625
  key: "getData",
626
626
  value: function () {
627
627
  var _getData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
628
+ var _this = this;
629
+
628
630
  var options, controller, result;
629
631
  return _regeneratorRuntime().wrap(function (_context4) {
630
632
  while (1) {
@@ -648,7 +650,7 @@ var ParseFile = /*#__PURE__*/function () {
648
650
  case 4:
649
651
  options = {
650
652
  requestTask: function (task) {
651
- return this._requestTask = task;
653
+ return _this._requestTask = task;
652
654
  }
653
655
  };
654
656
  controller = _CoreManager.default.getFileController();
@@ -668,9 +670,11 @@ var ParseFile = /*#__PURE__*/function () {
668
670
  }, _callee, this);
669
671
  }));
670
672
 
671
- return function () {
673
+ function getData() {
672
674
  return _getData.apply(this, arguments);
673
- };
675
+ }
676
+
677
+ return getData;
674
678
  }()
675
679
  /**
676
680
  * Gets the name of the file. Before save is called, this is the filename
@@ -915,11 +919,13 @@ var ParseFile = /*#__PURE__*/function () {
915
919
  value: function (metadata
916
920
  /*: any*/
917
921
  ) {
922
+ var _this4 = this;
923
+
918
924
  if (metadata && (0, _typeof2.default)(metadata) === 'object') {
919
925
  var _context5;
920
926
 
921
927
  (0, _forEach.default)(_context5 = (0, _keys.default)(metadata)).call(_context5, function (key) {
922
- this.addMetadata(key, metadata[key]);
928
+ _this4.addMetadata(key, metadata[key]);
923
929
  });
924
930
  }
925
931
  }
@@ -952,11 +958,13 @@ var ParseFile = /*#__PURE__*/function () {
952
958
  value: function (tags
953
959
  /*: any*/
954
960
  ) {
961
+ var _this5 = this;
962
+
955
963
  if (tags && (0, _typeof2.default)(tags) === 'object') {
956
964
  var _context6;
957
965
 
958
966
  (0, _forEach.default)(_context6 = (0, _keys.default)(tags)).call(_context6, function (key) {
959
- this.addTag(key, tags[key]);
967
+ _this5.addTag(key, tags[key]);
960
968
  });
961
969
  }
962
970
  }
@@ -1027,7 +1035,7 @@ var DefaultController = {
1027
1035
  ) {
1028
1036
  var base64Data, _base64Data$split, _base64Data$split2, first, second, data, newSource;
1029
1037
 
1030
- return _regeneratorRuntime().wrap(function (_context7) {
1038
+ return _regeneratorRuntime().wrap(function _callee2$(_context7) {
1031
1039
  while (1) {
1032
1040
  switch (_context7.prev = _context7.next) {
1033
1041
  case 0:
@@ -1082,11 +1090,13 @@ var DefaultController = {
1082
1090
  }, _callee2);
1083
1091
  }));
1084
1092
 
1085
- return function () {
1093
+ function saveFile(_x, _x2, _x3) {
1086
1094
  return _saveFile.apply(this, arguments);
1087
- };
1095
+ }
1096
+
1097
+ return saveFile;
1088
1098
  }(),
1089
- saveBase64: function (name
1099
+ saveBase64: function saveBase64(name
1090
1100
  /*: string*/
1091
1101
  , source
1092
1102
  /*: FileSource*/
@@ -1113,16 +1123,17 @@ var DefaultController = {
1113
1123
  data._ContentType = source.type;
1114
1124
  }
1115
1125
 
1116
- return _CoreManager.default.getRESTController().request('POST', 'files/' + name, data, options);
1126
+ var path = 'files/' + name;
1127
+ return _CoreManager.default.getRESTController().request('POST', path, data, options);
1117
1128
  },
1118
- download: function (uri, options) {
1129
+ download: function download(uri, options) {
1119
1130
  if (XHR) {
1120
1131
  return this.downloadAjax(uri, options);
1121
1132
  } else {
1122
1133
  return _promise.default.reject('Cannot make a request: No definition of XMLHttpRequest was found.');
1123
1134
  }
1124
1135
  },
1125
- downloadAjax: function (uri, options) {
1136
+ downloadAjax: function downloadAjax(uri, options) {
1126
1137
  return new _promise.default(function (resolve, reject) {
1127
1138
  var xhr = new XHR();
1128
1139
  xhr.open('GET', uri, true);
@@ -1152,7 +1163,7 @@ var DefaultController = {
1152
1163
  xhr.send();
1153
1164
  });
1154
1165
  },
1155
- deleteFile: function (name
1166
+ deleteFile: function deleteFile(name
1156
1167
  /*: string*/
1157
1168
  , options
1158
1169
  /*:: ?: FullOptions*/
@@ -1181,12 +1192,12 @@ var DefaultController = {
1181
1192
  }
1182
1193
  });
1183
1194
  },
1184
- _setXHR: function (xhr
1195
+ _setXHR: function _setXHR(xhr
1185
1196
  /*: any*/
1186
1197
  ) {
1187
1198
  XHR = xhr;
1188
1199
  },
1189
- _getXHR: function () {
1200
+ _getXHR: function _getXHR() {
1190
1201
  return XHR;
1191
1202
  }
1192
1203
  };
@@ -442,7 +442,7 @@ var LiveQuery = new _EventEmitter.default();
442
442
 
443
443
  LiveQuery.open = /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
444
444
  var liveQueryClient;
445
- return _regeneratorRuntime().wrap(function (_context) {
445
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
446
446
  while (1) {
447
447
  switch (_context.prev = _context.next) {
448
448
  case 0:
@@ -470,7 +470,7 @@ LiveQuery.open = /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_reg
470
470
 
471
471
  LiveQuery.close = /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
472
472
  var liveQueryClient;
473
- return _regeneratorRuntime().wrap(function (_context2) {
473
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
474
474
  while (1) {
475
475
  switch (_context2.prev = _context2.next) {
476
476
  case 0:
@@ -494,18 +494,18 @@ var _default = LiveQuery;
494
494
  exports.default = _default;
495
495
  var defaultLiveQueryClient;
496
496
  var DefaultLiveQueryController = {
497
- setDefaultLiveQueryClient: function (liveQueryClient
497
+ setDefaultLiveQueryClient: function setDefaultLiveQueryClient(liveQueryClient
498
498
  /*: LiveQueryClient*/
499
499
  ) {
500
500
  defaultLiveQueryClient = liveQueryClient;
501
501
  },
502
- getDefaultLiveQueryClient: function ()
502
+ getDefaultLiveQueryClient: function getDefaultLiveQueryClient()
503
503
  /*: Promise<LiveQueryClient>*/
504
504
  {
505
505
  return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
506
506
  var _yield$Promise$all, _yield$Promise$all2, currentUser, installationId, sessionToken, liveQueryServerURL, serverURL, protocol, host, applicationId, javascriptKey, masterKey;
507
507
 
508
- return _regeneratorRuntime().wrap(function (_context3) {
508
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
509
509
  while (1) {
510
510
  switch (_context3.prev = _context3.next) {
511
511
  case 0:
@@ -576,7 +576,7 @@ var DefaultLiveQueryController = {
576
576
  }, _callee3);
577
577
  }))();
578
578
  },
579
- _clearCachedDefaultClient: function () {
579
+ _clearCachedDefaultClient: function _clearCachedDefaultClient() {
580
580
  defaultLiveQueryClient = null;
581
581
  }
582
582
  };