parse 3.5.1-alpha.1 → 3.5.1-alpha.2

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 (45) hide show
  1. package/README.md +2 -1
  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/ParseQuery.js +3 -1
  22. package/lib/react-native/CoreManager.js +1 -1
  23. package/lib/react-native/LiveQueryClient.js +6 -2
  24. package/lib/react-native/LocalDatastore.js +3 -2
  25. package/lib/react-native/ParseCLP.js +32 -32
  26. package/lib/react-native/ParseFile.js +9 -3
  27. package/lib/react-native/ParseObject.js +14 -9
  28. package/lib/react-native/ParseOp.js +3 -1
  29. package/lib/react-native/ParseQuery.js +21 -7
  30. package/lib/react-native/RESTController.js +6 -7
  31. package/lib/weapp/CoreManager.js +1 -1
  32. package/lib/weapp/EventuallyQueue.js +31 -27
  33. package/lib/weapp/LiveQueryClient.js +6 -2
  34. package/lib/weapp/LocalDatastore.js +20 -20
  35. package/lib/weapp/LocalDatastoreController.js +16 -14
  36. package/lib/weapp/LocalDatastoreController.react-native.js +10 -10
  37. package/lib/weapp/ParseCLP.js +32 -32
  38. package/lib/weapp/ParseFile.js +26 -15
  39. package/lib/weapp/ParseLiveQuery.js +6 -6
  40. package/lib/weapp/ParseObject.js +84 -69
  41. package/lib/weapp/ParseOp.js +3 -1
  42. package/lib/weapp/ParseQuery.js +115 -88
  43. package/lib/weapp/ParseUser.js +74 -64
  44. package/lib/weapp/RESTController.js +6 -7
  45. package/package.json +3 -2
@@ -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[]*/
@@ -623,6 +623,8 @@ var ParseFile = /*#__PURE__*/function () {
623
623
  key: "getData",
624
624
  value: function () {
625
625
  var _getData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
626
+ var _this = this;
627
+
626
628
  var options, controller, result;
627
629
  return _regeneratorRuntime().wrap(function (_context4) {
628
630
  while (1) {
@@ -646,7 +648,7 @@ var ParseFile = /*#__PURE__*/function () {
646
648
  case 4:
647
649
  options = {
648
650
  requestTask: function (task) {
649
- return this._requestTask = task;
651
+ return _this._requestTask = task;
650
652
  }
651
653
  };
652
654
  controller = _CoreManager.default.getFileController();
@@ -666,9 +668,11 @@ var ParseFile = /*#__PURE__*/function () {
666
668
  }, _callee, this);
667
669
  }));
668
670
 
669
- return function () {
671
+ function getData() {
670
672
  return _getData.apply(this, arguments);
671
- };
673
+ }
674
+
675
+ return getData;
672
676
  }()
673
677
  /**
674
678
  * Gets the name of the file. Before save is called, this is the filename
@@ -913,11 +917,13 @@ var ParseFile = /*#__PURE__*/function () {
913
917
  value: function (metadata
914
918
  /*: any*/
915
919
  ) {
920
+ var _this4 = this;
921
+
916
922
  if (metadata && (0, _typeof2.default)(metadata) === 'object') {
917
923
  var _context5;
918
924
 
919
925
  (0, _forEach.default)(_context5 = (0, _keys.default)(metadata)).call(_context5, function (key) {
920
- this.addMetadata(key, metadata[key]);
926
+ _this4.addMetadata(key, metadata[key]);
921
927
  });
922
928
  }
923
929
  }
@@ -950,11 +956,13 @@ var ParseFile = /*#__PURE__*/function () {
950
956
  value: function (tags
951
957
  /*: any*/
952
958
  ) {
959
+ var _this5 = this;
960
+
953
961
  if (tags && (0, _typeof2.default)(tags) === 'object') {
954
962
  var _context6;
955
963
 
956
964
  (0, _forEach.default)(_context6 = (0, _keys.default)(tags)).call(_context6, function (key) {
957
- this.addTag(key, tags[key]);
965
+ _this5.addTag(key, tags[key]);
958
966
  });
959
967
  }
960
968
  }
@@ -1025,7 +1033,7 @@ var DefaultController = {
1025
1033
  ) {
1026
1034
  var base64Data, _base64Data$split, _base64Data$split2, first, second, data, newSource;
1027
1035
 
1028
- return _regeneratorRuntime().wrap(function (_context7) {
1036
+ return _regeneratorRuntime().wrap(function _callee2$(_context7) {
1029
1037
  while (1) {
1030
1038
  switch (_context7.prev = _context7.next) {
1031
1039
  case 0:
@@ -1080,11 +1088,13 @@ var DefaultController = {
1080
1088
  }, _callee2);
1081
1089
  }));
1082
1090
 
1083
- return function () {
1091
+ function saveFile(_x, _x2, _x3) {
1084
1092
  return _saveFile.apply(this, arguments);
1085
- };
1093
+ }
1094
+
1095
+ return saveFile;
1086
1096
  }(),
1087
- saveBase64: function (name
1097
+ saveBase64: function saveBase64(name
1088
1098
  /*: string*/
1089
1099
  , source
1090
1100
  /*: FileSource*/
@@ -1111,16 +1121,17 @@ var DefaultController = {
1111
1121
  data._ContentType = source.type;
1112
1122
  }
1113
1123
 
1114
- return _CoreManager.default.getRESTController().request('POST', 'files/' + name, data, options);
1124
+ var path = 'files/' + name;
1125
+ return _CoreManager.default.getRESTController().request('POST', path, data, options);
1115
1126
  },
1116
- download: function (uri, options) {
1127
+ download: function download(uri, options) {
1117
1128
  if (XHR) {
1118
1129
  return this.downloadAjax(uri, options);
1119
1130
  } else {
1120
1131
  return _promise.default.reject('Cannot make a request: No definition of XMLHttpRequest was found.');
1121
1132
  }
1122
1133
  },
1123
- downloadAjax: function (uri, options) {
1134
+ downloadAjax: function downloadAjax(uri, options) {
1124
1135
  return new _promise.default(function (resolve, reject) {
1125
1136
  var xhr = new XHR();
1126
1137
  xhr.open('GET', uri, true);
@@ -1150,7 +1161,7 @@ var DefaultController = {
1150
1161
  xhr.send();
1151
1162
  });
1152
1163
  },
1153
- deleteFile: function (name
1164
+ deleteFile: function deleteFile(name
1154
1165
  /*: string*/
1155
1166
  , options
1156
1167
  /*:: ?: FullOptions*/
@@ -1179,12 +1190,12 @@ var DefaultController = {
1179
1190
  }
1180
1191
  });
1181
1192
  },
1182
- _setXHR: function (xhr
1193
+ _setXHR: function _setXHR(xhr
1183
1194
  /*: any*/
1184
1195
  ) {
1185
1196
  XHR = xhr;
1186
1197
  },
1187
- _getXHR: function () {
1198
+ _getXHR: function _getXHR() {
1188
1199
  return XHR;
1189
1200
  }
1190
1201
  };
@@ -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
  };